diff --git a/CHANGELOG.md b/CHANGELOG.md index fd2bc968..69562602 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,39 @@ +4.1 + +- added support for command type requests with command specific metadata (commandName, commandArguments, commandArgumentsDefaults, commandOptions, commandOptionsDefaults, commandExitCode, commandOutput) +- added support for collecting executed artisan commands in Laravel integration +- added support for queue-job type requests with queue-job specific metadata (jobName, jobDescription, jobStatus, jobPayload, jobQueue, jobConnection, jobOptions) +- added support for collecting executed queue-jobs in Laravel integration (also supports Laravel Horizon) +- added support for test type requests with test specific metadata (testName, testStatus, testStatusMessage, testAsserts) +- added support for collecting test runs in Laravel integration using PHPunit +- added support for disabling collection of view data when collecting rendered views (new default is to collect views without data) +- added Twig data source using the built-in Twig profiler to collect more precise Twig profiling data +- added support for setting parent requests on requests +- improved collecting of database queries, cache queries, dispatched queue jobs and redis commands to also collect time +- improved the data sources filters api to allow multiple filter types +- improved collecting of Laravel views to use a separate data source +- improved Eloquent data source to have an additional "early" filter applied before the query is added to query counts +- improved Eloquent data source now passes raw stack trace as second argument to filters +- improved Laravel data source to work when response is not provided +- improved Laravel events data source to include Laravel namespace in the default ignored events +- improved Laravel views data source to strip view data prefixed with __ +- improved PHP data source to not set request time for cli commands +- improved serializer to ommit data below depth limit, support debugInfo, jsonSerialize and toArray methods (partially implemented by mahagr, thanks!) +- improved log to allow overriding serializer settings via context, no longer enabled toString by default +- improved Request class now has pre-populated request time on creation +- improved StackTrace helper with limit option, last method, fixed filter output keys +- improved Lumen queue and redis feature detection +- improved vanilla integration to allow manually sending the headers early (implemented by tminich, thanks!) +- fixed Symfony support, added support for latest Symfony 5.x and 4.x (reported by llaville, thanks!) +- removed dark theme for the web UI setting (now configurable in the Clockwork app itself) +- updated to Clockwork App 4.1 + +*BREAKING* + +- multiple new settings were added to the Laravel config file +- DataSourceInterface::reset method was added, default empty implementation is provided in the base DataSource class +- LaravelDataSource constructor arguments changed to reflect removing the views collecting support + 4.0.17 - improved performance and memory usage when doing file storage cleanup (reported by ikkez, thanks!) @@ -22,7 +58,6 @@ - fixed wrong stack traces skip namespaces defaults leading to wrong traces - fixed vanilla integration config file missing and no longer used settings - 4.0.12 - added a simple index file locking to the file storage diff --git a/Clockwork/Clockwork.php b/Clockwork/Clockwork.php index 92b53c91..c746b561 100644 --- a/Clockwork/Clockwork.php +++ b/Clockwork/Clockwork.php @@ -3,8 +3,10 @@ use Clockwork\Authentication\AuthenticatorInterface; use Clockwork\Authentication\NullAuthenticator; use Clockwork\DataSource\DataSourceInterface; +use Clockwork\Helpers\Serializer; use Clockwork\Request\Log; use Clockwork\Request\Request; +use Clockwork\Request\RequestType; use Clockwork\Request\Timeline; use Clockwork\Storage\StorageInterface; @@ -19,7 +21,7 @@ class Clockwork implements LoggerInterface /** * Clockwork version */ - const VERSION = '4.0.17'; + const VERSION = '4.1'; /** * Array of data sources, these objects provide data to be stored in a request object @@ -122,6 +124,58 @@ public function resolveRequest() return $this; } + // Resolve the current request as a "command" type request with command-specific data + public function resolveAsCommand($name, $exitCode = null, $arguments = [], $options = [], $argumentsDefaults = [], $optionsDefaults = [], $output = null) + { + $this->resolveRequest(); + + $this->request->type = RequestType::COMMAND; + $this->request->commandName = $name; + $this->request->commandArguments = $arguments; + $this->request->commandArgumentsDefaults = $argumentsDefaults; + $this->request->commandOptions = $options; + $this->request->commandOptionsDefaults = $optionsDefaults; + $this->request->commandExitCode = $exitCode; + $this->request->commandOutput = $output; + + return $this; + } + + // Resolve the current request as a "queue-job" type request with queue-job-specific data + public function resolveAsQueueJob($name, $description = null, $status = 'processed', $payload = [], $queue = null, $connection = null, $options = []) + { + $this->resolveRequest(); + + $this->request->type = RequestType::QUEUE_JOB; + $this->request->jobName = $name; + $this->request->jobDescription = $description; + $this->request->jobStatus = $status; + $this->request->jobPayload = (new Serializer)->normalize($payload); + $this->request->jobQueue = $queue; + $this->request->jobConnection = $connection; + $this->request->jobOptions = (new Serializer)->normalizeEach($options); + + return $this; + } + + // Resolve the current request as a "test" type request with test-specific data, accepts test name, status, status + // message in case of failure and array of ran asserts + public function resolveAsTest($name, $status = 'passed', $statusMessage = null, $asserts = []) + { + $this->resolveRequest(); + + $this->request->type = RequestType::TEST; + $this->request->testName = $name; + $this->request->testStatus = $status; + $this->request->testStatusMessage = $statusMessage; + + foreach ($asserts as $assert) { + $this->request->addTestAssert($assert['name'], $assert['arguments'], $assert['passed'], $assert['trace']); + } + + return $this; + } + // Extends the request with additional data form all data sources when being shown in the Clockwork app public function extendRequest(Request $request = null) { @@ -140,6 +194,19 @@ public function storeRequest() return $this->storage->store($this->request); } + // Reset the log, timeline and all data sources to an empty state, clearing any collected data + public function reset() + { + foreach ($this->dataSources as $dataSource) { + $dataSource->reset(); + } + + $this->log = new Log; + $this->timeline = new Timeline; + + return $this; + } + /** * Return the storage object */ diff --git a/Clockwork/DataSource/DBALDataSource.php b/Clockwork/DataSource/DBALDataSource.php index 88e458de..ce2e3150 100644 --- a/Clockwork/DataSource/DBALDataSource.php +++ b/Clockwork/DataSource/DBALDataSource.php @@ -180,7 +180,7 @@ public function stopQuery() { $duration = (microtime(true) - $this->start) * 1000; - $this->registerQuery($this->query['sql'], $this->query['params'], $duration, $this->connection->getDatabase()); + $this->registerQuery($this->query['sql'], $this->query['params'], $duration, $this->connection->getDatabase(), $this->start); if ($this->timeline !== null) { $this->timeline->endEvent(self::EVENT_NAME); @@ -190,13 +190,14 @@ public function stopQuery() /** * Log the query into the internal store */ - public function registerQuery($query, $bindings, $duration, $connection) + public function registerQuery($query, $bindings, $duration, $connection, $time) { $query = [ 'query' => $query, 'bindings' => $bindings, 'duration' => $duration, - 'connection' => $connection + 'connection' => $connection, + 'time' => $time ]; if ($this->passesFilters([ $query ])) { @@ -214,6 +215,15 @@ public function resolve(Request $request) return $request; } + // Reset the data source to an empty state, clearing any collected data + public function reset() + { + $this->queries = []; + + $this->start = null; + $this->query = null; + } + /** * Timeline Getter/Setter */ diff --git a/Clockwork/DataSource/DataSource.php b/Clockwork/DataSource/DataSource.php index ba74a43c..f6f7741e 100644 --- a/Clockwork/DataSource/DataSource.php +++ b/Clockwork/DataSource/DataSource.php @@ -24,10 +24,16 @@ public function extend(Request $request) return $request; } + // Reset the data source to an empty state, clearing any collected data + public function reset() + { + } + // Register a new filter - public function addFilter(\Closure $filter) + public function addFilter(\Closure $filter, $type = 'default') { - $this->filters[] = $filter; + $this->filters[$type] = isset($this->filters[$type]) + ? array_merge($this->filters[$type], [ $filter ]) : [ $filter ]; return $this; } @@ -41,9 +47,11 @@ public function clearFilters() } // Returns boolean whether the filterable passes all registered filters - protected function passesFilters($args) + protected function passesFilters($args, $type = 'default') { - foreach ($this->filters as $filter) { + $filters = isset($this->filters[$type]) ? $this->filters[$type] : []; + + foreach ($filters as $filter) { if (! call_user_func_array($filter, $args)) return false; } diff --git a/Clockwork/DataSource/DataSourceInterface.php b/Clockwork/DataSource/DataSourceInterface.php index 4ab6d582..b273bc49 100644 --- a/Clockwork/DataSource/DataSourceInterface.php +++ b/Clockwork/DataSource/DataSourceInterface.php @@ -14,4 +14,7 @@ public function resolve(Request $request); // Extends the request with additional data when being shown in the Clockwork app public function extend(Request $request); + + // Reset the data source to an empty state, clearing any collected data + public function reset(); } diff --git a/Clockwork/DataSource/EloquentDataSource.php b/Clockwork/DataSource/EloquentDataSource.php old mode 100755 new mode 100644 index fcb583e7..0a605b36 --- a/Clockwork/DataSource/EloquentDataSource.php +++ b/Clockwork/DataSource/EloquentDataSource.php @@ -28,18 +28,9 @@ class EloquentDataSource extends DataSource // Query counts by type protected $count = [ - 'total' => 0, - 'slow' => 0, - 'select' => 0, - 'insert' => 0, - 'update' => 0, - 'delete' => 0, - 'other' => 0 + 'total' => 0, 'slow' => 0, 'select' => 0, 'insert' => 0, 'update' => 0, 'delete' => 0, 'other' => 0 ]; - // Array of filter functions for collected queries - protected $filters = []; - // Whether we are collecting cache queries or stats only protected $collectQueries = true; @@ -105,6 +96,7 @@ public function registerQuery($event) 'query' => $this->createRunnableQuery($event->sql, $event->bindings, $event->connectionName), 'duration' => $event->time, 'connection' => $event->connectionName, + 'time' => microtime(true) - $event->time / 1000, 'trace' => $shortTrace = (new Serializer)->trace($trace), 'file' => isset($shortTrace[0]) ? $shortTrace[0]['file'] : null, 'line' => isset($shortTrace[0]) ? $shortTrace[0]['line'] : null, @@ -112,13 +104,15 @@ public function registerQuery($event) 'tags' => $this->slowThreshold !== null && $event->time > $this->slowThreshold ? [ 'slow' ] : [] ]; + $this->nextQueryModel = null; + + if (! $this->passesFilters([ $query, $trace ], 'early')) return; + $this->incrementQueryCount($query); - if ($this->collectQueries && $this->passesFilters([ $query ])) { - $this->queries[] = $query; - } + if (! $this->collectQueries || ! $this->passesFilters([ $query, $trace ])) return; - $this->nextQueryModel = null; + $this->queries[] = $query; } /** @@ -154,6 +148,18 @@ public function resolve(Request $request) return $request; } + // Reset the data source to an empty state, clearing any collected data + public function reset() + { + $this->queries = []; + + $this->count = [ + 'total' => 0, 'slow' => 0, 'select' => 0, 'insert' => 0, 'update' => 0, 'delete' => 0, 'other' => 0 + ]; + + $this->nextQueryModel = null; + } + /** * Takes a query, an array of bindings and the connection as arguments, returns runnable query with upper-cased keywords */ diff --git a/Clockwork/DataSource/LaravelCacheDataSource.php b/Clockwork/DataSource/LaravelCacheDataSource.php index 2f71ce7e..e85c3dca 100644 --- a/Clockwork/DataSource/LaravelCacheDataSource.php +++ b/Clockwork/DataSource/LaravelCacheDataSource.php @@ -23,10 +23,7 @@ class LaravelCacheDataSource extends DataSource // Query counts by type protected $count = [ - 'read' => 0, - 'hit' => 0, - 'write' => 0, - 'delete' => 0 + 'read' => 0, 'hit' => 0, 'write' => 0, 'delete' => 0 ]; // Whether we are collecting cache queries or stats only @@ -97,6 +94,16 @@ public function resolve(Request $request) return $request; } + // Reset the data source to an empty state, clearing any collected data + public function reset() + { + $this->queries = []; + + $this->count = [ + 'read' => 0, 'hit' => 0, 'write' => 0, 'delete' => 0 + ]; + } + /** * Registers a new query, resolves caller file and line no */ @@ -108,7 +115,7 @@ public function registerQuery(array $query) 'type' => $query['type'], 'key' => $query['key'], 'value' => isset($query['value']) ? (new Serializer)->normalize($query['value']) : null, - 'time' => null, + 'time' => microtime(true), 'connection' => null, 'trace' => $shortTrace = (new Serializer)->trace($trace), 'file' => isset($shortTrace[0]) ? $shortTrace[0]['file'] : null, diff --git a/Clockwork/DataSource/LaravelDataSource.php b/Clockwork/DataSource/LaravelDataSource.php index 800aaf6f..587fdf36 100644 --- a/Clockwork/DataSource/LaravelDataSource.php +++ b/Clockwork/DataSource/LaravelDataSource.php @@ -34,32 +34,22 @@ class LaravelDataSource extends DataSource */ protected $timeline; - /** - * Timeline data structure for views data - */ - protected $views; - // Whether we should collect log messages protected $collectLog = true; - // Whether we should collect views - protected $collectViews = false; - // Whether we should collect routes protected $collectRoutes = false; /** * Create a new data source, takes Laravel application instance as an argument */ - public function __construct(Application $app, $collectLog = true, $collectViews = false, $collectRoutes = false) + public function __construct(Application $app, $collectLog = true, $collectRoutes = false) { $this->app = $app; $this->collectLog = $collectLog; - $this->collectViews = $collectViews; $this->collectRoutes = $collectRoutes; $this->timeline = new Timeline(); - $this->views = new Timeline(); } /** @@ -80,11 +70,17 @@ public function resolve(Request $request) $this->resolveAuthenticatedUser($request); $request->timelineData = $this->timeline->finalize($request->time); - $request->viewsData = $this->views->finalize(); return $request; } + // Reset the data source to an empty state, clearing any collected data + public function reset() + { + $this->timeline = new Timeline; + $this->views = new Timeline; + } + // Set a log instance public function setLog(Log $log) { @@ -126,26 +122,6 @@ public function listenToEvents() }); } } - - if ($this->collectViews) { - $this->app['events']->listen('composing:*', function ($view, $data = null) { - if (is_string($view) && is_array($data)) { // Laravel 5.4 wildcard event - $view = $data[0]; - } - - $time = microtime(true); - $data = $view->getData(); - unset($data['__env']); - - $this->views->addEvent( - 'view ' . $view->getName(), - 'Rendering a view', - $time, - $time, - [ 'name' => $view->getName(), 'data' => (new Serializer)->normalize($data) ] - ); - }); - } } /** @@ -231,7 +207,7 @@ protected function getRequestUri() */ protected function getResponseStatus() { - return $this->response->getStatusCode(); + return $this->response ? $this->response->getStatusCode() : null; } // Return array of middleware for the matched route diff --git a/Clockwork/DataSource/LaravelEventsDataSource.php b/Clockwork/DataSource/LaravelEventsDataSource.php index 1f7941ca..0f3276b7 100644 --- a/Clockwork/DataSource/LaravelEventsDataSource.php +++ b/Clockwork/DataSource/LaravelEventsDataSource.php @@ -49,6 +49,12 @@ public function resolve(Request $request) return $request; } + // Reset the data source to an empty state, clearing any collected data + public function reset() + { + $this->events = []; + } + // Registers a new event, prepares data for serialization and resolves registered listeners protected function registerEvent($event, array $data) { @@ -119,6 +125,7 @@ protected function defaultIgnoredEvents() { return [ 'Illuminate\\\\.+', + 'Laravel\\\\.+', 'auth\.(?:attempt|login|logout)', 'artisan\.start', 'bootstrapped:.+', diff --git a/Clockwork/DataSource/LaravelQueueDataSource.php b/Clockwork/DataSource/LaravelQueueDataSource.php index 7f2c9596..c0986df5 100644 --- a/Clockwork/DataSource/LaravelQueueDataSource.php +++ b/Clockwork/DataSource/LaravelQueueDataSource.php @@ -21,6 +21,9 @@ class LaravelQueueDataSource extends DataSource */ protected $jobs = []; + // Clockwork ID of the current request + protected $currentRequestId; + /** * Create a new data source instance, takes an event dispatcher as argument */ @@ -36,15 +39,17 @@ public function listenToEvents() { $this->queue->createPayloadUsing(function ($connection, $queue, $payload) { $this->registerJob([ + 'id' => $id = (new Request)->id, 'connection' => $connection, 'queue' => $queue, 'name' => $payload['displayName'], 'data' => isset($payload['data']['command']) ? $payload['data']['command'] : null, 'maxTries' => $payload['maxTries'], - 'timeout' => $payload['timeout'] + 'timeout' => $payload['timeout'], + 'time' => microtime(true) ]); - return []; + return [ 'clockwork_id' => $id, 'clockwork_parent_id' => $this->currentRequestId ]; }); } @@ -58,6 +63,19 @@ public function resolve(Request $request) return $request; } + // Reset the data source to an empty state, clearing any collected data + public function reset() + { + $this->jobs = []; + } + + // Set Clockwork ID of the current request + public function setCurrentRequestId($requestId) + { + $this->currentRequestId = $requestId; + return $this; + } + /** * Registers a new queue job, resolves caller file and line no */ diff --git a/Clockwork/DataSource/LaravelRedisDataSource.php b/Clockwork/DataSource/LaravelRedisDataSource.php index cb7487f2..26c2fded 100644 --- a/Clockwork/DataSource/LaravelRedisDataSource.php +++ b/Clockwork/DataSource/LaravelRedisDataSource.php @@ -49,7 +49,8 @@ public function listenToEvents() 'command' => $event->command, 'parameters' => $event->parameters, 'duration' => $event->time, - 'connection' => $event->connectionName + 'connection' => $event->connectionName, + 'time' => microtime(true) - $event->time / 1000 ]); }); } @@ -64,6 +65,12 @@ public function resolve(Request $request) return $request; } + // Reset the data source to an empty state, clearing any collected data + public function reset() + { + $this->commands = []; + } + /** * Registers a new command, resolves caller file and line no */ diff --git a/Clockwork/DataSource/LaravelViewsDataSource.php b/Clockwork/DataSource/LaravelViewsDataSource.php new file mode 100644 index 00000000..5edcec79 --- /dev/null +++ b/Clockwork/DataSource/LaravelViewsDataSource.php @@ -0,0 +1,64 @@ +dispatcher = $dispatcher; + $this->collectData = $collectData; + + $this->views = new Timeline; + } + + // Adds rendered views to the request + public function resolve(Request $request) + { + $request->viewsData = array_merge($request->viewsData, $this->views->finalize()); + + return $request; + } + + // Start listening to the events + public function listenToEvents() + { + $this->dispatcher->listen('composing:*', function ($view, $data = null) { + if (is_string($view) && is_array($data)) { // Laravel 5.4 wildcard event + $view = $data[0]; + } + + $data = array_filter( + $this->collectData ? $view->getData() : [], + function ($v, $k) { return strpos($k, '__') !== 0; }, + \ARRAY_FILTER_USE_BOTH + ); + + $this->views->addEvent( + 'view ' . $view->getName(), + 'Rendering a view', + $time = microtime(true), + $time, + [ 'name' => $view->getName(), 'data' => (new Serializer)->normalize($data) ] + ); + }); + } +} diff --git a/Clockwork/DataSource/LumenDataSource.php b/Clockwork/DataSource/LumenDataSource.php index ffc9d161..008aca52 100644 --- a/Clockwork/DataSource/LumenDataSource.php +++ b/Clockwork/DataSource/LumenDataSource.php @@ -83,6 +83,13 @@ public function resolve(Request $request) return $request; } + // Reset the data source to an empty state, clearing any collected data + public function reset() + { + $this->timeline = new Timeline; + $this->views = new Timeline; + } + // Set a log instance public function setLog(Log $log) { diff --git a/Clockwork/DataSource/PhpDataSource.php b/Clockwork/DataSource/PhpDataSource.php index 3cb3a967..1e55706f 100644 --- a/Clockwork/DataSource/PhpDataSource.php +++ b/Clockwork/DataSource/PhpDataSource.php @@ -15,7 +15,7 @@ class PhpDataSource extends DataSource */ public function resolve(Request $request) { - $request->time = $this->getRequestTime(); + $request->time = PHP_SAPI !== 'cli' ? $this->getRequestTime() : $request->time; $request->method = $this->getRequestMethod(); $request->url = $this->getRequestUrl(); $request->uri = $this->getRequestUri(); diff --git a/Clockwork/DataSource/SwiftDataSource.php b/Clockwork/DataSource/SwiftDataSource.php index 04ec4613..d4d0d3f3 100644 --- a/Clockwork/DataSource/SwiftDataSource.php +++ b/Clockwork/DataSource/SwiftDataSource.php @@ -35,4 +35,10 @@ public function resolve(Request $request) return $request; } + + // Reset the data source to an empty state, clearing any collected data + public function reset() + { + $this->timeline = new Timeline; + } } diff --git a/Clockwork/DataSource/TwigDataSource.php b/Clockwork/DataSource/TwigDataSource.php new file mode 100644 index 00000000..5d82dc0c --- /dev/null +++ b/Clockwork/DataSource/TwigDataSource.php @@ -0,0 +1,46 @@ +twig = $twig; + } + + // Register the Twig profiler extension + public function listenToEvents() + { + $this->twig->addExtension(new Twig_Extension_Profiler($this->profile = new Twig_Profiler_Profile)); + } + + /** + * Adds email data to the request + */ + public function resolve(Request $request) + { + $timeline = (new ProfilerClockworkDumper)->dump($this->profile); + + $request->viewsData = array_merge($request->viewsData, $timeline->finalize()); + + return $request; + } +} diff --git a/Clockwork/Helpers/Serializer.php b/Clockwork/Helpers/Serializer.php index 6f037890..6575db16 100644 --- a/Clockwork/Helpers/Serializer.php +++ b/Clockwork/Helpers/Serializer.php @@ -12,7 +12,10 @@ class Serializer \Laravel\Lumen\Application::class ], 'limit' => 10, + 'toArray' => false, 'toString' => false, + 'debugInfo' => true, + 'jsonSerialize' => false, 'traces' => true, 'tracesFilter' => null, 'tracesSkip' => null, @@ -36,45 +39,48 @@ public function normalize($data, $context = null, $limit = null) if ($context === null) $context = [ 'references' => [] ]; if ($limit === null) $limit = $this->options['limit']; - if ($limit < 1) return $data; + if (is_array($data)) { + if ($limit === 0) return [ '__type__' => 'array', '__omitted__' => 'limit' ]; - if ($data instanceof \Closure) { - return [ '__type__' => 'anonymous function' ]; - } elseif (is_array($data)) { - return [ '__type__' => 'array' ] + array_map(function ($item) use ($context, $limit) { - return $this->normalize($item, $context, $limit - 1); - }, $data); + return [ '__type__' => 'array' ] + $this->normalizeEach($data, $context, $limit - 1); } elseif (is_object($data)) { - if ($this->options['toString'] && method_exists($data, '__toString')) { - return (string) $data; - } + if ($data instanceof \Closure) return [ '__type__' => 'anonymous function' ]; $className = get_class($data); $objectHash = spl_object_hash($data); - if (isset($context['references'][$objectHash])) { - return [ '__type__' => 'recursion' ]; - } + if ($limit === 0) return [ '__class__' => $className, '__omitted__' => 'limit' ]; + + if (isset($context['references'][$objectHash])) return [ '__type__' => 'recursion' ]; $context['references'][$objectHash] = true; - if (isset($this->cache[$objectHash])) { - return $this->cache[$objectHash]; - } + if (isset($this->cache[$objectHash])) return $this->cache[$objectHash]; if ($this->options['blackbox'] && in_array($className, $this->options['blackbox'])) { - return $this->cache[$objectHash] = [ '__class__' => $className ]; + return $this->cache[$objectHash] = [ '__class__' => $className, '__omitted__' => 'blackbox' ]; + } elseif ($this->options['toString'] && method_exists($data, '__toString')) { + return $this->cache[$objectHash] = (string) $data; + } + + if ($this->options['debugInfo'] && method_exists($data, '__debugInfo')) { + $data = (array) $data->__debugInfo(); + } elseif ($this->options['jsonSerialize'] && method_exists($data, 'jsonSerialize')) { + $data = (array) $data->jsonSerialize(); + } elseif ($this->options['toArray'] && method_exists($data, 'toArray')) { + $data = (array) $data->toArray(); + } else { + $data = (array) $data; } - $data = (array) $data; - $data = array_column(array_map(function ($key, $item) use ($className, $context, $limit) { - return [ + $data = array_combine( + array_map(function ($key) { // replace null-byte prefixes of protected and private properties used by php with * (protected) // and ~ (private) - preg_replace('/^\0.+?\0/', '~', str_replace("\0*\0", '*', $key)), - $this->normalize($item, $context, $limit - 1) - ]; - }, array_keys($data), $data), 1, 0); + return preg_replace('/^\0.+?\0/', '~', str_replace("\0*\0", '*', $key)); + }, array_keys($data)), + $this->normalizeEach($data, $context, $limit - 1) + ); return $this->cache[$objectHash] = [ '__class__' => $className ] + $data; } elseif (is_resource($data)) { @@ -85,8 +91,10 @@ public function normalize($data, $context = null, $limit = null) } // normalize each member of an array (doesn't add metadata for top level) - public function normalizeEach($data) { - return array_map(function ($item) { return $this->normalize($item); }, $data); + public function normalizeEach($data, $context = null, $limit = null) { + return array_map(function ($item) use ($context, $limit) { + return $this->normalize($item, $context, $limit); + }, $data); } public function trace(StackTrace $trace) diff --git a/Clockwork/Helpers/StackTrace.php b/Clockwork/Helpers/StackTrace.php index 72957a4d..e38d3bad 100644 --- a/Clockwork/Helpers/StackTrace.php +++ b/Clockwork/Helpers/StackTrace.php @@ -13,8 +13,9 @@ public static function get($options = []) { $backtraceOptions = isset($options['arguments']) ? DEBUG_BACKTRACE_PROVIDE_OBJECT : DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS; + $limit = isset($options['limit']) ? $options['limit'] : 0; - return static::from(debug_backtrace($backtraceOptions)); + return static::from(debug_backtrace($backtraceOptions, $limit)); } public static function from(array $trace) @@ -52,11 +53,22 @@ public function first($filter = null) } } + public function last($filter = null) + { + if (! $filter) return $this->frames[count($this->frames) - 1]; + + if ($filter instanceof StackFilter) $filter = $filter->closure(); + + foreach (array_reverse($this->frames) as $frame) { + if ($filter($frame)) return $frame; + } + } + public function filter($filter = null) { if ($filter instanceof StackFilter) $filter = $filter->closure(); - return $this->copy(array_filter($this->frames, $filter)); + return $this->copy(array_values(array_filter($this->frames, $filter))); } public function skip($count = null) diff --git a/Clockwork/Request/Log.php b/Clockwork/Request/Log.php index 054c226f..3aa6f33c 100644 --- a/Clockwork/Request/Log.php +++ b/Clockwork/Request/Log.php @@ -18,7 +18,7 @@ class Log extends AbstractLogger public $data = []; /** - * Add a new timestamped message, with a level and context, + * Add a new timestamped message, with a level and context, context can be used to override serializer defaults * $context['trace'] = true can be used to force collecting a stack trace */ public function log($level = LogLevel::INFO, $message, array $context = []) @@ -26,7 +26,7 @@ public function log($level = LogLevel::INFO, $message, array $context = []) $trace = $this->hasTrace($context) ? $context['trace'] : StackTrace::get()->resolveViewName(); $this->data[] = [ - 'message' => (new Serializer([ 'toString' => true ]))->normalize($message), + 'message' => (new Serializer($context))->normalize($message), 'exception' => $this->formatException($context), 'context' => $this->formatContext($context), 'level' => $level, diff --git a/Clockwork/Request/Request.php b/Clockwork/Request/Request.php index faee1f18..01b9726c 100644 --- a/Clockwork/Request/Request.php +++ b/Clockwork/Request/Request.php @@ -17,6 +17,9 @@ class Request */ public $version = 1; + // Request type + public $type = 'request'; + /** * Request time */ @@ -185,18 +188,74 @@ class Request public $xdebug = []; + // Command name + public $commandName; + + // Command arguments passed in + public $commandArguments = []; + + // Command arguments defaults + public $commandArgumentsDefaults = []; + + // Command options passed in + public $commandOptions = []; + + // Command options defaults + public $commandOptionsDefaults = []; + + // Command exit code + public $commandExitCode; + + // Command output + public $commandOutput; + + // Queue job name + public $jobName; + + // Queue job description + public $jobDescription; + + // Queue job status + public $jobStatus; + + // Queue job payload + public $jobPayload = []; + + // Queue job queue name + public $jobQueue; + + // Queue job connection name + public $jobConnection; + + // Queue job additional options + public $jobOptions = []; + + // Test name + public $testName; + + // Test status + public $testStatus; + + // Test status message (eg. in case of failure) + public $testStatusMessage; + + // Ran test asserts + public $testAsserts = []; + + // Parent request + public $parent; + /** * Create a new request, if optional data array argument is provided, it will be used to populate the request object, * otherwise empty request with autogenerated ID will be created */ - public function __construct(array $data = null) + public function __construct(array $data = []) { - if ($data) { - foreach ($data as $key => $val) { - $this->$key = $val; - } - } else { - $this->id = $this->generateRequestId(); + $this->id = isset($data['id']) ? $data['id'] : $this->generateRequestId(); + $this->time = microtime(true); + + foreach ($data as $key => $val) { + $this->$key = $val; } } @@ -224,53 +283,73 @@ public function getResponseDuration() public function toArray() { return [ - 'id' => $this->id, - 'version' => $this->version, - 'time' => $this->time, - 'method' => $this->method, - 'url' => $this->url, - 'uri' => $this->uri, - 'headers' => $this->headers, - 'controller' => $this->controller, - 'getData' => $this->getData, - 'postData' => $this->postData, - 'requestData' => $this->requestData, - 'sessionData' => $this->sessionData, - 'authenticatedUser' => $this->authenticatedUser, - 'cookies' => $this->cookies, - 'responseTime' => $this->responseTime, - 'responseStatus' => $this->responseStatus, - 'responseDuration' => $this->responseDuration ?: $this->getResponseDuration(), - 'memoryUsage' => $this->memoryUsage, - 'middleware' => $this->middleware, - 'databaseQueries' => $this->databaseQueries, - 'databaseQueriesCount' => $this->databaseQueriesCount, - 'databaseSlowQueries' => $this->databaseSlowQueries, - 'databaseSelects' => $this->databaseSelects, - 'databaseInserts' => $this->databaseInserts, - 'databaseUpdates' => $this->databaseUpdates, - 'databaseDeletes' => $this->databaseDeletes, - 'databaseOthers' => $this->databaseOthers, - 'databaseDuration' => $this->getDatabaseDuration(), - 'cacheQueries' => $this->cacheQueries, - 'cacheReads' => $this->cacheReads, - 'cacheHits' => $this->cacheHits, - 'cacheWrites' => $this->cacheWrites, - 'cacheDeletes' => $this->cacheDeletes, - 'cacheTime' => $this->cacheTime, - 'redisCommands' => $this->redisCommands, - 'queueJobs' => $this->queueJobs, - 'timelineData' => $this->timelineData, - 'log' => array_values($this->log), - 'events' => $this->events, - 'routes' => $this->routes, - 'emailsData' => $this->emailsData, - 'viewsData' => $this->viewsData, - 'userData' => array_map(function ($data) { + 'id' => $this->id, + 'version' => $this->version, + 'type' => $this->type, + 'time' => $this->time, + 'method' => $this->method, + 'url' => $this->url, + 'uri' => $this->uri, + 'headers' => $this->headers, + 'controller' => $this->controller, + 'getData' => $this->getData, + 'postData' => $this->postData, + 'requestData' => $this->requestData, + 'sessionData' => $this->sessionData, + 'authenticatedUser' => $this->authenticatedUser, + 'cookies' => $this->cookies, + 'responseTime' => $this->responseTime, + 'responseStatus' => $this->responseStatus, + 'responseDuration' => $this->responseDuration ?: $this->getResponseDuration(), + 'memoryUsage' => $this->memoryUsage, + 'middleware' => $this->middleware, + 'databaseQueries' => $this->databaseQueries, + 'databaseQueriesCount' => $this->databaseQueriesCount, + 'databaseSlowQueries' => $this->databaseSlowQueries, + 'databaseSelects' => $this->databaseSelects, + 'databaseInserts' => $this->databaseInserts, + 'databaseUpdates' => $this->databaseUpdates, + 'databaseDeletes' => $this->databaseDeletes, + 'databaseOthers' => $this->databaseOthers, + 'databaseDuration' => $this->getDatabaseDuration(), + 'cacheQueries' => $this->cacheQueries, + 'cacheReads' => $this->cacheReads, + 'cacheHits' => $this->cacheHits, + 'cacheWrites' => $this->cacheWrites, + 'cacheDeletes' => $this->cacheDeletes, + 'cacheTime' => $this->cacheTime, + 'redisCommands' => $this->redisCommands, + 'queueJobs' => $this->queueJobs, + 'timelineData' => $this->timelineData, + 'log' => array_values($this->log), + 'events' => $this->events, + 'routes' => $this->routes, + 'emailsData' => $this->emailsData, + 'viewsData' => $this->viewsData, + 'userData' => array_map(function ($data) { return $data instanceof UserData ? $data->toArray() : $data; }, $this->userData), - 'subrequests' => $this->subrequests, - 'xdebug' => $this->xdebug + 'subrequests' => $this->subrequests, + 'xdebug' => $this->xdebug, + 'commandName' => $this->commandName, + 'commandArguments' => $this->commandArguments, + 'commandArgumentsDefaults' => $this->commandArgumentsDefaults, + 'commandOptions' => $this->commandOptions, + 'commandOptionsDefaults' => $this->commandOptionsDefaults, + 'commandExitCode' => $this->commandExitCode, + 'commandOutput' => $this->commandOutput, + 'jobName' => $this->jobName, + 'jobDescription' => $this->jobDescription, + 'jobStatus' => $this->jobStatus, + 'jobPayload' => $this->jobPayload, + 'jobQueue' => $this->jobQueue, + 'jobConnection' => $this->jobConnection, + 'jobOptions' => $this->jobOptions, + 'testName' => $this->testName, + 'testStatus' => $this->testStatus, + 'testStatusMessage' => $this->testStatusMessage, + 'testAsserts' => $this->testAsserts, + 'parent' => $this->parent ]; } @@ -288,7 +367,7 @@ public function addDatabaseQuery($query, $bindings = [], $duration = null, $data { $this->databaseQueries[] = [ 'query' => $query, - 'bindings' => $bindings, + 'bindings' => (new Serializer)->normalize($bindings), 'duration' => $duration, 'connection' => isset($data['connection']) ? $data['connection'] : null, 'file' => isset($data['file']) ? $data['file'] : null, @@ -373,7 +452,7 @@ public function addView($name, $data = []) ]; } - // Add executed subrequest, takes the requested url, suvrequest Clockwork ID and additional data - path if non-default + // Add executed subrequest, takes the requested url, subrequest Clockwork ID and additional data - path if non-default public function addSubrequest($url, $id, $data = []) { $this->subrequests[] = [ @@ -393,6 +472,16 @@ public function setAuthenticatedUser($username, $id = null, $data = []) ]; } + // Set parent request, takes the request id and additional options - url and path if non-default + public function setParent($id, $data = []) + { + $this->parent = [ + 'id' => $id, + 'url' => isset($data['url']) ? $data['url'] : null, + 'path' => isset($data['path']) ? $data['path'] : null + ]; + } + // Add custom user data (presented as additional tabs in the official app) public function userData($key = null) { @@ -405,6 +494,17 @@ public function userData($key = null) return $key ? $this->userData[$key] = $userData : $this->userData[] = $userData; } + // Add a ran test assert, takes the assert name, arguments, whether it passed and trace as arguments + public function addTestAssert($name, $arguments = null, $passed = true, $trace = null) + { + $this->testAsserts[] = [ + 'name' => $name, + 'arguments' => (new Serializer)->normalize($arguments), + 'trace' => $trace, + 'passed' => $passed + ]; + } + /** * Generate unique request ID in form - */ diff --git a/Clockwork/Request/RequestType.php b/Clockwork/Request/RequestType.php new file mode 100644 index 00000000..aad30e6e --- /dev/null +++ b/Clockwork/Request/RequestType.php @@ -0,0 +1,10 @@ +path}/index", 'a'); flock($handle, LOCK_EX); + if ($request->type == 'command') { + $nameField = 'commandName'; + } elseif ($request->type == 'queue-job') { + $nameField = 'jobName'; + } elseif ($request->type == 'test') { + $nameField = 'testName'; + } else { + $nameField = 'uri'; + } + fputcsv($handle, [ $request->id, $request->time, $request->method, - $request->uri, + $request->$nameField, $request->controller, $request->responseStatus, - $request->getResponseDuration() + $request->getResponseDuration(), + $request->type ]); flock($handle, LOCK_UN); diff --git a/Clockwork/Storage/Search.php b/Clockwork/Storage/Search.php index 02a901ee..00ece3e3 100644 --- a/Clockwork/Storage/Search.php +++ b/Clockwork/Storage/Search.php @@ -1,6 +1,7 @@ $condition = isset($search[$condition]) ? $search[$condition] : []; } @@ -33,7 +36,21 @@ public static function fromRequest($data = []) public function matches(Request $request) { - return $this->matchesString($this->uri, $request->uri) + if ($request->type == RequestType::COMMAND) { + return $this->matchesCommand($request); + } elseif ($request->type == RequestType::QUEUE_JOB) { + return $this->matchesQueueJob($request); + } elseif ($request->type == RequestType::TEST) { + return $this->matchesTest($request); + } else { + return $this->matchesRequest($request); + } + } + + protected function matchesRequest(Request $request) + { + return $this->matchesString($this->type, RequestType::REQUEST) + && $this->matchesString($this->uri, $request->uri) && $this->matchesString($this->controller, $request->controller) && $this->matchesExact($this->method, strtolower($request->method)) && $this->matchesNumber($this->status, $request->responseStatus) @@ -41,10 +58,37 @@ public function matches(Request $request) && $this->matchesDate($this->received, $request->time); } + protected function matchesCommand(Request $request) + { + return $this->matchesString($this->type, RequestType::COMMAND) + && $this->matchesString($this->name, $request->commandName) + && $this->matchesNumber($this->status, $request->commandExitCode) + && $this->matchesNumber($this->time, $request->responseDuration) + && $this->matchesDate($this->received, $request->time); + } + + protected function matchesQueueJob(Request $request) + { + return $this->matchesString($this->type, RequestType::QUEUE_JOB) + && $this->matchesString($this->name, $request->jobName) + && $this->matchesString($this->status, $request->jobStatus) + && $this->matchesNumber($this->time, $request->responseDuration) + && $this->matchesDate($this->received, $request->time); + } + + protected function matchesTest(Request $request) + { + return $this->matchesString($this->type, RequestType::TEST) + && $this->matchesString($this->name, $request->testName) + && $this->matchesString($this->status, $request->testStatus) + && $this->matchesNumber($this->time, $request->responseDuration) + && $this->matchesDate($this->received, $request->time); + } + public function isEmpty() { return ! count($this->uri) && ! count($this->controller) && ! count($this->method) && ! count($this->status) - && ! count($this->time) && ! count($this->received); + && ! count($this->time) && ! count($this->received) && ! count($this->name) && ! count($this->type); } public function isNotEmpty() diff --git a/Clockwork/Storage/SqlSearch.php b/Clockwork/Storage/SqlSearch.php index f0500566..cd456e9d 100644 --- a/Clockwork/Storage/SqlSearch.php +++ b/Clockwork/Storage/SqlSearch.php @@ -37,12 +37,13 @@ protected function resolveConditions() if ($this->isEmpty()) return [ [], [] ]; $conditions = array_filter([ - $this->resolveStringCondition('uri', $this->uri), - $this->resolveStringCondition('controller', $this->controller), - $this->resolveExactCondition('method', $this->method), - $this->resolveNumberCondition('responseStatus', $this->status), - $this->resolveNumberCondition('responseDuration', $this->time), - $this->resolveDateCondition('time', $this->received) + $this->resolveStringCondition([ 'type' ], $this->type), + $this->resolveStringCondition([ 'uri', 'commandName', 'jobName', 'testName' ], array_merge($this->uri, $this->name)), + $this->resolveStringCondition([ 'controller' ], $this->controller), + $this->resolveExactCondition([ 'method' ], $this->method), + $this->resolveNumberCondition([ 'responseStatus', 'commandExitCode', 'jobStatus', 'testStatus' ], $this->status), + $this->resolveNumberCondition([ 'responseDuration' ], $this->time), + $this->resolveDateCondition([ 'time' ], $this->received) ]); $sql = array_map(function ($condition) { return $condition[0]; }, $conditions); @@ -53,71 +54,79 @@ protected function resolveConditions() return [ $sql, $bindings ]; } - protected function resolveDateCondition($field, $inputs) + protected function resolveDateCondition($fields, $inputs) { if (! count($inputs)) return null; $bindings = []; - $conditions = implode(' OR ', array_map(function ($input, $index) use ($field, &$bindings) { - if (preg_match('/^<(.+)$/', $input, $match)) { - $bindings["{$field}{$index}"] = $match[1]; - return "{$field} < :{$field}{$index}"; - } elseif (preg_match('/^>(.+)$/', $input, $match)) { - $bindings["{$field}{$index}"] = $match[1]; - return "{$field} > :{$field}{$index}"; - } - }, $inputs, array_keys($inputs))); + $conditions = implode(' OR ', array_map(function ($field) use ($inputs, &$bindings) { + return implode(' OR ', array_map(function ($input, $index) use ($field, &$bindings) { + if (preg_match('/^<(.+)$/', $input, $match)) { + $bindings["{$field}{$index}"] = $match[1]; + return "{$field} < :{$field}{$index}"; + } elseif (preg_match('/^>(.+)$/', $input, $match)) { + $bindings["{$field}{$index}"] = $match[1]; + return "{$field} > :{$field}{$index}"; + } + }, $inputs, array_keys($inputs))); + }, $fields)); return [ "({$conditions})", $bindings ]; } - protected function resolveExactCondition($field, $inputs) + protected function resolveExactCondition($fields, $inputs) { if (! count($inputs)) return null; $bindings = []; - $values = implode(', ', array_map(function ($input, $index) use ($field, &$bindings) { - $bindings["{$field}{$index}"] = $input; - return ":{$field}{$index}"; - }, $inputs, array_keys($inputs))); + $values = implode(' OR ', array_map(function ($field) use ($inputs, &$bindings) { + return implode(', ', array_map(function ($input, $index) use ($field, &$bindings) { + $bindings["{$field}{$index}"] = $input; + return ":{$field}{$index}"; + }, $inputs, array_keys($inputs))); + }, $fields)); return [ "{$field} IN ({$values})", $bindings ]; } - protected function resolveNumberCondition($field, $inputs) + protected function resolveNumberCondition($fields, $inputs) { if (! count($inputs)) return null; $bindings = []; - $conditions = implode(' OR ', array_map(function ($input, $index) use ($field, &$bindings) { - if (preg_match('/^<(\d+(?:\.\d+)?)$/', $input, $match)) { - $bindings["{$field}{$index}"] = $match[1]; - return "{$field} < :{$field}{$index}"; - } elseif (preg_match('/^>(\d+(?:\.\d+)?)$/', $input, $match)) { - $bindings["{$field}{$index}"] = $match[1]; - return "{$field} > :{$field}{$index}"; - } elseif (preg_match('/^(\d+(?:\.\d+)?)-(\d+(?:\.\d+)?)$/', $input, $match)) { - $bindings["{$field}{$index}from"] = $match[1]; - $bindings["{$field}{$index}to"] = $match[2]; - return "({$field} > :{$field}{$index}from AND {$field} < :{$field}{$index}to)"; - } else { - $bindings["{$field}{$index}"] = $input; - return "{$field} = :{$field}{$index}"; - } - }, $inputs, array_keys($inputs))); + $conditions = implode(' OR ', array_map(function ($field) use ($inputs, &$bindings) { + return implode(' OR ', array_map(function ($input, $index) use ($field, &$bindings) { + if (preg_match('/^<(\d+(?:\.\d+)?)$/', $input, $match)) { + $bindings["{$field}{$index}"] = $match[1]; + return "{$field} < :{$field}{$index}"; + } elseif (preg_match('/^>(\d+(?:\.\d+)?)$/', $input, $match)) { + $bindings["{$field}{$index}"] = $match[1]; + return "{$field} > :{$field}{$index}"; + } elseif (preg_match('/^(\d+(?:\.\d+)?)-(\d+(?:\.\d+)?)$/', $input, $match)) { + $bindings["{$field}{$index}from"] = $match[1]; + $bindings["{$field}{$index}to"] = $match[2]; + return "({$field} > :{$field}{$index}from AND {$field} < :{$field}{$index}to)"; + } else { + $bindings["{$field}{$index}"] = $input; + return "{$field} = :{$field}{$index}"; + } + }, $inputs, array_keys($inputs))); + }, $fields)); return [ "({$conditions})", $bindings ]; } - protected function resolveStringCondition($field, $inputs) + protected function resolveStringCondition($fields, $inputs) { if (! count($inputs)) return null; $bindings = []; - $conditions = implode(' OR ', array_map(function ($input, $index) use ($field, &$bindings) { - $bindings["{$field}{$index}"] = $input; - return "{$field} LIKE :{$field}{$index}"; - }, $inputs, array_keys($inputs))); + $conditions = implode(' OR ', array_map(function ($field) use ($inputs, &$bindings) { + return implode(' OR ', array_map(function ($input, $index) use ($field, &$bindings) { + $bindings["{$field}{$index}"] = $input; + return "{$field} LIKE :{$field}{$index}"; + }, $inputs, array_keys($inputs))); + }, $fields)); return [ "({$conditions})", $bindings ]; } diff --git a/Clockwork/Storage/SqlStorage.php b/Clockwork/Storage/SqlStorage.php index cc3fb703..75172393 100644 --- a/Clockwork/Storage/SqlStorage.php +++ b/Clockwork/Storage/SqlStorage.php @@ -21,58 +21,79 @@ class SqlStorage extends Storage // Schema for the Clockwork requests table protected $fields = [ - 'id' => 'VARCHAR(100) PRIMARY KEY', - 'version' => 'INTEGER', - 'time' => 'DOUBLE PRECISION NULL', - 'method' => 'VARCHAR(10) NULL', - 'url' => 'TEXT NULL', - 'uri' => 'TEXT NULL', - 'headers' => 'TEXT NULL', - 'controller' => 'VARCHAR(250) NULL', - 'getData' => 'TEXT NULL', - 'postData' => 'TEXT NULL', - 'requestData' => 'TEXT NULL', - 'sessionData' => 'TEXT NULL', - 'authenticatedUser' => 'TEXT NULL', - 'cookies' => 'TEXT NULL', - 'responseTime' => 'DOUBLE PRECISION NULL', - 'responseStatus' => 'INTEGER NULL', - 'responseDuration' => 'DOUBLE PRECISION NULL', - 'memoryUsage' => 'DOUBLE PRECISION NULL', - 'middleware' => 'TEXT NULL', - 'databaseQueries' => 'TEXT NULL', - 'databaseQueriesCount' => 'INTEGER NULL', - 'databaseSlowQueries' => 'INTEGER NULL', - 'databaseSelects' => 'INTEGER NULL', - 'databaseInserts' => 'INTEGER NULL', - 'databaseUpdates' => 'INTEGER NULL', - 'databaseDeletes' => 'INTEGER NULL', - 'databaseOthers' => 'INTEGER NULL', - 'databaseDuration' => 'DOUBLE PRECISION NULL', - 'cacheQueries' => 'TEXT NULL', - 'cacheReads' => 'INTEGER NULL', - 'cacheHits' => 'INTEGER NULL', - 'cacheWrites' => 'INTEGER NULL', - 'cacheDeletes' => 'INTEGER NULL', - 'cacheTime' => 'DOUBLE PRECISION NULL', - 'redisCommands' => 'TEXT NULL', - 'queueJobs' => 'TEXT NULL', - 'timelineData' => 'TEXT NULL', - 'log' => 'TEXT NULL', - 'events' => 'TEXT NULL', - 'routes' => 'TEXT NULL', - 'emailsData' => 'TEXT NULL', - 'viewsData' => 'TEXT NULL', - 'userData' => 'TEXT NULL', - 'subrequests' => 'TEXT NULL', - 'xdebug' => 'TEXT NULL' + 'id' => 'VARCHAR(100) PRIMARY KEY', + 'version' => 'INTEGER', + 'type' => 'VARCHAR(100) NULL', + 'time' => 'DOUBLE PRECISION NULL', + 'method' => 'VARCHAR(10) NULL', + 'url' => 'TEXT NULL', + 'uri' => 'TEXT NULL', + 'headers' => 'TEXT NULL', + 'controller' => 'VARCHAR(250) NULL', + 'getData' => 'TEXT NULL', + 'postData' => 'TEXT NULL', + 'requestData' => 'TEXT NULL', + 'sessionData' => 'TEXT NULL', + 'authenticatedUser' => 'TEXT NULL', + 'cookies' => 'TEXT NULL', + 'responseTime' => 'DOUBLE PRECISION NULL', + 'responseStatus' => 'INTEGER NULL', + 'responseDuration' => 'DOUBLE PRECISION NULL', + 'memoryUsage' => 'DOUBLE PRECISION NULL', + 'middleware' => 'TEXT NULL', + 'databaseQueries' => 'TEXT NULL', + 'databaseQueriesCount' => 'INTEGER NULL', + 'databaseSlowQueries' => 'INTEGER NULL', + 'databaseSelects' => 'INTEGER NULL', + 'databaseInserts' => 'INTEGER NULL', + 'databaseUpdates' => 'INTEGER NULL', + 'databaseDeletes' => 'INTEGER NULL', + 'databaseOthers' => 'INTEGER NULL', + 'databaseDuration' => 'DOUBLE PRECISION NULL', + 'cacheQueries' => 'TEXT NULL', + 'cacheReads' => 'INTEGER NULL', + 'cacheHits' => 'INTEGER NULL', + 'cacheWrites' => 'INTEGER NULL', + 'cacheDeletes' => 'INTEGER NULL', + 'cacheTime' => 'DOUBLE PRECISION NULL', + 'redisCommands' => 'TEXT NULL', + 'queueJobs' => 'TEXT NULL', + 'timelineData' => 'TEXT NULL', + 'log' => 'TEXT NULL', + 'events' => 'TEXT NULL', + 'routes' => 'TEXT NULL', + 'emailsData' => 'TEXT NULL', + 'viewsData' => 'TEXT NULL', + 'userData' => 'TEXT NULL', + 'subrequests' => 'TEXT NULL', + 'xdebug' => 'TEXT NULL', + 'commandName' => 'TEXT NULL', + 'commandArguments' => 'TEXT NULL', + 'commandArgumentsDefaults' => 'TEXT NULL', + 'commandOptions' => 'TEXT NULL', + 'commandOptionsDefaults' => 'TEXT NULL', + 'commandExitCode' => 'INTEGER NULL', + 'commandOutput' => 'TEXT NULL', + 'jobName' => 'TEXT NULL', + 'jobDescription' => 'TEXT NULL', + 'jobStatus' => 'TEXT NULL', + 'jobPayload' => 'TEXT NULL', + 'jobQueue' => 'TEXT NULL', + 'jobConnection' => 'TEXT NULL', + 'jobOptions' => 'TEXT NULL', + 'testName' => 'TEXT NULL', + 'testStatus' => 'TEXT NULL', + 'testStatusMessage' => 'TEXT NULL', + 'testAsserts' => 'TEXT NULL', + 'parent' => 'TEXT NULL' ]; // List of Request keys that need to be serialized before they can be stored in database protected $needsSerialization = [ 'headers', 'getData', 'postData', 'requestData', 'sessionData', 'authenticatedUser', 'cookies', 'middleware', 'databaseQueries', 'cacheQueries', 'redisCommands', 'queueJobs', 'timelineData', 'log', 'events', 'routes', - 'emailsData', 'viewsData', 'userData', 'subrequests', 'xdebug' + 'emailsData', 'viewsData', 'userData', 'subrequests', 'xdebug', 'commandArguments', 'commandArgumentsDefaults', + 'commandOptions', 'commandOptionsDefaults', 'jobPayload', 'jobOptions', 'testAsserts', 'parent' ]; // Return a new storage, takes PDO object or DSN and optionally a table name and database credentials as arguments diff --git a/Clockwork/Storage/Storage.php b/Clockwork/Storage/Storage.php old mode 100755 new mode 100644 diff --git a/Clockwork/Storage/SymfonyStorage.php b/Clockwork/Storage/SymfonyStorage.php old mode 100755 new mode 100644 index 4f6e4643..6c37e258 --- a/Clockwork/Storage/SymfonyStorage.php +++ b/Clockwork/Storage/SymfonyStorage.php @@ -39,7 +39,7 @@ protected function loadRequest($token) } // Open index file, optionally move file pointer to the end - protected function openIndex($position = 'start') + protected function openIndex($position = 'start', $lock = null, $force = null) { $this->indexHandle = fopen("{$this->path}/index.csv", 'r'); diff --git a/Clockwork/Support/Laravel/ClockworkController.php b/Clockwork/Support/Laravel/ClockworkController.php index 9031010f..42b847ff 100644 --- a/Clockwork/Support/Laravel/ClockworkController.php +++ b/Clockwork/Support/Laravel/ClockworkController.php @@ -44,10 +44,6 @@ public function webIndex() { $this->ensureClockworkIsEnabled(); - if ($this->app['clockwork.support']->isWebUsingDarkTheme() && ! $this->app['request']->exists('dark')) { - return new RedirectResponse('/__clockwork/app?dark'); - } - return $this->app['clockwork.support']->getWebAsset('index.html'); } diff --git a/Clockwork/Support/Laravel/ClockworkServiceProvider.php b/Clockwork/Support/Laravel/ClockworkServiceProvider.php old mode 100755 new mode 100644 index b2db3253..809c107c --- a/Clockwork/Support/Laravel/ClockworkServiceProvider.php +++ b/Clockwork/Support/Laravel/ClockworkServiceProvider.php @@ -8,10 +8,15 @@ use Clockwork\DataSource\LaravelEventsDataSource; use Clockwork\DataSource\LaravelRedisDataSource; use Clockwork\DataSource\LaravelQueueDataSource; +use Clockwork\DataSource\LaravelTwigDataSource; +use Clockwork\DataSource\LaravelViewsDataSource; use Clockwork\DataSource\PhpDataSource; use Clockwork\DataSource\SwiftDataSource; +use Clockwork\DataSource\TwigDataSource; use Clockwork\DataSource\XdebugDataSource; +use Clockwork\Helpers\StackFilter; use Clockwork\Request\Log; +use Clockwork\Request\Request; use Clockwork\Storage\StorageInterface; use Illuminate\Redis\RedisManager; @@ -46,11 +51,21 @@ protected function listenToEvents() if ($support->isFeatureEnabled('cache')) $this->app['clockwork.cache']->listenToEvents(); if ($support->isFeatureEnabled('database')) $this->app['clockwork.eloquent']->listenToEvents(); if ($support->isFeatureEnabled('events')) $this->app['clockwork.events']->listenToEvents(); - if ($support->isFeatureEnabled('queue')) $this->app['clockwork.queue']->listenToEvents(); + if ($support->isFeatureEnabled('queue')) { + $this->app['clockwork.queue']->listenToEvents(); + $this->app['clockwork.queue']->setCurrentRequestId($this->app['clockwork']->getRequest()->id); + } if ($support->isFeatureEnabled('redis')) { $this->app[RedisManager::class]->enableEvents(); $this->app['clockwork.redis']->listenToEvents(); } + if ($support->isFeatureEnabled('views')) { + $support->getConfig('features.views.use_twig_profiler', false) + ? $this->app['clockwork.twig']->listenToEvents() : $this->app['clockwork.views']->listenToEvents(); + } + + if ($support->isCollectingCommands()) $support->collectCommands(); + if ($support->isCollectingQueueJobs()) $support->collectQueueJobs(); } protected function listenToFrameworkEvents() @@ -69,6 +84,7 @@ public function register() $clockwork = (new Clockwork) ->setAuthenticator($app['clockwork.authenticator']) ->setLog($app['clockwork.log']) + ->setRequest($app['clockwork.request']) ->setStorage($app['clockwork.storage']) ->addDataSource(new PhpDataSource()) ->addDataSource($app['clockwork.laravel']); @@ -80,6 +96,11 @@ public function register() if ($support->isFeatureEnabled('events')) $clockwork->addDataSource($app['clockwork.events']); if ($support->isFeatureEnabled('emails')) $clockwork->addDataSource($app['clockwork.swift']); if ($support->isFeatureAvailable('xdebug')) $clockwork->addDataSource($app['clockwork.xdebug']); + if ($support->isFeatureEnabled('views')) { + $clockwork->addDataSource( + $support->getConfig('features.views.use_twig_profiler', false) ? $app['clockwork.twig'] : $app['clockwork.views'] + ); + } return $clockwork; }); @@ -92,6 +113,10 @@ public function register() return new Log; }); + $this->app->singleton('clockwork.request', function ($app) { + return new Request; + }); + $this->app->singleton('clockwork.storage', function ($app) { return $app['clockwork.support']->getStorage(); }); @@ -104,8 +129,8 @@ public function register() $this->registerDataSources(); $this->registerAliases(); + $this->app->make('clockwork.request'); // instantiate the request to have id and time available as early as possible $this->app['clockwork.support']->configureSerializer(); - $this->app['clockwork.laravel']->listenToEarlyEvents(); if ($this->app['clockwork.support']->getConfig('register_helpers', true)) { @@ -132,7 +157,7 @@ protected function registerDataSources() }); $this->app->singleton('clockwork.eloquent', function ($app) { - return (new EloquentDataSource( + $dataSource = (new EloquentDataSource( $app['db'], $app['events'], $app['clockwork.support']->getConfig('features.database.collect_queries'), @@ -140,6 +165,24 @@ protected function registerDataSources() $app['clockwork.support']->getConfig('features.database.slow_only'), $app['clockwork.support']->getConfig('features.database.detect_duplicate_queries') )); + + // if we are collecting queue jobs, filter out queries caused by the database queue implementation + if ($app['clockwork.support']->isCollectingQueueJobs()) { + $dataSource->addFilter(function ($query, $trace) { + return ! $trace->first(StackFilter::make()->isClass(\Illuminate\Queue\Worker::class)); + }, 'early'); + } + + if ($app->runningUnitTests()) { + $dataSource->addFilter(function ($query, $trace) { + return ! $trace->first(StackFilter::make()->isClass([ + \Illuminate\Database\Migrations\Migrator::class, + \Illuminate\Database\Console\Migrations\MigrateCommand::class + ])); + }); + } + + return $dataSource; }); $this->app->singleton('clockwork.events', function ($app) { @@ -153,7 +196,6 @@ protected function registerDataSources() return (new LaravelDataSource( $app, $app['clockwork.support']->isFeatureEnabled('log'), - $app['clockwork.support']->isFeatureEnabled('views'), $app['clockwork.support']->isFeatureEnabled('routes') )) ->setLog($app['clockwork.log']); @@ -164,13 +206,38 @@ protected function registerDataSources() }); $this->app->singleton('clockwork.redis', function ($app) { - return (new LaravelRedisDataSource($app['events'])); + $dataSource = new LaravelRedisDataSource($app['events']); + + // if we are collecting queue jobs, filter out commands executed by the redis queue implementation + if ($app['clockwork.support']->isCollectingQueueJobs()) { + $dataSource->addFilter(function ($query, $trace) { + return ! $trace->first(StackFilter::make()->isClass([ + \Illuminate\Queue\RedisQueue::class, + \Laravel\Horizon\Repositories\RedisJobRepository::class, + \Laravel\Horizon\Repositories\RedisTagRepository::class, + \Laravel\Horizon\Repositories\RedisMetricsRepository::class + ])); + }); + } + + return $dataSource; }); $this->app->singleton('clockwork.swift', function ($app) { return new SwiftDataSource($app['mailer']->getSwiftMailer()); }); + $this->app->singleton('clockwork.twig', function ($app) { + return new TwigDataSource($app['twig']); + }); + + $this->app->singleton('clockwork.views', function ($app) { + return new LaravelViewsDataSource( + $app['events'], + $app['clockwork.support']->getConfig('features.views.collect_data') + ); + }); + $this->app->singleton('clockwork.xdebug', function ($app) { return new XdebugDataSource; }); diff --git a/Clockwork/Support/Laravel/ClockworkSupport.php b/Clockwork/Support/Laravel/ClockworkSupport.php index 58ddb12b..6c452920 100644 --- a/Clockwork/Support/Laravel/ClockworkSupport.php +++ b/Clockwork/Support/Laravel/ClockworkSupport.php @@ -7,12 +7,14 @@ use Clockwork\Helpers\ServerTiming; use Clockwork\Helpers\StackFilter; use Clockwork\Helpers\StackTrace; +use Clockwork\Request\Request; use Clockwork\Storage\FileStorage; use Clockwork\Storage\Search; use Clockwork\Storage\SqlStorage; use Clockwork\Web\Web; use Illuminate\Contracts\Foundation\Application; +use Illuminate\Contracts\Console\Kernel as ConsoleKernel; use Illuminate\Http\JsonResponse; use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; @@ -117,6 +119,108 @@ public function getWebAsset($path) } } + // Set up collecting of executed artisan commands + public function collectCommands() + { + $this->app['events']->listen(\Illuminate\Console\Events\CommandStarting::class, function ($event) { + // only collect commands ran through artisan cli, other commands are recorded as part of respective request + if (basename(StackTrace::get()->last()->file) != 'artisan') return; + + if (! $this->getConfig('artisan.collect_output')) return; + if (! $event->command || $this->isCommandFiltered($event->command)) return; + + $event->output->setFormatter( + new Console\CapturingFormatter($event->output->getFormatter()) + ); + }); + + $this->app['events']->listen(\Illuminate\Console\Events\CommandFinished::class, function ($event) { + // only collect commands ran through artisan cli, other commands are recorded as part of respective request + if (basename(StackTrace::get()->last()->file) != 'artisan') return; + + if (! $event->command || $this->isCommandFiltered($event->command)) return; + + $command = $this->app->make(ConsoleKernel::class)->all()[$event->command]; + + $argumentsDefaults = $command->getDefinition()->getArgumentDefaults(); + $optionsDefaults = $command->getDefinition()->getOptionDefaults(); + + $this->app->make('clockwork') + ->resolveAsCommand( + $event->command, + $event->exitCode, + array_diff($event->input->getArguments(), $argumentsDefaults), + array_diff($event->input->getOptions(), $optionsDefaults), + $argumentsDefaults, + $optionsDefaults, + $this->getConfig('artisan.collect_output') ? $event->output->getFormatter()->capturedOutput() : null + ) + ->storeRequest(); + }); + } + + // Set up collecting of executed queue jobs + public function collectQueueJobs() + { + $this->app['events']->listen(\Illuminate\Queue\Events\JobProcessing::class, function ($event) { + // sync jobs are recorded as part of the parent request + if ($event->job instanceof \Illuminate\Queue\Jobs\SyncJob) return; + + $payload = $event->job->payload(); + + if (! isset($payload['clockwork_id']) || $this->isQueueJobFiltered($payload['displayName'])) return; + + $request = new Request([ 'id' => $payload['clockwork_id'] ]); + if (isset($payload['clockwork_parent_id'])) $request->setParent($payload['clockwork_parent_id']); + + $this->app->make('clockwork')->reset()->setRequest($request) + ->startEvent('total', 'Total execution time.', $request->time); + }); + + $this->app['events']->listen(\Illuminate\Queue\Events\JobProcessed::class, function ($event) { + $this->processQueueJob($event->job); + }); + + $this->app['events']->listen(\Illuminate\Queue\Events\JobFailed::class, function ($event) { + $this->processQueueJob($event->job, $event->exception); + }); + } + + protected function processQueueJob($job, $exception = null) + { + // sync jobs are recorded as part of the parent request + if ($job instanceof \Illuminate\Queue\Jobs\SyncJob) return; + + $payload = $job->payload(); + + if (! isset($payload['clockwork_id'])) return; + + $unserialized = isset($payload['data']['command']) ? unserialize($payload['data']['command']) : null; + + if (! $unserialized || $this->isQueueJobFiltered(get_class($unserialized))) return; + + if ($exception) { + $this->app->make('clockwork')->error($exception->getMessage(), [ 'exception' => $exception ]); + } + + $this->app->make('clockwork') + ->resolveAsQueueJob( + get_class($unserialized), + $payload['displayName'], + $job->hasFailed() ? 'failed' : ($job->isReleased() ? 'released' : 'done'), + $unserialized, + $job->getQueue(), + $job->getConnectionName(), + array_filter([ + 'maxTries' => isset($payload['maxTries']) ? $payload['maxTries'] : null, + 'delaySeconds' => isset($payload['delaySeconds']) ? $payload['delaySeconds'] : null, + 'timeout' => isset($payload['timeout']) ? $payload['timeout'] : null, + 'timeoutAt' => isset($payload['timeoutAt']) ? $payload['timeoutAt'] : null + ]) + ) + ->storeRequest(); + } + public function process($request, $response) { if (! $this->isCollectingData()) { @@ -185,12 +289,41 @@ public function isEnabled() } public function isCollectingData() + { + return $this->isCollectingCommands() + || $this->isCollectingQueueJobs() + || $this->isCollectingRequests() + || $this->isCollectingTests(); + } + + public function isCollectingCommands() + { + return ($this->isEnabled() || $this->getConfig('collect_data_always', false)) + && $this->app->runningInConsole() + && $this->getConfig('artisan.collect', false); + } + + public function isCollectingQueueJobs() + { + return ($this->isEnabled() || $this->getConfig('collect_data_always', false)) + && $this->app->runningInConsole() + && $this->getConfig('queue.collect', false); + } + + public function isCollectingRequests() { return ($this->isEnabled() || $this->getConfig('collect_data_always', false)) && ! $this->app->runningInConsole() && ! $this->isUriFiltered($this->app['request']->getRequestUri()); } + public function isCollectingTests() + { + return ($this->isEnabled() || $this->getConfig('collect_data_always', false)) + && $this->app->runningInConsole() + && $this->getConfig('tests.collect', false); + } + public function isFeatureEnabled($feature) { return $this->getConfig("features.{$feature}.enabled") && $this->isFeatureAvailable($feature); @@ -216,11 +349,6 @@ public function isWebEnabled() return $this->getConfig('web', true); } - public function isWebUsingDarkTheme() - { - return $this->getConfig('web_dark_theme', false); - } - public function isUriFiltered($uri) { $filterUris = $this->getConfig('filter_uris', []); @@ -235,10 +363,84 @@ public function isUriFiltered($uri) return false; } + protected function isCommandFiltered($command) + { + $whitelist = $this->getConfig('artisan.only', []); + + if (count($whitelist)) return ! in_array($command, $whitelist); + + $blacklist = $this->getConfig('artisan.except', []); + + if ($this->getConfig('artisan.except_laravel_commands', true)) { + $blacklist = array_merge($blacklist, $this->builtinLaravelCommands()); + } + + $blacklist = array_merge($blacklist, $this->builtinClockworkCommands()); + + return in_array($command, $blacklist); + } + + protected function isQueueJobFiltered($queueJob) + { + $whitelist = $this->getConfig('queue.only', []); + + if (count($whitelist)) return ! in_array($queueJob, $whitelist); + + $blacklist = $this->getConfig('queue.except', []); + + return in_array($queueJob, $blacklist); + } + + public function isTestFiltered($test) + { + $blacklist = $this->getConfig('tests.except', []); + + return in_array($test, $blacklist); + } + protected function appendServerTimingHeader($response, $request) { if (($eventsCount = $this->getConfig('server_timing', 10)) !== false) { $response->headers->set('Server-Timing', ServerTiming::fromRequest($request, $eventsCount)->value()); } } + + protected function builtinLaravelCommands() + { + return [ + 'clear-compiled', 'down', 'dump-server', 'env', 'help', 'list', 'migrate', 'optimize', 'preset', 'serve', + 'tinker', 'up', + 'app:name', + 'auth:clear-resets', + 'cache:clear', 'cache:forget', 'cache:table', + 'config:cache', 'config:clear', + 'db:seed', + 'event:cache', 'event:clear', 'event:generate', 'event:list', + 'key:generate', + 'make:auth', 'make:channel', 'make:command', 'make:controller', 'make:event', 'make:exception', + 'make:factory', 'make:job', 'make:listener', 'make:mail', 'make:middleware', 'make:migration', 'make:model', + 'make:notification', 'make:observer', 'make:policy', 'make:provider', 'make:request', 'make:resource', + 'make:rule', 'make:seeder', 'make:test', + 'migrate:fresh', 'migrate:install', 'migrate:refresh', 'migrate:reset', 'migrate:rollback', + 'migrate:status', + 'notifications:table', + 'optimize:clear', + 'package:discover', + 'queue:failed', 'queue:failed-table', 'queue:flush', 'queue:forget', 'queue:listen', 'queue:restart', + 'queue:retry', 'queue:table', 'queue:work', + 'route:cache', 'route:clear', 'route:list', + 'schedule:run', + 'session:table', + 'storage:link', + 'vendor:publish', + 'view:cache', 'view:clear' + ]; + } + + protected function builtinClockworkCommands() + { + return [ + 'clockwork:clean' + ]; + } } diff --git a/Clockwork/Support/Laravel/Console/CapturingFormatter.php b/Clockwork/Support/Laravel/Console/CapturingFormatter.php new file mode 100644 index 00000000..50c49abd --- /dev/null +++ b/Clockwork/Support/Laravel/Console/CapturingFormatter.php @@ -0,0 +1,70 @@ +formatter = $formatter; + } + + public function capturedOutput() + { + $capturedOutput = $this->capturedOutput; + + $this->capturedOutput = null; + + return $capturedOutput; + } + + public function setDecorated($decorated) + { + return $this->formatter->setDecorated($decorated); + } + + public function isDecorated() + { + return $this->formatter->isDecorated(); + } + + public function setStyle($name, OutputFormatterStyleInterface $style) + { + return $this->formatter->setStyle($name, $style); + } + + public function hasStyle($name) + { + return $this->formatter->hasStyle($name); + } + + public function getStyle($name) + { + return $this->formatter->getStyle($name); + } + + public function format($message) + { + $formatted = $this->formatter->format($message); + + $this->capturedOutput .= $formatted; + + return $formatted; + } + + public function __call($method, $args) + { + return call_user_func_array([ $this->formatter, $method ], $args); + } + + public function __clone() + { + $this->formatter = clone $this->formatter; + } +} diff --git a/Clockwork/Support/Laravel/Tests/UsesClockwork.php b/Clockwork/Support/Laravel/Tests/UsesClockwork.php new file mode 100644 index 00000000..0a51cc56 --- /dev/null +++ b/Clockwork/Support/Laravel/Tests/UsesClockwork.php @@ -0,0 +1,79 @@ + [] + ]; + + protected function setUpClockwork() + { + $this->beforeApplicationDestroyed(function () { + if ($this->app->make('clockwork.support')->isTestFiltered($this->toString())) return; + + $this->app->make('clockwork') + ->resolveAsTest( + $this->toString(), + $this->resolveClockworkStatus(), + $this->getStatusMessage(), + $this->resolveClockworkAsserts() + ) + ->storeRequest(); + }); + } + + protected function resolveClockworkStatus() + { + $status = $this->getStatus(); + + $statuses = [ + BaseTestRunner::STATUS_UNKNOWN => 'unknown', + BaseTestRunner::STATUS_PASSED => 'passed', + BaseTestRunner::STATUS_SKIPPED => 'skipped', + BaseTestRunner::STATUS_INCOMPLETE => 'incomplete', + BaseTestRunner::STATUS_FAILURE => 'failed', + BaseTestRunner::STATUS_ERROR => 'error', + BaseTestRunner::STATUS_RISKY => 'passed', + BaseTestRunner::STATUS_WARNING => 'warning' + ]; + + return isset($statuses[$status]) ? $statuses[$status] : null; + } + + protected function resolveClockworkAsserts() + { + $asserts = static::$clockwork['asserts']; + + if ($this->getStatus() == BaseTestRunner::STATUS_FAILURE) { + $asserts[count($asserts) - 1]['passed'] = false; + } + + static::$clockwork['asserts'] = []; + + return $asserts; + } + + public static function assertThat($value, Constraint $constraint, string $message = ''): void + { + $trace = StackTrace::get([ 'arguments' => true, 'limit' => 10 ]); + + $assertFrame = $trace->filter(function ($frame) { return strpos($frame->function, 'assert') === 0; })->last(); + $trace = $trace->skip(StackFilter::make()->isNotVendor([ 'itsgoingd', 'phpunit' ]))->limit(3); + + static::$clockwork['asserts'][] = [ + 'name' => $assertFrame->function, + 'arguments' => $assertFrame->args, + 'trace' => (new Serializer)->trace($trace), + 'passed' => true + ]; + + parent::assertThat($value, $constraint, $message); + } +} diff --git a/Clockwork/Support/Laravel/config/clockwork.php b/Clockwork/Support/Laravel/config/clockwork.php index 37075144..025c6536 100644 --- a/Clockwork/Support/Laravel/config/clockwork.php +++ b/Clockwork/Support/Laravel/config/clockwork.php @@ -91,9 +91,16 @@ 'enabled' => env('CLOCKWORK_ROUTES_ENABLED', false) ], - // Rendered views including passed data (high performance impact with large amount of data passed to views) + // Rendered views 'views' => [ - 'enabled' => env('CLOCKWORK_VIEWS_ENABLED', false) + 'enabled' => env('CLOCKWORK_VIEWS_ENABLED', true), + + // Collect views including view data (high performance impact with a high number of views) + 'collect_data' => env('CLOCKWORK_VIEWS_COLLECT_DATA', false), + + // Use Twig profiler instead of Laravel events for apps using laravel-twigbridge (more precise, but does + // not support collecting view data) + 'use_twig_profiler' => env('CLOCKWORK_VIEWS_USE_TWIG_PROFILER', false) ] ], @@ -111,7 +118,80 @@ 'web' => env('CLOCKWORK_WEB', true), - 'web_dark_theme' => env('CLOCKWORK_WEB_DARK_THEME', false), + /* + |-------------------------------------------------------------------------- + | Artisan commands collection + |-------------------------------------------------------------------------- + | + | You can enable or disable and configure collection of executed Artisan + | commands here. + | + */ + + 'artisan' => [ + // Enable or disable collection of executed Artisan commands + 'collect' => env('CLOCKWORK_ARTISAN_COLLECT', false), + + // List of commands that should not be collected (built-in commands are not collected by default) + 'except' => [ + // 'inspire' + ], + + // List of commands that should be collected, any other command will not be collected if not empty + 'only' => [ + // 'inspire' + ], + + // Enable or disable collection of command output + 'collect_output' => env('CLOCKWORK_ARTISAN_COLLECT_OUTPUT', false), + + // Enable or disable collection of built-in Laravel commands + 'except_laravel_commands' => env('CLOCKWORK_ARTISAN_EXCEPT_LARAVEL_COMMANDS', true) + ], + + /* + |-------------------------------------------------------------------------- + | Queue jobs collection + |-------------------------------------------------------------------------- + | + | You can enable or disable and configure collection of executed queue jobs + | here. + | + */ + + 'queue' => [ + // Enable or disable collection of executed queue jobs + 'collect' => env('CLOCKWORK_QUEUE_COLLECT', false), + + // List of queue jobs that should not be collected + 'except' => [ + // App\Jobs\ExpensiveJob::class + ], + + // List of queue jobs that should be collected, any other queue job will not be collected if not empty + 'only' => [ + // App\Jobs\BuggyJob::class + ] + ], + + /* + |-------------------------------------------------------------------------- + | Tests collection + |-------------------------------------------------------------------------- + | + | You can enable or disable and configure collection of ran tests here. + | + */ + + 'tests' => [ + // Enable or disable collection of ran tests + 'collect' => env('CLOCKWORK_TESTS_COLLECT', false), + + // List of tests that should not be collected + 'except' => [ + // Tests\Unit\ExampleTest::class + ] + ], /* |-------------------------------------------------------------------------- diff --git a/Clockwork/Support/Lumen/ClockworkServiceProvider.php b/Clockwork/Support/Lumen/ClockworkServiceProvider.php old mode 100755 new mode 100644 diff --git a/Clockwork/Support/Lumen/ClockworkSupport.php b/Clockwork/Support/Lumen/ClockworkSupport.php index 0f3b0eba..eb450c97 100644 --- a/Clockwork/Support/Lumen/ClockworkSupport.php +++ b/Clockwork/Support/Lumen/ClockworkSupport.php @@ -41,9 +41,9 @@ public function isFeatureAvailable($feature) } elseif ($feature == 'emails') { return $this->app->bound('mailer'); } elseif ($feature == 'redis') { - return method_exists(\Illuminate\Redis\RedisManager::class, 'enableEvents'); + return $this->app->bound('redis') && method_exists(\Illuminate\Redis\RedisManager::class, 'enableEvents'); } elseif ($feature == 'queue') { - return method_exists(\Illuminate\Queue\Queue::class, 'createPayloadUsing'); + return $this->app->bound('queue') && method_exists(\Illuminate\Queue\Queue::class, 'createPayloadUsing'); } elseif ($feature == 'xdebug') { return in_array('xdebug', get_loaded_extensions()); } diff --git a/Clockwork/Support/Lumen/Controller.php b/Clockwork/Support/Lumen/Controller.php index aacb4173..1a9eb382 100644 --- a/Clockwork/Support/Lumen/Controller.php +++ b/Clockwork/Support/Lumen/Controller.php @@ -49,10 +49,6 @@ public function webIndex(Request $request) { $this->ensureClockworkIsEnabled(); - if ($this->clockworkSupport->isWebUsingDarkTheme() && ! $request->exists('dark')) { - return new RedirectResponse('/__clockwork/app?dark'); - } - return $this->clockworkSupport->getWebAsset('index.html'); } diff --git a/Clockwork/Support/Symfony/ClockworkBundle.php b/Clockwork/Support/Symfony/ClockworkBundle.php old mode 100755 new mode 100644 diff --git a/Clockwork/Support/Symfony/ClockworkConfiguration.php b/Clockwork/Support/Symfony/ClockworkConfiguration.php old mode 100755 new mode 100644 index c49d9507..44f91502 --- a/Clockwork/Support/Symfony/ClockworkConfiguration.php +++ b/Clockwork/Support/Symfony/ClockworkConfiguration.php @@ -2,6 +2,7 @@ use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; +use Symfony\Component\HttpKernel\Kernel; class ClockworkConfiguration implements ConfigurationInterface { @@ -14,14 +15,22 @@ public function __construct($debug) public function getConfigTreeBuilder() { - return (new TreeBuilder)->root('clockwork') + return $this->getConfigRoot() ->children() ->booleanNode('enable')->defaultValue($this->debug)->end() ->booleanNode('web')->defaultValue(true)->end() - ->booleanNode('web_dark_theme')->defaultValue(false)->end() ->booleanNode('authentication')->defaultValue(false)->end() ->scalarNode('authentication_password')->defaultValue('VerySecretPassword')->end() ->end() ->end(); } + + protected function getConfigRoot() + { + if (Kernel::VERSION_ID < 40300) { + return (new TreeBuilder)->root('clockwork'); + } + + return (new TreeBuilder('clockwork'))->getRootNode(); + } } diff --git a/Clockwork/Support/Symfony/ClockworkController.php b/Clockwork/Support/Symfony/ClockworkController.php old mode 100755 new mode 100644 index 75475a97..34818d8a --- a/Clockwork/Support/Symfony/ClockworkController.php +++ b/Clockwork/Support/Symfony/ClockworkController.php @@ -2,25 +2,25 @@ use Clockwork\Clockwork; -use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\Profiler\Profiler; -class ClockworkController extends Controller +class ClockworkController extends AbstractController { protected $clockwork; - protected $profiler; + protected $support; - public function __construct(Clockwork $clockwork, ClockworkSupport $support, Profiler $profiler) + public function __construct(Clockwork $clockwork, ClockworkSupport $support) { $this->clockwork = $clockwork; $this->support = $support; - $this->profiler = $profiler; } public function authenticate(Request $request) { + $this->ensureClockworkIsEnabled(); + $token = $this->clockwork->getAuthenticator()->attempt($request->request->all()); return new JsonResponse([ 'token' => $token ], $token ? 200 : 403); @@ -28,33 +28,42 @@ public function authenticate(Request $request) public function getData(Request $request, $id = null, $direction = null, $count = null) { - $this->profiler->disable(); + $this->ensureClockworkIsEnabled(); return $this->support->getData($request, $id, $direction, $count); } public function webIndex(Request $request) { - $this->profiler->disable(); - - if ($this->support->isWebUsingDarkTheme() && ! $request->query->has('dark')) { - return $this->redirect('/__clockwork/app?dark'); - } + $this->ensureClockworkIsEnabled(); + $this->ensureClockworkWebIsEnabled(); return $this->support->getWebAsset('index.html'); } public function webAsset($path) { - $this->profiler->disable(); + $this->ensureClockworkIsEnabled(); + $this->ensureClockworkWebIsEnabled(); return $this->support->getWebAsset($path); } public function webRedirect() { - $this->profiler->disable(); + $this->ensureClockworkIsEnabled(); + $this->ensureClockworkWebIsEnabled(); return $this->redirect('/__clockwork/app'); } + + protected function ensureClockworkIsEnabled() + { + if (! $this->support->isEnabled()) throw $this->createNotFoundException(); + } + + protected function ensureClockworkWebIsEnabled() + { + if (! $this->support->isWebEnabled()) throw $this->createNotFoundException(); + } } diff --git a/Clockwork/Support/Symfony/ClockworkExtension.php b/Clockwork/Support/Symfony/ClockworkExtension.php old mode 100755 new mode 100644 diff --git a/Clockwork/Support/Symfony/ClockworkListener.php b/Clockwork/Support/Symfony/ClockworkListener.php old mode 100755 new mode 100644 index d169571e..bd201110 --- a/Clockwork/Support/Symfony/ClockworkListener.php +++ b/Clockwork/Support/Symfony/ClockworkListener.php @@ -2,20 +2,30 @@ use Clockwork\Clockwork; -use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\HttpKernel\KernelEvents; +use Symfony\Component\HttpKernel\Event\KernelEvent; +use Symfony\Component\HttpKernel\Profiler\Profiler; use Symfony\Component\EventDispatcher\EventSubscriberInterface; class ClockworkListener implements EventSubscriberInterface { protected $clockwork; + protected $profiler; - public function __construct(ClockworkSupport $clockwork) + public function __construct(ClockworkSupport $clockwork, Profiler $profiler) { $this->clockwork = $clockwork; + $this->profiler = $profiler; } - public function onKernelResponse(FilterResponseEvent $event) + public function onKernelRequest(KernelEvent $event) + { + if (preg_match('#/__clockwork(.*)#', $event->getRequest()->getPathInfo())) { + $this->profiler->disable(); + } + } + + public function onKernelResponse(KernelEvent $event) { if (! $this->clockwork->isEnabled()) return; @@ -30,7 +40,8 @@ public function onKernelResponse(FilterResponseEvent $event) public static function getSubscribedEvents() { return [ - KernelEvents::RESPONSE => [ 'onKernelResponse', -128 ], + KernelEvents::REQUEST => [ 'onKernelRequest', 512 ], + KernelEvents::RESPONSE => [ 'onKernelResponse', -128 ] ]; } } diff --git a/Clockwork/Support/Symfony/ClockworkSupport.php b/Clockwork/Support/Symfony/ClockworkSupport.php index b7e7a905..1df8fa66 100644 --- a/Clockwork/Support/Symfony/ClockworkSupport.php +++ b/Clockwork/Support/Symfony/ClockworkSupport.php @@ -84,8 +84,8 @@ public function isEnabled() return $this->getConfig('enable', false); } - public function isWebUsingDarkTheme() + public function isWebEnabled() { - return $this->getConfig('web_dark_theme', false); + return $this->getConfig('web', false); } } diff --git a/Clockwork/Support/Symfony/ProfileTransformer.php b/Clockwork/Support/Symfony/ProfileTransformer.php index 161587d0..0f47763b 100644 --- a/Clockwork/Support/Symfony/ProfileTransformer.php +++ b/Clockwork/Support/Symfony/ProfileTransformer.php @@ -49,10 +49,11 @@ protected function getCacheQueries($data) return [ 'connection' => $connection, - 'time' => $query['end'] - $query['start'], - 'type' => array_values($value)[0] ? 'hit' : 'miss', - 'key' => array_keys($value)[0], - 'value' => '' + 'time' => $query['start'], + 'type' => array_values($value)[0] ? 'hit' : 'miss', + 'key' => array_keys($value)[0], + 'value' => '', + 'duration' => $query['end'] - $query['start'] ]; }, $queries)); }, $this->unwrap($data->getCalls()), array_keys($this->unwrap($data->getCalls()))), function ($all, $queries) { diff --git a/Clockwork/Support/Symfony/Resources/config/clockwork.php b/Clockwork/Support/Symfony/Resources/config/clockwork.php index 7fbcd20e..181e1f00 100644 --- a/Clockwork/Support/Symfony/Resources/config/clockwork.php +++ b/Clockwork/Support/Symfony/Resources/config/clockwork.php @@ -24,10 +24,10 @@ ->setPublic(true); $container->autowire(Clockwork\Support\Symfony\ClockworkController::class) - ->setAutoconfigured(true) - ->setArgument('$profiler', new Reference('profiler')); + ->setAutoconfigured(true); $container->autowire(Clockwork\Support\Symfony\ClockworkListener::class) + ->setArgument('$profiler', new Reference('profiler')) ->addTag('kernel.event_subscriber'); $container->setAlias('clockwork', Clockwork\Clockwork::class)->setPublic('true'); diff --git a/Clockwork/Support/Symfony/Resources/config/routing/clockwork.php b/Clockwork/Support/Symfony/Resources/config/routing/clockwork.php index f83180d3..2d95d8d6 100644 --- a/Clockwork/Support/Symfony/Resources/config/routing/clockwork.php +++ b/Clockwork/Support/Symfony/Resources/config/routing/clockwork.php @@ -13,10 +13,6 @@ '_controller' => [ Clockwork\Support\Symfony\ClockworkController::class, 'webIndex' ] ])); -$routes->add('clockwork.webAsset', new Route('/__clockwork/{path}', [ - '_controller' => [ Clockwork\Support\Symfony\ClockworkController::class, 'webAsset' ] -], [ 'path' => '.+' ])); - $routes->add('clockwork.auth', new Route('/__clockwork/auth', [ '_controller' => [ Clockwork\Support\Symfony\ClockworkController::class, 'authenticate' ] ])); @@ -27,4 +23,8 @@ 'count' => null ], [ 'id' => '([a-z0-9-]+|latest)', 'direction' => '(next|previous)', 'count' => '\d+' ])); +$routes->add('clockwork.webAsset', new Route('/__clockwork/{path}', [ + '_controller' => [ Clockwork\Support\Symfony\ClockworkController::class, 'webAsset' ] +], [ 'path' => '.+' ])); + return $routes; diff --git a/Clockwork/Support/Twig/ProfilerClockworkDumper.php b/Clockwork/Support/Twig/ProfilerClockworkDumper.php new file mode 100644 index 00000000..e472876a --- /dev/null +++ b/Clockwork/Support/Twig/ProfilerClockworkDumper.php @@ -0,0 +1,46 @@ +dumpProfile($profile, $timeline); + + return $timeline; + } + + public function dumpProfile(Profile $profile, Timeline $timeline, $parent = null) + { + $id = $this->lastId++; + + if ($profile->isRoot()) { + $name = $profile->getName(); + } elseif ($profile->isTemplate()) { + $name = basename($profile->getTemplate()); + } else { + $name = basename($profile->getTemplate()) . '::' . $profile->getType() . '(' . $profile->getName() . ')'; + } + + foreach ($profile as $p) { + $this->dumpProfile($p, $timeline, $id); + } + + $data = $profile->__serialize(); + + $timeline->addEvent( + $id, + $name, + isset($data[3]['wt']) ? $data[3]['wt'] : null, + isset($data[4]['wt']) ? $data[4]['wt'] : null, + [ 'data' => [], 'memoryUsage' => isset($data[4]['mu']) ? $data[4]['mu'] : null, 'parent' => $parent ] + ); + } +} diff --git a/Clockwork/Support/Vanilla/Clockwork.php b/Clockwork/Support/Vanilla/Clockwork.php index 55266950..791d0ce8 100644 --- a/Clockwork/Support/Vanilla/Clockwork.php +++ b/Clockwork/Support/Vanilla/Clockwork.php @@ -22,6 +22,8 @@ class Clockwork protected $psrRequest; protected $psrResponse; + protected $headersSent = false; + protected static $defaultInstance; public function __construct($config = []) @@ -60,6 +62,43 @@ public function requestProcessed() if (! $this->config['enable']) return; + $this->sendHeaders(); + + if (($eventsCount = $this->config['server_timing']) !== false) { + $this->setHeader('Server-Timing', ServerTiming::fromRequest($this->clockwork->getRequest(), $eventsCount)->value()); + } + + return $this->psrResponse; + } + + public function commandExecuted($name, $exitCode = null, $arguments = [], $options = [], $argumentsDefaults = [], $optionsDefaults = [], $output = null) + { + if (! $this->config['enable'] && ! $this->config['collect_data_always']) return; + + $this->clockwork->getTimeline()->endEvent('total'); + + $this->clockwork + ->resolveAsCommand($name, $exitCode, $arguments, $options, $argumentsDefaults, $optionsDefaults, $output) + ->storeRequest(); + } + + public function queueJobExecuted($name, $description = null, $status = 'processed', $payload = [], $queue = null, $connection = null, $options = []) + { + if (! $this->config['enable'] && ! $this->config['collect_data_always']) return; + + $this->clockwork->getTimeline()->endEvent('total'); + + $this->clockwork + ->resolveAsQueueJob($name, $description, $status, $payload, $queue, $connection, $options) + ->storeRequest(); + } + + public function sendHeaders() + { + if (! $this->config['enable'] || $this->headersSent) return; + + $this->headersSent = true; + $this->setHeader('X-Clockwork-Id', $this->getRequest()->id); $this->setHeader('X-Clockwork-Version', BaseClockwork::VERSION); @@ -70,12 +109,6 @@ public function requestProcessed() foreach ($this->config['headers'] as $headerName => $headerValue) { $this->setHeader("X-Clockwork-Header-{$headerName}", $headerValue); } - - if (($eventsCount = $this->config['server_timing']) !== false) { - $this->setHeader('Server-Timing', ServerTiming::fromRequest($this->clockwork->getRequest(), $eventsCount)->value()); - } - - return $this->psrResponse; } public function returnMetadata($request = null) diff --git a/Clockwork/Web/public/css/app.af135e9c.css b/Clockwork/Web/public/css/app.af135e9c.css new file mode 100644 index 00000000..920358db --- /dev/null +++ b/Clockwork/Web/public/css/app.af135e9c.css @@ -0,0 +1 @@ +.exception-section{border-bottom:1px solid #d1d1d1}.application.dark .exception-section{border-bottom:1px solid #363636}.exception-section.compact .exception-message h3{display:inline;padding-right:4px}.exception-section .exception-info{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background:#ffebeb;color:#c51f24;display:-webkit-box;display:-ms-flexbox;display:flex;padding:6px 10px}.exception-section .exception-info:nth-child(2n){background:#ffe0e0}.exception-section .exception-info:first-child{padding-top:12px}.exception-section .exception-info:last-child{padding-bottom:12px}.application.dark .exception-section .exception-info{background:#380000;color:#ed797a}.application.dark .exception-section .exception-info:nth-child(2n){background:#2e0000}.exception-section .exception-info h3{border-bottom:0;font-size:14px;margin:0 0 5px}.exception-section .exception-info .exception-message{-webkit-box-flex:1;-ms-flex:1;flex:1;font-size:12px;line-height:1.5}.exception-section .exception-info .exception-previous,.exception-section .exception-info .exception-trace>a{color:#c51f24;font-size:12px;margin:0 4px}.application.dark .exception-section .exception-info .exception-previous,.application.dark .exception-section .exception-info .exception-trace>a{color:#ed797a}.exception-section .exception-info .exception-previous{margin-right:4px;text-decoration:none}.exception-section .exception-info .exception-trace{display:inline-block}.parent-request{-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-bottom:1px solid #d1d1d1;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:12px;font-weight:600;padding:12px 10px}.application.dark .parent-request{border-bottom:1px solid #363636}.parent-request.compact .parent-title{padding-right:4px}.parent-request.compact .parent-name,.parent-request.compact .parent-title{display:inline}.parent-request .parent-title{font-size:11px;margin-bottom:3px}.parent-request .parent-method{color:grey;font-size:90%;font-weight:400;margin-right:2px}.application.dark .parent-request .parent-method{color:#767676}.parent-request .parent-uri{font-weight:400}.parent-request .type-text{background:#cbdeec;border-radius:3px;color:#365063;font-size:80%;margin-right:2px;padding:1px 3px;vertical-align:1px}.application.dark .parent-request .type-text{background:#002e52;color:#6ebef7}.parent-request a{color:#258cdb;font-weight:400;text-decoration:none}.application.dark .parent-request a{color:#f27e02}.parent-request .parent-close{margin-left:auto}.messages-overlay .parent-request{display:-webkit-box;display:-ms-flexbox;display:flex;font-size:12px;font-weight:600;padding:10px}.messages-overlay .parent-request .parent-method{color:grey;font-size:90%;font-weight:400;margin-right:2px}.application.dark .messages-overlay .parent-request .parent-method{color:#767676}.messages-overlay .parent-request .parent-uri{font-weight:400}.messages-overlay .parent-request a{color:#258cdb;font-weight:400;text-decoration:none}.application.dark .messages-overlay .parent-request a{color:#f27e02}.messages-overlay .parent-request .parent-close{margin-left:auto}.messages-overlay .exception .exception-info{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background:#ffebeb;color:#c51f24;display:-webkit-box;display:-ms-flexbox;display:flex;padding:10px}.messages-overlay .exception .exception-info:nth-child(2n){background:#ffe0e0}.application.dark .messages-overlay .exception .exception-info{background:#380000;color:#ed797a}.application.dark .messages-overlay .exception .exception-info:nth-child(2n){background:#2e0000}.messages-overlay .exception .exception-info h3{border-bottom:0;display:inline;font-size:12px}.messages-overlay .exception .exception-info .exception-message{-webkit-box-flex:1;-ms-flex:1;flex:1;font-size:12px}.messages-overlay .exception .exception-info .exception-previous,.messages-overlay .exception .exception-info .exception-trace>a{color:#c51f24;font-size:12px;margin:0 4px}.application.dark .messages-overlay .exception .exception-info .exception-previous,.application.dark .messages-overlay .exception .exception-info .exception-trace>a{color:#ed797a}.messages-overlay .exception .exception-info .exception-previous{margin-right:4px;text-decoration:none}.messages-overlay .exception .exception-info .exception-trace{display:inline-block}.messages-overlay .update-notification{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background:#e9f3fb;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:110%;padding:10px}.application.dark .messages-overlay .update-notification{background:#643302}.messages-overlay .update-notification a{color:#258cdb;text-decoration:none}.application.dark .messages-overlay .update-notification a{color:#f27e02}.messages-overlay .update-notification strong{font-weight:500}.messages-overlay .update-notification .updateNotification-close{margin-left:auto}.settings-modal{background:#fff;border:1px solid #d1d1d1;border-radius:5px;-webkit-box-shadow:0 0 4px #e5e5e5;box-shadow:0 0 4px #e5e5e5;font-size:13px;left:5%;max-width:600px;padding:32px 35px 1px;position:absolute;text-align:left;top:0;width:90%;z-index:300}.application.dark .settings-modal{background:#1f1f1f;border:1px solid #404040;-webkit-box-shadow:0 0 4px #292929;box-shadow:0 0 4px #292929}.settings-modal a{padding:0}.settings-modal .controls-group{display:-webkit-box;display:-ms-flexbox;display:flex;margin:22px 0}.settings-modal .controls-group .controls{-webkit-box-flex:1;-ms-flex:1;flex:1}.settings-modal .help-text{font-size:90%;margin-top:8px}.settings-modal label{margin-right:10px;margin-top:5px;text-align:right;width:25%}.settings-modal input,.settings-modal select{border:1px solid #ccc;font-size:13px;height:26px}.application.dark .settings-modal input,.application.dark .settings-modal select{background:#5d5c5b;border-color:#7c7a78;color:#e9e9e9}.application.dark .settings-modal input::-webkit-input-placeholder,.application.dark .settings-modal select::-webkit-input-placeholder{color:#a7a6a5;opacity:1}.application.dark .settings-modal input::-moz-placeholder,.application.dark .settings-modal select::-moz-placeholder{color:#a7a6a5;opacity:1}.application.dark .settings-modal input:-ms-input-placeholder,.application.dark .settings-modal select:-ms-input-placeholder{color:#a7a6a5;opacity:1}.application.dark .settings-modal input::-ms-input-placeholder,.application.dark .settings-modal select::-ms-input-placeholder{color:#a7a6a5;opacity:1}.application.dark .settings-modal input::placeholder,.application.dark .settings-modal select::placeholder{color:#a7a6a5;opacity:1}.settings-modal input[type=checkbox],.settings-modal select[type=checkbox]{height:auto;margin-right:3px}.application.dark .settings-modal select{background:#6a6866;border:1px solid #7c7a78;border-radius:5px}.settings-modal .controls-input-vgroup input{border:1px solid #ccc;padding:4px 8px;width:100%}.settings-modal .controls-input-vgroup input:first-child{border-radius:4px 4px 0 0}.settings-modal .controls-input-vgroup input:last-child{border-radius:0 0 4px 4px;margin-top:-2px}.settings-modal .controls-checkbox{display:inline-block;margin-bottom:5px;text-align:left;width:100%}.settings-modal .appearance-controls{display:-webkit-box;display:-ms-flexbox;display:flex}.settings-modal .appearance-controls .option{-webkit-box-flex:0;-ms-flex:0;flex:0;margin-right:12px;text-align:center}.settings-modal .appearance-controls .option.selected img{border:2px solid #258cdb;-webkit-box-shadow:0 0 2px #258cdb;box-shadow:0 0 2px #258cdb}.application.dark .settings-modal .appearance-controls .option.selected img{border:2px solid #f27e02;-webkit-box-shadow:0 0 2px #f27e02;box-shadow:0 0 2px #f27e02}.settings-modal .appearance-controls .option img{border:1px solid #ccc;border-radius:4px;height:50px;width:75px}.application.dark .settings-modal .appearance-controls .option img{border:1px solid #363636}.settings-enter-active,.settings-leave-active{-webkit-transition:top .33s;transition:top .33s}.settings-enter,.settings-leave-to{top:-400px}.details-table .pagination-controls{background:transparent!important}.details-table .pagination-controls td{text-align:center}.details-table .pagination-controls a{color:#258cdb;text-decoration:none}.application.dark .details-table .pagination-controls a{color:#f27e02}.counter.database-slow-query{border-color:#d7a175!important}.application.dark .counter.database-slow-query{border-color:#d0b78b!important}.database-slow-query{background:#fffae2;color:#a85919}.database-slow-query:nth-child(2n){background:#fff5c2!important}.database-slow-query .database-query-path>a{color:#d7a175!important}.application.dark .database-slow-query{background:#382f00;color:#fad89f}.application.dark .database-slow-query:nth-child(2n){background:#2e2600!important}.application.dark .database-slow-query .database-query-path>a{color:#d0b78b!important}.database-query-bindings,.log-message-context{margin-top:2px}.command-output{background:#333;border-radius:6px;font-family:Menlo,monospace;overflow:auto;padding:16px 12px;white-space:pre}.application.dark .command-output{background:#111}.performance-log{margin-top:25px}.performance-log table thead .count{background:#c28451;color:#fffae2;border-radius:8px;margin-left:2px;padding:0 8px}.application.dark .performance-log table thead .count{background:#fad89f;color:#382f00}.performance-log table tr{background:transparent!important;color:#a85919}.performance-log table tr:nth-child(2n){background:#fffae2!important}.performance-log table tr .log-message-path>a{color:#d7a175!important}.application.dark .performance-log table tr{color:#fad89f}.application.dark .performance-log table tr:nth-child(2n){background:#382f00!important}.application.dark .performance-log table tr .log-message-path>a{color:#d0b78b!important}.performance-log table tr:first-child td{border-top:1px solid #d7a175!important}.application.dark .performance-log table tr:first-child td{border-top:1px solid #d0b78b!important}.performance-log table tr .toggle-filter{color:#d7a175!important}.application.dark .performance-log table tr .toggle-filter{color:#d0b78b!important}.performance-log table tr.filter{background:#fffae2!important}.application.dark .performance-log table tr.filter{background:#382f00!important}.performance-log table tr.filter td{border-top:1px solid #d7a175!important}.application.dark .performance-log table tr.filter td{border-top:1px solid #d0b78b!important}.performance-log table tr.filter td .example,.performance-log table tr.filter td .fa-search,.performance-log table tr.filter td input{color:#d7a175!important}.application.dark .performance-log table tr.filter td .example,.application.dark .performance-log table tr.filter td .fa-search,.application.dark .performance-log table tr.filter td input{color:#d0b78b!important}.timeline-item-tags{font-size:85%;opacity:.77}.job-options[data-v-e2548e86]{margin:2px 0;width:100%}.job-options span[data-v-e2548e86]{display:block;white-space:nowrap}.job-status-text[data-v-e2548e86]{background:#fffae2;border-radius:8px;color:#a85919;font-size:9px;padding:2px 6px;text-transform:uppercase}.application.dark .job-status-text[data-v-e2548e86]{background:#382f00;color:#fad89f}.job-status-text.is-success[data-v-e2548e86]{background:#e3eccb;color:#586336}.application.dark .job-status-text.is-success[data-v-e2548e86]{background:#293800;color:#e3fa9e}.job-status-text.is-error[data-v-e2548e86]{background:#ffebeb;color:#c51f24}.application.dark .job-status-text.is-error[data-v-e2548e86]{background:#380000;color:#ed797a}.views-view-name{margin-bottom:3px}.split-view-details{overflow:hidden}.sidebar-section .section-header{-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-bottom:1px solid #d1d1d1;display:-webkit-box;display:-ms-flexbox;display:flex;font-weight:700;padding:5px 10px}.application.dark .sidebar-section .section-header{border-bottom:1px solid #363636}.sidebar-section .section-header .section-title{cursor:default}.sidebar-section .section-header .toggle-filter{display:none;margin-left:auto}.sidebar-section .section-header:hover .toggle-filter{display:block}.sidebar-section table{border-bottom:1px solid #d1d1d1;font-size:11px;margin-bottom:0}.application.dark .sidebar-section table{border-bottom:1px solid #363636}.sidebar-section table thead th:last-child{padding-right:20px;position:relative}.sidebar-section table thead .fa-angle-down,.sidebar-section table thead .fa-angle-up{font-weight:700;margin-left:4px}.sidebar-section table thead .toggle-filter{position:absolute;right:4px;top:4px;visibility:hidden}.sidebar-section table thead:hover .toggle-filter{visibility:visible}.application.dark .sidebar-section table tr:first-child td,.sidebar-section table tr:first-child td{border-top:0}.sidebar-section table tr:nth-child(2n){background:#f5f5f5}.application.dark .sidebar-section table tr:nth-child(2n){background:#1b1b1b}.sidebar-section table th{font-size:12px;font-weight:600;padding:4px 2px;white-space:nowrap}.sidebar-section table td{padding:8px 10px;vertical-align:top}.sidebar-section table td .key{font-size:11px;font-weight:600;margin-bottom:3px;white-space:nowrap}.sidebar-section table td .value{word-break:break-all}.sidebar-section table .filter{background:none!important}.sidebar-section table .filter td{border-bottom:1px solid #d1d1d1;border-top:0;padding:2px 10px}.application.dark .sidebar-section table .filter td{border-bottom:1px solid #363636;border-top:0}.sidebar-section table .filter label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;position:relative}.sidebar-section table .filter .fa-search{color:#696969;margin:0 4px}.sidebar-section table .filter input{background:transparent;border:none;width:100%}.sidebar-section table .filter input:focus{outline:none}.sidebar-section table .filter input::-webkit-input-placeholder{color:#a9a9a9}.sidebar-section table .filter input::-moz-placeholder{color:#a9a9a9}.sidebar-section table .filter input:-ms-input-placeholder{color:#a9a9a9}.sidebar-section table .filter input::-ms-input-placeholder{color:#a9a9a9}.sidebar-section table .filter input::placeholder{color:#a9a9a9}.application.dark .sidebar-section table .filter input::-webkit-input-placeholder{color:#777}.application.dark .sidebar-section table .filter input::-moz-placeholder{color:#777}.application.dark .sidebar-section table .filter input:-ms-input-placeholder{color:#777}.application.dark .sidebar-section table .filter input::-ms-input-placeholder{color:#777}.application.dark .sidebar-section table .filter input::placeholder{color:#777}.application.dark .sidebar-section table .filter input{color:#b2b2b2}.sidebar-section table .filter .example{color:#a9a9a9;font-size:11px;pointer-events:none;position:absolute;right:0}.application.dark .sidebar-section table .filter .example{color:#777}.command-tab{background:#fff}.application.dark .command-tab{background:#1f1f1f}.queue-job-tab{background:#fff}.application.dark .queue-job-tab{background:#1f1f1f}.queue-job-tab .data-value{border-bottom:1px solid #d1d1d1;padding:8px 10px}.application.dark .queue-job-tab .data-value{border-bottom:1px solid #363636}.request-tab{background:#fff}.application.dark .request-tab{background:#1f1f1f}.request-tab .data-raw td{white-space:pre}.request-tab .session-user{-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-bottom:1px solid #d1d1d1;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:110%;padding:8px 10px}.application.dark .request-tab .session-user{border-bottom:1px solid #363636}.request-tab .session-user .fa-user{color:grey;font-size:110%;margin-right:8px}.request-tab .session-user .name{margin-right:6px}.request-tab .session-user .dimmed{color:grey;font-size:90%}.application.dark .request-tab .session-user .dimmed{color:#767676}.request-tab .session-user .session-user-details{margin-left:auto}.test-tab .test-status-message{border-bottom:1px solid #d1d1d1;background:#ffebeb;color:#c51f24;padding:12px 10px;font-size:13px}.application.dark .test-tab .test-status-message{border-bottom:1px solid #363636}.test-tab .test-assert .assert-name{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.test-tab .test-assert .assert-name .assert-name-content{-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto;font-size:11px;font-weight:600;margin-bottom:3px;max-width:100%;white-space:nowrap;margin-bottom:5px;color:#657e1b}.application.dark .test-tab .test-assert .assert-name .assert-name-content{color:#d0ed78}.test-tab .test-assert .assert-name .assert-name-content.assert-failed{color:#c51f24}.application.dark .test-tab .test-assert .assert-name .assert-name-content.assert-failed{color:#ed797a}.test-tab .test-assert .assert-name .assert-name-trace{-webkit-box-flex:0;-ms-flex:0;flex:0}.test-tab .test-assert .pretty-jason{font-size:11px}.request-sidebar{background:#fafafa;border-top:1px solid #d1d1d1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-ms-flex-negative:0;flex-shrink:0;height:25%}.application.dark .request-sidebar{background:#1b1b1b;border-top:1px solid #363636}.request-sidebar.large{height:33%}@media screen and (min-width:900px){.request-sidebar{border-left:1px solid #d1d1d1;border-top:0;height:100%;width:300px}.application.dark .request-sidebar{border-left:1px solid #363636;border-top:0}.request-sidebar.large{height:100%;width:400px}}@media screen and (min-width:1100px){.request-sidebar{width:360px}.request-sidebar.large{width:460px}}.request-sidebar .sidebar-header{background:#fff;border-bottom:1px solid #ccc;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;font-size:12px;height:31px;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;line-height:31px;width:100%}.application.dark .request-sidebar .sidebar-header{background:#1f1f1f;border-bottom:1px solid #363636}.request-sidebar .sidebar-header .sidebar-title{padding:0 10px}.request-sidebar .sidebar-header .sidebar-actions{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:15px;padding:0 5px}.request-sidebar .sidebar-header .sidebar-actions a{padding:0 5px}.request-sidebar .sidebar-content{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:auto}.request-sidebar .sidebar-date,.request-sidebar .sidebar-id{margin:10px 0;text-align:center}.request-sidebar .sidebar-id{color:grey}.application.dark .request-sidebar .sidebar-id{color:#767676}.split-view-requests{border-bottom:1px solid #d1d1d1;cursor:default;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-ms-flex-negative:0;flex-shrink:0;height:25%;width:100%}.application.dark .split-view-requests{border-bottom:1px solid #363636}.split-view-requests.large .notifications-count{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.split-view-requests.large .notifications-count .errors-count{margin-left:5px}.split-view-requests.large .notifications-count .errors-count svg{margin-right:0}@media screen and (min-width:900px){.split-view-requests{border-bottom:0;border-right:1px solid #d1d1d1;height:100%;width:300px}.application.dark .split-view-requests{border-right:1px solid #363636}.split-view-requests.large{width:400px}}@media screen and (min-width:1100px){.split-view-requests{width:320px}.split-view-requests.large{width:420px}}.split-view-requests table{line-height:1.4;table-layout:fixed}.split-view-requests tr{height:28px}.split-view-requests tr:first-child td{border-top:1px solid #d1d1d1}.application.dark .split-view-requests tr:first-child td{border-top:1px solid #363636}.split-view-requests tr:nth-child(2n):not(.filler){background:#f3f3f3}.application.dark .split-view-requests tr:nth-child(2n):not(.filler){background:#181818}.split-view-requests tr:nth-child(2n):not(.filler) .notifications-count{background:hsla(0,0%,95.3%,.8)}.application.dark .split-view-requests tr:nth-child(2n):not(.filler) .notifications-count{background:rgba(27,27,27,.8)}.split-view-requests tr.selected td{background:#2786f3!important;color:#fff}.application.dark .split-view-requests tr.selected td{background:#f27e02!important}.application.dark .split-view-requests tr.selected small,.split-view-requests tr.selected small{color:#fff}.split-view-requests tr.selected .notifications-count{background:#2786f3!important}.application.dark .split-view-requests tr.selected .notifications-count .errors-count,.application.dark .split-view-requests tr.selected .notifications-count .warnings-count,.application.dark .split-view-requests tr.selected .notifications-count .warnings-count svg,.split-view-requests tr.selected .notifications-count .errors-count,.split-view-requests tr.selected .notifications-count .warnings-count,.split-view-requests tr.selected .notifications-count .warnings-count svg{color:#fff}.application.dark .split-view-requests tr.selected .notifications-count{background:#f27e02!important}.application.dark .split-view-requests tr.selected .method-text,.split-view-requests tr.selected .method-text{color:#fff}.application.dark .split-view-requests tr.selected .status-text,.application.dark .split-view-requests tr.selected .type-text,.split-view-requests tr.selected .status-text,.split-view-requests tr.selected .type-text{background:transparent;color:#fff}.split-view-requests tr.sizing{height:0}.split-view-requests tr.sizing td{border-top:0;padding:0}.application.dark .split-view-requests tr.sizing td{border-top:0}.split-view-requests tr.filler{height:auto}.split-view-requests th{border-bottom:1px solid #d1d1d1;font-weight:400;height:30px;line-height:1.1;padding:2px 4px;white-space:nowrap}.application.dark .split-view-requests th{border-bottom:1px solid #363636}.split-view-requests td{overflow:hidden;padding:8px 6px;vertical-align:middle;white-space:nowrap}.split-view-requests small{color:grey;font-size:100%}.application.dark .split-view-requests small{color:#767676}.split-view-requests big{font-size:115%}.split-view-requests .status{text-align:center;width:52px}.split-view-requests .duration{text-align:right;width:68px}.split-view-requests .type-text{background:#cbdeec;border-radius:3px;color:#365063;font-size:80%;margin-right:2px;padding:1px 3px;vertical-align:1px}.application.dark .split-view-requests .type-text{background:#002e52;color:#6ebef7}.split-view-requests .method-text{color:grey;font-size:90%}.application.dark .split-view-requests .method-text{color:#767676}.split-view-requests .status-text{background:#e3eccb;border-radius:8px;color:#586336;padding:2px 6px;text-transform:uppercase}.application.dark .split-view-requests .status-text{background:#293800;color:#e3fa9e}.split-view-requests .status-text.client-error{background:#fffae2;color:#a85919}.application.dark .split-view-requests .status-text.client-error{background:#382f00;color:#fad89f}.split-view-requests .status-text.server-error{background:#ffebeb;color:#c51f24}.application.dark .split-view-requests .status-text.server-error{background:#380000;color:#ed797a}.split-view-requests .status-text.status-text-small{font-size:9px}.split-view-requests .notifications-count{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background:hsla(0,0%,98%,.8);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;float:right;height:100%;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;letter-spacing:-.5px;margin-right:-6px;padding:0 6px;position:relative}.split-view-requests .notifications-count .errors-count{color:#b3492e}.application.dark .split-view-requests .notifications-count .errors-count{color:#ed797a}.split-view-requests .notifications-count .errors-count svg{margin-right:1px}.split-view-requests .notifications-count .warnings-count{color:#a85919}.application.dark .split-view-requests .notifications-count .warnings-count{color:#fad89f}.split-view-requests .notifications-count .warnings-count svg{color:#f4bd00}.application.dark .split-view-requests .notifications-count .warnings-count svg{color:#fad89f}.application.dark .split-view-requests .notifications-count{background:rgba(27,27,27,.8)}.split-view-requests .requests-header{height:31px}.split-view-requests .requests-search{border-bottom:1px solid #d1d1d1;padding:6px 2px}.application.dark .split-view-requests .requests-search{border-bottom:1px solid #363636}.split-view-requests .requests-search label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;position:relative}.split-view-requests .requests-search .fa-search{color:#696969;margin:0 4px}.split-view-requests .requests-search input{background:transparent;border:none;width:100%}.split-view-requests .requests-search input:focus{outline:none}.split-view-requests .requests-search input::-webkit-input-placeholder{color:#a9a9a9}.split-view-requests .requests-search input::-moz-placeholder{color:#a9a9a9}.split-view-requests .requests-search input:-ms-input-placeholder{color:#a9a9a9}.split-view-requests .requests-search input::-ms-input-placeholder{color:#a9a9a9}.split-view-requests .requests-search input::placeholder{color:#a9a9a9}.application.dark .split-view-requests .requests-search input::-webkit-input-placeholder{color:#777}.application.dark .split-view-requests .requests-search input::-moz-placeholder{color:#777}.application.dark .split-view-requests .requests-search input:-ms-input-placeholder{color:#777}.application.dark .split-view-requests .requests-search input::-ms-input-placeholder{color:#777}.application.dark .split-view-requests .requests-search input::placeholder{color:#777}.application.dark .split-view-requests .requests-search input{color:#b2b2b2}.split-view-requests .requests-search .example{color:#a9a9a9;font-size:11px;pointer-events:none;position:absolute;right:0}.application.dark .split-view-requests .requests-search .example{color:#777}.split-view-requests .requests-container{background:#fafafa;height:calc(100% - 31px);overflow:auto}.split-view-requests .requests-container table{height:100%}.application.dark .split-view-requests .requests-container{background:#1b1b1b}.split-view-requests .load-more{-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-bottom:1px solid #d1d1d1;display:-webkit-box;display:-ms-flexbox;display:flex;height:36px;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.application.dark .split-view-requests .load-more{border-bottom:1px solid #363636}.split-view-requests .load-more a{color:#404040;text-decoration:none}.split-view-requests .load-more a:hover{color:#258cdb}.application.dark .split-view-requests .load-more a:hover{color:#f27e02}.application.dark .split-view-requests .load-more a{color:#b2b2b2}.whats-new{background:#fff;font-size:14px;height:calc(100% - 31px);overflow:auto;position:absolute;top:31px;width:100%;z-index:999}.application.dark .whats-new{background:#1f1f1f}.whats-new .whats-new-content{margin:0 auto;max-width:820px;padding:4px 16px 20px}.whats-new h1{font-size:18px;font-weight:400;margin:50px 0;text-align:center;width:100%}.whats-new h2{font-size:16px;font-weight:500}.whats-new .whats-new-section{margin-bottom:50px}.whats-new .whats-new-section img{border-bottom:1px solid #eee;margin-top:10px;max-width:100%}.application.dark .whats-new .whats-new-section img{border-bottom:1px solid #444}.whats-new .whats-new-actions{padding-top:25px;text-align:center;width:100%}.whats-new .whats-new-actions a{color:#258cdb;font-size:15px;margin:0 15px;text-decoration:none}.application.dark .whats-new .whats-new-actions a{color:#f27e02}.whats-new .whats-new-actions a.actions-show-more{border:1px solid #258cdb;border-radius:4px;padding:6px 12px}.application.dark .whats-new .whats-new-actions a.actions-show-more{border-color:#f27e02}.whats-new .whats-new-actions p{margin-top:45px}.pretty-jason{font-family:Menlo,Monaco,Consolas,monospace;font-size:12px;padding:0;margin:0;list-style:none;color:#222}.pretty-jason ul{list-style:none;padding-left:12px}.pretty-jason li{padding:1px 0}.pretty-jason-key{color:#881280}.pretty-jason-value-number{color:#1c00cf}.pretty-jason-value-string{color:#c41a16}.pretty-jason-value-null,.pretty-jason-value-undefined{color:grey}.pretty-jason-value-anonymous-function,.pretty-jason-value-boolean,.pretty-jason-value-resource{color:#132ba2}.pretty-jason-icon,.pretty-jason-icon-closed,.pretty-jason-icon-open{display:inline-block;width:0;height:0}.pretty-jason-icon{width:12px}.pretty-jason-icon-closed{border-style:solid;border-width:4.5px 0 4.5px 7.8px;border-color:transparent transparent transparent #7f7f80}.pretty-jason-icon-open{border-style:solid;border-width:7.8px 4.5px 0 4.5px;border-color:#7f7f80 transparent transparent transparent}.pretty-jason-preview{font-style:italic}.pretty-jason-preview:before{content:"{"}.pretty-jason-preview:after{content:"}"}.pretty-jason-preview-item:after{content:", "}.pretty-jason-preview .pretty-jason-preview-item:last-child:after{content:""}*{-webkit-box-sizing:border-box;box-sizing:border-box}html{background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:11px;overflow:hidden}body,html{height:100%}body{font-size:100%;margin:0}.application.dark,body.dark{background:#1f1f1f;color:#b2b2b2}table{border-collapse:collapse;font-size:100%;width:100%}table td,table th{text-align:left}a{color:#696969;cursor:default}a:hover{color:#3b3b3b}.application.dark a:hover{color:#f27e02}.application.dark a{color:grey}.split-view{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%;width:100%}@media screen and (min-width:900px){.split-view{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}}.split-view-details{-webkit-box-flex:1;-ms-flex:1;flex:1;min-width:0}@media screen and (min-width:900px){.split-view-details{height:100%}}.split-view-details{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.details-header,.split-view-details{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative}.details-header{background:#fff;border-bottom:1px solid #ccc;-ms-flex-negative:0;flex-shrink:0;height:31px;z-index:500}.application.dark .details-header{background:#1f1f1f;border-bottom:1px solid #363636}.details-header .details-header-tabs{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1;flex:1}.details-header .details-header-tabs .details-header-tab{color:#404040;cursor:default;-webkit-box-flex:1;-ms-flex:1;flex:1;font-size:12px;line-height:31px;text-align:center;text-decoration:none}.details-header .details-header-tabs .details-header-tab.active{color:#258cdb}.application.dark .details-header .details-header-tabs .details-header-tab.active{color:#f27e02}.application.dark .details-header .details-header-tabs .details-header-tab{color:#9e9e9e}.details-header .icons{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:15px;padding:0 5px}.details-header .icons a{padding:0 5px}.details-header .icons a.active{color:#258cdb}.application.dark .details-header .icons a.active{color:#f27e02}.details-content{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:auto;padding:10px}.details-content h3{border-bottom:1px solid #d1d1d1;font-size:13px;font-weight:600;margin:0;padding:4px 10px}.details-content table{font-size:12px;margin-bottom:18px}.details-content table thead th:last-child{padding-right:20px;position:relative}.details-content table thead .fa-angle-down,.details-content table thead .fa-angle-up{font-weight:700;margin-left:4px}.details-content table thead .toggle-filter{position:absolute;right:4px;top:4px;visibility:hidden}.details-content table thead:hover .toggle-filter{visibility:visible}.details-content table tr:first-child td{border-top:1px solid #d1d1d1}.application.dark .details-content table tr:first-child td{border-top:1px solid #363636}.details-content table tr:nth-child(2n){background:#f5f5f5}.application.dark .details-content table tr:nth-child(2n){background:#1b1b1b}.details-content table th{font-size:13px;font-weight:600;padding:4px 10px;white-space:nowrap}.details-content table td{padding:8px 10px;vertical-align:top}.details-content table td.key{font-size:12px;white-space:nowrap}.details-content table td.value{word-break:break-all}.details-content table .filter{background:none!important}.details-content table .filter td{border-top:1px solid #d1d1d1;padding:2px 10px}.application.dark .details-content table .filter td{border-top:1px solid #363636}.details-content table .filter label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;position:relative}.details-content table .filter .fa-search{color:#696969;margin:0 4px}.details-content table .filter input{background:transparent;border:none;width:100%}.details-content table .filter input:focus{outline:none}.details-content table .filter input::-webkit-input-placeholder{color:#a9a9a9}.details-content table .filter input::-moz-placeholder{color:#a9a9a9}.details-content table .filter input:-ms-input-placeholder{color:#a9a9a9}.details-content table .filter input::-ms-input-placeholder{color:#a9a9a9}.details-content table .filter input::placeholder{color:#a9a9a9}.application.dark .details-content table .filter input::-webkit-input-placeholder{color:#777}.application.dark .details-content table .filter input::-moz-placeholder{color:#777}.application.dark .details-content table .filter input:-ms-input-placeholder{color:#777}.application.dark .details-content table .filter input::-ms-input-placeholder{color:#777}.application.dark .details-content table .filter input::placeholder{color:#777}.application.dark .details-content table .filter input{color:#b2b2b2}.details-content table .filter .example{color:#a9a9a9;font-size:11px;pointer-events:none;position:absolute;right:0}.application.dark .details-content table .filter .example{color:#777}.details-content .counters-row{display:-webkit-box;display:-ms-flexbox;display:flex;margin:0 0 10px}.details-content .counters-row .counter{border:1px solid #d1d1d1;border-radius:3px;-webkit-box-shadow:0 2px 3px #e5e5e5;box-shadow:0 2px 3px #e5e5e5;margin:0 5px;-webkit-box-flex:0;-ms-flex:0 1 120px;flex:0 1 120px;padding:8px 20px 10px;text-align:center}.application.dark .details-content .counters-row .counter{border:1px solid #404040;-webkit-box-shadow:0 2px 3px #292929;box-shadow:0 2px 3px #292929}.details-content .counters-row .counter:first-child{margin-left:0}.details-content .counters-row .counter:last-child{margin-right:0}.details-content .counters-row .counter .counter-value{font-size:175%;white-space:nowrap}.details-content .counters-row .counter .counter-title{font-size:120%;font-variant:small-caps;text-transform:lowercase}.details-content .request-tab-info{display:-webkit-box;display:-ms-flexbox;display:flex;margin:4px 0 8px}.details-content .request-tab-info .field{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;margin:0 5px;padding:0 20px}.details-content .request-tab-info .field:first-child{margin-left:0}.details-content .request-tab-info .field:last-child{margin-right:0}.details-content .request-tab-info .field .field-value{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1;flex:1;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;font-size:130%;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.details-content .request-tab-info .field .field-value .small{color:#888;font-size:75%;padding-top:2px}.details-content .request-tab-info .field .field-title{font-size:120%;font-variant:small-caps;padding-bottom:5px;text-transform:lowercase}.details-content .request-tab-info .field.action{-webkit-box-flex:1;-ms-flex:1;flex:1}.details-content .request-tab-info .field.link{font-size:90%;padding:0}.details-content .performance-chart-container{-webkit-box-flex:0;-ms-flex:0 1 100px;flex:0 1 100px}.details-content .performance-chart{height:60px;margin:0 auto;position:relative;width:60px}.details-content .performance-chart-legend.style1{border-left:3px solid #78b1de!important}.application.dark .details-content .performance-chart-legend.style1{border-left:3px solid #649dca!important}.details-content .performance-chart-legend.style2{border-left:3px solid #e79697!important}.application.dark .details-content .performance-chart-legend.style2{border-left:3px solid #d38283!important}.details-content .performance-chart-legend.style3{border-left:3px solid #b1ca6d!important}.application.dark .details-content .performance-chart-legend.style3{border-left:3px solid #9db659!important}.details-content .performance-chart-legend.style4{border-left:3px solid #ba94e6!important}.application.dark .details-content .performance-chart-legend.style4{border-left:3px solid #a680d2!important}.details-content .performance-tabs{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1;flex:1;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding:8px 0 4px}.details-content .performance-tabs .performance-tab{color:#404040;cursor:default;font-size:12px;line-height:31px;padding:0 31px;text-align:center;text-decoration:none}.details-content .performance-tabs .performance-tab.active{color:#258cdb}.application.dark .details-content .performance-tabs .performance-tab.active{color:#f27e02}.application.dark .details-content .performance-tabs .performance-tab{color:#9e9e9e}.details-content .timeline{position:relative}.details-content .timeline table{table-layout:fixed}.details-content .timeline .timeline-description,.details-content .timeline .timeline-duration{display:none}.details-content .timeline.table-view .timeline-description,.details-content .timeline.table-view .timeline-duration{display:table-cell}.details-content .timeline.table-view .timeline-graph{padding:12px 0 0;width:25%}.details-content .timeline.table-view .timeline-bar .label,.details-content .timeline.table-view .timeline-legend{display:none}.details-content .timeline-controls{position:absolute;right:0;top:4px;z-index:100}.details-content .timeline-controls .timeline-control-group{margin:0 5px}.details-content .timeline-controls .toggle-filter{position:static;visibility:visible}.details-content .timeline-controls .fa-bar-chart{font-size:110%}.details-content .timeline-controls .fa-bars{font-size:115%}.details-content .timeline-controls a{margin:0 2px;text-decoration:none}.details-content .timeline-controls a.active{color:#258cdb}.application.dark .details-content .timeline-controls a.active{color:#f27e02}.application.dark .details-content .timeline-controls a{color:#9e9e9e}.details-content .timeline-graph{background-image:-webkit-gradient(linear,left top,right top,color-stop(99.5%,transparent),color-stop(99.5%,#e5e5e5),to(#e5e5e5));background-image:linear-gradient(90deg,transparent 99.5%,#e5e5e5 0,#e5e5e5);background-size:80px 1px;padding:6px 4px 8px}.application.dark .details-content .timeline-graph{background-image:-webkit-gradient(linear,left top,right top,color-stop(99.5%,transparent),color-stop(99.5%,#333),to(#333));background-image:linear-gradient(90deg,transparent 99.5%,#333 0,#333)}.details-content .timeline-legend{color:#a1a1a1;height:14px;margin-bottom:6px;margin-top:-2px;position:relative}.application.dark .details-content .timeline-legend{color:#666}.details-content .timeline-legend .timeline-legend-time{font-size:10px;font-weight:400;position:absolute;top:0}.details-content .timeline-bar .label{color:#365063;font-size:11.5px;margin-bottom:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.details-content .timeline-bar .bar{background:#78b1de;border:1px solid #4295c5;border-radius:3px;padding:3px}.application.dark .details-content .timeline-bar .bar{background:#649dca;border:1px solid #2e81b1}.details-content .timeline-bar.style1 .label{color:#365063}.application.dark .details-content .timeline-bar.style1 .label{color:#a3b5c2}.details-content .timeline-bar.style1 .bar{background:#78b1de;border:1px solid #4295c5}.application.dark .details-content .timeline-bar.style1 .bar{background:#649dca;border:1px solid #2e81b1}.details-content .timeline-bar.style2 .label{color:#633636}.application.dark .details-content .timeline-bar.style2 .label{color:#c2a3a4}.details-content .timeline-bar.style2 .bar{background:#e79697;border:1px solid #d16b6c}.application.dark .details-content .timeline-bar.style2 .bar{background:#d38283;border:1px solid #bd5758}.details-content .timeline-bar.style3 .label{color:#586336}.application.dark .details-content .timeline-bar.style3 .label{color:#bac2a3}.details-content .timeline-bar.style3 .bar{background:#b1ca6d;border:1px solid #98ba51}.application.dark .details-content .timeline-bar.style3 .bar{background:#9db659;border:1px solid #84a63d}.details-content .timeline-bar.style4 .label{color:#4a3663}.application.dark .details-content .timeline-bar.style4 .label{color:#b1a3c2}.details-content .timeline-bar.style4 .bar{background:#ba94e6;border:1px solid #9772b5}.application.dark .details-content .timeline-bar.style4 .bar{background:#a680d2;border:1px solid #835ea1}.details-content .timeline-duration{text-align:right;width:100px}.details-content .profiler .profiler-controls{position:absolute;right:0;top:4px}.details-content .profiler .profiler-controls .profiler-control-group{margin:0 5px}.details-content .profiler .profiler-controls .profiler-show-metric{font-size:105%}.details-content .profiler .profiler-controls .profiler-show-metric .fa-clock-o{font-size:110%}.details-content .profiler .profiler-controls .profiler-shown-fraction{font-size:85%}.details-content .profiler .profiler-controls .toggle-filter{position:static;visibility:visible}.details-content .profiler .profiler-controls a{margin:0 2px;text-decoration:none}.details-content .profiler .profiler-controls a.active{color:#258cdb}.application.dark .details-content .profiler .profiler-controls a.active{color:#f27e02}.application.dark .details-content .profiler .profiler-controls a{color:#9e9e9e}.details-content .profiler .profiler-metric{white-space:nowrap}.details-content .profiler .profiler-function{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.details-content .profiler .profiler-function .profiler-function-name{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;word-break:break-all}.details-content .profiler .profiler-function .profiler-path{color:#aaa;-webkit-box-flex:0;-ms-flex:0;flex:0;font-size:90%;margin-top:3px}.details-content .profiler-loading,.details-content .profiler-not-available{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;font-size:16px;padding:40px 0;text-align:center;width:100%}.details-content .profiler-loading .message,.details-content .profiler-not-available .message{color:#aaa;font-size:75%;margin:10px 0 0 0}.details-content .profiler-not-available{font-size:15px;line-height:1.5}.details-content .profiler-not-available .message{font-size:90%;margin:15px 0 0}.details-content .profiler-not-available a{color:#aaa;cursor:pointer}.details-content .profiler-not-available .profiler-enable a{color:#258cdb}.application.dark .details-content .profiler-not-available .profiler-enable a{color:#f27e02}.details-content .log-row.error{background:#ffebeb;color:#c51f24}.details-content .log-row.error:nth-child(2n){background:#ffe0e0}.details-content .log-row.error .log-message-path{color:#dd888b}.application.dark .details-content .log-row.error{background:#380000;color:#ed797a}.application.dark .details-content .log-row.error:nth-child(2n){background:#2e0000}.application.dark .details-content .log-row.error .log-message-path{color:#c3797b}.details-content .log-row.warning{background:#fffae2;color:#a85919}.details-content .log-row.warning:nth-child(2n){background:#fff5c2}.details-content .log-row.warning .log-message-path{color:#d7a175}.application.dark .details-content .log-row.warning{background:#382f00;color:#fad89f}.application.dark .details-content .log-row.warning:nth-child(2n){background:#2e2600}.application.dark .details-content .log-row.warning .log-message-path{color:#d0b78b}.details-content .log-date,.details-content .log-level{width:70px}.details-content .log-message{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.details-content .log-message .log-message-content{-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto;max-width:100%}.details-content .log-message .log-message-exception{-webkit-box-flex:0;-ms-flex:0;flex:0;font-size:90%;margin:3px 5px 0 0;white-space:nowrap}.details-content .log-message .log-message-exception .exception-previous{border:1px solid #aaa;border-radius:4px;text-decoration:none;padding:2px 4px;margin-right:5px}.application.dark .details-content .log-message .log-message-exception .exception-previous{border-color:grey}.details-content .log-message .log-message-path{color:#aaa;-webkit-box-flex:0;-ms-flex:0;flex:0;font-size:90%;margin-top:3px}.application.dark .details-content .log-message .log-message-path{color:#777}.details-content .fired-event{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.details-content .fired-event .fired-event-content{-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto;max-width:100%}.details-content .fired-event .fired-event-path{color:#aaa;-webkit-box-flex:0;-ms-flex:0;flex:0;font-size:90%;margin-top:3px}.application.dark .details-content .fired-event .fired-event-path{color:#777}.details-content .fired-event-details h4{margin:6px 0 3px}.details-content .fired-event-actions{padding-left:5px;width:10px}.details-content .database-query{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.details-content .database-query .database-query-content{-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto;max-width:100%}.details-content .database-query .database-query-path{color:#aaa;-webkit-box-flex:0;-ms-flex:0;flex:0;font-size:90%;margin-top:3px}.application.dark .details-content .database-query .database-query-path{color:#777}.details-content .database-duration{text-align:right;white-space:nowrap}.details-content .cache-query-type{font-size:125%;font-variant:small-caps}.details-authentication-overlay,.details-error-overlay,.details-loading-overlay{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background:#fff;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;font-size:16px;height:calc(100% - 31px);-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;left:0;position:absolute;top:31px;width:100%;z-index:999}.application.dark .details-authentication-overlay,.application.dark .details-error-overlay,.application.dark .details-loading-overlay{background:#1f1f1f}.details-authentication-overlay .fa-exclamation-circle,.details-authentication-overlay .fa-lock,.details-error-overlay .fa-exclamation-circle,.details-error-overlay .fa-lock,.details-loading-overlay .fa-exclamation-circle,.details-loading-overlay .fa-lock{color:#696969;font-size:46px}.details-authentication-overlay .title,.details-error-overlay .title,.details-loading-overlay .title{margin:10px 0 0 0}.details-authentication-overlay .message,.details-error-overlay .message,.details-loading-overlay .message{color:#aaa;font-size:75%;margin:5px 0 0 0}.details-authentication-overlay{text-align:center}.details-authentication-overlay .message,.details-authentication-overlay .title{font-size:80%}.details-authentication-overlay .title.failed{display:none}.details-authentication-overlay p{margin:1.3em 0}.details-authentication-overlay input{background:#eee;border:1px solid #eee;border-radius:4px;font-size:14px;height:30px;padding:0 10px}.application.dark .details-authentication-overlay input{background:#2e2e2e;border:1px solid #2e2e2e;color:#ccc}.details-authentication-overlay button{background:transparent;border:none;color:#258cdb;font-size:90%}.application.dark .details-authentication-overlay button{color:#f27e02}.details-authentication-overlay.failed .title{display:none}.details-authentication-overlay.failed .title.failed{display:block}.details-authentication-overlay.failed .fa-lock{-webkit-animation:shake .77s linear;animation:shake .77s linear}@-webkit-keyframes shake{10%,90%{-webkit-transform:translate(-2px);transform:translate(-2px)}20%,80%{-webkit-transform:translate(3px);transform:translate(3px)}30%,50%,70%{-webkit-transform:translate(-5px);transform:translate(-5px)}40%,60%{-webkit-transform:translate(5px);transform:translate(5px)}}@keyframes shake{10%,90%{-webkit-transform:translate(-2px);transform:translate(-2px)}20%,80%{-webkit-transform:translate(3px);transform:translate(3px)}30%,50%,70%{-webkit-transform:translate(-5px);transform:translate(-5px)}40%,60%{-webkit-transform:translate(5px);transform:translate(5px)}}.stack-trace{cursor:pointer}.stack-trace .popover{cursor:default}.stack-trace a{text-decoration:none}.stack-trace .stack-frame{color:#000;padding:6px 10px;text-align:left;word-break:break-word}.application.dark .stack-trace .stack-frame{color:#b2b2b2}.stack-trace .stack-frame:nth-child(2n){background:#f5f5f5}.application.dark .stack-trace .stack-frame:nth-child(2n){background:#1b1b1b}.stack-trace .stack-frame .stack-frame-call{font-size:12px;padding-bottom:3px}.stack-trace .stack-frame .stack-frame-file{color:#aaa;font-size:11px}.stack-trace .stack-frame.is-vendor .stack-frame-call,.stack-trace .stack-frame.is-vendor .stack-frame-file{font-size:10px}.popover{left:0;padding-top:20px;position:absolute;top:100%;width:300px;z-index:666}.popover.right-aligned{left:auto;right:0}.popover.right-aligned .popover-content:before{left:auto;right:8px}.popover.right-aligned .popover-content:after{left:auto;right:7px}.popover .popover-content{background:#fff;border:1px solid #d1d1d1;border-radius:5px;-webkit-box-shadow:0 0 4px #e5e5e5;box-shadow:0 0 4px #e5e5e5;max-height:400px;overflow:auto;padding:5px 0;text-align:center;width:100%}.application.dark .popover .popover-content{background:#1f1f1f;border:1px solid #404040;-webkit-box-shadow:0 0 4px #292929;box-shadow:0 0 4px #292929}.popover .popover-content:after,.popover .popover-content:before{border-style:solid;content:"";height:0;position:absolute;width:0}.popover .popover-content:before{border-color:transparent transparent #fff transparent;border-width:0 14px 14px 14px;left:8px;top:7px;z-index:500}.application.dark .popover .popover-content:before{border-color:transparent transparent #1f1f1f transparent}.popover .popover-content:after{border-color:transparent transparent #e5e5e5 transparent;border-width:0 15px 15px 15px;left:7px;top:5px}.application.dark .popover .popover-content:after{border-color:transparent transparent #292929 transparent}.popover-container{position:relative}.hidden{display:none}[stupid-table] th{cursor:default}[tab-content]{display:none}.application.dark .pretty-jason{color:#d5d5d5}.application.dark .pretty-jason-key{color:#e36eec}.application.dark .pretty-jason-value-number{color:#997fff}.application.dark .pretty-jason-value-string{color:#e33e3a}.application.dark .pretty-jason-value-null,.application.dark .pretty-jason-value-undefined{color:#7f7f7f}.application.dark .pretty-jason-value-anonymous-function,.application.dark .pretty-jason-value-boolean,.application.dark .pretty-jason-value-resource{color:#8296ff}.application.dark .pretty-jason-icon-closed{border-color:transparent transparent transparent #919191}.application.dark .pretty-jason-icon-open{border-color:#919191 transparent transparent transparent} \ No newline at end of file diff --git a/Clockwork/Web/public/css/app.c0baaa16.css b/Clockwork/Web/public/css/app.c0baaa16.css deleted file mode 100644 index 621ea508..00000000 --- a/Clockwork/Web/public/css/app.c0baaa16.css +++ /dev/null @@ -1 +0,0 @@ -.messages-overlay .parent-request{display:-webkit-box;display:-ms-flexbox;display:flex;font-size:12px;font-weight:600;padding:10px}.messages-overlay .parent-request .parent-method{color:grey;font-size:90%;font-weight:400;margin-right:2px}body.dark .messages-overlay .parent-request .parent-method{color:#767676}.messages-overlay .parent-request .parent-uri{font-weight:400}.messages-overlay .parent-request a{color:#258cdb;font-weight:400;text-decoration:none}body.dark .messages-overlay .parent-request a{color:#f27e02}.messages-overlay .parent-request .parent-close{margin-left:auto}.messages-overlay .exception .exception-info{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background:#ffebeb;color:#c51f24;display:-webkit-box;display:-ms-flexbox;display:flex;padding:10px}.messages-overlay .exception .exception-info:nth-child(2n){background:#ffe0e0}body.dark .messages-overlay .exception .exception-info{background:#380000;color:#ed797a}body.dark .messages-overlay .exception .exception-info:nth-child(2n){background:#2e0000}.messages-overlay .exception .exception-info h3{border-bottom:0;display:inline;font-size:12px}.messages-overlay .exception .exception-info .exception-message{-webkit-box-flex:1;-ms-flex:1;flex:1;font-size:12px}.messages-overlay .exception .exception-info .exception-previous,.messages-overlay .exception .exception-info .exception-trace>a{color:#c51f24;font-size:12px;margin:0 4px}body.dark .messages-overlay .exception .exception-info .exception-previous,body.dark .messages-overlay .exception .exception-info .exception-trace>a{color:#ed797a}.messages-overlay .exception .exception-info .exception-previous{margin-right:4px;text-decoration:none}.messages-overlay .exception .exception-info .exception-trace{display:inline-block}.messages-overlay .update-notification{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background:#e9f3fb;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:110%;padding:10px}body.dark .messages-overlay .update-notification{background:#643302}.messages-overlay .update-notification a{color:#258cdb;text-decoration:none}body.dark .messages-overlay .update-notification a{color:#f27e02}.messages-overlay .update-notification strong{font-weight:500}.messages-overlay .update-notification .updateNotification-close{margin-left:auto}.details-table .pagination-controls{background:transparent!important}.details-table .pagination-controls td{text-align:center}.details-table .pagination-controls a{color:#258cdb;text-decoration:none}body.dark .details-table .pagination-controls a{color:#f27e02}.counter.database-slow-query{border-color:#d7a175!important}body.dark .counter.database-slow-query{border-color:#d0b78b!important}.database-slow-query{background:#fffae2;color:#a85919}.database-slow-query:nth-child(2n){background:#fff5c2!important}.database-slow-query .database-query-path>a{color:#d7a175!important}body.dark .database-slow-query{background:#382f00;color:#fad89f}body.dark .database-slow-query:nth-child(2n){background:#2e2600!important}body.dark .database-slow-query .database-query-path>a{color:#d0b78b!important}.performance-log{margin-top:25px}.performance-log table thead .count{background:#c28451;color:#fffae2;border-radius:8px;margin-left:2px;padding:0 8px}body.dark .performance-log table thead .count{background:#fad89f;color:#382f00}.performance-log table tr{background:transparent!important;color:#a85919}.performance-log table tr:nth-child(2n){background:#fffae2!important}.performance-log table tr .log-message-path>a{color:#d7a175!important}body.dark .performance-log table tr{color:#fad89f}body.dark .performance-log table tr:nth-child(2n){background:#382f00!important}body.dark .performance-log table tr .log-message-path>a{color:#d0b78b!important}.performance-log table tr:first-child td{border-top:1px solid #d7a175!important}body.dark .performance-log table tr:first-child td{border-top:1px solid #d0b78b!important}.performance-log table tr .toggle-filter{color:#d7a175!important}body.dark .performance-log table tr .toggle-filter{color:#d0b78b!important}.performance-log table tr.filter{background:#fffae2!important}body.dark .performance-log table tr.filter{background:#382f00!important}.performance-log table tr.filter td{border-top:1px solid #d7a175!important}body.dark .performance-log table tr.filter td{border-top:1px solid #d0b78b!important}.performance-log table tr.filter td .example,.performance-log table tr.filter td .fa-search,.performance-log table tr.filter td input{color:#d7a175!important}body.dark .performance-log table tr.filter td .example,body.dark .performance-log table tr.filter td .fa-search,body.dark .performance-log table tr.filter td input{color:#d0b78b!important}.job-options span[data-v-ee698604]{display:block;white-space:nowrap}.split-view-details{overflow:hidden}.sidebar-section .section-header{-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-bottom:1px solid #d1d1d1;display:-webkit-box;display:-ms-flexbox;display:flex;font-weight:700;padding:5px 10px}body.dark .sidebar-section .section-header{border-bottom:1px solid #363636}.sidebar-section .section-header .section-title{cursor:default}.sidebar-section .section-header .toggle-filter{display:none;margin-left:auto}.sidebar-section .section-header:hover .toggle-filter{display:block}.sidebar-section table{border-bottom:1px solid #d1d1d1;font-size:11px;margin-bottom:0}body.dark .sidebar-section table{border-bottom:1px solid #363636}.sidebar-section table thead th:last-child{padding-right:20px;position:relative}.sidebar-section table thead .fa-angle-down,.sidebar-section table thead .fa-angle-up{font-weight:700;margin-left:4px}.sidebar-section table thead .toggle-filter{position:absolute;right:4px;top:4px;visibility:hidden}.sidebar-section table thead:hover .toggle-filter{visibility:visible}.sidebar-section table tr:first-child td,body.dark .sidebar-section table tr:first-child td{border-top:0}.sidebar-section table tr:nth-child(2n){background:#f5f5f5}body.dark .sidebar-section table tr:nth-child(2n){background:#1b1b1b}.sidebar-section table th{font-size:12px;font-weight:600;padding:4px 2px;white-space:nowrap}.sidebar-section table td{padding:8px 10px;vertical-align:top}.sidebar-section table td .key{font-size:11px;font-weight:600;margin-bottom:3px;white-space:nowrap}.sidebar-section table td .value{word-break:break-all}.sidebar-section table .filter{background:none!important}.sidebar-section table .filter td{border-bottom:1px solid #d1d1d1;border-top:0;padding:2px 10px}body.dark .sidebar-section table .filter td{border-bottom:1px solid #363636;border-top:0}.sidebar-section table .filter label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;position:relative}.sidebar-section table .filter .fa-search{color:#696969;margin:0 4px}.sidebar-section table .filter input{background:transparent;border:none;width:100%}.sidebar-section table .filter input:focus{outline:none}.sidebar-section table .filter input::-webkit-input-placeholder{color:#a9a9a9}.sidebar-section table .filter input::-moz-placeholder{color:#a9a9a9}.sidebar-section table .filter input:-ms-input-placeholder{color:#a9a9a9}.sidebar-section table .filter input::-ms-input-placeholder{color:#a9a9a9}.sidebar-section table .filter input::placeholder{color:#a9a9a9}body.dark .sidebar-section table .filter input::-webkit-input-placeholder{color:#777}body.dark .sidebar-section table .filter input::-moz-placeholder{color:#777}body.dark .sidebar-section table .filter input:-ms-input-placeholder{color:#777}body.dark .sidebar-section table .filter input::-ms-input-placeholder{color:#777}body.dark .sidebar-section table .filter input::placeholder{color:#777}body.dark .sidebar-section table .filter input{color:#b2b2b2}.sidebar-section table .filter .example{color:#a9a9a9;font-size:11px;pointer-events:none;position:absolute;right:0}body.dark .sidebar-section table .filter .example{color:#777}.request-tab{background:#fff}body.dark .request-tab{background:#1f1f1f}.request-tab .parent-request{border-bottom:1px solid #d1d1d1;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:12px;font-weight:600;padding:12px 10px}body.dark .request-tab .parent-request{border-bottom:1px solid #363636}.request-tab .parent-request .parent-method{color:grey;font-size:90%;font-weight:400;margin-right:2px}body.dark .request-tab .parent-request .parent-method{color:#767676}.request-tab .parent-request .parent-uri{font-weight:400}.request-tab .parent-request a{color:#258cdb;font-weight:400;text-decoration:none}body.dark .request-tab .parent-request a{color:#f27e02}.request-tab .parent-request .parent-close{margin-left:auto}.request-tab .exception{border-bottom:1px solid #d1d1d1}body.dark .request-tab .exception{border-bottom:1px solid #363636}.request-tab .exception .exception-info{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background:#ffebeb;color:#c51f24;display:-webkit-box;display:-ms-flexbox;display:flex;padding:6px 10px}.request-tab .exception .exception-info:nth-child(2n){background:#ffe0e0}.request-tab .exception .exception-info:first-child{padding-top:12px}.request-tab .exception .exception-info:last-child{padding-bottom:12px}body.dark .request-tab .exception .exception-info{background:#380000;color:#ed797a}body.dark .request-tab .exception .exception-info:nth-child(2n){background:#2e0000}.request-tab .exception .exception-info h3{border-bottom:0;font-size:14px;margin:0 0 5px}.request-tab .exception .exception-info .exception-message{-webkit-box-flex:1;-ms-flex:1;flex:1;font-size:12px;line-height:1.5}.request-tab .exception .exception-info .exception-previous,.request-tab .exception .exception-info .exception-trace>a{color:#c51f24;font-size:12px;margin:0 4px}body.dark .request-tab .exception .exception-info .exception-previous,body.dark .request-tab .exception .exception-info .exception-trace>a{color:#ed797a}.request-tab .exception .exception-info .exception-previous{margin-right:4px;text-decoration:none}.request-tab .exception .exception-info .exception-trace{display:inline-block}.request-tab .data-raw td{white-space:pre}.request-tab .session-user{-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-bottom:1px solid #d1d1d1;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:110%;padding:8px 10px}body.dark .request-tab .session-user{border-bottom:1px solid #363636}.request-tab .session-user .fa-user{color:grey;font-size:110%;margin-right:8px}.request-tab .session-user .name{margin-right:6px}.request-tab .session-user .dimmed{color:grey;font-size:90%}body.dark .request-tab .session-user .dimmed{color:#767676}.request-tab .session-user .session-user-details{margin-left:auto}.request-sidebar{background:#fafafa;border-top:1px solid #d1d1d1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-ms-flex-negative:0;flex-shrink:0;height:25%}body.dark .request-sidebar{background:#1b1b1b;border-top:1px solid #363636}.request-sidebar.large{height:33%}@media screen and (min-width:900px){.request-sidebar{border-left:1px solid #d1d1d1;border-top:0;height:100%;width:300px}body.dark .request-sidebar{border-left:1px solid #363636;border-top:0}.request-sidebar.large{height:100%;width:400px}}@media screen and (min-width:1100px){.request-sidebar{width:360px}.request-sidebar.large{width:460px}}.request-sidebar .sidebar-header{background:#fff;border-bottom:1px solid #ccc;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;font-size:12px;height:31px;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;line-height:31px;width:100%}body.dark .request-sidebar .sidebar-header{background:#1f1f1f;border-bottom:1px solid #363636}.request-sidebar .sidebar-header .sidebar-title{padding:0 10px}.request-sidebar .sidebar-header .sidebar-actions{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:15px;padding:0 5px}.request-sidebar .sidebar-header .sidebar-actions a{padding:0 5px}.request-sidebar .sidebar-content{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:auto}.request-sidebar .sidebar-date,.request-sidebar .sidebar-id{margin:10px 0;text-align:center}.request-sidebar .sidebar-id{color:grey}body.dark .request-sidebar .sidebar-id{color:#767676}.split-view-requests{border-bottom:1px solid #d1d1d1;cursor:default;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-ms-flex-negative:0;flex-shrink:0;height:25%;width:100%}body.dark .split-view-requests{border-bottom:1px solid #363636}.split-view-requests.large .notifications-count{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.split-view-requests.large .notifications-count .errors-count{margin-left:5px}.split-view-requests.large .notifications-count .errors-count svg{margin-right:0}@media screen and (min-width:900px){.split-view-requests{border-bottom:0;border-right:1px solid #d1d1d1;height:100%;width:300px}body.dark .split-view-requests{border-right:1px solid #363636}.split-view-requests.large{width:400px}}@media screen and (min-width:1100px){.split-view-requests{width:320px}.split-view-requests.large{width:420px}}.split-view-requests table{line-height:1.4;table-layout:fixed}.split-view-requests tr{height:28px}.split-view-requests tr:first-child td{border-top:1px solid #d1d1d1}body.dark .split-view-requests tr:first-child td{border-top:1px solid #363636}.split-view-requests tr:nth-child(2n):not(.filler){background:#f3f3f3}body.dark .split-view-requests tr:nth-child(2n):not(.filler){background:#181818}.split-view-requests tr:nth-child(2n):not(.filler) .notifications-count{background:hsla(0,0%,95.3%,.8)}body.dark .split-view-requests tr:nth-child(2n):not(.filler) .notifications-count{background:rgba(27,27,27,.8)}.split-view-requests tr.selected td{background:#2786f3!important;color:#fff}body.dark .split-view-requests tr.selected td{background:#f27e02!important}.split-view-requests tr.selected small,body.dark .split-view-requests tr.selected small{color:#fff}.split-view-requests tr.selected .notifications-count{background:#2786f3!important}.split-view-requests tr.selected .notifications-count .errors-count,.split-view-requests tr.selected .notifications-count .warnings-count,.split-view-requests tr.selected .notifications-count .warnings-count svg,body.dark .split-view-requests tr.selected .notifications-count .errors-count,body.dark .split-view-requests tr.selected .notifications-count .warnings-count,body.dark .split-view-requests tr.selected .notifications-count .warnings-count svg{color:#fff}body.dark .split-view-requests tr.selected .notifications-count{background:#f27e02!important}.split-view-requests tr.selected .method-text,body.dark .split-view-requests tr.selected .method-text{color:#fff}.split-view-requests tr.selected .status-text,body.dark .split-view-requests tr.selected .status-text{background:transparent;color:#fff}.split-view-requests tr.sizing{height:0}.split-view-requests tr.sizing td{border-top:0;padding:0}body.dark .split-view-requests tr.sizing td{border-top:0}.split-view-requests tr.filler{height:auto}.split-view-requests th{border-bottom:1px solid #d1d1d1;font-weight:400;height:30px;line-height:1.1;padding:2px 4px;white-space:nowrap}body.dark .split-view-requests th{border-bottom:1px solid #363636}.split-view-requests td{overflow:hidden;padding:8px 6px;vertical-align:middle;white-space:nowrap}.split-view-requests small{color:grey;font-size:100%}body.dark .split-view-requests small{color:#767676}.split-view-requests big{font-size:115%}.split-view-requests .method,.split-view-requests .status{text-align:center;width:42px}.split-view-requests .duration{text-align:right;width:68px}.split-view-requests .method-text{color:grey;font-size:90%}body.dark .split-view-requests .method-text{color:#767676}.split-view-requests .status-text{background:#e3eccb;border-radius:8px;color:#586336;padding:2px 6px}body.dark .split-view-requests .status-text{background:#293800;color:#e3fa9e}.split-view-requests .status-text.client-error{background:#fffae2;color:#a85919}body.dark .split-view-requests .status-text.client-error{background:#382f00;color:#fad89f}.split-view-requests .status-text.server-error{background:#ffebeb;color:#c51f24}body.dark .split-view-requests .status-text.server-error{background:#380000;color:#ed797a}.split-view-requests .notifications-count{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background:hsla(0,0%,98%,.8);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;float:right;height:100%;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;letter-spacing:-.5px;margin-right:-6px;padding:0 6px;position:relative}.split-view-requests .notifications-count .errors-count{color:#b3492e}body.dark .split-view-requests .notifications-count .errors-count{color:#ed797a}.split-view-requests .notifications-count .errors-count svg{margin-right:1px}.split-view-requests .notifications-count .warnings-count{color:#a85919}body.dark .split-view-requests .notifications-count .warnings-count{color:#fad89f}.split-view-requests .notifications-count .warnings-count svg{color:#f4bd00}body.dark .split-view-requests .notifications-count .warnings-count svg{color:#fad89f}body.dark .split-view-requests .notifications-count{background:rgba(27,27,27,.8)}.split-view-requests .requests-header{height:31px}.split-view-requests .requests-search{border-bottom:1px solid #d1d1d1;padding:6px 2px}body.dark .split-view-requests .requests-search{border-bottom:1px solid #363636}.split-view-requests .requests-search label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;position:relative}.split-view-requests .requests-search .fa-search{color:#696969;margin:0 4px}.split-view-requests .requests-search input{background:transparent;border:none;width:100%}.split-view-requests .requests-search input:focus{outline:none}.split-view-requests .requests-search input::-webkit-input-placeholder{color:#a9a9a9}.split-view-requests .requests-search input::-moz-placeholder{color:#a9a9a9}.split-view-requests .requests-search input:-ms-input-placeholder{color:#a9a9a9}.split-view-requests .requests-search input::-ms-input-placeholder{color:#a9a9a9}.split-view-requests .requests-search input::placeholder{color:#a9a9a9}body.dark .split-view-requests .requests-search input::-webkit-input-placeholder{color:#777}body.dark .split-view-requests .requests-search input::-moz-placeholder{color:#777}body.dark .split-view-requests .requests-search input:-ms-input-placeholder{color:#777}body.dark .split-view-requests .requests-search input::-ms-input-placeholder{color:#777}body.dark .split-view-requests .requests-search input::placeholder{color:#777}body.dark .split-view-requests .requests-search input{color:#b2b2b2}.split-view-requests .requests-search .example{color:#a9a9a9;font-size:11px;pointer-events:none;position:absolute;right:0}body.dark .split-view-requests .requests-search .example{color:#777}.split-view-requests .requests-container{background:#fafafa;height:calc(100% - 31px);overflow:auto}.split-view-requests .requests-container table{height:100%}body.dark .split-view-requests .requests-container{background:#1b1b1b}.split-view-requests .load-more{-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-bottom:1px solid #d1d1d1;border-right:1px solid #d1d1d1;display:-webkit-box;display:-ms-flexbox;display:flex;height:36px;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}body.dark .split-view-requests .load-more{border-bottom:1px solid #363636;border-right:1px solid #363636}.split-view-requests .load-more a{color:#404040;text-decoration:none}.split-view-requests .load-more a:hover{color:#258cdb}body.dark .split-view-requests .load-more a:hover{color:#f27e02}body.dark .split-view-requests .load-more a{color:#b2b2b2}.pretty-jason{font-family:Menlo,Monaco,Consolas,monospace;font-size:12px;padding:0;margin:0;list-style:none;color:#222}.pretty-jason ul{list-style:none;padding-left:12px}.pretty-jason li{padding:1px 0}.pretty-jason-key{color:#881280}.pretty-jason-value-number{color:#1c00cf}.pretty-jason-value-string{color:#c41a16}.pretty-jason-value-null,.pretty-jason-value-undefined{color:grey}.pretty-jason-value-anonymous-function,.pretty-jason-value-boolean,.pretty-jason-value-resource{color:#132ba2}.pretty-jason-icon,.pretty-jason-icon-closed,.pretty-jason-icon-open{display:inline-block;width:0;height:0}.pretty-jason-icon{width:12px}.pretty-jason-icon-closed{border-style:solid;border-width:4.5px 0 4.5px 7.8px;border-color:transparent transparent transparent #7f7f80}.pretty-jason-icon-open{border-style:solid;border-width:7.8px 4.5px 0 4.5px;border-color:#7f7f80 transparent transparent transparent}.pretty-jason-preview{font-style:italic}.pretty-jason-preview:before{content:"{"}.pretty-jason-preview:after{content:"}"}.pretty-jason-preview-item:after{content:", "}.pretty-jason-preview .pretty-jason-preview-item:last-child:after{content:""}*{-webkit-box-sizing:border-box;box-sizing:border-box}html{background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:11px;overflow:hidden}body,html{height:100%}body{font-size:100%;margin:0}body.dark{background:#1f1f1f;color:#b2b2b2}table{border-collapse:collapse;font-size:100%;width:100%}table td,table th{text-align:left}a{color:#696969;cursor:default}a:hover{color:#3b3b3b}body.dark a:hover{color:#f27e02}body.dark a{color:grey}.split-view{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%;width:100%}@media screen and (min-width:900px){.split-view{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}}.split-view-details{-webkit-box-flex:1;-ms-flex:1;flex:1;min-width:0}@media screen and (min-width:900px){.split-view-details{height:100%}}.split-view-details{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;position:relative}.details-header,.split-view-details{display:-webkit-box;display:-ms-flexbox;display:flex}.details-header{border-bottom:1px solid #ccc;-ms-flex-negative:0;flex-shrink:0;height:31px}body.dark .details-header{border-bottom:1px solid #363636}.details-header .details-header-tabs{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1;flex:1}.details-header .details-header-tabs .details-header-tab{color:#404040;cursor:default;-webkit-box-flex:1;-ms-flex:1;flex:1;font-size:12px;line-height:31px;text-align:center;text-decoration:none}.details-header .details-header-tabs .details-header-tab.active{color:#258cdb}body.dark .details-header .details-header-tabs .details-header-tab.active{color:#f27e02}body.dark .details-header .details-header-tabs .details-header-tab{color:#9e9e9e}.details-header .icons{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:15px;padding:0 5px}.details-header .icons a{padding:0 5px}.details-content{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:auto;padding:10px}.details-content h3{border-bottom:1px solid #d1d1d1;font-size:13px;font-weight:600;margin:0;padding:4px 10px}.details-content table{font-size:12px;margin-bottom:18px}.details-content table thead th:last-child{padding-right:20px;position:relative}.details-content table thead .fa-angle-down,.details-content table thead .fa-angle-up{font-weight:700;margin-left:4px}.details-content table thead .toggle-filter{position:absolute;right:4px;top:4px;visibility:hidden}.details-content table thead:hover .toggle-filter{visibility:visible}.details-content table tr:first-child td{border-top:1px solid #d1d1d1}body.dark .details-content table tr:first-child td{border-top:1px solid #363636}.details-content table tr:nth-child(2n){background:#f5f5f5}body.dark .details-content table tr:nth-child(2n){background:#1b1b1b}.details-content table th{font-size:13px;font-weight:600;padding:4px 10px;white-space:nowrap}.details-content table td{padding:8px 10px;vertical-align:top}.details-content table td.key{font-size:12px;white-space:nowrap}.details-content table td.value{word-break:break-all}.details-content table .filter{background:none!important}.details-content table .filter td{border-top:1px solid #d1d1d1;padding:2px 10px}body.dark .details-content table .filter td{border-top:1px solid #363636}.details-content table .filter label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;position:relative}.details-content table .filter .fa-search{color:#696969;margin:0 4px}.details-content table .filter input{background:transparent;border:none;width:100%}.details-content table .filter input:focus{outline:none}.details-content table .filter input::-webkit-input-placeholder{color:#a9a9a9}.details-content table .filter input::-moz-placeholder{color:#a9a9a9}.details-content table .filter input:-ms-input-placeholder{color:#a9a9a9}.details-content table .filter input::-ms-input-placeholder{color:#a9a9a9}.details-content table .filter input::placeholder{color:#a9a9a9}body.dark .details-content table .filter input::-webkit-input-placeholder{color:#777}body.dark .details-content table .filter input::-moz-placeholder{color:#777}body.dark .details-content table .filter input:-ms-input-placeholder{color:#777}body.dark .details-content table .filter input::-ms-input-placeholder{color:#777}body.dark .details-content table .filter input::placeholder{color:#777}body.dark .details-content table .filter input{color:#b2b2b2}.details-content table .filter .example{color:#a9a9a9;font-size:11px;pointer-events:none;position:absolute;right:0}body.dark .details-content table .filter .example{color:#777}.details-content .counters-row{display:-webkit-box;display:-ms-flexbox;display:flex;margin:0 0 10px}.details-content .counters-row .counter{border:1px solid #d1d1d1;border-radius:3px;-webkit-box-shadow:0 2px 3px #e5e5e5;box-shadow:0 2px 3px #e5e5e5;margin:0 5px;-webkit-box-flex:0;-ms-flex:0 1 120px;flex:0 1 120px;padding:8px 20px 10px;text-align:center}body.dark .details-content .counters-row .counter{border:1px solid #404040;-webkit-box-shadow:0 2px 3px #292929;box-shadow:0 2px 3px #292929}.details-content .counters-row .counter:first-child{margin-left:0}.details-content .counters-row .counter:last-child{margin-right:0}.details-content .counters-row .counter .counter-value{font-size:175%;white-space:nowrap}.details-content .counters-row .counter .counter-title{font-size:120%;font-variant:small-caps;text-transform:lowercase}.details-content .request-tab-info{display:-webkit-box;display:-ms-flexbox;display:flex;margin:4px 0 8px}.details-content .request-tab-info .field{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;margin:0 5px;padding:0 20px}.details-content .request-tab-info .field:first-child{margin-left:0}.details-content .request-tab-info .field:last-child{margin-right:0}.details-content .request-tab-info .field .field-value{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1;flex:1;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;font-size:130%;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.details-content .request-tab-info .field .field-value .small{color:#888;font-size:75%;padding-top:2px}.details-content .request-tab-info .field .field-title{font-size:120%;font-variant:small-caps;padding-bottom:5px;text-transform:lowercase}.details-content .request-tab-info .field.action{-webkit-box-flex:1;-ms-flex:1;flex:1}.details-content .request-tab-info .field.link{font-size:90%;padding:0}.details-content .performance-chart-container{-webkit-box-flex:0;-ms-flex:0 1 100px;flex:0 1 100px}.details-content .performance-chart{height:60px;margin:0 auto;position:relative;width:60px}.details-content .performance-chart-legend.style1{border-left:3px solid #78b1de!important}body.dark .details-content .performance-chart-legend.style1{border-left:3px solid #649dca!important}.details-content .performance-chart-legend.style2{border-left:3px solid #e79697!important}body.dark .details-content .performance-chart-legend.style2{border-left:3px solid #d38283!important}.details-content .performance-chart-legend.style3{border-left:3px solid #b1ca6d!important}body.dark .details-content .performance-chart-legend.style3{border-left:3px solid #9db659!important}.details-content .performance-chart-legend.style4{border-left:3px solid #ba94e6!important}body.dark .details-content .performance-chart-legend.style4{border-left:3px solid #a680d2!important}.details-content .performance-tabs{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1;flex:1;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding:8px 0 4px}.details-content .performance-tabs .performance-tab{color:#404040;cursor:default;font-size:12px;line-height:31px;padding:0 31px;text-align:center;text-decoration:none}.details-content .performance-tabs .performance-tab.active{color:#258cdb}body.dark .details-content .performance-tabs .performance-tab.active{color:#f27e02}body.dark .details-content .performance-tabs .performance-tab{color:#9e9e9e}.details-content .timeline{position:relative}.details-content .timeline .timeline-description,.details-content .timeline .timeline-duration{display:none}.details-content .timeline.table-view .timeline-description,.details-content .timeline.table-view .timeline-duration{display:table-cell}.details-content .timeline.table-view .timeline-graph{padding:12px 0 0;width:25%}.details-content .timeline.table-view .timeline-bar .label,.details-content .timeline.table-view .timeline-legend{display:none}.details-content .timeline-controls{position:absolute;right:0;top:4px;z-index:100}.details-content .timeline-controls .timeline-control-group{margin:0 5px}.details-content .timeline-controls .toggle-filter{position:static;visibility:visible}.details-content .timeline-controls .fa-bar-chart{font-size:110%}.details-content .timeline-controls .fa-bars{font-size:115%}.details-content .timeline-controls a{margin:0 2px;text-decoration:none}.details-content .timeline-controls a.active{color:#258cdb}body.dark .details-content .timeline-controls a.active{color:#f27e02}body.dark .details-content .timeline-controls a{color:#9e9e9e}.details-content .timeline-graph{background-image:-webkit-gradient(linear,left top,right top,color-stop(99.5%,transparent),color-stop(99.5%,#e5e5e5),to(#e5e5e5));background-image:linear-gradient(90deg,transparent 99.5%,#e5e5e5 0,#e5e5e5);background-size:80px 1px;padding:6px 4px 8px}body.dark .details-content .timeline-graph{background-image:-webkit-gradient(linear,left top,right top,color-stop(99.5%,transparent),color-stop(99.5%,#333),to(#333));background-image:linear-gradient(90deg,transparent 99.5%,#333 0,#333)}.details-content .timeline-legend{color:#a1a1a1;height:14px;margin-bottom:6px;margin-top:-2px;position:relative}body.dark .details-content .timeline-legend{color:#666}.details-content .timeline-legend .timeline-legend-time{font-size:10px;font-weight:400;position:absolute;top:0}.details-content .timeline-bar .label{color:#365063;font-size:11.5px;margin-bottom:2px;white-space:nowrap}.details-content .timeline-bar .bar{background:#78b1de;border:1px solid #4295c5;border-radius:3px;padding:3px}body.dark .details-content .timeline-bar .bar{background:#649dca;border:1px solid #2e81b1}.details-content .timeline-bar.style1 .label{color:#365063}body.dark .details-content .timeline-bar.style1 .label{color:#a3b5c2}.details-content .timeline-bar.style1 .bar{background:#78b1de;border:1px solid #4295c5}body.dark .details-content .timeline-bar.style1 .bar{background:#649dca;border:1px solid #2e81b1}.details-content .timeline-bar.style2 .label{color:#633636}body.dark .details-content .timeline-bar.style2 .label{color:#c2a3a4}.details-content .timeline-bar.style2 .bar{background:#e79697;border:1px solid #d16b6c}body.dark .details-content .timeline-bar.style2 .bar{background:#d38283;border:1px solid #bd5758}.details-content .timeline-bar.style3 .label{color:#586336}body.dark .details-content .timeline-bar.style3 .label{color:#bac2a3}.details-content .timeline-bar.style3 .bar{background:#b1ca6d;border:1px solid #98ba51}body.dark .details-content .timeline-bar.style3 .bar{background:#9db659;border:1px solid #84a63d}.details-content .timeline-bar.style4 .label{color:#4a3663}body.dark .details-content .timeline-bar.style4 .label{color:#b1a3c2}.details-content .timeline-bar.style4 .bar{background:#ba94e6;border:1px solid #9772b5}body.dark .details-content .timeline-bar.style4 .bar{background:#a680d2;border:1px solid #835ea1}.details-content .timeline-duration{text-align:right;width:100px}.details-content .profiler .profiler-controls{position:absolute;right:0;top:4px}.details-content .profiler .profiler-controls .profiler-control-group{margin:0 5px}.details-content .profiler .profiler-controls .profiler-show-metric{font-size:105%}.details-content .profiler .profiler-controls .profiler-show-metric .fa-clock-o{font-size:110%}.details-content .profiler .profiler-controls .profiler-shown-fraction{font-size:85%}.details-content .profiler .profiler-controls .toggle-filter{position:static;visibility:visible}.details-content .profiler .profiler-controls a{margin:0 2px;text-decoration:none}.details-content .profiler .profiler-controls a.active{color:#258cdb}body.dark .details-content .profiler .profiler-controls a.active{color:#f27e02}body.dark .details-content .profiler .profiler-controls a{color:#9e9e9e}.details-content .profiler .profiler-metric{white-space:nowrap}.details-content .profiler .profiler-function{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.details-content .profiler .profiler-function .profiler-function-name{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;word-break:break-all}.details-content .profiler .profiler-function .profiler-path{color:#aaa;-webkit-box-flex:0;-ms-flex:0;flex:0;font-size:90%;margin-top:3px}.details-content .profiler-loading,.details-content .profiler-not-available{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;font-size:16px;padding:40px 0;text-align:center;width:100%}.details-content .profiler-loading .message,.details-content .profiler-not-available .message{color:#aaa;font-size:75%;margin:10px 0 0 0}.details-content .profiler-not-available{font-size:15px;line-height:1.5}.details-content .profiler-not-available .message{font-size:90%;margin:15px 0 0}.details-content .profiler-not-available a{color:#aaa;cursor:pointer}.details-content .profiler-not-available .profiler-enable a{color:#258cdb}body.dark .details-content .profiler-not-available .profiler-enable a{color:#f27e02}.details-content .log-row.error{background:#ffebeb;color:#c51f24}.details-content .log-row.error:nth-child(2n){background:#ffe0e0}.details-content .log-row.error .log-message-path{color:#dd888b}body.dark .details-content .log-row.error{background:#380000;color:#ed797a}body.dark .details-content .log-row.error:nth-child(2n){background:#2e0000}body.dark .details-content .log-row.error .log-message-path{color:#c3797b}.details-content .log-row.warning{background:#fffae2;color:#a85919}.details-content .log-row.warning:nth-child(2n){background:#fff5c2}.details-content .log-row.warning .log-message-path{color:#d7a175}body.dark .details-content .log-row.warning{background:#382f00;color:#fad89f}body.dark .details-content .log-row.warning:nth-child(2n){background:#2e2600}body.dark .details-content .log-row.warning .log-message-path{color:#d0b78b}.details-content .log-date,.details-content .log-level{width:70px}.details-content .log-message{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.details-content .log-message .log-message-content{-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto;max-width:100%}.details-content .log-message .log-message-exception{-webkit-box-flex:0;-ms-flex:0;flex:0;font-size:90%;margin:3px 5px 0 0;white-space:nowrap}.details-content .log-message .log-message-exception .exception-previous{border:1px solid #aaa;border-radius:4px;text-decoration:none;padding:2px 4px;margin-right:5px}body.dark .details-content .log-message .log-message-exception .exception-previous{border-color:grey}.details-content .log-message .log-message-path{color:#aaa;-webkit-box-flex:0;-ms-flex:0;flex:0;font-size:90%;margin-top:3px}body.dark .details-content .log-message .log-message-path{color:#777}.details-content .fired-event{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.details-content .fired-event .fired-event-content{-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto;max-width:100%}.details-content .fired-event .fired-event-path{color:#aaa;-webkit-box-flex:0;-ms-flex:0;flex:0;font-size:90%;margin-top:3px}body.dark .details-content .fired-event .fired-event-path{color:#777}.details-content .fired-event-details h4{margin:6px 0 3px}.details-content .fired-event-actions{padding-left:5px;width:10px}.details-content .database-query{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.details-content .database-query .database-query-content{-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto;max-width:100%}.details-content .database-query .database-query-path{color:#aaa;-webkit-box-flex:0;-ms-flex:0;flex:0;font-size:90%;margin-top:3px}body.dark .details-content .database-query .database-query-path{color:#777}.details-content .database-duration{text-align:right;white-space:nowrap}.details-content .cache-query-type{font-size:125%;font-variant:small-caps}.details-authentication-overlay,.details-error-overlay,.details-loading-overlay{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background:#fff;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;font-size:16px;height:calc(100% - 31px);-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;left:0;position:absolute;top:31px;width:100%;z-index:999}body.dark .details-authentication-overlay,body.dark .details-error-overlay,body.dark .details-loading-overlay{background:#1f1f1f}.details-authentication-overlay .fa-exclamation-circle,.details-authentication-overlay .fa-lock,.details-error-overlay .fa-exclamation-circle,.details-error-overlay .fa-lock,.details-loading-overlay .fa-exclamation-circle,.details-loading-overlay .fa-lock{color:#696969;font-size:46px}.details-authentication-overlay .title,.details-error-overlay .title,.details-loading-overlay .title{margin:10px 0 0 0}.details-authentication-overlay .message,.details-error-overlay .message,.details-loading-overlay .message{color:#aaa;font-size:75%;margin:5px 0 0 0}.details-authentication-overlay{text-align:center}.details-authentication-overlay .message,.details-authentication-overlay .title{font-size:80%}.details-authentication-overlay .title.failed{display:none}.details-authentication-overlay p{margin:1.3em 0}.details-authentication-overlay input{background:#eee;border:1px solid #eee;border-radius:4px;font-size:14px;height:30px;padding:0 10px}body.dark .details-authentication-overlay input{background:#2e2e2e;border:1px solid #2e2e2e;color:#ccc}.details-authentication-overlay button{background:transparent;border:none;color:#258cdb;font-size:90%}body.dark .details-authentication-overlay button{color:#f27e02}.details-authentication-overlay.failed .title{display:none}.details-authentication-overlay.failed .title.failed{display:block}.details-authentication-overlay.failed .fa-lock{-webkit-animation:shake .77s linear;animation:shake .77s linear}@-webkit-keyframes shake{10%,90%{-webkit-transform:translate(-2px);transform:translate(-2px)}20%,80%{-webkit-transform:translate(3px);transform:translate(3px)}30%,50%,70%{-webkit-transform:translate(-5px);transform:translate(-5px)}40%,60%{-webkit-transform:translate(5px);transform:translate(5px)}}@keyframes shake{10%,90%{-webkit-transform:translate(-2px);transform:translate(-2px)}20%,80%{-webkit-transform:translate(3px);transform:translate(3px)}30%,50%,70%{-webkit-transform:translate(-5px);transform:translate(-5px)}40%,60%{-webkit-transform:translate(5px);transform:translate(5px)}}.settings-container .popover{right:-11px!important;top:14px}.settings-container .popover .popover-content{padding:6px 18px;text-align:left}.settings-container .popover .popover-content a{padding:0}.settings-container .controls-group{margin:8px 0 14px}.settings-container .controls-input-vgroup{font-size:90%}.settings-container .controls-input-vgroup input{border:1px solid #ccc;padding:1px 4px}.settings-container .controls-input-vgroup input:first-child{border-radius:4px 4px 0 0}.settings-container .controls-input-vgroup input:last-child{border-radius:0 0 4px 4px;margin-top:-2px}.settings-container .help-text{font-size:80%;margin-top:8px}.settings-container label{display:block;font-size:90%;margin-bottom:6px}.settings-container input,.settings-container select{font-size:90%;margin:0 -6px;width:calc(100% + 12px)}body.dark .settings-container input,body.dark .settings-container select{color:#e9e9e9}body.dark .settings-container input{background:#71706f;border-color:#7c7a78}body.dark .settings-container input::-webkit-input-placeholder{color:#939291;opacity:1}body.dark .settings-container input::-moz-placeholder{color:#939291;opacity:1}body.dark .settings-container input:-ms-input-placeholder{color:#939291;opacity:1}body.dark .settings-container input::-ms-input-placeholder{color:#939291;opacity:1}body.dark .settings-container input::placeholder{color:#939291;opacity:1}body.dark .settings-container select{background:#6a6866;border:1px solid #7c7a78;border-radius:5px}.settings-container .settings-save{text-align:center}.settings-container button{background:transparent;border:none;color:#258cdb;font-size:90%}body.dark .settings-container button{color:#f27e02}.stack-trace{cursor:pointer}.stack-trace .popover{cursor:default}.stack-trace a{text-decoration:none}.stack-trace .stack-frame{color:#000;padding:6px 10px;text-align:left;word-break:break-word}body.dark .stack-trace .stack-frame{color:#b2b2b2}.stack-trace .stack-frame:nth-child(2n){background:#f5f5f5}body.dark .stack-trace .stack-frame:nth-child(2n){background:#1b1b1b}.stack-trace .stack-frame .stack-frame-call{font-size:12px;padding-bottom:3px}.stack-trace .stack-frame .stack-frame-file{color:#aaa;font-size:11px}.stack-trace .stack-frame.is-vendor .stack-frame-call,.stack-trace .stack-frame.is-vendor .stack-frame-file{font-size:10px}.popover{left:0;padding-top:20px;position:absolute;top:100%;width:300px;z-index:666}.popover.right-aligned{left:auto;right:0}.popover.right-aligned .popover-content:before{left:auto;right:8px}.popover.right-aligned .popover-content:after{left:auto;right:7px}.popover .popover-content{background:#fff;border:1px solid #d1d1d1;border-radius:5px;-webkit-box-shadow:0 0 4px #e5e5e5;box-shadow:0 0 4px #e5e5e5;max-height:400px;overflow:auto;padding:5px 0;text-align:center;width:100%}body.dark .popover .popover-content{background:#1f1f1f;border:1px solid #404040;-webkit-box-shadow:0 0 4px #292929;box-shadow:0 0 4px #292929}.popover .popover-content:after,.popover .popover-content:before{border-style:solid;content:"";height:0;position:absolute;width:0}.popover .popover-content:before{border-color:transparent transparent #fff transparent;border-width:0 14px 14px 14px;left:8px;top:7px;z-index:500}body.dark .popover .popover-content:before{border-color:transparent transparent #1f1f1f transparent}.popover .popover-content:after{border-color:transparent transparent #e5e5e5 transparent;border-width:0 15px 15px 15px;left:7px;top:5px}body.dark .popover .popover-content:after{border-color:transparent transparent #292929 transparent}.popover-container{position:relative}.hidden{display:none}[stupid-table] th{cursor:default}[tab-content]{display:none}body.dark .pretty-jason{color:#d5d5d5}body.dark .pretty-jason-key{color:#e36eec}body.dark .pretty-jason-value-number{color:#997fff}body.dark .pretty-jason-value-string{color:#e33e3a}body.dark .pretty-jason-value-null,body.dark .pretty-jason-value-undefined{color:#7f7f7f}body.dark .pretty-jason-value-anonymous-function,body.dark .pretty-jason-value-boolean,body.dark .pretty-jason-value-resource{color:#8296ff}body.dark .pretty-jason-icon-closed{border-color:transparent transparent transparent #919191}body.dark .pretty-jason-icon-open{border-color:#919191 transparent transparent transparent} \ No newline at end of file diff --git a/Clockwork/Web/public/img/appearance-auto-icon.png b/Clockwork/Web/public/img/appearance-auto-icon.png new file mode 100644 index 00000000..5cb21ee0 Binary files /dev/null and b/Clockwork/Web/public/img/appearance-auto-icon.png differ diff --git a/Clockwork/Web/public/img/appearance-dark-icon.png b/Clockwork/Web/public/img/appearance-dark-icon.png new file mode 100644 index 00000000..f7d4285e Binary files /dev/null and b/Clockwork/Web/public/img/appearance-dark-icon.png differ diff --git a/Clockwork/Web/public/img/appearance-light-icon.png b/Clockwork/Web/public/img/appearance-light-icon.png new file mode 100644 index 00000000..7341c020 Binary files /dev/null and b/Clockwork/Web/public/img/appearance-light-icon.png differ diff --git a/Clockwork/Web/public/img/whats-new/4.1/commands-profiling.png b/Clockwork/Web/public/img/whats-new/4.1/commands-profiling.png new file mode 100644 index 00000000..89fb89e7 Binary files /dev/null and b/Clockwork/Web/public/img/whats-new/4.1/commands-profiling.png differ diff --git a/Clockwork/Web/public/img/whats-new/4.1/extended-timeline.png b/Clockwork/Web/public/img/whats-new/4.1/extended-timeline.png new file mode 100644 index 00000000..0b8d6a2b Binary files /dev/null and b/Clockwork/Web/public/img/whats-new/4.1/extended-timeline.png differ diff --git a/Clockwork/Web/public/img/whats-new/4.1/new-settings-modal.png b/Clockwork/Web/public/img/whats-new/4.1/new-settings-modal.png new file mode 100644 index 00000000..d0fc6d1e Binary files /dev/null and b/Clockwork/Web/public/img/whats-new/4.1/new-settings-modal.png differ diff --git a/Clockwork/Web/public/img/whats-new/4.1/queue-jobs-profiling.png b/Clockwork/Web/public/img/whats-new/4.1/queue-jobs-profiling.png new file mode 100644 index 00000000..42cb97e4 Binary files /dev/null and b/Clockwork/Web/public/img/whats-new/4.1/queue-jobs-profiling.png differ diff --git a/Clockwork/Web/public/img/whats-new/4.1/tests-profiling.png b/Clockwork/Web/public/img/whats-new/4.1/tests-profiling.png new file mode 100644 index 00000000..3d2bd0ce Binary files /dev/null and b/Clockwork/Web/public/img/whats-new/4.1/tests-profiling.png differ diff --git a/Clockwork/Web/public/index.html b/Clockwork/Web/public/index.html index 05431998..31430617 100644 --- a/Clockwork/Web/public/index.html +++ b/Clockwork/Web/public/index.html @@ -1 +1 @@ -Clockwork
\ No newline at end of file +Clockwork
\ No newline at end of file diff --git a/Clockwork/Web/public/js/app.648811c2.js b/Clockwork/Web/public/js/app.648811c2.js new file mode 100644 index 00000000..07d3bd87 --- /dev/null +++ b/Clockwork/Web/public/js/app.648811c2.js @@ -0,0 +1,2 @@ +(function(e){function t(t){for(var a,r,o=t[0],l=t[1],c=t[2],d=0,h=[];d'}),this.createElement("span",{text:"".concat(n," ")})]),this.generateHtmlPreview(this.data),this.generateHtmlNode(this.data)])])}},{key:"generateHtmlNode",value:function(e){var t=this;return this.createElement("ul",{style:{display:"none"}},Object.keys(e).filter((function(e){return!["__class__","__type__","__hash__"].includes(e)})).map((function(s){var n=t.resolveValueAndType(e[s]),i=Object(a["a"])(n,2),r=i[0],o=i[1];return t.createElement("li",{data:{key:s}},[t.createElement("span",{click:"object"==o?function(e){return t.objectNodeClickedCallback(e)}:void 0},[t.createElement("span",{class:"pretty-jason-icon",html:"object"==o?'':void 0}),t.createElement("span",{class:"pretty-jason-key",text:"".concat(s,": ")}),t.createElement("span",{class:"pretty-jason-value-".concat(o),text:r})])])})))}},{key:"generateHtmlPreview",value:function(e){var t=this;return this.createElement("span",{class:"pretty-jason-preview"},Object.keys(e).filter((function(e){return!["__class__","__type__","__hash__"].includes(e)})).slice(0,3).map((function(s){var n=t.resolveValueAndType(e[s]),i=Object(a["a"])(n,2),r=i[0],o=i[1];return t.createElement("span",{class:"pretty-jason-preview-item"},[t.createElement("span",{class:"pretty-jason-key",text:"".concat(s,": ")}),t.createElement("span",{class:"pretty-jason-value-".concat(o),text:r})])})).concat(Object.keys(e).length>3?[this.createElement("span",{class:"pretty-jason-preview-item",text:"..."})]:[]))}},{key:"resolveValueAndType",value:function(e){return null===e?["null","null"]:void 0===e?["undefined","undefined"]:"boolean"==typeof e?[e?"true":"false","boolean"]:"string"==typeof e?['"'.concat(e,'"'),"string"]:"object"==Object(p["a"])(e)?"array"==e.__type__?["Array(".concat(Object.values(e).length-1,")"),"object"]:e.__type__&&"object"!=e.__type__?[e.__type__,e.__type__.replace(" ","-")]:[e.__class__||"Object","object"]:[e.toString(),Object(p["a"])(e)]}},{key:"objectNodeClickedCallback",value:function(e){var t=e.currentTarget;this.isNodeExpanded(t)?this.collapseNode(t,e.ctrlKey||e.metaKey):this.expandNode(t,e.ctrlKey||e.metaKey)}},{key:"isNodeExpanded",value:function(e){var t=e.parentNode.querySelector("ul");return t&&"none"!=t.style.display}},{key:"expandNode",value:function(e,t){var s=this;this.renderObjectNode(e);var a=e.parentNode.querySelector("ul"),n=e.querySelector("i");n.classList.remove("pretty-jason-icon-closed","pretty-jason-icon-open"),a.style.display="block",n.classList.add("pretty-jason-icon-open"),t&&a.querySelectorAll(".pretty-jason-icon-closed").forEach((function(e){s.expandNode(e.parentNode.parentNode,t)}))}},{key:"collapseNode",value:function(e,t){var s=this,a=e.parentNode.querySelector("ul"),n=e.querySelector("i");n.classList.remove("pretty-jason-icon-closed","pretty-jason-icon-open"),a.style.display="none",n.classList.add("pretty-jason-icon-closed"),t&&a.querySelectorAll(".pretty-jason-icon-open").forEach((function(e){s.collapseNode(e.parentNode.parentNode,t)}))}},{key:"renderObjectNode",value:function(e){if(!e.dataset.rendered){var t=[],s=e;while(s=s.parentNode)if("LI"==s.tagName&&s.dataset.key){if(s.classList.contains("pretty-jason"))break;var a=s.dataset.key;t.unshift(isNaN(parseInt(a,10))?a:parseInt(a,10))}e.parentNode.append(this.generateHtmlNode(this.getDataFromPath(t))),e.dataset.rendered=!0}}},{key:"getDataFromPath",value:function(e){var t,s=this.data;while(void 0!==(t=e.shift()))s=s[t];return s}},{key:"createElement",value:function(e,t,s){var a=document.createElement(e);return t.html&&(a.innerHTML=t.html),t.text&&(a.innerText=t.text),t.class&&a.classList.add(t.class),t.style instanceof Object&&Object.keys(t.style).forEach((function(e){return a.style[e]=t.style[e]})),t.data instanceof Object&&Object.keys(t.data).forEach((function(e){return a.dataset[e]=t.data[e]})),t.click&&a.addEventListener("click",t.click),s instanceof Array&&s.forEach((function(e){return a.append(e)})),a}}]),e}(),b=function e(t,s){Object(m["a"])(this,e),this.message=t,this.exception=s},w=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("span",{on:{click:function(t){return e.expand(t)}}},[e.expanded?[e._v("\n\t\t"+e._s(e.full)+"\n\t")]:[e._t("default")]],2)},y=[],_={name:"ShortenedText",props:["full"],data:function(){return{expanded:!1}},methods:{expand:function(e){this.expanded||(e.stopPropagation(),e.preventDefault()),this.expanded=!0}}},q=_,$=s("2877"),C=Object($["a"])(q,w,y,!1,null,null,null),k=C.exports,x={name:"StackTrace",components:{ShortenedText:k},props:["trace","file","line"],data:function(){return{showPopover:!1}},computed:{fullPath:function(){var e,t;return this.makeFullPath(this.file||(null===(e=this.trace[0])||void 0===e?void 0:e.file),this.line||(null===(t=this.trace[0])||void 0===t?void 0:t.line))},shortPath:function(){var e,t;return this.makeShortPath(this.file||(null===(e=this.trace[0])||void 0===e?void 0:e.file),this.line||(null===(t=this.trace[0])||void 0===t?void 0:t.line))}},methods:{closePopover:function(){this.showPopover=!1},togglePopover:function(e){this.trace&&(e.preventDefault(),this.showPopover=!this.showPopover,this.$el.offsetParent.clientWidth-this.$el.offsetLeft<300&&this.$refs.popover.classList.add("right-aligned"))},makeFullPath:function(e,t){return"".concat(e,":").concat(t)},makeShortPath:function(e,t){return this.makeFullPath(e,t).split(/[\/\\]/).pop()}}},j=x,T=Object($["a"])(j,h,f,!1,null,null,null),P=T.exports,O={name:"ExceptionSection",components:{StackTrace:P},props:["compact"],methods:{showPreviousException:function(e){this.$request.exceptions.push(e.previous),e.previous=void 0}}},S=O,R=(s("9b34"),Object($["a"])(S,u,d,!1,null,null,null)),D=R.exports,N=function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.parentRequest?s("div",{staticClass:"parent-request",class:{compact:e.compact}},[s("div",[s("div",{staticClass:"parent-title"},[e._v("\n\t\t\tSubrequest of\n\t\t")]),e.parentRequest.isCommand()?s("div",{staticClass:"parent-name"},[s("span",{staticClass:"type-text"},[e._v("CMD")]),e._v(" "+e._s(e.parentRequest.commandName)+"\n\t\t")]):e.parentRequest.isQueueJob()?s("div",{staticClass:"parent-name"},[s("span",{staticClass:"type-text"},[e._v("QUEUE")]),e._v(" "+e._s(e.parentRequest.jobName)+"\n\t\t")]):s("div",{staticClass:"parent-name"},[s("span",{staticClass:"parent-method"},[e._v(e._s(e.parentRequest.method))]),s("span",{staticClass:"parent-uri"},[e._v(e._s(e.parentRequest.uri))])])]),s("div",{staticClass:"parent-close"},[s("a",{attrs:{href:"#"},on:{click:function(t){return e.showRequestById(e.parentRequest.id)}}},[e._v("Show")])])]):e._e()},E=[],M=(s("96cf"),s("3b8d")),L={name:"ParentRequest",props:["compact"],data:function(){return{parentRequest:null}},methods:{showRequestById:function(e){this.global.$request=this.$requests.findId(e)}},watch:{$request:{handler:function(){var e=Object(M["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this.parentRequest=null,this.$request&&this.$request.parent&&this.$request.parent.id){e.next=3;break}return e.abrupt("return");case 3:if(e.t0=this.$requests.findId(this.$request.parent.id),e.t0){e.next=8;break}return e.next=7,this.$requests.loadId(this.$request.parent.id);case 7:e.t0=e.sent;case 8:this.parentRequest=e.t0;case 9:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),immediate:!0}}},I=L,Q=(s("1746"),Object($["a"])(I,N,E,!1,null,null,null)),A=Q.exports,U={name:"MessagesOverlay",components:{ExceptionSection:D,ParentRequest:A,StackTrace:P},data:function(){return{updateNotification:!1}},methods:{closeUpdateNotification:function(){this.$updateNotification.ignoreUpdate(this.$requests.remoteUrl),this.updateNotification=!1},showPreviousException:function(e){this.$request.exceptions.push(e.previous),e.previous=void 0},showRequestById:function(e){this.global.$request=this.$requests.find(e)}},watch:{"$requests.remoteUrl":{handler:function(){this.updateNotification=this.$updateNotification.show(this.$requests.remoteUrl)},immediate:!0},"$updateNotification.serverVersion":function(){this.updateNotification=this.$updateNotification.show(this.$requests.remoteUrl)}}},J=U,H=(s("9cad"),Object($["a"])(J,l,c,!1,null,null,null)),B=H.exports,F=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("transition",{attrs:{name:"settings"}},[s("div",{directives:[{name:"show",rawName:"v-show",value:e.$settings.shown,expression:"$settings.shown"}],staticClass:"settings-modal"},[s("div",{staticClass:"controls-group"},[s("label",{attrs:{for:"settings-editor"}},[e._v("Appearance")]),s("div",{staticClass:"controls"},[s("div",{staticClass:"appearance-controls"},[s("div",{staticClass:"option",class:{selected:"auto"==e.$settings.global.appearance},on:{click:function(t){return e.setAppearance("auto")}}},[s("img",{attrs:{src:"img/appearance-auto-icon.png"}}),e._v("\n\t\t\t\t\t\tAuto\n\t\t\t\t\t")]),s("div",{staticClass:"option",class:{selected:"light"==e.$settings.global.appearance},on:{click:function(t){return e.setAppearance("light")}}},[s("img",{attrs:{src:"img/appearance-light-icon.png"}}),e._v("\n\t\t\t\t\t\tLight\n\t\t\t\t\t")]),s("div",{staticClass:"option",class:{selected:"dark"==e.$settings.global.appearance},on:{click:function(t){return e.setAppearance("dark")}}},[s("img",{attrs:{src:"img/appearance-dark-icon.png"}}),e._v("\n\t\t\t\t\t\tDark\n\t\t\t\t\t")])])])]),s("div",{staticClass:"controls-group"},[s("label",{attrs:{for:"settings-editor"}},[e._v("Code editor")]),s("div",{staticClass:"controls"},[s("select",{directives:[{name:"model",rawName:"v-model",value:e.$settings.global.editor,expression:"$settings.global.editor"}],attrs:{id:"settings-editor"},on:{change:[function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.$set(e.$settings.global,"editor",t.target.multiple?s:s[0])},e.save]}},[s("option",{attrs:{value:"atom"}},[e._v("Atom")]),s("option",{attrs:{value:"phpstorm"}},[e._v("PhpStorm")]),s("option",{attrs:{value:"sublime"}},[e._v("Sublime Text")]),s("option",{attrs:{value:"textmate"}},[e._v("Textmate")]),s("option",{attrs:{value:"vs-code"}},[e._v("Visual Studio Code")])]),s("div",{directives:[{name:"show",rawName:"v-show",value:"atom"==e.$settings.global.editor,expression:"$settings.global.editor == 'atom'"}],staticClass:"help-text"},[e._v("\n\t\t\t\t\tRequires "),s("a",{attrs:{href:"https://atom.io/packages/open",target:"_blank"}},[e._v("Atom Open")]),e._v(" package.\n\t\t\t\t")]),s("div",{directives:[{name:"show",rawName:"v-show",value:"sublime"==e.$settings.global.editor,expression:"$settings.global.editor == 'sublime'"}],staticClass:"help-text"},[e._v("\n\t\t\t\t\tRequires "),s("a",{attrs:{href:"https://github.com/asuth/subl-handler",target:"_blank"}},[e._v("subl-handler")]),e._v(".\n\t\t\t\t")])])]),s("div",{staticClass:"controls-group"},[s("label",{attrs:{for:"settings-local-path-map"}},[e._v("Code path")]),s("div",{staticClass:"controls"},[s("div",{staticClass:"controls-input-vgroup"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.$settings.site.localPathMap.real,expression:"$settings.site.localPathMap.real"}],attrs:{type:"text",name:"settings-local-path-map-real",placeholder:"/real/path"},domProps:{value:e.$settings.site.localPathMap.real},on:{change:e.save,input:function(t){t.target.composing||e.$set(e.$settings.site.localPathMap,"real",t.target.value)}}}),s("input",{directives:[{name:"model",rawName:"v-model",value:e.$settings.site.localPathMap.local,expression:"$settings.site.localPathMap.local"}],attrs:{type:"text",name:"settings-local-path-map-local",placeholder:"/local/path"},domProps:{value:e.$settings.site.localPathMap.local},on:{change:e.save,input:function(t){t.target.composing||e.$set(e.$settings.site.localPathMap,"local",t.target.value)}}})]),s("div",{staticClass:"help-text"},[e._v("\n\t\t\t\t\tMap a remote path to a local path when developing on a remote server or a virtual machine.\n\t\t\t\t")])])]),s("div",{staticClass:"controls-group"},[s("label"),s("div",{staticClass:"controls"},[s("label",{staticClass:"controls-checkbox"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.$settings.global.showIncomingRequests,expression:"$settings.global.showIncomingRequests"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.$settings.global.showIncomingRequests)?e._i(e.$settings.global.showIncomingRequests,null)>-1:e.$settings.global.showIncomingRequests},on:{change:[function(t){var s=e.$settings.global.showIncomingRequests,a=t.target,n=!!a.checked;if(Array.isArray(s)){var i=null,r=e._i(s,i);a.checked?r<0&&e.$set(e.$settings.global,"showIncomingRequests",s.concat([i])):r>-1&&e.$set(e.$settings.global,"showIncomingRequests",s.slice(0,r).concat(s.slice(r+1)))}else e.$set(e.$settings.global,"showIncomingRequests",n)},e.save]}}),e._v("\n\t\t\t\t\tAutomatically show incoming requests\n\t\t\t\t")])])]),s("div",{staticClass:"controls-group"},[s("label"),s("div",{staticClass:"controls"},[s("label",{staticClass:"controls-checkbox"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.$settings.global.hideCommandTypeRequests,expression:"$settings.global.hideCommandTypeRequests"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.$settings.global.hideCommandTypeRequests)?e._i(e.$settings.global.hideCommandTypeRequests,null)>-1:e.$settings.global.hideCommandTypeRequests},on:{change:[function(t){var s=e.$settings.global.hideCommandTypeRequests,a=t.target,n=!!a.checked;if(Array.isArray(s)){var i=null,r=e._i(s,i);a.checked?r<0&&e.$set(e.$settings.global,"hideCommandTypeRequests",s.concat([i])):r>-1&&e.$set(e.$settings.global,"hideCommandTypeRequests",s.slice(0,r).concat(s.slice(r+1)))}else e.$set(e.$settings.global,"hideCommandTypeRequests",n)},e.save]}}),e._v("\n\t\t\t\t\tHide commands in requests list\n\t\t\t\t")]),s("label",{staticClass:"controls-checkbox"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.$settings.global.hideQueueJobTypeRequests,expression:"$settings.global.hideQueueJobTypeRequests"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.$settings.global.hideQueueJobTypeRequests)?e._i(e.$settings.global.hideQueueJobTypeRequests,null)>-1:e.$settings.global.hideQueueJobTypeRequests},on:{change:[function(t){var s=e.$settings.global.hideQueueJobTypeRequests,a=t.target,n=!!a.checked;if(Array.isArray(s)){var i=null,r=e._i(s,i);a.checked?r<0&&e.$set(e.$settings.global,"hideQueueJobTypeRequests",s.concat([i])):r>-1&&e.$set(e.$settings.global,"hideQueueJobTypeRequests",s.slice(0,r).concat(s.slice(r+1)))}else e.$set(e.$settings.global,"hideQueueJobTypeRequests",n)},e.save]}}),e._v("\n\t\t\t\t\tHide queue jobs in requests list\n\t\t\t\t")]),s("label",{staticClass:"controls-checkbox"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.$settings.global.hideTestTypeRequests,expression:"$settings.global.hideTestTypeRequests"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.$settings.global.hideTestTypeRequests)?e._i(e.$settings.global.hideTestTypeRequests,null)>-1:e.$settings.global.hideTestTypeRequests},on:{change:[function(t){var s=e.$settings.global.hideTestTypeRequests,a=t.target,n=!!a.checked;if(Array.isArray(s)){var i=null,r=e._i(s,i);a.checked?r<0&&e.$set(e.$settings.global,"hideTestTypeRequests",s.concat([i])):r>-1&&e.$set(e.$settings.global,"hideTestTypeRequests",s.slice(0,r).concat(s.slice(r+1)))}else e.$set(e.$settings.global,"hideTestTypeRequests",n)},e.save]}}),e._v("\n\t\t\t\t\tHide tests in requests list\n\t\t\t\t")])])])])])},z=[],V={name:"SettingsModal",data:function(){return{}},methods:{setAppearance:function(e){this.$settings.global.appearance=e,this.save()},save:function(){this.$settings.save()}}},W=V,K=(s("28e9"),Object($["a"])(W,F,z,!1,null,null,null)),G=K.exports,X=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("a",{staticClass:"details-header-tab",class:{active:e.active},attrs:{href:"#"},on:{click:e.selectTab}},[e._t("default")],2)},Y=[],Z=(s("7f7f"),{name:"TabHandle",props:["name","active"],methods:{selectTab:function(){this.$emit("tab-selected",this.name)}}}),ee=Z,te=Object($["a"])(ee,X,Y,!1,null,null,null),se=te.exports,ae=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{directives:[{name:"show",rawName:"v-show",value:e.active,expression:"active"}]},[s("div",{staticClass:"counters-row"},[s("div",{directives:[{name:"show",rawName:"v-show",value:e.$request.cacheQueries.length,expression:"$request.cacheQueries.length"}],staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.cacheQueries.length))]),s("div",{staticClass:"counter-title"},[e._v("queries")])]),s("div",{directives:[{name:"show",rawName:"v-show",value:null!==e.$request.cacheReads,expression:"$request.cacheReads !== null"}],staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.cacheReads))]),s("div",{staticClass:"counter-title"},[e._v("reads")])]),s("div",{directives:[{name:"show",rawName:"v-show",value:null!==e.$request.cacheHits,expression:"$request.cacheHits !== null"}],staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.cacheHits))]),s("div",{staticClass:"counter-title"},[e._v("hits")])]),s("div",{directives:[{name:"show",rawName:"v-show",value:null!==e.$request.cacheMisses,expression:"$request.cacheMisses !== null"}],staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.cacheMisses))]),s("div",{staticClass:"counter-title"},[e._v("misses")])]),s("div",{directives:[{name:"show",rawName:"v-show",value:null!==e.$request.cacheWrites,expression:"$request.cacheWrites !== null"}],staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.cacheWrites))]),s("div",{staticClass:"counter-title"},[e._v("writes")])]),s("div",{directives:[{name:"show",rawName:"v-show",value:null!==e.$request.cacheDeletes,expression:"$request.cacheDeletes !== null"}],staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.cacheDeletes))]),s("div",{staticClass:"counter-title"},[e._v("deletes")])]),s("div",{directives:[{name:"show",rawName:"v-show",value:null!==e.$request.cacheTime,expression:"$request.cacheTime !== null"}],staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.cacheTime))]),s("div",{staticClass:"counter-title"},[e._v("time")])])]),e.$request.cacheQueries.length?s("details-table",{attrs:{columns:e.columns,items:e.$request.cacheQueries,filter:e.filter,"filter-example":"info@underground.works action:miss key:lastRequest file:Controller.php"},scopedSlots:e._u([{key:"body",fn:function(t){var a=t.items;return e._l(a,(function(t,a){return s("tr",{key:e.$request.id+"-"+a},[e.columns.includes("Connection")?s("td",[e._v(e._s(t.connection))]):e._e(),s("td",{staticClass:"cache-query-type"},[e._v(e._s(t.type))]),s("td",[e._v(e._s(t.key))]),s("td",[s("div",{staticClass:"database-query"},[s("div",{staticClass:"database-query-content"},[s("pretty-print",{attrs:{data:t.value}})],1),s("stack-trace",{staticClass:"database-query-path",attrs:{trace:t.trace,file:t.file,line:t.line}})],1)]),s("td",[t.expiration?s("span",[e._v(e._s(t.expiration))]):e._e()]),e.columns.includes("Duration")?s("td",[e._v(e._s(e._f("round")(t.duration,3))+" ms")]):e._e()])}))}}],null,!1,1651104168)}):e._e()],1)},ne=[],ie=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("table",{staticClass:"details-table"},[s("thead",[e.noHeader?e._e():s("tr",[e._t("header",e._l(e.columns,(function(t,a){return s("th",{on:{click:function(s){e.filter.sortBy(t.sortBy||t.toLowerCase())}}},[e._v("\n\t\t\t\t\t"+e._s(t.name||t)+"\n\t\t\t\t\t"),s("font-awesome-icon",{directives:[{name:"show",rawName:"v-show",value:e.filter.sortedBy==(t.sortBy||t.toLowerCase()),expression:"filter.sortedBy == (column.sortBy || column.toLowerCase())"}],attrs:{icon:e.filter.sortedDesc?"angle-down":"angle-up"}}),a==e.columns.length-1?s("details-table-filter-toggle",{attrs:{filter:e.filter}}):e._e()],1)})),{filter:e.filter})],2),s("tr",{directives:[{name:"show",rawName:"v-show",value:e.filter.shown,expression:"filter.shown"}],staticClass:"filter"},[s("td",{attrs:{colspan:e.columns.length}},[s("label",[s("font-awesome-icon",{attrs:{icon:"search"}}),s("input",{directives:[{name:"model",rawName:"v-model",value:e.filter.input,expression:"filter.input"}],ref:"filterInput",attrs:{type:"search",placeholder:"Filter..."},domProps:{value:e.filter.input},on:{input:function(t){t.target.composing||e.$set(e.filter,"input",t.target.value)}}}),s("span",{directives:[{name:"show",rawName:"v-show",value:!e.filter.input,expression:"! filter.input"}],staticClass:"example"},[e._v("eg. "+e._s(e.filterExample))])],1)])])]),s("tbody",[e.hasPreviousItems?s("tr",{staticClass:"pagination-controls"},[s("td",{attrs:{colspan:e.columns.length}},[s("a",{attrs:{href:"#"},on:{click:e.showPreviousItems}},[e._v("Show "+e._s(e.previousItemsCount)+" previous")])])]):e._e(),e._t("body",null,{items:e.shownItems}),e.hasNextItems?s("tr",{staticClass:"pagination-controls"},[s("td",{attrs:{colspan:e.columns.length}},[s("a",{attrs:{href:"#"},on:{click:e.showNextItems}},[e._v("Show "+e._s(e.nextItemsCount)+" more")])])]):e._e()],2)])},re=[],oe=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("a",{staticClass:"toggle-filter",attrs:{href:"#"},on:{click:function(t){return t.stopPropagation(),e.filter.toggle(t)}}},[s("font-awesome-icon",{attrs:{icon:"search"}})],1)},le=[],ce={name:"DetailsTableFilterToggle",props:["filter"]},ue=ce,de=Object($["a"])(ue,oe,le,!1,null,null,null),he=de.exports,fe=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div")},pe=[],me={name:"PrettyPrint",props:["data","expanded"],methods:{render:function(){var e=this.data,t=document.createElement("div");if(!0===e)t.innerHTML="true";else if(!1===e)t.innerHTML="false";else if(void 0===e)t.innerHTML="undefined";else if(null===e)t.innerHTML="null";else if("number"===typeof e)t.innerText=e;else try{t.append(new g(e).generateHtml())}catch(s){t.innerText=e}this.$el.firstChild&&this.$el.firstChild.remove(),this.$el.append(t),this.expanded&&this.$el.querySelector(".pretty-jason > li > span").click()}},mounted:function(){this.render()},watch:{data:function(){this.render()}}},ve=me,ge=Object($["a"])(ve,fe,pe,!1,null,null,null),be=ge.exports,we={name:"DetailsTable",components:{DetailsTableFilterToggle:he,PrettyPrint:be},props:{columns:{},filter:{},filterExample:{},items:{},noHeader:{},perPage:{default:30}},data:function(){return{firstShown:0}},computed:{filteredItems:function(){return this.filter.filter(this.items)},shownItems:function(){return this.firstShown>this.filteredItems.length&&(this.firstShown=Math.max(this.filteredItems.length-this.perPage,0)),this.filteredItems.slice(this.firstShown,this.firstShown+this.perPage)},hasPreviousItems:function(){return this.firstShown>0},previousItemsCount:function(){return this.firstShown},hasNextItems:function(){return this.firstShown+this.perPaget&&(e.scrollTop=t)}},watch:{filteredItems:function(){this.firstShown=0}}},ye=we,_e=(s("2958"),Object($["a"])(ye,ie,re,!1,null,null,null)),qe=_e.exports,$e=(s("4917"),s("55dd"),s("2b0e")),Ce=function(){function e(t,s){Object(m["a"])(this,e),this.tags=t,this.map=s,this.shown=!1,this.sortedBy=void 0,this.sortedDesc=!1,this.input=""}return Object(v["a"])(e,[{key:"toggle",value:function(e){this.shown=!this.shown,this.shown&&$e["a"].nextTick((function(){var t=e.target;while(t=t.parentNode)if("TABLE"==t.tagName)break;t.querySelector(".filter input").focus()}))}},{key:"sortBy",value:function(e){this.sortedBy==e?this.sortedDesc=!this.sortedDesc:(this.sortedBy=e,this.sortedDesc=!0)}},{key:"filter",value:function(e){var t=this,s=this.tokenize(this.input),a=s.terms,n=s.tags;if(e=e.filter((function(e){var s=t.map?t.map(e):e;return t.matchesTerms(s,a)&&t.matchesTags(e,n)})),this.sortedBy){var i=this.tags.find((function(e){return e.tag==t.sortedBy}));e.sort((function(e,s){var a,n;return i&&"number"==i.type?e[t.sortedBy]-s[t.sortedBy]:null===(a=e[t.sortedBy])||void 0===a?void 0:a.toString().localeCompare(null===(n=s[t.sortedBy])||void 0===n?void 0:n.toString())}))}return this.sortedDesc&&(e=e.reverse()),e}},{key:"matchesTerms",value:function(e,t){var s=this;return!t.length||("object"==Object(p["a"])(e)&&null!==e?Object.values(e).find((function(e){return s.matchesTerms(e,t)})):"string"==typeof e&&t.find((function(t){return e.toLowerCase().includes(t.toLowerCase())})))}},{key:"matchesTags",value:function(e,t){var s=this;return!Object.keys(t).length||Object.keys(t).every((function(a){return a=s.tags.find((function(e){return e.tag==a})),!!a&&("number"==a.type||"date"==a.type?t[a.tag].every((function(t){return s.isTagApplicable(a,e,t)})):t[a.tag].find((function(t){return s.isTagApplicable(a,e,t)})))}))}},{key:"isTagApplicable",value:function(e,t,s){return e.apply?e.apply(t,s):(t=e.map?e.map(t):t[e.tag],"number"==e.type?(a=s.match(/^<(\d+(?:\.\d+)?)$/))?t(\d+(?:\.\d+)?)$/))?parseFloat(a[1])(.+)$/))?moment(t).isAfter(n[1].match(/^\d+:\d+(:\d+)?$/)?moment().format("YYYY-MM-DD ")+n[1]:n[1]):moment(t).isSame(s):"string"==typeof t&&t.toLowerCase().includes(s.toLowerCase()));var a,n}},{key:"tokenize",value:function(e){var t,s=[],a={},n=/(\w+:)?("[^"]*"|[^\s]+)/g;while(t=n.exec(e)){var i=t[1]?t[1].substr(0,t[1].length-1):void 0,r=t[2];(t=r.match(/^"(.+?)"$/))&&(r=t[1]),i?(a[i]||(a[i]=[]),a[i].push(r)):s.push(r)}return{terms:s,tags:a}}}]),e}(),ke={name:"CacheTab",components:{DetailsTable:qe,PrettyPrint:be,StackTrace:P},props:["active"],data:function(){return{filter:new Ce([{tag:"action",apply:function(e,t){if(["read","write","delete","miss"].includes(t.toLowerCase()))return e.type.toLowerCase()==t.toLowerCase()}},{tag:"key"},{tag:"file",map:function(e){return e.shortPath}}])}},computed:{columns:function(){var e=[{name:"Action",sortBy:"type"},"Key","Value","Expires"];return this.$request.cacheQueries.some((function(e){return e.connection}))&&e.unshift("Connection"),this.$request.cacheQueries.some((function(e){return e.duration}))&&e.push("Duration"),e}}},xe=ke,je=Object($["a"])(xe,ae,ne,!1,null,null,null),Te=je.exports,Pe=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{directives:[{name:"show",rawName:"v-show",value:e.active,expression:"active"}]},[s("div",{staticClass:"counters-row"},[s("div",{staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.databaseQueriesCount))]),s("div",{staticClass:"counter-title"},[e._v("queries")])]),e.$request.databaseSlowQueries?s("div",{staticClass:"counter database-slow-query"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.databaseSlowQueries))]),s("div",{staticClass:"counter-title"},[e._v("slow")])]):e._e(),e.$request.databaseSelects?s("div",{staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.databaseSelects))]),s("div",{staticClass:"counter-title"},[e._v("selects")])]):e._e(),e.$request.databaseInserts?s("div",{staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.databaseInserts))]),s("div",{staticClass:"counter-title"},[e._v("inserts")])]):e._e(),e.$request.databaseUpdates?s("div",{staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.databaseUpdates))]),s("div",{staticClass:"counter-title"},[e._v("updates")])]):e._e(),e.$request.databaseDeletes?s("div",{staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.databaseDeletes))]),s("div",{staticClass:"counter-title"},[e._v("deletes")])]):e._e(),e.$request.databaseOthers?s("div",{staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.databaseOthers))]),s("div",{staticClass:"counter-title"},[e._v("other")])]):e._e(),s("div",{staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.databaseDurationRounded)+" ms")]),s("div",{staticClass:"counter-title"},[e._v("time")])])]),e.$request.databaseQueries.length?s("details-table",{attrs:{columns:e.columns,items:e.$request.databaseQueries,filter:e.filter,"filter-example":"where request_id model:request type:select file:Controller.php duration:>100"},scopedSlots:e._u([{key:"body",fn:function(t){var a=t.items;return e._l(a,(function(t,a){return s("tr",{key:e.$request.id+"-"+a,class:{"database-slow-query":t.tags.includes("slow")}},[s("td",[s("shortened-text",{attrs:{full:t.model}},[e._v(e._s(t.shortModel))])],1),e.columns.includes("Connection")?s("td",[e._v(e._s(t.connection))]):e._e(),s("td",[s("div",{staticClass:"database-query"},[s("div",{staticClass:"database-query-content"},[s("div",[e._v(e._s(t.query))]),t.bindings?s("div",{staticClass:"database-query-bindings"},[s("pretty-print",{attrs:{data:t.bindings}})],1):e._e()]),s("stack-trace",{staticClass:"database-query-path",attrs:{trace:t.trace,file:t.file,line:t.line}})],1)]),s("td",{staticClass:"database-duration"},[t.duration?s("span",[e._v(e._s(e._f("round")(t.duration,3))+" ms")]):e._e()])])}))}}],null,!1,2035122076)}):e._e()],1)},Oe=[],Se=(s("5df3"),s("4f7f"),s("3b2b"),{name:"DatabaseTab",components:{DetailsTable:qe,PrettyPrint:be,ShortenedText:k,StackTrace:P},props:["active"],data:function(){return{filter:new Ce([{tag:"model"},{tag:"type",apply:function(e,t){if(["select","update","insert","delete"].includes(t.toLowerCase()))return e.query.match(new RegExp("^".concat(t.toLowerCase()),"i"))}},{tag:"file",map:function(e){return e.shortPath}},{tag:"duration",type:"number"}])}},computed:{columns:function(){var e=["Model","Query","Duration"],t=new Set(this.$request.databaseQueries.map((function(e){return e.connection}))).size>1;return t&&e.splice(1,0,"Connection"),e}}}),Re=Se,De=(s("c563"),Object($["a"])(Re,Pe,Oe,!1,null,null,null)),Ne=De.exports,Ee=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{directives:[{name:"show",rawName:"v-show",value:e.active,expression:"active"}]},[s("details-table",{attrs:{columns:["To","Subject","Headers"],items:e.$request.emails,filter:e.filter,"filter-example":'"User Registration" to:its@underground.works'},scopedSlots:e._u([{key:"body",fn:function(t){var a=t.items;return e._l(a,(function(t,a){return s("tr",{key:e.$request.id+"-"+a},[s("td",[e._v(e._s(t.to))]),s("td",[e._v(e._s(t.subject))]),s("td",{attrs:{colspan:"2"}},[s("pretty-print",{attrs:{data:t.headers}})],1)])}))}}])})],1)},Me=[],Le={name:"EmailsTab",components:{DetailsTable:qe,DetailsTableFilterToggle:he,PrettyPrint:be},props:["active"],data:function(){return{filter:new Ce([{tag:"to"}])}}},Ie=Le,Qe=Object($["a"])(Ie,Ee,Me,!1,null,null,null),Ae=Qe.exports,Ue=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{directives:[{name:"show",rawName:"v-show",value:e.active,expression:"active"}]},[s("details-table",{attrs:{columns:["Time","Event",""],items:e.$request.events,filter:e.filter,"filter-example":'"user registered" file:Controller.php time:<13:08:30'},scopedSlots:e._u([{key:"body",fn:function(t){var a=t.items;return e._l(a,(function(t,a){return s("tr",{key:e.$request.id+"-"+a},[s("td",[e._v(e._s(e._f("moment")(t.time,"HH:mm:ss")))]),s("td",[s("div",{staticClass:"fired-event"},[s("div",{staticClass:"fired-event-content"},[t.objectEvent?s("div",[s("pretty-print",{attrs:{data:t.data}})],1):e._e(),t.objectEvent?e._e():s("div",[e._v("\n\t\t\t\t\t\t\t\t"+e._s(t.event)+"\n\t\t\t\t\t\t\t")])]),s("stack-trace",{staticClass:"fired-query-path",attrs:{trace:t.trace,file:t.file,line:t.line}})],1),s("div",{directives:[{name:"show",rawName:"v-show",value:e.isEventExpanded(t),expression:"isEventExpanded(event)"}],staticClass:"fired-event-details"},[t.objectEvent?e._e():s("div",{staticClass:"fired-event-parameters"},[s("h4",[e._v("Parameters")]),s("pretty-print",{attrs:{data:t.data}})],1),s("div",{staticClass:"fired-event-listeners"},[s("h4",[e._v("Listeners")]),e._l(t.listeners,(function(t,a){return s("shortened-text",{key:e.$request.id+"-"+a,attrs:{full:t.name}},[e._v("\n\t\t\t\t\t\t\t\t"+e._s(t.shortName)+"\n\t\t\t\t\t\t\t")])}))],2)])]),s("td",{staticClass:"fired-event-actions"},[s("font-awesome-icon",{attrs:{icon:e.isEventExpanded(t)?"angle-up":"angle-down"},on:{click:function(s){return e.toggleEvent(t)}}})],1)])}))}}])})],1)},Je=[],He={name:"EventsTab",components:{DetailsTable:qe,PrettyPrint:be,ShortenedText:k,StackTrace:P},props:["active"],data:function(){return{filter:new Ce([{tag:"time",type:"date"},{tag:"file",map:function(e){return e.shortPath}}]),expandedEvents:[]}},methods:{toggleEvent:function(e){this.isEventExpanded(e)?this.expandedEvents=this.expandedEvents.filter((function(t){return t!=e})):this.expandedEvents.push(e)},isEventExpanded:function(e){return-1!==this.expandedEvents.indexOf(e)}}},Be=He,Fe=Object($["a"])(Be,Ue,Je,!1,null,null,null),ze=Fe.exports,Ve=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{directives:[{name:"show",rawName:"v-show",value:e.active,expression:"active"}]},[s("details-table",{attrs:{columns:["Time","Level","Message"],items:e.log,filter:e.filter,"filter-example":"query failed level:error file:Controller.php time:>13:08:29"},scopedSlots:e._u([{key:"body",fn:function(t){var a=t.items;return e._l(a,(function(t,a){return s("tr",{key:e.$request.id+"-"+a,class:{"log-row":!0,error:["emergency","alert","critical","error"].includes(t.level),warning:"warning"==t.level}},[s("td",{staticClass:"log-date"},[e._v(e._s(e._f("moment")(t.time,"HH:mm:ss")))]),s("td",{staticClass:"log-level"},[e._v(e._s(t.level))]),s("td",[s("div",{staticClass:"log-message"},[s("div",{staticClass:"log-message-content"},[s("pretty-print",{attrs:{data:t.message}}),s("div",{directives:[{name:"show",rawName:"v-show",value:t.context,expression:"message.context"}],staticClass:"log-message-context"},[s("pretty-print",{attrs:{data:t.context}})],1)],1),t.exception?s("div",{staticClass:"log-message-exception"},[t.exception.previous?s("a",{staticClass:"exception-previous",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),e.showPreviousException(t)}}},[e._v("Show previous")]):e._e(),s("span",{staticClass:"exception-type"},[e._v(e._s(t.exception.type))]),t.exception.code?s("span",{staticClass:"exception-code"},[e._v("#"+e._s(t.exception.code))]):e._e()]):e._e(),s("stack-trace",{staticClass:"log-message-path",attrs:{trace:t.trace,file:t.file,line:t.line}})],1)])])}))}}])})],1)},We=[],Ke={name:"LogTab",components:{DetailsTable:qe,PrettyPrint:be,StackTrace:P},props:["active"],data:function(){return{filter:new Ce([{tag:"time",type:"date"},{tag:"level"},{tag:"file",map:function(e){return e.shortPath}}],(function(e){return e.message}))}},computed:{log:function(){return this.$request.log.filter((function(e){var t;return!(null===(t=e.context)||void 0===t?void 0:t.performance)}))}},methods:{showPreviousException:function(e){var t=this.$request.log.indexOf(e);this.$request.log.splice(t+1,0,{message:e.exception.previous.message,exception:e.exception.previous,level:"error",shortPath:"".concat(e.exception.previous.file.split(/[\/\\]/).pop(),":").concat(e.exception.previous.line),trace:e.exception.previous.trace}),e.exception.previous=void 0}}},Ge=Ke,Xe=(s("f16e"),Object($["a"])(Ge,Ve,We,!1,null,null,null)),Ye=Xe.exports,Ze=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{directives:[{name:"show",rawName:"v-show",value:e.active,expression:"active"}]},[s("div",{staticClass:"command-output",domProps:{innerHTML:e._s(e.formattedOutput)}})])},et=[],tt=s("61ab"),st=s.n(tt),at={name:"OutputTab",props:["active"],computed:{formattedOutput:function(){return this.ansiToHtml.toHtml(this.$request.commandOutput||"")}},created:function(){this.ansiToHtml=new st.a({fg:"#c7c7c7",bg:"#000000",escapeXML:!0,colors:{0:"#000000",1:"#c91b00",2:"#00c200",3:"#c7c400",4:"#0225c7",5:"#c930c7",6:"#00c5c7",7:"#c7c7c7",8:"#676767",9:"#ff6d67",10:"#5ff967",11:"#fefb67",12:"#6871ff",13:"#ff76ff",14:"#5ffdff",15:"#feffff"}})}},nt=at,it=(s("288a"),Object($["a"])(nt,Ze,et,!1,null,null,null)),rt=it.exports,ot=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{directives:[{name:"show",rawName:"v-show",value:e.active,expression:"active"}]},[s("div",{staticClass:"counters-row"},[s("div",{staticClass:"performance-chart-container"},[s("div",{staticClass:"performance-chart"},[s("pie-chart",{attrs:{donut:!0,data:e.chartValues,colors:e.chartColors,library:e.chartOptions,height:"60px"}})],1)]),e._l(e.$request.performanceMetrics,(function(t,a){return s("div",{key:e.$request.id+"-"+a,staticClass:"counter performance-chart-legend",class:t.style},[s("div",{staticClass:"counter-value"},[e._v(e._s(t.value)+" ms")]),s("div",{staticClass:"counter-title"},[e._v(e._s(t.name))])])})),e.$request.responseDurationRounded?s("div",{staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.responseDurationRounded)+" ms")]),s("div",{staticClass:"counter-title"},[e._v("total")])]):e._e(),e.$request.memoryUsage?s("div",{staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.memoryUsageFormatted))]),s("div",{staticClass:"counter-title"},[e._v("memory")])]):e._e()],2),s("performance-log"),s("div",{attrs:{tabs:"performance"}},[s("div",{staticClass:"performance-tabs"},[s("a",{staticClass:"performance-tab",class:{active:e.isTabActive("timeline")},attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),e.showTab("timeline")}}},[e._v("Timeline")]),s("a",{staticClass:"performance-tab",class:{active:e.isTabActive("profiler")},attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),e.showTab("profiler")}}},[e._v("Profiler")])]),s("timeline",{directives:[{name:"show",rawName:"v-show",value:e.isTabActive("timeline"),expression:"isTabActive('timeline')"}],attrs:{name:"performance",items:e.$request.timeline,tags:e.timelineTags}}),s("profiler",{directives:[{name:"show",rawName:"v-show",value:e.isTabActive("profiler"),expression:"isTabActive('profiler')"}]})],1)],1)},lt=[],ct=function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.performanceLog.length||e.databaseSlowQueries.length?s("div",{staticClass:"performance-log"},[e.performanceLog.length?s("details-table",{attrs:{columns:["Message"],items:e.performanceLog,filter:e.performanceLogFilter,"filter-example":"query failed file:Controller.php time:>13:08:29"},scopedSlots:e._u([{key:"header",fn:function(t){var a=t.filter;return[s("th",{attrs:{colspan:e.databaseSlowQueriesColumns.length}},[e._v("\n\t\t\t\tPerformance warnings "),s("span",{staticClass:"count"},[e._v(e._s(e.performanceLog.length))]),s("details-table-filter-toggle",{attrs:{filter:a}})],1)]}},{key:"body",fn:function(t){var a=t.items;return e._l(a,(function(t,a){return s("tr",{key:e.$request.id+"-"+a,staticClass:"log-row"},[s("td",[s("div",{staticClass:"log-message"},[s("div",{staticClass:"log-message-content"},[s("pretty-print",{attrs:{data:t.message}}),s("div",{directives:[{name:"show",rawName:"v-show",value:t.context&&t.context.length,expression:"message.context && message.context.length"}]},[s("pretty-print",{attrs:{data:t.context}})],1)],1),s("stack-trace",{staticClass:"log-message-path",attrs:{trace:t.trace,file:t.file,line:t.line}})],1)])])}))}}],null,!1,1500537959)}):e._e(),e.databaseSlowQueries.length?s("details-table",{attrs:{columns:e.databaseSlowQueriesColumns,items:e.databaseSlowQueries,filter:e.databaseSlowQueriesFilter,"filter-example":"where request_id model:request type:select file:Controller.php duration:>100"},scopedSlots:e._u([{key:"header",fn:function(t){var a=t.filter;return[s("th",{attrs:{colspan:e.databaseSlowQueriesColumns.length}},[e._v("\n\t\t\t\tSlow database queries "),s("span",{staticClass:"count"},[e._v(e._s(e.$request.databaseSlowQueries))]),s("details-table-filter-toggle",{attrs:{filter:a}})],1)]}},{key:"body",fn:function(t){var a=t.items;return e._l(a,(function(t,a){return s("tr",{key:e.$request.id+"-"+a,class:{"database-slow-query":t.tags.includes("slow")}},[s("td",[s("shortened-text",{attrs:{full:t.model}},[e._v(e._s(t.shortModel))])],1),e.databaseSlowQueriesColumns.includes("Connection")?s("td",[e._v(e._s(t.connection))]):e._e(),s("td",[s("div",{staticClass:"database-query"},[s("div",{staticClass:"database-query-content"},[e._v(e._s(t.query))]),s("stack-trace",{staticClass:"database-query-path",attrs:{trace:t.trace,file:t.file,line:t.line}})],1)]),s("td",{staticClass:"database-duration"},[e._v(e._s(t.duration)+" ms")])])}))}}],null,!1,2667532720)}):e._e()],1):e._e()},ut=[],dt=s("e0e5"),ht=s.n(dt),ft=s("57b8"),pt=s.n(ft),mt={name:"PerformanceLog",components:{DetailsTable:qe,DetailsTableFilterToggle:he,PrettyPrint:be,ShortenedText:k,StackTrace:P},data:function(){return{databaseSlowQueriesFilter:new Ce([{tag:"model"},{tag:"type",apply:function(e,t){if(["select","update","insert","delete"].includes(t.toLowerCase()))return e.query.match(new RegExp("^".concat(t.toLowerCase()),"i"))}},{tag:"file",map:function(e){return e.shortPath}},{tag:"duration",type:"number"}]),performanceLogFilter:new Ce([{tag:"time",type:"date"},{tag:"file",map:function(e){return e.shortPath}}],(function(e){return e.message}))}},computed:{databaseSlowQueriesColumns:function(){var e=["Model","Query","Duration"],t=new Set(this.databaseSlowQueries.map((function(e){return e.connection}))).size>1;return t&&e.splice(1,0,"Connection"),e},databaseSlowQueries:function(){return this.$request.databaseQueries.filter((function(e){return e.tags.includes("slow")}))},performanceLog:function(){return this.$request.log.filter((function(e){var t;return null===(t=e.context)||void 0===t?void 0:t.performance})).map((function(e){return ht()({},e,{context:pt()(e.context,["performance","trace"])})}))}}},vt=mt,gt=(s("e924"),Object($["a"])(vt,ct,ut,!1,null,null,null)),bt=gt.exports,wt=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[e.$profiler.ready?s("table",{staticClass:"profiler"},[s("thead",[s("tr",[s("th",{on:{click:function(t){return e.filter.sortBy("self["+e.$profiler.metric+"]")}}},[e._v("\n\t\t\t\t\tSelf\n\t\t\t\t\t"),s("font-awesome-icon",{directives:[{name:"show",rawName:"v-show",value:e.filter.sortedBy=="self["+e.$profiler.metric+"]",expression:"filter.sortedBy == `self[${$profiler.metric}]`"}],attrs:{icon:e.filter.sortedDesc?"angle-down":"angle-up"}})],1),s("th",{on:{click:function(t){return e.filter.sortBy("inclusive["+e.$profiler.metric+"]")}}},[e._v("\n\t\t\t\t\tInclusive\n\t\t\t\t\t"),s("font-awesome-icon",{directives:[{name:"show",rawName:"v-show",value:e.filter.sortedBy=="inclusive["+e.$profiler.metric+"]",expression:"filter.sortedBy == `inclusive[${$profiler.metric}]`"}],attrs:{icon:e.filter.sortedDesc?"angle-down":"angle-up"}})],1),s("th",{on:{click:function(t){return e.filter.sortBy("function")}}},[e._v("\n\t\t\t\t\tFunction\n\t\t\t\t\t"),s("font-awesome-icon",{directives:[{name:"show",rawName:"v-show",value:"function"==e.filter.sortedBy,expression:"filter.sortedBy == 'function'"}],attrs:{icon:e.filter.sortedDesc?"angle-down":"angle-up"}}),s("div",{staticClass:"profiler-controls"},[s("span",{staticClass:"profiler-control-group"},[s("a",{staticClass:"toggle-filter",attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.filter.toggle()}}},[s("font-awesome-icon",{attrs:{icon:"search"}})],1)]),s("span",{staticClass:"profiler-control-group profiler-show-metric"},[s("a",{class:{active:0==e.$profiler.metric},attrs:{href:"#",title:"Execution time"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.$profiler.showMetric(0)}}},[s("font-awesome-icon",{attrs:{icon:"clock"}})],1),s("a",{class:{active:1==e.$profiler.metric},attrs:{href:"#",title:"Memory usage"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.$profiler.showMetric(1)}}},[s("font-awesome-icon",{attrs:{icon:"microchip"}})],1)]),s("span",{staticClass:"profiler-control-group"},[s("a",{class:{active:!e.$profiler.percentual},attrs:{href:"#",title:"Exact"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.$profiler.showPercentual(!1)}}},[0==e.$profiler.metric?s("span",[e._v("ms")]):e._e(),1==e.$profiler.metric?s("span",[e._v("kB")]):e._e()]),s("a",{class:{active:e.$profiler.percentual},attrs:{href:"#",title:"Percentual"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.$profiler.showPercentual()}}},[s("font-awesome-icon",{attrs:{icon:"percent"}})],1)]),s("span",{staticClass:"profiler-control-group profiler-shown-fraction"},[s("a",{class:{active:1==e.$profiler.shownFraction},attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.$profiler.setShownFraction(1)}}},[e._v("\n\t\t\t\t\t\t\t\t100%\n\t\t\t\t\t\t\t")]),s("a",{class:{active:.9==e.$profiler.shownFraction},attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.$profiler.setShownFraction(.9)}}},[e._v("\n\t\t\t\t\t\t\t\t90%\n\t\t\t\t\t\t\t")]),s("a",{class:{active:.5==e.$profiler.shownFraction},attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.$profiler.setShownFraction(.5)}}},[e._v("\n\t\t\t\t\t\t\t\t50%\n\t\t\t\t\t\t\t")])]),s("span",{staticClass:"profiler-control-group"},[s("a",{attrs:{href:"#",title:"Disable profiler"},on:{click:function(t){return t.preventDefault(),e.$profiler.disableProfiling()}}},[s("font-awesome-icon",{attrs:{icon:"times-circle"}})],1)])])],1)]),s("tr",{directives:[{name:"show",rawName:"v-show",value:e.filter.shown,expression:"filter.shown"}],staticClass:"filter"},[s("td",{attrs:{colspan:"3"}},[s("label",[s("font-awesome-icon",{attrs:{icon:"search"}}),s("input",{directives:[{name:"model",rawName:"v-model",value:e.filter.input,expression:"filter.input"}],attrs:{type:"search",placeholder:"Filter..."},domProps:{value:e.filter.input},on:{input:function(t){t.target.composing||e.$set(e.filter,"input",t.target.value)}}}),s("span",{directives:[{name:"show",rawName:"v-show",value:!e.filter.input,expression:"! filter.input"}],staticClass:"example"},[e._v('eg. "preg_match" self:>500')])],1)])])]),s("tbody",e._l(e.filterXdebug(e.$profiler.functions),(function(t,a){return s("tr",{key:e.$request.id+"-"+a},[s("td",{staticClass:"profiler-metric"},[e._v(e._s(e.$profiler.formatMetric(t.self)))]),s("td",{staticClass:"profiler-metric"},[e._v(e._s(e.$profiler.formatMetric(t.inclusive)))]),s("td",{staticClass:"profiler-function"},[s("div",{staticClass:"profiler-function-name"},[e._v("\n\t\t\t\t\t\t"+e._s(t.name)+"\n\t\t\t\t\t")]),s("div",{staticClass:"profiler-path"},[s("shortened-text",{attrs:{full:t.fullPath}},[e._v(e._s(t.shortPath))])],1)])])})),0)]):e._e(),s("div",{directives:[{name:"show",rawName:"v-show",value:e.$profiler.loading||e.$profiler.parsing,expression:"$profiler.loading || $profiler.parsing"}],staticClass:"profiler-loading"},[s("spinner",{attrs:{name:"fading-circle"}}),s("p",{directives:[{name:"show",rawName:"v-show",value:e.$profiler.loading,expression:"$profiler.loading"}],staticClass:"message"},[e._v("\n\t\t\tLoading profile...\n\t\t")]),s("p",{directives:[{name:"show",rawName:"v-show",value:e.$profiler.parsing,expression:"$profiler.parsing"}],staticClass:"message"},[e._v("\n\t\t\tProcessing profile...\n\t\t")])],1),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.$profiler.available,expression:"! $profiler.available"}],staticClass:"profiler-not-available"},[s("p",[e._v("\n\t\t\tProfile is not present for current request.\n\t\t")]),e._m(0),s("p",{staticClass:"message profiler-enable"},[s("a",{directives:[{name:"show",rawName:"v-show",value:!e.$profiler.isProfiling,expression:"! $profiler.isProfiling"}],attrs:{href:"#"},on:{click:function(t){return e.$profiler.enableProfiling()}}},[e._v("\n\t\t\t\tEnable profiler\n\t\t\t")]),s("a",{directives:[{name:"show",rawName:"v-show",value:e.$profiler.isProfiling,expression:"$profiler.isProfiling"}],attrs:{href:"#"},on:{click:function(t){return e.$profiler.disableProfiling()}}},[e._v("\n\t\t\t\tDisable profiler\n\t\t\t")])])])])},yt=[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("p",{staticClass:"message"},[e._v("\n\t\t\tProfiling requires the Xdebug php extension."),s("br"),s("a",{attrs:{href:"https://underground.works/clockwork/xdebug-profiler?#content",target:"_blank"}},[e._v("Read more about how to set up Xdebug")])])}],_t={name:"Profiler",components:{ShortenedText:k},data:function(){return{filter:function(){var e=new Ce([{tag:"model"},{tag:"file",map:function(e){return e.shortPath}},{tag:"self",type:"number"},{tag:"inclusive",type:"number"}],(function(e){return e.name}));return e.sortedBy="self[0]",e.sortedDesc=!0,e}()}},methods:{filterXdebug:function(e){return e?this.filter.filter(e):[]}}},qt=_t,$t=Object($["a"])(qt,wt,yt,!1,null,null,null),Ct=$t.exports,kt=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"timeline",class:{"table-view":"table"==e.view}},[s("div",{staticClass:"timeline-controls"},[s("span",{staticClass:"timeline-control-group"},[s("a",{staticClass:"toggle-filter",attrs:{href:"#"},on:{click:function(t){return e.filter.toggle()}}},[s("font-awesome-icon",{attrs:{icon:"search"}})],1)]),e.availableTags.length?s("span",{staticClass:"timeline-control-group"},e._l(e.availableTags,(function(t){return s("a",{class:{active:!e.hiddenTags.includes(t.tag)},attrs:{href:"#",title:t.title},on:{click:function(s){return e.toggleTag(t.tag)}}},[s("font-awesome-icon",{attrs:{icon:t.icon}})],1)})),0):e._e(),s("span",{staticClass:"timeline-control-group"},[s("a",{class:{active:"chart"==e.view},attrs:{href:"#",title:"Timeline view"},on:{click:function(t){e.view="chart"}}},[s("font-awesome-icon",{attrs:{icon:"chart-bar"}})],1),s("a",{class:{active:"table"==e.view},attrs:{href:"#",title:"Table view"},on:{click:function(t){e.view="table"}}},[s("font-awesome-icon",{attrs:{icon:"bars"}})],1)])]),s("details-table",{attrs:{columns:e.columns,items:e.filteredItems,filter:e.filter,"filter-example":"database query duration:>50","per-page":100},scopedSlots:e._u([{key:"header",fn:function(t){t.filter;return[s("th",[e._v("Timeline")]),s("th",{staticClass:"timeline-duration"},[e._v("Duration")]),s("th",{staticClass:"timeline-description"},[e._v("Description")])]}},{key:"body",fn:function(t){var a=t.items;return e._l(a,(function(t,a){return s("tr",[s("td",{staticClass:"timeline-graph"},[0==a?s("div",{staticClass:"timeline-legend"},e._l(e.legend,(function(t){return s("span",{staticClass:"timeline-legend-time",style:{left:t.left+"%"}},[e._v(e._s(t.time)+" ms")])})),0):e._e(),s("div",{staticClass:"timeline-bar",class:t.style},[s("div",{staticClass:"label",style:{"text-align":t.labelAlign,"margin-left":t.labelLeft,"margin-right":t.labelRight},attrs:{title:t.description+" ("+t.durationRounded+" ms)"}},[s("span",{staticClass:"timeline-item-tags"},e._l(e.resolveTags(t.tags),(function(e){return s("span",[s("font-awesome-icon",{attrs:{icon:e.icon,title:e.title}})],1)})),0),e._v("\n\t\t\t\t\t\t\t"+e._s(t.description)+"\n\t\t\t\t\t\t\t("+e._s(t.durationRounded)+" ms)\n\t\t\t\t\t\t")]),s("div",{staticClass:"bar",style:{width:t.barWidth,"margin-left":t.barLeft}})])]),s("td",{staticClass:"timeline-duration"},[e._v(e._s(t.durationRounded)+" ms")]),s("td",{staticClass:"timeline-description"},[e._t("table-description",[s("span",{staticClass:"timeline-item-tags"},e._l(e.resolveTags(t.tags),(function(e){return s("span",[s("font-awesome-icon",{attrs:{icon:e.icon,title:e.title}})],1)})),0),e._v("\n\t\t\t\t\t\t"+e._s(t.description)+"\n\t\t\t\t\t")],{item:t})],2)])}))}}],null,!0)})],1)},xt=[],jt=s("a501"),Tt=s.n(jt),Pt={name:"Timeline",components:{DetailsTable:qe},props:{name:{},items:{},tags:{default:function(){return[]}}},data:function(){return{view:"chart",hiddenTags:[],filter:new Ce([{tag:"duration",type:"number"}],(function(e){return e.description}))}},computed:{availableTags:function(){var e=this;return this.tags.filter((function(t){return e.items.find((function(e){return e.tags.includes(t.tag)}))}))},columns:function(){return"chart"==this.view?["Timeline"]:["Timeline","Duration","Description"]},filteredItems:function(){var e=this;return this.items.filter((function(t){return!Tt()(t.tags,e.hiddenTags).length}))},legend:function(){if(!this.$request)return[];var e,t=[],s=document.querySelector(".details-content"),a=s?s.offsetWidth-28:0,n=Math.floor(a/80),i=this.$request.responseDuration/a;for(e=1;e45&&t.push({left:((a-38)/a*100).toString(),time:Math.round(a*i).toString()}),t}},methods:{toggleTag:function(e){this.hiddenTags.includes(e)?this.hiddenTags=this.hiddenTags.filter((function(t){return t!=e})):this.hiddenTags.push(e),this.$settings.global.timelineHiddenTags[this.name]=this.hiddenTags,this.$settings.save()},resolveTags:function(e){var t=this;return e.map((function(e){return t.tags.find((function(t){return t.tag==e}))})).filter((function(e){return e}))}},mounted:function(){this.hiddenTags=this.$settings.global.timelineHiddenTags[this.name]||[]}},Ot=Pt,St=(s("8161"),Object($["a"])(Ot,kt,xt,!1,null,null,null)),Rt=St.exports,Dt={name:"PerformanceTab",components:{PerformanceLog:bt,Profiler:Ct,Timeline:Rt},props:["active"],data:function(){return{activePerformanceTab:"timeline",timelineTags:[{tag:"events",icon:["fas","bullhorn"],title:"Events"},{tag:"databaseQueries",icon:["fas","database"],title:"Database"},{tag:"cacheQueries",icon:["fas","boxes"],title:"Cache"},{tag:"redisCommands",icon:["fas","cube"],title:"Redis"},{tag:"queueJobs",icon:["fas","history"],title:"Queue"},{tag:"views",icon:["fas","pencil-ruler"],title:"Views"},{tag:"emails",icon:["fas","envelope"],title:"Emails"}]}},computed:{chartValues:function(){var e;return null===(e=this.$request)||void 0===e?void 0:e.performanceMetrics.map((function(e){return[e.name,e.value]}))},chartColors:function(){var e,t={style1:{light:"#78b1de",dark:"#649dca"},style2:{light:"#e79697",dark:"#d38283"},style3:{light:"#b1ca6d",dark:"#9db659"},style4:{light:"#ba94e6",dark:"#a680d2"}},s="auto"!=this.$settings.global.appearance?this.$settings.global.appearance:this.defaultAppearance;return null===(e=this.$request)||void 0===e?void 0:e.performanceMetrics.map((function(e){return t[e.style][s]}))},chartOptions:function(){var e="auto"!=this.$settings.global.appearance?this.$settings.global.appearance:this.defaultAppearance;return{legend:{display:!1},tooltips:{enabled:!1},hover:{mode:null},elements:{arc:{borderColor:"dark"==e?"#1f1f1f":"#fff"}}}}},methods:{isTabActive:function(e){return this.activePerformanceTab==e},showTab:function(e){this.activePerformanceTab=e,"profiler"==e&&this.$profiler.loadRequest(this.$request)}}},Nt=Dt,Et=Object($["a"])(Nt,ot,lt,!1,null,null,null),Mt=Et.exports,Lt=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{directives:[{name:"show",rawName:"v-show",value:e.active,expression:"active"}]},[s("details-table",{attrs:{columns:e.columns,items:e.$request.redisCommands,filter:e.filter,"filter-example":"command:zrange connection:eshop file:StatsController.php duration:>50"},scopedSlots:e._u([{key:"body",fn:function(t){var a=t.items;return e._l(a,(function(t,a){return s("tr",{key:e.$request.id+"-"+a},[e.columns.includes("Connection")?s("td",[e._v(e._s(t.connection))]):e._e(),s("td",[e._v(e._s(t.command))]),s("td",[s("div",{staticClass:"database-query"},[s("div",{staticClass:"database-query-content"},[s("pretty-print",{attrs:{data:t.parameters}})],1),s("stack-trace",{staticClass:"database-query-path",attrs:{trace:t.trace,file:t.file,line:t.line}})],1)]),s("td",{staticClass:"database-duration"},[e._v(e._s(t.duration)+" ms")])])}))}}])})],1)},It=[],Qt={name:"RedisTab",components:{DetailsTable:qe,PrettyPrint:be,StackTrace:P},props:["active"],data:function(){return{filter:new Ce([{tag:"connection"},{tag:"command"},{tag:"file",map:function(e){return e.shortPath}},{tag:"duration",type:"number"}])}},computed:{columns:function(){var e=["Command","Parameters","Duration"],t=new Set(this.$request.redisCommands.map((function(e){return e.connection}))).size>1;return t&&e.splice(0,0,"Connection"),e}}},At=Qt,Ut=Object($["a"])(At,Lt,It,!1,null,null,null),Jt=Ut.exports,Ht=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{directives:[{name:"show",rawName:"v-show",value:e.active,expression:"active"}]},[s("details-table",{attrs:{columns:e.columns,items:e.queueJobs,filter:e.filter,"filter-example":"Underground.works name:GenerateInvoice queue:priority"},scopedSlots:e._u([{key:"body",fn:function(t){var a=t.items;return e._l(a,(function(t,a){return s("tr",{key:e.$request.id+"-"+a},[e.columns.includes("Queue")?s("td",[e._v(e._s(t.queue))]):e._e(),e.columns.includes("Connection")?s("td",[e._v(e._s(t.connection))]):e._e(),s("td",[s("shortened-text",{attrs:{full:t.name}},[e._v(e._s(t.shortName))])],1),s("td",[s("div",{staticClass:"database-query"},[s("div",{staticClass:"database-query-content"},[s("pretty-print",{attrs:{data:t.data}})],1),t.maxTries||t.timeout?s("div",{staticClass:"job-options"},[t.maxTries?s("span",[e._v(e._s(t.maxTries)+" tries")]):e._e(),t.timeout?s("span",[e._v(e._s(t.timeout)+"s timeout")]):e._e()]):e._e(),s("stack-trace",{staticClass:"database-query-path",attrs:{trace:t.trace,file:t.file,line:t.line}})],1)]),s("td",[s("span",{class:{"job-status-text":!0,"is-success":t.request&&"done"==t.request.jobStatus,"is-error":t.request&&"failed"==t.request.jobStatus}},[e._v("\n\t\t\t\t\t\t"+e._s(t.request?t.request.jobStatus:"waiting")+"\n\t\t\t\t\t")])]),s("td",[t.request?s("a",{attrs:{href:"#",title:"Show details"},on:{click:function(s){return s.preventDefault(),e.showJob(t)}}},[s("font-awesome-icon",{attrs:{icon:"search"}})],1):e._e()])])}))}}])})],1)},Bt=[],Ft={name:"QueueTab",components:{DetailsTable:qe,PrettyPrint:be,ShortenedText:k,StackTrace:P},props:["active"],data:function(){return{filter:new Ce([{tag:"connection"},{tag:"queue"},{tag:"name"}]),jobRequests:{}}},computed:{columns:function(){var e=["Name","Data"],t=new Set(this.$request.queueJobs.map((function(e){return e.queue}))).size>1,s=new Set(this.$request.queueJobs.map((function(e){return e.connection}))).size>1;return t&&e.splice(0,0,"Queue"),s&&e.splice(0,0,"Connection"),e.concat(["Status",""])},queueJobs:function(){var e=this;return this.$request?this.$request.queueJobs.map((function(t){return ht()({request:e.jobRequests[t.id]},t)})):[]}},methods:{showJob:function(e){this.global.$request=this.$requests.findId(e.id)},loadQueueJobRequest:function(){var e=Object(M["a"])(regeneratorRuntime.mark((function e(t){var s,a,n=this,i=arguments;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(s=i.length>1&&void 0!==i[1]?i[1]:0,12!=s){e.next=3;break}return e.abrupt("return");case 3:if(!t.loadRequestTimeout){e.next=5;break}return e.abrupt("return");case 5:if(e.t0=this.$requests.findId(t.id),e.t0){e.next=10;break}return e.next=9,this.$requests.loadId(t.id,!1);case 9:e.t0=e.sent;case 10:if(a=e.t0,a){e.next=13;break}return e.abrupt("return",t.loadRequestTimeout=setTimeout((function(){t.loadRequestTimeout=null,n.loadQueueJobRequest(t,s+1)}),5e3));case 13:this.$set(this.jobRequests,t.id,a);case 14:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},watch:{active:function(e){var t=this;e&&this.$request.queueJobs.forEach((function(e){e.id&&t.loadQueueJobRequest(e)}))}}},zt=Ft,Vt=(s("05dd"),Object($["a"])(zt,Ht,Bt,!1,null,"e2548e86",null)),Wt=Vt.exports,Kt=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{directives:[{name:"show",rawName:"v-show",value:e.active,expression:"active"}]},[s("details-table",{attrs:{columns:e.columns,items:e.$request.routes,filter:e.filter,"filter-example":"OrderController method:post uri:order"},scopedSlots:e._u([{key:"body",fn:function(t){var a=t.items;return e._l(a,(function(t,a){return s("tr",{key:e.$request.id+"-"+a},[s("td",[e._v(e._s(t.method))]),s("td",[e._v(e._s(t.uri))]),s("td",[e._v(e._s(t.action))]),e.columns.includes("Name")?s("td",[e._v(e._s(t.name))]):e._e(),e.columns.includes("Middleware")?s("td",e._l(t.middleware,(function(a,n){return s("span",[e._v("\n\t\t\t\t\t\t"+e._s(a)+e._s(n==t.middleware.length-1?"":", ")+"\n\t\t\t\t\t")])})),0):e._e(),e.columns.includes("Before")?s("td",[e._v(e._s(t.before))]):e._e(),e.columns.includes("After")?s("td",[e._v(e._s(t.after))]):e._e()])}))}}])})],1)},Gt=[],Xt={name:"RoutesTab",components:{DetailsTable:qe},props:["active"],data:function(){return{filter:new Ce([{tag:"method",apply:function(e,t){if(["get","post","put","delete","head","patch"].includes(t.toLowerCase()))return e.method.toLowerCase()==t.toLowerCase()}},{tag:"uri"}])}},computed:{columns:function(){var e=["Methods","URI","Action"];return this.$request.routes.some((function(e){return e.name}))&&e.push("Name"),this.$request.routes.some((function(e){return e.middleware}))&&e.push("Middleware"),this.$request.routes.some((function(e){return e.before}))&&e.push("Before"),this.$request.routes.some((function(e){return e.after}))&&e.push("After"),e}}},Yt=Xt,Zt=Object($["a"])(Yt,Kt,Gt,!1,null,null,null),es=Zt.exports,ts=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{directives:[{name:"show",rawName:"v-show",value:e.active,expression:"active"}]},e._l(e.userTab.sections,(function(t,a){return s("div",{key:e.$request.id+"-"+a},["counters"==t.showAs?s("div",{staticClass:"counters-row"},e._l(t.data,(function(t,a){return s("div",{key:e.$request.id+"-"+a,staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(t.value))]),s("div",{staticClass:"counter-title"},[e._v(e._s(t.key))])])})),0):e._e(),t.title?s("h3",[e._v("\n\t\t\t"+e._s(t.title)+"\n\t\t")]):e._e(),"table"==t.showAs?s("details-table",{attrs:{columns:t.data[0].map((function(e){return e.key})),items:t.data,filter:e.filters[a]},scopedSlots:e._u([{key:"body",fn:function(t){var a=t.items;return e._l(a,(function(t){return s("tr",e._l(t,(function(e){return s("td",[s("pretty-print",{attrs:{data:e.value}})],1)})),0)}))}}],null,!0)}):e._e()],1)})),0)},ss=[],as={name:"UserTab",components:{DetailsTable:qe,PrettyPrint:be},props:["active","userTab"],data:function(){return{filters:[]}},watch:{userTab:{handler:function(e){this.filters=e.sections.map((function(e){if("table"==e.showAs)return new Ce(e.data[0].map((function(e){return{tag:e.key}})))}))},immediate:!0}}},ns=as,is=Object($["a"])(ns,ts,ss,!1,null,null,null),rs=is.exports,os=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{directives:[{name:"show",rawName:"v-show",value:e.active,expression:"active"}]},[s("timeline",{attrs:{name:"views",items:e.$request.viewsData},scopedSlots:e._u([{key:"table-description",fn:function(t){var a=t.item;return[s("div",{staticClass:"views-view-name"},[e._v(e._s(a.description))]),a.data.data?s("pretty-print",{attrs:{data:a.data.data}}):e._e()]}}])})],1)},ls=[],cs={name:"ViewsTab",components:{PrettyPrint:be,Timeline:Rt},props:["active"]},us=cs,ds=(s("a5d3"),Object($["a"])(us,os,ls,!1,null,null,null)),hs=ds.exports,fs={name:"RequestDetails",components:{MessagesOverlay:B,SettingsModal:G,TabHandle:se,CacheTab:Te,DatabaseTab:Ne,EmailsTab:Ae,EventsTab:ze,LogTab:Ye,OutputTab:rt,PerformanceTab:Mt,RedisTab:Jt,QueueTab:Wt,RoutesTab:es,UserTab:rs,ViewsTab:hs},computed:{activeDetailsTab:function(){if(this.$request)return!1===this.shownTabs[this.global.activeTab]?"performance":this.global.activeTab},shownTabs:function(){var e,t,s,a,n,i,r,o,l,c,u,d,h,f,p,m,v,g,b,w,y=this;return{log:(null===(e=this.$request)||void 0===e?void 0:null===(t=e.log)||void 0===t?void 0:t.length)>0,database:(null===(s=this.$request)||void 0===s?void 0:s.databaseQueriesCount)>0||(null===(a=this.$request)||void 0===a?void 0:null===(n=a.databaseQueries)||void 0===n?void 0:n.length)>0,cache:["cacheReads","cacheHits","cacheWrites","cacheDeletes","cacheTime"].some((function(e){var t;return null===(t=y.$request)||void 0===t?void 0:t[e]}))||(null===(i=this.$request)||void 0===i?void 0:i.cacheQueries.length)>0,redis:(null===(r=this.$request)||void 0===r?void 0:null===(o=r.redisCommands)||void 0===o?void 0:o.length)>0,queue:(null===(l=this.$request)||void 0===l?void 0:null===(c=l.queueJobs)||void 0===c?void 0:c.length)>0,events:(null===(u=this.$request)||void 0===u?void 0:null===(d=u.events)||void 0===d?void 0:d.length)>0,views:(null===(h=this.$request)||void 0===h?void 0:null===(f=h.viewsData)||void 0===f?void 0:f.length)>0,emails:(null===(p=this.$request)||void 0===p?void 0:null===(m=p.emails)||void 0===m?void 0:m.length)>0,routes:(null===(v=this.$request)||void 0===v?void 0:null===(g=v.routes)||void 0===g?void 0:g.length)>0,output:(null===(b=this.$request)||void 0===b?void 0:null===(w=b.commandOutput)||void 0===w?void 0:w.length)>0}}},methods:{showTab:function(e){this.global.activeTab=e,this.global.showIncomingRequests=!1},toggleRequestsList:function(){this.$store.set("requestsListCollapsed",!this.$store.get("requestsListCollapsed"))},toggleRequestSidebar:function(){this.$store.set("requestSidebarCollapsed",!this.$store.get("requestSidebarCollapsed"))},togglePreserveLog:function(){this.$store.set("preserveLog",!this.$store.get("preserveLog"))},toggleSettingsModal:function(){this.$settings.toggle()},clear:function(){this.$requests.clear()}}},ps=fs,ms=(s("0f8a"),Object($["a"])(ps,r,o,!1,null,null,null)),vs=ms.exports,gs=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{class:{"request-sidebar":!0,large:e.$store.data.requestsListCollapsed}},[s("div",{staticClass:"sidebar-header"},[s("div",{staticClass:"sidebar-title"},[e.$request&&e.$request.isCommand()?[e._v("\n\t\t\t\tCommand\n\t\t\t")]:e.$request&&e.$request.isQueueJob()?[e._v("\n\t\t\t\tQueue job\n\t\t\t")]:e.$request&&e.$request.isTest()?[e._v("\n\t\t\t\tTest\n\t\t\t")]:[e._v("\n\t\t\t\tRequest\n\t\t\t")]],2),s("div",{staticClass:"sidebar-actions"},[e.$request&&e.$request.url?s("a",{directives:[{name:"clipboard",rawName:"v-clipboard:copy",value:e.$request.url,expression:"$request.url",arg:"copy"}],attrs:{href:"#",title:"Copy url"}},[s("font-awesome-icon",{attrs:{icon:"link"}})],1):e._e(),s("a",{attrs:{href:"#",title:"Preserve log"},on:{click:e.togglePreserveLog}},[s("font-awesome-icon",{attrs:{icon:e.$store.data.preserveLog?"circle":["far","circle"]}})],1),s("a",{attrs:{href:"#",title:"Clear"},on:{click:e.clear}},[s("font-awesome-icon",{attrs:{icon:"ban"}})],1)])]),s("div",{staticClass:"sidebar-content"},[s("parent-request"),s("exception-section"),e.$request&&e.$request.isCommand()?s("command-tab"):e._e(),e.$request&&e.$request.isQueueJob()?s("queue-job-tab"):e._e(),e.$request&&e.$request.isTest()?s("test-tab"):e.$request?s("request-tab"):e._e(),e.$request&&e.$request.time?s("div",{staticClass:"sidebar-date"},[e._v("\n\t\t\t"+e._s(e._f("moment")(1e3*e.$request.time,"Y-MM-DD HH:mm:ss"))+"\n\t\t")]):e._e(),e.$request?s("div",{staticClass:"sidebar-id"},[e._v(e._s(e.$request.id))]):e._e()],1)])},bs=[],ws=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"command-tab"},[s("sidebar-section",{directives:[{name:"show",rawName:"v-show",value:e.$request.commandArgumentsMerged.length,expression:"$request.commandArgumentsMerged.length"}],attrs:{title:"Arguments",name:"arguments",items:e.$request.commandArgumentsMerged,"filter-example":'"Mike Jones" name:name'}}),s("sidebar-section",{directives:[{name:"show",rawName:"v-show",value:e.$request.commandOptionsMerged.length,expression:"$request.commandOptionsMerged.length"}],attrs:{title:"Options",name:"options",items:e.$request.commandOptionsMerged,"filter-example":'"Mike Jones" name:name'}})],1)},ys=[],_s=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"sidebar-section"},[s("div",{staticClass:"section-header"},[s("span",{staticClass:"section-title",on:{click:e.toggle}},[e._v("\n\t\t\t"+e._s(e.title)+"\n\t\t\t"),s("font-awesome-icon",{attrs:{icon:e.expanded?"angle-down":"angle-up"}})],1),s("details-table-filter-toggle",{attrs:{filter:e.filter}})],1),e._t("content",[s("div",{directives:[{name:"show",rawName:"v-show",value:e.expanded,expression:"expanded"}]},[e._t("above-table")],2),e._t("table",[s("details-table",{directives:[{name:"show",rawName:"v-show",value:e.expanded,expression:"expanded"}],attrs:{columns:["Key","Value"],items:e.items,filter:e.filter,"filter-example":e.filterExample,"no-header":!0},scopedSlots:e._u([{key:"body",fn:function(t){var a=t.items;return e._l(a,(function(t,a){return s("tr",{key:e.$request.id+"-"+a},[s("td",{attrs:{colspan:"2"}},[s("div",{staticClass:"key"},[e._v(e._s(t.name))]),s("div",{staticClass:"value"},[s("pretty-print",{attrs:{data:t.value}})],1)])])}))}}])})],{items:e.items,filter:e.filter,filterExample:e.filterExample,expanded:e.expanded})],{expanded:e.expanded})],2)},qs=[],$s={name:"SidebarSection",components:{DetailsTable:qe,DetailsTableFilterToggle:he,PrettyPrint:be},props:["title","name","filterExample","items"],data:function(){return{filter:new Ce([{tag:"name"}])}},computed:{expanded:function(){return this.$store.get("sidebarSection.".concat(this.name),!0)}},methods:{toggle:function(){this.$store.set("sidebarSection.".concat(this.name),!this.expanded)}}},Cs=$s,ks=(s("101e"),Object($["a"])(Cs,_s,qs,!1,null,null,null)),xs=ks.exports,js={name:"CommandTab",components:{SidebarSection:xs}},Ts=js,Ps=(s("ef62"),Object($["a"])(Ts,ws,ys,!1,null,null,null)),Os=Ps.exports,Ss=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"queue-job-tab"},[e.$request.jobPayload?s("sidebar-section",{attrs:{title:"Payload",name:"payload"},scopedSlots:e._u([{key:"content",fn:function(t){var a=t.expanded;return[s("div",{directives:[{name:"show",rawName:"v-show",value:a,expression:"expanded"}],staticClass:"data-value"},[s("pretty-print",{attrs:{data:e.$request.jobPayload,expanded:!0}})],1)]}}],null,!1,1651862303)}):e._e(),e.$request.jobQueue?s("sidebar-section",{attrs:{title:"Queue",name:"queue"},scopedSlots:e._u([{key:"content",fn:function(t){var a=t.expanded;return[s("div",{directives:[{name:"show",rawName:"v-show",value:a,expression:"expanded"}],staticClass:"data-value"},[e._v("\n\t\t\t\t"+e._s(e.$request.jobQueue)+"\n\t\t\t")])]}}],null,!1,3947836948)}):e._e(),e.$request.jobConnection?s("sidebar-section",{attrs:{title:"Connection",name:"connection"},scopedSlots:e._u([{key:"content",fn:function(t){var a=t.expanded;return[s("div",{directives:[{name:"show",rawName:"v-show",value:a,expression:"expanded"}],staticClass:"data-value"},[e._v("\n\t\t\t\t"+e._s(e.$request.jobConnection)+"\n\t\t\t")])]}}],null,!1,3935745011)}):e._e(),e.$request.jobOptions.length?s("sidebar-section",{attrs:{title:"Options",name:"options",items:e.$request.jobOptions,"filter-example":'"Mike Jones" name:name'}}):e._e()],1)},Rs=[],Ds={name:"QueueJobTab",components:{PrettyPrint:be,SidebarSection:xs}},Ns=Ds,Es=(s("6b0a"),Object($["a"])(Ns,Ss,Rs,!1,null,null,null)),Ms=Es.exports,Ls=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"request-tab"},[s("sidebar-section",{directives:[{name:"show",rawName:"v-show",value:e.headers.length,expression:"headers.length"}],attrs:{title:"Headers",name:"headers",items:e.headers,"filter-example":"text/html name:Accept"}}),s("sidebar-section",{directives:[{name:"show",rawName:"v-show",value:e.$request.requestData,expression:"$request.requestData"}],attrs:{title:"Data",name:"data",items:e.$request.requestData,"filter-example":"420 name:price"}},[e.$request.requestData instanceof Object?e._e():s("template",{slot:"content"},[s("div",{staticClass:"data-raw"},[e._v("\n\t\t\t\t"+e._s(e.$request.requestData)+"\n\t\t\t")])])],2),s("sidebar-section",{directives:[{name:"show",rawName:"v-show",value:e.$request.getData.length,expression:"$request.getData.length"}],attrs:{title:"GET data",name:"getData",items:e.$request.getData,"filter-example":"created_at name:orderBy"}}),s("sidebar-section",{directives:[{name:"show",rawName:"v-show",value:e.$request.postData.length,expression:"$request.postData.length"}],attrs:{title:"POST data",name:"postData",items:e.$request.postData,"filter-example":'"Mike Jones" name:name'}}),s("sidebar-section",{directives:[{name:"show",rawName:"v-show",value:e.$request.cookies.length,expression:"$request.cookies.length"}],attrs:{title:"Cookies",name:"cookies",items:e.$request.cookies,"filter-example":'"Mike Jones" name:name'}}),s("sidebar-section",{directives:[{name:"show",rawName:"v-show",value:e.$request.middleware.length,expression:"$request.middleware.length"}],attrs:{title:"Middleware",name:"middleware",items:e.$request.middleware,"filter-example":"auth:admin"},scopedSlots:e._u([{key:"table",fn:function(t){var a=t.items,n=t.filter,i=t.filterExample,r=t.expanded;return[s("details-table",{directives:[{name:"show",rawName:"v-show",value:r,expression:"expanded"}],attrs:{columns:["Value"],items:a,filter:n,"filter-example":i,"no-header":!0},scopedSlots:e._u([{key:"header",fn:function(e){e.filter}},{key:"body",fn:function(t){var a=t.items;return e._l(a,(function(t,a){return s("tr",{key:e.$request.id+"-"+a},[s("td",{staticClass:"value"},[e._v(e._s(t))])])}))}}],null,!0)})]}}])}),s("sidebar-section",{directives:[{name:"show",rawName:"v-show",value:e.$request.sessionData.length||e.$request.authenticatedUser,expression:"$request.sessionData.length || $request.authenticatedUser"}],attrs:{title:"Session",name:"session",items:e.$request.sessionData,"filter-example":"registration successful name:_token"}},[s("template",{slot:"above-table"},[e.$request.authenticatedUser?s("div",{staticClass:"session-user"},[s("font-awesome-icon",{attrs:{icon:"user"}}),s("div",[e.$request.authenticatedUser.name&&e.$request.authenticatedUser.name.trim()?s("span",{staticClass:"name"},[e._v(e._s(e.$request.authenticatedUser.name))]):e._e(),s("span",{class:e.$request.authenticatedUser.name&&e.$request.authenticatedUser.name.trim()?"dimmed":""},[e._v(e._s(e.$request.authenticatedUser.username))])]),e.$request.authenticatedUser.email||e.$request.authenticatedUser.id?s("span",{staticClass:"session-user-details"},[e.$request.authenticatedUser.id?s("span",{staticClass:"dimmed"},[e._v("#"+e._s(e.$request.authenticatedUser.id))]):e._e()]):e._e()],1):e._e()])],2)],1)},Is=[],Qs={name:"RequestTab",components:{DetailsTable:qe,SidebarSection:xs},computed:{headers:function(){return this.$request.cookies.length?this.$request.headers.filter((function(e){return"Cookie"!=e.name})):this.$request.headers}}},As=Qs,Us=(s("9a64"),Object($["a"])(As,Ls,Is,!1,null,null,null)),Js=Us.exports,Hs=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"request-tab test-tab"},[e.$request.testStatusMessage?s("div",{staticClass:"test-status-message"},[e._v("\n\t\t"+e._s(e.$request.testStatusMessage)+"\n\t")]):e._e(),s("sidebar-section",{directives:[{name:"show",rawName:"v-show",value:e.asserts.length,expression:"asserts.length"}],attrs:{title:"Asserts",name:"asserts",items:e.asserts,"filter-example":"text/html name:Accept"},scopedSlots:e._u([{key:"table",fn:function(t){var a=t.items,n=t.filter,i=t.filterExample,r=t.expanded;return[s("details-table",{directives:[{name:"show",rawName:"v-show",value:r,expression:"expanded"}],attrs:{columns:["Assert"],items:a,filter:n,"filter-example":i,"no-header":!0},scopedSlots:e._u([{key:"header",fn:function(e){e.filter}},{key:"body",fn:function(t){var a=t.items;return e._l(a,(function(t,a){return s("tr",{key:e.$request.id+"-"+a},[s("td",{staticClass:"value test-assert"},[s("div",{staticClass:"assert-name"},[s("div",{staticClass:"assert-name-content",class:{"assert-failed":!t.passed}},[e._v(e._s(t.name))]),s("div",{staticClass:"assert-name-trace"},[s("stack-trace",{attrs:{trace:t.trace}})],1)]),s("pretty-print",{attrs:{data:t.arguments}})],1)])}))}}],null,!0)})]}}])})],1)},Bs=[],Fs={name:"TestTab",components:{DetailsTable:qe,PrettyPrint:be,SidebarSection:xs,StackTrace:P},computed:{asserts:function(){return this.$request.testAsserts.reverse()}}},zs=Fs,Vs=(s("86a4"),Object($["a"])(zs,Hs,Bs,!1,null,null,null)),Ws=Vs.exports,Ks={name:"RequestSidebar",components:{CommandTab:Os,ExceptionSection:D,ParentRequest:A,QueueJobTab:Ms,RequestTab:Js,TestTab:Ws},methods:{togglePreserveLog:function(){this.$store.set("preserveLog",!this.$store.get("preserveLog"))},clear:function(){this.$requests.clear()}}},Gs=Ks,Xs=(s("313b"),Object($["a"])(Gs,gs,bs,!1,null,null,null)),Ys=Xs.exports,Zs=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{class:{"split-view-pane split-view-requests":!0,large:e.$store.data.requestSidebarCollapsed}},[s("table",{staticClass:"requests-header",attrs:{id:"requests-header"}},[s("thead",[s("tr",[e._m(0),s("th",{staticClass:"status"},[e._v("\n\t\t\t\t\tStatus\n\t\t\t\t")]),s("th",{staticClass:"duration"},[e._v("\n\t\t\t\t\tTime"),s("br"),e.showDatabaseTime?s("small",[e._v("Database")]):e._e()])])])]),s("div",{directives:[{name:"show",rawName:"v-show",value:e.$requestsSearch.shown,expression:"$requestsSearch.shown"}],staticClass:"requests-search"},[s("label",[s("font-awesome-icon",{attrs:{icon:"search"}}),s("input",{directives:[{name:"model",rawName:"v-model",value:e.$requestsSearch.input,expression:"$requestsSearch.input"}],attrs:{type:"search",placeholder:"Search..."},domProps:{value:e.$requestsSearch.input},on:{input:[function(t){t.target.composing||e.$set(e.$requestsSearch,"input",t.target.value)},e.$requestsSearch.searchDebounced]}}),s("span",{directives:[{name:"show",rawName:"v-show",value:!e.$requestsSearch.input,expression:"! $requestsSearch.input"}],staticClass:"example"},[e._v("eg. /api/users method:post status:500")])],1)]),s("div",{ref:"requestsContainer",staticClass:"requests-container"},[s("div",{ref:"loadMore",staticClass:"load-more"},[s("p",{directives:[{name:"show",rawName:"v-show",value:!e.loadingMoreRequests,expression:"! loadingMoreRequests"}],staticClass:"load"},[s("a",{attrs:{href:"#"},on:{click:e.loadMoreRequests}},[e._v("load more")])]),s("p",{directives:[{name:"show",rawName:"v-show",value:e.loadingMoreRequests,expression:"loadingMoreRequests"}],staticClass:"loading"},[e._v("\n\t\t\t\tloading...\n\t\t\t")])]),s("table",{ref:"requestsTable",attrs:{id:"requests"}},[e._m(1),e._l(e.requests,(function(t){return s("tr",{key:t.id,class:{selected:e.isActive(t.id)},on:{click:function(s){return e.showRequest(t)}}},[s("td",{staticClass:"controller",attrs:{title:t.tooltip}},[s("div",{staticClass:"notifications-count"},[s("span",{directives:[{name:"show",rawName:"v-show",value:t.warningsCount,expression:"request.warningsCount"}],staticClass:"warnings-count"},[s("font-awesome-icon",{attrs:{icon:"exclamation-triangle"}}),e._v(" "+e._s(t.warningsCount)+"\n\t\t\t\t\t\t")],1),s("span",{directives:[{name:"show",rawName:"v-show",value:t.errorsCount,expression:"request.errorsCount"}],staticClass:"errors-count"},[s("font-awesome-icon",{attrs:{icon:"exclamation-circle"}}),e._v(" "+e._s(t.errorsCount)+"\n\t\t\t\t\t\t")],1)]),s("big",[t.isCommand()?[s("span",{staticClass:"type-text"},[e._v("CMD")]),e._v("\n\t\t\t\t\t\t\t"+e._s(t.commandName)+"\n\t\t\t\t\t\t")]:t.isQueueJob()?[s("span",{staticClass:"type-text"},[e._v("QUEUE")]),e._v("\n\t\t\t\t\t\t\t"+e._s(t.jobName)+"\n\t\t\t\t\t\t")]:t.isTest()?[s("span",{staticClass:"type-text"},[e._v("TEST")]),e._v("\n\t\t\t\t\t\t\t"+e._s(t.testGroup)+"\n\t\t\t\t\t\t")]:[t.isAjax()?s("span",{staticClass:"type-text"},[e._v("AJAX")]):e._e(),s("span",{staticClass:"method-text"},[e._v(e._s(t.method))]),e._v(" "+e._s(t.uri)+"\n\t\t\t\t\t\t")]],2),s("br"),t.isCommand()?[s("small",[e._v(e._s(t.commandLine))])]:t.isQueueJob()?[s("small",[e._v(e._s(t.jobDescription))])]:t.isTest()?[s("small",[e._v(e._s(t.testName))])]:[e.$store.data.requestSidebarCollapsed?s("small",[e._v(e._s(t.controller))]):s("small",[e._v(e._s(e._f("shortClass")(t.controller)))])]],2),t.isCommand()?[s("td",{staticClass:"status",attrs:{title:t.commandExitCode}},[s("span",{class:{"status-text":!0,"client-error":t.isCommandWarning(),"server-error":t.isCommandError()}},[e._v(e._s(t.commandExitCode))])])]:t.isQueueJob()?[s("td",{staticClass:"status",attrs:{title:t.jobStatus}},[s("span",{class:{"status-text":!0,"status-text-small":!0,"client-error":t.isQueueJobWarning(),"server-error":t.isQueueJobError()}},[e._v(e._s(t.jobStatus))])])]:t.isTest()?[s("td",{staticClass:"status",attrs:{title:t.testStatus}},[s("span",{class:{"status-text":!0,"status-text-small":!0,"client-error":t.isTestWarning(),"server-error":t.isTestError()}},[e._v(e._s(t.testStatus))])])]:[s("td",{staticClass:"status",attrs:{title:t.responseStatus}},[s("span",{class:{"status-text":!0,"client-error":t.isClientError(),"server-error":t.isServerError()}},[e._v(e._s(t.responseStatus))])])],s("td",{staticClass:"duration",attrs:{title:t.responseDurationRounded+" ms ("+t.databaseDurationRounded+" ms)"}},[e._v("\n\t\t\t\t\t"+e._s(t.responseDurationRounded)+" ms"),s("br"),e.showDatabaseTime?s("small",[e._v(e._s(t.databaseDurationRounded)+" ms")]):e._e()])],2)})),e._m(2)],2)])])},ea=[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("th",{staticClass:"controller"},[e._v("\n\t\t\t\t\tPath"),s("br"),s("small",[e._v("Controller")])])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("tr",{staticClass:"sizing"},[s("td",{staticClass:"controller"}),s("td",{staticClass:"status"}),s("td",{staticClass:"duration"})])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("tr",{staticClass:"filler"},[s("td",{staticClass:"controller"}),s("td",{staticClass:"status"}),s("td",{staticClass:"duration"})])}],ta={name:"RequestsList",components:{},data:function(){return{loadingMoreRequests:!1}},computed:{requests:function(){var e=this.$requests.items;return this.$settings.global.hideCommandTypeRequests&&(e=e.filter((function(e){return"command"!=e.type}))),this.$settings.global.hideQueueJobTypeRequests&&(e=e.filter((function(e){return"queue-job"!=e.type}))),this.$settings.global.hideTestTypeRequests&&(e=e.filter((function(e){return"test"!=e.type}))),e},showDatabaseTime:function(){return this.requests.find((function(e){return e.databaseDuration>0}))}},mounted:function(){this.$refs.requestsContainer.scrollTop=this.$refs.loadMore.offsetHeight+1},methods:{isActive:function(e){var t;return(null===(t=this.$request)||void 0===t?void 0:t.id)==e},showRequest:function(e){this.global.$request=e},loadMoreRequests:function(){var e=this;this.loadingMoreRequests=!0,this.$requests.loadPrevious(10).then((function(){e.loadingMoreRequests=!1}))},shouldShowFirstRequest:function(){return!this.$store.get("preserveLog")&&(!this.$request||!this.$requests.findId(this.$request.id))},shouldShowIncomingRequest:function(){return this.$store.get("preserveLog")&&(!this.$request||this.$settings.global.showIncomingRequests&&this.global.showIncomingRequests)}},watch:{requests:{handler:function(e){this.shouldShowFirstRequest()?this.showRequest(this.$requests.first()):this.shouldShowIncomingRequest()&&(this.showRequest(this.$requests.last((function(e){return!e.isAjax()}))||this.$requests.last()),this.$refs.requestsContainer.scrollTop=this.$refs.requestsTable.offsetHeight)},deep:!0},$request:{handler:function(e){var t,s;"requires-authentication"==(null===(t=this.$request)||void 0===t?void 0:null===(s=t.error)||void 0===s?void 0:s.error)&&this.$authentication.request(this.$request.error.message,this.$request.error.requires);var a=this.$requests.last((function(e){return!e.isAjax()}))||this.$requests.last(),n=this.$requests.all().indexOf(a);this.global.showIncomingRequests=this.$requests.all().slice(n).includes(e)}}}},sa=ta,aa=(s("d852"),Object($["a"])(sa,Zs,ea,!1,null,null,null)),na=aa.exports,ia=function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.shown?s("div",{staticClass:"whats-new"},[s("div",{staticClass:"whats-new-content"},[s("h1",[e._v("Clockwork has just been updated!")]),e._l(e.release.notes,(function(t){return[s("div",{staticClass:"whats-new-section"},[s("h2",[e._v(e._s(t.title))]),e._l(t.text,(function(t){return s("p",[e._v(e._s(t))])})),t.image?s("img",{attrs:{src:"img/whats-new/"+e.release.version+"/"+t.image}}):e._e()],2)]})),s("div",{staticClass:"whats-new-actions"},[s("a",{staticClass:"actions-show-more",attrs:{href:e.release.url,target:"_blank"}},[e._v("Learn more")]),s("a",{staticClass:"actions-close",attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),e.close(t)}}},[e._v("Close")]),e._m(0)])],2)]):e._e()},ra=[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("p",[s("small",[e._v("Some of the new features might require server-side Clockwork library update.")])])}],oa=function(){function e(){Object(m["a"])(this,e)}return Object(v["a"])(e,null,[{key:"latestRelease",get:function(){return e.releases[0]}},{key:"releases",get:function(){return[{version:"4.1",url:"https://underground.works/blog/clockwork-4.1-released-with-commands-queue-jobs-and-tests-profiling",notes:[{title:"Commands profiling",text:["Collect executed artisan commands with all profiling data and command specific data like command name, exit code, arguments, parameters and output.",'New "output" tab shows an ansi formatted command output.'],image:"commands-profiling.png"},{title:"Queue jobs profiling",text:["Collect executed queue jobs with all profiling data and queue-job specific data like job name, status, payload, connection, queue name and options.",'The "queue" tab now shows the disatched job\'s status with an ability to show full job details if available.'],image:"queue-jobs-profiling.png"},{title:"Tests profiling",text:["Collect ran tests with all profiling data and test specific data like test name, status and executed asserts."],image:"tests-profiling.png"},{title:"Extended timeline",text:["Timeline now includes database queries, events, cache queries, queue jobs, redis commands, views and emails.",'You can use the new "tag" icons to filter out specific type of timeline items.'],image:"extended-timeline.png"},{title:"New settings modal",text:["Personalize Clockwork via the new settings modal, including new appearance settings, ability to hide various types of requests and to disable auto-showing of incoming requests."],image:"new-settings-modal.png"},{title:"Parent requests",text:["Requests can now have parent requests, eg. a queue-job can have the http request that dispatched it as a parent. Parent requests are lazy-loaded with ability to click-through to the parent details."]},{title:"Views timeline",text:["The views tab now shows a timeline view instead of a simple table, supports memory usage and does not show empty view data anymore."]}]}]}}]),e}(),la={name:"WhatsNew",computed:{shown:function(){return this.$settings.global.seenReleaseNotesVersion!=oa.latestRelease.version},release:function(){return oa.latestRelease}},methods:{close:function(){this.$settings.global.seenReleaseNotesVersion=oa.latestRelease.version,this.$settings.save()}}},ca=la,ua=(s("f407"),Object($["a"])(ca,ia,ra,!1,null,null,null)),da=ua.exports,ha={name:"App",components:{RequestDetails:vs,RequestSidebar:Ys,RequestsList:na,WhatsNew:da},computed:{appearance:function(){return"auto"!=this.$settings.global.appearance?this.$settings.global.appearance:this.defaultAppearance}}},fa=ha,pa=(s("5c0b"),Object($["a"])(fa,n,i,!1,null,null,null)),ma=pa.exports,va=s("d842"),ga=s("4eb5"),ba=s.n(ga),wa=s("2ead"),ya=s.n(wa),_a=s("3cb4"),qa=s.n(_a),$a=s("2103"),Ca=s.n($a),ka=s("30ef"),xa=s.n(ka),ja=s("9b02"),Ta=s.n(ja),Pa=s("ad3d");$e["a"].config.devtools=!0,$e["a"].config.performance=!0,$e["a"].config.productionTip=!1,$e["a"].use(ba.a),$e["a"].use(ya.a),$e["a"].use(va["a"],{adapter:xa.a}),$e["a"].use(Ca.a),$e["a"].component("font-awesome-icon",Pa["a"]),$e["a"].component("spinner",qa.a),$e["a"].mixin({methods:{$get:Ta.a}});var Oa=s("ecee"),Sa=s("c074"),Ra=s("b702");Oa["c"].add(Sa["r"],Sa["w"],Sa["o"],Sa["p"],Ra["a"],Sa["i"],Sa["d"],Sa["s"],Sa["z"],Sa["h"],Sa["e"],Sa["b"],Sa["a"],Sa["j"],Sa["v"],Sa["y"],Sa["A"],Sa["u"],Sa["k"],Sa["B"],Sa["c"],Sa["t"],Sa["m"],Sa["g"],Sa["f"],Sa["l"],Sa["q"],Sa["x"],Sa["n"]);var Da=s("75fc"),Na=s("1160"),Ea=s.n(Na),Ma=s("c909"),La=s.n(Ma),Ia=function(){function e(t){Object(m["a"])(this,e),Object.assign(this,t),this.time=parseFloat(this.time),this.responseDurationRounded=this.responseDuration?Math.round(this.responseDuration):0,this.databaseDurationRounded=this.databaseDuration?Math.round(this.databaseDuration):0,this.memoryUsageFormatted=this.memoryUsage?this.formatBytes(this.memoryUsage):void 0,this.processCacheStats(),this.cacheQueries=this.processCacheQueries(this.cacheQueries),this.cookies=this.createKeypairs(this.cookies),this.middleware=this.middleware instanceof Array?this.middleware:[],this.processDatabase(),this.emails=this.processEmails(this.emailsData),this.events=this.processEvents(this.events),this.getData=this.createKeypairs(this.getData),this.requestData=this.requestData instanceof Object?this.createKeypairs(this.requestData,!1):this.requestData,this.headers=this.processHeaders(this.headers),this.log=this.processLog(this.log),this.postData=this.createKeypairs(this.postData),this.queueJobs=this.processQueueJobs(this.queueJobs),this.redisCommands=this.processRedisCommands(this.redisCommands),this.sessionData=this.createKeypairs(this.sessionData),this.performanceMetrics=this.processPerformanceMetrics(this.performanceMetrics),this.viewsData=this.processViews(this.viewsData),this.userData=this.processUserData(this.userData),this.timeline=this.processTimeline(this.timelineData),this.processCommand(),this.processQueueJob(),this.processTest(),this.errorsCount=this.getErrorsCount(),this.warningsCount=this.getWarningsCount(),this.exceptions=this.processExceptions()}return Object(v["a"])(e,[{key:"resolve",value:function(e){return Object.assign(this,e,{loading:!1,error:void 0}),this}},{key:"resolveWithError",value:function(e){return Object.assign(this,{loading:!1,error:e}),this}},{key:"extend",value:function(e,t){var s=this;return t.forEach((function(t){return s[t]=e[t]})),this}},{key:"isClientError",value:function(){return this.responseStatus>=400&&this.responseStatus<500}},{key:"isServerError",value:function(){return this.responseStatus>=500&&this.responseStatus<600}},{key:"isAjax",value:function(){return this.headers.find((function(e){return"X-Requested-With"==e.name&&"XMLHttpRequest"==e.value}))}},{key:"isRequest",value:function(){return"request"==this.type||!this.type}},{key:"isCommand",value:function(){return"command"==this.type}},{key:"isCommandError",value:function(){return 1==this.commandExitCode}},{key:"isCommandWarning",value:function(){return this.commandExitCode>1}},{key:"isQueueJob",value:function(){return"queue-job"==this.type}},{key:"isQueueJobError",value:function(){return"failed"==this.jobStatus}},{key:"isQueueJobWarning",value:function(){return"released"==this.jobStatus}},{key:"isTest",value:function(){return"test"==this.type}},{key:"isTestError",value:function(){return["failed","error"].includes(this.testStatus)}},{key:"isTestWarning",value:function(){return["warning"].includes(this.testStatus)}},{key:"createKeypairs",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!(e instanceof Object))return[];var s=Object.keys(e).map((function(t){return{name:t,value:e[t]}}));return t&&(s=s.sort((function(e,t){return e.name.localeCompare(t.name)}))),s}},{key:"processCacheStats",value:function(){this.cacheDeletes&&(this.cacheDeletes=parseInt(this.cacheDeletes)),this.cacheHits&&(this.cacheHits=parseInt(this.cacheHits)),this.cacheReads&&(this.cacheReads=parseInt(this.cacheReads)),this.cacheWrites&&(this.cacheWrites=parseInt(this.cacheWrites)),this.cacheMisses=this.cacheReads&&this.cacheHits?this.cacheReads-this.cacheHits:null}},{key:"processCacheQueries",value:function(e){var t=this;return e instanceof Array?e.map((function(e){return e.expiration=e.expiration?t.formatTime(e.expiration):void 0,e.value="hit"==e.type||"write"==e.type?e.value:"",e})):[]}},{key:"processDatabase",value:function(){this.databaseQueries=this.processDatabaseQueries(this.databaseQueries),this.databaseQueriesCount=parseInt(this.databaseQueriesCount)||this.databaseQueries.length,this.databaseSlowQueries=parseInt(this.databaseSlowQueries)||this.databaseQueries.filter((function(e){return e.tags.includes("slow")})).length,this.databaseSelects=parseInt(this.databaseSelects)||this.databaseQueries.filter((function(e){return e.query.match(/^select /i)})).length,this.databaseInserts=parseInt(this.databaseInserts)||this.databaseQueries.filter((function(e){return e.query.match(/^insert /i)})).length,this.databaseUpdates=parseInt(this.databaseUpdates)||this.databaseQueries.filter((function(e){return e.query.match(/^update /i)})).length,this.databaseDeletes=parseInt(this.databaseDelets)||this.databaseQueries.filter((function(e){return e.query.match(/^delete /i)})).length,this.databaseOthers=parseInt(this.databaseOthers)||this.databaseQueries.filter((function(e){return!e.query.match(/^(select|insert|update|delete) /i)})).length}},{key:"processDatabaseQueries",value:function(e){var t=this;return e instanceof Array?e.map((function(e){return e.model=e.model||"-",e.shortModel=e.model?e.model.split("\\").pop():"-",e.tags=e.tags instanceof Array?e.tags:[],e.bindings=t.optionalNonEmptyObject(e.bindings),e})):[]}},{key:"processEmails",value:function(e){return e instanceof Object?Object.values(e).filter((function(e){return e.data instanceof Object})).map((function(e){return Object.assign({time:e.start,duration:e.duration},e.data)})):[]}},{key:"processEvents",value:function(e){return e instanceof Array?e.map((function(e){return e.objectEvent=e.data instanceof Object&&e.event==e.data.__class__,e.time=e.time?new Date(1e3*e.time):void 0,e.listeners=e.listeners instanceof Array?e.listeners:[],e.listeners=e.listeners.map((function(e){var t,s;return t=(s=e.match(/Closure \(.*[\/\\](.+?:\d+)-\d+\)/))?"Closure ("+s[1]+")":e.split(/[\/\\]/).pop(),{name:e,shortName:t}})),e})):[]}},{key:"processExceptions",value:function(){var e=this.log.length?this.log[this.log.length-1].exception:null;if(this.isRequest()&&!this.isServerError()||!e)return[];e=Ea()(e);var t=e;do{t.trace=[{call:"".concat(t.type,"()"),file:t.file,line:t.line,isVendor:!1}].concat(Object(Da["a"])(t.trace))}while(t=t.previous);return[e]}},{key:"processHeaders",value:function(e){return e instanceof Object?Object.keys(e).map((function(t){var s=e[t];return t=t.split("-").map((function(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).join("-"),{name:t,value:s}})).reduce((function(e,t){return t=t.value instanceof Array?t.value.map((function(e){return{name:t.name,value:e}})):[t],e.concat(t)}),[]).sort((function(e,t){return e.name.localeCompare(t.name)})):[]}},{key:"processLog",value:function(e){return e instanceof Array?e.map((function(e){return e.exception&&(e.file=e.exception.file,e.line=e.exception.line,e.trace=e.exception.trace),e.time=new Date(1e3*e.time),e.context=e.context instanceof Object&&Object.keys(e.context).filter((function(e){return"__type__"!=e})).length?e.context:void 0,e})):[]}},{key:"processPerformanceMetrics",value:function(e){if(!e)return[{name:"Database",value:this.databaseDurationRounded,style:"style2"},{name:"Cache",value:this.cacheTime,style:"style3"},{name:"Other",value:(this.responseDurationRounded||0)-(this.databaseDurationRounded||0)-(this.cacheTime||0),style:"style1"}].filter((function(e){return e.value>0}));e=e.filter((function(e){return e instanceof Object})).map((function(e,t){return e.style="style"+(t+2),e}));var t=e.reduce((function(e,t){return e+t.value}),0);return e.push({name:"Other",value:this.responseDurationRounded-t,style:"style1"}),e}},{key:"processQueueJobs",value:function(e){return e instanceof Array?e.map((function(e){return e.shortName=e.name.split("\\").pop(),e})):[]}},{key:"processRedisCommands",value:function(e){return e instanceof Array?e:[]}},{key:"processTest",value:function(){if(this.testName){var e=this.testName.includes("::")?this.testName.split("::"):[this.testName,""],t=Object(a["a"])(e,2);this.testGroup=t[0],this.testName=t[1]}}},{key:"processTimeline",value:function(e){return e=e instanceof Object?Object.values(e):[],this.appendToTimeline(e,this.databaseQueries,(function(e){return{description:e.query,tags:["databaseQueries"]}})),this.appendToTimeline(e,this.events,(function(e){return{description:e.event,tags:["events"]}})),this.appendToTimeline(e,this.cacheQueries,(function(e){return{description:"".concat(e.type.toUpperCase()," ").concat(e.key),tags:["cacheQueries"]}})),this.appendToTimeline(e,this.redisCommands,(function(e){return{description:"".concat(e.command," ").concat(Object.values(e.parameters).join(" ")),tags:["redisCommands"]}})),this.appendToTimeline(e,this.queueJobs,(function(e){return{description:e.name,tags:["queueJobs"]}})),this.mergeToTimeline(e,this.viewsData),this.appendToTimeline(e,this.emails,(function(e){return{description:"".concat(e.to," - ").concat(e.subject),tags:["emails"]}})),e=e.sort((function(e,t){return e.start-t.start})),this.createTimeline(e)}},{key:"createTimeline",value:function(e){var t=this;return Object.values(e).map((function(e,s){return e.style="style"+(s%4+1),e.start=e.start||t.time,e.startPercentual=1e3*(e.start-t.time)/t.responseDuration*100,e.duration=e.duration||t.time+t.responseDuration-e.start,e.durationPercentual=e.duration/t.responseDuration*100,e.barLeft="".concat(e.startPercentual,"%"),e.barWidth=e.startPercentual+e.durationPercentual<100?"".concat(e.durationPercentual,"%"):"".concat(100-e.startPercentual,"%"),e.labelAlign="left",e.labelLeft=e.barLeft,e.labelRight="auto",e.startPercentual>50&&(e.labelAlign="right",e.labelLeft="auto",e.labelRight=e.durationPercentual<1?"calc(100% - ".concat(e.barLeft," - 8px)"):"calc(100% - ".concat(e.barLeft," - ").concat(e.barWidth,")")),e.durationRounded=Math.round(e.duration),0===e.durationRounded&&(e.durationRounded="< 1"),e.tags=e.tags||[],e}))}},{key:"appendToTimeline",value:function(e,t,s){t.forEach((function(t){if(t.time){var a=t.time instanceof Date?t.time.getTime()/1e3:t.time,n=t.duration||0;e.push(Object.assign({description:"",start:a,end:a+n,duration:n,data:[],tags:[]},s(t)))}}))}},{key:"mergeToTimeline",value:function(e,t){e.push.apply(e,Object(Da["a"])(t))}},{key:"processViews",value:function(e){var t=this;e=e instanceof Object?Object.values(e):[];e.forEach((function(e){return e.data=e.data||{},e.description=e.data.name||e.description,e.data.data=e.data.data instanceof Object&&Object.keys(e.data.data).filter((function(e){return"__type__"!=e})).length?e.data.data:void 0,e.tags=["views"],e.data.memoryUsage&&(e.description+=" (".concat(t.formatBytes(e.data.memoryUsage),")")),e}));return this.createTimeline(e)}},{key:"processUserData",value:function(e){if(!(e instanceof Object))return[];var t=function(e){var t=Object(a["a"])(e,2),s=t[0];t[1];return"__meta"!=s},s=function(e){return function(t){var s=Object(a["a"])(t,2),n=s[0],i=s[1];return{key:e[n]||n,value:i}}};return Object.entries(e).filter((function(e){var t=Object(a["a"])(e,2),s=(t[0],t[1]);return s instanceof Object||s.__meta||s.__meta.title})).map((function(e){var n=Object(a["a"])(e,2),i=n[0],r=n[1];return{key:i,title:r.__meta.title,sections:Object.entries(r).filter(t).map((function(e){var n=Object(a["a"])(e,2),i=(n[0],n[1]),r=i.__meta.labels||{},o="counters"==i.__meta.showAs?Object.entries(i).filter(t).map(s(r)):Object.entries(i).filter(t).map((function(e){var t=Object(a["a"])(e,2),n=(t[0],t[1]);return Object.entries(n).map(s(r))}));return{data:o,showAs:i.__meta.showAs,title:i.__meta.title}}))}}))}},{key:"processCommand",value:function(){this.commandLine="",this.commandLine+=Object.values(this.commandArguments||{}).filter((function(e){return e})).join(" "),this.commandLine+=Object.entries(this.commandOptions||{}).reduce((function(e,t){var s=Object(a["a"])(t,2),n=s[0],i=s[1];return e+(!0===i?" --".concat(n):" --".concat(n,"=").concat(i))}),""),this.commandArgumentsMerged=this.createKeypairs(Object.assign({},this.commandArgumentsDefaults||{},this.commandArguments||{}),!1),this.commandOptionsMerged=this.createKeypairs(Object.assign({},this.commandOptionsDefaults||{},this.commandOptions||{}),!1)}},{key:"processQueueJob",value:function(){this.jobOptions=this.createKeypairs(this.jobOptions)}},{key:"getErrorsCount",value:function(){return this.log.reduce((function(e,t){return"error"==t.level?e+1:e}),0)}},{key:"getWarningsCount",value:function(){return this.log.filter((function(e){return"warning"==e.level})).length+this.databaseSlowQueries}},{key:"formatTime",value:function(e){var t=Math.floor(e/60),s=Math.floor(t/60);e%=60,t%=60;var a=[];return s&&a.push(s+"h"),t&&a.push(t+"min"),e&&a.push(e+"sec"),a.join(" ")}},{key:"formatBytes",value:function(e){var t=["B","kB","MB","GB","TB","PB"],s=Math.floor(Math.log(e)/Math.log(1024));return"".concat(Math.round(e/Math.round(Math.pow(1024,s)))," ").concat(t[s])}},{key:"optionalNonEmptyObject",value:function(e,t){return e instanceof Object&&Object.keys(e).filter((function(e){return"__type__"!=e})).length?e:t}},{key:"tooltip",get:function(){return this.isCommand()?"[CMD] ".concat(this.commandName," (").concat(this.commandLine,")"):this.isQueueJob()?"[QUEUE] ".concat(this.jobName," (").concat(this.jobDescription,")"):this.isTest()?"[TEST] ".concat(this.testGroup," (").concat(this.testName,")"):"".concat(this.method," ").concat(this.uri," (").concat(this.controller,")")}}],[{key:"placeholder",value:function(t,s,a){return Object.assign(new e({loading:!0,id:t,uri:s?new La.a(s.url).pathname():"/",controller:"Waiting...",method:s?s.method:"GET",responseStatus:"?",parent:a}),{responseDurationRounded:"?",databaseDurationRounded:"?"})}}]),e}(),Qa=function(){function e(){Object(m["a"])(this,e)}return Object(v["a"])(e,[{key:"init",value:function(e){this.global=e,this.requests=e.$requests,this.profiler=e.$profiler,this.settings=e.$settings,this.store=e.$store,this.updateNotification=e.$updateNotification,this.useProperTheme(),this.setMetadataUrl(),this.setMetadataClient(),this.listenToRequests(),this.loadLastRequest()}},{key:"useProperTheme",value:function(){"dark"===this.api.devtools.panels.themeName&&(this.global.defaultAppearance="dark")}},{key:"setMetadataUrl",value:function(){var e=this;this.resolveTabUrl().then((function(t){return e.requests.setRemote(t)}))}},{key:"setMetadataClient",value:function(){var e=this;this.requests.setClient((function(t,s,a,n){return new Promise((function(i,r){var o=e.profiler.isProfiling,l=function(){e.api.runtime.sendMessage({action:"getJSON",method:t,url:s,data:a,headers:n},(function(t){o&&e.profiler.enableProfiling(),t.error?r(t):i(t.data)}))};o?e.profiler.disableProfiling().then(l):l()}))}))}},{key:"setCookie",value:function(e,t,s){var a=this;return this.resolveTabUrl().then((function(n){a.api.cookies.set({url:n,name:e,value:t,path:"/",expirationDate:Math.floor(Date.now()/1e3)+s})}))}},{key:"getCookie",value:function(e){var t=this;return this.resolveTabUrl().then((function(s){return new Promise((function(a,n){t.api.cookies.get({url:s,name:e},(function(e){a(e?e.value:void 0)}))}))}))}},{key:"resolveTabUrl",value:function(){var e=this;return new Promise((function(t,s){e.api.runtime.sendMessage({action:"getTabUrl",tabId:e.api.devtools.inspectedWindow.tabId},(function(e){return t(e)}))}))}},{key:"listenToRequests",value:function(){var e=this;this.api.runtime.onMessage.addListener((function(t){if("requestCompleted"===t.action&&(-1!==navigator.userAgent.toLowerCase().indexOf("firefox/57.0")||t.request.tabId==e.api.devtools.inspectedWindow.tabId)){var s=e.parseHeaders(t.request.responseHeaders);if(s){e.updateNotification.serverVersion=s.version,e.requests.setRemote(t.request.url,s);var a=Ia.placeholder(s.id,t.request);e.requests.loadId(s.id,a),s.subrequests.forEach((function(t){e.requests.setRemote(t.url,{path:t.path}),e.requests.loadId(t.id,Ia.placeholder(t.id,t,a))})),e.requests.setRemote(t.request.url,s),e.settings.global.hideCommandTypeRequests&&e.settings.global.hideQueueJobTypeRequests&&e.settings.global.hideTestTypeRequests||e.startPollingRequests()}}})),this.api.runtime.onMessage.addListener((function(t){"navigationStarted"===t.action&&(e.store.get("preserveLog")||t.details.tabId==e.api.devtools.inspectedWindow.tabId&&e.requests.clear())}))}},{key:"loadLastRequest",value:function(){var e=this;this.api.runtime.sendMessage({action:"getLastClockworkRequestInTab",tabId:this.api.devtools.inspectedWindow.tabId},(function(t){if(t){var s=e.parseHeaders(t.responseHeaders);e.updateNotification.serverVersion=s.version,e.requests.setRemote(t.url,s),e.requests.loadId(s.id,Ia.placeholder(s.id,t)),e.settings.global.hideCommandTypeRequests&&e.settings.global.hideQueueJobTypeRequests&&e.settings.global.hideTestTypeRequests||e.startPollingRequests()}}))}},{key:"parseHeaders",value:function(e){var t,s=(t=e.find((function(e){return"x-clockwork-id"==e.name.toLowerCase()})))?t.value:void 0,a=(t=e.find((function(e){return"x-clockwork-path"==e.name.toLowerCase()})))?t.value:void 0,n=(t=e.find((function(e){return"x-clockwork-version"==e.name.toLowerCase()})))?t.value:void 0;if(s){var i={};e.forEach((function(e){if(0===e.name.toLowerCase().indexOf("x-clockwork-header-")){var t=e.name.replace(/^x-clockwork-header-/i,"");i[t]=e.value}}));var r=e.filter((function(e){return"x-clockwork-subrequest"==e.name.toLowerCase()})).reduce((function(e,t){return e.concat(t.value.split(",").map((function(e){var t=e.trim().split(";");return{id:t[0],url:decodeURIComponent(t[1]),path:decodeURIComponent(t[2])}})))}),[]);return{id:s,path:a,version:n,headers:i,subrequests:r}}}},{key:"startPollingRequests",value:function(){this.pollingInterval=1e3,this.isPolling=!0,this.pollTimeout||this.pollRequests()}},{key:"stopPollingRequests",value:function(){this.isPolling=!1,clearTimeout(this.pollTimeout),this.pollTimeout=null}},{key:"pollRequests",value:function(){var e=this;clearTimeout(this.pollTimeout);var t=[this.settings.global.hideCommandTypeRequests?null:"command",this.settings.global.hideQueueJobTypeRequests?null:"queue-job",this.settings.global.hideTestTypeRequests?null:"test"].filter(Boolean);this.requests.withQuery({"type[]":t},(function(){e.requests.loadNext().then((function(){e.isPolling&&(e.pollTimeout=setTimeout((function(){return e.pollRequests()}),e.pollingInterval))})).catch((function(){e.isPolling&&(e.pollTimeout=setTimeout((function(){return e.pollRequests()}),e.pollingInterval))}))}))}},{key:"throttlePolling",value:function(){var e=this;document.addEventListener("visibilitychange",(function(){e.pollingInterval=document.hidden?6e4:1e3,!document.hidden&&e.isPolling&&e.pollRequests()}))}},{key:"settingsChanged",value:function(){this.settings.global.hideCommandTypeRequests&&this.settings.global.hideQueueJobTypeRequests&&this.settings.global.hideTestTypeRequests?this.stopPollingRequests():this.startPollingRequests()}},{key:"api",get:function(){return chrome||browser}}],[{key:"runningAsExtension",value:function(){return"object"==("undefined"===typeof chrome?"undefined":Object(p["a"])(chrome))&&chrome.devtools||"object"==("undefined"===typeof browser?"undefined":Object(p["a"])(browser))&&browser.devtools}}]),e}(),Aa=function(){function e(){Object(m["a"])(this,e)}return Object(v["a"])(e,[{key:"init",value:function(e){this.global=e,this.requests=e.$requests,this.authentication=e.$authentication,this.profiler=e.$profiler,this.store=e.$store,this.useProperTheme(),this.setMetadataUrl(),this.setMetadataClient(),this.startPollingRequests(),this.throttlePolling()}},{key:"useProperTheme",value:function(){window.matchMedia("(prefers-color-scheme: dark)").matches&&(this.global.defaultAppearance="dark")}},{key:"setMetadataUrl",value:function(){this.requests.setRemote(window.location.href,{path:La()(window.location.href.split("/").slice(0,-1).join("/")).path()+"/"})}},{key:"setMetadataClient",value:function(){var e=this;this.requests.setClient((function(t,s,n,i){var r=e.profiler.isProfiling,o=new FormData;Object.entries(n).forEach((function(e){var t=Object(a["a"])(e,2),s=t[0],n=t[1];return o.append(s,n)}));var l=function(){return fetch(s,{method:t,body:Object.keys(n).length?o:null,headers:i}).then((function(e){return e.json().then((function(t){return{response:e,data:t}}))})).then((function(e){var t=e.response,s=e.data;if(403==t.status)throw{error:"requires-authentication",message:s.message,requires:s.requires};if(200!=t.status)throw{error:"Server returned an error response."};if(!(s instanceof Object)||!Object.keys(s).length)throw{error:"Server returned an empty metadata."};return s})).then((function(t){return r&&e.profiler.enableProfiling(),t}))};return r?e.profiler.disableProfiling().then(l):l()}))}},{key:"setCookie",value:function(e,t,s){return document.cookie="".concat(e,"=").concat(t,";path=/;max-age=").concat(s),Promise.resolve()}},{key:"getCookie",value:function(e){var t=document.cookie.match(new RegExp("(?:^| )".concat(e,"=([^;]*)")));return Promise.resolve(t?t[1]:void 0)}},{key:"startPollingRequests",value:function(){var e=this;this.pollingInterval=1e3,this.requests.loadLatest().then((function(){if(!e.requests.last())throw new Error;e.pollRequests()})).catch((function(t){"requires-authentication"==t.error?e.authentication.request(t.message,t.requires).then((function(){e.startPollingRequests()})):setTimeout((function(){return e.startPollingRequests()}),e.pollingInterval)}))}},{key:"pollRequests",value:function(){var e=this;clearTimeout(this.pollTimeout),this.requests.loadNext().then((function(){e.store.get("preserveLog")||e.requests.setItems(e.requests.all().slice(-1)),e.pollTimeout=setTimeout((function(){return e.pollRequests()}),e.pollingInterval)})).catch((function(){e.pollTimeout=setTimeout((function(){return e.pollRequests()}),e.pollingInterval)}))}},{key:"throttlePolling",value:function(){var e=this;document.addEventListener("visibilitychange",(function(){e.pollingInterval=document.hidden?6e4:1e3,document.hidden||e.pollRequests()}))}},{key:"settingsChanged",value:function(){}}]),e}(),Ua=function(){function e(t){Object(m["a"])(this,e),this.requests=t,this.username=this.password="",this.shown=!1,this.failed=!1,this.requires=[]}return Object(v["a"])(e,[{key:"attempt",value:function(){var e=this,t={username:this.username,password:this.password};return this.username=this.password="",this.failed=!1,this.requests.client("POST","".concat(this.requests.remoteUrl,"auth"),t).then((function(t){e.shown=!1,e.requests.setAuthenticationToken(t.token),e.requests.items.forEach((function(t){if(t.error&&"requires-authentication"==t.error.error)return e.requests.loadId(t.id)})),e.accept()})).catch((function(t){e.failed=!0}))}},{key:"request",value:function(e,t){var s=this;return this.shown=!0,this.requires=t,this.message=e,new Promise((function(e,t){s.accept=e,s.reject=t}))}}]),e}(),Ja=function(){function e(t){Object(m["a"])(this,e),this.settings=t}return Object(v["a"])(e,[{key:"register",value:function(){$e["a"].filter("editorLink",this.filter())}},{key:"filter",value:function(){var e=this;return function(t,s){var a={atom:function(e,t){return"atom://open?url=file://".concat(e,"&line=").concat(t)},phpstorm:function(e,t){return"phpstorm://open?file=".concat(e,"&line=").concat(t)},sublime:function(e,t){return"subl://open?url=file://".concat(e,"&line=").concat(t)},textmate:function(e,t){return"txmt://open?url=file://".concat(e,"&line=").concat(t)},"vs-code":function(e,t){return"vscode://file/".concat(e,":").concat(t)}},n=e.settings.global.editor;if(n&&a[n])return t&&e.settings.site.localPathMap.real&&(t=t.replace(e.settings.site.localPathMap.real,e.settings.site.localPathMap.local)),a[n](t,s)}}}]),e}(),Ha=function(){function e(){Object(m["a"])(this,e),this.load()}return Object(v["a"])(e,[{key:"get",value:function(e,t){return void 0==this.data[e]&&this.set(e,t),this.data[e]}},{key:"set",value:function(e,t){this.data[e]=t,this.save()}},{key:"load",value:function(){try{this.data=JSON.parse(localStorage.getItem("clockwork"))}catch(e){}this.data instanceof Object||(this.data={}),this.data=ht()({},this.defaults(),this.data)}},{key:"save",value:function(){try{localStorage.setItem("clockwork",JSON.stringify(this.data))}catch(e){}}},{key:"defaults",value:function(){return{preserveLog:!0,requestsListCollapsed:!1,requestSidebarCollapsed:!1}}}]),e}(),Ba=(s("6c7b"),s("f559"),function(){function e(t,s){Object(m["a"])(this,e),this.metadata=t,this.functions=s}return Object(v["a"])(e,null,[{key:"parse",value:function(t){return new Promise((function(s,a){s(e.parseSync(t))}))}},{key:"parseSync",value:function(t){var s=this,n={},i=[],r={},o={};t=t.split("\n");var l,c,u,d,h=0;while(void 0!==(l=t[h++]))l.startsWith("fl=")?function(){var e=s.resolveCompressedName(l.match(/fl=(.+)/)[0],r),n=Object(a["a"])(e,2),c=(n[0],n[1]);l=t[h++];var d=s.resolveCompressedName(l.match(/fn=(.+)/)[0],o),f=Object(a["a"])(d,2),p=f[0],m=f[1];l=t[h++];var v=l.split(" ").map((function(e){return parseFloat(e)})),g=v.shift();u=i[p],u||(i[p]=u={name:m,file:c,line:g,invocations:0,self:new Array(v.length).fill(0),inclusive:new Array(v.length).fill(0),callers:[],subCalls:[]}),u.invocations++,u.self=u.self.map((function(e,t){return e+v[t]})),u.inclusive=u.inclusive.map((function(e,t){return e+v[t]}))}():l.startsWith("cfn=")?function(){var e=s.resolveCompressedName(l.match(/cfn=(.+)/)[0],o),n=Object(a["a"])(e,2),r=n[0],c=n[1];l=t[h++],l=t[h++];var f=l.split(" ").map((function(e){return parseFloat(e)})),p=f.shift(),m=i[r];u.inclusive=f.map((function(e,t){return e+(u.inclusive[t]||0)}));var v=m.callers[d];v||(m.callers[d]=v={name:u.name,line:p,calls:0,summed:new Array(f.length).fill(0)}),v.calls++,v.summed=v.summed.map((function(e,t){return e+f[t]}));var g=u.subCalls[r];g||(u.subCalls[r]=g={name:c,line:p,calls:0,summed:new Array(f.length).fill(0)}),g.calls++,g.summed=g.summed.map((function(e,t){return e+f[t]}))}():(c=l.match(/^(.+?): (.+)/))&&(n[c[1]]=c[2]);return new e(n,i.slice(1))}},{key:"resolveCompressedName",value:function(e,t){var s=e.match(/\((\d+)\)(?: (.*))?/),n=Object(a["a"])(s,3),i=(n[0],n[1]),r=n[2];return r&&(t[i]=r),[i,t[i]]}}]),e}()),Fa=function(){function e(t,s){var a=this;Object(m["a"])(this,e),this.requests=t,this.platform=s,this.available=!1,this.loading=!1,this.parsing=!1,this.ready=!1,this.isProfiling=!1,this.metric=0,this.percentual=!1,this.shownFraction=.9,this.request=void 0,this.platform.getCookie("XDEBUG_PROFILE").then((function(e){return a.isProfiling=e}))}return Object(v["a"])(e,[{key:"enableProfiling",value:function(){var e=this;return this.platform.setCookie("XDEBUG_PROFILE","1",2592e3).then((function(){e.isProfiling=!0}))}},{key:"disableProfiling",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t&&this.clear(),this.platform.setCookie("XDEBUG_PROFILE","0",0).then((function(){e.isProfiling=!1}))}},{key:"loadRequest",value:function(e){var t=this;if(!this.request||this.request.id!=e.id){if(!e.xdebug||!e.xdebug.profile)return this.clear();if(this.request=e,this.available=this.loading=this.parsing=this.ready=!1,this.summary=this.metadata=this.functions=void 0,this.available=!0,e.xdebug.profileData)return this.parseProfile();this.loading=!0,this.requests.loadExtended(e.id,["xdebug"]).then((function(e){t.loading=!1,t.parseProfile()}))}}},{key:"parseProfile",value:function(){var e=this;this.ready=!1,this.parsing=!0,Ba.parse(this.request.xdebug.profileData).then((function(t){if(!t.metadata.summary)return e.parsing=e.available=!1;e.metadata=t.metadata,e.summary=e.metadata.summary.split(" ");var s=e.shownFraction*e.summary[e.metric];e.functions=t.functions.filter((function(e){return"{main}"!=e.name})).sort((function(t,s){return s.self[e.metric]-t.self[e.metric]})).filter((function(t){return s-=t.self[e.metric],s>0})).map((function(e){return e.fullPath="php:internal"==e.file?"internal":"".concat(e.file,":").concat(e.line),e.shortPath="internal"!=e.fullPath?e.fullPath.split(/[\/\\]/).pop():e.fullPath,e})),e.parsing=!1,e.ready=!0}))}},{key:"clear",value:function(){this.available=this.loading=this.parsing=this.ready=!1,this.metadata=this.functions=void 0}},{key:"showMetric",value:function(e){this.metric=e,this.parseProfile()}},{key:"showPercentual",value:function(e){this.percentual=!0===e||void 0===e}},{key:"setShownFraction",value:function(e){this.shownFraction=e,this.parseProfile()}},{key:"formatMetric",value:function(e){return this.percentual?Math.round(e[this.metric]/this.summary[this.metric]*100)+" %":1==this.metric?Math.round(e[this.metric]/1024)+" kB":Math.round(e[this.metric]/100)/10+" ms"}}]),e}(),za=function(){function e(t){Object(m["a"])(this,e),this.store=t,this.items=[],this.tokens=this.store.get("requests.tokens"),this.query={},this.exclusive={},this.tokens instanceof Object||(this.tokens={})}return Object(v["a"])(e,[{key:"all",value:function(){return this.items}},{key:"findId",value:function(e){return this.items.find((function(t){return t.id==e}))}},{key:"loadId",value:function(e,t){var s=this,a=this.findId(e);return a?t=a:!1!==t&&(t=t||Ia.placeholder(e),this.items.push(t)),t&&(t.loading=!0),this.load(e,(function(e){return e.then((function(e){return t?t.resolve(e[0]):s.items.push(e[0]),s.sort(),t||e[0]})).catch((function(e){t&&t.resolveWithError(e)}))}))}},{key:"loadExtended",value:function(e,t){var s=this.findId(e);return this.load("".concat(e,"/extended"),(function(e){return e.then((function(e){return s.extend(e[0],t)})).catch((function(e){}))}))}},{key:"loadLatest",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.load("latest",(function(s){return s.then((function(s){return t&&e.merge(s),s[0]}))}),t)}},{key:"returnLatest",value:function(){return this.loadLatest(!1)}},{key:"loadNext",value:function(e,t){var s,a=this,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t=t||(null===(s=this.last((function(e){return!e.loading})))||void 0===s?void 0:s.id),t?this.load("".concat(t,"/next")+(e?"/".concat(e):""),(function(e){return e.then((function(e){return n&&a.merge(e),e})).catch((function(e){}))}),n):Promise.resolve([])}},{key:"returnNext",value:function(e,t){return this.loadNext(e,t,!1)}},{key:"loadPrevious",value:function(e,t){var s=this,a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t||this.items.length?(t=t||this.first((function(e){return!e.loading})).id,this.load("".concat(t,"/previous")+(e?"/".concat(e):""),(function(e){return e.then((function(e){return a&&s.merge(e),e})).catch((function(e){}))}),a)):Promise.resolve([])}},{key:"returnPrevious",value:function(e,t){return this.loadPrevious(e,t,!1)}},{key:"clear",value:function(){this.items.splice(0)}},{key:"merge",value:function(e){var t=this;e=e.filter((function(e){return!t.findId(e.id)})),e.length&&(this.items=this.items.concat(e),this.sort())}},{key:"sort",value:function(){this.items=this.items.sort((function(e,t){return e.time-t.time}))}},{key:"first",value:function(e){return e?this.items.find(e):this.items[0]}},{key:"last",value:function(e){return e?this.items.slice().reverse().find(e):this.items[this.items.length-1]}},{key:"setClient",value:function(e){this.client=e}},{key:"setItems",value:function(e){this.items=e}},{key:"setRemote",value:function(e,t){t=t||{},t.path=t.path||"/__clockwork/",e=new La.a(e);var s=t.path.split("?"),n=Object(a["a"])(s,2),i=n[0],r=n[1];e.pathname(i||""),e.query(r||""),e.hash(""),this.remoteUrl=e.toString(),this.remoteHeaders=t.headers||{}}},{key:"setAuthenticationToken",value:function(e){this.tokens[this.remoteUrl]=e,this.store.set("requests.tokens",this.tokens)}},{key:"setQuery",value:function(e){this.query=e}},{key:"withQuery",value:function(e,t){var s=this.query;this.query=e,t(),this.query=s}},{key:"load",value:function(e,t){var s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(s)return this.loadExclusive(e,t);var a=La()("".concat(this.remoteUrl).concat(e)).addQuery(this.query).toString(),n=Object.assign({},this.remoteHeaders,{"X-Clockwork-Auth":this.tokens[this.remoteUrl]});return t(this.client("GET",a,{},n).then((function(e){return e?(e instanceof Array?e:[e]).map((function(e){return new Ia(e)})):[]})))}},{key:"loadExclusive",value:function(e,t){var s=this;return this.exclusive[e]?this.exclusive[e]:this.exclusive[e]=this.load(e,t).finally((function(){return s.exclusive[e]=null}))}}]),e}(),Va=(s("8e6e"),s("bd86")),Wa=(s("386d"),s("2fd4")),Ka=s.n(Wa),Ga=s("c1df"),Xa=s.n(Ga);function Ya(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,a)}return s}function Za(e){for(var t=1;t=100&&e<600}},{tag:"time"},{tag:"received",validate:function(e){return Xa()(e).isValid()}},{tag:"type",validate:function(e){return["command","queue-job","request"].includes(e)}}],this.shown=!1,this.input="",this.searchDebounced=Ka()((function(){return s.search()}),500)}return Object(v["a"])(e,[{key:"toggle",value:function(){this.shown=!this.shown,this.shown?$e["a"].nextTick((function(){return document.querySelector(".requests-search input").focus()})):(this.input="",this.search())}},{key:"search",value:function(){var e=this,t=this.tokenize(this.input),s=t.terms,n=t.tags;n=Object.entries(n).filter((function(t){var s=Object(a["a"])(t,2),n=s[0],i=s[1];return n=e.tags.find((function(e){return e.tag==n})),n&&(!n.validate||i.every((function(e){return n.validate(e)})))})).reduce((function(e,t){var s=Object(a["a"])(t,2),n=s[0],i=s[1];return e["".concat(n,"[]")]=i,e}),{}),this.requests.setQuery(s.length||Object.keys(n).length?Za({"uri[]":s,"name[]":s},n):{}),this.requests.returnLatest().then((function(t){e.requests.returnPrevious(9,t.id).then((function(s){e.requests.setItems(s?[].concat(Object(Da["a"])(s),[t]):[t])}))})).catch((function(){e.requests.clear()}))}},{key:"tokenize",value:function(e){var t,s=[],a={},n=/(\w+:)?("[^"]*"|[^\s]+)/g;while(t=n.exec(e)){var i=t[1]?t[1].substr(0,t[1].length-1):void 0,r=t[2];(t=r.match(/^"(.+?)"$/))&&(r=t[1]),i?(a[i]||(a[i]=[]),a[i].push(r)):s.push(r)}return{terms:s,tags:a}}}]),e}(),tn=s("5c9a"),sn=s.n(tn),an=function(){function e(t,s,a){Object(m["a"])(this,e),this.store=t,this.requests=s,this.platform=a,this.shown=!1,this.settings={},this.load()}return Object(v["a"])(e,[{key:"toggle",value:function(){this.shown=!this.shown}},{key:"save",value:function(){this.store.set("settings",this.settings),this.platform.settingsChanged()}},{key:"load",value:function(){var e=this.defaults(),t=this.store.get("settings",{});this.settings={global:ht()(!0,e.global,t.global||{}),site:sn()(t.site||{},(function(t){return ht()(!0,{},e.site,t||{})}))}}},{key:"defaults",value:function(){return{global:{appearance:"auto",editor:null,showIncomingRequests:!0,hideCommandTypeRequests:this.platform instanceof Qa,hideQueueJobTypeRequests:this.platform instanceof Qa,hideTestTypeRequests:this.platform instanceof Qa,timelineHiddenTags:{},seenReleaseNotesVersion:null},site:{localPathMap:{real:null,local:null}}}}},{key:"global",get:function(){return this.settings.global}},{key:"site",get:function(){return this.settings.site[this.requests.remoteUrl]||(this.settings.site[this.requests.remoteUrl]=ht()(!0,{},this.defaults().site)),this.settings.site[this.requests.remoteUrl]}}]),e}(),nn=function(){function e(){Object(m["a"])(this,e)}return Object(v["a"])(e,[{key:"register",value:function(){$e["a"].filter("round",this.round),$e["a"].filter("shortClass",this.shortClass)}},{key:"round",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return parseFloat(parseFloat(e).toFixed(t))}},{key:"shortClass",value:function(e){return e?e.split("\\").pop():""}}]),e}(),rn=function(){function e(t){Object(m["a"])(this,e),this.store=t,this.serverVersion=null}return Object(v["a"])(e,[{key:"latest",value:function(){return{version:"4.0.0",url:"https://underground.works/blog/clockwork-4.0-released-with-ui-improvements-requests-search-and-more"}}},{key:"show",value:function(e){if(!this.ignoresUpdate(e)&&this.serverVersion)return 1==this.versionCompare(this.latest().version,this.serverVersion)?{version:this.latest().version,url:this.latest().url,currentVersion:this.serverVersion}:void 0}},{key:"ignoresUpdate",value:function(e){var t=this.ignoredUpdates[e];return t&&this.versionCompare(t,this.latest().version)>=0}},{key:"ignoreUpdate",value:function(e){var t=this.ignoredUpdates;t[e]=this.latest().version,this.store.set("update-notification.ignored-updates",t)}},{key:"versionCompare",value:function(e,t){e=e.split(".").map((function(e){return parseInt(e)})),t=t.split(".").map((function(e){return parseInt(e)}));for(var s=0;st[s])return 1;if(!e[s]&&t[s]||e[s]'}),this.createElement("span",{text:"".concat(r," ")})]),this.generateHtmlPreview(this.data),this.generateHtmlNode(this.data)])])}},{key:"generateHtmlNode",value:function(e){var t=this;return this.createElement("ul",{style:{display:"none"}},Object.keys(e).filter(function(e){return!["__class__","__type__","__hash__"].includes(e)}).map(function(s){var r=t.resolveValueAndType(e[s]),n=Object(a["a"])(r,2),i=n[0],o=n[1];return t.createElement("li",{data:{key:s}},[t.createElement("span",{click:"object"==o?function(e){return t.objectNodeClickedCallback(e)}:void 0},[t.createElement("span",{class:"pretty-jason-icon",html:"object"==o?'':void 0}),t.createElement("span",{class:"pretty-jason-key",text:"".concat(s,": ")}),t.createElement("span",{class:"pretty-jason-value-".concat(o),text:i})])])}))}},{key:"generateHtmlPreview",value:function(e){var t=this;return this.createElement("span",{class:"pretty-jason-preview"},Object.keys(e).filter(function(e){return!["__class__","__type__","__hash__"].includes(e)}).slice(0,3).map(function(s){var r=t.resolveValueAndType(e[s]),n=Object(a["a"])(r,2),i=n[0],o=n[1];return t.createElement("span",{class:"pretty-jason-preview-item"},[t.createElement("span",{class:"pretty-jason-key",text:"".concat(s,": ")}),t.createElement("span",{class:"pretty-jason-value-".concat(o),text:i})])}).concat(Object.keys(e).length>3?[this.createElement("span",{class:"pretty-jason-preview-item",text:"..."})]:[]))}},{key:"resolveValueAndType",value:function(e){return null===e?["null","null"]:void 0===e?["undefined","undefined"]:"boolean"==typeof e?[e?"true":"false","boolean"]:"string"==typeof e?['"'.concat(e,'"'),"string"]:"object"==Object(h["a"])(e)?"array"==e.__type__?["Array(".concat(Object.values(e).length-1,")"),"object"]:e.__type__&&"object"!=e.__type__?[e.__type__,e.__type__.replace(" ","-")]:[e.__class__||"Object","object"]:[e.toString(),Object(h["a"])(e)]}},{key:"objectNodeClickedCallback",value:function(e){var t=e.currentTarget;this.isNodeExpanded(t)?this.collapseNode(t,e.ctrlKey||e.metaKey):this.expandNode(t,e.ctrlKey||e.metaKey)}},{key:"isNodeExpanded",value:function(e){var t=e.parentNode.querySelector("ul");return t&&"none"!=t.style.display}},{key:"expandNode",value:function(e,t){var s=this;this.renderObjectNode(e);var a=e.parentNode.querySelector("ul"),r=e.querySelector("i");r.classList.remove("pretty-jason-icon-closed","pretty-jason-icon-open"),a.style.display="block",r.classList.add("pretty-jason-icon-open"),t&&a.querySelectorAll(".pretty-jason-icon-closed").forEach(function(e){s.expandNode(e.parentNode.parentNode,t)})}},{key:"collapseNode",value:function(e,t){var s=this,a=e.parentNode.querySelector("ul"),r=e.querySelector("i");r.classList.remove("pretty-jason-icon-closed","pretty-jason-icon-open"),a.style.display="none",r.classList.add("pretty-jason-icon-closed"),t&&a.querySelectorAll(".pretty-jason-icon-open").forEach(function(e){s.collapseNode(e.parentNode.parentNode,t)})}},{key:"renderObjectNode",value:function(e){if(!e.dataset.rendered){var t=[],s=e;while(s=s.parentNode)if("LI"==s.tagName&&s.dataset.key){if(s.classList.contains("pretty-jason"))break;var a=s.dataset.key;t.unshift(isNaN(parseInt(a,10))?a:parseInt(a,10))}e.parentNode.append(this.generateHtmlNode(this.getDataFromPath(t))),e.dataset.rendered=!0}}},{key:"getDataFromPath",value:function(e){var t,s=this.data;while(void 0!==(t=e.shift()))s=s[t];return s}},{key:"createElement",value:function(e,t,s){var a=document.createElement(e);return t.html&&(a.innerHTML=t.html),t.text&&(a.innerText=t.text),t.class&&a.classList.add(t.class),t.style instanceof Object&&Object.keys(t.style).forEach(function(e){return a.style[e]=t.style[e]}),t.data instanceof Object&&Object.keys(t.data).forEach(function(e){return a.dataset[e]=t.data[e]}),t.click&&a.addEventListener("click",t.click),s instanceof Array&&s.forEach(function(e){return a.append(e)}),a}}]),e}(),m=function e(t,s){Object(f["a"])(this,e),this.message=t,this.exception=s},b=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("span",{on:{click:function(t){return e.expand(t)}}},[e.expanded?[e._v("\n\t\t"+e._s(e.full)+"\n\t")]:[e._t("default")]],2)},g=[],w={name:"ShortenedText",props:["full"],data:function(){return{expanded:!1}},methods:{expand:function(e){this.expanded||(e.stopPropagation(),e.preventDefault()),this.expanded=!0}}},_=w,y=s("2877"),q=Object(y["a"])(_,b,g,!1,null,null,null),k=q.exports,C={name:"PrettyPrint",components:{ShortenedText:k},props:["trace","file","line"],data:function(){return{showPopover:!1}},computed:{fullPath:function(){return this.makeFullPath(this.file,this.line)},shortPath:function(){return this.makeShortPath(this.file,this.line)}},methods:{closePopover:function(){this.showPopover=!1},togglePopover:function(e){this.trace&&(e.preventDefault(),this.showPopover=!this.showPopover,this.$el.offsetParent.clientWidth-this.$el.offsetLeft<300&&this.$refs.popover.classList.add("right-aligned"))},makeFullPath:function(e,t){return"".concat(e,":").concat(t)},makeShortPath:function(e,t){return this.makeFullPath(e,t).split(/[\/\\]/).pop()}}},$=C,x=Object(y["a"])($,u,d,!1,null,null,null),j=x.exports,T={name:"MessagesOverlay",components:{StackTrace:j},data:function(){return{updateNotification:!1}},methods:{closeUpdateNotification:function(){this.$updateNotification.ignoreUpdate(this.$requests.remoteUrl),this.updateNotification=!1},showPreviousException:function(e){this.$request.exceptions.push(e.previous),e.previous=void 0},showRequestById:function(e){this.global.$request=this.$requests.find(e)}},watch:{"$requests.remoteUrl":{handler:function(){this.updateNotification=this.$updateNotification.show(this.$requests.remoteUrl)},immediate:!0},"$updateNotification.serverVersion":function(){this.updateNotification=this.$updateNotification.show(this.$requests.remoteUrl)}}},P=T,O=(s("9cad"),Object(y["a"])(P,l,c,!1,null,null,null)),S=O.exports,D=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("a",{staticClass:"details-header-tab",class:{active:e.active},attrs:{href:"#"},on:{click:e.selectTab}},[e._t("default")],2)},N=[],E=(s("7f7f"),{name:"TabHandle",props:["name","active"],methods:{selectTab:function(){this.$emit("tab-selected",this.name)}}}),L=E,R=Object(y["a"])(L,D,N,!1,null,null,null),M=R.exports,I=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.close,expression:"close"}],staticClass:"popover-container settings-container"},[s("a",{attrs:{href:"#",title:"Settings"},on:{click:function(t){return t.preventDefault(),e.toggle(t)}}},[s("font-awesome-icon",{attrs:{icon:"cog"}})],1),s("div",{directives:[{name:"show",rawName:"v-show",value:e.show,expression:"show"}],staticClass:"popover right-aligned"},[s("div",{staticClass:"popover-content"},[s("div",{staticClass:"controls-group"},[s("label",{attrs:{for:"settings-editor"}},[e._v("Code editor")]),s("select",{directives:[{name:"model",rawName:"v-model",value:e.$settings.editor,expression:"$settings.editor"}],attrs:{id:"settings-editor"},on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(e){var t="_value"in e?e._value:e.value;return t});e.$set(e.$settings,"editor",t.target.multiple?s:s[0])}}},[s("option",{attrs:{value:"atom"}},[e._v("Atom")]),s("option",{attrs:{value:"phpstorm"}},[e._v("PhpStorm")]),s("option",{attrs:{value:"sublime"}},[e._v("Sublime Text")]),s("option",{attrs:{value:"textmate"}},[e._v("Textmate")]),s("option",{attrs:{value:"vs-code"}},[e._v("Visual Studio Code")])]),s("div",{directives:[{name:"show",rawName:"v-show",value:"atom"==e.$settings.editor,expression:"$settings.editor == 'atom'"}],staticClass:"help-text"},[e._v("\n\t\t\t\t\tRequires "),s("a",{attrs:{href:"https://atom.io/packages/open",target:"_blank"}},[e._v("Atom Open")]),e._v(" package.\n\t\t\t\t")]),s("div",{directives:[{name:"show",rawName:"v-show",value:"sublime"==e.$settings.editor,expression:"$settings.editor == 'sublime'"}],staticClass:"help-text"},[e._v("\n\t\t\t\t\tRequires "),s("a",{attrs:{href:"https://github.com/asuth/subl-handler",target:"_blank"}},[e._v("subl-handler")]),e._v(".\n\t\t\t\t")])]),s("div",{staticClass:"controls-group"},[s("label",{attrs:{for:"settings-local-path-map"}},[e._v("Local path map")]),s("div",{staticClass:"controls-input-vgroup"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.$settings.localPathMapReal,expression:"$settings.localPathMapReal"}],attrs:{type:"text",name:"settings-local-path-map-real",placeholder:"/real/path"},domProps:{value:e.$settings.localPathMapReal},on:{input:function(t){t.target.composing||e.$set(e.$settings,"localPathMapReal",t.target.value)}}}),s("input",{directives:[{name:"model",rawName:"v-model",value:e.$settings.localPathMapLocal,expression:"$settings.localPathMapLocal"}],attrs:{type:"text",name:"settings-local-path-map-local",placeholder:"/local/path"},domProps:{value:e.$settings.localPathMapLocal},on:{input:function(t){t.target.composing||e.$set(e.$settings,"localPathMapLocal",t.target.value)}}})]),s("div",{staticClass:"help-text"},[e._v("\n\t\t\t\t\tMap real to local path for the code editor links.\n\t\t\t\t")])]),s("div",{staticClass:"controls-group settings-save"},[s("button",{on:{click:e.save}},[e._v("\n\t\t\t\t\tSave\n\t\t\t\t")])])])])])},A=[],U={name:"SettingsPopover",data:function(){return{show:!1}},methods:{close:function(){this.show=!1},toggle:function(){this.show||this.$settings.reload(),this.show=!this.show},save:function(){this.$settings.save(),this.show=!1}}},Q=U,F=Object(y["a"])(Q,I,A,!1,null,null,null),B=F.exports,H=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("div",{staticClass:"counters-row"},[s("div",{directives:[{name:"show",rawName:"v-show",value:e.$request.cacheQueries.length,expression:"$request.cacheQueries.length"}],staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.cacheQueries.length))]),s("div",{staticClass:"counter-title"},[e._v("queries")])]),s("div",{directives:[{name:"show",rawName:"v-show",value:null!==e.$request.cacheReads,expression:"$request.cacheReads !== null"}],staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.cacheReads))]),s("div",{staticClass:"counter-title"},[e._v("reads")])]),s("div",{directives:[{name:"show",rawName:"v-show",value:null!==e.$request.cacheHits,expression:"$request.cacheHits !== null"}],staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.cacheHits))]),s("div",{staticClass:"counter-title"},[e._v("hits")])]),s("div",{directives:[{name:"show",rawName:"v-show",value:null!==e.$request.cacheMisses,expression:"$request.cacheMisses !== null"}],staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.cacheMisses))]),s("div",{staticClass:"counter-title"},[e._v("misses")])]),s("div",{directives:[{name:"show",rawName:"v-show",value:null!==e.$request.cacheWrites,expression:"$request.cacheWrites !== null"}],staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.cacheWrites))]),s("div",{staticClass:"counter-title"},[e._v("writes")])]),s("div",{directives:[{name:"show",rawName:"v-show",value:null!==e.$request.cacheDeletes,expression:"$request.cacheDeletes !== null"}],staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.cacheDeletes))]),s("div",{staticClass:"counter-title"},[e._v("deletes")])]),s("div",{directives:[{name:"show",rawName:"v-show",value:null!==e.$request.cacheTime,expression:"$request.cacheTime !== null"}],staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.cacheTime))]),s("div",{staticClass:"counter-title"},[e._v("time")])])]),e.$request.cacheQueries.length?s("details-table",{attrs:{columns:e.columns,items:e.$request.cacheQueries,filter:e.filter,"filter-example":"info@underground.works action:miss key:lastRequest file:Controller.php"},scopedSlots:e._u([{key:"body",fn:function(t){var a=t.items;return e._l(a,function(t,a){return s("tr",{key:e.$request.id+"-"+a},[e.columns.includes("Connection")?s("td",[e._v(e._s(t.connection))]):e._e(),s("td",{staticClass:"cache-query-type"},[e._v(e._s(t.type))]),s("td",[e._v(e._s(t.key))]),s("td",[s("div",{staticClass:"database-query"},[s("div",{staticClass:"database-query-content"},[s("pretty-print",{attrs:{data:t.value}})],1),s("stack-trace",{staticClass:"database-query-path",attrs:{trace:t.trace,file:t.file,line:t.line}})],1)]),s("td",[t.expiration?s("span",[e._v(e._s(t.expiration))]):e._e()]),e.columns.includes("Duration")?s("td",[e._v(e._s(e._f("number:3")(t.duration))+" ms")]):e._e()])})}}],null,!1,1238126495)}):e._e()],1)},z=[],V=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("table",{staticClass:"details-table"},[s("thead",[e.noHeader?e._e():s("tr",[e._t("header",e._l(e.columns,function(t,a){return s("th",{on:{click:function(s){e.filter.sortBy(t.sortBy||t.toLowerCase())}}},[e._v("\n\t\t\t\t\t"+e._s(t.name||t)+"\n\t\t\t\t\t"),s("font-awesome-icon",{directives:[{name:"show",rawName:"v-show",value:e.filter.sortedBy==(t.sortBy||t.toLowerCase()),expression:"filter.sortedBy == (column.sortBy || column.toLowerCase())"}],attrs:{icon:e.filter.sortedDesc?"angle-down":"angle-up"}}),a==e.columns.length-1?s("details-table-filter-toggle",{attrs:{filter:e.filter}}):e._e()],1)}),{filter:e.filter})],2),s("tr",{directives:[{name:"show",rawName:"v-show",value:e.filter.shown,expression:"filter.shown"}],staticClass:"filter"},[s("td",{attrs:{colspan:e.columns.length}},[s("label",[s("font-awesome-icon",{attrs:{icon:"search"}}),s("input",{directives:[{name:"model",rawName:"v-model",value:e.filter.input,expression:"filter.input"}],ref:"filterInput",attrs:{type:"search",placeholder:"Filter..."},domProps:{value:e.filter.input},on:{input:function(t){t.target.composing||e.$set(e.filter,"input",t.target.value)}}}),s("span",{directives:[{name:"show",rawName:"v-show",value:!e.filter.input,expression:"! filter.input"}],staticClass:"example"},[e._v("eg. "+e._s(e.filterExample))])],1)])])]),s("tbody",[e.hasPreviousItems?s("tr",{staticClass:"pagination-controls"},[s("td",{attrs:{colspan:e.columns.length}},[s("a",{attrs:{href:"#"},on:{click:e.showPreviousItems}},[e._v("Show "+e._s(e.previousItemsCount)+" previous")])])]):e._e(),e._t("body",null,{items:e.shownItems}),e.hasNextItems?s("tr",{staticClass:"pagination-controls"},[s("td",{attrs:{colspan:e.columns.length}},[s("a",{attrs:{href:"#"},on:{click:e.showNextItems}},[e._v("Show "+e._s(e.nextItemsCount)+" more")])])]):e._e()],2)])},W=[],J=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("a",{staticClass:"toggle-filter",attrs:{href:"#"},on:{click:function(t){return t.stopPropagation(),e.filter.toggle(t)}}},[s("font-awesome-icon",{attrs:{icon:"search"}})],1)},K=[],G={name:"DetailsTableFilterToggle",props:["filter"]},Y=G,X=Object(y["a"])(Y,J,K,!1,null,null,null),Z=X.exports,ee=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div")},te=[],se={name:"PrettyPrint",props:["data"],methods:{render:function(){var e=this.data,t=document.createElement("div");if(!0===e)t.innerHTML="true";else if(!1===e)t.innerHTML="false";else if(void 0===e)t.innerHTML="undefined";else if(null===e)t.innerHTML="null";else if("number"===typeof e)t.innerText=e;else try{t.append(new p(e).generateHtml())}catch(s){t.innerText=e}this.$el.firstChild&&this.$el.firstChild.remove(),this.$el.append(t)}},mounted:function(){this.render()},watch:{data:function(){this.render()}}},ae=se,re=Object(y["a"])(ae,ee,te,!1,null,null,null),ne=re.exports,ie={name:"DetailsTable",components:{DetailsTableFilterToggle:Z,PrettyPrint:ne},props:["columns","filter","filterExample","items","noHeader"],data:function(){return{showItemsCount:30,showItemsFirst:0}},computed:{filteredItems:function(){return this.filter.filter(this.items)},shownItems:function(){return this.showItemsFirst>this.filteredItems.length&&(this.showItemsFirst=Math.max(this.filteredItems.length-this.showItemsCount,0)),this.filteredItems.slice(this.showItemsFirst,this.showItemsFirst+this.showItemsCount)},hasPreviousItems:function(){return this.showItemsFirst>0},previousItemsCount:function(){return this.showItemsFirst},hasNextItems:function(){return this.showItemsFirst+this.showItemsCountt&&(e.scrollTop=t)}},watch:{filteredItems:function(){this.showItemsFirst=0}}},oe=ie,le=(s("2958"),Object(y["a"])(oe,V,W,!1,null,null,null)),ce=le.exports,ue=(s("4917"),s("55dd"),s("2b0e")),de=function(){function e(t,s){Object(f["a"])(this,e),this.tags=t,this.map=s,this.shown=!1,this.sortedBy=void 0,this.sortedDesc=!1,this.input=""}return Object(v["a"])(e,[{key:"toggle",value:function(e){this.shown=!this.shown,this.shown&&ue["a"].nextTick(function(){var t=e.target;while(t=t.parentNode)if("TABLE"==t.tagName)break;t.querySelector(".filter input").focus()})}},{key:"sortBy",value:function(e){this.sortedBy==e?this.sortedDesc=!this.sortedDesc:(this.sortedBy=e,this.sortedDesc=!0)}},{key:"filter",value:function(e){var t=this,s=this.tokenize(this.input),a=s.terms,r=s.tags;if(e=e.filter(function(e){var s=t.map?t.map(e):e;return t.matchesTerms(s,a)&&t.matchesTags(e,r)}),this.sortedBy){var n=this.tags.find(function(e){return e.tag==t.sortedBy});e.sort(function(e,s){var a,r;return n&&"number"==n.type?e[t.sortedBy]-s[t.sortedBy]:null===(a=e[t.sortedBy])||void 0===a?void 0:a.toString().localeCompare(null===(r=s[t.sortedBy])||void 0===r?void 0:r.toString())})}return this.sortedDesc&&(e=e.reverse()),e}},{key:"matchesTerms",value:function(e,t){var s=this;return!t.length||("object"==Object(h["a"])(e)&&null!==e?Object.values(e).find(function(e){return s.matchesTerms(e,t)}):"string"==typeof e&&t.find(function(t){return e.toLowerCase().includes(t.toLowerCase())}))}},{key:"matchesTags",value:function(e,t){var s=this;return!Object.keys(t).length||Object.keys(t).every(function(a){return a=s.tags.find(function(e){return e.tag==a}),!!a&&("number"==a.type||"date"==a.type?t[a.tag].every(function(t){return s.isTagApplicable(a,e,t)}):t[a.tag].find(function(t){return s.isTagApplicable(a,e,t)}))})}},{key:"isTagApplicable",value:function(e,t,s){return e.apply?e.apply(t,s):(t=e.map?e.map(t):t[e.tag],"number"==e.type?(a=s.match(/^<(\d+(?:\.\d+)?)$/))?t(\d+(?:\.\d+)?)$/))?parseFloat(a[1])(.+)$/))?moment(t).isAfter(r[1].match(/^\d+:\d+(:\d+)?$/)?moment().format("YYYY-MM-DD ")+r[1]:r[1]):moment(t).isSame(s):"string"==typeof t&&t.toLowerCase().includes(s.toLowerCase()));var a,r}},{key:"tokenize",value:function(e){var t,s=[],a={},r=/(\w+:)?("[^"]*"|[^\s]+)/g;while(t=r.exec(e)){var n=t[1]?t[1].substr(0,t[1].length-1):void 0,i=t[2];(t=i.match(/^"(.+?)"$/))&&(i=t[1]),n?(a[n]||(a[n]=[]),a[n].push(i)):s.push(i)}return{terms:s,tags:a}}}]),e}(),he={name:"CacheTab",components:{DetailsTable:ce,PrettyPrint:ne,StackTrace:j},data:function(){return{filter:new de([{tag:"action",apply:function(e,t){if(["read","write","delete","miss"].includes(t.toLowerCase()))return e.type.toLowerCase()==t.toLowerCase()}},{tag:"key"},{tag:"file",map:function(e){return e.shortPath}}])}},computed:{columns:function(){var e=[{name:"Action",sortBy:"type"},"Key","Value","Expires"];return this.$request.cacheQueries.some(function(e){return e.connection})&&e.unshift("Connection"),this.$request.cacheQueries.some(function(e){return e.duration})&&e.push("Duration"),e}}},fe=he,ve=Object(y["a"])(fe,H,z,!1,null,null,null),pe=ve.exports,me=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("div",{staticClass:"counters-row"},[s("div",{staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.databaseQueriesCount))]),s("div",{staticClass:"counter-title"},[e._v("queries")])]),e.$request.databaseSlowQueries?s("div",{staticClass:"counter database-slow-query"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.databaseSlowQueries))]),s("div",{staticClass:"counter-title"},[e._v("slow")])]):e._e(),e.$request.databaseSelects?s("div",{staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.databaseSelects))]),s("div",{staticClass:"counter-title"},[e._v("selects")])]):e._e(),e.$request.databaseInserts?s("div",{staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.databaseInserts))]),s("div",{staticClass:"counter-title"},[e._v("inserts")])]):e._e(),e.$request.databaseUpdates?s("div",{staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.databaseUpdates))]),s("div",{staticClass:"counter-title"},[e._v("updates")])]):e._e(),e.$request.databaseDeletes?s("div",{staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.databaseDeletes))]),s("div",{staticClass:"counter-title"},[e._v("deletes")])]):e._e(),e.$request.databaseOthers?s("div",{staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.databaseOthers))]),s("div",{staticClass:"counter-title"},[e._v("other")])]):e._e(),s("div",{staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.databaseDurationRounded)+" ms")]),s("div",{staticClass:"counter-title"},[e._v("time")])])]),e.$request.databaseQueries.length?s("details-table",{attrs:{columns:e.columns,items:e.$request.databaseQueries,filter:e.filter,"filter-example":"where request_id model:request type:select file:Controller.php duration:>100"},scopedSlots:e._u([{key:"body",fn:function(t){var a=t.items;return e._l(a,function(t,a){return s("tr",{key:e.$request.id+"-"+a,class:{"database-slow-query":t.tags.includes("slow")}},[s("td",[s("shortened-text",{attrs:{full:t.model}},[e._v(e._s(t.shortModel))])],1),e.columns.includes("Connection")?s("td",[e._v(e._s(t.connection))]):e._e(),s("td",[s("div",{staticClass:"database-query"},[s("div",{staticClass:"database-query-content"},[e._v(e._s(t.query))]),s("stack-trace",{staticClass:"database-query-path",attrs:{trace:t.trace,file:t.file,line:t.line}})],1)]),s("td",{staticClass:"database-duration"},[e._v(e._s(t.duration)+" ms")])])})}}],null,!1,3970562768)}):e._e()],1)},be=[],ge=(s("5df3"),s("4f7f"),s("3b2b"),{name:"DatabaseTab",components:{DetailsTable:ce,ShortenedText:k,StackTrace:j},data:function(){return{filter:new de([{tag:"model"},{tag:"type",apply:function(e,t){if(["select","update","insert","delete"].includes(t.toLowerCase()))return e.query.match(new RegExp("^".concat(t.toLowerCase()),"i"))}},{tag:"file",map:function(e){return e.shortPath}},{tag:"duration",type:"number"}])}},computed:{columns:function(){var e=["Model","Query","Duration"],t=new Set(this.$request.databaseQueries.map(function(e){return e.connection})).size>1;return t&&e.splice(1,0,"Connection"),e}}}),we=ge,_e=(s("c563"),Object(y["a"])(we,me,be,!1,null,null,null)),ye=_e.exports,qe=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("details-table",{attrs:{columns:["To","Subject","Headers"],items:e.$request.emails,filter:e.filter,"filter-example":'"User Registration" to:its@underground.works'},scopedSlots:e._u([{key:"body",fn:function(t){var a=t.items;return e._l(a,function(t,a){return s("tr",{key:e.$request.id+"-"+a},[s("td",[e._v(e._s(t.to))]),s("td",[e._v(e._s(t.subject))]),s("td",{attrs:{colspan:"2"}},[s("pretty-print",{attrs:{data:t.headers}})],1)])})}}])})],1)},ke=[],Ce={name:"EmailsTab",components:{DetailsTable:ce,DetailsTableFilterToggle:Z,PrettyPrint:ne},data:function(){return{filter:new de([{tag:"to"}])}}},$e=Ce,xe=Object(y["a"])($e,qe,ke,!1,null,null,null),je=xe.exports,Te=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("details-table",{attrs:{columns:["Time","Event",""],items:e.$request.events,filter:e.filter,"filter-example":'"user registered" file:Controller.php time:<13:08:30'},scopedSlots:e._u([{key:"body",fn:function(t){var a=t.items;return e._l(a,function(t,a){return s("tr",{key:e.$request.id+"-"+a},[s("td",[e._v(e._s(e._f("moment")(t.time,"HH:mm:ss")))]),s("td",[s("div",{staticClass:"fired-event"},[s("div",{staticClass:"fired-event-content"},[t.objectEvent?s("div",[s("pretty-print",{attrs:{data:t.data}})],1):e._e(),t.objectEvent?e._e():s("div",[e._v("\n\t\t\t\t\t\t\t\t"+e._s(t.event)+"\n\t\t\t\t\t\t\t")])]),s("stack-trace",{staticClass:"fired-query-path",attrs:{trace:t.trace,file:t.file,line:t.line}})],1),s("div",{directives:[{name:"show",rawName:"v-show",value:e.isEventExpanded(t),expression:"isEventExpanded(event)"}],staticClass:"fired-event-details"},[t.objectEvent?e._e():s("div",{staticClass:"fired-event-parameters"},[s("h4",[e._v("Parameters")]),s("pretty-print",{attrs:{data:t.data}})],1),s("div",{staticClass:"fired-event-listeners"},[s("h4",[e._v("Listeners")]),e._l(t.listeners,function(t,a){return s("shortened-text",{key:e.$request.id+"-"+a,attrs:{full:t.name}},[e._v("\n\t\t\t\t\t\t\t\t"+e._s(t.shortName)+"\n\t\t\t\t\t\t\t")])})],2)])]),s("td",{staticClass:"fired-event-actions"},[s("font-awesome-icon",{attrs:{icon:e.isEventExpanded(t)?"angle-up":"angle-down"},on:{click:function(s){return e.toggleEvent(t)}}})],1)])})}}])})],1)},Pe=[],Oe={name:"EventsTab",components:{DetailsTable:ce,PrettyPrint:ne,ShortenedText:k,StackTrace:j},data:function(){return{filter:new de([{tag:"time",type:"date"},{tag:"file",map:function(e){return e.shortPath}}]),expandedEvents:[]}},methods:{toggleEvent:function(e){this.isEventExpanded(e)?this.expandedEvents=this.expandedEvents.filter(function(t){return t!=e}):this.expandedEvents.push(e)},isEventExpanded:function(e){return-1!==this.expandedEvents.indexOf(e)}}},Se=Oe,De=Object(y["a"])(Se,Te,Pe,!1,null,null,null),Ne=De.exports,Ee=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("details-table",{attrs:{columns:["Time","Level","Message"],items:e.log,filter:e.filter,"filter-example":"query failed level:error file:Controller.php time:>13:08:29"},scopedSlots:e._u([{key:"body",fn:function(t){var a=t.items;return e._l(a,function(t,a){return s("tr",{key:e.$request.id+"-"+a,class:{"log-row":!0,error:["emergency","alert","critical","error"].includes(t.level),warning:"warning"==t.level}},[s("td",{staticClass:"log-date"},[e._v(e._s(e._f("moment")(t.time,"HH:mm:ss")))]),s("td",{staticClass:"log-level"},[e._v(e._s(t.level))]),s("td",[s("div",{staticClass:"log-message"},[s("div",{staticClass:"log-message-content"},[s("pretty-print",{attrs:{data:t.message}}),s("div",{directives:[{name:"show",rawName:"v-show",value:t.context,expression:"message.context"}]},[s("pretty-print",{attrs:{data:t.context}})],1)],1),t.exception?s("div",{staticClass:"log-message-exception"},[t.exception.previous?s("a",{staticClass:"exception-previous",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),e.showPreviousException(t)}}},[e._v("Show previous")]):e._e(),s("span",{staticClass:"exception-type"},[e._v(e._s(t.exception.type))]),t.exception.code?s("span",{staticClass:"exception-code"},[e._v("#"+e._s(t.exception.code))]):e._e()]):e._e(),s("stack-trace",{staticClass:"log-message-path",attrs:{trace:t.trace,file:t.file,line:t.line}})],1)])])})}}])})],1)},Le=[],Re={name:"LogTab",components:{DetailsTable:ce,PrettyPrint:ne,StackTrace:j},data:function(){return{filter:new de([{tag:"time",type:"date"},{tag:"level"},{tag:"file",map:function(e){return e.shortPath}}],function(e){return e.message})}},computed:{log:function(){return this.$request.log.filter(function(e){var t;return!(null===(t=e.context)||void 0===t?void 0:t.performance)})}},methods:{showPreviousException:function(e){var t=this.$request.log.indexOf(e);this.$request.log.splice(t+1,0,{message:e.exception.previous.message,exception:e.exception.previous,level:"error",shortPath:"".concat(e.exception.previous.file.split(/[\/\\]/).pop(),":").concat(e.exception.previous.line),trace:e.exception.previous.trace}),e.exception.previous=void 0}}},Me=Re,Ie=Object(y["a"])(Me,Ee,Le,!1,null,null,null),Ae=Ie.exports,Ue=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("div",{staticClass:"counters-row"},[s("div",{staticClass:"performance-chart-container"},[s("div",{staticClass:"performance-chart"},[s("pie-chart",{attrs:{donut:!0,data:e.chartValues,colors:e.chartColors,library:e.chartOptions,height:"60px"}})],1)]),e._l(e.$request.performanceMetrics,function(t,a){return s("div",{key:e.$request.id+"-"+a,staticClass:"counter performance-chart-legend",class:t.style},[s("div",{staticClass:"counter-value"},[e._v(e._s(t.value)+" ms")]),s("div",{staticClass:"counter-title"},[e._v(e._s(t.name))])])}),e.$request.responseDurationRounded?s("div",{staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.responseDurationRounded)+" ms")]),s("div",{staticClass:"counter-title"},[e._v("total")])]):e._e(),e.$request.memoryUsage?s("div",{staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(e.$request.memoryUsageFormatted))]),s("div",{staticClass:"counter-title"},[e._v("memory")])]):e._e()],2),s("performance-log"),s("div",{attrs:{tabs:"performance"}},[s("div",{staticClass:"performance-tabs"},[s("a",{staticClass:"performance-tab",class:{active:e.isTabActive("timeline")},attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),e.showTab("timeline")}}},[e._v("Timeline")]),s("a",{staticClass:"performance-tab",class:{active:e.isTabActive("profiler")},attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),e.showTab("profiler")}}},[e._v("Profiler")])]),s("timeline",{directives:[{name:"show",rawName:"v-show",value:e.isTabActive("timeline"),expression:"isTabActive('timeline')"}]}),s("profiler",{directives:[{name:"show",rawName:"v-show",value:e.isTabActive("profiler"),expression:"isTabActive('profiler')"}]})],1)],1)},Qe=[],Fe=function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.performanceLog.length||e.databaseSlowQueries.length?s("div",{staticClass:"performance-log"},[e.performanceLog.length?s("details-table",{attrs:{columns:["Message"],items:e.performanceLog,filter:e.performanceLogFilter,"filter-example":"query failed file:Controller.php time:>13:08:29"},scopedSlots:e._u([{key:"header",fn:function(t){var a=t.filter;return[s("th",{attrs:{colspan:e.databaseSlowQueriesColumns.length}},[e._v("\n\t\t\t\tPerformance warnings "),s("span",{staticClass:"count"},[e._v(e._s(e.performanceLog.length))]),s("details-table-filter-toggle",{attrs:{filter:a}})],1)]}},{key:"body",fn:function(t){var a=t.items;return e._l(a,function(t,a){return s("tr",{key:e.$request.id+"-"+a,staticClass:"log-row"},[s("td",[s("div",{staticClass:"log-message"},[s("div",{staticClass:"log-message-content"},[s("pretty-print",{attrs:{data:t.message}}),s("div",{directives:[{name:"show",rawName:"v-show",value:t.context&&t.context.length,expression:"message.context && message.context.length"}]},[s("pretty-print",{attrs:{data:t.context}})],1)],1),s("stack-trace",{staticClass:"log-message-path",attrs:{trace:t.trace,file:t.file,line:t.line}})],1)])])})}}],null,!1,1500537959)}):e._e(),e.databaseSlowQueries.length?s("details-table",{attrs:{columns:e.databaseSlowQueriesColumns,items:e.databaseSlowQueries,filter:e.databaseSlowQueriesFilter,"filter-example":"where request_id model:request type:select file:Controller.php duration:>100"},scopedSlots:e._u([{key:"header",fn:function(t){var a=t.filter;return[s("th",{attrs:{colspan:e.databaseSlowQueriesColumns.length}},[e._v("\n\t\t\t\tSlow database queries "),s("span",{staticClass:"count"},[e._v(e._s(e.$request.databaseSlowQueries))]),s("details-table-filter-toggle",{attrs:{filter:a}})],1)]}},{key:"body",fn:function(t){var a=t.items;return e._l(a,function(t,a){return s("tr",{key:e.$request.id+"-"+a,class:{"database-slow-query":t.tags.includes("slow")}},[s("td",[s("shortened-text",{attrs:{full:t.model}},[e._v(e._s(t.shortModel))])],1),e.databaseSlowQueriesColumns.includes("Connection")?s("td",[e._v(e._s(t.connection))]):e._e(),s("td",[s("div",{staticClass:"database-query"},[s("div",{staticClass:"database-query-content"},[e._v(e._s(t.query))]),s("stack-trace",{staticClass:"database-query-path",attrs:{trace:t.trace,file:t.file,line:t.line}})],1)]),s("td",{staticClass:"database-duration"},[e._v(e._s(t.duration)+" ms")])])})}}],null,!1,2667532720)}):e._e()],1):e._e()},Be=[],He=s("e0e5"),ze=s.n(He),Ve=s("57b8"),We=s.n(Ve),Je={name:"PerformanceLog",components:{DetailsTable:ce,DetailsTableFilterToggle:Z,PrettyPrint:ne,ShortenedText:k,StackTrace:j},data:function(){return{databaseSlowQueriesFilter:new de([{tag:"model"},{tag:"type",apply:function(e,t){if(["select","update","insert","delete"].includes(t.toLowerCase()))return e.query.match(new RegExp("^".concat(t.toLowerCase()),"i"))}},{tag:"file",map:function(e){return e.shortPath}},{tag:"duration",type:"number"}]),performanceLogFilter:new de([{tag:"time",type:"date"},{tag:"file",map:function(e){return e.shortPath}}],function(e){return e.message})}},computed:{databaseSlowQueriesColumns:function(){var e=["Model","Query","Duration"],t=new Set(this.databaseSlowQueries.map(function(e){return e.connection})).size>1;return t&&e.splice(1,0,"Connection"),e},databaseSlowQueries:function(){return this.$request.databaseQueries.filter(function(e){return e.tags.includes("slow")})},performanceLog:function(){return this.$request.log.filter(function(e){var t;return null===(t=e.context)||void 0===t?void 0:t.performance}).map(function(e){return ze()({},e,{context:We()(e.context,["performance","trace"])})})}}},Ke=Je,Ge=(s("e924"),Object(y["a"])(Ke,Fe,Be,!1,null,null,null)),Ye=Ge.exports,Xe=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[e.$profiler.ready?s("table",{staticClass:"profiler"},[s("thead",[s("tr",[s("th",{on:{click:function(t){return e.filter.sortBy("self["+e.$profiler.metric+"]")}}},[e._v("\n\t\t\t\t\tSelf\n\t\t\t\t\t"),s("font-awesome-icon",{directives:[{name:"show",rawName:"v-show",value:e.filter.sortedBy=="self["+e.$profiler.metric+"]",expression:"filter.sortedBy == `self[${$profiler.metric}]`"}],attrs:{icon:e.filter.sortedDesc?"angle-down":"angle-up"}})],1),s("th",{on:{click:function(t){return e.filter.sortBy("inclusive["+e.$profiler.metric+"]")}}},[e._v("\n\t\t\t\t\tInclusive\n\t\t\t\t\t"),s("font-awesome-icon",{directives:[{name:"show",rawName:"v-show",value:e.filter.sortedBy=="inclusive["+e.$profiler.metric+"]",expression:"filter.sortedBy == `inclusive[${$profiler.metric}]`"}],attrs:{icon:e.filter.sortedDesc?"angle-down":"angle-up"}})],1),s("th",{on:{click:function(t){return e.filter.sortBy("function")}}},[e._v("\n\t\t\t\t\tFunction\n\t\t\t\t\t"),s("font-awesome-icon",{directives:[{name:"show",rawName:"v-show",value:"function"==e.filter.sortedBy,expression:"filter.sortedBy == 'function'"}],attrs:{icon:e.filter.sortedDesc?"angle-down":"angle-up"}}),s("div",{staticClass:"profiler-controls"},[s("span",{staticClass:"profiler-control-group"},[s("a",{staticClass:"toggle-filter",attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.filter.toggle()}}},[s("font-awesome-icon",{attrs:{icon:"search"}})],1)]),s("span",{staticClass:"profiler-control-group profiler-show-metric"},[s("a",{class:{active:0==e.$profiler.metric},attrs:{href:"#",title:"Execution time"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.$profiler.showMetric(0)}}},[s("font-awesome-icon",{attrs:{icon:"clock"}})],1),s("a",{class:{active:1==e.$profiler.metric},attrs:{href:"#",title:"Memory usage"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.$profiler.showMetric(1)}}},[s("font-awesome-icon",{attrs:{icon:"microchip"}})],1)]),s("span",{staticClass:"profiler-control-group"},[s("a",{class:{active:!e.$profiler.percentual},attrs:{href:"#",title:"Exact"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.$profiler.showPercentual(!1)}}},[0==e.$profiler.metric?s("span",[e._v("ms")]):e._e(),1==e.$profiler.metric?s("span",[e._v("kB")]):e._e()]),s("a",{class:{active:e.$profiler.percentual},attrs:{href:"#",title:"Percentual"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.$profiler.showPercentual()}}},[s("font-awesome-icon",{attrs:{icon:"percent"}})],1)]),s("span",{staticClass:"profiler-control-group profiler-shown-fraction"},[s("a",{class:{active:1==e.$profiler.shownFraction},attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.$profiler.setShownFraction(1)}}},[e._v("\n\t\t\t\t\t\t\t\t100%\n\t\t\t\t\t\t\t")]),s("a",{class:{active:.9==e.$profiler.shownFraction},attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.$profiler.setShownFraction(.9)}}},[e._v("\n\t\t\t\t\t\t\t\t90%\n\t\t\t\t\t\t\t")]),s("a",{class:{active:.5==e.$profiler.shownFraction},attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.$profiler.setShownFraction(.5)}}},[e._v("\n\t\t\t\t\t\t\t\t50%\n\t\t\t\t\t\t\t")])]),s("span",{staticClass:"profiler-control-group"},[s("a",{attrs:{href:"#",title:"Disable profiler"},on:{click:function(t){return t.preventDefault(),e.$profiler.disableProfiling()}}},[s("font-awesome-icon",{attrs:{icon:"times-circle"}})],1)])])],1)]),s("tr",{directives:[{name:"show",rawName:"v-show",value:e.filter.shown,expression:"filter.shown"}],staticClass:"filter"},[s("td",{attrs:{colspan:"3"}},[s("label",[s("font-awesome-icon",{attrs:{icon:"search"}}),s("input",{directives:[{name:"model",rawName:"v-model",value:e.filter.input,expression:"filter.input"}],attrs:{type:"search",placeholder:"Filter..."},domProps:{value:e.filter.input},on:{input:function(t){t.target.composing||e.$set(e.filter,"input",t.target.value)}}}),s("span",{directives:[{name:"show",rawName:"v-show",value:!e.filter.input,expression:"! filter.input"}],staticClass:"example"},[e._v('eg. "preg_match" self:>500')])],1)])])]),s("tbody",e._l(e.filterXdebug(e.$profiler.functions),function(t,a){return s("tr",{key:e.$request.id+"-"+a},[s("td",{staticClass:"profiler-metric"},[e._v(e._s(e.$profiler.formatMetric(t.self)))]),s("td",{staticClass:"profiler-metric"},[e._v(e._s(e.$profiler.formatMetric(t.inclusive)))]),s("td",{staticClass:"profiler-function"},[s("div",{staticClass:"profiler-function-name"},[e._v("\n\t\t\t\t\t\t"+e._s(t.name)+"\n\t\t\t\t\t")]),s("div",{staticClass:"profiler-path"},[s("shortened-text",{attrs:{full:t.fullPath}},[e._v(e._s(t.shortPath))])],1)])])}),0)]):e._e(),s("div",{directives:[{name:"show",rawName:"v-show",value:e.$profiler.loading||e.$profiler.parsing,expression:"$profiler.loading || $profiler.parsing"}],staticClass:"profiler-loading"},[s("spinner",{attrs:{name:"fading-circle"}}),s("p",{directives:[{name:"show",rawName:"v-show",value:e.$profiler.loading,expression:"$profiler.loading"}],staticClass:"message"},[e._v("\n\t\t\tLoading profile...\n\t\t")]),s("p",{directives:[{name:"show",rawName:"v-show",value:e.$profiler.parsing,expression:"$profiler.parsing"}],staticClass:"message"},[e._v("\n\t\t\tProcessing profile...\n\t\t")])],1),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.$profiler.available,expression:"! $profiler.available"}],staticClass:"profiler-not-available"},[s("p",[e._v("\n\t\t\tProfile is not present for current request.\n\t\t")]),e._m(0),s("p",{staticClass:"message profiler-enable"},[s("a",{directives:[{name:"show",rawName:"v-show",value:!e.$profiler.isProfiling,expression:"! $profiler.isProfiling"}],attrs:{href:"#"},on:{click:function(t){return e.$profiler.enableProfiling()}}},[e._v("\n\t\t\t\tEnable profiler\n\t\t\t")]),s("a",{directives:[{name:"show",rawName:"v-show",value:e.$profiler.isProfiling,expression:"$profiler.isProfiling"}],attrs:{href:"#"},on:{click:function(t){return e.$profiler.disableProfiling()}}},[e._v("\n\t\t\t\tDisable profiler\n\t\t\t")])])])])},Ze=[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("p",{staticClass:"message"},[e._v("\n\t\t\tProfiling requires the Xdebug php extension."),s("br"),s("a",{attrs:{href:"https://underground.works/clockwork/xdebug-profiler?#content",target:"_blank"}},[e._v("Read more about how to set up Xdebug")])])}],et={name:"Profiler",components:{ShortenedText:k},data:function(){return{filter:function(){var e=new de([{tag:"model"},{tag:"file",map:function(e){return e.shortPath}},{tag:"self",type:"number"},{tag:"inclusive",type:"number"}],function(e){return e.name});return e.sortedBy="self[0]",e.sortedDesc=!0,e}()}},methods:{filterXdebug:function(e){return e?this.filter.filter(e):[]}}},tt=et,st=Object(y["a"])(tt,Xe,Ze,!1,null,null,null),at=st.exports,rt=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"timeline",class:{"table-view":"table"==e.view}},[s("div",{staticClass:"timeline-controls"},[s("span",{staticClass:"timeline-control-group"},[s("a",{staticClass:"toggle-filter",attrs:{href:"#"},on:{click:function(t){return e.filter.toggle()}}},[s("font-awesome-icon",{attrs:{icon:"search"}})],1)]),s("span",{staticClass:"timeline-control-group"},[s("a",{class:{active:"chart"==e.view},attrs:{href:"#",title:"Timeline view"},on:{click:function(t){e.view="chart"}}},[s("font-awesome-icon",{attrs:{icon:"chart-bar"}})],1),s("a",{class:{active:"table"==e.view},attrs:{href:"#",title:"Table view"},on:{click:function(t){e.view="table"}}},[s("font-awesome-icon",{attrs:{icon:"bars"}})],1)])]),s("details-table",{attrs:{columns:["Timeline","Duration","Description"],items:e.$request.timeline,filter:e.filter,"filter-example":"database query duration:>50"},scopedSlots:e._u([{key:"header",fn:function(t){t.filter;return[s("th",[e._v("Timeline")]),s("th",{staticClass:"timeline-duration"},[e._v("Duration")]),s("th",{staticClass:"timeline-description"},[e._v("Description")])]}},{key:"body",fn:function(t){var a=t.items;return e._l(a,function(t,a){return s("tr",[s("td",{staticClass:"timeline-graph"},[0==a?s("div",{staticClass:"timeline-legend"},e._l(e.legend,function(t){return s("span",{staticClass:"timeline-legend-time",style:{left:t.left+"%"}},[e._v(e._s(t.time)+" ms")])}),0):e._e(),s("div",{staticClass:"timeline-bar",class:t.style},[s("div",{staticClass:"label",style:{"text-align":t.labelAlign,"margin-left":t.labelLeft,"margin-right":t.labelRight}},[e._v("\n\t\t\t\t\t\t\t"+e._s(t.description)+" ("+e._s(t.durationRounded)+" ms)\n\t\t\t\t\t\t")]),s("div",{staticClass:"bar",style:{width:t.barWidth,"margin-left":t.barLeft}})])]),s("td",{staticClass:"timeline-duration"},[e._v(e._s(t.durationRounded)+" ms")]),s("td",{staticClass:"timeline-description"},[e._v(e._s(t.description))])])})}}])})],1)},nt=[],it={name:"Timeline",components:{DetailsTable:ce},data:function(){return{view:"chart",filter:new de([{tag:"duration",type:"number"}],function(e){return e.description})}},computed:{legend:function(){if(!this.$request)return[];var e,t=[],s=document.querySelector(".details-content"),a=s?s.offsetWidth-28:0,r=Math.floor(a/80),n=this.$request.responseDuration/a;for(e=1;e45&&t.push({left:((a-38)/a*100).toString(),time:Math.round(a*n).toString()}),t}}},ot=it,lt=Object(y["a"])(ot,rt,nt,!1,null,null,null),ct=lt.exports,ut={name:"PerformanceTab",components:{PerformanceLog:Ye,Profiler:at,Timeline:ct},data:function(){return{activeTab:"timeline"}},computed:{chartValues:function(){var e;return null===(e=this.$request)||void 0===e?void 0:e.performanceMetrics.map(function(e){return[e.name,e.value]})},chartColors:function(){var e,t={style1:{light:"#78b1de",dark:"#649dca"},style2:{light:"#e79697",dark:"#d38283"},style3:{light:"#b1ca6d",dark:"#9db659"},style4:{light:"#ba94e6",dark:"#a680d2"}},s=document.querySelector("body").classList.contains("dark")?"dark":"light";return null===(e=this.$request)||void 0===e?void 0:e.performanceMetrics.map(function(e){return t[e.style][s]})},chartOptions:function(){var e=document.querySelector("body").classList.contains("dark")?"dark":"light";return{legend:{display:!1},tooltips:{enabled:!1},hover:{mode:null},elements:{arc:{borderColor:"dark"==e?"#1f1f1f":"#fff"}}}}},methods:{isTabActive:function(e){return this.activeTab==e},showTab:function(e){this.activeTab=e,"profiler"==e&&this.$profiler.loadRequest(this.$request)}}},dt=ut,ht=Object(y["a"])(dt,Ue,Qe,!1,null,null,null),ft=ht.exports,vt=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("details-table",{attrs:{columns:e.columns,items:e.$request.redisCommands,filter:e.filter,"filter-example":"command:zrange connection:eshop file:StatsController.php duration:>50"},scopedSlots:e._u([{key:"body",fn:function(t){var a=t.items;return e._l(a,function(t,a){return s("tr",{key:e.$request.id+"-"+a},[e.columns.includes("Connection")?s("td",[e._v(e._s(t.connection))]):e._e(),s("td",[e._v(e._s(t.command))]),s("td",[s("div",{staticClass:"database-query"},[s("div",{staticClass:"database-query-content"},[s("pretty-print",{attrs:{data:t.parameters}})],1),s("stack-trace",{staticClass:"database-query-path",attrs:{trace:t.trace,file:t.file,line:t.line}})],1)]),s("td",{staticClass:"database-duration"},[e._v(e._s(t.duration)+" ms")])])})}}])})],1)},pt=[],mt={name:"RedisTab",components:{DetailsTable:ce,PrettyPrint:ne,StackTrace:j},data:function(){return{filter:new de([{tag:"connection"},{tag:"command"},{tag:"file",map:function(e){return e.shortPath}},{tag:"duration",type:"number"}])}},computed:{columns:function(){var e=["Command","Parameters","Duration"],t=new Set(this.$request.redisCommands.map(function(e){return e.connection})).size>1;return t&&e.splice(0,0,"Connection"),e}}},bt=mt,gt=Object(y["a"])(bt,vt,pt,!1,null,null,null),wt=gt.exports,_t=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("details-table",{attrs:{columns:e.columns,items:e.$request.queueJobs,filter:e.filter,"filter-example":"Underground.works name:GenerateInvoice queue:priority"},scopedSlots:e._u([{key:"body",fn:function(t){var a=t.items;return e._l(a,function(t,a){return s("tr",{key:e.$request.id+"-"+a},[e.columns.includes("Queue")?s("td",[e._v(e._s(t.queue))]):e._e(),e.columns.includes("Connection")?s("td",[e._v(e._s(t.connection))]):e._e(),s("td",[s("shortened-text",{attrs:{full:t.name}},[e._v(e._s(t.shortName))])],1),s("td",[s("div",{staticClass:"database-query"},[s("div",{staticClass:"database-query-content"},[s("pretty-print",{attrs:{data:t.data}})],1),s("stack-trace",{staticClass:"database-query-path",attrs:{trace:t.trace,file:t.file,line:t.line}})],1)]),e.columns.includes("Options")?s("td",{staticClass:"job-options"},[t.maxTries?s("span",[e._v(e._s(t.maxTries)+" tries")]):e._e(),t.timeout?s("span",[e._v(e._s(t.timeout)+"s timeout")]):e._e()]):e._e()])})}}])})],1)},yt=[],qt={name:"QueueTab",components:{DetailsTable:ce,PrettyPrint:ne,ShortenedText:k,StackTrace:j},data:function(){return{filter:new de([{tag:"connection"},{tag:"queue"},{tag:"name"}])}},computed:{columns:function(){var e=["Name","Data"],t=new Set(this.$request.queueJobs.map(function(e){return e.queue})).size>1,s=new Set(this.$request.queueJobs.map(function(e){return e.connection})).size>1,a=this.$request.queueJobs.some(function(e){return e.maxTries||e.timeout});return t&&e.splice(0,0,"Queue"),s&&e.splice(0,0,"Connection"),a&&e.push("Options"),e}}},kt=qt,Ct=(s("a074"),Object(y["a"])(kt,_t,yt,!1,null,"ee698604",null)),$t=Ct.exports,xt=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("details-table",{attrs:{columns:e.columns,items:e.$request.routes,filter:e.filter,"filter-example":"OrderController method:post uri:order"},scopedSlots:e._u([{key:"body",fn:function(t){var a=t.items;return e._l(a,function(t,a){return s("tr",{key:e.$request.id+"-"+a},[s("td",[e._v(e._s(t.method))]),s("td",[e._v(e._s(t.uri))]),s("td",[e._v(e._s(t.action))]),e.columns.includes("Name")?s("td",[e._v(e._s(t.name))]):e._e(),e.columns.includes("Middleware")?s("td",e._l(t.middleware,function(a,r){return s("span",[e._v("\n\t\t\t\t\t\t"+e._s(a)+e._s(r==t.middleware.length-1?"":", ")+"\n\t\t\t\t\t")])}),0):e._e(),e.columns.includes("Before")?s("td",[e._v(e._s(t.before))]):e._e(),e.columns.includes("After")?s("td",[e._v(e._s(t.after))]):e._e()])})}}])})],1)},jt=[],Tt={name:"RoutesTab",components:{DetailsTable:ce},data:function(){return{filter:new de([{tag:"method",apply:function(e,t){if(["get","post","put","delete","head","patch"].includes(t.toLowerCase()))return e.method.toLowerCase()==t.toLowerCase()}},{tag:"uri"}])}},computed:{columns:function(){var e=["Methods","URI","Action"];return this.$request.routes.some(function(e){return e.name})&&e.push("Name"),this.$request.routes.some(function(e){return e.middleware})&&e.push("Middleware"),this.$request.routes.some(function(e){return e.before})&&e.push("Before"),this.$request.routes.some(function(e){return e.after})&&e.push("After"),e}}},Pt=Tt,Ot=Object(y["a"])(Pt,xt,jt,!1,null,null,null),St=Ot.exports,Dt=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",e._l(e.userTab.sections,function(t,a){return s("div",{key:e.$request.id+"-"+a},["counters"==t.showAs?s("div",{staticClass:"counters-row"},e._l(t.data,function(t,a){return s("div",{key:e.$request.id+"-"+a,staticClass:"counter"},[s("div",{staticClass:"counter-value"},[e._v(e._s(t.value))]),s("div",{staticClass:"counter-title"},[e._v(e._s(t.key))])])}),0):e._e(),t.title?s("h3",[e._v("\n\t\t\t"+e._s(t.title)+"\n\t\t")]):e._e(),"table"==t.showAs?s("details-table",{attrs:{columns:t.data[0].map(function(e){return e.key}),items:t.data,filter:e.filters[a]},scopedSlots:e._u([{key:"body",fn:function(t){var a=t.items;return e._l(a,function(t){return s("tr",e._l(t,function(e){return s("td",[s("pretty-print",{attrs:{data:e.value}})],1)}),0)})}}],null,!0)}):e._e()],1)}),0)},Nt=[],Et={name:"UserTab",components:{DetailsTable:ce,PrettyPrint:ne},props:["userTab"],data:function(){return{filters:[]}},watch:{userTab:{handler:function(e){this.filters=e.sections.map(function(e){if("table"==e.showAs)return new de(e.data[0].map(function(e){return{tag:e.key}}))})},immediate:!0}}},Lt=Et,Rt=Object(y["a"])(Lt,Dt,Nt,!1,null,null,null),Mt=Rt.exports,It=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("details-table",{attrs:{columns:["Name","Data"],items:e.$request.views,filter:e.filter,"filter-example":'"Mike Jones" name:welcome'},scopedSlots:e._u([{key:"body",fn:function(t){var a=t.items;return e._l(a,function(t,a){return s("tr",{key:e.$request.id+"-"+a},[s("td",[e._v(e._s(t.name))]),s("td",[s("pretty-print",{attrs:{data:t.data}})],1)])})}}])})],1)},At=[],Ut={name:"ViewsTab",components:{DetailsTable:ce,PrettyPrint:ne},data:function(){return{filter:new de([{tag:"name"}])}}},Qt=Ut,Ft=Object(y["a"])(Qt,It,At,!1,null,null,null),Bt=Ft.exports,Ht={name:"RequestDetails",components:{MessagesOverlay:S,TabHandle:M,SettingsPopover:B,CacheTab:pe,DatabaseTab:ye,EmailsTab:je,EventsTab:Ne,LogTab:Ae,PerformanceTab:ft,RedisTab:wt,QueueTab:$t,RoutesTab:St,UserTab:Mt,ViewsTab:Bt},data:function(){return{activeTab:"performance"}},computed:{showLogTab:function(){var e,t;return null===(e=this.$request)||void 0===e?void 0:null===(t=e.log)||void 0===t?void 0:t.length},showDatabaseTab:function(){var e,t,s;return(null===(e=this.$request)||void 0===e?void 0:e.databaseQueriesCount)||(null===(t=this.$request)||void 0===t?void 0:null===(s=t.databaseQueries)||void 0===s?void 0:s.length)},showCacheTab:function(){var e,t=this;return["cacheReads","cacheHits","cacheWrites","cacheDeletes","cacheTime"].some(function(e){var s;return null===(s=t.$request)||void 0===s?void 0:s[e]})||(null===(e=this.$request)||void 0===e?void 0:e.cacheQueries.length)},showRedisTab:function(){var e,t;return null===(e=this.$request)||void 0===e?void 0:null===(t=e.redisCommands)||void 0===t?void 0:t.length},showQueueTab:function(){var e,t;return null===(e=this.$request)||void 0===e?void 0:null===(t=e.queueJobs)||void 0===t?void 0:t.length},showEventsTab:function(){var e,t;return null===(e=this.$request)||void 0===e?void 0:null===(t=e.events)||void 0===t?void 0:t.length},showViewsTab:function(){var e,t;return null===(e=this.$request)||void 0===e?void 0:null===(t=e.views)||void 0===t?void 0:t.length},showEmailsTab:function(){var e,t;return null===(e=this.$request)||void 0===e?void 0:null===(t=e.emails)||void 0===t?void 0:t.length},showRoutesTab:function(){var e,t;return null===(e=this.$request)||void 0===e?void 0:null===(t=e.routes)||void 0===t?void 0:t.length}},methods:{isTabActive:function(e){return this.$request&&this.activeTab==e},showTab:function(e){this.activeTab=e,this.global.showIncomingRequests=!1},toggleRequestsList:function(){this.$store.set("requestsListCollapsed",!this.$store.get("requestsListCollapsed"))},toggleRequestSidebar:function(){this.$store.set("requestSidebarCollapsed",!this.$store.get("requestSidebarCollapsed"))},togglePreserveLog:function(){this.$store.set("preserveLog",!this.$store.get("preserveLog"))},clear:function(){this.$requests.clear()}}},zt=Ht,Vt=(s("0f8a"),Object(y["a"])(zt,i,o,!1,null,null,null)),Wt=Vt.exports,Jt=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{class:{"request-sidebar":!0,large:e.$store.data.requestsListCollapsed}},[s("div",{staticClass:"sidebar-header"},[s("div",{staticClass:"sidebar-title"},[e._v("\n\t\t\tRequest\n\t\t")]),s("div",{staticClass:"sidebar-actions"},[e.$request&&e.$request.url?s("a",{directives:[{name:"clipboard",rawName:"v-clipboard:copy",value:e.$request.url,expression:"$request.url",arg:"copy"}],attrs:{href:"#",title:"Copy url"}},[s("font-awesome-icon",{attrs:{icon:"link"}})],1):e._e(),s("a",{attrs:{href:"#",title:"Preserve log"},on:{click:e.togglePreserveLog}},[s("font-awesome-icon",{attrs:{icon:e.$store.data.preserveLog?"circle":["far","circle"]}})],1),s("a",{attrs:{href:"#",title:"Clear"},on:{click:e.clear}},[s("font-awesome-icon",{attrs:{icon:"ban"}})],1)])]),s("div",{staticClass:"sidebar-content"},[e.$request?s("request-tab"):e._e(),e.$request&&e.$request.time?s("div",{staticClass:"sidebar-date"},[e._v("\n\t\t\t"+e._s(e._f("moment")(1e3*e.$request.time,"Y-MM-DD HH:mm:ss"))+"\n\t\t")]):e._e(),e.$request?s("div",{staticClass:"sidebar-id"},[e._v(e._s(e.$request.id))]):e._e()],1)])},Kt=[],Gt=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"request-tab"},[e.$request&&e.$request.parent?s("div",{staticClass:"parent-request"},[s("div",[e._v("\n\t\t\tSubrequest of "),s("span",{staticClass:"parent-method"},[e._v(e._s(e.$request.parent.method))]),s("span",{staticClass:"parent-uri"},[e._v(e._s(e.$request.parent.uri))])]),s("div",{staticClass:"parent-close"},[s("a",{attrs:{href:"#"},on:{click:function(t){return e.showRequestById(e.$request.parent.id)}}},[e._v("Show")])])]):e._e(),e.$request&&e.$request.exceptions.length?s("div",{staticClass:"exception"},e._l(e.$request.exceptions,function(t,a){return s("div",{key:e.$request.id+"-"+a,staticClass:"exception-info"},[s("div",{staticClass:"exception-message"},[s("h3",[e._v(e._s(t.type)+" "),t.code?s("small",[e._v("#"+e._s(t.code))]):e._e()]),e._v("\n\t\t\t\t"+e._s(t.message)+"\n\t\t\t")]),s("div",[t.previous?s("a",{staticClass:"exception-previous",attrs:{href:"#",title:"Show previous"},on:{click:function(s){return s.preventDefault(),e.showPreviousException(t)}}},[s("font-awesome-icon",{attrs:{icon:"arrow-circle-down"}})],1):e._e(),s("stack-trace",{staticClass:"exception-trace",attrs:{trace:t.trace}})],1)])}),0):e._e(),s("sidebar-section",{directives:[{name:"show",rawName:"v-show",value:e.headers.length,expression:"headers.length"}],attrs:{title:"Headers",name:"headers",items:e.headers,"filter-example":"text/html name:Accept"}}),s("sidebar-section",{directives:[{name:"show",rawName:"v-show",value:e.$request.requestData,expression:"$request.requestData"}],attrs:{title:"Data",name:"data",items:e.$request.requestData,"filter-example":"420 name:price"}},[e.$request.requestData instanceof Object?e._e():s("template",{slot:"content"},[s("div",{staticClass:"data-raw"},[e._v("\n\t\t\t\t"+e._s(e.$request.requestData)+"\n\t\t\t")])])],2),s("sidebar-section",{directives:[{name:"show",rawName:"v-show",value:e.$request.getData.length,expression:"$request.getData.length"}],attrs:{title:"GET data",name:"getData",items:e.$request.getData,"filter-example":"created_at name:orderBy"}}),s("sidebar-section",{directives:[{name:"show",rawName:"v-show",value:e.$request.postData.length,expression:"$request.postData.length"}],attrs:{title:"POST data",name:"postData",items:e.$request.postData,"filter-example":'"Mike Jones" name:name'}}),s("sidebar-section",{directives:[{name:"show",rawName:"v-show",value:e.$request.cookies.length,expression:"$request.cookies.length"}],attrs:{title:"Cookies",name:"cookies",items:e.$request.cookies,"filter-example":'"Mike Jones" name:name'}}),s("sidebar-section",{directives:[{name:"show",rawName:"v-show",value:e.$request.middleware.length,expression:"$request.middleware.length"}],attrs:{title:"Middleware",name:"middleware",items:e.$request.middleware,"filter-example":"auth:admin"},scopedSlots:e._u([{key:"table",fn:function(t){var a=t.items,r=t.filter,n=t.filterExample,i=t.expanded;return[s("details-table",{directives:[{name:"show",rawName:"v-show",value:i,expression:"expanded"}],attrs:{columns:["Value"],items:a,filter:r,"filter-example":n,"no-header":!0},scopedSlots:e._u([{key:"header",fn:function(e){e.filter}},{key:"body",fn:function(t){var a=t.items;return e._l(a,function(t,a){return s("tr",{key:e.$request.id+"-"+a},[s("td",{staticClass:"value"},[e._v(e._s(t))])])})}}],null,!0)})]}}])}),s("sidebar-section",{directives:[{name:"show",rawName:"v-show",value:e.$request.sessionData.length||e.$request.authenticatedUser,expression:"$request.sessionData.length || $request.authenticatedUser"}],attrs:{title:"Session",name:"session",items:e.$request.sessionData,"filter-example":"registration successful name:_token"}},[s("template",{slot:"above-table"},[e.$request.authenticatedUser?s("div",{staticClass:"session-user"},[s("font-awesome-icon",{attrs:{icon:"user"}}),s("div",[e.$request.authenticatedUser.name&&e.$request.authenticatedUser.name.trim()?s("span",{staticClass:"name"},[e._v(e._s(e.$request.authenticatedUser.name))]):e._e(),s("span",{class:e.$request.authenticatedUser.name&&e.$request.authenticatedUser.name.trim()?"dimmed":""},[e._v(e._s(e.$request.authenticatedUser.username))])]),e.$request.authenticatedUser.email||e.$request.authenticatedUser.id?s("span",{staticClass:"session-user-details"},[e.$request.authenticatedUser.id?s("span",{staticClass:"dimmed"},[e._v("#"+e._s(e.$request.authenticatedUser.id))]):e._e()]):e._e()],1):e._e()])],2)],1)},Yt=[],Xt=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"sidebar-section"},[s("div",{staticClass:"section-header"},[s("span",{staticClass:"section-title",on:{click:e.toggle}},[e._v("\n\t\t\t"+e._s(e.title)+"\n\t\t\t"),s("font-awesome-icon",{attrs:{icon:e.expanded?"angle-down":"angle-up"}})],1),s("details-table-filter-toggle",{attrs:{filter:e.filter}})],1),e._t("content",[s("div",{directives:[{name:"show",rawName:"v-show",value:e.expanded,expression:"expanded"}]},[e._t("above-table")],2),e._t("table",[s("details-table",{directives:[{name:"show",rawName:"v-show",value:e.expanded,expression:"expanded"}],attrs:{columns:["Key","Value"],items:e.items,filter:e.filter,"filter-example":e.filterExample,"no-header":!0},scopedSlots:e._u([{key:"body",fn:function(t){var a=t.items;return e._l(a,function(t,a){return s("tr",{key:e.$request.id+"-"+a},[s("td",{attrs:{colspan:"2"}},[s("div",{staticClass:"key"},[e._v(e._s(t.name))]),s("div",{staticClass:"value"},[s("pretty-print",{attrs:{data:t.value}})],1)])])})}}])})],{items:e.items,filter:e.filter,filterExample:e.filterExample,expanded:e.expanded})])],2)},Zt=[],es={name:"SidebarSection",components:{DetailsTable:ce,DetailsTableFilterToggle:Z,PrettyPrint:ne},props:["title","name","filterExample","items"],data:function(){return{filter:new de([{tag:"name"}])}},computed:{expanded:function(){return this.$store.get("sidebarSection.".concat(this.name),!0)}},methods:{toggle:function(){this.$store.set("sidebarSection.".concat(this.name),!this.expanded)}}},ts=es,ss=(s("101e"),Object(y["a"])(ts,Xt,Zt,!1,null,null,null)),as=ss.exports,rs={name:"RequestTab",components:{DetailsTable:ce,SidebarSection:as,StackTrace:j},computed:{headers:function(){return this.$request.cookies.length?this.$request.headers.filter(function(e){return"Cookie"!=e.name}):this.$request.headers}},methods:{showPreviousException:function(e){this.$request.exceptions.push(e.previous),e.previous=void 0},showRequestById:function(e){this.global.$request=this.$requests.find(e)}}},ns=rs,is=(s("9a64"),Object(y["a"])(ns,Gt,Yt,!1,null,null,null)),os=is.exports,ls={name:"RequestSidebar",components:{RequestTab:os},methods:{togglePreserveLog:function(){this.$store.set("preserveLog",!this.$store.get("preserveLog"))},clear:function(){this.$requests.clear()}}},cs=ls,us=(s("313b"),Object(y["a"])(cs,Jt,Kt,!1,null,null,null)),ds=us.exports,hs=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{class:{"split-view-pane split-view-requests":!0,large:e.$store.data.requestSidebarCollapsed}},[e._m(0),s("div",{directives:[{name:"show",rawName:"v-show",value:e.$requestsSearch.shown,expression:"$requestsSearch.shown"}],staticClass:"requests-search"},[s("label",[s("font-awesome-icon",{attrs:{icon:"search"}}),s("input",{directives:[{name:"model",rawName:"v-model",value:e.$requestsSearch.input,expression:"$requestsSearch.input"}],attrs:{type:"search",placeholder:"Search..."},domProps:{value:e.$requestsSearch.input},on:{input:[function(t){t.target.composing||e.$set(e.$requestsSearch,"input",t.target.value)},e.$requestsSearch.searchDebounced]}}),s("span",{directives:[{name:"show",rawName:"v-show",value:!e.$requestsSearch.input,expression:"! $requestsSearch.input"}],staticClass:"example"},[e._v("eg. /api/users method:post status:500")])],1)]),s("div",{ref:"requestsContainer",staticClass:"requests-container"},[s("div",{ref:"loadMore",staticClass:"load-more"},[s("p",{directives:[{name:"show",rawName:"v-show",value:!e.loadingMoreRequests,expression:"! loadingMoreRequests"}],staticClass:"load"},[s("a",{attrs:{href:"#"},on:{click:e.loadMoreRequests}},[e._v("load more")])]),s("p",{directives:[{name:"show",rawName:"v-show",value:e.loadingMoreRequests,expression:"loadingMoreRequests"}],staticClass:"loading"},[e._v("\n\t\t\t\tloading...\n\t\t\t")])]),s("table",{ref:"requestsTable",attrs:{id:"requests"}},[e._m(1),e._l(e.$requests.items,function(t){return s("tr",{key:t.id,class:{selected:e.isActive(t.id)},on:{click:function(s){return e.showRequest(t)}}},[s("td",{staticClass:"controller",attrs:{title:t.method+" "+t.uri+" ("+t.controller+")"}},[s("div",{staticClass:"notifications-count"},[s("span",{directives:[{name:"show",rawName:"v-show",value:t.warningsCount,expression:"request.warningsCount"}],staticClass:"warnings-count"},[s("font-awesome-icon",{attrs:{icon:"exclamation-triangle"}}),e._v(" "+e._s(t.warningsCount)+"\n\t\t\t\t\t\t")],1),s("span",{directives:[{name:"show",rawName:"v-show",value:t.errorsCount,expression:"request.errorsCount"}],staticClass:"errors-count"},[s("font-awesome-icon",{attrs:{icon:"exclamation-circle"}}),e._v(" "+e._s(t.errorsCount)+"\n\t\t\t\t\t\t")],1)]),s("big",[s("span",{staticClass:"method-text"},[e._v(e._s(t.method))]),e._v(" "+e._s(t.uri))]),s("br"),e.$store.data.requestSidebarCollapsed?s("small",[e._v(e._s(t.controller))]):s("small",[e._v(e._s(e._f("shortClass")(t.controller)))])],1),s("td",{staticClass:"status",attrs:{title:t.responseStatus}},[s("span",{class:{"status-text":!0,"client-error":t.isClientError(),"server-error":t.isServerError()}},[e._v(e._s(t.responseStatus))])]),s("td",{staticClass:"duration",attrs:{title:t.responseDurationRounded+" ms ("+t.databaseDurationRounded+" ms)"}},[e._v("\n\t\t\t\t\t"+e._s(t.responseDurationRounded)+" ms"),s("br"),s("small",[e._v(e._s(t.databaseDurationRounded)+" ms")])])])}),e._m(2)],2)])])},fs=[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("table",{staticClass:"requests-header",attrs:{id:"requests-header"}},[s("thead",[s("tr",[s("th",{staticClass:"controller"},[e._v("\n\t\t\t\t\tPath"),s("br"),s("small",[e._v("Controller")])]),s("th",{staticClass:"status"},[e._v("\n\t\t\t\t\tStatus\n\t\t\t\t")]),s("th",{staticClass:"duration"},[e._v("\n\t\t\t\t\tTime"),s("br"),s("small",[e._v("Database")])])])])])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("tr",{staticClass:"sizing"},[s("td",{staticClass:"controller"}),s("td",{staticClass:"status"}),s("td",{staticClass:"duration"})])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("tr",{staticClass:"filler"},[s("td",{staticClass:"controller"}),s("td",{staticClass:"status"}),s("td",{staticClass:"duration"})])}],vs={name:"RequestsList",components:{},data:function(){return{loadingMoreRequests:!1}},computed:{requests:function(){return this.$requests.items}},mounted:function(){this.$refs.requestsContainer.scrollTop=this.$refs.loadMore.offsetHeight+1},methods:{isActive:function(e){var t;return(null===(t=this.$request)||void 0===t?void 0:t.id)==e},showRequest:function(e){var t,s;this.global.$request=e,"requires-authentication"==(null===(t=this.$request)||void 0===t?void 0:null===(s=t.error)||void 0===s?void 0:s.error)&&this.$authentication.request(this.$request.error.message,this.$request.error.requires),this.global.showIncomingRequests=e==this.$requests.last()},loadMoreRequests:function(){var e=this;this.loadingMoreRequests=!0,this.$requests.loadPrevious(10).then(function(){e.loadingMoreRequests=!1})}},watch:{requests:{handler:function(e){this.$store.get("preserveLog")?this.global.showIncomingRequests&&(this.showRequest(this.global.$requests.last()),this.$refs.requestsContainer.scrollTop=this.$refs.requestsTable.offsetHeight):this.showRequest(this.global.$requests.first())},deep:!0}}},ps=vs,ms=(s("d852"),Object(y["a"])(ps,hs,fs,!1,null,null,null)),bs=ms.exports,gs={name:"App",components:{RequestDetails:Wt,RequestSidebar:ds,RequestsList:bs}},ws=gs,_s=(s("5c0b"),Object(y["a"])(ws,r,n,!1,null,null,null)),ys=_s.exports,qs=s("d842"),ks=s("4eb5"),Cs=s.n(ks),$s=s("2ead"),xs=s.n($s),js=s("f035"),Ts=s.n(js),Ps=s("2103"),Os=s.n(Ps),Ss=s("30ef"),Ds=s.n(Ss),Ns=s("9b02"),Es=s.n(Ns),Ls=s("ad3d");ue["a"].config.devtools=!0,ue["a"].config.performance=!0,ue["a"].config.productionTip=!1,ue["a"].use(Cs.a),ue["a"].use(xs.a),ue["a"].use(qs["a"],{adapter:Ds.a}),ue["a"].use(Os.a),ue["a"].component("font-awesome-icon",Ls["a"]),ue["a"].component("spinner",Ts.a),ue["a"].mixin({methods:{$get:Es.a}});var Rs=s("ecee"),Ms=s("c074"),Is=s("b702");Rs["c"].add(Ms["l"],Ms["q"],Ms["j"],Ms["k"],Is["a"],Ms["g"],Ms["d"],Ms["m"],Ms["s"],Ms["f"],Ms["e"],Ms["b"],Ms["a"],Ms["h"],Ms["p"],Ms["r"],Ms["t"],Ms["o"],Ms["i"],Ms["u"],Ms["c"],Ms["n"]);var As=s("75fc"),Us=s("1160"),Qs=s.n(Us),Fs=s("c909"),Bs=s.n(Fs),Hs=function(){function e(t){Object(f["a"])(this,e),Object.assign(this,t),this.time=parseFloat(this.time),this.responseDurationRounded=this.responseDuration?Math.round(this.responseDuration):0,this.databaseDurationRounded=this.databaseDuration?Math.round(this.databaseDuration):0,this.memoryUsageFormatted=this.memoryUsage?this.formatBytes(this.memoryUsage):void 0,this.processCacheStats(),this.cacheQueries=this.processCacheQueries(this.cacheQueries),this.cookies=this.createKeypairs(this.cookies),this.middleware=this.middleware instanceof Array?this.middleware:[],this.processDatabase(),this.emails=this.processEmails(this.emailsData),this.events=this.processEvents(this.events),this.getData=this.createKeypairs(this.getData),this.requestData=this.requestData instanceof Object?this.createKeypairs(this.requestData,!1):this.requestData,this.headers=this.processHeaders(this.headers),this.log=this.processLog(this.log),this.postData=this.createKeypairs(this.postData),this.queueJobs=this.processQueueJobs(this.queueJobs),this.redisCommands=this.processRedisCommands(this.redisCommands),this.sessionData=this.createKeypairs(this.sessionData),this.performanceMetrics=this.processPerformanceMetrics(this.performanceMetrics),this.timeline=this.processTimeline(this.timelineData),this.views=this.processViews(this.viewsData),this.userData=this.processUserData(this.userData),this.errorsCount=this.getErrorsCount(),this.warningsCount=this.getWarningsCount(),this.exceptions=this.processExceptions()}return Object(v["a"])(e,[{key:"resolve",value:function(e){return Object.assign(this,e,{loading:!1,error:void 0}),this}},{key:"resolveWithError",value:function(e){return Object.assign(this,{loading:!1,error:e}),this}},{key:"extend",value:function(e,t){var s=this;return t.forEach(function(t){return s[t]=e[t]}),this}},{key:"isClientError",value:function(){return this.responseStatus>=400&&this.responseStatus<500}},{key:"isServerError",value:function(){return this.responseStatus>=500&&this.responseStatus<600}},{key:"createKeypairs",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!(e instanceof Object))return[];var s=Object.keys(e).map(function(t){return{name:t,value:e[t]}});return t&&(s=s.sort(function(e,t){return e.name.localeCompare(t.name)})),s}},{key:"processCacheStats",value:function(){this.cacheDeletes&&(this.cacheDeletes=parseInt(this.cacheDeletes)),this.cacheHits&&(this.cacheHits=parseInt(this.cacheHits)),this.cacheReads&&(this.cacheReads=parseInt(this.cacheReads)),this.cacheWrites&&(this.cacheWrites=parseInt(this.cacheWrites)),this.cacheMisses=this.cacheReads&&this.cacheHits?this.cacheReads-this.cacheHits:null}},{key:"processCacheQueries",value:function(e){var t=this;return e instanceof Array?e.map(function(e){return e.expiration=e.expiration?t.formatTime(e.expiration):void 0,e.value="hit"==e.type||"write"==e.type?e.value:"",e}):[]}},{key:"processDatabase",value:function(){this.databaseQueries=this.processDatabaseQueries(this.databaseQueries),this.databaseQueriesCount=parseInt(this.databaseQueriesCount)||this.databaseQueries.length,this.databaseSlowQueries=parseInt(this.databaseSlowQueries)||this.databaseQueries.filter(function(e){return e.tags.includes("slow")}).length,this.databaseSelects=parseInt(this.databaseSelects)||this.databaseQueries.filter(function(e){return e.query.match(/^select /i)}).length,this.databaseInserts=parseInt(this.databaseInserts)||this.databaseQueries.filter(function(e){return e.query.match(/^insert /i)}).length,this.databaseUpdates=parseInt(this.databaseUpdates)||this.databaseQueries.filter(function(e){return e.query.match(/^update /i)}).length,this.databaseDeletes=parseInt(this.databaseDelets)||this.databaseQueries.filter(function(e){return e.query.match(/^delete /i)}).length,this.databaseOthers=parseInt(this.databaseOthers)||this.databaseQueries.filter(function(e){return!e.query.match(/^(select|insert|update|delete) /i)}).length}},{key:"processDatabaseQueries",value:function(e){return e instanceof Array?e.map(function(e){return e.model=e.model||"-",e.shortModel=e.model?e.model.split("\\").pop():"-",e.tags=e.tags instanceof Array?e.tags:[],e}):[]}},{key:"processEmails",value:function(e){return e instanceof Object?Object.values(e).filter(function(e){return e.data instanceof Object}).map(function(e){return e.data}):[]}},{key:"processEvents",value:function(e){return e instanceof Array?e.map(function(e){return e.objectEvent=e.data instanceof Object&&e.event==e.data.__class__,e.time=e.time?new Date(1e3*e.time):void 0,e.listeners=e.listeners instanceof Array?e.listeners:[],e.listeners=e.listeners.map(function(e){var t,s;return t=(s=e.match(/Closure \(.*[\/\\](.+?:\d+)-\d+\)/))?"Closure ("+s[1]+")":e.split(/[\/\\]/).pop(),{name:e,shortName:t}}),e}):[]}},{key:"processExceptions",value:function(){var e=this.log.length?this.log[this.log.length-1].exception:null;if(500!=this.responseStatus||!e)return[];e=Qs()(e);var t=e;do{t.trace=[{call:"".concat(t.type,"()"),file:t.file,line:t.line,isVendor:!1}].concat(Object(As["a"])(t.trace))}while(t=t.previous);return[e]}},{key:"processHeaders",value:function(e){return e instanceof Object?Object.keys(e).map(function(t){var s=e[t];return t=t.split("-").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}).join("-"),{name:t,value:s}}).reduce(function(e,t){return t=t.value instanceof Array?t.value.map(function(e){return{name:t.name,value:e}}):[t],e.concat(t)},[]).sort(function(e,t){return e.name.localeCompare(t.name)}):[]}},{key:"processLog",value:function(e){return e instanceof Array?e.map(function(e){return e.exception&&(e.file=e.exception.file,e.line=e.exception.line,e.trace=e.exception.trace),e.time=new Date(1e3*e.time),e.context=e.context instanceof Object&&Object.keys(e.context).filter(function(e){return"__type__"!=e}).length?e.context:void 0,e}):[]}},{key:"processPerformanceMetrics",value:function(e){if(!e)return[{name:"Database",value:this.databaseDurationRounded,style:"style2"},{name:"Cache",value:this.cacheTime,style:"style3"},{name:"Other",value:(this.responseDurationRounded||0)-(this.databaseDurationRounded||0)-(this.cacheTime||0),style:"style1"}].filter(function(e){return e.value>0});e=e.filter(function(e){return e instanceof Object}).map(function(e,t){return e.style="style"+(t+2),e});var t=e.reduce(function(e,t){return e+t.value},0);return e.push({name:"Other",value:this.responseDurationRounded-t,style:"style1"}),e}},{key:"processQueueJobs",value:function(e){return e instanceof Array?e.map(function(e){return e.shortName=e.name.split("\\").pop(),e}):[]}},{key:"processRedisCommands",value:function(e){return e instanceof Array?e:[]}},{key:"processTimeline",value:function(e){var t=this;return e instanceof Object?Object.values(e).map(function(e,s){return e.style="style"+(s%4+1),e.startPercentual=1e3*(e.start-t.time)/t.responseDuration*100,e.durationPercentual=e.duration/t.responseDuration*100,e.barLeft="".concat(e.startPercentual,"%"),e.barWidth=e.startPercentual+e.durationPercentual<100?"".concat(e.durationPercentual,"%"):"".concat(100-e.startPercentual,"%"),e.labelAlign="left",e.labelLeft=e.barLeft,e.labelRight="auto",e.startPercentual>50&&(e.labelAlign="right",e.labelLeft="auto",e.labelRight=e.durationPercentual<1?"calc(100% - ".concat(e.barLeft," - 8px)"):"calc(100% - ".concat(e.barLeft," - ").concat(e.barWidth,")")),e.durationRounded=Math.round(e.duration),0===e.durationRounded&&(e.durationRounded="< 1"),e}):[]}},{key:"processViews",value:function(e){return e instanceof Object?Object.values(e).filter(function(e){return e.data instanceof Object}).map(function(e){return e.data}):[]}},{key:"processUserData",value:function(e){if(!(e instanceof Object))return[];var t=function(e){var t=Object(a["a"])(e,2),s=t[0];t[1];return"__meta"!=s},s=function(e){return function(t){var s=Object(a["a"])(t,2),r=s[0],n=s[1];return{key:e[r]||r,value:n}}};return Object.entries(e).filter(function(e){var t=Object(a["a"])(e,2),s=(t[0],t[1]);return s instanceof Object||s.__meta||s.__meta.title}).map(function(e){var r=Object(a["a"])(e,2),n=r[0],i=r[1];return{key:n,title:i.__meta.title,sections:Object.entries(i).filter(t).map(function(e){var r=Object(a["a"])(e,2),n=(r[0],r[1]),i=n.__meta.labels||{},o="counters"==n.__meta.showAs?Object.entries(n).filter(t).map(s(i)):Object.entries(n).filter(t).map(function(e){var t=Object(a["a"])(e,2),r=(t[0],t[1]);return Object.entries(r).map(s(i))});return{data:o,showAs:n.__meta.showAs,title:n.__meta.title}})}})}},{key:"getErrorsCount",value:function(){return this.log.reduce(function(e,t){return"error"==t.level?e+1:e},0)}},{key:"getWarningsCount",value:function(){return this.log.filter(function(e){return"warning"==e.level}).length+this.databaseSlowQueries}},{key:"formatTime",value:function(e){var t=Math.floor(e/60),s=Math.floor(t/60);e%=60,t%=60;var a=[];return s&&a.push(s+"h"),t&&a.push(t+"min"),e&&a.push(e+"sec"),a.join(" ")}},{key:"formatBytes",value:function(e){var t=["B","kB","MB","GB","TB","PB"],s=Math.floor(Math.log(e)/Math.log(1024));return"".concat(Math.round(e/Math.round(Math.pow(1024,s)))," ").concat(t[s])}}],[{key:"placeholder",value:function(t,s,a){return Object.assign(new e({loading:!0,id:t,uri:s?new Bs.a(s.url).pathname():"/",controller:"Waiting...",method:s?s.method:"GET",responseStatus:"?",parent:a}),{responseDurationRounded:"?",databaseDurationRounded:"?"})}}]),e}(),zs=function(){function e(){Object(f["a"])(this,e)}return Object(v["a"])(e,[{key:"init",value:function(e){this.global=e,this.requests=e.$requests,this.profiler=e.$profiler,this.store=e.$store,this.updateNotification=e.$updateNotification,this.useProperTheme(),this.setMetadataUrl(),this.setMetadataClient(),this.listenToRequests(),this.loadLastRequest()}},{key:"useProperTheme",value:function(){"dark"===this.api.devtools.panels.themeName&&document.querySelector("body").classList.add("dark")}},{key:"setMetadataUrl",value:function(){var e=this;this.resolveTabUrl().then(function(t){return e.requests.setRemote(t)})}},{key:"setMetadataClient",value:function(){var e=this;this.requests.setClient(function(t,s,a,r){return new Promise(function(n,i){var o=e.profiler.isProfiling,l=function(){e.api.runtime.sendMessage({action:"getJSON",method:t,url:s,data:a,headers:r},function(t){o&&e.profiler.enableProfiling(),t.error?i(t):n(t.data)})};o?e.profiler.disableProfiling().then(l):l()})})}},{key:"setCookie",value:function(e,t,s){var a=this;return this.resolveTabUrl().then(function(r){a.api.cookies.set({url:r,name:e,value:t,path:"/",expirationDate:Math.floor(Date.now()/1e3)+s})})}},{key:"getCookie",value:function(e){var t=this;return this.resolveTabUrl().then(function(s){return new Promise(function(a,r){t.api.cookies.get({url:s,name:e},function(e){a(e?e.value:void 0)})})})}},{key:"resolveTabUrl",value:function(){var e=this;return new Promise(function(t,s){e.api.runtime.sendMessage({action:"getTabUrl",tabId:e.api.devtools.inspectedWindow.tabId},function(e){return t(e)})})}},{key:"listenToRequests",value:function(){var e=this;this.api.runtime.onMessage.addListener(function(t){if("requestCompleted"===t.action&&(-1!==navigator.userAgent.toLowerCase().indexOf("firefox/57.0")||t.request.tabId==e.api.devtools.inspectedWindow.tabId)){var s=e.parseHeaders(t.request.responseHeaders);if(s){e.updateNotification.serverVersion=s.version,e.requests.setRemote(t.request.url,s);var a=Hs.placeholder(s.id,t.request);e.requests.loadId(s.id,a),s.subrequests.forEach(function(t){e.requests.setRemote(t.url,{path:t.path}),e.requests.loadId(t.id,Hs.placeholder(t.id,t,a))}),e.requests.setRemote(t.request.url,s)}}}),this.api.runtime.onMessage.addListener(function(t){"navigationStarted"===t.action&&(e.store.get("preserveLog")||t.details.tabId==e.api.devtools.inspectedWindow.tabId&&e.requests.clear())})}},{key:"loadLastRequest",value:function(){var e=this;this.api.runtime.sendMessage({action:"getLastClockworkRequestInTab",tabId:this.api.devtools.inspectedWindow.tabId},function(t){if(t){var s=e.parseHeaders(t.responseHeaders);e.updateNotification.serverVersion=s.version,e.requests.setRemote(t.url,s),e.requests.loadId(s.id,Hs.placeholder(s.id,t))}})}},{key:"parseHeaders",value:function(e){var t,s=(t=e.find(function(e){return"x-clockwork-id"==e.name.toLowerCase()}))?t.value:void 0,a=(t=e.find(function(e){return"x-clockwork-path"==e.name.toLowerCase()}))?t.value:void 0,r=(t=e.find(function(e){return"x-clockwork-version"==e.name.toLowerCase()}))?t.value:void 0;if(s){var n={};e.forEach(function(e){if(0===e.name.toLowerCase().indexOf("x-clockwork-header-")){var t=e.name.replace(/^x-clockwork-header-/i,"");n[t]=e.value}});var i=e.filter(function(e){return"x-clockwork-subrequest"==e.name.toLowerCase()}).reduce(function(e,t){return e.concat(t.value.split(",").map(function(e){var t=e.trim().split(";");return{id:t[0],url:decodeURIComponent(t[1]),path:decodeURIComponent(t[2])}}))},[]);return{id:s,path:a,version:r,headers:n,subrequests:i}}}},{key:"api",get:function(){return chrome||browser}}],[{key:"runningAsExtension",value:function(){return"object"==("undefined"===typeof chrome?"undefined":Object(h["a"])(chrome))&&chrome.devtools||"object"==("undefined"===typeof browser?"undefined":Object(h["a"])(browser))&&browser.devtools}}]),e}(),Vs=function(){function e(){Object(f["a"])(this,e)}return Object(v["a"])(e,[{key:"init",value:function(e){this.global=e,this.requests=e.$requests,this.authentication=e.$authentication,this.profiler=e.$profiler,this.store=e.$store,this.useProperTheme(),this.setMetadataUrl(),this.setMetadataClient(),this.startPollingRequests(),this.throttlePolling()}},{key:"useProperTheme",value:function(){var e=Bs()(window.location.href).query(!0).dark;"1"==e||"0"==e?(this.store.set("use-dark-theme",e),e="1"==e):e=this.store.get("use-dark-theme")?"1"==this.store.get("use-dark-theme"):null===e,e&&document.querySelector("body").classList.add("dark")}},{key:"setMetadataUrl",value:function(){this.requests.setRemote(window.location.href,{path:Bs()(window.location.href.split("/").slice(0,-1).join("/")).path()+"/"})}},{key:"setMetadataClient",value:function(){var e=this;this.requests.setClient(function(t,s,r,n){var i=e.profiler.isProfiling,o=new FormData;Object.entries(r).forEach(function(e){var t=Object(a["a"])(e,2),s=t[0],r=t[1];return o.append(s,r)});var l=function(){return fetch(s,{method:t,body:Object.keys(r).length?o:null,headers:n}).then(function(e){return e.json().then(function(t){return{response:e,data:t}})}).then(function(e){var t=e.response,s=e.data;if(403==t.status)throw{error:"requires-authentication",message:s.message,requires:s.requires};if(200!=t.status)throw{error:"Server returned an error response."};if(!(s instanceof Object)||!Object.keys(s).length)throw{error:"Server returned an empty metadata."};return s}).then(function(t){return i&&e.profiler.enableProfiling(),t})};return i?e.profiler.disableProfiling().then(l):l()})}},{key:"setCookie",value:function(e,t,s){return document.cookie="".concat(e,"=").concat(t,";path=/;max-age=").concat(s),Promise.resolve()}},{key:"getCookie",value:function(e){var t=document.cookie.match(new RegExp("(?:^| )".concat(e,"=([^;]*)")));return Promise.resolve(t?t[1]:void 0)}},{key:"startPollingRequests",value:function(){var e=this;this.pollingInterval=1e3,this.requests.loadLatest().then(function(){if(!e.requests.last())throw new Error;e.pollRequests()}).catch(function(t){"requires-authentication"==t.error?e.authentication.request(t.message,t.requires).then(function(){e.startPollingRequests()}):setTimeout(function(){return e.startPollingRequests()},e.pollingInterval)})}},{key:"pollRequests",value:function(){var e=this;clearTimeout(this.pollTimeout),this.requests.loadNext().then(function(){e.store.get("preserveLog")||e.requests.setItems(e.requests.all().slice(-1)),e.pollTimeout=setTimeout(function(){return e.pollRequests()},e.pollingInterval)}).catch(function(){e.pollTimeout=setTimeout(function(){return e.pollRequests()},e.pollingInterval)})}},{key:"throttlePolling",value:function(){var e=this;document.addEventListener("visibilitychange",function(){e.pollingInterval=document.hidden?6e4:1e3,document.hidden||e.pollRequests()})}}]),e}(),Ws=function(){function e(t){Object(f["a"])(this,e),this.requests=t,this.username=this.password="",this.shown=!1,this.failed=!1,this.requires=[]}return Object(v["a"])(e,[{key:"attempt",value:function(){var e=this,t={username:this.username,password:this.password};return this.username=this.password="",this.failed=!1,this.requests.client("POST","".concat(this.requests.remoteUrl,"auth"),t).then(function(t){e.shown=!1,e.requests.setAuthenticationToken(t.token),e.requests.items.forEach(function(t){if(t.error&&"requires-authentication"==t.error.error)return e.requests.loadId(t.id)}),e.accept()}).catch(function(t){e.failed=!0})}},{key:"request",value:function(e,t){var s=this;return this.shown=!0,this.requires=t,this.message=e,new Promise(function(e,t){s.accept=e,s.reject=t})}}]),e}(),Js=function(){function e(t){Object(f["a"])(this,e),this.settings=t}return Object(v["a"])(e,[{key:"register",value:function(){ue["a"].filter("editorLink",this.filter())}},{key:"filter",value:function(){var e=this;return function(t,s){var a={atom:function(e,t){return"atom://open?url=file://".concat(e,"&line=").concat(t)},phpstorm:function(e,t){return"phpstorm://open?url=file://".concat(e,"&line=").concat(t)},sublime:function(e,t){return"subl://open?url=file://".concat(e,"&line=").concat(t)},textmate:function(e,t){return"txmt://open?url=file://".concat(e,"&line=").concat(t)},"vs-code":function(e,t){return"vscode://file/".concat(e,":").concat(t)}},r=e.settings.editor;if(r&&a[r])return t&&e.settings.localPathMapReal&&(t=t.replace(e.settings.localPathMapReal,e.settings.localPathMapLocal)),a[r](t,s)}}}]),e}(),Ks=function(){function e(){Object(f["a"])(this,e),this.load()}return Object(v["a"])(e,[{key:"get",value:function(e,t){return void 0==this.data[e]&&this.set(e,t),this.data[e]}},{key:"set",value:function(e,t){this.data[e]=t,this.save()}},{key:"load",value:function(){try{this.data=JSON.parse(localStorage.getItem("clockwork"))}catch(e){}this.data instanceof Object||(this.data={}),this.data=ze()(this.defaults(),this.data)}},{key:"save",value:function(){try{localStorage.setItem("clockwork",JSON.stringify(this.data))}catch(e){}}},{key:"defaults",value:function(){return{preserveLog:!0,requestsListCollapsed:!1,requestSidebarCollapsed:!1}}}]),e}(),Gs=(s("6c7b"),s("f559"),function(){function e(t,s){Object(f["a"])(this,e),this.metadata=t,this.functions=s}return Object(v["a"])(e,null,[{key:"parse",value:function(t){return new Promise(function(s,a){s(e.parseSync(t))})}},{key:"parseSync",value:function(t){var s=this,r={},n=[],i={},o={};t=t.split("\n");var l,c,u,d,h=0;while(void 0!==(l=t[h++]))l.startsWith("fl=")?function(){var e=s.resolveCompressedName(l.match(/fl=(.+)/)[0],i),r=Object(a["a"])(e,2),c=(r[0],r[1]);l=t[h++];var d=s.resolveCompressedName(l.match(/fn=(.+)/)[0],o),f=Object(a["a"])(d,2),v=f[0],p=f[1];l=t[h++];var m=l.split(" ").map(function(e){return parseFloat(e)}),b=m.shift();u=n[v],u||(n[v]=u={name:p,file:c,line:b,invocations:0,self:new Array(m.length).fill(0),inclusive:new Array(m.length).fill(0),callers:[],subCalls:[]}),u.invocations++,u.self=u.self.map(function(e,t){return e+m[t]}),u.inclusive=u.inclusive.map(function(e,t){return e+m[t]})}():l.startsWith("cfn=")?function(){var e=s.resolveCompressedName(l.match(/cfn=(.+)/)[0],o),r=Object(a["a"])(e,2),i=r[0],c=r[1];l=t[h++],l=t[h++];var f=l.split(" ").map(function(e){return parseFloat(e)}),v=f.shift(),p=n[i];u.inclusive=f.map(function(e,t){return e+(u.inclusive[t]||0)});var m=p.callers[d];m||(p.callers[d]=m={name:u.name,line:v,calls:0,summed:new Array(f.length).fill(0)}),m.calls++,m.summed=m.summed.map(function(e,t){return e+f[t]});var b=u.subCalls[i];b||(u.subCalls[i]=b={name:c,line:v,calls:0,summed:new Array(f.length).fill(0)}),b.calls++,b.summed=b.summed.map(function(e,t){return e+f[t]})}():(c=l.match(/^(.+?): (.+)/))&&(r[c[1]]=c[2]);return new e(r,n.slice(1))}},{key:"resolveCompressedName",value:function(e,t){var s=e.match(/\((\d+)\)(?: (.*))?/),r=Object(a["a"])(s,3),n=(r[0],r[1]),i=r[2];return i&&(t[n]=i),[n,t[n]]}}]),e}()),Ys=function(){function e(t,s){var a=this;Object(f["a"])(this,e),this.requests=t,this.platform=s,this.available=!1,this.loading=!1,this.parsing=!1,this.ready=!1,this.isProfiling=!1,this.metric=0,this.percentual=!1,this.shownFraction=.9,this.request=void 0,this.platform.getCookie("XDEBUG_PROFILE").then(function(e){return a.isProfiling=e})}return Object(v["a"])(e,[{key:"enableProfiling",value:function(){var e=this;return this.platform.setCookie("XDEBUG_PROFILE","1",2592e3).then(function(){e.isProfiling=!0})}},{key:"disableProfiling",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t&&this.clear(),this.platform.setCookie("XDEBUG_PROFILE","0",0).then(function(){e.isProfiling=!1})}},{key:"loadRequest",value:function(e){var t=this;if(!this.request||this.request.id!=e.id){if(!e.xdebug||!e.xdebug.profile)return this.clear();if(this.request=e,this.available=this.loading=this.parsing=this.ready=!1,this.summary=this.metadata=this.functions=void 0,this.available=!0,e.xdebug.profileData)return this.parseProfile();this.loading=!0,this.requests.loadExtended(e.id,["xdebug"]).then(function(e){t.loading=!1,t.parseProfile()})}}},{key:"parseProfile",value:function(){var e=this;this.ready=!1,this.parsing=!0,Gs.parse(this.request.xdebug.profileData).then(function(t){if(!t.metadata.summary)return e.parsing=e.available=!1;e.metadata=t.metadata,e.summary=e.metadata.summary.split(" ");var s=e.shownFraction*e.summary[e.metric];e.functions=t.functions.filter(function(e){return"{main}"!=e.name}).sort(function(t,s){return s.self[e.metric]-t.self[e.metric]}).filter(function(t){return s-=t.self[e.metric],s>0}).map(function(e){return e.fullPath="php:internal"==e.file?"internal":"".concat(e.file,":").concat(e.line),e.shortPath="internal"!=e.fullPath?e.fullPath.split(/[\/\\]/).pop():e.fullPath,e}),e.parsing=!1,e.ready=!0})}},{key:"clear",value:function(){this.available=this.loading=this.parsing=this.ready=!1,this.metadata=this.functions=void 0}},{key:"showMetric",value:function(e){this.metric=e,this.parseProfile()}},{key:"showPercentual",value:function(e){this.percentual=!0===e||void 0===e}},{key:"setShownFraction",value:function(e){this.shownFraction=e,this.parseProfile()}},{key:"formatMetric",value:function(e){return this.percentual?Math.round(e[this.metric]/this.summary[this.metric]*100)+" %":1==this.metric?Math.round(e[this.metric]/1024)+" kB":Math.round(e[this.metric]/100)/10+" ms"}}]),e}(),Xs=function(){function e(t){Object(f["a"])(this,e),this.store=t,this.items=[],this.tokens=this.store.get("requests.tokens"),this.query={},this.exclusive={},this.tokens instanceof Object||(this.tokens={})}return Object(v["a"])(e,[{key:"all",value:function(){return this.items}},{key:"findId",value:function(e){return this.items.find(function(t){return t.id==e})}},{key:"loadId",value:function(e,t){var s=this.findId(e);return s?t=s:(t=t||Hs.placeholder(e),this.items.push(t)),t.loading=!0,this.load(e,function(e){return e.then(function(e){return t.resolve(e[0])}).catch(function(e){return t.resolveWithError(e)})})}},{key:"loadExtended",value:function(e,t){var s=this.findId(e);return this.load("".concat(e,"/extended"),function(e){return e.then(function(e){return s.extend(e[0],t)}).catch(function(e){})})}},{key:"loadLatest",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.load("latest",function(s){return s.then(function(s){return t&&e.items.push(s[0]),s[0]})},t)}},{key:"returnLatest",value:function(){return this.loadLatest(!1)}},{key:"loadNext",value:function(e,t){var s=this,a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t||this.items.length?(t=t||this.last().id,this.load("".concat(t,"/next")+(e?"/".concat(e):""),function(e){return e.then(function(e){var t;return a&&(t=s.items).push.apply(t,Object(As["a"])(e)),e}).catch(function(e){})},a)):Promise.resolve([])}},{key:"returnNext",value:function(e,t){return this.loadNext(e,t,!1)}},{key:"loadPrevious",value:function(e,t){var s=this,a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t||this.items.length?(t=t||this.first().id,this.load("".concat(t,"/previous")+(e?"/".concat(e):""),function(e){return e.then(function(e){var t;return a&&(t=s.items).unshift.apply(t,Object(As["a"])(e)),e}).catch(function(e){})},a)):Promise.resolve([])}},{key:"returnPrevious",value:function(e,t){return this.loadPrevious(e,t,!1)}},{key:"clear",value:function(){this.items.splice(0)}},{key:"first",value:function(){return this.items[0]}},{key:"last",value:function(){return this.items[this.items.length-1]}},{key:"setClient",value:function(e){this.client=e}},{key:"setItems",value:function(e){this.items=e}},{key:"setRemote",value:function(e,t){t=t||{},t.path=t.path||"/__clockwork/",e=new Bs.a(e);var s=t.path.split("?"),r=Object(a["a"])(s,2),n=r[0],i=r[1];e.pathname(n||""),e.query(i||""),e.hash(""),this.remoteUrl=e.toString(),this.remoteHeaders=t.headers||{}}},{key:"setAuthenticationToken",value:function(e){this.tokens[this.remoteUrl]=e,this.store.set("requests.tokens",this.tokens)}},{key:"setQuery",value:function(e){this.query=e}},{key:"load",value:function(e,t){var s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(s)return this.loadExclusive(e,t);var a=Bs()("".concat(this.remoteUrl).concat(e)).addQuery(this.query).toString(),r=Object.assign({},this.remoteHeaders,{"X-Clockwork-Auth":this.tokens[this.remoteUrl]});return t(this.client("GET",a,{},r).then(function(e){return e?(e instanceof Array?e:[e]).map(function(e){return new Hs(e)}):[]}))}},{key:"loadExclusive",value:function(e,t){var s=this;return this.exclusive[e]?this.exclusive[e]:this.exclusive[e]=this.load(e,t).finally(function(){return s.exclusive[e]=null})}}]),e}(),Zs=(s("8e6e"),s("bd86")),ea=(s("386d"),s("2fd4")),ta=s.n(ea),sa=s("c1df"),aa=s.n(sa);function ra(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function na(e){for(var t=1;t=100&&e<600}},{tag:"time"},{tag:"received",validate:function(e){return aa()(e).isValid()}}],this.shown=!1,this.input="",this.searchDebounced=ta()(function(){return s.search()},500)}return Object(v["a"])(e,[{key:"toggle",value:function(){this.shown=!this.shown,this.shown?ue["a"].nextTick(function(){return document.querySelector(".requests-search input").focus()}):(this.input="",this.search())}},{key:"search",value:function(){var e=this,t=this.tokenize(this.input),s=t.terms,r=t.tags;r=Object.entries(r).filter(function(t){var s=Object(a["a"])(t,2),r=s[0],n=s[1];return r=e.tags.find(function(e){return e.tag==r}),r&&(!r.validate||n.every(function(e){return r.validate(e)}))}).reduce(function(e,t){var s=Object(a["a"])(t,2),r=s[0],n=s[1];return e["".concat(r,"[]")]=n,e},{}),this.requests.setQuery(s.length||Object.keys(r).length?na({"uri[]":s},r):{}),this.requests.returnLatest().then(function(t){e.requests.returnPrevious(9,t.id).then(function(s){e.requests.setItems(s?[].concat(Object(As["a"])(s),[t]):[t])})}).catch(function(){e.requests.clear()})}},{key:"tokenize",value:function(e){var t,s=[],a={},r=/(\w+:)?("[^"]*"|[^\s]+)/g;while(t=r.exec(e)){var n=t[1]?t[1].substr(0,t[1].length-1):void 0,i=t[2];(t=i.match(/^"(.+?)"$/))&&(i=t[1]),n?(a[n]||(a[n]=[]),a[n].push(i)):s.push(i)}return{terms:s,tags:a}}}]),e}(),oa=function(){function e(t,s){Object(f["a"])(this,e),this.store=t,this.requests=s,this.reload()}return Object(v["a"])(e,[{key:"getSite",value:function(e,t){return this.settings.site[this.requests.remoteUrl]?this.settings.site[this.requests.remoteUrl][e]:t}},{key:"setSite",value:function(e,t){this.settings.site[this.requests.remoteUrl]||(this.settings.site[this.requests.remoteUrl]={}),this.settings.site[this.requests.remoteUrl][e]=t}},{key:"save",value:function(){var e=ze()(!0,this.loadSettings(),this.settings);this.store.set("settings",e)}},{key:"reload",value:function(){this.settings=this.loadSettings()}},{key:"loadSettings",value:function(){var e={global:{editor:null},site:{}};return ze()(!0,e,this.store.get("settings"))}},{key:"editor",get:function(){return this.settings.global.editor},set:function(e){this.settings.global.editor=e}},{key:"localPathMapReal",get:function(){return this.getSite("localPathMap",{}).real},set:function(e){this.setSite("localPathMap",ze()(!0,this.getSite("localPathMap",{}),{real:e}))}},{key:"localPathMapLocal",get:function(){return this.getSite("localPathMap",{}).local},set:function(e){this.setSite("localPathMap",ze()(!0,this.getSite("localPathMap",{}),{local:e}))}}]),e}(),la=function(){function e(){Object(f["a"])(this,e)}return Object(v["a"])(e,[{key:"register",value:function(){ue["a"].filter("shortClass",this.shortClass)}},{key:"shortClass",value:function(e){return e?e.split("\\").pop():""}}]),e}(),ca=function(){function e(t){Object(f["a"])(this,e),this.store=t,this.serverVersion=null}return Object(v["a"])(e,[{key:"latest",value:function(){return{version:"4.0.0",url:"https://underground.works/blog/clockwork-4.0-released-with-ui-improvements-requests-search-and-more"}}},{key:"show",value:function(e){if(!this.ignoresUpdate(e)&&this.serverVersion)return 1==this.versionCompare(this.latest().version,this.serverVersion)?{version:this.latest().version,url:this.latest().url,currentVersion:this.serverVersion}:void 0}},{key:"ignoresUpdate",value:function(e){var t=this.ignoredUpdates[e];return t&&this.versionCompare(t,this.latest().version)>=0}},{key:"ignoreUpdate",value:function(e){var t=this.ignoredUpdates;t[e]=this.latest().version,this.store.set("update-notification.ignored-updates",t)}},{key:"versionCompare",value:function(e,t){e=e.split(".").map(function(e){return parseInt(e)}),t=t.split(".").map(function(e){return parseInt(e)});for(var s=0;st[s])return 1;if(!e[s]&&t[s]||e[s]1))break;n.splice(0,1)}a[s]=n.join("")}var l=-1,c=0,d=0,f=-1,h=!1;for(s=0;sc&&(l=f,c=d)):"0"===a[s]&&(h=!0,f=s,d=1);d>c&&(l=f,c=d),c>1&&a.splice(l,c,""),i=a.length;var m="";for(""===a[0]&&(m=":"),s=0;sa)Q(e,n=r[a++],t[n]);return e},K=function(e,t){return void 0===t?k(e):Z(k(e),t)},X=function(e){var t=I.call(this,e=w(e,!0));return!(this===V&&a(W,e)&&!a(R,e))&&(!(t||!a(this,e)||!a(W,e)||a(this,z)&&this[z][e])||t)},ee=function(e,t){if(e=M(e),t=w(t,!0),e!==V||!a(W,t)||a(R,t)){var n=O(e,t);return!n||!a(W,t)||a(e,z)&&e[z][t]||(n.enumerable=!0),n}},te=function(e){var t,n=P(M(e)),r=[],i=0;while(n.length>i)a(W,t=n[i++])||t==z||t==u||r.push(t);return r},ne=function(e){var t,n=e===V,r=P(n?R:M(e)),i=[],o=0;while(r.length>o)!a(W,t=r[o++])||n&&!a(V,t)||i.push(W[t]);return i};U||(j=function(){if(this instanceof j)throw TypeError("Symbol is not a constructor!");var e=f(arguments.length>0?arguments[0]:void 0),t=function(n){this===V&&t.call(R,n),a(this,z)&&a(this[z],e)&&(this[z][e]=!1),q(this,e,L(1,n))};return i&&B&&q(V,e,{configurable:!0,set:t}),G(e)},s(j[E],"toString",(function(){return this._k})),Y.f=ee,S.f=Q,n("6abf").f=x.f=te,n("355d").f=X,D.f=ne,i&&!n("b8e3")&&s(V,"propertyIsEnumerable",X,!0),m.f=function(e){return G(h(e))}),o(o.G+o.W+o.F*!U,{Symbol:j});for(var re="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ae=0;re.length>ae;)h(re[ae++]);for(var ie=T(h.store),oe=0;ie.length>oe;)p(ie[oe++]);o(o.S+o.F*!U,"Symbol",{for:function(e){return a(N,e+="")?N[e]:N[e]=j(e)},keyFor:function(e){if(!J(e))throw TypeError(e+" is not a symbol!");for(var t in N)if(N[t]===e)return t},useSetter:function(){B=!0},useSimple:function(){B=!1}}),o(o.S+o.F*!U,"Object",{create:K,defineProperty:Q,defineProperties:Z,getOwnPropertyDescriptor:ee,getOwnPropertyNames:te,getOwnPropertySymbols:ne});var se=l((function(){D.f(1)}));o(o.S+o.F*se,"Object",{getOwnPropertySymbols:function(e){return D.f(b(e))}}),H&&o(o.S+o.F*(!U||l((function(){var e=j();return"[null]"!=C([e])||"{}"!=C({a:e})||"{}"!=C(Object(e))}))),"JSON",{stringify:function(e){var t,n,r=[e],a=1;while(arguments.length>a)r.push(arguments[a++]);if(n=t=r[1],(v(t)||void 0!==e)&&!J(e))return y(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!J(t))return t}),r[1]=t,C.apply(H,r)}}),j[E][F]||n("35e8")(j[E],F,j[E].valueOf),d(j,"Symbol"),d(Math,"Math",!0),d(r.JSON,"JSON",!0)},"01f9":function(e,t,n){"use strict";var r=n("2d00"),a=n("5ca1"),i=n("2aba"),o=n("32e9"),s=n("84f2"),u=n("41a0"),l=n("7f20"),c=n("38fd"),d=n("2b4c")("iterator"),f=!([].keys&&"next"in[].keys()),h="@@iterator",m="keys",p="values",_=function(){return this};e.exports=function(e,t,n,y,g,v,b){u(n,t,y);var M,w,L,k=function(e){if(!f&&e in S)return S[e];switch(e){case m:return function(){return new n(this,e)};case p:return function(){return new n(this,e)}}return function(){return new n(this,e)}},x=t+" Iterator",Y=g==p,D=!1,S=e.prototype,T=S[d]||S[h]||g&&S[g],O=T||k(g),A=g?Y?k("entries"):O:void 0,P="Array"==t&&S.entries||T;if(P&&(L=c(P.call(new e)),L!==Object.prototype&&L.next&&(l(L,x,!0),r||"function"==typeof L[d]||o(L,d,_))),Y&&T&&T.name!==p&&(D=!0,O=function(){return T.call(this)}),r&&!b||!f&&!D&&S[d]||o(S,d,O),s[t]=O,s[x]=_,g)if(M={values:Y?O:k(p),keys:v?O:k(m),entries:A},b)for(w in M)w in S||i(S,w,M[w]);else a(a.P+a.F*(f||D),t,M);return M}},"02f4":function(e,t,n){var r=n("4588"),a=n("be13");e.exports=function(e){return function(t,n){var i,o,s=String(a(t)),u=r(n),l=s.length;return u<0||u>=l?e?"":void 0:(i=s.charCodeAt(u),i<55296||i>56319||u+1===l||(o=s.charCodeAt(u+1))<56320||o>57343?e?s.charAt(u):i:e?s.slice(u,u+2):o-56320+(i-55296<<10)+65536)}}},"02fb":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",ss:"%d സെക്കൻഡ്",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(e,t){return 12===e&&(e=0),"രാത്രി"===t&&e>=4||"ഉച്ച കഴിഞ്ഞ്"===t||"വൈകുന്നേരം"===t?e+12:e},meridiem:function(e,t,n){return e<4?"രാത്രി":e<12?"രാവിലെ":e<17?"ഉച്ച കഴിഞ്ഞ്":e<20?"വൈകുന്നേരം":"രാത്രി"}});return t}))},"0390":function(e,t,n){"use strict";var r=n("02f4")(!0);e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},"0395":function(e,t,n){var r=n("36c3"),a=n("6abf").f,i={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(e){try{return a(e)}catch(t){return o.slice()}};e.exports.f=function(e){return o&&"[object Window]"==i.call(e)?s(e):a(r(e))}},"03ec":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(e){var t=/сехет$/i.exec(e)?"рен":/ҫул$/i.exec(e)?"тан":"ран";return e+t},past:"%s каялла",s:"пӗр-ик ҫеккунт",ss:"%d ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},dayOfMonthOrdinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}});return t}))},"051a":function(e,t,n){var r=s(n("64b2")),a=u(r);t.XML=h(r,a);var i=s(n("f0f2")),o=u(i);function s(e){return Object.keys(e).sort().reduce((function(t,n){return t[e[n]]="&"+n+";",t}),{})}function u(e){var t=[],n=[];return Object.keys(e).forEach((function(e){1===e.length?t.push("\\"+e):n.push(e)})),n.unshift("["+t.join("")+"]"),new RegExp(n.join("|"),"g")}t.HTML=h(i,o);var l=/[^\0-\x7F]/g,c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;function d(e){return"&#x"+e.charCodeAt(0).toString(16).toUpperCase()+";"}function f(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),r=1024*(t-55296)+n-56320+65536;return"&#x"+r.toString(16).toUpperCase()+";"}function h(e,t){function n(t){return e[t]}return function(e){return e.replace(t,n).replace(c,f).replace(l,d)}}var m=u(r);function p(e){return e.replace(m,d).replace(c,f).replace(l,d)}t.escape=p},"0558":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";function t(e){return e%100===11||e%10!==1}function n(e,n,r,a){var i=e+" ";switch(r){case"s":return n||a?"nokkrar sekúndur":"nokkrum sekúndum";case"ss":return t(e)?i+(n||a?"sekúndur":"sekúndum"):i+"sekúnda";case"m":return n?"mínúta":"mínútu";case"mm":return t(e)?i+(n||a?"mínútur":"mínútum"):n?i+"mínúta":i+"mínútu";case"hh":return t(e)?i+(n||a?"klukkustundir":"klukkustundum"):i+"klukkustund";case"d":return n?"dagur":a?"dag":"degi";case"dd":return t(e)?n?i+"dagar":i+(a?"daga":"dögum"):n?i+"dagur":i+(a?"dag":"degi");case"M":return n?"mánuður":a?"mánuð":"mánuði";case"MM":return t(e)?n?i+"mánuðir":i+(a?"mánuði":"mánuðum"):n?i+"mánuður":i+(a?"mánuð":"mánuði");case"y":return n||a?"ár":"ári";case"yy":return t(e)?i+(n||a?"ár":"árum"):i+(n||a?"ár":"ári")}}var r=e.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:n,ss:n,m:n,mm:n,h:"klukkustund",hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return r}))},"0721":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",ss:"%d sekundir",m:"ein minuttur",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaður",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return t}))},"079e":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("ja",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiemParse:/午前|午後/i,isPM:function(e){return"午後"===e},meridiem:function(e,t,n){return e<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:function(e){return e.week()M;M++)if((f||M in g)&&(p=g[M],_=v(p,M,y),e))if(n)w[M]=_;else if(_)switch(e){case 3:return!0;case 5:return p;case 6:return M;case 2:w.push(p)}else if(c)return!1;return d?-1:l||c?c:w}}},"0a84":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:6,doy:12}});return t}))},"0b07":function(e,t,n){var r=n("34ac"),a=n("3698");function i(e,t){var n=a(e,t);return r(n)?n:void 0}e.exports=i},"0bfb":function(e,t,n){"use strict";var r=n("cb7c");e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},"0caa":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";function t(e,t,n,r){var a={s:["thodde secondanim","thodde second"],ss:[e+" secondanim",e+" second"],m:["eka mintan","ek minute"],mm:[e+" mintanim",e+" mintam"],h:["eka voran","ek vor"],hh:[e+" voranim",e+" voram"],d:["eka disan","ek dis"],dd:[e+" disanim",e+" dis"],M:["eka mhoinean","ek mhoino"],MM:[e+" mhoineanim",e+" mhoine"],y:["eka vorsan","ek voros"],yy:[e+" vorsanim",e+" vorsam"]};return t?a[n][0]:a[n][1]}var n=e.defineLocale("gom-latn",{months:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Aitar_Somar_Mongllar_Budvar_Brestar_Sukrar_Son'var".split("_"),weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM[achea] Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"},calendar:{sameDay:"[Aiz] LT",nextDay:"[Faleam] LT",nextWeek:"[Ieta to] dddd[,] LT",lastDay:"[Kal] LT",lastWeek:"[Fatlo] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s adim",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(er)/,ordinal:function(e,t){switch(t){case"D":return e+"er";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:1,doy:4},meridiemParse:/rati|sokalli|donparam|sanje/,meridiemHour:function(e,t){return 12===e&&(e=0),"rati"===t?e<4?e:e+12:"sokalli"===t?e:"donparam"===t?e>12?e:e+12:"sanje"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"rati":e<12?"sokalli":e<16?"donparam":e<20?"sanje":"rati"}});return n}))},"0d58":function(e,t,n){var r=n("ce10"),a=n("e11e");e.exports=Object.keys||function(e){return r(e,a)}},"0e49":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}});return t}))},"0e65":function(e,t,n){"use strict";var r=Date.prototype.getDay,a=function(e){try{return r.call(e),!0}catch(t){return!1}},i=Object.prototype.toString,o="[object Date]",s="function"===typeof Symbol&&"symbol"===typeof Symbol.toStringTag;e.exports=function(e){return"object"===typeof e&&null!==e&&(s?a(e):i.call(e)===o)}},"0e6b":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10,n=1===~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n},week:{dow:1,doy:4}});return t}))},"0e81":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"},n=e.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[gelecek] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",ss:"%d saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'ıncı";var r=e%10,a=e%100-r,i=e>=100?100:null;return e+(t[r]||t[a]||t[i])}},week:{dow:1,doy:7}});return n}))},"0f14":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"på dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[i] dddd[s kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",ss:"%d sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return t}))},"0f38":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}});return t}))},"0f7c":function(e,t,n){"use strict";var r=n("688e");e.exports=Function.prototype.bind||r},"0fc9":function(e,t,n){var r=n("3a38"),a=Math.max,i=Math.min;e.exports=function(e,t){return e=r(e),e<0?a(e+t,0):i(e,t)}},"0ff2":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}});return t}))},"10e8":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),monthsParseExact:!0,weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(e){return"หลังเที่ยง"===e},meridiem:function(e,t,n){return e<12?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",ss:"%d วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}});return t}))},1160:function(e,t){function n(e){if("function"==typeof e)return e;var t=Array.isArray(e)?[]:{};for(var a in e){var i=e[a],o={}.toString.call(i).slice(8,-1);t[a]="Array"==o||"Object"==o?n(i):"Date"==o?new Date(i.getTime()):"RegExp"==o?RegExp(i.source,r(i)):i}return t}function r(e){if("string"==typeof e.source.flags)return e.source.flags;var t=[];return e.global&&t.push("g"),e.ignoreCase&&t.push("i"),e.multiline&&t.push("m"),e.sticky&&t.push("y"),e.unicode&&t.push("u"),t.join("")}e.exports=n},1169:function(e,t,n){var r=n("2d95");e.exports=Array.isArray||function(e){return"Array"==r(e)}},1173:function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},"11e9":function(e,t,n){var r=n("52a7"),a=n("4630"),i=n("6821"),o=n("6a99"),s=n("69a8"),u=n("c69a"),l=Object.getOwnPropertyDescriptor;t.f=n("9e1e")?l:function(e,t){if(e=i(e),t=o(t,!0),u)try{return l(e,t)}catch(n){}if(s(e,t))return a(!r.f.call(e,t),e[t])}},1290:function(e,t){function n(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}e.exports=n},1310:function(e,t){function n(e){return null!=e&&"object"==typeof e}e.exports=n},1368:function(e,t,n){var r=n("da03"),a=function(){var e=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function i(e){return!!a&&a in e}e.exports=i},"13e9":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t={words:{ss:["секунда","секунде","секунди"],m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,r){var a=t.words[r];return 1===r.length?n?a[0]:a[1]:e+" "+t.correctGrammaticalCase(e,a)}},n=e.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){var e=["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"];return e[this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"дан",dd:t.translate,M:"месец",MM:t.translate,y:"годину",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}});return n}))},1495:function(e,t,n){var r=n("86cc"),a=n("cb7c"),i=n("0d58");e.exports=n("9e1e")?Object.defineProperties:function(e,t){a(e);var n,o=i(t),s=o.length,u=0;while(s>u)r.f(e,n=o[u++],t[n]);return e}},1654:function(e,t,n){"use strict";var r=n("71c1")(!0);n("30f1")(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})}))},1691:function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},1696:function(e,t,n){"use strict";e.exports=function(){if("function"!==typeof Symbol||"function"!==typeof Object.getOwnPropertySymbols)return!1;if("symbol"===typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"===typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;var r=42;for(t in e[t]=r,e)return!1;if("function"===typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"===typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var a=Object.getOwnPropertySymbols(e);if(1!==a.length||a[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"===typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(i.value!==r||!0!==i.enumerable)return!1}return!0}},"18d8":function(e,t,n){var r=n("234d"),a=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,o=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(a,(function(e,n,r,a){t.push(r?a.replace(i,"$1"):n||e)})),t}));e.exports=o},1991:function(e,t,n){var r,a,i,o=n("9b43"),s=n("31f4"),u=n("fab2"),l=n("230e"),c=n("7726"),d=c.process,f=c.setImmediate,h=c.clearImmediate,m=c.MessageChannel,p=c.Dispatch,_=0,y={},g="onreadystatechange",v=function(){var e=+this;if(y.hasOwnProperty(e)){var t=y[e];delete y[e],t()}},b=function(e){v.call(e.data)};f&&h||(f=function(e){var t=[],n=1;while(arguments.length>n)t.push(arguments[n++]);return y[++_]=function(){s("function"==typeof e?e:Function(e),t)},r(_),_},h=function(e){delete y[e]},"process"==n("2d95")(d)?r=function(e){d.nextTick(o(v,e,1))}:p&&p.now?r=function(e){p.now(o(v,e,1))}:m?(a=new m,i=a.port2,a.port1.onmessage=b,r=o(i.postMessage,i,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(r=function(e){c.postMessage(e+"","*")},c.addEventListener("message",b,!1)):r=g in l("script")?function(e){u.appendChild(l("script"))[g]=function(){u.removeChild(this),v.call(e)}}:function(e){setTimeout(o(v,e,1),0)}),e.exports={set:f,clear:h}},"1a8c":function(e,t){function n(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=n},"1af6":function(e,t,n){var r=n("63b6");r(r.S,"Array",{isArray:n("9003")})},"1b45":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("mt",{months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Illum fil-]LT",nextDay:"[Għada fil-]LT",nextWeek:"dddd [fil-]LT",lastDay:"[Il-bieraħ fil-]LT",lastWeek:"dddd [li għadda] [fil-]LT",sameElse:"L"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",ss:"%d sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}});return t}))},"1bc3":function(e,t,n){var r=n("f772");e.exports=function(e,t){if(!r(e))return e;var n,a;if(t&&"function"==typeof(n=e.toString)&&!r(a=n.call(e)))return a;if("function"==typeof(n=e.valueOf)&&!r(a=n.call(e)))return a;if(!t&&"function"==typeof(n=e.toString)&&!r(a=n.call(e)))return a;throw TypeError("Can't convert object to primitive value")}},"1c7e":function(e,t,n){"use strict";var r=n("f367").supportsDescriptors,a=n("57ec"),i=Object.getOwnPropertyDescriptor,o=Object.defineProperty,s=TypeError,u=Object.getPrototypeOf,l=/a/;e.exports=function(){if(!r||!u)throw new s("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=a(),t=u(l),n=i(t,"flags");return n&&n.get===e||o(t,"flags",{configurable:!0,enumerable:!1,get:e}),e}},"1cfd":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},n=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},r={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},a=function(e){return function(t,a,i,o){var s=n(t),u=r[e][n(t)];return 2===s&&(u=u[a?0:1]),u.replace(/%d/i,t)}},i=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"],o=e.defineLocale("ar-ly",{months:i,monthsShort:i,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:a("s"),ss:a("s"),m:a("m"),mm:a("m"),h:a("h"),hh:a("h"),d:a("d"),dd:a("d"),M:a("M"),MM:a("M"),y:a("y"),yy:a("y")},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}});return o}))},"1ec9":function(e,t,n){var r=n("f772"),a=n("e53d").document,i=r(a)&&r(a.createElement);e.exports=function(e){return i?a.createElement(e):{}}},"1efc":function(e,t){function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}e.exports=n},"1fa8":function(e,t,n){var r=n("cb7c");e.exports=function(e,t,n,a){try{return a?t(r(n)[0],n[1]):t(n)}catch(o){var i=e["return"];throw void 0!==i&&r(i.call(e)),o}}},"1fc1":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";function t(e,t){var n=e.split("_");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}function n(e,n,r){var a={ss:n?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:n?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:n?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"};return"m"===r?n?"хвіліна":"хвіліну":"h"===r?n?"гадзіна":"гадзіну":e+" "+t(a[r],+e)}var r=e.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:n,mm:n,h:n,hh:n,d:"дзень",dd:n,M:"месяц",MM:n,y:"год",yy:n},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(e){return/^(дня|вечара)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночы":e<12?"раніцы":e<17?"дня":"вечара"},dayOfMonthOrdinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e%10!==2&&e%10!==3||e%100===12||e%100===13?e+"-ы":e+"-і";case"D":return e+"-га";default:return e}},week:{dow:1,doy:7}});return r}))},"1fc8":function(e,t,n){var r=n("4245");function a(e,t){var n=r(this,e),a=n.size;return n.set(e,t),this.size+=n.size==a?0:1,this}e.exports=a},"201b":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("ka",{months:{standalone:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),format:"იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს".split("_")},monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(e){return/(წამი|წუთი|საათი|წელი)/.test(e)?e.replace(/ი$/,"ში"):e+"ში"},past:function(e){return/(წამი|წუთი|საათი|დღე|თვე)/.test(e)?e.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(e)?e.replace(/წელი$/,"წლის წინ"):void 0},s:"რამდენიმე წამი",ss:"%d წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},dayOfMonthOrdinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(e){return 0===e?e:1===e?e+"-ლი":e<20||e<=100&&e%20===0||e%100===0?"მე-"+e:e+"-ე"},week:{dow:1,doy:7}});return t}))},"20fd":function(e,t,n){"use strict";var r=n("d9f6"),a=n("aebd");e.exports=function(e,t,n){t in e?r.f(e,t,a(0,n)):e[t]=n}},2103:function(e,t,n){!function(t,n){e.exports=n()}(0,(function(){var e="__v-click-outside",t="undefined"!=typeof window,n="undefined"!=typeof navigator,r=t&&("ontouchstart"in window||n&&navigator.msMaxTouchPoints>0)?["touchstart"]:["click"];function a(t,n){var a=function(e){var t="function"==typeof e;if(!t&&"object"!=typeof e)throw new Error("v-click-outside: Binding value must be a function or an object");return{handler:t?e:e.handler,middleware:e.middleware||function(e){return e},events:e.events||r,isActive:!(!1===e.isActive)}}(n.value),i=a.handler,o=a.middleware;a.isActive&&(t[e]=a.events.map((function(e){return{event:e,handler:function(e){return function(e){var t=e.el,n=e.event,r=e.handler,a=e.middleware;n.target!==t&&!t.contains(n.target)&&a(n,t)&&r(n,t)}({event:e,el:t,handler:i,middleware:o})}}})),t[e].forEach((function(e){var t=e.event,n=e.handler;return setTimeout((function(){return document.documentElement.addEventListener(t,n,!1)}),0)})))}function i(t){(t[e]||[]).forEach((function(e){return document.documentElement.removeEventListener(e.event,e.handler,!1)})),delete t[e]}var o={bind:a,update:function(e,t){var n=t.value,r=t.oldValue;JSON.stringify(n)!==JSON.stringify(r)&&(i(e),a(e,{value:n}))},unbind:i};return{install:function(e){e.directive("click-outside",o)},directive:o}}))},"214f":function(e,t,n){"use strict";n("b0c5");var r=n("2aba"),a=n("32e9"),i=n("79e5"),o=n("be13"),s=n("2b4c"),u=n("520a"),l=s("species"),c=!i((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")})),d=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();e.exports=function(e,t,n){var f=s(e),h=!i((function(){var t={};return t[f]=function(){return 7},7!=""[e](t)})),m=h?!i((function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[l]=function(){return n}),n[f](""),!t})):void 0;if(!h||!m||"replace"===e&&!c||"split"===e&&!d){var p=/./[f],_=n(o,f,""[e],(function(e,t,n,r,a){return t.exec===u?h&&!a?{done:!0,value:p.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}})),y=_[0],g=_[1];r(String.prototype,e,y),a(RegExp.prototype,f,2==t?function(e,t){return g.call(e,this,t)}:function(e){return g.call(e,this)})}}},"22f8":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",ss:"%d초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"},dayOfMonthOrdinalParse:/\d{1,2}(일|월|주)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"일";case"M":return e+"월";case"w":case"W":return e+"주";default:return e}},meridiemParse:/오전|오후/,isPM:function(e){return"오후"===e},meridiem:function(e,t,n){return e<12?"오전":"오후"}});return t}))},"230e":function(e,t,n){var r=n("d3f4"),a=n("7726").document,i=r(a)&&r(a.createElement);e.exports=function(e){return i?a.createElement(e):{}}},"234d":function(e,t,n){var r=n("e380"),a=500;function i(e){var t=r(e,(function(e){return n.size===a&&n.clear(),e})),n=t.cache;return t}e.exports=i},"23c6":function(e,t,n){var r=n("2d95"),a=n("2b4c")("toStringTag"),i="Arguments"==r(function(){return arguments}()),o=function(e,t){try{return e[t]}catch(n){}};e.exports=function(e){var t,n,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=o(t=Object(e),a))?n:i?r(t):"Object"==(s=r(t))&&"function"==typeof t.callee?"Arguments":s}},"241e":function(e,t,n){var r=n("25eb");e.exports=function(e){return Object(r(e))}},2421:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},r=["کانونی دووەم","شوبات","ئازار","نیسان","ئایار","حوزەیران","تەمموز","ئاب","ئەیلوول","تشرینی یەكەم","تشرینی دووەم","كانونی یەکەم"],a=e.defineLocale("ku",{months:r,monthsShort:r,weekdays:"یه‌كشه‌ممه‌_دووشه‌ممه‌_سێشه‌ممه‌_چوارشه‌ممه‌_پێنجشه‌ممه‌_هه‌ینی_شه‌ممه‌".split("_"),weekdaysShort:"یه‌كشه‌م_دووشه‌م_سێشه‌م_چوارشه‌م_پێنجشه‌م_هه‌ینی_شه‌ممه‌".split("_"),weekdaysMin:"ی_د_س_چ_پ_ه_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ئێواره‌|به‌یانی/,isPM:function(e){return/ئێواره‌/.test(e)},meridiem:function(e,t,n){return e<12?"به‌یانی":"ئێواره‌"},calendar:{sameDay:"[ئه‌مرۆ كاتژمێر] LT",nextDay:"[به‌یانی كاتژمێر] LT",nextWeek:"dddd [كاتژمێر] LT",lastDay:"[دوێنێ كاتژمێر] LT",lastWeek:"dddd [كاتژمێر] LT",sameElse:"L"},relativeTime:{future:"له‌ %s",past:"%s",s:"چه‌ند چركه‌یه‌ك",ss:"چركه‌ %d",m:"یه‌ك خوله‌ك",mm:"%d خوله‌ك",h:"یه‌ك كاتژمێر",hh:"%d كاتژمێر",d:"یه‌ك ڕۆژ",dd:"%d ڕۆژ",M:"یه‌ك مانگ",MM:"%d مانگ",y:"یه‌ك ساڵ",yy:"%d ساڵ"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}});return a}))},2478:function(e,t,n){var r=n("4245");function a(e){return r(this,e).get(e)}e.exports=a},"24c5":function(e,t,n){"use strict";var r,a,i,o,s=n("b8e3"),u=n("e53d"),l=n("d864"),c=n("40c3"),d=n("63b6"),f=n("f772"),h=n("79aa"),m=n("1173"),p=n("a22a"),_=n("f201"),y=n("4178").set,g=n("aba2")(),v=n("656e"),b=n("4439"),M=n("bc13"),w=n("cd78"),L="Promise",k=u.TypeError,x=u.process,Y=x&&x.versions,D=Y&&Y.v8||"",S=u[L],T="process"==c(x),O=function(){},A=a=v.f,P=!!function(){try{var e=S.resolve(1),t=(e.constructor={})[n("5168")("species")]=function(e){e(O,O)};return(T||"function"==typeof PromiseRejectionEvent)&&e.then(O)instanceof t&&0!==D.indexOf("6.6")&&-1===M.indexOf("Chrome/66")}catch(r){}}(),j=function(e){var t;return!(!f(e)||"function"!=typeof(t=e.then))&&t},H=function(e,t){if(!e._n){e._n=!0;var n=e._c;g((function(){var r=e._v,a=1==e._s,i=0,o=function(t){var n,i,o,s=a?t.ok:t.fail,u=t.resolve,l=t.reject,c=t.domain;try{s?(a||(2==e._h&&z(e),e._h=1),!0===s?n=r:(c&&c.enter(),n=s(r),c&&(c.exit(),o=!0)),n===t.promise?l(k("Promise-chain cycle")):(i=j(n))?i.call(n,u,l):u(n)):l(r)}catch(d){c&&!o&&c.exit(),l(d)}};while(n.length>i)o(n[i++]);e._c=[],e._n=!1,t&&!e._h&&C(e)}))}},C=function(e){y.call(u,(function(){var t,n,r,a=e._v,i=E(e);if(i&&(t=b((function(){T?x.emit("unhandledRejection",a,e):(n=u.onunhandledrejection)?n({promise:e,reason:a}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",a)})),e._h=T||E(e)?2:1),e._a=void 0,i&&t.e)throw t.v}))},E=function(e){return 1!==e._h&&0===(e._a||e._c).length},z=function(e){y.call(u,(function(){var t;T?x.emit("rejectionHandled",e):(t=u.onrejectionhandled)&&t({promise:e,reason:e._v})}))},F=function(e){var t=this;t._d||(t._d=!0,t=t._w||t,t._v=e,t._s=2,t._a||(t._a=t._c.slice()),H(t,!0))},I=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw k("Promise can't be resolved itself");(t=j(e))?g((function(){var r={_w:n,_d:!1};try{t.call(e,l(I,r,1),l(F,r,1))}catch(a){F.call(r,a)}})):(n._v=e,n._s=1,H(n,!1))}catch(r){F.call({_w:n,_d:!1},r)}}};P||(S=function(e){m(this,S,L,"_h"),h(e),r.call(this);try{e(l(I,this,1),l(F,this,1))}catch(t){F.call(this,t)}},r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n("5c95")(S.prototype,{then:function(e,t){var n=A(_(this,S));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=T?x.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&H(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new r;this.promise=e,this.resolve=l(I,e,1),this.reject=l(F,e,1)},v.f=A=function(e){return e===S||e===o?new i(e):a(e)}),d(d.G+d.W+d.F*!P,{Promise:S}),n("45f2")(S,L),n("4c95")(L),o=n("584a")[L],d(d.S+d.F*!P,L,{reject:function(e){var t=A(this),n=t.reject;return n(e),t.promise}}),d(d.S+d.F*(s||!P),L,{resolve:function(e){return w(s&&this===o?S:this,e)}}),d(d.S+d.F*!(P&&n("4ee1")((function(e){S.all(e)["catch"](O)}))),L,{all:function(e){var t=this,n=A(t),r=n.resolve,a=n.reject,i=b((function(){var n=[],i=0,o=1;p(e,!1,(function(e){var s=i++,u=!1;n.push(void 0),o++,t.resolve(e).then((function(e){u||(u=!0,n[s]=e,--o||r(n))}),a)})),--o||r(n)}));return i.e&&a(i.v),n.promise},race:function(e){var t=this,n=A(t),r=n.reject,a=b((function(){p(e,!1,(function(e){t.resolve(e).then(n.resolve,r)}))}));return a.e&&r(a.v),n.promise}})},2524:function(e,t,n){var r=n("6044"),a="__lodash_hash_undefined__";function i(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?a:t,this}e.exports=i},2554:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";function t(e,t,n){var r=e+" ";switch(n){case"ss":return r+=1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi",r;case"m":return t?"jedna minuta":"jedne minute";case"mm":return r+=1===e?"minuta":2===e||3===e||4===e?"minute":"minuta",r;case"h":return t?"jedan sat":"jednog sata";case"hh":return r+=1===e?"sat":2===e||3===e||4===e?"sata":"sati",r;case"dd":return r+=1===e?"dan":"dana",r;case"MM":return r+=1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci",r;case"yy":return r+=1===e?"godina":2===e||3===e||4===e?"godine":"godina",r}}var n=e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}});return n}))},"25eb":function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},2621:function(e,t){t.f=Object.getOwnPropertySymbols},"26f9":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t={ss:"sekundė_sekundžių_sekundes",m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"};function n(e,t,n,r){return t?"kelios sekundės":r?"kelių sekundžių":"kelias sekundes"}function r(e,t,n,r){return t?i(n)[0]:r?i(n)[1]:i(n)[2]}function a(e){return e%10===0||e>10&&e<20}function i(e){return t[e].split("_")}function o(e,t,n,o){var s=e+" ";return 1===e?s+r(e,t,n[0],o):t?s+(a(e)?i(n)[1]:i(n)[0]):o?s+i(n)[1]:s+(a(e)?i(n)[1]:i(n)[2])}var s=e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:n,ss:o,m:r,mm:o,h:r,hh:o,d:r,dd:o,M:r,MM:o,y:r,yy:o},dayOfMonthOrdinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}});return s}))},"27ee":function(e,t,n){var r=n("23c6"),a=n("2b4c")("iterator"),i=n("84f2");e.exports=n("8378").getIteratorMethod=function(e){if(void 0!=e)return e[a]||e["@@iterator"]||i[r(e)]}},2877:function(e,t,n){"use strict";function r(e,t,n,r,a,i,o,s){var u,l="function"===typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),r&&(l.functional=!0),i&&(l._scopeId="data-v-"+i),o?(u=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),a&&a.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},l._ssrRegister=u):a&&(u=s?function(){a.call(this,this.$root.$options.shadowRoot)}:a),u)if(l.functional){l._injectStyles=u;var c=l.render;l.render=function(e,t){return u.call(t),c(e,t)}}else{var d=l.beforeCreate;l.beforeCreate=d?[].concat(d,u):[u]}return{exports:e,options:l}}n.d(t,"a",(function(){return r}))},"28a5":function(e,t,n){"use strict";var r=n("aae3"),a=n("cb7c"),i=n("ebd6"),o=n("0390"),s=n("9def"),u=n("5f1b"),l=n("520a"),c=n("79e5"),d=Math.min,f=[].push,h="split",m="length",p="lastIndex",_=4294967295,y=!c((function(){RegExp(_,"y")}));n("214f")("split",2,(function(e,t,n,c){var g;return g="c"=="abbc"[h](/(b)*/)[1]||4!="test"[h](/(?:)/,-1)[m]||2!="ab"[h](/(?:ab)*/)[m]||4!="."[h](/(.?)(.?)/)[m]||"."[h](/()()/)[m]>1||""[h](/.?/)[m]?function(e,t){var a=String(this);if(void 0===e&&0===t)return[];if(!r(e))return n.call(a,e,t);var i,o,s,u=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),d=0,h=void 0===t?_:t>>>0,y=new RegExp(e.source,c+"g");while(i=l.call(y,a)){if(o=y[p],o>d&&(u.push(a.slice(d,i.index)),i[m]>1&&i.index=h))break;y[p]===i.index&&y[p]++}return d===a[m]?!s&&y.test("")||u.push(""):u.push(a.slice(d)),u[m]>h?u.slice(0,h):u}:"0"[h](void 0,0)[m]?function(e,t){return void 0===e&&0===t?[]:n.call(this,e,t)}:n,[function(n,r){var a=e(this),i=void 0==n?void 0:n[t];return void 0!==i?i.call(n,a,r):g.call(String(a),n,r)},function(e,t){var r=c(g,e,this,t,g!==n);if(r.done)return r.value;var l=a(e),f=String(this),h=i(l,RegExp),m=l.unicode,p=(l.ignoreCase?"i":"")+(l.multiline?"m":"")+(l.unicode?"u":"")+(y?"y":"g"),v=new h(y?l:"^(?:"+l.source+")",p),b=void 0===t?_:t>>>0;if(0===b)return[];if(0===f.length)return null===u(v,f)?[f]:[];var M=0,w=0,L=[];while(w=2&&e<=4?t[1]:t[2]},translate:function(e,n,r){var a=t.words[r];return 1===r.length?n?a[0]:a[1]:e+" "+t.correctGrammaticalCase(e,a)}},n=e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){var e=["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"];return e[this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mjesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}});return n}))},"294c":function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},"29f3":function(e,t){var n=Object.prototype,r=n.toString;function a(e){return r.call(e)}e.exports=a},"2aba":function(e,t,n){var r=n("7726"),a=n("32e9"),i=n("69a8"),o=n("ca5a")("src"),s=n("fa5b"),u="toString",l=(""+s).split(u);n("8378").inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var u="function"==typeof n;u&&(i(n,"name")||a(n,"name",t)),e[t]!==n&&(u&&(i(n,o)||a(n,o,e[t]?""+e[t]:l.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:a(e,t,n):(delete e[t],a(e,t,n)))})(Function.prototype,u,(function(){return"function"==typeof this&&this[o]||s.call(this)}))},"2aeb":function(e,t,n){var r=n("cb7c"),a=n("1495"),i=n("e11e"),o=n("613b")("IE_PROTO"),s=function(){},u="prototype",l=function(){var e,t=n("230e")("iframe"),r=i.length,a="<",o=">";t.style.display="none",n("fab2").appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(a+"script"+o+"document.F=Object"+a+"/script"+o),e.close(),l=e.F;while(r--)delete l[u][i[r]];return l()};e.exports=Object.create||function(e,t){var n;return null!==e?(s[u]=r(e),n=new s,s[u]=null,n[o]=e):n=l(),void 0===t?n:a(n,t)}},"2b0e":function(e,t,n){"use strict";(function(e){ +/*! + * Vue.js v2.6.11 + * (c) 2014-2019 Evan You + * Released under the MIT License. + */ +var n=Object.freeze({});function r(e){return void 0===e||null===e}function a(e){return void 0!==e&&null!==e}function i(e){return!0===e}function o(e){return!1===e}function s(e){return"string"===typeof e||"number"===typeof e||"symbol"===typeof e||"boolean"===typeof e}function u(e){return null!==e&&"object"===typeof e}var l=Object.prototype.toString;function c(e){return"[object Object]"===l.call(e)}function d(e){return"[object RegExp]"===l.call(e)}function f(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function h(e){return a(e)&&"function"===typeof e.then&&"function"===typeof e.catch}function m(e){return null==e?"":Array.isArray(e)||c(e)&&e.toString===l?JSON.stringify(e,null,2):String(e)}function p(e){var t=parseFloat(e);return isNaN(t)?e:t}function _(e,t){for(var n=Object.create(null),r=e.split(","),a=0;a-1)return e.splice(n,1)}}var v=Object.prototype.hasOwnProperty;function b(e,t){return v.call(e,t)}function M(e){var t=Object.create(null);return function(n){var r=t[n];return r||(t[n]=e(n))}}var w=/-(\w)/g,L=M((function(e){return e.replace(w,(function(e,t){return t?t.toUpperCase():""}))})),k=M((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),x=/\B([A-Z])/g,Y=M((function(e){return e.replace(x,"-$1").toLowerCase()}));function D(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n}function S(e,t){return e.bind(t)}var T=Function.prototype.bind?S:D;function O(e,t){t=t||0;var n=e.length-t,r=new Array(n);while(n--)r[n]=e[n+t];return r}function A(e,t){for(var n in t)e[n]=t[n];return e}function P(e){for(var t={},n=0;n0,ne=X&&X.indexOf("edge/")>0,re=(X&&X.indexOf("android"),X&&/iphone|ipad|ipod|ios/.test(X)||"ios"===K),ae=(X&&/chrome\/\d+/.test(X),X&&/phantomjs/.test(X),X&&X.match(/firefox\/(\d+)/)),ie={}.watch,oe=!1;if(Q)try{var se={};Object.defineProperty(se,"passive",{get:function(){oe=!0}}),window.addEventListener("test-passive",null,se)}catch(Lo){}var ue=function(){return void 0===G&&(G=!Q&&!Z&&"undefined"!==typeof e&&(e["process"]&&"server"===e["process"].env.VUE_ENV)),G},le=Q&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ce(e){return"function"===typeof e&&/native code/.test(e.toString())}var de,fe="undefined"!==typeof Symbol&&ce(Symbol)&&"undefined"!==typeof Reflect&&ce(Reflect.ownKeys);de="undefined"!==typeof Set&&ce(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var he=j,me=0,pe=function(){this.id=me++,this.subs=[]};pe.prototype.addSub=function(e){this.subs.push(e)},pe.prototype.removeSub=function(e){g(this.subs,e)},pe.prototype.depend=function(){pe.target&&pe.target.addDep(this)},pe.prototype.notify=function(){var e=this.subs.slice();for(var t=0,n=e.length;t-1)if(i&&!b(a,"default"))o=!1;else if(""===o||o===Y(e)){var u=et(String,a.type);(u<0||s0&&(o=Dt(o,(t||"")+"_"+n),Yt(o[0])&&Yt(l)&&(c[u]=we(l.text+o[0].text),o.shift()),c.push.apply(c,o)):s(o)?Yt(l)?c[u]=we(l.text+o):""!==o&&c.push(we(o)):Yt(o)&&Yt(l)?c[u]=we(l.text+o.text):(i(e._isVList)&&a(o.tag)&&r(o.key)&&a(t)&&(o.key="__vlist"+t+"_"+n+"__"),c.push(o)));return c}function St(e){var t=e.$options.provide;t&&(e._provided="function"===typeof t?t.call(e):t)}function Tt(e){var t=Ot(e.$options.inject,e);t&&(Te(!1),Object.keys(t).forEach((function(n){He(e,n,t[n])})),Te(!0))}function Ot(e,t){if(e){for(var n=Object.create(null),r=fe?Reflect.ownKeys(e):Object.keys(e),a=0;a0,o=e?!!e.$stable:!i,s=e&&e.$key;if(e){if(e._normalized)return e._normalized;if(o&&r&&r!==n&&s===r.$key&&!i&&!r.$hasNormal)return r;for(var u in a={},e)e[u]&&"$"!==u[0]&&(a[u]=Ht(t,u,e[u]))}else a={};for(var l in t)l in a||(a[l]=Ct(t,l));return e&&Object.isExtensible(e)&&(e._normalized=a),$(a,"$stable",o),$(a,"$key",s),$(a,"$hasNormal",i),a}function Ht(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({});return e=e&&"object"===typeof e&&!Array.isArray(e)?[e]:xt(e),e&&(0===e.length||1===e.length&&e[0].isComment)?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function Ct(e,t){return function(){return e[t]}}function Et(e,t){var n,r,i,o,s;if(Array.isArray(e)||"string"===typeof e)for(n=new Array(e.length),r=0,i=e.length;r1?O(n):n;for(var r=O(arguments,1),a='event handler for "'+e+'"',i=0,o=n.length;idocument.createEvent("Event").timeStamp&&(Gn=function(){return Jn.now()})}function Qn(){var e,t;for(qn=Gn(),Un=!0,Nn.sort((function(e,t){return e.id-t.id})),$n=0;$n$n&&Nn[n].id>e.id)n--;Nn.splice(n+1,0,e)}else Nn.push(e);Vn||(Vn=!0,mt(Qn))}}var tr=0,nr=function(e,t,n,r,a){this.vm=e,a&&(e._watcher=this),e._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++tr,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new de,this.newDepIds=new de,this.expression="","function"===typeof t?this.getter=t:(this.getter=q(t),this.getter||(this.getter=j)),this.value=this.lazy?void 0:this.get()};nr.prototype.get=function(){var e;ye(this);var t=this.vm;try{e=this.getter.call(t,t)}catch(Lo){if(!this.user)throw Lo;tt(Lo,t,'getter for watcher "'+this.expression+'"')}finally{this.deep&&_t(e),ge(),this.cleanupDeps()}return e},nr.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},nr.prototype.cleanupDeps=function(){var e=this.deps.length;while(e--){var t=this.deps[e];this.newDepIds.has(t.id)||t.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},nr.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():er(this)},nr.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||u(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(Lo){tt(Lo,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},nr.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},nr.prototype.depend=function(){var e=this.deps.length;while(e--)this.deps[e].depend()},nr.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||g(this.vm._watchers,this);var e=this.deps.length;while(e--)this.deps[e].removeSub(this);this.active=!1}};var rr={enumerable:!0,configurable:!0,get:j,set:j};function ar(e,t,n){rr.get=function(){return this[t][n]},rr.set=function(e){this[t][n]=e},Object.defineProperty(e,n,rr)}function ir(e){e._watchers=[];var t=e.$options;t.props&&or(e,t.props),t.methods&&mr(e,t.methods),t.data?sr(e):je(e._data={},!0),t.computed&&cr(e,t.computed),t.watch&&t.watch!==ie&&pr(e,t.watch)}function or(e,t){var n=e.$options.propsData||{},r=e._props={},a=e.$options._propKeys=[],i=!e.$parent;i||Te(!1);var o=function(i){a.push(i);var o=Qe(i,t,n,e);He(r,i,o),i in e||ar(e,"_props",i)};for(var s in t)o(s);Te(!0)}function sr(e){var t=e.$options.data;t=e._data="function"===typeof t?ur(t,e):t||{},c(t)||(t={});var n=Object.keys(t),r=e.$options.props,a=(e.$options.methods,n.length);while(a--){var i=n[a];0,r&&b(r,i)||U(i)||ar(e,"_data",i)}je(t,!0)}function ur(e,t){ye();try{return e.call(t,t)}catch(Lo){return tt(Lo,t,"data()"),{}}finally{ge()}}var lr={lazy:!0};function cr(e,t){var n=e._computedWatchers=Object.create(null),r=ue();for(var a in t){var i=t[a],o="function"===typeof i?i:i.get;0,r||(n[a]=new nr(e,o||j,j,lr)),a in e||dr(e,a,i)}}function dr(e,t,n){var r=!ue();"function"===typeof n?(rr.get=r?fr(t):hr(n),rr.set=j):(rr.get=n.get?r&&!1!==n.cache?fr(t):hr(n.get):j,rr.set=n.set||j),Object.defineProperty(e,t,rr)}function fr(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),pe.target&&t.depend(),t.value}}function hr(e){return function(){return e.call(this,this)}}function mr(e,t){e.$options.props;for(var n in t)e[n]="function"!==typeof t[n]?j:T(t[n],e)}function pr(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var a=0;a-1)return this;var n=O(arguments,1);return n.unshift(this),"function"===typeof e.install?e.install.apply(e,n):"function"===typeof e&&e.apply(null,n),t.push(e),this}}function xr(e){e.mixin=function(e){return this.options=Ge(this.options,e),this}}function Yr(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,a=e._Ctor||(e._Ctor={});if(a[r])return a[r];var i=e.name||n.options.name;var o=function(e){this._init(e)};return o.prototype=Object.create(n.prototype),o.prototype.constructor=o,o.cid=t++,o.options=Ge(n.options,e),o["super"]=n,o.options.props&&Dr(o),o.options.computed&&Sr(o),o.extend=n.extend,o.mixin=n.mixin,o.use=n.use,N.forEach((function(e){o[e]=n[e]})),i&&(o.options.components[i]=o),o.superOptions=n.options,o.extendOptions=e,o.sealedOptions=A({},o.options),a[r]=o,o}}function Dr(e){var t=e.options.props;for(var n in t)ar(e.prototype,"_props",n)}function Sr(e){var t=e.options.computed;for(var n in t)dr(e.prototype,n,t[n])}function Tr(e){N.forEach((function(t){e[t]=function(e,n){return n?("component"===t&&c(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"===typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}}))}function Or(e){return e&&(e.Ctor.options.name||e.tag)}function Ar(e,t){return Array.isArray(e)?e.indexOf(t)>-1:"string"===typeof e?e.split(",").indexOf(t)>-1:!!d(e)&&e.test(t)}function Pr(e,t){var n=e.cache,r=e.keys,a=e._vnode;for(var i in n){var o=n[i];if(o){var s=Or(o.componentOptions);s&&!t(s)&&jr(n,i,r,a)}}}function jr(e,t,n,r){var a=e[t];!a||r&&a.tag===r.tag||a.componentInstance.$destroy(),e[t]=null,g(n,t)}vr(Lr),yr(Lr),Tn(Lr),jn(Lr),gn(Lr);var Hr=[String,RegExp,Array],Cr={name:"keep-alive",abstract:!0,props:{include:Hr,exclude:Hr,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)jr(this.cache,e,this.keys)},mounted:function(){var e=this;this.$watch("include",(function(t){Pr(e,(function(e){return Ar(t,e)}))})),this.$watch("exclude",(function(t){Pr(e,(function(e){return!Ar(t,e)}))}))},render:function(){var e=this.$slots.default,t=Ln(e),n=t&&t.componentOptions;if(n){var r=Or(n),a=this,i=a.include,o=a.exclude;if(i&&(!r||!Ar(i,r))||o&&r&&Ar(o,r))return t;var s=this,u=s.cache,l=s.keys,c=null==t.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):t.key;u[c]?(t.componentInstance=u[c].componentInstance,g(l,c),l.push(c)):(u[c]=t,l.push(c),this.max&&l.length>parseInt(this.max)&&jr(u,l[0],l,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}},Er={KeepAlive:Cr};function zr(e){var t={get:function(){return R}};Object.defineProperty(e,"config",t),e.util={warn:he,extend:A,mergeOptions:Ge,defineReactive:He},e.set=Ce,e.delete=Ee,e.nextTick=mt,e.observable=function(e){return je(e),e},e.options=Object.create(null),N.forEach((function(t){e.options[t+"s"]=Object.create(null)})),e.options._base=e,A(e.options.components,Er),kr(e),xr(e),Yr(e),Tr(e)}zr(Lr),Object.defineProperty(Lr.prototype,"$isServer",{get:ue}),Object.defineProperty(Lr.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Lr,"FunctionalRenderContext",{value:Zt}),Lr.version="2.6.11";var Fr=_("style,class"),Ir=_("input,textarea,option,select,progress"),Nr=function(e,t,n){return"value"===n&&Ir(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},Wr=_("contenteditable,draggable,spellcheck"),Rr=_("events,caret,typing,plaintext-only"),Vr=function(e,t){return Gr(t)||"false"===t?"false":"contenteditable"===e&&Rr(t)?t:"true"},Ur=_("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),$r="http://www.w3.org/1999/xlink",Br=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},qr=function(e){return Br(e)?e.slice(6,e.length):""},Gr=function(e){return null==e||!1===e};function Jr(e){var t=e.data,n=e,r=e;while(a(r.componentInstance))r=r.componentInstance._vnode,r&&r.data&&(t=Qr(r.data,t));while(a(n=n.parent))n&&n.data&&(t=Qr(t,n.data));return Zr(t.staticClass,t.class)}function Qr(e,t){return{staticClass:Kr(e.staticClass,t.staticClass),class:a(e.class)?[e.class,t.class]:t.class}}function Zr(e,t){return a(e)||a(t)?Kr(e,Xr(t)):""}function Kr(e,t){return e?t?e+" "+t:e:t||""}function Xr(e){return Array.isArray(e)?ea(e):u(e)?ta(e):"string"===typeof e?e:""}function ea(e){for(var t,n="",r=0,i=e.length;r-1?sa[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:sa[e]=/HTMLUnknownElement/.test(t.toString())}var la=_("text,number,password,search,email,tel,url");function ca(e){if("string"===typeof e){var t=document.querySelector(e);return t||document.createElement("div")}return e}function da(e,t){var n=document.createElement(e);return"select"!==e?n:(t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)}function fa(e,t){return document.createElementNS(na[e],t)}function ha(e){return document.createTextNode(e)}function ma(e){return document.createComment(e)}function pa(e,t,n){e.insertBefore(t,n)}function _a(e,t){e.removeChild(t)}function ya(e,t){e.appendChild(t)}function ga(e){return e.parentNode}function va(e){return e.nextSibling}function ba(e){return e.tagName}function Ma(e,t){e.textContent=t}function wa(e,t){e.setAttribute(t,"")}var La=Object.freeze({createElement:da,createElementNS:fa,createTextNode:ha,createComment:ma,insertBefore:pa,removeChild:_a,appendChild:ya,parentNode:ga,nextSibling:va,tagName:ba,setTextContent:Ma,setStyleScope:wa}),ka={create:function(e,t){xa(t)},update:function(e,t){e.data.ref!==t.data.ref&&(xa(e,!0),xa(t))},destroy:function(e){xa(e,!0)}};function xa(e,t){var n=e.data.ref;if(a(n)){var r=e.context,i=e.componentInstance||e.elm,o=r.$refs;t?Array.isArray(o[n])?g(o[n],i):o[n]===i&&(o[n]=void 0):e.data.refInFor?Array.isArray(o[n])?o[n].indexOf(i)<0&&o[n].push(i):o[n]=[i]:o[n]=i}}var Ya=new ve("",{},[]),Da=["create","activate","update","remove","destroy"];function Sa(e,t){return e.key===t.key&&(e.tag===t.tag&&e.isComment===t.isComment&&a(e.data)===a(t.data)&&Ta(e,t)||i(e.isAsyncPlaceholder)&&e.asyncFactory===t.asyncFactory&&r(t.asyncFactory.error))}function Ta(e,t){if("input"!==e.tag)return!0;var n,r=a(n=e.data)&&a(n=n.attrs)&&n.type,i=a(n=t.data)&&a(n=n.attrs)&&n.type;return r===i||la(r)&&la(i)}function Oa(e,t,n){var r,i,o={};for(r=t;r<=n;++r)i=e[r].key,a(i)&&(o[i]=r);return o}function Aa(e){var t,n,o={},u=e.modules,l=e.nodeOps;for(t=0;tp?(d=r(n[g+1])?null:n[g+1].elm,L(e,d,n,m,g,i)):m>g&&x(t,f,p)}function S(e,t,n,r){for(var i=n;i-1?Ra(e,t,n):Ur(t)?Gr(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):Wr(t)?e.setAttribute(t,Vr(t,n)):Br(t)?Gr(n)?e.removeAttributeNS($r,qr(t)):e.setAttributeNS($r,t,n):Ra(e,t,n)}function Ra(e,t,n){if(Gr(n))e.removeAttribute(t);else{if(ee&&!te&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var Va={create:Na,update:Na};function Ua(e,t){var n=t.elm,i=t.data,o=e.data;if(!(r(i.staticClass)&&r(i.class)&&(r(o)||r(o.staticClass)&&r(o.class)))){var s=Jr(t),u=n._transitionClasses;a(u)&&(s=Kr(s,Xr(u))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}var $a,Ba={create:Ua,update:Ua},qa="__r",Ga="__c";function Ja(e){if(a(e[qa])){var t=ee?"change":"input";e[t]=[].concat(e[qa],e[t]||[]),delete e[qa]}a(e[Ga])&&(e.change=[].concat(e[Ga],e.change||[]),delete e[Ga])}function Qa(e,t,n){var r=$a;return function a(){var i=t.apply(null,arguments);null!==i&&Xa(e,a,n,r)}}var Za=ot&&!(ae&&Number(ae[1])<=53);function Ka(e,t,n,r){if(Za){var a=qn,i=t;t=i._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=a||e.timeStamp<=0||e.target.ownerDocument!==document)return i.apply(this,arguments)}}$a.addEventListener(e,t,oe?{capture:n,passive:r}:n)}function Xa(e,t,n,r){(r||$a).removeEventListener(e,t._wrapper||t,n)}function ei(e,t){if(!r(e.data.on)||!r(t.data.on)){var n=t.data.on||{},a=e.data.on||{};$a=t.elm,Ja(n),bt(n,a,Ka,Xa,Qa,t.context),$a=void 0}}var ti,ni={create:ei,update:ei};function ri(e,t){if(!r(e.data.domProps)||!r(t.data.domProps)){var n,i,o=t.elm,s=e.data.domProps||{},u=t.data.domProps||{};for(n in a(u.__ob__)&&(u=t.data.domProps=A({},u)),s)n in u||(o[n]="");for(n in u){if(i=u[n],"textContent"===n||"innerHTML"===n){if(t.children&&(t.children.length=0),i===s[n])continue;1===o.childNodes.length&&o.removeChild(o.childNodes[0])}if("value"===n&&"PROGRESS"!==o.tagName){o._value=i;var l=r(i)?"":String(i);ai(o,l)&&(o.value=l)}else if("innerHTML"===n&&aa(o.tagName)&&r(o.innerHTML)){ti=ti||document.createElement("div"),ti.innerHTML=""+i+"";var c=ti.firstChild;while(o.firstChild)o.removeChild(o.firstChild);while(c.firstChild)o.appendChild(c.firstChild)}else if(i!==s[n])try{o[n]=i}catch(Lo){}}}}function ai(e,t){return!e.composing&&("OPTION"===e.tagName||ii(e,t)||oi(e,t))}function ii(e,t){var n=!0;try{n=document.activeElement!==e}catch(Lo){}return n&&e.value!==t}function oi(e,t){var n=e.value,r=e._vModifiers;if(a(r)){if(r.number)return p(n)!==p(t);if(r.trim)return n.trim()!==t.trim()}return n!==t}var si={create:ri,update:ri},ui=M((function(e){var t={},n=/;(?![^(]*\))/g,r=/:(.+)/;return e.split(n).forEach((function(e){if(e){var n=e.split(r);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}));function li(e){var t=ci(e.style);return e.staticStyle?A(e.staticStyle,t):t}function ci(e){return Array.isArray(e)?P(e):"string"===typeof e?ui(e):e}function di(e,t){var n,r={};if(t){var a=e;while(a.componentInstance)a=a.componentInstance._vnode,a&&a.data&&(n=li(a.data))&&A(r,n)}(n=li(e.data))&&A(r,n);var i=e;while(i=i.parent)i.data&&(n=li(i.data))&&A(r,n);return r}var fi,hi=/^--/,mi=/\s*!important$/,pi=function(e,t,n){if(hi.test(t))e.style.setProperty(t,n);else if(mi.test(n))e.style.setProperty(Y(t),n.replace(mi,""),"important");else{var r=yi(t);if(Array.isArray(n))for(var a=0,i=n.length;a-1?t.split(bi).forEach((function(t){return e.classList.add(t)})):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function wi(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(bi).forEach((function(t){return e.classList.remove(t)})):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";while(n.indexOf(r)>=0)n=n.replace(r," ");n=n.trim(),n?e.setAttribute("class",n):e.removeAttribute("class")}}function Li(e){if(e){if("object"===typeof e){var t={};return!1!==e.css&&A(t,ki(e.name||"v")),A(t,e),t}return"string"===typeof e?ki(e):void 0}}var ki=M((function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}})),xi=Q&&!te,Yi="transition",Di="animation",Si="transition",Ti="transitionend",Oi="animation",Ai="animationend";xi&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Si="WebkitTransition",Ti="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Oi="WebkitAnimation",Ai="webkitAnimationEnd"));var Pi=Q?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function ji(e){Pi((function(){Pi(e)}))}function Hi(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),Mi(e,t))}function Ci(e,t){e._transitionClasses&&g(e._transitionClasses,t),wi(e,t)}function Ei(e,t,n){var r=Fi(e,t),a=r.type,i=r.timeout,o=r.propCount;if(!a)return n();var s=a===Yi?Ti:Ai,u=0,l=function(){e.removeEventListener(s,c),n()},c=function(t){t.target===e&&++u>=o&&l()};setTimeout((function(){u0&&(n=Yi,c=o,d=i.length):t===Di?l>0&&(n=Di,c=l,d=u.length):(c=Math.max(o,l),n=c>0?o>l?Yi:Di:null,d=n?n===Yi?i.length:u.length:0);var f=n===Yi&&zi.test(r[Si+"Property"]);return{type:n,timeout:c,propCount:d,hasTransform:f}}function Ii(e,t){while(e.length1}function $i(e,t){!0!==t.data.show&&Wi(t)}var Bi=Q?{create:$i,activate:$i,remove:function(e,t){!0!==e.data.show?Ri(e,t):t()}}:{},qi=[Va,Ba,ni,si,vi,Bi],Gi=qi.concat(Ia),Ji=Aa({nodeOps:La,modules:Gi});te&&document.addEventListener("selectionchange",(function(){var e=document.activeElement;e&&e.vmodel&&ro(e,"input")}));var Qi={inserted:function(e,t,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?Mt(n,"postpatch",(function(){Qi.componentUpdated(e,t,n)})):Zi(e,t,n.context),e._vOptions=[].map.call(e.options,eo)):("textarea"===n.tag||la(e.type))&&(e._vModifiers=t.modifiers,t.modifiers.lazy||(e.addEventListener("compositionstart",to),e.addEventListener("compositionend",no),e.addEventListener("change",no),te&&(e.vmodel=!0)))},componentUpdated:function(e,t,n){if("select"===n.tag){Zi(e,t,n.context);var r=e._vOptions,a=e._vOptions=[].map.call(e.options,eo);if(a.some((function(e,t){return!E(e,r[t])}))){var i=e.multiple?t.value.some((function(e){return Xi(e,a)})):t.value!==t.oldValue&&Xi(t.value,a);i&&ro(e,"change")}}}};function Zi(e,t,n){Ki(e,t,n),(ee||ne)&&setTimeout((function(){Ki(e,t,n)}),0)}function Ki(e,t,n){var r=t.value,a=e.multiple;if(!a||Array.isArray(r)){for(var i,o,s=0,u=e.options.length;s-1,o.selected!==i&&(o.selected=i);else if(E(eo(o),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));a||(e.selectedIndex=-1)}}function Xi(e,t){return t.every((function(t){return!E(t,e)}))}function eo(e){return"_value"in e?e._value:e.value}function to(e){e.target.composing=!0}function no(e){e.target.composing&&(e.target.composing=!1,ro(e.target,"input"))}function ro(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function ao(e){return!e.componentInstance||e.data&&e.data.transition?e:ao(e.componentInstance._vnode)}var io={bind:function(e,t,n){var r=t.value;n=ao(n);var a=n.data&&n.data.transition,i=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&a?(n.data.show=!0,Wi(n,(function(){e.style.display=i}))):e.style.display=r?i:"none"},update:function(e,t,n){var r=t.value,a=t.oldValue;if(!r!==!a){n=ao(n);var i=n.data&&n.data.transition;i?(n.data.show=!0,r?Wi(n,(function(){e.style.display=e.__vOriginalDisplay})):Ri(n,(function(){e.style.display="none"}))):e.style.display=r?e.__vOriginalDisplay:"none"}},unbind:function(e,t,n,r,a){a||(e.style.display=e.__vOriginalDisplay)}},oo={model:Qi,show:io},so={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function uo(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?uo(Ln(t.children)):e}function lo(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var a=n._parentListeners;for(var i in a)t[L(i)]=a[i];return t}function co(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}function fo(e){while(e=e.parent)if(e.data.transition)return!0}function ho(e,t){return t.key===e.key&&t.tag===e.tag}var mo=function(e){return e.tag||wn(e)},po=function(e){return"show"===e.name},_o={name:"transition",props:so,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(mo),n.length)){0;var r=this.mode;0;var a=n[0];if(fo(this.$vnode))return a;var i=uo(a);if(!i)return a;if(this._leaving)return co(e,a);var o="__transition-"+this._uid+"-";i.key=null==i.key?i.isComment?o+"comment":o+i.tag:s(i.key)?0===String(i.key).indexOf(o)?i.key:o+i.key:i.key;var u=(i.data||(i.data={})).transition=lo(this),l=this._vnode,c=uo(l);if(i.data.directives&&i.data.directives.some(po)&&(i.data.show=!0),c&&c.data&&!ho(i,c)&&!wn(c)&&(!c.componentInstance||!c.componentInstance._vnode.isComment)){var d=c.data.transition=A({},u);if("out-in"===r)return this._leaving=!0,Mt(d,"afterLeave",(function(){t._leaving=!1,t.$forceUpdate()})),co(e,a);if("in-out"===r){if(wn(i))return l;var f,h=function(){f()};Mt(u,"afterEnter",h),Mt(u,"enterCancelled",h),Mt(d,"delayLeave",(function(e){f=e}))}}return a}}},yo=A({tag:String,moveClass:String},so);delete yo.mode;var go={props:yo,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var a=An(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,a(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,a=this.$slots.default||[],i=this.children=[],o=lo(this),s=0;s=20?"ste":"de")},week:{dow:1,doy:4}});return t}))},"2d00":function(e,t){e.exports=!1},"2d95":function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},"2e8c":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",ss:"%d фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}});return t}))},"2ead":function(e,t,n){(function(e){(function(e,n){n(t)})(0,(function(t){"use strict";var n="undefined"!==typeof window?window:"undefined"!==typeof e?e:"undefined"!==typeof self?self:{};function r(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function a(e,t){return t={exports:{}},e(t,t.exports),t.exports}var i=a((function(e,t){var a="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e}; +//! moment.js +(function(n,r){"object"===a(t)?e.exports=r():n.moment=r()})(n,(function(){var t,n;function i(){return t.apply(null,arguments)}function o(e){t=e}function s(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function u(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function l(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}function c(e){return void 0===e}function d(e){return"number"===typeof e||"[object Number]"===Object.prototype.toString.call(e)}function f(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function h(e,t){var n,r=[];for(n=0;n>>0,r=0;r0)for(n=0;n0?"future":"past"];return H(n)?n(t):n.replace(/%s/i,t)}var Q={};function Z(e,t){var n=e.toLowerCase();Q[n]=Q[n+"s"]=Q[t]=e}function K(e){return"string"===typeof e?Q[e]||Q[e.toLowerCase()]:void 0}function X(e){var t,n,r={};for(n in e)m(e,n)&&(t=K(n),t&&(r[t]=e[n]));return r}var ee={};function te(e,t){ee[e]=t}function ne(e){var t=[];for(var n in e)t.push({unit:n,priority:ee[n]});return t.sort((function(e,t){return e.priority-t.priority})),t}function re(e,t,n){var r=""+Math.abs(e),a=t-r.length,i=e>=0;return(i?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+r}var ae=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ie=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,oe={},se={};function ue(e,t,n,r){var a=r;"string"===typeof r&&(a=function(){return this[r]()}),e&&(se[e]=a),t&&(se[t[0]]=function(){return re(a.apply(this,arguments),t[1],t[2])}),n&&(se[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),e)})}function le(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function ce(e){var t,n,r=e.match(ae);for(t=0,n=r.length;t=0&&ie.test(e))e=e.replace(ie,r),ie.lastIndex=0,n-=1;return e}var he=/\d/,me=/\d\d/,pe=/\d{3}/,_e=/\d{4}/,ye=/[+-]?\d{6}/,ge=/\d\d?/,ve=/\d\d\d\d?/,be=/\d\d\d\d\d\d?/,Me=/\d{1,3}/,we=/\d{1,4}/,Le=/[+-]?\d{1,6}/,ke=/\d+/,xe=/[+-]?\d+/,Ye=/Z|[+-]\d\d:?\d\d/gi,De=/Z|[+-]\d\d(?::?\d\d)?/gi,Se=/[+-]?\d+(\.\d{1,3})?/,Te=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Oe={};function Ae(e,t,n){Oe[e]=H(t)?t:function(e,r){return e&&n?n:t}}function Pe(e,t){return m(Oe,e)?Oe[e](t._strict,t._locale):new RegExp(je(e))}function je(e){return He(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,n,r,a){return t||n||r||a})))}function He(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var Ce={};function Ee(e,t){var n,r=t;for("string"===typeof e&&(e=[e]),d(t)&&(r=function(e,n){n[t]=D(e)}),n=0;n68?1900:2e3)};var Qe,Ze=Xe("FullYear",!0);function Ke(){return Je(this.year())}function Xe(e,t){return function(n){return null!=n?(tt(this,e,n),i.updateOffset(this,t),this):et(this,e)}}function et(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function tt(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&Je(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),it(n,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function nt(e){return e=K(e),H(this[e])?this[e]():this}function rt(e,t){if("object"===("undefined"===typeof e?"undefined":a(e))){e=X(e);for(var n=ne(e),r=0;r=0?(s=new Date(e+400,t,n,r,a,i,o),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,r,a,i,o),s}function wt(e){var t;if(e<100&&e>=0){var n=Array.prototype.slice.call(arguments);n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)}else t=new Date(Date.UTC.apply(null,arguments));return t}function Lt(e,t,n){var r=7+t-n,a=(7+wt(e,0,r).getUTCDay()-t)%7;return-a+r-1}function kt(e,t,n,r,a){var i,o,s=(7+n-r)%7,u=Lt(e,r,a),l=1+7*(t-1)+s+u;return l<=0?(i=e-1,o=Ge(i)+l):l>Ge(e)?(i=e+1,o=l-Ge(e)):(i=e,o=l),{year:i,dayOfYear:o}}function xt(e,t,n){var r,a,i=Lt(e.year(),t,n),o=Math.floor((e.dayOfYear()-i-1)/7)+1;return o<1?(a=e.year()-1,r=o+Yt(a,t,n)):o>Yt(e.year(),t,n)?(r=o-Yt(e.year(),t,n),a=e.year()+1):(a=e.year(),r=o),{week:r,year:a}}function Yt(e,t,n){var r=Lt(e,t,n),a=Lt(e+1,t,n);return(Ge(e)-r+a)/7}function Dt(e){return xt(e,this._week.dow,this._week.doy).week}ue("w",["ww",2],"wo","week"),ue("W",["WW",2],"Wo","isoWeek"),Z("week","w"),Z("isoWeek","W"),te("week",5),te("isoWeek",5),Ae("w",ge),Ae("ww",ge,me),Ae("W",ge),Ae("WW",ge,me),ze(["w","ww","W","WW"],(function(e,t,n,r){t[r.substr(0,1)]=D(e)}));var St={dow:0,doy:6};function Tt(){return this._week.dow}function Ot(){return this._week.doy}function At(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function Pt(e){var t=xt(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function jt(e,t){return"string"!==typeof e?e:isNaN(e)?(e=t.weekdaysParse(e),"number"===typeof e?e:null):parseInt(e,10)}function Ht(e,t){return"string"===typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Ct(e,t){return e.slice(t,7).concat(e.slice(0,t))}ue("d",0,"do","day"),ue("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),ue("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),ue("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),ue("e",0,0,"weekday"),ue("E",0,0,"isoWeekday"),Z("day","d"),Z("weekday","e"),Z("isoWeekday","E"),te("day",11),te("weekday",11),te("isoWeekday",11),Ae("d",ge),Ae("e",ge),Ae("E",ge),Ae("dd",(function(e,t){return t.weekdaysMinRegex(e)})),Ae("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),Ae("dddd",(function(e,t){return t.weekdaysRegex(e)})),ze(["dd","ddd","dddd"],(function(e,t,n,r){var a=n._locale.weekdaysParse(e,r,n._strict);null!=a?t.d=a:g(n).invalidWeekday=e})),ze(["d","e","E"],(function(e,t,n,r){t[r]=D(e)}));var Et="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");function zt(e,t){var n=s(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Ct(n,this._week.dow):e?n[e.day()]:n}var Ft="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");function It(e){return!0===e?Ct(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}var Nt="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Wt(e){return!0===e?Ct(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Rt(e,t,n){var r,a,i,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)i=_([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(i,"").toLocaleLowerCase();return n?"dddd"===t?(a=Qe.call(this._weekdaysParse,o),-1!==a?a:null):"ddd"===t?(a=Qe.call(this._shortWeekdaysParse,o),-1!==a?a:null):(a=Qe.call(this._minWeekdaysParse,o),-1!==a?a:null):"dddd"===t?(a=Qe.call(this._weekdaysParse,o),-1!==a?a:(a=Qe.call(this._shortWeekdaysParse,o),-1!==a?a:(a=Qe.call(this._minWeekdaysParse,o),-1!==a?a:null))):"ddd"===t?(a=Qe.call(this._shortWeekdaysParse,o),-1!==a?a:(a=Qe.call(this._weekdaysParse,o),-1!==a?a:(a=Qe.call(this._minWeekdaysParse,o),-1!==a?a:null))):(a=Qe.call(this._minWeekdaysParse,o),-1!==a?a:(a=Qe.call(this._weekdaysParse,o),-1!==a?a:(a=Qe.call(this._shortWeekdaysParse,o),-1!==a?a:null)))}function Vt(e,t,n){var r,a,i;if(this._weekdaysParseExact)return Rt.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(a=_([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(i="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[r]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function Ut(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=jt(e,this.localeData()),this.add(e-t,"d")):t}function $t(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function Bt(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=Ht(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}var qt=Te;function Gt(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Xt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(m(this,"_weekdaysRegex")||(this._weekdaysRegex=qt),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}var Jt=Te;function Qt(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Xt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(m(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Jt),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}var Zt=Te;function Kt(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Xt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(m(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Zt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Xt(){function e(e,t){return t.length-e.length}var t,n,r,a,i,o=[],s=[],u=[],l=[];for(t=0;t<7;t++)n=_([2e3,1]).day(t),r=this.weekdaysMin(n,""),a=this.weekdaysShort(n,""),i=this.weekdays(n,""),o.push(r),s.push(a),u.push(i),l.push(r),l.push(a),l.push(i);for(o.sort(e),s.sort(e),u.sort(e),l.sort(e),t=0;t<7;t++)s[t]=He(s[t]),u[t]=He(u[t]),l[t]=He(l[t]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function en(){return this.hours()%12||12}function tn(){return this.hours()||24}function nn(e,t){ue(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function rn(e,t){return t._meridiemParse}function an(e){return"p"===(e+"").toLowerCase().charAt(0)}ue("H",["HH",2],0,"hour"),ue("h",["hh",2],0,en),ue("k",["kk",2],0,tn),ue("hmm",0,0,(function(){return""+en.apply(this)+re(this.minutes(),2)})),ue("hmmss",0,0,(function(){return""+en.apply(this)+re(this.minutes(),2)+re(this.seconds(),2)})),ue("Hmm",0,0,(function(){return""+this.hours()+re(this.minutes(),2)})),ue("Hmmss",0,0,(function(){return""+this.hours()+re(this.minutes(),2)+re(this.seconds(),2)})),nn("a",!0),nn("A",!1),Z("hour","h"),te("hour",13),Ae("a",rn),Ae("A",rn),Ae("H",ge),Ae("h",ge),Ae("k",ge),Ae("HH",ge,me),Ae("hh",ge,me),Ae("kk",ge,me),Ae("hmm",ve),Ae("hmmss",be),Ae("Hmm",ve),Ae("Hmmss",be),Ee(["H","HH"],Re),Ee(["k","kk"],(function(e,t,n){var r=D(e);t[Re]=24===r?0:r})),Ee(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),Ee(["h","hh"],(function(e,t,n){t[Re]=D(e),g(n).bigHour=!0})),Ee("hmm",(function(e,t,n){var r=e.length-2;t[Re]=D(e.substr(0,r)),t[Ve]=D(e.substr(r)),g(n).bigHour=!0})),Ee("hmmss",(function(e,t,n){var r=e.length-4,a=e.length-2;t[Re]=D(e.substr(0,r)),t[Ve]=D(e.substr(r,2)),t[Ue]=D(e.substr(a)),g(n).bigHour=!0})),Ee("Hmm",(function(e,t,n){var r=e.length-2;t[Re]=D(e.substr(0,r)),t[Ve]=D(e.substr(r))})),Ee("Hmmss",(function(e,t,n){var r=e.length-4,a=e.length-2;t[Re]=D(e.substr(0,r)),t[Ve]=D(e.substr(r,2)),t[Ue]=D(e.substr(a))}));var on=/[ap]\.?m?\.?/i;function sn(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var un,ln=Xe("Hours",!0),cn={calendar:F,longDateFormat:N,invalidDate:R,ordinal:U,dayOfMonthOrdinalParse:$,relativeTime:q,months:st,monthsShort:lt,week:St,weekdays:Et,weekdaysMin:Nt,weekdaysShort:Ft,meridiemParse:on},dn={},fn={};function hn(e){return e?e.toLowerCase().replace("_","-"):e}function mn(e){var t,n,r,a,i=0;while(i0){if(r=pn(a.slice(0,t).join("-")),r)return r;if(n&&n.length>=t&&S(a,n,!0)>=t-1)break;t--}i++}return un}function pn(t){var n=null;if(!dn[t]&&e&&e.exports)try{n=un._abbr;var a=r;a("./locale/"+t),_n(n)}catch(i){}return dn[t]}function _n(e,t){var n;return e&&(n=c(t)?vn(e):yn(e,t),n?un=n:"undefined"!==typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),un._abbr}function yn(e,t){if(null!==t){var n,r=cn;if(t.abbr=e,null!=dn[e])j("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=dn[e]._config;else if(null!=t.parentLocale)if(null!=dn[t.parentLocale])r=dn[t.parentLocale]._config;else{if(n=pn(t.parentLocale),null==n)return fn[t.parentLocale]||(fn[t.parentLocale]=[]),fn[t.parentLocale].push({name:e,config:t}),null;r=n._config}return dn[e]=new z(E(r,t)),fn[e]&&fn[e].forEach((function(e){yn(e.name,e.config)})),_n(e),dn[e]}return delete dn[e],null}function gn(e,t){if(null!=t){var n,r,a=cn;r=pn(e),null!=r&&(a=r._config),t=E(a,t),n=new z(t),n.parentLocale=dn[e],dn[e]=n,_n(e)}else null!=dn[e]&&(null!=dn[e].parentLocale?dn[e]=dn[e].parentLocale:null!=dn[e]&&delete dn[e]);return dn[e]}function vn(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return un;if(!s(e)){if(t=pn(e),t)return t;e=[e]}return mn(e)}function bn(){return A(dn)}function Mn(e){var t,n=e._a;return n&&-2===g(e).overflow&&(t=n[Ne]<0||n[Ne]>11?Ne:n[We]<1||n[We]>it(n[Ie],n[Ne])?We:n[Re]<0||n[Re]>24||24===n[Re]&&(0!==n[Ve]||0!==n[Ue]||0!==n[$e])?Re:n[Ve]<0||n[Ve]>59?Ve:n[Ue]<0||n[Ue]>59?Ue:n[$e]<0||n[$e]>999?$e:-1,g(e)._overflowDayOfYear&&(tWe)&&(t=We),g(e)._overflowWeeks&&-1===t&&(t=Be),g(e)._overflowWeekday&&-1===t&&(t=qe),g(e).overflow=t),e}function wn(e,t,n){return null!=e?e:null!=t?t:n}function Ln(e){var t=new Date(i.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function kn(e){var t,n,r,a,i,o=[];if(!e._d){for(r=Ln(e),e._w&&null==e._a[We]&&null==e._a[Ne]&&xn(e),null!=e._dayOfYear&&(i=wn(e._a[Ie],r[Ie]),(e._dayOfYear>Ge(i)||0===e._dayOfYear)&&(g(e)._overflowDayOfYear=!0),n=wt(i,0,e._dayOfYear),e._a[Ne]=n.getUTCMonth(),e._a[We]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=o[t]=r[t];for(;t<7;t++)e._a[t]=o[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[Re]&&0===e._a[Ve]&&0===e._a[Ue]&&0===e._a[$e]&&(e._nextDay=!0,e._a[Re]=0),e._d=(e._useUTC?wt:Mt).apply(null,o),a=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Re]=24),e._w&&"undefined"!==typeof e._w.d&&e._w.d!==a&&(g(e).weekdayMismatch=!0)}}function xn(e){var t,n,r,a,i,o,s,u;if(t=e._w,null!=t.GG||null!=t.W||null!=t.E)i=1,o=4,n=wn(t.GG,e._a[Ie],xt(Qn(),1,4).year),r=wn(t.W,1),a=wn(t.E,1),(a<1||a>7)&&(u=!0);else{i=e._locale._week.dow,o=e._locale._week.doy;var l=xt(Qn(),i,o);n=wn(t.gg,e._a[Ie],l.year),r=wn(t.w,l.week),null!=t.d?(a=t.d,(a<0||a>6)&&(u=!0)):null!=t.e?(a=t.e+i,(t.e<0||t.e>6)&&(u=!0)):a=i}r<1||r>Yt(n,i,o)?g(e)._overflowWeeks=!0:null!=u?g(e)._overflowWeekday=!0:(s=kt(n,r,a,i,o),e._a[Ie]=s.year,e._dayOfYear=s.dayOfYear)}var Yn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Dn=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Sn=/Z|[+-]\d\d(?::?\d\d)?/,Tn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],On=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],An=/^\/?Date\((\-?\d+)/i;function Pn(e){var t,n,r,a,i,o,s=e._i,u=Yn.exec(s)||Dn.exec(s);if(u){for(g(e).iso=!0,t=0,n=Tn.length;t0&&g(e).unusedInput.push(o),s=s.slice(s.indexOf(n)+n.length),l+=n.length),se[a]?(n?g(e).empty=!1:g(e).unusedTokens.push(a),Fe(a,n,e)):e._strict&&!n&&g(e).unusedTokens.push(a);g(e).charsLeftOver=u-l,s.length>0&&g(e).unusedInput.push(s),e._a[Re]<=12&&!0===g(e).bigHour&&e._a[Re]>0&&(g(e).bigHour=void 0),g(e).parsedDateParts=e._a.slice(0),g(e).meridiem=e._meridiem,e._a[Re]=Vn(e._locale,e._a[Re],e._meridiem),kn(e),Mn(e)}else Nn(e);else Pn(e)}function Vn(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?(r=e.isPM(n),r&&t<12&&(t+=12),r||12!==t||(t=0),t):t}function Un(e){var t,n,r,a,i;if(0===e._f.length)return g(e).invalidFormat=!0,void(e._d=new Date(NaN));for(a=0;athis?this:e:b()}));function Xn(e,t){var n,r;if(1===t.length&&s(t[0])&&(t=t[0]),!t.length)return Qn();for(n=t[0],r=1;rthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function wr(){if(!c(this._isDSTShifted))return this._isDSTShifted;var e={};if(w(e,this),e=qn(e),e._a){var t=e._isUTC?_(e._a):Qn(e._a);this._isDSTShifted=this.isValid()&&S(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Lr(){return!!this.isValid()&&!this._isUTC}function kr(){return!!this.isValid()&&this._isUTC}function xr(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}i.updateOffset=function(){};var Yr=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Dr=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Sr(e,t){var n,r,i,o=e,s=null;return ur(e)?o={ms:e._milliseconds,d:e._days,M:e._months}:d(e)?(o={},t?o[t]=e:o.milliseconds=e):(s=Yr.exec(e))?(n="-"===s[1]?-1:1,o={y:0,d:D(s[We])*n,h:D(s[Re])*n,m:D(s[Ve])*n,s:D(s[Ue])*n,ms:D(lr(1e3*s[$e]))*n}):(s=Dr.exec(e))?(n="-"===s[1]?-1:1,o={y:Tr(s[2],n),M:Tr(s[3],n),w:Tr(s[4],n),d:Tr(s[5],n),h:Tr(s[6],n),m:Tr(s[7],n),s:Tr(s[8],n)}):null==o?o={}:"object"===("undefined"===typeof o?"undefined":a(o))&&("from"in o||"to"in o)&&(i=Ar(Qn(o.from),Qn(o.to)),o={},o.ms=i.milliseconds,o.M=i.months),r=new sr(o),ur(e)&&m(e,"_locale")&&(r._locale=e._locale),r}function Tr(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Or(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Ar(e,t){var n;return e.isValid()&&t.isValid()?(t=hr(t,e),e.isBefore(t)?n=Or(e,t):(n=Or(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Pr(e,t){return function(n,r){var a,i;return null===r||isNaN(+r)||(j(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=n,n=r,r=i),n="string"===typeof n?+n:n,a=Sr(n,r),jr(this,a,e),this}}function jr(e,t,n,r){var a=t._milliseconds,o=lr(t._days),s=lr(t._months);e.isValid()&&(r=null==r||r,s&&ht(e,et(e,"Month")+s*n),o&&tt(e,"Date",et(e,"Date")+o*n),a&&e._d.setTime(e._d.valueOf()+a*n),r&&i.updateOffset(e,o||s))}Sr.fn=sr.prototype,Sr.invalid=or;var Hr=Pr(1,"add"),Cr=Pr(-1,"subtract");function Er(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function zr(e,t){var n=e||Qn(),r=hr(n,this).startOf("day"),a=i.calendarFormat(this,r)||"sameElse",o=t&&(H(t[a])?t[a].call(this,n):t[a]);return this.format(o||this.localeData().calendar(a,this,Qn(n)))}function Fr(){return new k(this)}function Ir(e,t){var n=x(e)?e:Qn(e);return!(!this.isValid()||!n.isValid())&&(t=K(t)||"millisecond","millisecond"===t?this.valueOf()>n.valueOf():n.valueOf()9999?de(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):H(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",de(n,"Z")):de(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Jr(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a="-MM-DD[T]HH:mm:ss.SSS",i=t+'[")]';return this.format(n+r+a+i)}function Qr(e){e||(e=this.isUtc()?i.defaultFormatUtc:i.defaultFormat);var t=de(this,e);return this.localeData().postformat(t)}function Zr(e,t){return this.isValid()&&(x(e)&&e.isValid()||Qn(e).isValid())?Sr({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Kr(e){return this.from(Qn(),e)}function Xr(e,t){return this.isValid()&&(x(e)&&e.isValid()||Qn(e).isValid())?Sr({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ea(e){return this.to(Qn(),e)}function ta(e){var t;return void 0===e?this._locale._abbr:(t=vn(e),null!=t&&(this._locale=t),this)}i.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",i.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var na=O("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function ra(){return this._locale}var aa=1e3,ia=60*aa,oa=60*ia,sa=3506328*oa;function ua(e,t){return(e%t+t)%t}function la(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-sa:new Date(e,t,n).valueOf()}function ca(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-sa:Date.UTC(e,t,n)}function da(e){var t;if(e=K(e),void 0===e||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?ca:la;switch(e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=ua(t+(this._isUTC?0:this.utcOffset()*ia),oa);break;case"minute":t=this._d.valueOf(),t-=ua(t,ia);break;case"second":t=this._d.valueOf(),t-=ua(t,aa);break}return this._d.setTime(t),i.updateOffset(this,!0),this}function fa(e){var t;if(e=K(e),void 0===e||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?ca:la;switch(e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=oa-ua(t+(this._isUTC?0:this.utcOffset()*ia),oa)-1;break;case"minute":t=this._d.valueOf(),t+=ia-ua(t,ia)-1;break;case"second":t=this._d.valueOf(),t+=aa-ua(t,aa)-1;break}return this._d.setTime(t),i.updateOffset(this,!0),this}function ha(){return this._d.valueOf()-6e4*(this._offset||0)}function ma(){return Math.floor(this.valueOf()/1e3)}function pa(){return new Date(this.valueOf())}function _a(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function ya(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function ga(){return this.isValid()?this.toISOString():null}function va(){return v(this)}function ba(){return p({},g(this))}function Ma(){return g(this).overflow}function wa(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function La(e,t){ue(0,[e,e.length],0,t)}function ka(e){return Sa.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function xa(e){return Sa.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Ya(){return Yt(this.year(),1,4)}function Da(){var e=this.localeData()._week;return Yt(this.year(),e.dow,e.doy)}function Sa(e,t,n,r,a){var i;return null==e?xt(this,r,a).year:(i=Yt(e,r,a),t>i&&(t=i),Ta.call(this,e,t,n,r,a))}function Ta(e,t,n,r,a){var i=kt(e,t,n,r,a),o=wt(i.year,0,i.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}function Oa(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}ue(0,["gg",2],0,(function(){return this.weekYear()%100})),ue(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),La("gggg","weekYear"),La("ggggg","weekYear"),La("GGGG","isoWeekYear"),La("GGGGG","isoWeekYear"),Z("weekYear","gg"),Z("isoWeekYear","GG"),te("weekYear",1),te("isoWeekYear",1),Ae("G",xe),Ae("g",xe),Ae("GG",ge,me),Ae("gg",ge,me),Ae("GGGG",we,_e),Ae("gggg",we,_e),Ae("GGGGG",Le,ye),Ae("ggggg",Le,ye),ze(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,r){t[r.substr(0,2)]=D(e)})),ze(["gg","GG"],(function(e,t,n,r){t[r]=i.parseTwoDigitYear(e)})),ue("Q",0,"Qo","quarter"),Z("quarter","Q"),te("quarter",7),Ae("Q",he),Ee("Q",(function(e,t){t[Ne]=3*(D(e)-1)})),ue("D",["DD",2],"Do","date"),Z("date","D"),te("date",9),Ae("D",ge),Ae("DD",ge,me),Ae("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),Ee(["D","DD"],We),Ee("Do",(function(e,t){t[We]=D(e.match(ge)[0])}));var Aa=Xe("Date",!0);function Pa(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}ue("DDD",["DDDD",3],"DDDo","dayOfYear"),Z("dayOfYear","DDD"),te("dayOfYear",4),Ae("DDD",Me),Ae("DDDD",pe),Ee(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=D(e)})),ue("m",["mm",2],0,"minute"),Z("minute","m"),te("minute",14),Ae("m",ge),Ae("mm",ge,me),Ee(["m","mm"],Ve);var ja=Xe("Minutes",!1);ue("s",["ss",2],0,"second"),Z("second","s"),te("second",15),Ae("s",ge),Ae("ss",ge,me),Ee(["s","ss"],Ue);var Ha,Ca=Xe("Seconds",!1);for(ue("S",0,0,(function(){return~~(this.millisecond()/100)})),ue(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),ue(0,["SSS",3],0,"millisecond"),ue(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),ue(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),ue(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),ue(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),ue(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),ue(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),Z("millisecond","ms"),te("millisecond",16),Ae("S",Me,he),Ae("SS",Me,me),Ae("SSS",Me,pe),Ha="SSSS";Ha.length<=9;Ha+="S")Ae(Ha,ke);function Ea(e,t){t[$e]=D(1e3*("0."+e))}for(Ha="S";Ha.length<=9;Ha+="S")Ee(Ha,Ea);var za=Xe("Milliseconds",!1);function Fa(){return this._isUTC?"UTC":""}function Ia(){return this._isUTC?"Coordinated Universal Time":""}ue("z",0,0,"zoneAbbr"),ue("zz",0,0,"zoneName");var Na=k.prototype;function Wa(e){return Qn(1e3*e)}function Ra(){return Qn.apply(null,arguments).parseZone()}function Va(e){return e}Na.add=Hr,Na.calendar=zr,Na.clone=Fr,Na.diff=$r,Na.endOf=fa,Na.format=Qr,Na.from=Zr,Na.fromNow=Kr,Na.to=Xr,Na.toNow=ea,Na.get=nt,Na.invalidAt=Ma,Na.isAfter=Ir,Na.isBefore=Nr,Na.isBetween=Wr,Na.isSame=Rr,Na.isSameOrAfter=Vr,Na.isSameOrBefore=Ur,Na.isValid=va,Na.lang=na,Na.locale=ta,Na.localeData=ra,Na.max=Kn,Na.min=Zn,Na.parsingFlags=ba,Na.set=rt,Na.startOf=da,Na.subtract=Cr,Na.toArray=_a,Na.toObject=ya,Na.toDate=pa,Na.toISOString=Gr,Na.inspect=Jr,Na.toJSON=ga,Na.toString=qr,Na.unix=ma,Na.valueOf=ha,Na.creationData=wa,Na.year=Ze,Na.isLeapYear=Ke,Na.weekYear=ka,Na.isoWeekYear=xa,Na.quarter=Na.quarters=Oa,Na.month=mt,Na.daysInMonth=pt,Na.week=Na.weeks=At,Na.isoWeek=Na.isoWeeks=Pt,Na.weeksInYear=Da,Na.isoWeeksInYear=Ya,Na.date=Aa,Na.day=Na.days=Ut,Na.weekday=$t,Na.isoWeekday=Bt,Na.dayOfYear=Pa,Na.hour=Na.hours=ln,Na.minute=Na.minutes=ja,Na.second=Na.seconds=Ca,Na.millisecond=Na.milliseconds=za,Na.utcOffset=pr,Na.utc=yr,Na.local=gr,Na.parseZone=vr,Na.hasAlignedHourOffset=br,Na.isDST=Mr,Na.isLocal=Lr,Na.isUtcOffset=kr,Na.isUtc=xr,Na.isUTC=xr,Na.zoneAbbr=Fa,Na.zoneName=Ia,Na.dates=O("dates accessor is deprecated. Use date instead.",Aa),Na.months=O("months accessor is deprecated. Use month instead",mt),Na.years=O("years accessor is deprecated. Use year instead",Ze),Na.zone=O("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",_r),Na.isDSTShifted=O("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",wr);var Ua=z.prototype;function $a(e,t,n,r){var a=vn(),i=_().set(r,t);return a[n](i,e)}function Ba(e,t,n){if(d(e)&&(t=e,e=void 0),e=e||"",null!=t)return $a(e,t,n,"month");var r,a=[];for(r=0;r<12;r++)a[r]=$a(e,r,n,"month");return a}function qa(e,t,n,r){"boolean"===typeof e?(d(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,d(t)&&(n=t,t=void 0),t=t||"");var a,i=vn(),o=e?i._week.dow:0;if(null!=n)return $a(t,(n+o)%7,r,"day");var s=[];for(a=0;a<7;a++)s[a]=$a(t,(a+o)%7,r,"day");return s}function Ga(e,t){return Ba(e,t,"months")}function Ja(e,t){return Ba(e,t,"monthsShort")}function Qa(e,t,n){return qa(e,t,n,"weekdays")}function Za(e,t,n){return qa(e,t,n,"weekdaysShort")}function Ka(e,t,n){return qa(e,t,n,"weekdaysMin")}Ua.calendar=I,Ua.longDateFormat=W,Ua.invalidDate=V,Ua.ordinal=B,Ua.preparse=Va,Ua.postformat=Va,Ua.relativeTime=G,Ua.pastFuture=J,Ua.set=C,Ua.months=ut,Ua.monthsShort=ct,Ua.monthsParse=ft,Ua.monthsRegex=vt,Ua.monthsShortRegex=yt,Ua.week=Dt,Ua.firstDayOfYear=Ot,Ua.firstDayOfWeek=Tt,Ua.weekdays=zt,Ua.weekdaysMin=Wt,Ua.weekdaysShort=It,Ua.weekdaysParse=Vt,Ua.weekdaysRegex=Gt,Ua.weekdaysShortRegex=Qt,Ua.weekdaysMinRegex=Kt,Ua.isPM=an,Ua.meridiem=sn,_n("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=1===D(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}}),i.lang=O("moment.lang is deprecated. Use moment.locale instead.",_n),i.langData=O("moment.langData is deprecated. Use moment.localeData instead.",vn);var Xa=Math.abs;function ei(){var e=this._data;return this._milliseconds=Xa(this._milliseconds),this._days=Xa(this._days),this._months=Xa(this._months),e.milliseconds=Xa(e.milliseconds),e.seconds=Xa(e.seconds),e.minutes=Xa(e.minutes),e.hours=Xa(e.hours),e.months=Xa(e.months),e.years=Xa(e.years),this}function ti(e,t,n,r){var a=Sr(t,n);return e._milliseconds+=r*a._milliseconds,e._days+=r*a._days,e._months+=r*a._months,e._bubble()}function ni(e,t){return ti(this,e,t,1)}function ri(e,t){return ti(this,e,t,-1)}function ai(e){return e<0?Math.floor(e):Math.ceil(e)}function ii(){var e,t,n,r,a,i=this._milliseconds,o=this._days,s=this._months,u=this._data;return i>=0&&o>=0&&s>=0||i<=0&&o<=0&&s<=0||(i+=864e5*ai(si(s)+o),o=0,s=0),u.milliseconds=i%1e3,e=Y(i/1e3),u.seconds=e%60,t=Y(e/60),u.minutes=t%60,n=Y(t/60),u.hours=n%24,o+=Y(n/24),a=Y(oi(o)),s+=a,o-=ai(si(a)),r=Y(s/12),s%=12,u.days=o,u.months=s,u.years=r,this}function oi(e){return 4800*e/146097}function si(e){return 146097*e/4800}function ui(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=K(e),"month"===e||"quarter"===e||"year"===e)switch(t=this._days+r/864e5,n=this._months+oi(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(si(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}}function li(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*D(this._months/12):NaN}function ci(e){return function(){return this.as(e)}}var di=ci("ms"),fi=ci("s"),hi=ci("m"),mi=ci("h"),pi=ci("d"),_i=ci("w"),yi=ci("M"),gi=ci("Q"),vi=ci("y");function bi(){return Sr(this)}function Mi(e){return e=K(e),this.isValid()?this[e+"s"]():NaN}function wi(e){return function(){return this.isValid()?this._data[e]:NaN}}var Li=wi("milliseconds"),ki=wi("seconds"),xi=wi("minutes"),Yi=wi("hours"),Di=wi("days"),Si=wi("months"),Ti=wi("years");function Oi(){return Y(this.days()/7)}var Ai=Math.round,Pi={ss:44,s:45,m:45,h:22,d:26,M:11};function ji(e,t,n,r,a){return a.relativeTime(t||1,!!n,e,r)}function Hi(e,t,n){var r=Sr(e).abs(),a=Ai(r.as("s")),i=Ai(r.as("m")),o=Ai(r.as("h")),s=Ai(r.as("d")),u=Ai(r.as("M")),l=Ai(r.as("y")),c=a<=Pi.ss&&["s",a]||a0,c[4]=n,ji.apply(null,c)}function Ci(e){return void 0===e?Ai:"function"===typeof e&&(Ai=e,!0)}function Ei(e,t){return void 0!==Pi[e]&&(void 0===t?Pi[e]:(Pi[e]=t,"s"===e&&(Pi.ss=t-1),!0))}function zi(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),n=Hi(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)}var Fi=Math.abs;function Ii(e){return(e>0)-(e<0)||+e}function Ni(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,r=Fi(this._milliseconds)/1e3,a=Fi(this._days),i=Fi(this._months);e=Y(r/60),t=Y(e/60),r%=60,e%=60,n=Y(i/12),i%=12;var o=n,s=i,u=a,l=t,c=e,d=r?r.toFixed(3).replace(/\.?0+$/,""):"",f=this.asSeconds();if(!f)return"P0D";var h=f<0?"-":"",m=Ii(this._months)!==Ii(f)?"-":"",p=Ii(this._days)!==Ii(f)?"-":"",_=Ii(this._milliseconds)!==Ii(f)?"-":"";return h+"P"+(o?m+o+"Y":"")+(s?m+s+"M":"")+(u?p+u+"D":"")+(l||c||d?"T":"")+(l?_+l+"H":"")+(c?_+c+"M":"")+(d?_+d+"S":"")}var Wi=sr.prototype;return Wi.isValid=ir,Wi.abs=ei,Wi.add=ni,Wi.subtract=ri,Wi.as=ui,Wi.asMilliseconds=di,Wi.asSeconds=fi,Wi.asMinutes=hi,Wi.asHours=mi,Wi.asDays=pi,Wi.asWeeks=_i,Wi.asMonths=yi,Wi.asQuarters=gi,Wi.asYears=vi,Wi.valueOf=li,Wi._bubble=ii,Wi.clone=bi,Wi.get=Mi,Wi.milliseconds=Li,Wi.seconds=ki,Wi.minutes=xi,Wi.hours=Yi,Wi.days=Di,Wi.weeks=Oi,Wi.months=Si,Wi.years=Ti,Wi.humanize=zi,Wi.toISOString=Ni,Wi.toString=Ni,Wi.toJSON=Ni,Wi.locale=ta,Wi.localeData=ra,Wi.toIsoString=O("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ni),Wi.lang=na,ue("X",0,0,"unix"),ue("x",0,0,"valueOf"),Ae("x",xe),Ae("X",Se),Ee("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))})),Ee("x",(function(e,t,n){n._d=new Date(D(e))})),i.version="2.24.0",o(Qn),i.fn=Na,i.min=er,i.max=tr,i.now=nr,i.utc=_,i.unix=Wa,i.months=Ga,i.isDate=f,i.locale=_n,i.invalid=b,i.duration=Sr,i.isMoment=x,i.weekdays=Qa,i.parseZone=Ra,i.localeData=vn,i.isDuration=ur,i.monthsShort=Ja,i.weekdaysMin=Ka,i.defineLocale=yn,i.updateLocale=gn,i.locales=bn,i.weekdaysShort=Za,i.normalizeUnits=K,i.relativeTimeRounding=Ci,i.relativeTimeThreshold=Ei,i.calendarFormat=Er,i.prototype=Na,i.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},i}))})),o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function s(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t1?arguments[1]:void 0)}})},3024:function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},"30ef":function(e,t,n){ +/*! + * Chart.js v2.9.3 + * https://www.chartjs.org + * (c) 2019 Chart.js Contributors + * Released under the MIT License + */ +(function(t,r){e.exports=r(function(){try{return n("c1df")}catch(e){}}())})(0,(function(e){"use strict";function t(e,t){return t={exports:{}},e(t,t.exports),t.exports}function n(e){return e&&e["default"]||e}e=e&&e.hasOwnProperty("default")?e["default"]:e;var r={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},a=t((function(e){var t={};for(var n in r)r.hasOwnProperty(n)&&(t[r[n]]=n);var a=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var i in a)if(a.hasOwnProperty(i)){if(!("channels"in a[i]))throw new Error("missing channels property: "+i);if(!("labels"in a[i]))throw new Error("missing channel labels property: "+i);if(a[i].labels.length!==a[i].channels)throw new Error("channel and label counts mismatch: "+i);var o=a[i].channels,s=a[i].labels;delete a[i].channels,delete a[i].labels,Object.defineProperty(a[i],"channels",{value:o}),Object.defineProperty(a[i],"labels",{value:s})}function u(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2)}a.rgb.hsl=function(e){var t,n,r,a=e[0]/255,i=e[1]/255,o=e[2]/255,s=Math.min(a,i,o),u=Math.max(a,i,o),l=u-s;return u===s?t=0:a===u?t=(i-o)/l:i===u?t=2+(o-a)/l:o===u&&(t=4+(a-i)/l),t=Math.min(60*t,360),t<0&&(t+=360),r=(s+u)/2,n=u===s?0:r<=.5?l/(u+s):l/(2-u-s),[t,100*n,100*r]},a.rgb.hsv=function(e){var t,n,r,a,i,o=e[0]/255,s=e[1]/255,u=e[2]/255,l=Math.max(o,s,u),c=l-Math.min(o,s,u),d=function(e){return(l-e)/6/c+.5};return 0===c?a=i=0:(i=c/l,t=d(o),n=d(s),r=d(u),o===l?a=r-n:s===l?a=1/3+t-r:u===l&&(a=2/3+n-t),a<0?a+=1:a>1&&(a-=1)),[360*a,100*i,100*l]},a.rgb.hwb=function(e){var t=e[0],n=e[1],r=e[2],i=a.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[i,100*o,100*r]},a.rgb.cmyk=function(e){var t,n,r,a,i=e[0]/255,o=e[1]/255,s=e[2]/255;return a=Math.min(1-i,1-o,1-s),t=(1-i-a)/(1-a)||0,n=(1-o-a)/(1-a)||0,r=(1-s-a)/(1-a)||0,[100*t,100*n,100*r,100*a]},a.rgb.keyword=function(e){var n=t[e];if(n)return n;var a,i=1/0;for(var o in r)if(r.hasOwnProperty(o)){var s=r[o],l=u(e,s);l.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92;var a=.4124*t+.3576*n+.1805*r,i=.2126*t+.7152*n+.0722*r,o=.0193*t+.1192*n+.9505*r;return[100*a,100*i,100*o]},a.rgb.lab=function(e){var t,n,r,i=a.rgb.xyz(e),o=i[0],s=i[1],u=i[2];return o/=95.047,s/=100,u/=108.883,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,u=u>.008856?Math.pow(u,1/3):7.787*u+16/116,t=116*s-16,n=500*(o-s),r=200*(s-u),[t,n,r]},a.hsl.rgb=function(e){var t,n,r,a,i,o=e[0]/360,s=e[1]/100,u=e[2]/100;if(0===s)return i=255*u,[i,i,i];n=u<.5?u*(1+s):u+s-u*s,t=2*u-n,a=[0,0,0];for(var l=0;l<3;l++)r=o+1/3*-(l-1),r<0&&r++,r>1&&r--,i=6*r<1?t+6*(n-t)*r:2*r<1?n:3*r<2?t+(n-t)*(2/3-r)*6:t,a[l]=255*i;return a},a.hsl.hsv=function(e){var t,n,r=e[0],a=e[1]/100,i=e[2]/100,o=a,s=Math.max(i,.01);return i*=2,a*=i<=1?i:2-i,o*=s<=1?s:2-s,n=(i+a)/2,t=0===i?2*o/(s+o):2*a/(i+a),[r,100*t,100*n]},a.hsv.rgb=function(e){var t=e[0]/60,n=e[1]/100,r=e[2]/100,a=Math.floor(t)%6,i=t-Math.floor(t),o=255*r*(1-n),s=255*r*(1-n*i),u=255*r*(1-n*(1-i));switch(r*=255,a){case 0:return[r,u,o];case 1:return[s,r,o];case 2:return[o,r,u];case 3:return[o,s,r];case 4:return[u,o,r];case 5:return[r,o,s]}},a.hsv.hsl=function(e){var t,n,r,a=e[0],i=e[1]/100,o=e[2]/100,s=Math.max(o,.01);return r=(2-i)*o,t=(2-i)*s,n=i*s,n/=t<=1?t:2-t,n=n||0,r/=2,[a,100*n,100*r]},a.hwb.rgb=function(e){var t,n,r,a,i,o,s,u=e[0]/360,l=e[1]/100,c=e[2]/100,d=l+c;switch(d>1&&(l/=d,c/=d),t=Math.floor(6*u),n=1-c,r=6*u-t,0!==(1&t)&&(r=1-r),a=l+r*(n-l),t){default:case 6:case 0:i=n,o=a,s=l;break;case 1:i=a,o=n,s=l;break;case 2:i=l,o=n,s=a;break;case 3:i=l,o=a,s=n;break;case 4:i=a,o=l,s=n;break;case 5:i=n,o=l,s=a;break}return[255*i,255*o,255*s]},a.cmyk.rgb=function(e){var t,n,r,a=e[0]/100,i=e[1]/100,o=e[2]/100,s=e[3]/100;return t=1-Math.min(1,a*(1-s)+s),n=1-Math.min(1,i*(1-s)+s),r=1-Math.min(1,o*(1-s)+s),[255*t,255*n,255*r]},a.xyz.rgb=function(e){var t,n,r,a=e[0]/100,i=e[1]/100,o=e[2]/100;return t=3.2406*a+-1.5372*i+-.4986*o,n=-.9689*a+1.8758*i+.0415*o,r=.0557*a+-.204*i+1.057*o,t=t>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,t=Math.min(Math.max(0,t),1),n=Math.min(Math.max(0,n),1),r=Math.min(Math.max(0,r),1),[255*t,255*n,255*r]},a.xyz.lab=function(e){var t,n,r,a=e[0],i=e[1],o=e[2];return a/=95.047,i/=100,o/=108.883,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,t=116*i-16,n=500*(a-i),r=200*(i-o),[t,n,r]},a.lab.xyz=function(e){var t,n,r,a=e[0],i=e[1],o=e[2];n=(a+16)/116,t=i/500+n,r=n-o/200;var s=Math.pow(n,3),u=Math.pow(t,3),l=Math.pow(r,3);return n=s>.008856?s:(n-16/116)/7.787,t=u>.008856?u:(t-16/116)/7.787,r=l>.008856?l:(r-16/116)/7.787,t*=95.047,n*=100,r*=108.883,[t,n,r]},a.lab.lch=function(e){var t,n,r,a=e[0],i=e[1],o=e[2];return t=Math.atan2(o,i),n=360*t/2/Math.PI,n<0&&(n+=360),r=Math.sqrt(i*i+o*o),[a,r,n]},a.lch.lab=function(e){var t,n,r,a=e[0],i=e[1],o=e[2];return r=o/360*2*Math.PI,t=i*Math.cos(r),n=i*Math.sin(r),[a,t,n]},a.rgb.ansi16=function(e){var t=e[0],n=e[1],r=e[2],i=1 in arguments?arguments[1]:a.rgb.hsv(e)[2];if(i=Math.round(i/50),0===i)return 30;var o=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return 2===i&&(o+=60),o},a.hsv.ansi16=function(e){return a.rgb.ansi16(a.hsv.rgb(e),e[2])},a.rgb.ansi256=function(e){var t=e[0],n=e[1],r=e[2];if(t===n&&n===r)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;var a=16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5);return a},a.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];var n=.5*(1+~~(e>50)),r=(1&t)*n*255,a=(t>>1&1)*n*255,i=(t>>2&1)*n*255;return[r,a,i]},a.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var n;e-=16;var r=Math.floor(e/36)/5*255,a=Math.floor((n=e%36)/6)/5*255,i=n%6/5*255;return[r,a,i]},a.rgb.hex=function(e){var t=((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2])),n=t.toString(16).toUpperCase();return"000000".substring(n.length)+n},a.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var n=t[0];3===t[0].length&&(n=n.split("").map((function(e){return e+e})).join(""));var r=parseInt(n,16),a=r>>16&255,i=r>>8&255,o=255&r;return[a,i,o]},a.rgb.hcg=function(e){var t,n,r=e[0]/255,a=e[1]/255,i=e[2]/255,o=Math.max(Math.max(r,a),i),s=Math.min(Math.min(r,a),i),u=o-s;return t=u<1?s/(1-u):0,n=u<=0?0:o===r?(a-i)/u%6:o===a?2+(i-r)/u:4+(r-a)/u+4,n/=6,n%=1,[360*n,100*u,100*t]},a.hsl.hcg=function(e){var t=e[1]/100,n=e[2]/100,r=1,a=0;return r=n<.5?2*t*n:2*t*(1-n),r<1&&(a=(n-.5*r)/(1-r)),[e[0],100*r,100*a]},a.hsv.hcg=function(e){var t=e[1]/100,n=e[2]/100,r=t*n,a=0;return r<1&&(a=(n-r)/(1-r)),[e[0],100*r,100*a]},a.hcg.rgb=function(e){var t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];var a=[0,0,0],i=t%1*6,o=i%1,s=1-o,u=0;switch(Math.floor(i)){case 0:a[0]=1,a[1]=o,a[2]=0;break;case 1:a[0]=s,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=o;break;case 3:a[0]=0,a[1]=s,a[2]=1;break;case 4:a[0]=o,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=s}return u=(1-n)*r,[255*(n*a[0]+u),255*(n*a[1]+u),255*(n*a[2]+u)]},a.hcg.hsv=function(e){var t=e[1]/100,n=e[2]/100,r=t+n*(1-t),a=0;return r>0&&(a=t/r),[e[0],100*a,100*r]},a.hcg.hsl=function(e){var t=e[1]/100,n=e[2]/100,r=n*(1-t)+.5*t,a=0;return r>0&&r<.5?a=t/(2*r):r>=.5&&r<1&&(a=t/(2*(1-r))),[e[0],100*a,100*r]},a.hcg.hwb=function(e){var t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],100*(r-t),100*(1-r)]},a.hwb.hcg=function(e){var t=e[1]/100,n=e[2]/100,r=1-n,a=r-t,i=0;return a<1&&(i=(r-a)/(1-a)),[e[0],100*a,100*i]},a.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},a.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},a.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},a.gray.hsl=a.gray.hsv=function(e){return[0,0,e[0]]},a.gray.hwb=function(e){return[0,100,e[0]]},a.gray.cmyk=function(e){return[0,0,0,e[0]]},a.gray.lab=function(e){return[e[0],0,0]},a.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),n=(t<<16)+(t<<8)+t,r=n.toString(16).toUpperCase();return"000000".substring(r.length)+r},a.rgb.gray=function(e){var t=(e[0]+e[1]+e[2])/3;return[t/255*100]}}));a.rgb,a.hsl,a.hsv,a.hwb,a.cmyk,a.xyz,a.lab,a.lch,a.hex,a.keyword,a.ansi16,a.ansi256,a.hcg,a.apple,a.gray;function i(){for(var e={},t=Object.keys(a),n=t.length,r=0;r1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}function h(e){var t=function(t){if(void 0===t||null===t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=e(t);if("object"===typeof n)for(var r=n.length,a=0;a=0&&t<1?j(Math.round(255*t)):"")}function k(e,t){return t<1||e[3]&&e[3]<1?x(e,t):"rgb("+e[0]+", "+e[1]+", "+e[2]+")"}function x(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"rgba("+e[0]+", "+e[1]+", "+e[2]+", "+t+")"}function Y(e,t){if(t<1||e[3]&&e[3]<1)return D(e,t);var n=Math.round(e[0]/255*100),r=Math.round(e[1]/255*100),a=Math.round(e[2]/255*100);return"rgb("+n+"%, "+r+"%, "+a+"%)"}function D(e,t){var n=Math.round(e[0]/255*100),r=Math.round(e[1]/255*100),a=Math.round(e[2]/255*100);return"rgba("+n+"%, "+r+"%, "+a+"%, "+(t||e[3]||1)+")"}function S(e,t){return t<1||e[3]&&e[3]<1?T(e,t):"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)"}function T(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+t+")"}function O(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+(void 0!==t&&1!==t?", "+t:"")+")"}function A(e){return H[e.slice(0,3)]}function P(e,t,n){return Math.min(Math.max(t,e),n)}function j(e){var t=e.toString(16).toUpperCase();return t.length<2?"0"+t:t}var H={};for(var C in p)H[p[C]]=C;var E=function(e){return e instanceof E?e:this instanceof E?(this.valid=!1,this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1},void("string"===typeof e?(t=_.getRgba(e),t?this.setValues("rgb",t):(t=_.getHsla(e))?this.setValues("hsl",t):(t=_.getHwb(e))&&this.setValues("hwb",t)):"object"===typeof e&&(t=e,void 0!==t.r||void 0!==t.red?this.setValues("rgb",t):void 0!==t.l||void 0!==t.lightness?this.setValues("hsl",t):void 0!==t.v||void 0!==t.value?this.setValues("hsv",t):void 0!==t.w||void 0!==t.whiteness?this.setValues("hwb",t):void 0===t.c&&void 0===t.cyan||this.setValues("cmyk",t)))):new E(e);var t};E.prototype={isValid:function(){return this.valid},rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var e=this.values;return 1!==e.alpha?e.hwb.concat([e.alpha]):e.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var e=this.values;return e.rgb.concat([e.alpha])},hslaArray:function(){var e=this.values;return e.hsl.concat([e.alpha])},alpha:function(e){return void 0===e?this.values.alpha:(this.setValues("alpha",e),this)},red:function(e){return this.setChannel("rgb",0,e)},green:function(e){return this.setChannel("rgb",1,e)},blue:function(e){return this.setChannel("rgb",2,e)},hue:function(e){return e&&(e%=360,e=e<0?360+e:e),this.setChannel("hsl",0,e)},saturation:function(e){return this.setChannel("hsl",1,e)},lightness:function(e){return this.setChannel("hsl",2,e)},saturationv:function(e){return this.setChannel("hsv",1,e)},whiteness:function(e){return this.setChannel("hwb",1,e)},blackness:function(e){return this.setChannel("hwb",2,e)},value:function(e){return this.setChannel("hsv",2,e)},cyan:function(e){return this.setChannel("cmyk",0,e)},magenta:function(e){return this.setChannel("cmyk",1,e)},yellow:function(e){return this.setChannel("cmyk",2,e)},black:function(e){return this.setChannel("cmyk",3,e)},hexString:function(){return _.hexString(this.values.rgb)},rgbString:function(){return _.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return _.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return _.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return _.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return _.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return _.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return _.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var e=this.values.rgb;return e[0]<<16|e[1]<<8|e[2]},luminosity:function(){for(var e=this.values.rgb,t=[],n=0;nn?(t+.05)/(n+.05):(n+.05)/(t+.05)},level:function(e){var t=this.contrast(e);return t>=7.1?"AAA":t>=4.5?"AA":""},dark:function(){var e=this.values.rgb,t=(299*e[0]+587*e[1]+114*e[2])/1e3;return t<128},light:function(){return!this.dark()},negate:function(){for(var e=[],t=0;t<3;t++)e[t]=255-this.values.rgb[t];return this.setValues("rgb",e),this},lighten:function(e){var t=this.values.hsl;return t[2]+=t[2]*e,this.setValues("hsl",t),this},darken:function(e){var t=this.values.hsl;return t[2]-=t[2]*e,this.setValues("hsl",t),this},saturate:function(e){var t=this.values.hsl;return t[1]+=t[1]*e,this.setValues("hsl",t),this},desaturate:function(e){var t=this.values.hsl;return t[1]-=t[1]*e,this.setValues("hsl",t),this},whiten:function(e){var t=this.values.hwb;return t[1]+=t[1]*e,this.setValues("hwb",t),this},blacken:function(e){var t=this.values.hwb;return t[2]+=t[2]*e,this.setValues("hwb",t),this},greyscale:function(){var e=this.values.rgb,t=.3*e[0]+.59*e[1]+.11*e[2];return this.setValues("rgb",[t,t,t]),this},clearer:function(e){var t=this.values.alpha;return this.setValues("alpha",t-t*e),this},opaquer:function(e){var t=this.values.alpha;return this.setValues("alpha",t+t*e),this},rotate:function(e){var t=this.values.hsl,n=(t[0]+e)%360;return t[0]=n<0?360+n:n,this.setValues("hsl",t),this},mix:function(e,t){var n=this,r=e,a=void 0===t?.5:t,i=2*a-1,o=n.alpha()-r.alpha(),s=((i*o===-1?i:(i+o)/(1+i*o))+1)/2,u=1-s;return this.rgb(s*n.red()+u*r.red(),s*n.green()+u*r.green(),s*n.blue()+u*r.blue()).alpha(n.alpha()*a+r.alpha()*(1-a))},toJSON:function(){return this.rgb()},clone:function(){var e,t,n=new E,r=this.values,a=n.values;for(var i in r)r.hasOwnProperty(i)&&(e=r[i],t={}.toString.call(e),"[object Array]"===t?a[i]=e.slice(0):"[object Number]"===t?a[i]=e:console.error("unexpected color value:",e));return n}},E.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},E.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},E.prototype.getValues=function(e){for(var t=this.values,n={},r=0;r=0;a--)t.call(n,e[a],a);else for(a=0;a=1?e:-(Math.sqrt(1-e*e)-1)},easeOutCirc:function(e){return Math.sqrt(1-(e-=1)*e)},easeInOutCirc:function(e){return(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},easeInElastic:function(e){var t=1.70158,n=0,r=1;return 0===e?0:1===e?1:(n||(n=.3),r<1?(r=1,t=n/4):t=n/(2*Math.PI)*Math.asin(1/r),-r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n))},easeOutElastic:function(e){var t=1.70158,n=0,r=1;return 0===e?0:1===e?1:(n||(n=.3),r<1?(r=1,t=n/4):t=n/(2*Math.PI)*Math.asin(1/r),r*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/n)+1)},easeInOutElastic:function(e){var t=1.70158,n=0,r=1;return 0===e?0:2===(e/=.5)?1:(n||(n=.45),r<1?(r=1,t=n/4):t=n/(2*Math.PI)*Math.asin(1/r),e<1?r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*-.5:r*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*.5+1)},easeInBack:function(e){var t=1.70158;return e*e*((t+1)*e-t)},easeOutBack:function(e){var t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},easeInOutBack:function(e){var t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},easeInBounce:function(e){return 1-N.easeOutBounce(1-e)},easeOutBounce:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:function(e){return e<.5?.5*N.easeInBounce(2*e):.5*N.easeOutBounce(2*e-1)+.5}},W={effects:N};I.easingEffects=N;var R=Math.PI,V=R/180,U=2*R,$=R/2,B=R/4,q=2*R/3,G={clear:function(e){e.ctx.clearRect(0,0,e.width,e.height)},roundedRect:function(e,t,n,r,a,i){if(i){var o=Math.min(i,a/2,r/2),s=t+o,u=n+o,l=t+r-o,c=n+a-o;e.moveTo(t,u),st.left-n&&e.xt.top-n&&e.y0&&e.requestAnimationFrame()},advance:function(){var e,t,n,r,a=this.animations,i=0;while(i=n?(le.callback(e.onAnimationComplete,[e],t),t.animating=!1,a.splice(i,1)):++i}},Me=le.options.resolve,we=["push","pop","shift","splice","unshift"];function Le(e,t){e._chartjs?e._chartjs.listeners.push(t):(Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),we.forEach((function(t){var n="onData"+t.charAt(0).toUpperCase()+t.slice(1),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:function(){var t=Array.prototype.slice.call(arguments),a=r.apply(this,t);return le.each(e._chartjs.listeners,(function(e){"function"===typeof e[n]&&e[n].apply(e,t)})),a}})})))}function ke(e,t){var n=e._chartjs;if(n){var r=n.listeners,a=r.indexOf(t);-1!==a&&r.splice(a,1),r.length>0||(we.forEach((function(t){delete e[t]})),delete e._chartjs)}}var xe=function(e,t){this.initialize(e,t)};le.extend(xe.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(e,t){var n=this;n.chart=e,n.index=t,n.linkScales(),n.addElements(),n._type=n.getMeta().type},updateIndex:function(e){this.index=e},linkScales:function(){var e=this,t=e.getMeta(),n=e.chart,r=n.scales,a=e.getDataset(),i=n.options.scales;null!==t.xAxisID&&t.xAxisID in r&&!a.xAxisID||(t.xAxisID=a.xAxisID||i.xAxes[0].id),null!==t.yAxisID&&t.yAxisID in r&&!a.yAxisID||(t.yAxisID=a.yAxisID||i.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(e){return this.chart.scales[e]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this._update(!0)},destroy:function(){this._data&&ke(this._data,this)},createMetaDataset:function(){var e=this,t=e.datasetElementType;return t&&new t({_chart:e.chart,_datasetIndex:e.index})},createMetaData:function(e){var t=this,n=t.dataElementType;return n&&new n({_chart:t.chart,_datasetIndex:t.index,_index:e})},addElements:function(){var e,t,n=this,r=n.getMeta(),a=n.getDataset().data||[],i=r.data;for(e=0,t=a.length;er&&e.insertElements(r,a-r)},insertElements:function(e,t){for(var n=0;na?(i=a/t.innerRadius,e.arc(o,s,t.innerRadius-a,r+i,n-i,!0)):e.arc(o,s,a,r+Math.PI/2,n-Math.PI/2),e.closePath(),e.clip()}function Te(e,t,n,r){var a,i=n.endAngle;for(r&&(n.endAngle=n.startAngle+De,Se(e,n),n.endAngle=i,n.endAngle===n.startAngle&&n.fullCircles&&(n.endAngle+=De,n.fullCircles--)),e.beginPath(),e.arc(n.x,n.y,n.innerRadius,n.startAngle+De,n.startAngle,!0),a=0;as)a-=De;while(a=o&&a<=s,l=i>=n.innerRadius&&i<=n.outerRadius;return u&&l}return!1},getCenterPoint:function(){var e=this._view,t=(e.startAngle+e.endAngle)/2,n=(e.innerRadius+e.outerRadius)/2;return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}},getArea:function(){var e=this._view;return Math.PI*((e.endAngle-e.startAngle)/(2*Math.PI))*(Math.pow(e.outerRadius,2)-Math.pow(e.innerRadius,2))},tooltipPosition:function(){var e=this._view,t=e.startAngle+(e.endAngle-e.startAngle)/2,n=(e.outerRadius-e.innerRadius)/2+e.innerRadius;return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}},draw:function(){var e,t=this._chart.ctx,n=this._view,r="inner"===n.borderAlign?.33:0,a={x:n.x,y:n.y,innerRadius:n.innerRadius,outerRadius:Math.max(n.outerRadius-r,0),pixelMargin:r,startAngle:n.startAngle,endAngle:n.endAngle,fullCircles:Math.floor(n.circumference/De)};if(t.save(),t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,a.fullCircles){for(a.endAngle=a.startAngle+De,t.beginPath(),t.arc(a.x,a.y,a.outerRadius,a.startAngle,a.endAngle),t.arc(a.x,a.y,a.innerRadius,a.endAngle,a.startAngle,!0),t.closePath(),e=0;ee.x&&(t=Ve(t,"left","right")):e.basen?n:r,r:u.right||a<0?0:a>t?t:a,b:u.bottom||i<0?0:i>n?n:i,l:u.left||o<0?0:o>t?t:o}}function Be(e){var t=Re(e),n=t.right-t.left,r=t.bottom-t.top,a=$e(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r},inner:{x:t.left+a.l,y:t.top+a.t,w:n-a.l-a.r,h:r-a.t-a.b}}}function qe(e,t,n){var r=null===t,a=null===n,i=!(!e||r&&a)&&Re(e);return i&&(r||t>=i.left&&t<=i.right)&&(a||n>=i.top&&n<=i.bottom)}Z._set("global",{elements:{rectangle:{backgroundColor:Ne,borderColor:Ne,borderSkipped:"bottom",borderWidth:0}}});var Ge=ye.extend({_type:"rectangle",draw:function(){var e=this._chart.ctx,t=this._view,n=Be(t),r=n.outer,a=n.inner;e.fillStyle=t.backgroundColor,e.fillRect(r.x,r.y,r.w,r.h),r.w===a.w&&r.h===a.h||(e.save(),e.beginPath(),e.rect(r.x,r.y,r.w,r.h),e.clip(),e.fillStyle=t.borderColor,e.rect(a.x,a.y,a.w,a.h),e.fill("evenodd"),e.restore())},height:function(){var e=this._view;return e.base-e.y},inRange:function(e,t){return qe(this._view,e,t)},inLabelRange:function(e,t){var n=this._view;return We(n)?qe(n,e,null):qe(n,null,t)},inXRange:function(e){return qe(this._view,e,null)},inYRange:function(e){return qe(this._view,null,e)},getCenterPoint:function(){var e,t,n=this._view;return We(n)?(e=n.x,t=(n.y+n.base)/2):(e=(n.x+n.base)/2,t=n.y),{x:e,y:t}},getArea:function(){var e=this._view;return We(e)?e.width*Math.abs(e.y-e.base):e.height*Math.abs(e.x-e.base)},tooltipPosition:function(){var e=this._view;return{x:e.x,y:e.y}}}),Je={},Qe=Ae,Ze=He,Ke=Ie,Xe=Ge;Je.Arc=Qe,Je.Line=Ze,Je.Point=Ke,Je.Rectangle=Xe;var et=le._deprecated,tt=le.valueOrDefault;function nt(e,t){var n,r,a,i,o=e._length;for(a=1,i=t.length;a0?Math.min(o,Math.abs(r-n)):o,n=r;return o}function rt(e,t,n){var r,a,i=n.barThickness,o=t.stackCount,s=t.pixels[e],u=le.isNullOrUndef(i)?nt(t.scale,t.pixels):-1;return le.isNullOrUndef(i)?(r=u*n.categoryPercentage,a=n.barPercentage):(r=i*o,a=1),{chunk:r/o,ratio:a,start:s-r/2}}function at(e,t,n){var r,a,i=t.pixels,o=i[e],s=e>0?i[e-1]:null,u=e=0&&_.min>=0?_.min:_.max,M=void 0===_.start?_.end:_.max>=0&&_.min>=0?_.max-_.min:_.min-_.max,w=p.length;if(g||void 0===g&&void 0!==v)for(r=0;r=0&&l.max>=0?l.max:l.min,(_.min<0&&i<0||_.max>=0&&i>0)&&(b+=i))}return o=f.getPixelForValue(b),s=f.getPixelForValue(b+M),u=s-o,void 0!==y&&Math.abs(u)=0&&!h||M<0&&h?o-y:o+y),{size:u,base:o,head:s,center:s+u/2}},calculateBarIndexPixels:function(e,t,n,r){var a=this,i="flex"===r.barThickness?at(t,n,r):rt(t,n,r),o=a.getStackIndex(e,a.getMeta().stack),s=i.start+i.chunk*o+i.chunk/2,u=Math.min(tt(r.maxBarThickness,1/0),i.chunk*i.ratio);return{base:s-u/2,head:s+u/2,center:s,size:u}},draw:function(){var e=this,t=e.chart,n=e._getValueScale(),r=e.getMeta().data,a=e.getDataset(),i=r.length,o=0;for(le.canvas.clipArea(t.ctx,t.chartArea);o=ct?-dt:g<-ct?dt:0;var v=g+_,b=Math.cos(g),M=Math.sin(g),w=Math.cos(v),L=Math.sin(v),k=g<=0&&v>=0||v>=dt,x=g<=ft&&v>=ft||v>=dt+ft,Y=g===-ct||v>=ct,D=g<=-ft&&v>=-ft||v>=ct+ft,S=Y?-1:Math.min(b,b*p,w,w*p),T=D?-1:Math.min(M,M*p,L,L*p),O=k?1:Math.max(b,b*p,w,w*p),A=x?1:Math.max(M,M*p,L,L*p);l=(O-S)/2,c=(A-T)/2,d=-(O+S)/2,f=-(A+T)/2}for(r=0,a=m.length;r0&&!isNaN(e)?dt*(Math.abs(e)/t):0},getMaxBorderWidth:function(e){var t,n,r,a,i,o,s,u,l=this,c=0,d=l.chart;if(!e)for(t=0,n=d.data.datasets.length;tc?s:c,c=u>c?u:c);return c},setHoverStyle:function(e){var t=e._model,n=e._options,r=le.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth},t.backgroundColor=lt(n.hoverBackgroundColor,r(n.backgroundColor)),t.borderColor=lt(n.hoverBorderColor,r(n.borderColor)),t.borderWidth=lt(n.hoverBorderWidth,n.borderWidth)},_getRingWeightOffset:function(e){for(var t=0,n=0;n0&&yt(l[e-1]._model,u)&&(n.controlPointPreviousX=c(n.controlPointPreviousX,u.left,u.right),n.controlPointPreviousY=c(n.controlPointPreviousY,u.top,u.bottom)),e0&&(i=e.getDatasetMeta(i[0]._datasetIndex).data),i},"x-axis":function(e,t){return Ht(e,t,{intersect:!1})},point:function(e,t){var n=Tt(t,e);return At(e,n)},nearest:function(e,t,n){var r=Tt(t,e);n.axis=n.axis||"xy";var a=jt(n.axis);return Pt(e,r,n.intersect,a)},x:function(e,t,n){var r=Tt(t,e),a=[],i=!1;return Ot(e,(function(e){e.inXRange(r.x)&&a.push(e),e.inRange(r.x,r.y)&&(i=!0)})),n.intersect&&!i&&(a=[]),a},y:function(e,t,n){var r=Tt(t,e),a=[],i=!1;return Ot(e,(function(e){e.inYRange(r.y)&&a.push(e),e.inRange(r.x,r.y)&&(i=!0)})),n.intersect&&!i&&(a=[]),a}}},Et=le.extend;function zt(e,t){return le.where(e,(function(e){return e.pos===t}))}function Ft(e,t){return e.sort((function(e,n){var r=t?n:e,a=t?e:n;return r.weight===a.weight?r.index-a.index:r.weight-a.weight}))}function It(e){var t,n,r,a=[];for(t=0,n=(e||[]).length;t div {\n\tposition: absolute;\n\twidth: 1000000px;\n\theight: 1000000px;\n\tleft: 0;\n\ttop: 0;\n}\n\n.chartjs-size-monitor-shrink > div {\n\tposition: absolute;\n\twidth: 200%;\n\theight: 200%;\n\tleft: 0;\n\ttop: 0;\n}\n",Zt=Object.freeze({__proto__:null,default:Qt}),Kt=n(Zt),Xt="$chartjs",en="chartjs-",tn=en+"size-monitor",nn=en+"render-monitor",rn=en+"render-animation",an=["animationstart","webkitAnimationStart"],on={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function sn(e,t){var n=le.getStyle(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?Number(r[1]):void 0}function un(e,t){var n=e.style,r=e.getAttribute("height"),a=e.getAttribute("width");if(e[Xt]={initial:{height:r,width:a,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===a||""===a){var i=sn(e,"width");void 0!==i&&(e.width=i)}if(null===r||""===r)if(""===e.style.height)e.height=e.width/(t.options.aspectRatio||2);else{var o=sn(e,"height");void 0!==i&&(e.height=o)}return e}var ln=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("e",null,t)}catch(n){}return e}(),cn=!!ln&&{passive:!0};function dn(e,t,n){e.addEventListener(t,n,cn)}function fn(e,t,n){e.removeEventListener(t,n,cn)}function hn(e,t,n,r,a){return{type:e,chart:t,native:a||null,x:void 0!==n?n:null,y:void 0!==r?r:null}}function mn(e,t){var n=on[e.type]||e.type,r=le.getRelativePosition(e,t);return hn(n,t,r.x,r.y,e)}function pn(e,t){var n=!1,r=[];return function(){r=Array.prototype.slice.call(arguments),t=t||this,n||(n=!0,le.requestAnimFrame.call(window,(function(){n=!1,e.apply(t,r)})))}}function _n(e){var t=document.createElement("div");return t.className=e||"",t}function yn(e){var t=1e6,n=_n(tn),r=_n(tn+"-expand"),a=_n(tn+"-shrink");r.appendChild(_n()),a.appendChild(_n()),n.appendChild(r),n.appendChild(a),n._reset=function(){r.scrollLeft=t,r.scrollTop=t,a.scrollLeft=t,a.scrollTop=t};var i=function(){n._reset(),e()};return dn(r,"scroll",i.bind(r,"expand")),dn(a,"scroll",i.bind(a,"shrink")),n}function gn(e,t){var n=e[Xt]||(e[Xt]={}),r=n.renderProxy=function(e){e.animationName===rn&&t()};le.each(an,(function(t){dn(e,t,r)})),n.reflow=!!e.offsetParent,e.classList.add(nn)}function vn(e){var t=e[Xt]||{},n=t.renderProxy;n&&(le.each(an,(function(t){fn(e,t,n)})),delete t.renderProxy),e.classList.remove(nn)}function bn(e,t,n){var r=e[Xt]||(e[Xt]={}),a=r.resizer=yn(pn((function(){if(r.resizer){var a=n.options.maintainAspectRatio&&e.parentNode,i=a?a.clientWidth:0;t(hn("resize",n)),a&&a.clientWidth0){var i=e[0];i.label?n=i.label:i.xLabel?n=i.xLabel:a>0&&i.index-1?e.split("\n"):e}function jn(e){var t=e._xScale,n=e._yScale||e._scale,r=e._index,a=e._datasetIndex,i=e._chart.getDatasetMeta(a).controller,o=i._getIndexScale(),s=i._getValueScale();return{xLabel:t?t.getLabelForIndex(r,a):"",yLabel:n?n.getLabelForIndex(r,a):"",label:o?""+o.getLabelForIndex(r,a):"",value:s?""+s.getLabelForIndex(r,a):"",index:r,datasetIndex:a,x:e._model.x,y:e._model.y}}function Hn(e){var t=Z.global;return{xPadding:e.xPadding,yPadding:e.yPadding,xAlign:e.xAlign,yAlign:e.yAlign,rtl:e.rtl,textDirection:e.textDirection,bodyFontColor:e.bodyFontColor,_bodyFontFamily:Sn(e.bodyFontFamily,t.defaultFontFamily),_bodyFontStyle:Sn(e.bodyFontStyle,t.defaultFontStyle),_bodyAlign:e.bodyAlign,bodyFontSize:Sn(e.bodyFontSize,t.defaultFontSize),bodySpacing:e.bodySpacing,titleFontColor:e.titleFontColor,_titleFontFamily:Sn(e.titleFontFamily,t.defaultFontFamily),_titleFontStyle:Sn(e.titleFontStyle,t.defaultFontStyle),titleFontSize:Sn(e.titleFontSize,t.defaultFontSize),_titleAlign:e.titleAlign,titleSpacing:e.titleSpacing,titleMarginBottom:e.titleMarginBottom,footerFontColor:e.footerFontColor,_footerFontFamily:Sn(e.footerFontFamily,t.defaultFontFamily),_footerFontStyle:Sn(e.footerFontStyle,t.defaultFontStyle),footerFontSize:Sn(e.footerFontSize,t.defaultFontSize),_footerAlign:e.footerAlign,footerSpacing:e.footerSpacing,footerMarginTop:e.footerMarginTop,caretSize:e.caretSize,cornerRadius:e.cornerRadius,backgroundColor:e.backgroundColor,opacity:0,legendColorBackground:e.multiKeyBackground,displayColors:e.displayColors,borderColor:e.borderColor,borderWidth:e.borderWidth}}function Cn(e,t){var n=e._chart.ctx,r=2*t.yPadding,a=0,i=t.body,o=i.reduce((function(e,t){return e+t.before.length+t.lines.length+t.after.length}),0);o+=t.beforeBody.length+t.afterBody.length;var s=t.title.length,u=t.footer.length,l=t.titleFontSize,c=t.bodyFontSize,d=t.footerFontSize;r+=s*l,r+=s?(s-1)*t.titleSpacing:0,r+=s?t.titleMarginBottom:0,r+=o*c,r+=o?(o-1)*t.bodySpacing:0,r+=u?t.footerMarginTop:0,r+=u*d,r+=u?(u-1)*t.footerSpacing:0;var f=0,h=function(e){a=Math.max(a,n.measureText(e).width+f)};return n.font=le.fontString(l,t._titleFontStyle,t._titleFontFamily),le.each(t.title,h),n.font=le.fontString(c,t._bodyFontStyle,t._bodyFontFamily),le.each(t.beforeBody.concat(t.afterBody),h),f=t.displayColors?c+2:0,le.each(i,(function(e){le.each(e.before,h),le.each(e.lines,h),le.each(e.after,h)})),f=0,n.font=le.fontString(d,t._footerFontStyle,t._footerFontFamily),le.each(t.footer,h),a+=2*t.xPadding,{width:a,height:r}}function En(e,t){var n,r,a,i,o,s=e._model,u=e._chart,l=e._chart.chartArea,c="center",d="center";s.yu.height-t.height&&(d="bottom");var f=(l.left+l.right)/2,h=(l.top+l.bottom)/2;"center"===d?(n=function(e){return e<=f},r=function(e){return e>f}):(n=function(e){return e<=t.width/2},r=function(e){return e>=u.width-t.width/2}),a=function(e){return e+t.width+s.caretSize+s.caretPadding>u.width},i=function(e){return e-t.width-s.caretSize-s.caretPadding<0},o=function(e){return e<=h?"top":"bottom"},n(s.x)?(c="left",a(s.x)&&(c="center",d=o(s.y))):r(s.x)&&(c="right",i(s.x)&&(c="center",d=o(s.y)));var m=e._options;return{xAlign:m.xAlign?m.xAlign:c,yAlign:m.yAlign?m.yAlign:d}}function zn(e,t,n,r){var a=e.x,i=e.y,o=e.caretSize,s=e.caretPadding,u=e.cornerRadius,l=n.xAlign,c=n.yAlign,d=o+s,f=u+s;return"right"===l?a-=t.width:"center"===l&&(a-=t.width/2,a+t.width>r.width&&(a=r.width-t.width),a<0&&(a=0)),"top"===c?i+=d:i-="bottom"===c?t.height+d:t.height/2,"center"===c?"left"===l?a+=d:"right"===l&&(a-=d):"left"===l?a-=f:"right"===l&&(a+=f),{x:a,y:i}}function Fn(e,t){return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-e.xPadding:e.x+e.xPadding}function In(e){return An([],Pn(e))}var Nn=ye.extend({initialize:function(){this._model=Hn(this._options),this._lastActive=[]},getTitle:function(){var e=this,t=e._options,n=t.callbacks,r=n.beforeTitle.apply(e,arguments),a=n.title.apply(e,arguments),i=n.afterTitle.apply(e,arguments),o=[];return o=An(o,Pn(r)),o=An(o,Pn(a)),o=An(o,Pn(i)),o},getBeforeBody:function(){return In(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(e,t){var n=this,r=n._options.callbacks,a=[];return le.each(e,(function(e){var i={before:[],lines:[],after:[]};An(i.before,Pn(r.beforeLabel.call(n,e,t))),An(i.lines,r.label.call(n,e,t)),An(i.after,Pn(r.afterLabel.call(n,e,t))),a.push(i)})),a},getAfterBody:function(){return In(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var e=this,t=e._options.callbacks,n=t.beforeFooter.apply(e,arguments),r=t.footer.apply(e,arguments),a=t.afterFooter.apply(e,arguments),i=[];return i=An(i,Pn(n)),i=An(i,Pn(r)),i=An(i,Pn(a)),i},update:function(e){var t,n,r=this,a=r._options,i=r._model,o=r._model=Hn(a),s=r._active,u=r._data,l={xAlign:i.xAlign,yAlign:i.yAlign},c={x:i.x,y:i.y},d={width:i.width,height:i.height},f={x:i.caretX,y:i.caretY};if(s.length){o.opacity=1;var h=[],m=[];f=On[a.position].call(r,s,r._eventPosition);var p=[];for(t=0,n=s.length;t0&&n.stroke()},draw:function(){var e=this._chart.ctx,t=this._view;if(0!==t.opacity){var n={width:t.width,height:t.height},r={x:t.x,y:t.y},a=Math.abs(t.opacity<.001)?0:t.opacity,i=t.title.length||t.beforeBody.length||t.body.length||t.afterBody.length||t.footer.length;this._options.enabled&&i&&(e.save(),e.globalAlpha=a,this.drawBackground(r,t,e,n),r.y+=t.yPadding,le.rtl.overrideTextDirection(e,t.textDirection),this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),le.rtl.restoreTextDirection(e,t.textDirection),e.restore())}},handleEvent:function(e){var t=this,n=t._options,r=!1;return t._lastActive=t._lastActive||[],"mouseout"===e.type?t._active=[]:(t._active=t._chart.getElementsAtEventForMode(e,n.mode,n),n.reverse&&t._active.reverse()),r=!le.arrayEquals(t._active,t._lastActive),r&&(t._lastActive=t._active,(n.enabled||n.custom)&&(t._eventPosition={x:e.x,y:e.y},t.update(!0),t.pivot())),r}}),Wn=On,Rn=Nn;Rn.positioners=Wn;var Vn=le.valueOrDefault;function Un(){return le.merge({},[].slice.call(arguments),{merger:function(e,t,n,r){if("xAxes"===e||"yAxes"===e){var a,i,o,s=n[e].length;for(t[e]||(t[e]=[]),a=0;a=t[e].length&&t[e].push({}),!t[e][a].type||o.type&&o.type!==t[e][a].type?le.merge(t[e][a],[Dn.getScaleDefaults(i),o]):le.merge(t[e][a],o)}else le._merger(e,t,n,r)}})}function $n(){return le.merge({},[].slice.call(arguments),{merger:function(e,t,n,r){var a=t[e]||{},i=n[e];"scales"===e?t[e]=Un(a,i):"scale"===e?t[e]=le.merge(a,[Dn.getScaleDefaults(i.type),i]):le._merger(e,t,n,r)}})}function Bn(e){e=e||{};var t=e.data=e.data||{};return t.datasets=t.datasets||[],t.labels=t.labels||[],e.options=$n(Z.global,Z[e.type],e.options||{}),e}function qn(e){var t=e.options;le.each(e.scales,(function(t){Gt.removeBox(e,t)})),t=$n(Z.global,Z[e.config.type],t),e.options=e.config.options=t,e.ensureScalesHaveIDs(),e.buildOrUpdateScales(),e.tooltip._options=t.tooltips,e.tooltip.initialize()}function Gn(e,t,n){var r,a=function(e){return e.id===r};do{r=t+n++}while(le.findIndex(e,a)>=0);return r}function Jn(e){return"top"===e||"bottom"===e}function Qn(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}Z._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var Zn=function(e,t){return this.construct(e,t),this};le.extend(Zn.prototype,{construct:function(e,t){var n=this;t=Bn(t);var r=xn.acquireContext(e,t),a=r&&r.canvas,i=a&&a.height,o=a&&a.width;n.id=le.uid(),n.ctx=r,n.canvas=a,n.config=t,n.width=o,n.height=i,n.aspectRatio=i?o/i:null,n.options=t.options,n._bufferedRender=!1,n._layers=[],n.chart=n,n.controller=n,Zn.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(e){n.config.data=e}}),r&&a?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var e=this;return Yn.notify(e,"beforeInit"),le.retinaScale(e,e.options.devicePixelRatio),e.bindEvents(),e.options.responsive&&e.resize(!0),e.initToolTip(),Yn.notify(e,"afterInit"),e},clear:function(){return le.canvas.clear(this),this},stop:function(){return be.cancelAnimation(this),this},resize:function(e){var t=this,n=t.options,r=t.canvas,a=n.maintainAspectRatio&&t.aspectRatio||null,i=Math.max(0,Math.floor(le.getMaximumWidth(r))),o=Math.max(0,Math.floor(a?i/a:le.getMaximumHeight(r)));if((t.width!==i||t.height!==o)&&(r.width=t.width=i,r.height=t.height=o,r.style.width=i+"px",r.style.height=o+"px",le.retinaScale(t,n.devicePixelRatio),!e)){var s={width:i,height:o};Yn.notify(t,"resize",[s]),n.onResize&&n.onResize(t,s),t.stop(),t.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var e=this.options,t=e.scales||{},n=e.scale;le.each(t.xAxes,(function(e,n){e.id||(e.id=Gn(t.xAxes,"x-axis-",n))})),le.each(t.yAxes,(function(e,n){e.id||(e.id=Gn(t.yAxes,"y-axis-",n))})),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var e=this,t=e.options,n=e.scales||{},r=[],a=Object.keys(n).reduce((function(e,t){return e[t]=!1,e}),{});t.scales&&(r=r.concat((t.scales.xAxes||[]).map((function(e){return{options:e,dtype:"category",dposition:"bottom"}})),(t.scales.yAxes||[]).map((function(e){return{options:e,dtype:"linear",dposition:"left"}})))),t.scale&&r.push({options:t.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),le.each(r,(function(t){var r=t.options,i=r.id,o=Vn(r.type,t.dtype);Jn(r.position)!==Jn(t.dposition)&&(r.position=t.dposition),a[i]=!0;var s=null;if(i in n&&n[i].type===o)s=n[i],s.options=r,s.ctx=e.ctx,s.chart=e;else{var u=Dn.getScaleConstructor(o);if(!u)return;s=new u({id:i,type:o,options:r,ctx:e.ctx,chart:e}),n[s.id]=s}s.mergeTicksOptions(),t.isDefault&&(e.scale=s)})),le.each(a,(function(e,t){e||delete n[t]})),e.scales=n,Dn.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e,t,n=this,r=[],a=n.data.datasets;for(e=0,t=a.length;e=0;--n)r.drawDataset(t[n],e);Yn.notify(r,"afterDatasetsDraw",[e])}},drawDataset:function(e,t){var n=this,r={meta:e,index:e.index,easingValue:t};!1!==Yn.notify(n,"beforeDatasetDraw",[r])&&(e.controller.draw(t),Yn.notify(n,"afterDatasetDraw",[r]))},_drawTooltip:function(e){var t=this,n=t.tooltip,r={tooltip:n,easingValue:e};!1!==Yn.notify(t,"beforeTooltipDraw",[r])&&(n.draw(),Yn.notify(t,"afterTooltipDraw",[r]))},getElementAtEvent:function(e){return Ct.modes.single(this,e)},getElementsAtEvent:function(e){return Ct.modes.label(this,e,{intersect:!0})},getElementsAtXAxis:function(e){return Ct.modes["x-axis"](this,e,{intersect:!0})},getElementsAtEventForMode:function(e,t,n){var r=Ct.modes[t];return"function"===typeof r?r(this,e,n):[]},getDatasetAtEvent:function(e){return Ct.modes.dataset(this,e,{intersect:!0})},getDatasetMeta:function(e){var t=this,n=t.data.datasets[e];n._meta||(n._meta={});var r=n._meta[t.id];return r||(r=n._meta[t.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n.order||0,index:e}),r},getVisibleDatasetCount:function(){for(var e=0,t=0,n=this.data.datasets.length;t=0;r--){var a=e[r];if(t(a))return a}},le.isNumber=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},le.almostEquals=function(e,t,n){return Math.abs(e-t)=e},le.max=function(e){return e.reduce((function(e,t){return isNaN(t)?e:Math.max(e,t)}),Number.NEGATIVE_INFINITY)},le.min=function(e){return e.reduce((function(e,t){return isNaN(t)?e:Math.min(e,t)}),Number.POSITIVE_INFINITY)},le.sign=Math.sign?function(e){return Math.sign(e)}:function(e){return e=+e,0===e||isNaN(e)?e:e>0?1:-1},le.toRadians=function(e){return e*(Math.PI/180)},le.toDegrees=function(e){return e*(180/Math.PI)},le._decimalPlaces=function(e){if(le.isFinite(e)){var t=1,n=0;while(Math.round(e*t)/t!==e)t*=10,n++;return n}},le.getAngleFromPoint=function(e,t){var n=t.x-e.x,r=t.y-e.y,a=Math.sqrt(n*n+r*r),i=Math.atan2(r,n);return i<-.5*Math.PI&&(i+=2*Math.PI),{angle:i,distance:a}},le.distanceBetweenPoints=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},le.aliasPixel=function(e){return e%2===0?0:.5},le._alignPixel=function(e,t,n){var r=e.currentDevicePixelRatio,a=n/2;return Math.round((t-a)*r)/r+a},le.splineCurve=function(e,t,n,r){var a=e.skip?t:e,i=t,o=n.skip?t:n,s=Math.sqrt(Math.pow(i.x-a.x,2)+Math.pow(i.y-a.y,2)),u=Math.sqrt(Math.pow(o.x-i.x,2)+Math.pow(o.y-i.y,2)),l=s/(s+u),c=u/(s+u);l=isNaN(l)?0:l,c=isNaN(c)?0:c;var d=r*l,f=r*c;return{previous:{x:i.x-d*(o.x-a.x),y:i.y-d*(o.y-a.y)},next:{x:i.x+f*(o.x-a.x),y:i.y+f*(o.y-a.y)}}},le.EPSILON=Number.EPSILON||1e-14,le.splineCurveMonotone=function(e){var t,n,r,a,i,o,s,u,l,c=(e||[]).map((function(e){return{model:e._model,deltaK:0,mK:0}})),d=c.length;for(t=0;t0?c[t-1]:null,a=t0?c[t-1]:null,a=t=e.length-1?e[0]:e[t+1]:t>=e.length-1?e[e.length-1]:e[t+1]},le.previousItem=function(e,t,n){return n?t<=0?e[e.length-1]:e[t-1]:t<=0?e[0]:e[t-1]},le.niceNum=function(e,t){var n,r=Math.floor(le.log10(e)),a=e/Math.pow(10,r);return n=t?a<1.5?1:a<3?2:a<7?5:10:a<=1?1:a<=2?2:a<=5?5:10,n*Math.pow(10,r)},le.requestAnimFrame=function(){return"undefined"===typeof window?function(e){e()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return window.setTimeout(e,1e3/60)}}(),le.getRelativePosition=function(e,t){var n,r,a=e.originalEvent||e,i=e.target||e.srcElement,o=i.getBoundingClientRect(),s=a.touches;s&&s.length>0?(n=s[0].clientX,r=s[0].clientY):(n=a.clientX,r=a.clientY);var u=parseFloat(le.getStyle(i,"padding-left")),l=parseFloat(le.getStyle(i,"padding-top")),c=parseFloat(le.getStyle(i,"padding-right")),d=parseFloat(le.getStyle(i,"padding-bottom")),f=o.right-o.left-u-c,h=o.bottom-o.top-l-d;return n=Math.round((n-o.left-u)/f*i.width/t.currentDevicePixelRatio),r=Math.round((r-o.top-l)/h*i.height/t.currentDevicePixelRatio),{x:n,y:r}},le.getConstraintWidth=function(e){return n(e,"max-width","clientWidth")},le.getConstraintHeight=function(e){return n(e,"max-height","clientHeight")},le._calculatePadding=function(e,t,n){return t=le.getStyle(e,t),t.indexOf("%")>-1?n*parseInt(t,10)/100:parseInt(t,10)},le._getParentNode=function(e){var t=e.parentNode;return t&&"[object ShadowRoot]"===t.toString()&&(t=t.host),t},le.getMaximumWidth=function(e){var t=le._getParentNode(e);if(!t)return e.clientWidth;var n=t.clientWidth,r=le._calculatePadding(t,"padding-left",n),a=le._calculatePadding(t,"padding-right",n),i=n-r-a,o=le.getConstraintWidth(e);return isNaN(o)?i:Math.min(i,o)},le.getMaximumHeight=function(e){var t=le._getParentNode(e);if(!t)return e.clientHeight;var n=t.clientHeight,r=le._calculatePadding(t,"padding-top",n),a=le._calculatePadding(t,"padding-bottom",n),i=n-r-a,o=le.getConstraintHeight(e);return isNaN(o)?i:Math.min(i,o)},le.getStyle=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,null).getPropertyValue(t)},le.retinaScale=function(e,t){var n=e.currentDevicePixelRatio=t||"undefined"!==typeof window&&window.devicePixelRatio||1;if(1!==n){var r=e.canvas,a=e.height,i=e.width;r.height=a*n,r.width=i*n,e.ctx.scale(n,n),r.style.height||r.style.width||(r.style.height=a+"px",r.style.width=i+"px")}},le.fontString=function(e,t,n){return t+" "+e+"px "+n},le.longestText=function(e,t,n,r){r=r||{};var a=r.data=r.data||{},i=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(a=r.data={},i=r.garbageCollect=[],r.font=t),e.font=t;var o,s,u,l,c,d=0,f=n.length;for(o=0;on.length){for(o=0;or&&(r=i),r},le.numberOfLabelLines=function(e){var t=1;return le.each(e,(function(e){le.isArray(e)&&e.length>t&&(t=e.length)})),t},le.color=z?function(e){return e instanceof CanvasGradient&&(e=Z.global.defaultColor),z(e)}:function(e){return console.error("Color.js not found!"),e},le.getHoverColor=function(e){return e instanceof CanvasPattern||e instanceof CanvasGradient?e:le.color(e).saturate(.5).darken(.1).rgbString()}};function er(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}function tr(e){this.options=e||{}}le.extend(tr.prototype,{formats:er,parse:er,format:er,add:er,diff:er,startOf:er,endOf:er,_create:function(e){return e}}),tr.override=function(e){le.extend(tr.prototype,e)};var nr=tr,rr={_date:nr},ar={formatters:{values:function(e){return le.isArray(e)?e:""+e},linear:function(e,t,n){var r=n.length>3?n[2]-n[1]:n[1]-n[0];Math.abs(r)>1&&e!==Math.floor(e)&&(r=e-Math.floor(e));var a=le.log10(Math.abs(r)),i="";if(0!==e){var o=Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]));if(o<1e-4){var s=le.log10(Math.abs(e)),u=Math.floor(s)-Math.floor(a);u=Math.max(Math.min(u,20),0),i=e.toExponential(u)}else{var l=-1*Math.floor(a);l=Math.max(Math.min(l,20),0),i=e.toFixed(l)}}else i="0";return i},logarithmic:function(e,t,n){var r=e/Math.pow(10,Math.floor(le.log10(e)));return 0===e?"0":1===r||2===r||5===r||0===t||t===n.length-1?e.toExponential():""}}},ir=le.isArray,or=le.isNullOrUndef,sr=le.valueOrDefault,ur=le.valueAtIndexOrDefault;function lr(e,t){for(var n=[],r=e.length/t,a=0,i=e.length;au+l)))return o}function dr(e,t){le.each(e,(function(e){var n,r=e.gc,a=r.length/2;if(a>t){for(n=0;nl)return i;return Math.max(l,1)}function br(e){var t,n,r=[];for(t=0,n=e.length;t=f||c<=1||!s.isHorizontal()?s.labelRotation=d:(e=s._getLabelSizes(),t=e.widest.width,n=e.highest.height-e.highest.offset,r=Math.min(s.maxWidth,s.chart.width-t),a=u.offset?s.maxWidth/c:r/(c-1),t+6>a&&(a=r/(c-(u.offset?.5:1)),i=s.maxHeight-hr(u.gridLines)-l.padding-mr(u.scaleLabel),o=Math.sqrt(t*t+n*n),h=le.toDegrees(Math.min(Math.asin(Math.min((e.highest.height+6)/a,1)),Math.asin(Math.min(i/o,1))-Math.asin(n/o))),h=Math.max(d,Math.min(f,h))),s.labelRotation=h)},afterCalculateTickRotation:function(){le.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){le.callback(this.options.beforeFit,[this])},fit:function(){var e=this,t=e.minSize={width:0,height:0},n=e.chart,r=e.options,a=r.ticks,i=r.scaleLabel,o=r.gridLines,s=e._isVisible(),u="bottom"===r.position,l=e.isHorizontal();if(l?t.width=e.maxWidth:s&&(t.width=hr(o)+mr(i)),l?s&&(t.height=hr(o)+mr(i)):t.height=e.maxHeight,a.display&&s){var c=_r(a),d=e._getLabelSizes(),f=d.first,h=d.last,m=d.widest,p=d.highest,_=.4*c.minor.lineHeight,y=a.padding;if(l){var g=0!==e.labelRotation,v=le.toRadians(e.labelRotation),b=Math.cos(v),M=Math.sin(v),w=M*m.width+b*(p.height-(g?p.offset:0))+(g?0:_);t.height=Math.min(e.maxHeight,t.height+w+y);var L,k,x=e.getPixelForTick(0)-e.left,Y=e.right-e.getPixelForTick(e.getTicks().length-1);g?(L=u?b*f.width+M*f.offset:M*(f.height-f.offset),k=u?M*(h.height-h.offset):b*h.width+M*h.offset):(L=f.width/2,k=h.width/2),e.paddingLeft=Math.max((L-x)*e.width/(e.width-x),0)+3,e.paddingRight=Math.max((k-Y)*e.width/(e.width-Y),0)+3}else{var D=a.mirror?0:m.width+y+_;t.width=Math.min(e.maxWidth,t.width+D),e.paddingTop=f.height/2,e.paddingBottom=h.height/2}}e.handleMargins(),l?(e.width=e._length=n.width-e.margins.left-e.margins.right,e.height=t.height):(e.width=t.width,e.height=e._length=n.height-e.margins.top-e.margins.bottom)},handleMargins:function(){var e=this;e.margins&&(e.margins.left=Math.max(e.paddingLeft,e.margins.left),e.margins.top=Math.max(e.paddingTop,e.margins.top),e.margins.right=Math.max(e.paddingRight,e.margins.right),e.margins.bottom=Math.max(e.paddingBottom,e.margins.bottom))},afterFit:function(){le.callback(this.options.afterFit,[this])},isHorizontal:function(){var e=this.options.position;return"top"===e||"bottom"===e},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(e){if(or(e))return NaN;if(("number"===typeof e||e instanceof Number)&&!isFinite(e))return NaN;if(e)if(this.isHorizontal()){if(void 0!==e.x)return this.getRightValue(e.x)}else if(void 0!==e.y)return this.getRightValue(e.y);return e},_convertTicksToLabels:function(e){var t,n,r,a=this;for(a.ticks=e.map((function(e){return e.value})),a.beforeTickToLabelConversion(),t=a.convertTicksToLabels(e)||a.ticks,a.afterTickToLabelConversion(),n=0,r=e.length;nr-1?null:t.getPixelForDecimal(e*a+(n?a/2:0))},getPixelForDecimal:function(e){var t=this;return t._reversePixels&&(e=1-e),t._startPixel+e*t._length},getDecimalForPixel:function(e){var t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var e=this,t=e.min,n=e.max;return e.beginAtZero?0:t<0&&n<0?n:t>0&&n>0?t:0},_autoSkip:function(e){var t,n,r,a,i=this,o=i.options.ticks,s=i._length,u=o.maxTicksLimit||s/i._tickSize()+1,l=o.major.enabled?br(e):[],c=l.length,d=l[0],f=l[c-1];if(c>u)return Mr(e,l,c/u),yr(e);if(r=vr(l,e,s,u),c>0){for(t=0,n=c-1;t1?(f-d)/(c-1):null,wr(e,r,le.isNullOrUndef(a)?0:d-a,d),wr(e,r,f,le.isNullOrUndef(a)?e.length:f+a),yr(e)}return wr(e,r),yr(e)},_tickSize:function(){var e=this,t=e.options.ticks,n=le.toRadians(e.labelRotation),r=Math.abs(Math.cos(n)),a=Math.abs(Math.sin(n)),i=e._getLabelSizes(),o=t.autoSkipPadding||0,s=i?i.widest.width+o:0,u=i?i.highest.height+o:0;return e.isHorizontal()?u*r>s*a?s/r:u/a:u*a=0&&(o=e)),void 0!==i&&(e=n.indexOf(i),e>=0&&(s=e)),t.minIndex=o,t.maxIndex=s,t.min=n[o],t.max=n[s]},buildTicks:function(){var e=this,t=e._getLabels(),n=e.minIndex,r=e.maxIndex;e.ticks=0===n&&r===t.length-1?t:t.slice(n,r+1)},getLabelForIndex:function(e,t){var n=this,r=n.chart;return r.getDatasetMeta(t).controller._getValueScaleId()===n.id?n.getRightValue(r.data.datasets[t].data[e]):n._getLabels()[e]},_configure:function(){var e=this,t=e.options.offset,n=e.ticks;kr.prototype._configure.call(e),e.isHorizontal()||(e._reversePixels=!e._reversePixels),n&&(e._startValue=e.minIndex-(t?.5:0),e._valueRange=Math.max(n.length-(t?0:1),1))},getPixelForValue:function(e,t,n){var r,a,i,o=this;return xr(t)||xr(n)||(e=o.chart.data.datasets[n].data[t]),xr(e)||(r=o.isHorizontal()?e.x:e.y),(void 0!==r||void 0!==e&&isNaN(t))&&(a=o._getLabels(),e=le.valueOrDefault(r,e),i=a.indexOf(e),t=-1!==i?i:t,isNaN(t)&&(t=e)),o.getPixelForDecimal((t-o._startValue)/o._valueRange)},getPixelForTick:function(e){var t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e],e+this.minIndex)},getValueForPixel:function(e){var t=this,n=Math.round(t._startValue+t.getDecimalForPixel(e)*t._valueRange);return Math.min(Math.max(n,0),t.ticks.length-1)},getBasePixel:function(){return this.bottom}}),Sr=Yr;Dr._defaults=Sr;var Tr=le.noop,Or=le.isNullOrUndef;function Ar(e,t){var n,r,a,i,o=[],s=1e-14,u=e.stepSize,l=u||1,c=e.maxTicks-1,d=e.min,f=e.max,h=e.precision,m=t.min,p=t.max,_=le.niceNum((p-m)/c/l)*l;if(_c&&(_=le.niceNum(i*_/c/l)*l),u||Or(h)?n=Math.pow(10,le._decimalPlaces(_)):(n=Math.pow(10,h),_=Math.ceil(_*n)/n),r=Math.floor(m/_)*_,a=Math.ceil(p/_)*_,u&&(!Or(d)&&le.almostWhole(d/_,_/1e3)&&(r=d),!Or(f)&&le.almostWhole(f/_,_/1e3)&&(a=f)),i=(a-r)/_,i=le.almostEquals(i,Math.round(i),_/1e3)?Math.round(i):Math.ceil(i),r=Math.round(r*n)/n,a=Math.round(a*n)/n,o.push(Or(d)?r:d);for(var y=1;y0&&a>0&&(e.min=0)}var i=void 0!==n.min||void 0!==n.suggestedMin,o=void 0!==n.max||void 0!==n.suggestedMax;void 0!==n.min?e.min=n.min:void 0!==n.suggestedMin&&(null===e.min?e.min=n.suggestedMin:e.min=Math.min(e.min,n.suggestedMin)),void 0!==n.max?e.max=n.max:void 0!==n.suggestedMax&&(null===e.max?e.max=n.suggestedMax:e.max=Math.max(e.max,n.suggestedMax)),i!==o&&e.min>=e.max&&(i?e.max=e.min+1:e.min=e.max-1),e.min===e.max&&(e.max++,n.beginAtZero||e.min--)},getTickLimit:function(){var e,t=this,n=t.options.ticks,r=n.stepSize,a=n.maxTicksLimit;return r?e=Math.ceil(t.max/r)-Math.floor(t.min/r)+1:(e=t._computeTickLimit(),a=a||11),a&&(e=Math.min(a,e)),e},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:Tr,buildTicks:function(){var e=this,t=e.options,n=t.ticks,r=e.getTickLimit();r=Math.max(2,r);var a={maxTicks:r,min:n.min,max:n.max,precision:n.precision,stepSize:le.valueOrDefault(n.fixedStepSize,n.stepSize)},i=e.ticks=Ar(a,e);e.handleDirectionalChanges(),e.max=le.max(i),e.min=le.min(i),n.reverse?(i.reverse(),e.start=e.max,e.end=e.min):(e.start=e.min,e.end=e.max)},convertTicksToLabels:function(){var e=this;e.ticksAsNumbers=e.ticks.slice(),e.zeroLineIndex=e.ticks.indexOf(0),kr.prototype.convertTicksToLabels.call(e)},_configure:function(){var e,t=this,n=t.getTicks(),r=t.min,a=t.max;kr.prototype._configure.call(t),t.options.offset&&n.length&&(e=(a-r)/Math.max(n.length-1,1)/2,r-=e,a+=e),t._startValue=r,t._endValue=a,t._valueRange=a-r}}),jr={position:"left",ticks:{callback:ar.formatters.linear}},Hr=0,Cr=1;function Er(e,t,n){var r=[n.type,void 0===t&&void 0===n.stack?n.index:"",n.stack].join(".");return void 0===e[r]&&(e[r]={pos:[],neg:[]}),e[r]}function zr(e,t,n,r){var a,i,o=e.options,s=o.stacked,u=Er(t,s,n),l=u.pos,c=u.neg,d=r.length;for(a=0;at.length-1?null:this.getPixelForValue(t[e])}}),Nr=jr;Ir._defaults=Nr;var Wr=le.valueOrDefault,Rr=le.math.log10;function Vr(e,t){var n,r,a=[],i=Wr(e.min,Math.pow(10,Math.floor(Rr(t.min)))),o=Math.floor(Rr(t.max)),s=Math.ceil(t.max/Math.pow(10,o));0===i?(n=Math.floor(Rr(t.minNotZero)),r=Math.floor(t.minNotZero/Math.pow(10,n)),a.push(i),i=r*Math.pow(10,n)):(n=Math.floor(Rr(i)),r=Math.floor(i/Math.pow(10,n)));var u=n<0?Math.pow(10,Math.abs(n)):1;do{a.push(i),++r,10===r&&(r=1,++n,u=n>=0?1:u),i=Math.round(r*Math.pow(10,n)*u)/u}while(n=0?e:t}var Br=kr.extend({determineDataLimits:function(){var e,t,n,r,a,i,o=this,s=o.options,u=o.chart,l=u.data.datasets,c=o.isHorizontal();function d(e){return c?e.xAxisID===o.id:e.yAxisID===o.id}o.min=Number.POSITIVE_INFINITY,o.max=Number.NEGATIVE_INFINITY,o.minNotZero=Number.POSITIVE_INFINITY;var f=s.stacked;if(void 0===f)for(e=0;e0){var t=le.min(e),n=le.max(e);o.min=Math.min(o.min,t),o.max=Math.max(o.max,n)}}))}else for(e=0;e0?e.minNotZero=e.min:e.max<1?e.minNotZero=Math.pow(10,Math.floor(Rr(e.max))):e.minNotZero=n)},buildTicks:function(){var e=this,t=e.options.ticks,n=!e.isHorizontal(),r={min:$r(t.min),max:$r(t.max)},a=e.ticks=Vr(r,e);e.max=le.max(a),e.min=le.min(a),t.reverse?(n=!n,e.start=e.max,e.end=e.min):(e.start=e.min,e.end=e.max),n&&a.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),kr.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(e,t){return this._getScaleLabel(this.chart.data.datasets[t].data[e])},getPixelForTick:function(e){var t=this.tickValues;return e<0||e>t.length-1?null:this.getPixelForValue(t[e])},_getFirstTickValue:function(e){var t=Math.floor(Rr(e)),n=Math.floor(e/Math.pow(10,t));return n*Math.pow(10,t)},_configure:function(){var e=this,t=e.min,n=0;kr.prototype._configure.call(e),0===t&&(t=e._getFirstTickValue(e.minNotZero),n=Wr(e.options.ticks.fontSize,Z.global.defaultFontSize)/e._length),e._startValue=Rr(t),e._valueOffset=n,e._valueRange=(Rr(e.max)-Rr(t))/(1-n)},getPixelForValue:function(e){var t=this,n=0;return e=+t.getRightValue(e),e>t.min&&e>0&&(n=(Rr(e)-t._startValue)/t._valueRange+t._valueOffset),t.getPixelForDecimal(n)},getValueForPixel:function(e){var t=this,n=t.getDecimalForPixel(e);return 0===n&&0===t.min?0:Math.pow(10,t._startValue+(n-t._valueOffset)*t._valueRange)}}),qr=Ur;Br._defaults=qr;var Gr=le.valueOrDefault,Jr=le.valueAtIndexOrDefault,Qr=le.options.resolve,Zr={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:ar.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(e){return e}}};function Kr(e){var t=e.ticks;return t.display&&e.display?Gr(t.fontSize,Z.global.defaultFontSize)+2*t.backdropPaddingY:0}function Xr(e,t,n){return le.isArray(n)?{w:le.longestText(e,e.font,n),h:n.length*t}:{w:e.measureText(n).width,h:t}}function ea(e,t,n,r,a){return e===r||e===a?{start:t-n/2,end:t+n/2}:ea?{start:t-n,end:t}:{start:t,end:t+n}}function ta(e){var t,n,r,a=le.options._parseFont(e.options.pointLabels),i={l:0,r:e.width,t:0,b:e.height-e.paddingTop},o={};e.ctx.font=a.string,e._pointLabelSizes=[];var s=e.chart.data.labels.length;for(t=0;ti.r&&(i.r=c.end,o.r=u),d.starti.b&&(i.b=d.end,o.b=u)}e.setReductions(e.drawingArea,i,o)}function na(e){return 0===e||180===e?"center":e<180?"left":"right"}function ra(e,t,n,r){var a,i,o=n.y+r/2;if(le.isArray(t))for(a=0,i=t.length;a270||e<90)&&(n.y-=t.h)}function ia(e){var t=e.ctx,n=e.options,r=n.pointLabels,a=Kr(n),i=e.getDistanceFromCenterForValue(n.ticks.reverse?e.min:e.max),o=le.options._parseFont(r);t.save(),t.font=o.string,t.textBaseline="middle";for(var s=e.chart.data.labels.length-1;s>=0;s--){var u=0===s?a/2:0,l=e.getPointPosition(s,i+u+5),c=Jr(r.fontColor,s,Z.global.defaultFontColor);t.fillStyle=c;var d=e.getIndexAngle(s),f=le.toDegrees(d);t.textAlign=na(f),aa(f,e._pointLabelSizes[s],l),ra(t,e.pointLabels[s],l,o.lineHeight)}t.restore()}function oa(e,t,n,r){var a,i=e.ctx,o=t.circular,s=e.chart.data.labels.length,u=Jr(t.color,r-1),l=Jr(t.lineWidth,r-1);if((o||s)&&u&&l){if(i.save(),i.strokeStyle=u,i.lineWidth=l,i.setLineDash&&(i.setLineDash(t.borderDash||[]),i.lineDashOffset=t.borderDashOffset||0),i.beginPath(),o)i.arc(e.xCenter,e.yCenter,n,0,2*Math.PI);else{a=e.getPointPosition(0,n),i.moveTo(a.x,a.y);for(var c=1;c0&&r>0?n:0)},_drawGrid:function(){var e,t,n,r=this,a=r.ctx,i=r.options,o=i.gridLines,s=i.angleLines,u=Gr(s.lineWidth,o.lineWidth),l=Gr(s.color,o.color);if(i.pointLabels.display&&ia(r),o.display&&le.each(r.ticks,(function(e,n){0!==n&&(t=r.getDistanceFromCenterForValue(r.ticksAsNumbers[n]),oa(r,o,t,n))})),s.display&&u&&l){for(a.save(),a.lineWidth=u,a.strokeStyle=l,a.setLineDash&&(a.setLineDash(Qr([s.borderDash,o.borderDash,[]])),a.lineDashOffset=Qr([s.borderDashOffset,o.borderDashOffset,0])),e=r.chart.data.labels.length-1;e>=0;e--)t=r.getDistanceFromCenterForValue(i.ticks.reverse?r.min:r.max),n=r.getPointPosition(e,t),a.beginPath(),a.moveTo(r.xCenter,r.yCenter),a.lineTo(n.x,n.y),a.stroke();a.restore()}},_drawLabels:function(){var e=this,t=e.ctx,n=e.options,r=n.ticks;if(r.display){var a,i,o=e.getIndexAngle(0),s=le.options._parseFont(r),u=Gr(r.fontColor,Z.global.defaultFontColor);t.save(),t.font=s.string,t.translate(e.xCenter,e.yCenter),t.rotate(o),t.textAlign="center",t.textBaseline="middle",le.each(e.ticks,(function(n,o){(0!==o||r.reverse)&&(a=e.getDistanceFromCenterForValue(e.ticksAsNumbers[o]),r.showLabelBackdrop&&(i=t.measureText(n).width,t.fillStyle=r.backdropColor,t.fillRect(-i/2-r.backdropPaddingX,-a-s.size/2-r.backdropPaddingY,i+2*r.backdropPaddingX,s.size+2*r.backdropPaddingY)),t.fillStyle=u,t.fillText(n,0,-a))})),t.restore()}},_drawTitle:le.noop}),la=Zr;ua._defaults=la;var ca=le._deprecated,da=le.options.resolve,fa=le.valueOrDefault,ha=Number.MIN_SAFE_INTEGER||-9007199254740991,ma=Number.MAX_SAFE_INTEGER||9007199254740991,pa={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},_a=Object.keys(pa);function ya(e,t){return e-t}function ga(e){var t,n,r,a={},i=[];for(t=0,n=e.length;tt&&s=0&&o<=s){if(r=o+s>>1,a=e[r-1]||null,i=e[r],!a)return{lo:null,hi:i};if(i[t]n))return{lo:a,hi:i};s=r-1}}return{lo:i,hi:null}}function La(e,t,n,r){var a=wa(e,t,n),i=a.lo?a.hi?a.lo:e[e.length-2]:e[0],o=a.lo?a.hi?a.hi:e[e.length-1]:e[1],s=o[t]-i[t],u=s?(n-i[t])/s:0,l=(o[r]-i[r])*u;return i[r]+l}function ka(e,t){var n=e._adapter,r=e.options.time,a=r.parser,i=a||r.format,o=t;return"function"===typeof a&&(o=a(o)),le.isFinite(o)||(o="string"===typeof i?n.parse(o,i):n.parse(o)),null!==o?+o:(a||"function"!==typeof i||(o=i(t),le.isFinite(o)||(o=n.parse(o))),o)}function xa(e,t){if(le.isNullOrUndef(t))return null;var n=e.options.time,r=ka(e,e.getRightValue(t));return null===r?r:(n.round&&(r=+e._adapter.startOf(r,n.round)),r)}function Ya(e,t,n,r){var a,i,o,s=_a.length;for(a=_a.indexOf(e);a=_a.indexOf(n);i--)if(o=_a[i],pa[o].common&&e._adapter.diff(a,r,o)>=t-1)return o;return _a[n?_a.indexOf(n):0]}function Sa(e){for(var t=_a.indexOf(e)+1,n=_a.length;t1e5*l)throw t+" and "+n+" are too far apart with stepSize of "+l+" "+u;for(a=d;a=0&&(t[i].major=!0);return t}function Pa(e,t,n){var r,a,i=[],o={},s=t.length;for(r=0;r1?ga(m).sort(ya):m.sort(ya),f=Math.min(f,m[0]),h=Math.max(h,m[m.length-1])),f=xa(s,va(c))||f,h=xa(s,ba(c))||h,f=f===ma?+l.startOf(Date.now(),d):f,h=h===ha?+l.endOf(Date.now(),d)+1:h,s.min=Math.min(f,h),s.max=Math.max(f+1,h),s._table=[],s._timestamps={data:m,datasets:p,labels:_}},buildTicks:function(){var e,t,n,r=this,a=r.min,i=r.max,o=r.options,s=o.ticks,u=o.time,l=r._timestamps,c=[],d=r.getLabelCapacity(a),f=s.source,h=o.distribution;for(l="data"===f||"auto"===f&&"series"===h?l.data:"labels"===f?l.labels:Ta(r,a,i,d),"ticks"===o.bounds&&l.length&&(a=l[0],i=l[l.length-1]),a=xa(r,va(o))||a,i=xa(r,ba(o))||i,e=0,t=l.length;e=a&&n<=i&&c.push(n);return r.min=a,r.max=i,r._unit=u.unit||(s.autoSkip?Ya(u.minUnit,r.min,r.max,d):Da(r,c.length,u.minUnit,r.min,r.max)),r._majorUnit=s.major.enabled&&"year"!==r._unit?Sa(r._unit):void 0,r._table=Ma(r._timestamps.data,a,i,h),r._offsets=Oa(r._table,c,a,i,o),s.reverse&&c.reverse(),Pa(r,c,r._majorUnit)},getLabelForIndex:function(e,t){var n=this,r=n._adapter,a=n.chart.data,i=n.options.time,o=a.labels&&e=0&&e0?s:1}}),Ca=ja;Ha._defaults=Ca;var Ea={category:Dr,linear:Ir,logarithmic:Br,radialLinear:ua,time:Ha},za={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};rr._date.override("function"===typeof e?{_id:"moment",formats:function(){return za},parse:function(t,n){return"string"===typeof t&&"string"===typeof n?t=e(t,n):t instanceof e||(t=e(t)),t.isValid()?t.valueOf():null},format:function(t,n){return e(t).format(n)},add:function(t,n,r){return e(t).add(n,r).valueOf()},diff:function(t,n,r){return e(t).diff(e(n),r)},startOf:function(t,n,r){return t=e(t),"isoWeek"===n?t.isoWeekday(r).valueOf():t.startOf(n).valueOf()},endOf:function(t,n){return e(t).endOf(n).valueOf()},_create:function(t){return e(t)}}:{}),Z._set("global",{plugins:{filler:{propagate:!0}}});var Fa={dataset:function(e){var t=e.fill,n=e.chart,r=n.getDatasetMeta(t),a=r&&n.isDatasetVisible(t),i=a&&r.dataset._children||[],o=i.length||0;return o?function(e,t){return t=n)&&r;switch(i){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return i;default:return!1}}function Na(e){var t,n=e.el._model||{},r=e.el._scale||{},a=e.fill,i=null;if(isFinite(a))return null;if("start"===a?i=void 0===n.scaleBottom?r.bottom:n.scaleBottom:"end"===a?i=void 0===n.scaleTop?r.top:n.scaleTop:void 0!==n.scaleZero?i=n.scaleZero:r.getBasePixel&&(i=r.getBasePixel()),void 0!==i&&null!==i){if(void 0!==i.x&&void 0!==i.y)return i;if(le.isFinite(i))return t=r.isHorizontal(),{x:t?i:null,y:t?null:i}}return null}function Wa(e){var t,n,r,a,i,o=e.el._scale,s=o.options,u=o.chart.data.labels.length,l=e.fill,c=[];if(!u)return null;for(t=s.ticks.reverse?o.max:o.min,n=s.ticks.reverse?o.min:o.max,r=o.getPointPositionForValue(0,t),a=0;a0;--i)le.canvas.lineTo(e,n[i],n[i-1],!0);else for(o=n[0].cx,s=n[0].cy,u=Math.sqrt(Math.pow(n[0].x-o,2)+Math.pow(n[0].y-s,2)),i=a-1;i>0;--i)e.arc(o,s,u,n[i].angle,n[i-1].angle,!0)}}function qa(e,t,n,r,a,i){var o,s,u,l,c,d,f,h,m=t.length,p=r.spanGaps,_=[],y=[],g=0,v=0;for(e.beginPath(),o=0,s=m;o=0;--n)t=u[n].$filler,t&&t.visible&&(r=t.el,a=r._view,i=r._children||[],o=t.mapper,s=a.backgroundColor||Z.global.defaultColor,o&&s&&i.length&&(le.canvas.clipArea(l,e.chartArea),qa(l,i,o,a,s,r._loop),le.canvas.unclipArea(l)))}},Ja=le.rtl.getRtlAdapter,Qa=le.noop,Za=le.valueOrDefault;function Ka(e,t){return e.usePointStyle&&e.boxWidth>t?t:e.boxWidth}Z._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(e,t){var n=t.datasetIndex,r=this.chart,a=r.getDatasetMeta(n);a.hidden=null===a.hidden?!r.data.datasets[n].hidden:null,r.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(e){var t=e.data.datasets,n=e.options.legend||{},r=n.labels&&n.labels.usePointStyle;return e._getSortedDatasetMetas().map((function(n){var a=n.controller.getStyle(r?0:void 0);return{text:t[n.index].label,fillStyle:a.backgroundColor,hidden:!e.isDatasetVisible(n.index),lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:a.borderWidth,strokeStyle:a.borderColor,pointStyle:a.pointStyle,rotation:a.rotation,datasetIndex:n.index}}),this)}}},legendCallback:function(e){var t,n,r,a,i=document.createElement("ul"),o=e.data.datasets;for(i.setAttribute("class",e.id+"-legend"),t=0,n=o.length;tu.width)&&(d+=o+n.padding,c[c.length-(t>0?0:1)]=0),s[t]={left:0,top:0,width:i,height:o},c[c.length-1]+=i+n.padding})),u.height+=d}else{var f=n.padding,h=e.columnWidths=[],m=e.columnHeights=[],p=n.padding,_=0,y=0;le.each(e.legendItems,(function(e,t){var r=Ka(n,o),i=r+o/2+a.measureText(e.text).width;t>0&&y+o+2*f>u.height&&(p+=_+n.padding,h.push(_),m.push(y),_=0,y=0),_=Math.max(_,i),y+=o+f,s[t]={left:0,top:0,width:i,height:o}})),p+=_,h.push(_),m.push(y),u.width+=p}e.width=u.width,e.height=u.height}else e.width=u.width=e.height=u.height=0},afterFit:Qa,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var e=this,t=e.options,n=t.labels,r=Z.global,a=r.defaultColor,i=r.elements.line,o=e.height,s=e.columnHeights,u=e.width,l=e.lineWidths;if(t.display){var c,d=Ja(t.rtl,e.left,e.minSize.width),f=e.ctx,h=Za(n.fontColor,r.defaultFontColor),m=le.options._parseFont(n),p=m.size;f.textAlign=d.textAlign("left"),f.textBaseline="middle",f.lineWidth=.5,f.strokeStyle=h,f.fillStyle=h,f.font=m.string;var _=Ka(n,p),y=e.legendHitBoxes,g=function(e,t,r){if(!(isNaN(_)||_<=0)){f.save();var o=Za(r.lineWidth,i.borderWidth);if(f.fillStyle=Za(r.fillStyle,a),f.lineCap=Za(r.lineCap,i.borderCapStyle),f.lineDashOffset=Za(r.lineDashOffset,i.borderDashOffset),f.lineJoin=Za(r.lineJoin,i.borderJoinStyle),f.lineWidth=o,f.strokeStyle=Za(r.strokeStyle,a),f.setLineDash&&f.setLineDash(Za(r.lineDash,i.borderDash)),n&&n.usePointStyle){var s=_*Math.SQRT2/2,u=d.xPlus(e,_/2),l=t+p/2;le.canvas.drawPoint(f,r.pointStyle,s,u,l,r.rotation)}else f.fillRect(d.leftForLtr(e,_),t,_,p),0!==o&&f.strokeRect(d.leftForLtr(e,_),t,_,p);f.restore()}},v=function(e,t,n,r){var a=p/2,i=d.xPlus(e,_+a),o=t+a;f.fillText(n.text,i,o),n.hidden&&(f.beginPath(),f.lineWidth=2,f.moveTo(i,o),f.lineTo(d.xPlus(i,r),o),f.stroke())},b=function(e,r){switch(t.align){case"start":return n.padding;case"end":return e-r;default:return(e-r+n.padding)/2}},M=e.isHorizontal();c=M?{x:e.left+b(u,l[0]),y:e.top+n.padding,line:0}:{x:e.left+n.padding,y:e.top+b(o,s[0]),line:0},le.rtl.overrideTextDirection(e.ctx,t.textDirection);var w=p+n.padding;le.each(e.legendItems,(function(t,r){var a=f.measureText(t.text).width,i=_+p/2+a,h=c.x,m=c.y;d.setWidth(e.minSize.width),M?r>0&&h+i+n.padding>e.left+e.minSize.width&&(m=c.y+=w,c.line++,h=c.x=e.left+b(u,l[c.line])):r>0&&m+w>e.top+e.minSize.height&&(h=c.x=h+e.columnWidths[c.line]+n.padding,c.line++,m=c.y=e.top+b(o,s[c.line]));var L=d.x(h);g(L,m,t),y[r].left=d.leftForLtr(L,y[r].width),y[r].top=m,v(L,m,t,a),M?c.x+=i+n.padding:c.y+=w})),le.rtl.restoreTextDirection(e.ctx,t.textDirection)}},_getLegendItemAt:function(e,t){var n,r,a,i=this;if(e>=i.left&&e<=i.right&&t>=i.top&&t<=i.bottom)for(a=i.legendHitBoxes,n=0;n=r.left&&e<=r.left+r.width&&t>=r.top&&t<=r.top+r.height)return i.legendItems[n];return null},handleEvent:function(e){var t,n=this,r=n.options,a="mouseup"===e.type?"click":e.type;if("mousemove"===a){if(!r.onHover&&!r.onLeave)return}else{if("click"!==a)return;if(!r.onClick)return}t=n._getLegendItemAt(e.x,e.y),"click"===a?t&&r.onClick&&r.onClick.call(n,e.native,t):(r.onLeave&&t!==n._hoveredItem&&(n._hoveredItem&&r.onLeave.call(n,e.native,n._hoveredItem),n._hoveredItem=t),r.onHover&&t&&r.onHover.call(n,e.native,t))}});function ei(e,t){var n=new Xa({ctx:e.ctx,options:t,chart:e});Gt.configure(e,n,t),Gt.addBox(e,n),e.legend=n}var ti={id:"legend",_element:Xa,beforeInit:function(e){var t=e.options.legend;t&&ei(e,t)},beforeUpdate:function(e){var t=e.options.legend,n=e.legend;t?(le.mergeIf(t,Z.global.legend),n?(Gt.configure(e,n,t),n.options=t):ei(e,t)):n&&(Gt.removeBox(e,n),delete e.legend)},afterEvent:function(e,t){var n=e.legend;n&&n.handleEvent(t)}},ni=le.noop;Z._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var ri=ye.extend({initialize:function(e){var t=this;le.extend(t,e),t.legendHitBoxes=[]},beforeUpdate:ni,update:function(e,t,n){var r=this;return r.beforeUpdate(),r.maxWidth=e,r.maxHeight=t,r.margins=n,r.beforeSetDimensions(),r.setDimensions(),r.afterSetDimensions(),r.beforeBuildLabels(),r.buildLabels(),r.afterBuildLabels(),r.beforeFit(),r.fit(),r.afterFit(),r.afterUpdate(),r.minSize},afterUpdate:ni,beforeSetDimensions:ni,setDimensions:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=0,e.right=e.width):(e.height=e.maxHeight,e.top=0,e.bottom=e.height),e.paddingLeft=0,e.paddingTop=0,e.paddingRight=0,e.paddingBottom=0,e.minSize={width:0,height:0}},afterSetDimensions:ni,beforeBuildLabels:ni,buildLabels:ni,afterBuildLabels:ni,beforeFit:ni,fit:function(){var e,t,n=this,r=n.options,a=n.minSize={},i=n.isHorizontal();r.display?(e=le.isArray(r.text)?r.text.length:1,t=e*le.options._parseFont(r).lineHeight+2*r.padding,n.width=a.width=i?n.maxWidth:t,n.height=a.height=i?t:n.maxHeight):n.width=a.width=n.height=a.height=0},afterFit:ni,isHorizontal:function(){var e=this.options.position;return"top"===e||"bottom"===e},draw:function(){var e=this,t=e.ctx,n=e.options;if(n.display){var r,a,i,o=le.options._parseFont(n),s=o.lineHeight,u=s/2+n.padding,l=0,c=e.top,d=e.left,f=e.bottom,h=e.right;t.fillStyle=le.valueOrDefault(n.fontColor,Z.global.defaultFontColor),t.font=o.string,e.isHorizontal()?(a=d+(h-d)/2,i=c+u,r=h-d):(a="left"===n.position?d+u:h-u,i=c+(f-c)/2,r=f-c,l=Math.PI*("left"===n.position?-.5:.5)),t.save(),t.translate(a,i),t.rotate(l),t.textAlign="center",t.textBaseline="middle";var m=n.text;if(le.isArray(m))for(var p=0,_=0;_1?arguments[1]:void 0,n),u=o>2?arguments[2]:void 0,l=void 0===u?n:a(u,n);while(l>s)t[s++]=e;return t}},"36c3":function(e,t,n){var r=n("335c"),a=n("25eb");e.exports=function(e){return r(a(e))}},3702:function(e,t,n){var r=n("481b"),a=n("5168")("iterator"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||i[a]===e)}},3729:function(e,t,n){var r=n("9e69"),a=n("00fd"),i=n("29f3"),o="[object Null]",s="[object Undefined]",u=r?r.toStringTag:void 0;function l(e){return null==e?void 0===e?s:o:u&&u in Object(e)?a(e):i(e)}e.exports=l},3846:function(e,t,n){n("9e1e")&&"g"!=/./g.flags&&n("86cc").f(RegExp.prototype,"flags",{configurable:!0,get:n("0bfb")})},"386d":function(e,t,n){"use strict";var r=n("cb7c"),a=n("83a1"),i=n("5f1b");n("214f")("search",1,(function(e,t,n,o){return[function(n){var r=e(this),a=void 0==n?void 0:n[t];return void 0!==a?a.call(n,r):new RegExp(n)[t](String(r))},function(e){var t=o(n,e,this);if(t.done)return t.value;var s=r(e),u=String(this),l=s.lastIndex;a(l,0)||(s.lastIndex=0);var c=i(s,u);return a(s.lastIndex,l)||(s.lastIndex=l),null===c?-1:c.index}]}))},3886:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10,n=1===~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}});return t}))},"38fd":function(e,t,n){var r=n("69a8"),a=n("4bf8"),i=n("613b")("IE_PROTO"),o=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=a(e),r(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?o:null}},"39a6":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10,n=1===~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n},week:{dow:1,doy:4}});return t}))},"39bd":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};function r(e,t,n,r){var a="";if(t)switch(n){case"s":a="काही सेकंद";break;case"ss":a="%d सेकंद";break;case"m":a="एक मिनिट";break;case"mm":a="%d मिनिटे";break;case"h":a="एक तास";break;case"hh":a="%d तास";break;case"d":a="एक दिवस";break;case"dd":a="%d दिवस";break;case"M":a="एक महिना";break;case"MM":a="%d महिने";break;case"y":a="एक वर्ष";break;case"yy":a="%d वर्षे";break}else switch(n){case"s":a="काही सेकंदां";break;case"ss":a="%d सेकंदां";break;case"m":a="एका मिनिटा";break;case"mm":a="%d मिनिटां";break;case"h":a="एका तासा";break;case"hh":a="%d तासां";break;case"d":a="एका दिवसा";break;case"dd":a="%d दिवसां";break;case"M":a="एका महिन्या";break;case"MM":a="%d महिन्यां";break;case"y":a="एका वर्षा";break;case"yy":a="%d वर्षां";break}return a.replace(/%d/i,e)}var a=e.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:r,ss:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/रात्री|सकाळी|दुपारी|सायंकाळी/,meridiemHour:function(e,t){return 12===e&&(e=0),"रात्री"===t?e<4?e:e+12:"सकाळी"===t?e:"दुपारी"===t?e>=10?e:e+12:"सायंकाळी"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"रात्री":e<10?"सकाळी":e<17?"दुपारी":e<20?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}});return a}))},"3a38":function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},"3a39":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},r=e.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(e,t){return 12===e&&(e=0),"राति"===t?e<4?e:e+12:"बिहान"===t?e:"दिउँसो"===t?e>=10?e:e+12:"साँझ"===t?e+12:void 0},meridiem:function(e,t,n){return e<3?"राति":e<12?"बिहान":e<16?"दिउँसो":e<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",ss:"%d सेकेण्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}});return r}))},"3b1b":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t={0:"-ум",1:"-ум",2:"-юм",3:"-юм",4:"-ум",5:"-ум",6:"-ум",7:"-ум",8:"-ум",9:"-ум",10:"-ум",12:"-ум",13:"-ум",20:"-ум",30:"-юм",40:"-ум",50:"-ум",60:"-ум",70:"-ум",80:"-ум",90:"-ум",100:"-ум"},n=e.defineLocale("tg",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе".split("_"),weekdaysShort:"яшб_дшб_сшб_чшб_пшб_ҷум_шнб".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Имрӯз соати] LT",nextDay:"[Пагоҳ соати] LT",lastDay:"[Дирӯз соати] LT",nextWeek:"dddd[и] [ҳафтаи оянда соати] LT",lastWeek:"dddd[и] [ҳафтаи гузашта соати] LT",sameElse:"L"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"},meridiemParse:/шаб|субҳ|рӯз|бегоҳ/,meridiemHour:function(e,t){return 12===e&&(e=0),"шаб"===t?e<4?e:e+12:"субҳ"===t?e:"рӯз"===t?e>=11?e:e+12:"бегоҳ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"шаб":e<11?"субҳ":e<16?"рӯз":e<19?"бегоҳ":"шаб"},dayOfMonthOrdinalParse:/\d{1,2}-(ум|юм)/,ordinal:function(e){var n=e%10,r=e>=100?100:null;return e+(t[e]||t[n]||t[r])},week:{dow:1,doy:7}});return n}))},"3b2b":function(e,t,n){var r=n("7726"),a=n("5dbc"),i=n("86cc").f,o=n("9093").f,s=n("aae3"),u=n("0bfb"),l=r.RegExp,c=l,d=l.prototype,f=/a/g,h=/a/g,m=new l(f)!==f;if(n("9e1e")&&(!m||n("79e5")((function(){return h[n("2b4c")("match")]=!1,l(f)!=f||l(h)==h||"/a/i"!=l(f,"i")})))){l=function(e,t){var n=this instanceof l,r=s(e),i=void 0===t;return!n&&r&&e.constructor===l&&i?e:a(m?new c(r&&!i?e.source:e,t):c((r=e instanceof l)?e.source:e,r&&i?u.call(e):t),n?this:d,l)};for(var p=function(e){e in l||i(l,e,{configurable:!0,get:function(){return c[e]},set:function(t){c[e]=t}})},_=o(c),y=0;_.length>y;)p(_[y++]);d.constructor=l,l.prototype=d,n("2aba")(r,"RegExp",l)}n("7a56")("RegExp")},"3b8d":function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n("795b"),a=n.n(r);function i(e,t,n,r,i,o,s){try{var u=e[o](s),l=u.value}catch(c){return void n(c)}u.done?t(l):a.a.resolve(l).then(r,i)}function o(e){return function(){var t=this,n=arguments;return new a.a((function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,u,"next",e)}function u(e){i(o,r,a,s,u,"throw",e)}s(void 0)}))}}},"3c0d":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t="leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),n="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),r=[/^led/i,/^úno/i,/^bře/i,/^dub/i,/^kvě/i,/^(čvn|červen$|června)/i,/^(čvc|červenec|července)/i,/^srp/i,/^zář/i,/^říj/i,/^lis/i,/^pro/i],a=/^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;function i(e){return e>1&&e<5&&1!==~~(e/10)}function o(e,t,n,r){var a=e+" ";switch(n){case"s":return t||r?"pár sekund":"pár sekundami";case"ss":return t||r?a+(i(e)?"sekundy":"sekund"):a+"sekundami";case"m":return t?"minuta":r?"minutu":"minutou";case"mm":return t||r?a+(i(e)?"minuty":"minut"):a+"minutami";case"h":return t?"hodina":r?"hodinu":"hodinou";case"hh":return t||r?a+(i(e)?"hodiny":"hodin"):a+"hodinami";case"d":return t||r?"den":"dnem";case"dd":return t||r?a+(i(e)?"dny":"dní"):a+"dny";case"M":return t||r?"měsíc":"měsícem";case"MM":return t||r?a+(i(e)?"měsíce":"měsíců"):a+"měsíci";case"y":return t||r?"rok":"rokem";case"yy":return t||r?a+(i(e)?"roky":"let"):a+"lety"}}var s=e.defineLocale("cs",{months:t,monthsShort:n,monthsRegex:a,monthsShortRegex:a,monthsStrictRegex:/^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,monthsShortStrictRegex:/^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,monthsParse:r,longMonthsParse:r,shortMonthsParse:r,weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return s}))},"3c11":function(e,t,n){"use strict";var r=n("63b6"),a=n("584a"),i=n("e53d"),o=n("f201"),s=n("cd78");r(r.P+r.R,"Promise",{finally:function(e){var t=o(this,a.Promise||i.Promise),n="function"==typeof e;return this.then(n?function(n){return s(t,e()).then((function(){return n}))}:e,n?function(n){return s(t,e()).then((function(){throw n}))}:e)}})},"3cb4":function(e,t,n){(function(t,n){e.exports=n()})("undefined"!==typeof self&&self,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({"0273":function(e,t,n){var r=n("c1b2"),a=n("4180"),i=n("2c6c");e.exports=r?function(e,t,n){return a.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},"057f":function(e,t,n){var r=n("fc6a"),a=n("241c").f,i={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(e){try{return a(e)}catch(t){return o.slice()}};e.exports.f=function(e){return o&&"[object Window]"==i.call(e)?s(e):a(r(e))}},"06cf":function(e,t,n){var r=n("83ab"),a=n("d1e7"),i=n("5c6c"),o=n("fc6a"),s=n("c04e"),u=n("5135"),l=n("0cfb"),c=Object.getOwnPropertyDescriptor;t.f=r?c:function(e,t){if(e=o(e),t=s(t,!0),l)try{return c(e,t)}catch(n){}if(u(e,t))return i(!a.f.call(e,t),e[t])}},"06fa":function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},"0cfb":function(e,t,n){var r=n("83ab"),a=n("d039"),i=n("cc12");e.exports=!r&&!a((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},"159b":function(e,t,n){var r=n("da84"),a=n("fdbc"),i=n("17c2"),o=n("9112");for(var s in a){var u=r[s],l=u&&u.prototype;if(l&&l.forEach!==i)try{o(l,"forEach",i)}catch(c){l.forEach=i}}},"17c2":function(e,t,n){"use strict";var r=n("b727").forEach,a=n("b301");e.exports=a("forEach")?function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}:[].forEach},1875:function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},"194a":function(e,t,n){var r=n("cc94");e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,a){return e.call(t,n,r,a)}}return function(){return e.apply(t,arguments)}}},"1be4":function(e,t,n){var r=n("d066");e.exports=r("document","documentElement")},"1c0b":function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},"1d80":function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},"1dde":function(e,t,n){var r=n("d039"),a=n("b622"),i=a("species");e.exports=function(e){return!r((function(){var t=[],n=t.constructor={};return n[i]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},"23cb":function(e,t,n){var r=n("a691"),a=Math.max,i=Math.min;e.exports=function(e,t){var n=r(e);return n<0?a(n+t,0):i(n,t)}},"23e7":function(e,t,n){var r=n("da84"),a=n("06cf").f,i=n("9112"),o=n("6eeb"),s=n("ce4e"),u=n("e893"),l=n("94ca");e.exports=function(e,t){var n,c,d,f,h,m,p=e.target,_=e.global,y=e.stat;if(c=_?r:y?r[p]||s(p,{}):(r[p]||{}).prototype,c)for(d in t){if(h=t[d],e.noTargetGet?(m=a(c,d),f=m&&m.value):f=c[d],n=l(_?d:p+(y?".":"#")+d,e.forced),!n&&void 0!==f){if(typeof h===typeof f)continue;u(h,f)}(e.sham||f&&f.sham)&&i(h,"sham",!0),o(c,d,h,e)}}},"241c":function(e,t,n){var r=n("ca84"),a=n("7839"),i=a.concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},"2c6c":function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},"37e8":function(e,t,n){var r=n("83ab"),a=n("9bf2"),i=n("825a"),o=n("df75");e.exports=r?Object.defineProperties:function(e,t){i(e);var n,r=o(t),s=r.length,u=0;while(s>u)a.f(e,n=r[u++],t[n]);return e}},"3ac6":function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||Function("return this")()}).call(this,n("c8ba"))},"3e47":function(e,t,n){var r=n("a5eb"),a=n("c1b2"),i=n("4180");r({target:"Object",stat:!0,forced:!a,sham:!a},{defineProperty:i.f})},4160:function(e,t,n){"use strict";var r=n("23e7"),a=n("17c2");r({target:"Array",proto:!0,forced:[].forEach!=a},{forEach:a})},4180:function(e,t,n){var r=n("c1b2"),a=n("77b2"),i=n("6f8d"),o=n("7168"),s=Object.defineProperty;t.f=r?s:function(e,t,n){if(i(e),t=o(t,!0),i(n),a)try{return s(e,t,n)}catch(r){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},"428f":function(e,t,n){e.exports=n("da84")},"44ad":function(e,t,n){var r=n("d039"),a=n("c6b6"),i="".split;e.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==a(e)?i.call(e,""):Object(e)}:Object},"44ba":function(e,t,n){var r=n("c1b2"),a=n("7043"),i=n("2c6c"),o=n("a421"),s=n("7168"),u=n("78e7"),l=n("77b2"),c=Object.getOwnPropertyDescriptor;t.f=r?c:function(e,t){if(e=o(e),t=s(t,!0),l)try{return c(e,t)}catch(n){}if(u(e,t))return i(!a.f.call(e,t),e[t])}},4930:function(e,t,n){var r=n("d039");e.exports=!!Object.getOwnPropertySymbols&&!r((function(){return!String(Symbol())}))},"4a7a":function(e,t,n){},"4d64":function(e,t,n){var r=n("fc6a"),a=n("50c4"),i=n("23cb"),o=function(e){return function(t,n,o){var s,u=r(t),l=a(u.length),c=i(o,l);if(e&&n!=n){while(l>c)if(s=u[c++],s!=s)return!0}else for(;l>c;c++)if((e||c in u)&&u[c]===n)return e||c||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},"4de4":function(e,t,n){"use strict";var r=n("23e7"),a=n("b727").filter,i=n("1dde");r({target:"Array",proto:!0,forced:!i("filter")},{filter:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}})},"50c4":function(e,t,n){var r=n("a691"),a=Math.min;e.exports=function(e){return e>0?a(r(e),9007199254740991):0}},5135:function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},5692:function(e,t,n){var r=n("c430"),a=n("c6cd");(e.exports=function(e,t){return a[e]||(a[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.3.3",mode:r?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},"56ef":function(e,t,n){var r=n("d066"),a=n("241c"),i=n("7418"),o=n("825a");e.exports=r("Reflect","ownKeys")||function(e){var t=a.f(o(e)),n=i.f;return n?t.concat(n(e)):t}},"5c6c":function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},"638c":function(e,t,n){var r=n("06fa"),a=n("fc48"),i="".split;e.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==a(e)?i.call(e,""):Object(e)}:Object},"65f0":function(e,t,n){var r=n("861d"),a=n("e8b5"),i=n("b622"),o=i("species");e.exports=function(e,t){var n;return a(e)&&(n=e.constructor,"function"!=typeof n||n!==Array&&!a(n.prototype)?r(n)&&(n=n[o],null===n&&(n=void 0)):n=void 0),new(void 0===n?Array:n)(0===t?0:t)}},"69f3":function(e,t,n){var r,a,i,o=n("7f9a"),s=n("da84"),u=n("861d"),l=n("9112"),c=n("5135"),d=n("f772"),f=n("d012"),h=s.WeakMap,m=function(e){return i(e)?a(e):r(e,{})},p=function(e){return function(t){var n;if(!u(t)||(n=a(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}};if(o){var _=new h,y=_.get,g=_.has,v=_.set;r=function(e,t){return v.call(_,e,t),t},a=function(e){return y.call(_,e)||{}},i=function(e){return g.call(_,e)}}else{var b=d("state");f[b]=!0,r=function(e,t){return l(e,b,t),t},a=function(e){return c(e,b)?e[b]:{}},i=function(e){return c(e,b)}}e.exports={set:r,get:a,has:i,enforce:m,getterFor:p}},"6eeb":function(e,t,n){var r=n("da84"),a=n("5692"),i=n("9112"),o=n("5135"),s=n("ce4e"),u=n("9e81"),l=n("69f3"),c=l.get,d=l.enforce,f=String(u).split("toString");a("inspectSource",(function(e){return u.call(e)})),(e.exports=function(e,t,n,a){var u=!!a&&!!a.unsafe,l=!!a&&!!a.enumerable,c=!!a&&!!a.noTargetGet;"function"==typeof n&&("string"!=typeof t||o(n,"name")||i(n,"name",t),d(n).source=f.join("string"==typeof t?t:"")),e!==r?(u?!c&&e[t]&&(l=!0):delete e[t],l?e[t]=n:i(e,t,n)):l?e[t]=n:s(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&c(this).source||u.call(this)}))},"6f8d":function(e,t,n){var r=n("dfdb");e.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},7043:function(e,t,n){"use strict";var r={}.propertyIsEnumerable,a=Object.getOwnPropertyDescriptor,i=a&&!r.call({1:2},1);t.f=i?function(e){var t=a(this,e);return!!t&&t.enumerable}:r},7168:function(e,t,n){var r=n("dfdb");e.exports=function(e,t){if(!r(e))return e;var n,a;if(t&&"function"==typeof(n=e.toString)&&!r(a=n.call(e)))return a;if("function"==typeof(n=e.valueOf)&&!r(a=n.call(e)))return a;if(!t&&"function"==typeof(n=e.toString)&&!r(a=n.call(e)))return a;throw TypeError("Can't convert object to primitive value")}},7418:function(e,t){t.f=Object.getOwnPropertySymbols},"746f":function(e,t,n){var r=n("428f"),a=n("5135"),i=n("c032"),o=n("9bf2").f;e.exports=function(e){var t=r.Symbol||(r.Symbol={});a(t,e)||o(t,e,{value:i.f(e)})}},"764b":function(e,t){e.exports={}},"77b2":function(e,t,n){var r=n("c1b2"),a=n("06fa"),i=n("7a37");e.exports=!r&&!a((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},7839:function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"78e7":function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},"7a37":function(e,t,n){var r=n("3ac6"),a=n("dfdb"),i=r.document,o=a(i)&&a(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},"7b0b":function(e,t,n){var r=n("1d80");e.exports=function(e){return Object(r(e))}},"7c73":function(e,t,n){var r=n("825a"),a=n("37e8"),i=n("7839"),o=n("d012"),s=n("1be4"),u=n("cc12"),l=n("f772"),c=l("IE_PROTO"),d="prototype",f=function(){},h=function(){var e,t=u("iframe"),n=i.length,r="<",a="script",o=">",l="java"+a+":";t.style.display="none",s.appendChild(t),t.src=String(l),e=t.contentWindow.document,e.open(),e.write(r+a+o+"document.F=Object"+r+"/"+a+o),e.close(),h=e.F;while(n--)delete h[d][i[n]];return h()};e.exports=Object.create||function(e,t){var n;return null!==e?(f[d]=r(e),n=new f,f[d]=null,n[c]=e):n=h(),void 0===t?n:a(n,t)},o[c]=!0},"7f9a":function(e,t,n){var r=n("da84"),a=n("9e81"),i=r.WeakMap;e.exports="function"===typeof i&&/native code/.test(a.call(i))},"825a":function(e,t,n){var r=n("861d");e.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},"83ab":function(e,t,n){var r=n("d039");e.exports=!r((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},8418:function(e,t,n){"use strict";var r=n("c04e"),a=n("9bf2"),i=n("5c6c");e.exports=function(e,t,n){var o=r(t);o in e?a.f(e,o,i(0,n)):e[o]=n}},"85d3":function(e,t,n){e.exports=n("9a13")},"861d":function(e,t){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}},"90e3":function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++n+r).toString(36)}},9112:function(e,t,n){var r=n("83ab"),a=n("9bf2"),i=n("5c6c");e.exports=r?function(e,t,n){return a.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},"94ca":function(e,t,n){var r=n("d039"),a=/#|\.prototype\./,i=function(e,t){var n=s[o(e)];return n==l||n!=u&&("function"==typeof t?r(t):!!t)},o=i.normalize=function(e){return String(e).replace(a,".").toLowerCase()},s=i.data={},u=i.NATIVE="N",l=i.POLYFILL="P";e.exports=i},"9a13":function(e,t,n){e.exports=n("a38c")},"9bf2":function(e,t,n){var r=n("83ab"),a=n("0cfb"),i=n("825a"),o=n("c04e"),s=Object.defineProperty;t.f=r?s:function(e,t,n){if(i(e),t=o(t,!0),i(n),a)try{return s(e,t,n)}catch(r){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},"9e81":function(e,t,n){var r=n("5692");e.exports=r("native-function-to-string",Function.toString)},a0e5:function(e,t,n){var r=n("06fa"),a=/#|\.prototype\./,i=function(e,t){var n=s[o(e)];return n==l||n!=u&&("function"==typeof t?r(t):!!t)},o=i.normalize=function(e){return String(e).replace(a,".").toLowerCase()},s=i.data={},u=i.NATIVE="N",l=i.POLYFILL="P";e.exports=i},a38c:function(e,t,n){n("3e47");var r=n("764b"),a=r.Object,i=e.exports=function(e,t,n){return a.defineProperty(e,t,n)};a.defineProperty.sham&&(i.sham=!0)},a421:function(e,t,n){var r=n("638c"),a=n("1875");e.exports=function(e){return r(a(e))}},a4d3:function(e,t,n){"use strict";var r=n("23e7"),a=n("da84"),i=n("c430"),o=n("83ab"),s=n("4930"),u=n("d039"),l=n("5135"),c=n("e8b5"),d=n("861d"),f=n("825a"),h=n("7b0b"),m=n("fc6a"),p=n("c04e"),_=n("5c6c"),y=n("7c73"),g=n("df75"),v=n("241c"),b=n("057f"),M=n("7418"),w=n("06cf"),L=n("9bf2"),k=n("d1e7"),x=n("9112"),Y=n("6eeb"),D=n("5692"),S=n("f772"),T=n("d012"),O=n("90e3"),A=n("b622"),P=n("c032"),j=n("746f"),H=n("d44e"),C=n("69f3"),E=n("b727").forEach,z=S("hidden"),F="Symbol",I="prototype",N=A("toPrimitive"),W=C.set,R=C.getterFor(F),V=Object[I],U=a.Symbol,$=a.JSON,B=$&&$.stringify,q=w.f,G=L.f,J=b.f,Q=k.f,Z=D("symbols"),K=D("op-symbols"),X=D("string-to-symbol-registry"),ee=D("symbol-to-string-registry"),te=D("wks"),ne=a.QObject,re=!ne||!ne[I]||!ne[I].findChild,ae=o&&u((function(){return 7!=y(G({},"a",{get:function(){return G(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=q(V,t);r&&delete V[t],G(e,t,n),r&&e!==V&&G(V,t,r)}:G,ie=function(e,t){var n=Z[e]=y(U[I]);return W(n,{type:F,tag:e,description:t}),o||(n.description=t),n},oe=s&&"symbol"==typeof U.iterator?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof U},se=function(e,t,n){e===V&&se(K,t,n),f(e);var r=p(t,!0);return f(n),l(Z,r)?(n.enumerable?(l(e,z)&&e[z][r]&&(e[z][r]=!1),n=y(n,{enumerable:_(0,!1)})):(l(e,z)||G(e,z,_(1,{})),e[z][r]=!0),ae(e,r,n)):G(e,r,n)},ue=function(e,t){f(e);var n=m(t),r=g(n).concat(he(n));return E(r,(function(t){o&&!ce.call(n,t)||se(e,t,n[t])})),e},le=function(e,t){return void 0===t?y(e):ue(y(e),t)},ce=function(e){var t=p(e,!0),n=Q.call(this,t);return!(this===V&&l(Z,t)&&!l(K,t))&&(!(n||!l(this,t)||!l(Z,t)||l(this,z)&&this[z][t])||n)},de=function(e,t){var n=m(e),r=p(t,!0);if(n!==V||!l(Z,r)||l(K,r)){var a=q(n,r);return!a||!l(Z,r)||l(n,z)&&n[z][r]||(a.enumerable=!0),a}},fe=function(e){var t=J(m(e)),n=[];return E(t,(function(e){l(Z,e)||l(T,e)||n.push(e)})),n},he=function(e){var t=e===V,n=J(t?K:m(e)),r=[];return E(n,(function(e){!l(Z,e)||t&&!l(V,e)||r.push(Z[e])})),r};s||(U=function(){if(this instanceof U)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=O(e),n=function(e){this===V&&n.call(K,e),l(this,z)&&l(this[z],t)&&(this[z][t]=!1),ae(this,t,_(1,e))};return o&&re&&ae(V,t,{configurable:!0,set:n}),ie(t,e)},Y(U[I],"toString",(function(){return R(this).tag})),k.f=ce,L.f=se,w.f=de,v.f=b.f=fe,M.f=he,o&&(G(U[I],"description",{configurable:!0,get:function(){return R(this).description}}),i||Y(V,"propertyIsEnumerable",ce,{unsafe:!0})),P.f=function(e){return ie(A(e),e)}),r({global:!0,wrap:!0,forced:!s,sham:!s},{Symbol:U}),E(g(te),(function(e){j(e)})),r({target:F,stat:!0,forced:!s},{for:function(e){var t=String(e);if(l(X,t))return X[t];var n=U(t);return X[t]=n,ee[n]=t,n},keyFor:function(e){if(!oe(e))throw TypeError(e+" is not a symbol");if(l(ee,e))return ee[e]},useSetter:function(){re=!0},useSimple:function(){re=!1}}),r({target:"Object",stat:!0,forced:!s,sham:!o},{create:le,defineProperty:se,defineProperties:ue,getOwnPropertyDescriptor:de}),r({target:"Object",stat:!0,forced:!s},{getOwnPropertyNames:fe,getOwnPropertySymbols:he}),r({target:"Object",stat:!0,forced:u((function(){M.f(1)}))},{getOwnPropertySymbols:function(e){return M.f(h(e))}}),$&&r({target:"JSON",stat:!0,forced:!s||u((function(){var e=U();return"[null]"!=B([e])||"{}"!=B({a:e})||"{}"!=B(Object(e))}))},{stringify:function(e){var t,n,r=[e],a=1;while(arguments.length>a)r.push(arguments[a++]);if(n=t=r[1],(d(t)||void 0!==e)&&!oe(e))return c(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!oe(t))return t}),r[1]=t,B.apply($,r)}}),U[I][N]||x(U[I],N,U[I].valueOf),H(U,F),T[z]=!0},a5eb:function(e,t,n){"use strict";var r=n("3ac6"),a=n("44ba").f,i=n("a0e5"),o=n("764b"),s=n("194a"),u=n("0273"),l=n("78e7"),c=function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var n,d,f,h,m,p,_,y,g,v=e.target,b=e.global,M=e.stat,w=e.proto,L=b?r:M?r[v]:(r[v]||{}).prototype,k=b?o:o[v]||(o[v]={}),x=k.prototype;for(h in t)n=i(b?h:v+(M?".":"#")+h,e.forced),d=!n&&L&&l(L,h),p=k[h],d&&(e.noTargetGet?(g=a(L,h),_=g&&g.value):_=L[h]),m=d&&_?_:t[h],d&&typeof p===typeof m||(y=e.bind&&d?s(m,r):e.wrap&&d?c(m):w&&"function"==typeof m?s(Function.call,m):m,(e.sham||m&&m.sham||p&&p.sham)&&u(y,"sham",!0),k[h]=y,w&&(f=v+"Prototype",l(o,f)||u(o,f,{}),o[f][h]=m,e.real&&x&&!x[h]&&u(x,h,m)))}},a691:function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},b0c0:function(e,t,n){var r=n("83ab"),a=n("9bf2").f,i=Function.prototype,o=i.toString,s=/^\s*function ([^ (]*)/,u="name";!r||u in i||a(i,u,{configurable:!0,get:function(){try{return o.call(this).match(s)[1]}catch(e){return""}}})},b301:function(e,t,n){"use strict";var r=n("d039");e.exports=function(e,t){var n=[][e];return!n||!r((function(){n.call(null,t||function(){throw 1},1)}))}},b622:function(e,t,n){var r=n("da84"),a=n("5692"),i=n("90e3"),o=n("4930"),s=r.Symbol,u=a("wks");e.exports=function(e){return u[e]||(u[e]=o&&s[e]||(o?s:i)("Symbol."+e))}},b64b:function(e,t,n){var r=n("23e7"),a=n("7b0b"),i=n("df75"),o=n("d039"),s=o((function(){i(1)}));r({target:"Object",stat:!0,forced:s},{keys:function(e){return i(a(e))}})},b727:function(e,t,n){var r=n("f8c2"),a=n("44ad"),i=n("7b0b"),o=n("50c4"),s=n("65f0"),u=[].push,l=function(e){var t=1==e,n=2==e,l=3==e,c=4==e,d=6==e,f=5==e||d;return function(h,m,p,_){for(var y,g,v=i(h),b=a(v),M=r(m,p,3),w=o(b.length),L=0,k=_||s,x=t?k(h,w):n?k(h,0):void 0;w>L;L++)if((f||L in b)&&(y=b[L],g=M(y,L,v),e))if(t)x[L]=g;else if(g)switch(e){case 3:return!0;case 5:return y;case 6:return L;case 2:u.call(x,y)}else if(c)return!1;return d?-1:l||c?c:x}};e.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6)}},c032:function(e,t,n){t.f=n("b622")},c04e:function(e,t,n){var r=n("861d");e.exports=function(e,t){if(!r(e))return e;var n,a;if(t&&"function"==typeof(n=e.toString)&&!r(a=n.call(e)))return a;if("function"==typeof(n=e.valueOf)&&!r(a=n.call(e)))return a;if(!t&&"function"==typeof(n=e.toString)&&!r(a=n.call(e)))return a;throw TypeError("Can't convert object to primitive value")}},c1b2:function(e,t,n){var r=n("06fa");e.exports=!r((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},c430:function(e,t){e.exports=!1},c6b6:function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},c6cd:function(e,t,n){var r=n("da84"),a=n("ce4e"),i="__core-js_shared__",o=r[i]||a(i,{});e.exports=o},c8ba:function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}e.exports=n},ca84:function(e,t,n){var r=n("5135"),a=n("fc6a"),i=n("4d64").indexOf,o=n("d012");e.exports=function(e,t){var n,s=a(e),u=0,l=[];for(n in s)!r(o,n)&&r(s,n)&&l.push(n);while(t.length>u)r(s,n=t[u++])&&(~i(l,n)||l.push(n));return l}},cc12:function(e,t,n){var r=n("da84"),a=n("861d"),i=r.document,o=a(i)&&a(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},cc94:function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},ce4e:function(e,t,n){var r=n("da84"),a=n("9112");e.exports=function(e,t){try{a(r,e,t)}catch(n){r[e]=t}return t}},d012:function(e,t){e.exports={}},d039:function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},d066:function(e,t,n){var r=n("428f"),a=n("da84"),i=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?i(r[e])||i(a[e]):r[e]&&r[e][t]||a[e]&&a[e][t]}},d1e7:function(e,t,n){"use strict";var r={}.propertyIsEnumerable,a=Object.getOwnPropertyDescriptor,i=a&&!r.call({1:2},1);t.f=i?function(e){var t=a(this,e);return!!t&&t.enumerable}:r},d44e:function(e,t,n){var r=n("9bf2").f,a=n("5135"),i=n("b622"),o=i("toStringTag");e.exports=function(e,t,n){e&&!a(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},da84:function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||Function("return this")()}).call(this,n("c8ba"))},dbb4:function(e,t,n){var r=n("23e7"),a=n("83ab"),i=n("56ef"),o=n("fc6a"),s=n("06cf"),u=n("8418");r({target:"Object",stat:!0,sham:!a},{getOwnPropertyDescriptors:function(e){var t,n,r=o(e),a=s.f,l=i(r),c={},d=0;while(l.length>d)n=a(r,t=l[d++]),void 0!==n&&u(c,t,n);return c}})},df75:function(e,t,n){var r=n("ca84"),a=n("7839");e.exports=Object.keys||function(e){return r(e,a)}},dfdb:function(e,t){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}},e439:function(e,t,n){var r=n("23e7"),a=n("d039"),i=n("fc6a"),o=n("06cf").f,s=n("83ab"),u=a((function(){o(1)})),l=!s||u;r({target:"Object",stat:!0,forced:l,sham:!s},{getOwnPropertyDescriptor:function(e,t){return o(i(e),t)}})},e893:function(e,t,n){var r=n("5135"),a=n("56ef"),i=n("06cf"),o=n("9bf2");e.exports=function(e,t){for(var n=a(t),s=o.f,u=i.f,l=0;l=10?e:e+12},week:{dow:0,doy:6}});return r}))},"3e92":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t={1:"೧",2:"೨",3:"೩",4:"೪",5:"೫",6:"೬",7:"೭",8:"೮",9:"೯",0:"೦"},n={"೧":"1","೨":"2","೩":"3","೪":"4","೫":"5","೬":"6","೭":"7","೮":"8","೯":"9","೦":"0"},r=e.defineLocale("kn",{months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),monthsParseExact:!0,weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[ಇಂದು] LT",nextDay:"[ನಾಳೆ] LT",nextWeek:"dddd, LT",lastDay:"[ನಿನ್ನೆ] LT",lastWeek:"[ಕೊನೆಯ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",ss:"%d ಸೆಕೆಂಡುಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"},preparse:function(e){return e.replace(/[೧೨೩೪೫೬೭೮೯೦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ರಾತ್ರಿ"===t?e<4?e:e+12:"ಬೆಳಿಗ್ಗೆ"===t?e:"ಮಧ್ಯಾಹ್ನ"===t?e>=10?e:e+12:"ಸಂಜೆ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ರಾತ್ರಿ":e<10?"ಬೆಳಿಗ್ಗೆ":e<17?"ಮಧ್ಯಾಹ್ನ":e<20?"ಸಂಜೆ":"ರಾತ್ರಿ"},dayOfMonthOrdinalParse:/\d{1,2}(ನೇ)/,ordinal:function(e){return e+"ನೇ"},week:{dow:0,doy:6}});return r}))},"40c3":function(e,t,n){var r=n("6b4c"),a=n("5168")("toStringTag"),i="Arguments"==r(function(){return arguments}()),o=function(e,t){try{return e[t]}catch(n){}};e.exports=function(e){var t,n,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=o(t=Object(e),a))?n:i?r(t):"Object"==(s=r(t))&&"function"==typeof t.callee?"Arguments":s}},4178:function(e,t,n){var r,a,i,o=n("d864"),s=n("3024"),u=n("32fc"),l=n("1ec9"),c=n("e53d"),d=c.process,f=c.setImmediate,h=c.clearImmediate,m=c.MessageChannel,p=c.Dispatch,_=0,y={},g="onreadystatechange",v=function(){var e=+this;if(y.hasOwnProperty(e)){var t=y[e];delete y[e],t()}},b=function(e){v.call(e.data)};f&&h||(f=function(e){var t=[],n=1;while(arguments.length>n)t.push(arguments[n++]);return y[++_]=function(){s("function"==typeof e?e:Function(e),t)},r(_),_},h=function(e){delete y[e]},"process"==n("6b4c")(d)?r=function(e){d.nextTick(o(v,e,1))}:p&&p.now?r=function(e){p.now(o(v,e,1))}:m?(a=new m,i=a.port2,a.port1.onmessage=b,r=o(i.postMessage,i,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(r=function(e){c.postMessage(e+"","*")},c.addEventListener("message",b,!1)):r=g in l("script")?function(e){u.appendChild(l("script"))[g]=function(){u.removeChild(this),v.call(e)}}:function(e){setTimeout(o(v,e,1),0)}),e.exports={set:f,clear:h}},"41a0":function(e,t,n){"use strict";var r=n("2aeb"),a=n("4630"),i=n("7f20"),o={};n("32e9")(o,n("2b4c")("iterator"),(function(){return this})),e.exports=function(e,t,n){e.prototype=r(o,{next:a(1,n)}),i(e,t+" Iterator")}},"423e":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("ar-kw",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:12}});return t}))},4245:function(e,t,n){var r=n("1290");function a(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}e.exports=a},"43fc":function(e,t,n){"use strict";var r=n("63b6"),a=n("656e"),i=n("4439");r(r.S,"Promise",{try:function(e){var t=a.f(this),n=i(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},"440c":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";function t(e,t,n,r){var a={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return t?a[n][0]:a[n][1]}function n(e){var t=e.substr(0,e.indexOf(" "));return a(t)?"a "+e:"an "+e}function r(e){var t=e.substr(0,e.indexOf(" "));return a(t)?"viru "+e:"virun "+e}function a(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return 4<=e&&e<=7;if(e<100){var t=e%10,n=e/10;return a(0===t?n:t)}if(e<1e4){while(e>=10)e/=10;return a(e)}return e/=1e3,a(e)}var i=e.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:n,past:r,s:"e puer Sekonnen",ss:"%d Sekonnen",m:t,mm:"%d Minutten",h:t,hh:"%d Stonnen",d:t,dd:"%d Deeg",M:t,MM:"%d Méint",y:t,yy:"%d Joer"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return i}))},4439:function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(t){return{e:!0,v:t}}}},"44b7":function(e,t,n){"use strict";var r=n("0f7c"),a=n("e9ac"),i=a("%Function%"),o=i.apply,s=i.call;e.exports=function(){return r.apply(s,arguments)},e.exports.apply=function(){return r.apply(o,arguments)}},"454f":function(e,t,n){n("46a7");var r=n("584a").Object;e.exports=function(e,t,n){return r.defineProperty(e,t,n)}},"456d":function(e,t,n){var r=n("4bf8"),a=n("0d58");n("5eda")("keys",(function(){return function(e){return a(r(e))}}))},4588:function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},"45f2":function(e,t,n){var r=n("d9f6").f,a=n("07e3"),i=n("5168")("toStringTag");e.exports=function(e,t,n){e&&!a(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},4630:function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},"469f":function(e,t,n){n("6c1c"),n("1654"),e.exports=n("7d7b")},"46a7":function(e,t,n){var r=n("63b6");r(r.S+r.F*!n("8e60"),"Object",{defineProperty:n("d9f6").f})},"47ee":function(e,t,n){var r=n("c3a1"),a=n("9aa9"),i=n("355d");e.exports=function(e){var t=r(e),n=a.f;if(n){var o,s=n(e),u=i.f,l=0;while(s.length>l)u.call(e,o=s[l++])&&t.push(o)}return t}},"481b":function(e,t){e.exports={}},"485c":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"},n=e.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"birneçə saniyə",ss:"%d saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(e){return/^(gündüz|axşam)$/.test(e)},meridiem:function(e,t,n){return e<4?"gecə":e<12?"səhər":e<17?"gündüz":"axşam"},dayOfMonthOrdinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(e){if(0===e)return e+"-ıncı";var n=e%10,r=e%100-n,a=e>=100?100:null;return e+(t[n]||t[r]||t[a])},week:{dow:1,doy:7}});return n}))},4917:function(e,t,n){"use strict";var r=n("cb7c"),a=n("9def"),i=n("0390"),o=n("5f1b");n("214f")("match",1,(function(e,t,n,s){return[function(n){var r=e(this),a=void 0==n?void 0:n[t];return void 0!==a?a.call(n,r):new RegExp(n)[t](String(r))},function(e){var t=s(n,e,this);if(t.done)return t.value;var u=r(e),l=String(this);if(!u.global)return o(u,l);var c=u.unicode;u.lastIndex=0;var d,f=[],h=0;while(null!==(d=o(u,l))){var m=String(d[0]);f[h]=m,""===m&&(u.lastIndex=i(l,a(u.lastIndex),c)),h++}return 0===h?null:f}]}))},"49ab":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var r=100*e+t;return r<600?"凌晨":r<900?"早上":r<1130?"上午":r<1230?"中午":r<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}});return t}))},"49f4":function(e,t,n){var r=n("6044");function a(){this.__data__=r?r(null):{},this.size=0}e.exports=a},"4a59":function(e,t,n){var r=n("9b43"),a=n("1fa8"),i=n("33a4"),o=n("cb7c"),s=n("9def"),u=n("27ee"),l={},c={};t=e.exports=function(e,t,n,d,f){var h,m,p,_,y=f?function(){return e}:u(e),g=r(n,d,t?2:1),v=0;if("function"!=typeof y)throw TypeError(e+" is not iterable!");if(i(y)){for(h=s(e.length);h>v;v++)if(_=t?g(o(m=e[v])[0],m[1]):g(e[v]),_===l||_===c)return _}else for(p=y.call(e);!(m=p.next()).done;)if(_=a(p,g,m.value,t),_===l||_===c)return _};t.BREAK=l,t.RETURN=c},"4ba9":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";function t(e,t,n){var r=e+" ";switch(n){case"ss":return r+=1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi",r;case"m":return t?"jedna minuta":"jedne minute";case"mm":return r+=1===e?"minuta":2===e||3===e||4===e?"minute":"minuta",r;case"h":return t?"jedan sat":"jednog sata";case"hh":return r+=1===e?"sat":2===e||3===e||4===e?"sata":"sati",r;case"dd":return r+=1===e?"dan":"dana",r;case"MM":return r+=1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci",r;case"yy":return r+=1===e?"godina":2===e||3===e||4===e?"godine":"godina",r}}var n=e.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}});return n}))},"4bf8":function(e,t,n){var r=n("be13");e.exports=function(e){return Object(r(e))}},"4c95":function(e,t,n){"use strict";var r=n("e53d"),a=n("584a"),i=n("d9f6"),o=n("8e60"),s=n("5168")("species");e.exports=function(e){var t="function"==typeof a[e]?a[e]:r[e];o&&t&&!t[s]&&i.f(t,s,{configurable:!0,get:function(){return this}})}},"4eb5":function(e,t,n){var r=n("6981"),a={autoSetContainer:!1},i={install:function(e){e.prototype.$clipboardConfig=a,e.prototype.$copyText=function(e,t){return new Promise((function(n,a){var i=document.createElement("button"),o=new r(i,{text:function(){return e},action:function(){return"copy"},container:"object"===typeof t?t:document.body});o.on("success",(function(e){o.destroy(),n(e)})),o.on("error",(function(e){o.destroy(),a(e)})),i.click()}))},e.directive("clipboard",{bind:function(e,t,n){if("success"===t.arg)e._v_clipboard_success=t.value;else if("error"===t.arg)e._v_clipboard_error=t.value;else{var i=new r(e,{text:function(){return t.value},action:function(){return"cut"===t.arg?"cut":"copy"},container:a.autoSetContainer?e:void 0});i.on("success",(function(t){var n=e._v_clipboard_success;n&&n(t)})),i.on("error",(function(t){var n=e._v_clipboard_error;n&&n(t)})),e._v_clipboard=i}},update:function(e,t){"success"===t.arg?e._v_clipboard_success=t.value:"error"===t.arg?e._v_clipboard_error=t.value:(e._v_clipboard.text=function(){return t.value},e._v_clipboard.action=function(){return"cut"===t.arg?"cut":"copy"})},unbind:function(e,t){"success"===t.arg?delete e._v_clipboard_success:"error"===t.arg?delete e._v_clipboard_error:(e._v_clipboard.destroy(),delete e._v_clipboard)}})},config:a};e.exports=i},"4ee1":function(e,t,n){var r=n("5168")("iterator"),a=!1;try{var i=[7][r]();i["return"]=function(){a=!0},Array.from(i,(function(){throw 2}))}catch(o){}e.exports=function(e,t){if(!t&&!a)return!1;var n=!1;try{var i=[7],s=i[r]();s.next=function(){return{done:n=!0}},i[r]=function(){return s},e(i)}catch(o){}return n}},"4f7f":function(e,t,n){"use strict";var r=n("c26b"),a=n("b39a"),i="Set";e.exports=n("e0b8")(i,(function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(e){return r.def(a(this,i),e=0===e?0:e,e)}},r)},5038:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"siang"===t?e>=11?e:e+12:"sore"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",ss:"%d detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}});return t}))},"504c":function(e,t,n){var r=n("9e1e"),a=n("0d58"),i=n("6821"),o=n("52a7").f;e.exports=function(e){return function(t){var n,s=i(t),u=a(s),l=u.length,c=0,d=[];while(l>c)n=u[c++],r&&!o.call(s,n)||d.push(e?[n,s[n]]:s[n]);return d}}},"50d1":function(e,t,n){(function(t,n){e.exports=n()})(0,(function(){"use strict";function e(e){return"[object Array]"===Object.prototype.toString.call(e)}function t(e){return e instanceof Function}function n(e){return"[object Object]"===Object.prototype.toString.call(e)&&!t(e)&&e instanceof Object}function r(t,a){var i;for(i in a)"__proto__"!==i&&(n(a[i])||e(a[i])?(n(a[i])&&!n(t[i])&&(t[i]={}),e(a[i])&&!e(t[i])&&(t[i]=[]),r(t[i],a[i])):void 0!==a[i]&&(t[i]=a[i]))}function a(e,t){var n={};return r(n,e),r(n,t),n}var i=/^(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)$/i,o=/(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)(T)?(\d\d)(:)?(\d\d)?(:)?(\d\d)?([.,]\d+)?($|Z|([+-])(\d\d)(:)?(\d\d)?)/i,s=String(1.5).charAt(1);function u(e){var t,n,r,a,i,u,l,c,d,f,h;return f=Object.prototype.toString.call(e),"[object Date]"===f?e:"[object String]"===f?(r=e.match(o),r?(h=parseInt(r[1],10),u=parseInt(r[3],10)-1,t=parseInt(r[5],10),n=parseInt(r[7],10),i=r[9]?parseInt(r[9],10):0,d=r[11]?parseInt(r[11],10):0,a=r[12]?1e3*parseFloat(s+r[12].slice(1)):0,c=Date.UTC(h,u,t,n,i,d,a),r[13]&&r[14]&&(l=60*r[15],r[17]&&(l+=parseInt(r[17],10)),l*="-"===r[14]?-1:1,c-=60*l*1e3),new Date(c)):void 0):void 0}function l(e){var t,n,r;for(t=0;t=6}function x(e){return"number"===typeof e}function Y(e,t,n,r){e=e||"",n.prefix&&(t<0&&(t*=-1,e+="-"),e+=n.prefix);var a=n.suffix||"",i=n.precision,o=n.round;if(n.byteScale){var s=r?n.byteScale:t;s>=1099511627776?(t/=1099511627776,a=" TB"):s>=1073741824?(t/=1073741824,a=" GB"):s>=1048576?(t/=1048576,a=" MB"):s>=1024?(t/=1024,a=" KB"):a=" bytes",void 0===i&&void 0===o&&(i=3)}if(void 0!==i&&void 0!==o)throw Error("Use either round or precision, not both");if(!r&&(void 0!==i&&(t=t.toPrecision(i),n.zeros||(t=parseFloat(t))),void 0!==o))if(o<0){var u=Math.pow(10,-1*o);t=parseInt((1*t/u).toFixed(0))*u}else t=t.toFixed(o),n.zeros||(t=parseFloat(t));if(n.thousands||n.decimal){t=c(t);var l=t.split(".");t=l[0],n.thousands&&(t=t.replace(/\B(?=(\d{3})+(?!\d))/g,n.thousands)),l.length>1&&(t+=(n.decimal||".")+l[1])}return e+t+a}function D(e,t,n){return n in t?t[n]:n in e.options?e.options[n]:null}function S(e){var t,n,r;for(t=0;t25?r=25:r<10&&(r=10),n.scales.xAxes[0].ticks.callback||(n.scales.xAxes[0].ticks.callback=function(e){return e=c(e),e.length>r?e.substring(0,r-2)+"...":e})},U=function(t,n,r){var a={prefix:t.options.prefix,suffix:t.options.suffix,thousands:t.options.thousands,decimal:t.options.decimal,precision:t.options.precision,round:t.options.round,zeros:t.options.zeros};if(t.options.bytes){var i=t.data;"pie"===r&&(i=[{data:i}]);for(var o=0,s=0;so&&(o=u.data[l][1]);var c=1;while(o>=1024)c*=1024,o/=1024;a.byteScale=c}if("pie"!==r){var d=n.scales.yAxes;"bar"===r&&(d=n.scales.xAxes),a.byteScale&&(d[0].ticks.stepSize||(d[0].ticks.stepSize=a.byteScale/2),d[0].ticks.maxTicksLimit||(d[0].ticks.maxTicksLimit=4)),d[0].ticks.callback||(d[0].ticks.callback=function(e){return Y("",e,a,!0)})}if(!n.tooltips.callbacks.label)if("scatter"===r)n.tooltips.callbacks.label=function(e,t){var n=t.datasets[e.datasetIndex].label||"";return n&&(n+=": "),n+"("+e.xLabel+", "+e.yLabel+")"};else if("bubble"===r)n.tooltips.callbacks.label=function(e,t){var n=t.datasets[e.datasetIndex].label||"";n&&(n+=": ");var r=t.datasets[e.datasetIndex].data[e.index];return n+"("+e.xLabel+", "+e.yLabel+", "+r.v+")"};else if("pie"===r)n.tooltips.callbacks.label=function(t,n){var r=n.labels[t.index],i=": ";return e(r)?(r=r.slice(),r[0]+=i):r+=i,Y(r,n.datasets[t.datasetIndex].data[t.index],a)};else{var f="bar"===r?"xLabel":"yLabel";n.tooltips.callbacks.label=function(e,t){var n=t.datasets[e.datasetIndex].label||"";return n&&(n+=": "),Y(n,e[f],a)}}},$=m(a(T,O),P,j,H,C,F,I,N),B=function(e,t,n,r){var i,o=[],s=[],u=e.options.colors||A,l=!0,c=!0,h=!0,m=!0,p=!0,_=!0,k=e.data,x=0;if("bubble"===n)for(var Y=0;Yx&&(x=S.data[T][2]);var O,P,j,H,C,E=[],z=[];if("bar"===n||"column"===n||"number"!==e.xtype&&"bubble"!==e.xtype){var F,I,N=[];for(O=0;O0){var re=(R(X)?f(X):s[0]).getTime(),ae=(R(ee)?f(ee):s[0]).getTime();for(O=1;Oae&&(ae=ie)}var oe,se=(ae-re)/864e5;if(!t.scales.xAxes[0].time.unit)if(m||se>3650?(t.scales.xAxes[0].time.unit="year",oe=365):h||se>300?(t.scales.xAxes[0].time.unit="month",oe=30):l||se>10?(t.scales.xAxes[0].time.unit="day",oe=1):p||se>.5?(t.scales.xAxes[0].time.displayFormats={hour:"MMM D, h a"},t.scales.xAxes[0].time.unit="hour",oe=1/24):_&&(t.scales.xAxes[0].time.displayFormats={minute:"h:mm a"},t.scales.xAxes[0].time.unit="minute",oe=1/24/60),oe&&se>0){var ue=Math.ceil(se/oe/(e.element.offsetWidth/100));c&&1===oe&&(ue=7*Math.ceil(ue/7)),t.scales.xAxes[0].time.unitStepSize=ue}t.scales.xAxes[0].time.tooltipFormat||(l?t.scales.xAxes[0].time.tooltipFormat="ll":p?t.scales.xAxes[0].time.tooltipFormat="MMM D, h a":_&&(t.scales.xAxes[0].time.tooltipFormat="h:mm a"))}var le={labels:s,datasets:o};return le},q=function(e){this.name="chartjs",this.library=e};q.prototype.renderLineChart=function(e,t){var n={};!e.options.max&&S(e.data)&&(n.max=1);var r=$(e,a(n,e.options));U(e,r,t);var i=B(e,r,t||"line",this.library);"number"===e.xtype?(r.scales.xAxes[0].type="linear",r.scales.xAxes[0].position="bottom"):r.scales.xAxes[0].type="string"===e.xtype?"category":"time",this.drawChart(e,"line",i,r)},q.prototype.renderPieChart=function(e){var t=a({},T);e.options.donut&&(t.cutoutPercentage=50),"legend"in e.options&&P(t,e.options.legend),e.options.title&&j(t,e.options.title),t=a(t,e.options.library||{}),U(e,t,"pie");for(var n=[],r=[],i=0;i● '+Y(this.series.name+": ",this.y,r)+"
"})},ae=function(e){this.name="highcharts",this.library=e};ae.prototype.renderLineChart=function(e,t){t=t||"spline";var n={};"areaspline"===t&&(n={plotOptions:{areaspline:{stacking:"normal"},area:{stacking:"normal"},series:{marker:{enabled:!1}}}}),!1===e.options.curve&&("areaspline"===t?t="area":"spline"===t&&(t="line"));var r,a,i,o=ne(e,e.options,n);o.xAxis.type="string"===e.xtype?"category":"number"===e.xtype?"linear":"datetime",o.chart.type||(o.chart.type=t),re(e,o,t);var s=e.data;for(a=0;a0)return!1;return!0}function Re(e,t){t.options.messages&&t.options.messages.empty&&We(t.data,e)?Oe(t.element,t.options.messages.empty):(Ve(e,t),t.options.download&&!t.__downloadAttached&&"chartjs"===t.adapter&&He(t))}function Ve(e,n){var r,a,i,o;for(i="render"+e,o=n.options.adapter,Ne(),r=0;r0?new Error("No charting library found for "+e):new Error("No charting libraries found - be sure to include one before your charts")}var Ue=function(e,t){return e="number"===t?d(e):"datetime"===t?f(e):c(e),e},$e=function(e,t){var n,r,a=[];for(r=0;r1&&i.call(o[0],n,(function(){for(c=1;c=11?e:e+12:"entsambama"===t||"ebusuku"===t?0===e?0:e+12:void 0},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}});return t}))},"53e2":function(e,t,n){var r=n("07e3"),a=n("241e"),i=n("5559")("IE_PROTO"),o=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=a(e),r(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?o:null}},"549b":function(e,t,n){"use strict";var r=n("d864"),a=n("63b6"),i=n("241e"),o=n("b0dc"),s=n("3702"),u=n("b447"),l=n("20fd"),c=n("7cd6");a(a.S+a.F*!n("4ee1")((function(e){Array.from(e)})),"Array",{from:function(e){var t,n,a,d,f=i(e),h="function"==typeof this?this:Array,m=arguments.length,p=m>1?arguments[1]:void 0,_=void 0!==p,y=0,g=c(f);if(_&&(p=r(p,m>2?arguments[2]:void 0,2)),void 0==g||h==Array&&s(g))for(t=u(f.length),n=new h(t);t>y;y++)l(n,y,_?p(f[y],y):f[y]);else for(d=g.call(f),n=new h;!(a=d.next()).done;y++)l(n,y,_?o(d,p,[a.value,y],!0):a.value);return n.length=y,n}})},"54a1":function(e,t,n){n("6c1c"),n("1654"),e.exports=n("95d5")},"551c":function(e,t,n){"use strict";var r,a,i,o,s=n("2d00"),u=n("7726"),l=n("9b43"),c=n("23c6"),d=n("5ca1"),f=n("d3f4"),h=n("d8e8"),m=n("f605"),p=n("4a59"),_=n("ebd6"),y=n("1991").set,g=n("8079")(),v=n("a5b8"),b=n("9c80"),M=n("a25f"),w=n("bcaa"),L="Promise",k=u.TypeError,x=u.process,Y=x&&x.versions,D=Y&&Y.v8||"",S=u[L],T="process"==c(x),O=function(){},A=a=v.f,P=!!function(){try{var e=S.resolve(1),t=(e.constructor={})[n("2b4c")("species")]=function(e){e(O,O)};return(T||"function"==typeof PromiseRejectionEvent)&&e.then(O)instanceof t&&0!==D.indexOf("6.6")&&-1===M.indexOf("Chrome/66")}catch(r){}}(),j=function(e){var t;return!(!f(e)||"function"!=typeof(t=e.then))&&t},H=function(e,t){if(!e._n){e._n=!0;var n=e._c;g((function(){var r=e._v,a=1==e._s,i=0,o=function(t){var n,i,o,s=a?t.ok:t.fail,u=t.resolve,l=t.reject,c=t.domain;try{s?(a||(2==e._h&&z(e),e._h=1),!0===s?n=r:(c&&c.enter(),n=s(r),c&&(c.exit(),o=!0)),n===t.promise?l(k("Promise-chain cycle")):(i=j(n))?i.call(n,u,l):u(n)):l(r)}catch(d){c&&!o&&c.exit(),l(d)}};while(n.length>i)o(n[i++]);e._c=[],e._n=!1,t&&!e._h&&C(e)}))}},C=function(e){y.call(u,(function(){var t,n,r,a=e._v,i=E(e);if(i&&(t=b((function(){T?x.emit("unhandledRejection",a,e):(n=u.onunhandledrejection)?n({promise:e,reason:a}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",a)})),e._h=T||E(e)?2:1),e._a=void 0,i&&t.e)throw t.v}))},E=function(e){return 1!==e._h&&0===(e._a||e._c).length},z=function(e){y.call(u,(function(){var t;T?x.emit("rejectionHandled",e):(t=u.onrejectionhandled)&&t({promise:e,reason:e._v})}))},F=function(e){var t=this;t._d||(t._d=!0,t=t._w||t,t._v=e,t._s=2,t._a||(t._a=t._c.slice()),H(t,!0))},I=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw k("Promise can't be resolved itself");(t=j(e))?g((function(){var r={_w:n,_d:!1};try{t.call(e,l(I,r,1),l(F,r,1))}catch(a){F.call(r,a)}})):(n._v=e,n._s=1,H(n,!1))}catch(r){F.call({_w:n,_d:!1},r)}}};P||(S=function(e){m(this,S,L,"_h"),h(e),r.call(this);try{e(l(I,this,1),l(F,this,1))}catch(t){F.call(this,t)}},r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n("dcbc")(S.prototype,{then:function(e,t){var n=A(_(this,S));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=T?x.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&H(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new r;this.promise=e,this.resolve=l(I,e,1),this.reject=l(F,e,1)},v.f=A=function(e){return e===S||e===o?new i(e):a(e)}),d(d.G+d.W+d.F*!P,{Promise:S}),n("7f20")(S,L),n("7a56")(L),o=n("8378")[L],d(d.S+d.F*!P,L,{reject:function(e){var t=A(this),n=t.reject;return n(e),t.promise}}),d(d.S+d.F*(s||!P),L,{resolve:function(e){return w(s&&this===o?S:this,e)}}),d(d.S+d.F*!(P&&n("5cc5")((function(e){S.all(e)["catch"](O)}))),L,{all:function(e){var t=this,n=A(t),r=n.resolve,a=n.reject,i=b((function(){var n=[],i=0,o=1;p(e,!1,(function(e){var s=i++,u=!1;n.push(void 0),o++,t.resolve(e).then((function(e){u||(u=!0,n[s]=e,--o||r(n))}),a)})),--o||r(n)}));return i.e&&a(i.v),n.promise},race:function(e){var t=this,n=A(t),r=n.reject,a=b((function(){p(e,!1,(function(e){t.resolve(e).then(n.resolve,r)}))}));return a.e&&r(a.v),n.promise}})},5537:function(e,t,n){var r=n("8378"),a=n("7726"),i="__core-js_shared__",o=a[i]||(a[i]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n("2d00")?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},5559:function(e,t,n){var r=n("dbdb")("keys"),a=n("62a0");e.exports=function(e){return r[e]||(r[e]=a(e))}},"55c9":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),r=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],a=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,i=e.defineLocale("es-us",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,r){return e?/-MMM-/.test(r)?n[e.month()]:t[e.month()]:t},monthsRegex:a,monthsShortRegex:a,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:r,longMonthsParse:r,shortMonthsParse:r,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:6}});return i}))},"55dd":function(e,t,n){"use strict";var r=n("5ca1"),a=n("d8e8"),i=n("4bf8"),o=n("79e5"),s=[].sort,u=[1,2,3];r(r.P+r.F*(o((function(){u.sort(void 0)}))||!o((function(){u.sort(null)}))||!n("2f21")(s)),"Array",{sort:function(e){return void 0===e?s.call(i(this)):s.call(i(this),a(e))}})},5708:function(e,t,n){"use strict";var r=Object,a=TypeError;e.exports=function(){if(null!=this&&this!==r(this))throw new a("RegExp.prototype.flags getter called on non-object");var e="";return this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.sticky&&(e+="y"),e}},"576c":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"minutu balun",ss:"minutu %d",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10,n=1===~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n},week:{dow:1,doy:4}});return t}))},"57b8":function(e,t){function n(e,t){var n={};for(var r in"string"===typeof t&&(t=[].slice.call(arguments,1)),e)e.hasOwnProperty&&!e.hasOwnProperty(r)||-1===t.indexOf(r)&&(n[r]=e[r]);return n}e.exports=n},"57ec":function(e,t,n){"use strict";var r=n("5708"),a=n("f367").supportsDescriptors,i=Object.getOwnPropertyDescriptor,o=TypeError;e.exports=function(){if(!a)throw new o("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");if("gim"===/a/gim.flags){var e=i(RegExp.prototype,"flags");if(e&&"function"===typeof e.get&&"boolean"===typeof/a/.dotAll)return e.get}return r}},"584a":function(e,t){var n=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=n)},"585a":function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n("c8ba"))},"598a":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"],n=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"],r=e.defineLocale("dv",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(e){return"މފ"===e},meridiem:function(e,t,n){return e<12?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",ss:"d% ސިކުންތު",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:7,doy:12}});return r}))},"5b14":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");function n(e,t,n,r){var a=e;switch(n){case"s":return r||t?"néhány másodperc":"néhány másodperce";case"ss":return a+(r||t)?" másodperc":" másodperce";case"m":return"egy"+(r||t?" perc":" perce");case"mm":return a+(r||t?" perc":" perce");case"h":return"egy"+(r||t?" óra":" órája");case"hh":return a+(r||t?" óra":" órája");case"d":return"egy"+(r||t?" nap":" napja");case"dd":return a+(r||t?" nap":" napja");case"M":return"egy"+(r||t?" hónap":" hónapja");case"MM":return a+(r||t?" hónap":" hónapja");case"y":return"egy"+(r||t?" év":" éve");case"yy":return a+(r||t?" év":" éve")}return""}function r(e){return(e?"":"[múlt] ")+"["+t[this.day()]+"] LT[-kor]"}var a=e.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,t,n){return e<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return r.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return r.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return a}))},"5b4e":function(e,t,n){var r=n("36c3"),a=n("b447"),i=n("0fc9");e.exports=function(e){return function(t,n,o){var s,u=r(t),l=a(u.length),c=i(o,l);if(e&&n!=n){while(l>c)if(s=u[c++],s!=s)return!0}else for(;l>c;c++)if((e||c in u)&&u[c]===n)return e||c||0;return!e&&-1}}},"5c3a":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"下午"===t||"晚上"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var r=100*e+t;return r<600?"凌晨":r<900?"早上":r<1130?"上午":r<1230?"中午":r<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s内",past:"%s前",s:"几秒",ss:"%d 秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}});return t}))},"5c95":function(e,t,n){var r=n("35e8");e.exports=function(e,t,n){for(var a in t)n&&e[a]?e[a]=t[a]:r(e,a,t[a]);return e}},"5c9a":function(e,t){function n(e,t){for(var n={},r=Object.keys(e),a=r.length,i=0;i=10?e:e+12:"సాయంత్రం"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"రాత్రి":e<10?"ఉదయం":e<17?"మధ్యాహ్నం":e<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}});return t}))},"5cc5":function(e,t,n){var r=n("2b4c")("iterator"),a=!1;try{var i=[7][r]();i["return"]=function(){a=!0},Array.from(i,(function(){throw 2}))}catch(o){}e.exports=function(e,t){if(!t&&!a)return!1;var n=!1;try{var i=[7],s=i[r]();s.next=function(){return{done:n=!0}},i[r]=function(){return s},e(i)}catch(o){}return n}},"5d58":function(e,t,n){e.exports=n("d8d6")},"5d73":function(e,t,n){e.exports=n("469f")},"5dbc":function(e,t,n){var r=n("d3f4"),a=n("8b97").set;e.exports=function(e,t,n){var i,o=t.constructor;return o!==n&&"function"==typeof o&&(i=o.prototype)!==n.prototype&&r(i)&&a&&a(e,i),e}},"5df3":function(e,t,n){"use strict";var r=n("02f4")(!0);n("01f9")(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})}))},"5e2e":function(e,t,n){var r=n("28c9"),a=n("69d5"),i=n("b4c0"),o=n("fba5"),s=n("67ca");function u(e){var t=-1,n=null==e?0:e.length;this.clear();while(++t=11?e:e+12},meridiem:function(e,t,n){var r=100*e+t;return r<600?"يېرىم كېچە":r<900?"سەھەر":r<1130?"چۈشتىن بۇرۇن":r<1230?"چۈش":r<1800?"چۈشتىن كېيىن":"كەچ"},calendar:{sameDay:"[بۈگۈن سائەت] LT",nextDay:"[ئەتە سائەت] LT",nextWeek:"[كېلەركى] dddd [سائەت] LT",lastDay:"[تۆنۈگۈن] LT",lastWeek:"[ئالدىنقى] dddd [سائەت] LT",sameElse:"L"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",ss:"%d سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"},dayOfMonthOrdinalParse:/\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"-كۈنى";case"w":case"W":return e+"-ھەپتە";default:return e}},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:7}});return t}))},"613b":function(e,t,n){var r=n("5537")("keys"),a=n("ca5a");e.exports=function(e){return r[e]||(r[e]=a(e))}},"61ab":function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n0?40*e+55:0,o=t>0?40*t+55:0,s=n>0?40*n+55:0;r[a]=d([i,o,s])}function c(e){var t=e.toString(16);while(t.length<2)t="0"+t;return t}function d(e){var t=[],n=!0,r=!1,a=void 0;try{for(var i,o=e[Symbol.iterator]();!(n=(i=o.next()).done);n=!0){var s=i.value;t.push(c(s))}}catch(u){r=!0,a=u}finally{try{n||null==o["return"]||o["return"]()}finally{if(r)throw a}}return"#"+t.join("")}function f(e,t,n,r){var a;return"text"===t?a=v(n,r):"display"===t?a=m(e,n,r):"xterm256"===t?a=w(e,r.colors[n]):"rgb"===t&&(a=h(e,n)),a}function h(e,t){t=t.substring(2).slice(0,-1);var n=+t.substr(0,2),r=t.substring(5).split(";"),a=r.map((function(e){return("0"+Number(e).toString(16)).substr(-2)})).join("");return M(e,(38===n?"color:#":"background-color:#")+a)}function m(e,t,n){t=parseInt(t,10);var r,a={"-1":function(){return"
"},0:function(){return e.length&&p(e)},1:function(){return b(e,"b")},3:function(){return b(e,"i")},4:function(){return b(e,"u")},8:function(){return M(e,"display:none")},9:function(){return b(e,"strike")},22:function(){return M(e,"font-weight:normal;text-decoration:none;font-style:normal")},23:function(){return k(e,"i")},24:function(){return k(e,"u")},39:function(){return w(e,n.fg)},49:function(){return L(e,n.bg)},53:function(){return M(e,"text-decoration:overline")}};return a[t]?r=a[t]():4"})).join("")}function _(e,t){for(var n=[],r=e;r<=t;r++)n.push(r);return n}function y(e){return function(t){return(null===e||t.category!==e)&&"all"!==e}}function g(e){e=parseInt(e,10);var t=null;return 0===e?t="all":1===e?t="bold":2"].join("")}function M(e,t){return b(e,"span",t)}function w(e,t){return b(e,"span","color:"+t)}function L(e,t){return b(e,"span","background-color:"+t)}function k(e,t){var n;if(e.slice(-1)[0]===t&&(n=e.pop()),n)return""}function x(e,t,n){var r=!1,a=3;function i(){return""}function o(e,t){return n("xterm256",t),""}function s(e){return t.newline?n("display",-1):n("text",e),""}function u(e,t){r=!0,0===t.trim().length&&(t="0"),t=t.trimRight(";").split(";");var a=!0,i=!1,o=void 0;try{for(var s,u=t[Symbol.iterator]();!(a=(s=u.next()).done);a=!0){var l=s.value;n("display",l)}}catch(c){i=!0,o=c}finally{try{a||null==u["return"]||u["return"]()}finally{if(i)throw o}}return""}function l(e){return n("text",e),""}function c(e){return n("rgb",e),""}var d=[{pattern:/^\x08+/,sub:i},{pattern:/^\x1b\[[012]?K/,sub:i},{pattern:/^\x1b\[\(B/,sub:i},{pattern:/^\x1b\[[34]8;2;\d+;\d+;\d+m/,sub:c},{pattern:/^\x1b\[38;5;(\d+)m/,sub:o},{pattern:/^\n/,sub:s},{pattern:/^\r\n/,sub:s},{pattern:/^\x1b\[((?:\d{1,3};?)+|)m/,sub:u},{pattern:/^\x1b\[\d?J/,sub:i},{pattern:/^\x1b\[\d{0,3};\d{0,3}f/,sub:i},{pattern:/^\x1b\[?[\d;]{0,3}/,sub:i},{pattern:/^(([^\x1b\x08\r\n])+)/,sub:l}];function f(t,n){n>a&&r||(r=!1,e=e.replace(t.pattern,t.sub))}var h=[],m=e,p=m.length;e:while(p>0){for(var _=0,y=0,g=d.length;y= 0x80 (not a basic code point)","invalid-input":"Invalid input"},M=l-c,w=Math.floor,L=String.fromCharCode;function k(e){throw new RangeError(b[e])}function x(e,t){var n=e.length,r=[];while(n--)r[n]=t(e[n]);return r}function Y(e,t){var n=e.split("@"),r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(v,".");var a=e.split("."),i=x(a,t).join(".");return r+i}function D(e){var t,n,r=[],a=0,i=e.length;while(a=55296&&t<=56319&&a65535&&(e-=65536,t+=L(e>>>10&1023|55296),e=56320|1023&e),t+=L(e),t})).join("")}function T(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:l}function O(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function A(e,t,n){var r=0;for(e=n?w(e/h):e>>1,e+=w(e/t);e>M*d>>1;r+=l)e=w(e/M);return w(r+(M+1)*e/(e+f))}function P(e){var t,n,r,a,i,o,s,f,h,y,g=[],v=e.length,b=0,M=p,L=m;for(n=e.lastIndexOf(_),n<0&&(n=0),r=0;r=128&&k("not-basic"),g.push(e.charCodeAt(r));for(a=n>0?n+1:0;a=v&&k("invalid-input"),f=T(e.charCodeAt(a++)),(f>=l||f>w((u-b)/o))&&k("overflow"),b+=f*o,h=s<=L?c:s>=L+d?d:s-L,fw(u/y)&&k("overflow"),o*=y}t=g.length+1,L=A(b-i,t,0==i),w(b/t)>u-M&&k("overflow"),M+=w(b/t),b%=t,g.splice(b++,0,M)}return S(g)}function j(e){var t,n,r,a,i,o,s,f,h,y,g,v,b,M,x,Y=[];for(e=D(e),v=e.length,t=p,n=0,i=m,o=0;o=t&&gw((u-n)/b)&&k("overflow"),n+=(s-t)*b,t=s,o=0;ou&&k("overflow"),g==t){for(f=n,h=l;;h+=l){if(y=h<=i?c:h>=i+d?d:h-i,f=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}});return t}))},"64b2":function(e){e.exports=JSON.parse('{"amp":"&","apos":"\'","gt":">","lt":"<","quot":"\\""}')},"656b":function(e,t,n){var r=n("e2e4"),a=n("f4d6");function i(e,t){t=r(t,e);var n=0,i=t.length;while(null!=e&&n11?n?"p.t.m.":"P.T.M.":n?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd [je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasinta] dddd [je] LT",sameElse:"L"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"sekundoj",ss:"%d sekundoj",m:"minuto",mm:"%d minutoj",h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"},dayOfMonthOrdinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}});return t}))},6718:function(e,t,n){var r=n("e53d"),a=n("584a"),i=n("b8e3"),o=n("ccb9"),s=n("d9f6").f;e.exports=function(e){var t=a.Symbol||(a.Symbol=i?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:o.f(e)})}},6747:function(e,t){var n=Array.isArray;e.exports=n},6762:function(e,t,n){"use strict";var r=n("5ca1"),a=n("c366")(!0);r(r.P,"Array",{includes:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}}),n("9c6c")("includes")},6784:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=["جنوري","فيبروري","مارچ","اپريل","مئي","جون","جولاءِ","آگسٽ","سيپٽمبر","آڪٽوبر","نومبر","ڊسمبر"],n=["آچر","سومر","اڱارو","اربع","خميس","جمع","ڇنڇر"],r=e.defineLocale("sd",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[اڄ] LT",nextDay:"[سڀاڻي] LT",nextWeek:"dddd [اڳين هفتي تي] LT",lastDay:"[ڪالهه] LT",lastWeek:"[گزريل هفتي] dddd [تي] LT",sameElse:"L"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",ss:"%d سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}});return r}))},"67ab":function(e,t,n){var r=n("ca5a")("meta"),a=n("d3f4"),i=n("69a8"),o=n("86cc").f,s=0,u=Object.isExtensible||function(){return!0},l=!n("79e5")((function(){return u(Object.preventExtensions({}))})),c=function(e){o(e,r,{value:{i:"O"+ ++s,w:{}}})},d=function(e,t){if(!a(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,r)){if(!u(e))return"F";if(!t)return"E";c(e)}return e[r].i},f=function(e,t){if(!i(e,r)){if(!u(e))return!0;if(!t)return!1;c(e)}return e[r].w},h=function(e){return l&&m.NEED&&u(e)&&!i(e,r)&&c(e),e},m=e.exports={KEY:r,NEED:!1,fastKey:d,getWeak:f,onFreeze:h}},"67bb":function(e,t,n){e.exports=n("f921")},"67ca":function(e,t,n){var r=n("cb5a");function a(e,t){var n=this.__data__,a=r(n,e);return a<0?(++this.size,n.push([e,t])):n[a][1]=t,this}e.exports=a},6821:function(e,t,n){var r=n("626a"),a=n("be13");e.exports=function(e){return r(a(e))}},6887:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";function t(e,t,n){var r={mm:"munutenn",MM:"miz",dd:"devezh"};return e+" "+a(r[n],e)}function n(e){switch(r(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}function r(e){return e>9?r(e%10):e}function a(e,t){return 2===t?i(e):e}function i(e){var t={m:"v",b:"v",d:"z"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}var o=e.defineLocale("br",{months:"Genver_C'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Merc'her_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h[e]mm A",LTS:"h[e]mm:ss A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY h[e]mm A",LLLL:"dddd, D [a viz] MMMM YYYY h[e]mm A"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warc'hoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Dec'h da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s 'zo",s:"un nebeud segondennoù",ss:"%d eilenn",m:"ur vunutenn",mm:t,h:"un eur",hh:"%d eur",d:"un devezh",dd:t,M:"ur miz",MM:t,y:"ur bloaz",yy:n},dayOfMonthOrdinalParse:/\d{1,2}(añ|vet)/,ordinal:function(e){var t=1===e?"añ":"vet";return e+t},week:{dow:1,doy:4}});return o}))},"688b":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("mi",{months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",ss:"%d hēkona",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}});return t}))},"688e":function(e,t,n){"use strict";var r="Function.prototype.bind called on incompatible ",a=Array.prototype.slice,i=Object.prototype.toString,o="[object Function]";e.exports=function(e){var t=this;if("function"!==typeof t||i.call(t)!==o)throw new TypeError(r+t);for(var n,s=a.call(arguments,1),u=function(){if(this instanceof n){var r=t.apply(this,s.concat(a.call(arguments)));return Object(r)===r?r:this}return t.apply(e,s.concat(a.call(arguments)))},l=Math.max(0,t.length-s.length),c=[],d=0;d10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}});return t}))},"696e":function(e,t,n){n("c207"),n("1654"),n("6c1c"),n("24c5"),n("3c11"),n("43fc"),e.exports=n("584a").Promise},6981:function(e,t,n){ +/*! + * clipboard.js v2.0.4 + * https://zenorocha.github.io/clipboard.js + * + * Licensed MIT © Zeno Rocha + */ +!function(t,n){e.exports=n()}(0,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(){function e(e,t){for(var n=0;n=100?100:null;return e+(t[e]||t[n]||t[r])},week:{dow:1,doy:7}});return n}))},"6d83":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}});return t}))},"6db7":function(e,t,n){"use strict";var r=function(e){return e!==e};e.exports=function(e,t){return 0===e&&0===t?1/e===1/t:e===t||!(!r(e)||!r(t))}},"6e98":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}});return t}))},"6f12":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("it-ch",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}});return t}))},"6f50":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10,n=1===~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n},week:{dow:1,doy:4}});return t}))},7073:function(e,t,n){var r=n("b514");function a(e){if(e>=55296&&e<=57343||e>1114111)return"�";e in r&&(e=r[e]);var t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e),t}e.exports=a},7118:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),n="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),r=e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,r){return e?/-MMM-/.test(r)?n[e.month()]:t[e.month()]:t},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",ss:"%d sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}});return r}))},"71c1":function(e,t,n){var r=n("3a38"),a=n("25eb");e.exports=function(e){return function(t,n){var i,o,s=String(a(t)),u=r(n),l=s.length;return u<0||u>=l?e?"":void 0:(i=s.charCodeAt(u),i<55296||i>56319||u+1===l||(o=s.charCodeAt(u+1))<56320||o>57343?e?s.charAt(u):i:e?s.slice(u,u+2):o-56320+(i-55296<<10)+65536)}}},7333:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("en-il",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10,n=1===~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}});return t}))},73334:function(e,t,n){"use strict";var r=n("9e1e"),a=n("0d58"),i=n("2621"),o=n("52a7"),s=n("4bf8"),u=n("626a"),l=Object.assign;e.exports=!l||n("79e5")((function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=l({},e)[n]||Object.keys(l({},t)).join("")!=r}))?function(e,t){var n=s(e),l=arguments.length,c=1,d=i.f,f=o.f;while(l>c){var h,m=u(arguments[c++]),p=d?a(m).concat(d(m)):a(m),_=p.length,y=0;while(_>y)h=p[y++],r&&!f.call(m,h)||(n[h]=m[h])}return n}:l},"74dc":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",ss:"sekunde %d",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"masiku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}});return t}))},7514:function(e,t,n){"use strict";var r=n("5ca1"),a=n("0a49")(5),i="find",o=!0;i in[]&&Array(1)[i]((function(){o=!1})),r(r.P+r.F*o,"Array",{find:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}}),n("9c6c")(i)},"75fc":function(e,t,n){"use strict";var r=n("a745"),a=n.n(r);function i(e){if(a()(e)){for(var t=0,n=new Array(e.length);t1&&e<5}function a(e,t,n,a){var i=e+" ";switch(n){case"s":return t||a?"pár sekúnd":"pár sekundami";case"ss":return t||a?i+(r(e)?"sekundy":"sekúnd"):i+"sekundami";case"m":return t?"minúta":a?"minútu":"minútou";case"mm":return t||a?i+(r(e)?"minúty":"minút"):i+"minútami";case"h":return t?"hodina":a?"hodinu":"hodinou";case"hh":return t||a?i+(r(e)?"hodiny":"hodín"):i+"hodinami";case"d":return t||a?"deň":"dňom";case"dd":return t||a?i+(r(e)?"dni":"dní"):i+"dňami";case"M":return t||a?"mesiac":"mesiacom";case"MM":return t||a?i+(r(e)?"mesiace":"mesiacov"):i+"mesiacmi";case"y":return t||a?"rok":"rokom";case"yy":return t||a?i+(r(e)?"roky":"rokov"):i+"rokmi"}}var i=e.defineLocale("sk",{months:t,monthsShort:n,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return i}))},"7c64":function(e,t,n){var r=n("e24b"),a=n("5e2e"),i=n("79bc");function o(){this.size=0,this.__data__={hash:new r,map:new(i||a),string:new r}}e.exports=o},"7cd6":function(e,t,n){var r=n("40c3"),a=n("5168")("iterator"),i=n("481b");e.exports=n("584a").getIteratorMethod=function(e){if(void 0!=e)return e[a]||e["@@iterator"]||i[r(e)]}},"7d7b":function(e,t,n){var r=n("e4ae"),a=n("7cd6");e.exports=n("584a").getIterator=function(e){var t=a(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return r(t.call(e))}},"7e90":function(e,t,n){var r=n("d9f6"),a=n("e4ae"),i=n("c3a1");e.exports=n("8e60")?Object.defineProperties:function(e,t){a(e);var n,o=i(t),s=o.length,u=0;while(s>u)r.f(e,n=o[u++],t[n]);return e}},"7f20":function(e,t,n){var r=n("86cc").f,a=n("69a8"),i=n("2b4c")("toStringTag");e.exports=function(e,t,n){e&&!a(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},"7f33":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("yo",{months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Ònì ni] LT",nextDay:"[Ọ̀la ni] LT",nextWeek:"dddd [Ọsẹ̀ tón'bọ] [ni] LT",lastDay:"[Àna ni] LT",lastWeek:"dddd [Ọsẹ̀ tólọ́] [ni] LT",sameElse:"L"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",ss:"aayá %d",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"},dayOfMonthOrdinalParse:/ọjọ́\s\d{1,2}/,ordinal:"ọjọ́ %d",week:{dow:1,doy:4}});return t}))},"7f7f":function(e,t,n){var r=n("86cc").f,a=Function.prototype,i=/^\s*function ([^ (]*)/,o="name";o in a||n("9e1e")&&r(a,o,{configurable:!0,get:function(){try{return(""+this).match(i)[1]}catch(e){return""}}})},"7fae":function(e,t,n){var r=n("d6c7"),a=n("e39c"),i=n("6db7"),o=n("d8d8"),s=n("e710"),u=n("0e65"),l=Date.prototype.getTime;function c(e,t,n){var r=n||{};return!(r.strict?!i(e,t):e!==t)||(!e||!t||"object"!==typeof e&&"object"!==typeof t?r.strict?i(e,t):e==t:h(e,t,r))}function d(e){return null===e||void 0===e}function f(e){return!(!e||"object"!==typeof e||"number"!==typeof e.length)&&("function"===typeof e.copy&&"function"===typeof e.slice&&!(e.length>0&&"number"!==typeof e[0]))}function h(e,t,n){var i,h;if(typeof e!==typeof t)return!1;if(d(e)||d(t))return!1;if(e.prototype!==t.prototype)return!1;if(a(e)!==a(t))return!1;var m=o(e),p=o(t);if(m!==p)return!1;if(m||p)return e.source===t.source&&s(e)===s(t);if(u(e)&&u(t))return l.call(e)===l.call(t);var _=f(e),y=f(t);if(_!==y)return!1;if(_||y){if(e.length!==t.length)return!1;for(i=0;i=0;i--)if(g[i]!=v[i])return!1;for(i=g.length-1;i>=0;i--)if(h=g[i],!c(e[h],t[h],n))return!1;return!0}e.exports=c},8079:function(e,t,n){var r=n("7726"),a=n("1991").set,i=r.MutationObserver||r.WebKitMutationObserver,o=r.process,s=r.Promise,u="process"==n("2d95")(o);e.exports=function(){var e,t,n,l=function(){var r,a;u&&(r=o.domain)&&r.exit();while(e){a=e.fn,e=e.next;try{a()}catch(i){throw e?n():t=void 0,i}}t=void 0,r&&r.enter()};if(u)n=function(){o.nextTick(l)};else if(!i||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var c=s.resolve(void 0);n=function(){c.then(l)}}else n=function(){a.call(r,l)};else{var d=!0,f=document.createTextNode("");new i(l).observe(f,{characterData:!0}),n=function(){f.data=d=!d}}return function(r){var a={fn:r,next:void 0};t&&(t.next=a),e||(e=a,n()),t=a}}},8155:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";function t(e,t,n,r){var a=e+" ";switch(n){case"s":return t||r?"nekaj sekund":"nekaj sekundami";case"ss":return a+=1===e?t?"sekundo":"sekundi":2===e?t||r?"sekundi":"sekundah":e<5?t||r?"sekunde":"sekundah":"sekund",a;case"m":return t?"ena minuta":"eno minuto";case"mm":return a+=1===e?t?"minuta":"minuto":2===e?t||r?"minuti":"minutama":e<5?t||r?"minute":"minutami":t||r?"minut":"minutami",a;case"h":return t?"ena ura":"eno uro";case"hh":return a+=1===e?t?"ura":"uro":2===e?t||r?"uri":"urama":e<5?t||r?"ure":"urami":t||r?"ur":"urami",a;case"d":return t||r?"en dan":"enim dnem";case"dd":return a+=1===e?t||r?"dan":"dnem":2===e?t||r?"dni":"dnevoma":t||r?"dni":"dnevi",a;case"M":return t||r?"en mesec":"enim mesecem";case"MM":return a+=1===e?t||r?"mesec":"mesecem":2===e?t||r?"meseca":"mesecema":e<5?t||r?"mesece":"meseci":t||r?"mesecev":"meseci",a;case"y":return t||r?"eno leto":"enim letom";case"yy":return a+=1===e?t||r?"leto":"letom":2===e?t||r?"leti":"letoma":e<5?t||r?"leta":"leti":t||r?"let":"leti",a}}var n=e.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}});return n}))},"81e9":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),n=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",t[7],t[8],t[9]];function r(e,t,n,r){var i="";switch(n){case"s":return r?"muutaman sekunnin":"muutama sekunti";case"ss":return r?"sekunnin":"sekuntia";case"m":return r?"minuutin":"minuutti";case"mm":i=r?"minuutin":"minuuttia";break;case"h":return r?"tunnin":"tunti";case"hh":i=r?"tunnin":"tuntia";break;case"d":return r?"päivän":"päivä";case"dd":i=r?"päivän":"päivää";break;case"M":return r?"kuukauden":"kuukausi";case"MM":i=r?"kuukauden":"kuukautta";break;case"y":return r?"vuoden":"vuosi";case"yy":i=r?"vuoden":"vuotta";break}return i=a(e,r)+" "+i,i}function a(e,r){return e<10?r?n[e]:t[e]:e}var i=e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:r,ss:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return i}))},8230:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},r=e.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:0,doy:6}});return r}))},8378:function(e,t){var n=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=n)},"83a1":function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e===1/t:e!=e&&t!=t}},8436:function(e,t){e.exports=function(){}},"84aa":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[В изминалата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[В изминалия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",ss:"%d секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дни",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}});return t}))},"84f2":function(e,t){e.exports={}},"85f2":function(e,t,n){e.exports=n("454f")},8615:function(e,t,n){var r=n("5ca1"),a=n("504c")(!1);r(r.S,"Object",{values:function(e){return a(e)}})},8689:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t={1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"},n={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"},r=e.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",ss:"%d စက္ကန့်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(e){return e.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}});return r}))},"86cc":function(e,t,n){var r=n("cb7c"),a=n("c69a"),i=n("6a99"),o=Object.defineProperty;t.f=n("9e1e")?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),a)try{return o(e,t,n)}catch(s){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},8840:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("gl",{months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(e){return 0===e.indexOf("un")?"n"+e:"en "+e},past:"hai %s",s:"uns segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}});return t}))},"898b":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),r=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],a=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,i=e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,r){return e?/-MMM-/.test(r)?n[e.month()]:t[e.month()]:t},monthsRegex:a,monthsShortRegex:a,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:r,longMonthsParse:r,shortMonthsParse:r,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}});return i}))},"8b97":function(e,t,n){var r=n("d3f4"),a=n("cb7c"),i=function(e,t){if(a(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{r=n("9b43")(Function.call,n("11e9").f(Object.prototype,"__proto__").set,2),r(e,[]),t=!(e instanceof Array)}catch(a){t=!0}return function(e,n){return i(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:i}},"8d47":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";function t(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}var n=e.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(e,t){return e?"string"===typeof t&&/D/.test(t.substring(0,t.indexOf("MMMM")))?this._monthsGenitiveEl[e.month()]:this._monthsNominativeEl[e.month()]:this._monthsNominativeEl},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(e,t,n){return e>11?n?"μμ":"ΜΜ":n?"πμ":"ΠΜ"},isPM:function(e){return"μ"===(e+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(e,n){var r=this._calendarEl[e],a=n&&n.hours();return t(r)&&(r=r.apply(n)),r.replace("{}",a%12===1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",ss:"%d δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},dayOfMonthOrdinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}});return n}))},"8d57":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_");function r(e){return e%10<5&&e%10>1&&~~(e/10)%10!==1}function a(e,t,n){var a=e+" ";switch(n){case"ss":return a+(r(e)?"sekundy":"sekund");case"m":return t?"minuta":"minutę";case"mm":return a+(r(e)?"minuty":"minut");case"h":return t?"godzina":"godzinę";case"hh":return a+(r(e)?"godziny":"godzin");case"MM":return a+(r(e)?"miesiące":"miesięcy");case"yy":return a+(r(e)?"lata":"lat")}}var i=e.defineLocale("pl",{months:function(e,r){return e?""===r?"("+n[e.month()]+"|"+t[e.month()]+")":/D MMMM/.test(r)?n[e.month()]:t[e.month()]:t},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedzielę o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W środę o] LT";case 6:return"[W sobotę o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",ss:a,m:a,mm:a,h:a,hh:a,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:a,y:"rok",yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return i}))},"8df4":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},n={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"},r=e.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(e){return/بعد از ظهر/.test(e)},meridiem:function(e,t,n){return e<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",ss:"ثانیه d%",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(e){return e.replace(/[۰-۹]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},dayOfMonthOrdinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}});return r}))},"8e60":function(e,t,n){e.exports=!n("294c")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},"8e6e":function(e,t,n){var r=n("5ca1"),a=n("990b"),i=n("6821"),o=n("11e9"),s=n("f1ae");r(r.S,"Object",{getOwnPropertyDescriptors:function(e){var t,n,r=i(e),u=o.f,l=a(r),c={},d=0;while(l.length>d)n=u(r,t=l[d++]),void 0!==n&&s(c,t,n);return c}})},"8e73":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},r=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},a={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},i=function(e){return function(t,n,i,o){var s=r(t),u=a[e][r(t)];return 2===s&&(u=u[n?0:1]),u.replace(/%d/i,t)}},o=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"],s=e.defineLocale("ar",{months:o,monthsShort:o,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:i("s"),ss:i("s"),m:i("m"),mm:i("m"),h:i("h"),hh:i("h"),d:i("d"),dd:i("d"),M:i("M"),MM:i("M"),y:i("y"),yy:i("y")},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}});return s}))},"8f60":function(e,t,n){"use strict";var r=n("a159"),a=n("aebd"),i=n("45f2"),o={};n("35e8")(o,n("5168")("iterator"),(function(){return this})),e.exports=function(e,t,n){e.prototype=r(o,{next:a(1,n)}),i(e,t+" Iterator")}},9003:function(e,t,n){var r=n("6b4c");e.exports=Array.isArray||function(e){return"Array"==r(e)}},9043:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"},r=e.defineLocale("bn",{months:"জানুয়ারী_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব_মার্চ_এপ্র_মে_জুন_জুল_আগ_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t&&e>=4||"দুপুর"===t&&e<5||"বিকাল"===t?e+12:e},meridiem:function(e,t,n){return e<4?"রাত":e<10?"সকাল":e<17?"দুপুর":e<20?"বিকাল":"রাত"},week:{dow:0,doy:6}});return r}))},9093:function(e,t,n){var r=n("ce10"),a=n("e11e").concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,a)}},"90ea":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var r=100*e+t;return r<600?"凌晨":r<900?"早上":r<1130?"上午":r<1230?"中午":r<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}});return t}))},9138:function(e,t,n){e.exports=n("35e8")},9166:function(e){e.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Acirc":"Â","acirc":"â","acute":"´","AElig":"Æ","aelig":"æ","Agrave":"À","agrave":"à","amp":"&","AMP":"&","Aring":"Å","aring":"å","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","brvbar":"¦","Ccedil":"Ç","ccedil":"ç","cedil":"¸","cent":"¢","copy":"©","COPY":"©","curren":"¤","deg":"°","divide":"÷","Eacute":"É","eacute":"é","Ecirc":"Ê","ecirc":"ê","Egrave":"È","egrave":"è","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","frac12":"½","frac14":"¼","frac34":"¾","gt":">","GT":">","Iacute":"Í","iacute":"í","Icirc":"Î","icirc":"î","iexcl":"¡","Igrave":"Ì","igrave":"ì","iquest":"¿","Iuml":"Ï","iuml":"ï","laquo":"«","lt":"<","LT":"<","macr":"¯","micro":"µ","middot":"·","nbsp":" ","not":"¬","Ntilde":"Ñ","ntilde":"ñ","Oacute":"Ó","oacute":"ó","Ocirc":"Ô","ocirc":"ô","Ograve":"Ò","ograve":"ò","ordf":"ª","ordm":"º","Oslash":"Ø","oslash":"ø","Otilde":"Õ","otilde":"õ","Ouml":"Ö","ouml":"ö","para":"¶","plusmn":"±","pound":"£","quot":"\\"","QUOT":"\\"","raquo":"»","reg":"®","REG":"®","sect":"§","shy":"­","sup1":"¹","sup2":"²","sup3":"³","szlig":"ß","THORN":"Þ","thorn":"þ","times":"×","Uacute":"Ú","uacute":"ú","Ucirc":"Û","ucirc":"û","Ugrave":"Ù","ugrave":"ù","uml":"¨","Uuml":"Ü","uuml":"ü","Yacute":"Ý","yacute":"ý","yen":"¥","yuml":"ÿ"}')},"93ed":function(e,t,n){var r=n("4245");function a(e){var t=r(this,e)["delete"](e);return this.size-=t?1:0,t}e.exports=a},9520:function(e,t,n){var r=n("3729"),a=n("1a8c"),i="[object AsyncFunction]",o="[object Function]",s="[object GeneratorFunction]",u="[object Proxy]";function l(e){if(!a(e))return!1;var t=r(e);return t==o||t==s||t==i||t==u}e.exports=l},"957c":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";function t(e,t){var n=e.split("_");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}function n(e,n,r){var a={ss:n?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:n?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"};return"m"===r?n?"минута":"минуту":e+" "+t(a[r],+e)}var r=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i],a=e.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:r,longMonthsParse:r,shortMonthsParse:r,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},calendar:{sameDay:"[Сегодня, в] LT",nextDay:"[Завтра, в] LT",lastDay:"[Вчера, в] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В следующее] dddd, [в] LT";case 1:case 2:case 4:return"[В следующий] dddd, [в] LT";case 3:case 5:case 6:return"[В следующую] dddd, [в] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd, [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd, [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd, [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",ss:n,m:n,mm:n,h:"час",hh:n,d:"день",dd:n,M:"месяц",MM:n,y:"год",yy:n},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-й";case"D":return e+"-го";case"w":case"W":return e+"-я";default:return e}},week:{dow:1,doy:4}});return a}))},"958b":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";function t(e,t,n,r){switch(n){case"s":return t?"хэдхэн секунд":"хэдхэн секундын";case"ss":return e+(t?" секунд":" секундын");case"m":case"mm":return e+(t?" минут":" минутын");case"h":case"hh":return e+(t?" цаг":" цагийн");case"d":case"dd":return e+(t?" өдөр":" өдрийн");case"M":case"MM":return e+(t?" сар":" сарын");case"y":case"yy":return e+(t?" жил":" жилийн");default:return e}}var n=e.defineLocale("mn",{months:"Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),monthsParseExact:!0,weekdays:"Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба".split("_"),weekdaysShort:"Ням_Дав_Мяг_Лха_Пүр_Баа_Бям".split("_"),weekdaysMin:"Ня_Да_Мя_Лх_Пү_Ба_Бя".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},meridiemParse:/ҮӨ|ҮХ/i,isPM:function(e){return"ҮХ"===e},meridiem:function(e,t,n){return e<12?"ҮӨ":"ҮХ"},calendar:{sameDay:"[Өнөөдөр] LT",nextDay:"[Маргааш] LT",nextWeek:"[Ирэх] dddd LT",lastDay:"[Өчигдөр] LT",lastWeek:"[Өнгөрсөн] dddd LT",sameElse:"L"},relativeTime:{future:"%s дараа",past:"%s өмнө",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2} өдөр/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+" өдөр";default:return e}}});return n}))},"95d5":function(e,t,n){var r=n("40c3"),a=n("5168")("iterator"),i=n("481b");e.exports=n("584a").isIterable=function(e){var t=Object(e);return void 0!==t[a]||"@@iterator"in t||i.hasOwnProperty(r(t))}},9609:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"},n=e.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кечээ саат] LT",lastWeek:"[Өткөн аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",ss:"%d секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(e){var n=e%10,r=e>=100?100:null;return e+(t[e]||t[n]||t[r])},week:{dow:1,doy:7}});return n}))},9638:function(e,t){function n(e,t){return e===t||e!==e&&t!==t}e.exports=n},"96cf":function(e,t,n){var r=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,a="function"===typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",o=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function u(e,t,n,r){var a=t&&t.prototype instanceof p?t:p,i=Object.create(a.prototype),o=new S(r||[]);return i._invoke=k(e,n,o),i}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(r){return{type:"throw",arg:r}}}e.wrap=u;var c="suspendedStart",d="suspendedYield",f="executing",h="completed",m={};function p(){}function _(){}function y(){}var g={};g[i]=function(){return this};var v=Object.getPrototypeOf,b=v&&v(v(T([])));b&&b!==n&&r.call(b,i)&&(g=b);var M=y.prototype=p.prototype=Object.create(g);function w(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function L(e){function t(n,a,i,o){var s=l(e[n],e,a);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"===typeof c&&r.call(c,"__await")?Promise.resolve(c.__await).then((function(e){t("next",e,i,o)}),(function(e){t("throw",e,i,o)})):Promise.resolve(c).then((function(e){u.value=e,i(u)}),(function(e){return t("throw",e,i,o)}))}o(s.arg)}var n;function a(e,r){function a(){return new Promise((function(n,a){t(e,r,n,a)}))}return n=n?n.then(a,a):a()}this._invoke=a}function k(e,t,n){var r=c;return function(a,i){if(r===f)throw new Error("Generator is already running");if(r===h){if("throw"===a)throw i;return O()}n.method=a,n.arg=i;while(1){var o=n.delegate;if(o){var s=x(o,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===c)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var u=l(e,t,n);if("normal"===u.type){if(r=n.done?h:d,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=h,n.method="throw",n.arg=u.arg)}}}function x(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator["return"]&&(n.method="return",n.arg=t,x(e,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var a=l(r,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,m;var i=a.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function Y(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(Y,this),this.reset(!0)}function T(e){if(e){var n=e[i];if(n)return n.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){while(++a=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(u&&l){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),D(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;D(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:T(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=r}catch(a){Function("r","regeneratorRuntime = r")(r)}},"972c":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";function t(e,t,n){var r={ss:"secunde",mm:"minute",hh:"ore",dd:"zile",MM:"luni",yy:"ani"},a=" ";return(e%100>=20||e>=100&&e%100===0)&&(a=" de "),e+a+r[n]}var n=e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",ss:t,m:"un minut",mm:t,h:"o oră",hh:t,d:"o zi",dd:t,M:"o lună",MM:t,y:"un an",yy:t},week:{dow:1,doy:7}});return n}))},9797:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",ss:"%d eiliad",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},dayOfMonthOrdinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var t=e,n="",r=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"];return t>20?n=40===t||50===t||60===t||80===t||100===t?"fed":"ain":t>0&&(n=r[t]),e+n},week:{dow:1,doy:4}});return t}))},"990b":function(e,t,n){var r=n("9093"),a=n("2621"),i=n("cb7c"),o=n("7726").Reflect;e.exports=o&&o.ownKeys||function(e){var t=r.f(i(e)),n=a.f;return n?t.concat(n(e)):t}},"9aa9":function(e,t){t.f=Object.getOwnPropertySymbols},"9b02":function(e,t,n){var r=n("656b");function a(e,t,n){var a=null==e?void 0:r(e,t);return void 0===a?n:a}e.exports=a},"9b43":function(e,t,n){var r=n("d8e8");e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,a){return e.call(t,n,r,a)}}return function(){return e.apply(t,arguments)}}},"9c6c":function(e,t,n){var r=n("2b4c")("unscopables"),a=Array.prototype;void 0==a[r]&&n("32e9")(a,r,{}),e.exports=function(e){a[r][e]=!0}},"9c80":function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(t){return{e:!0,v:t}}}},"9def":function(e,t,n){var r=n("4588"),a=Math.min;e.exports=function(e){return e>0?a(r(e),9007199254740991):0}},"9e1e":function(e,t,n){e.exports=!n("79e5")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},"9e69":function(e,t,n){var r=n("2b3e"),a=r.Symbol;e.exports=a},"9f26":function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(e,t){switch(t){case"D":return e+(1===e?"er":"");default:case"M":case"Q":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}});return t}))},a0d3:function(e,t,n){"use strict";var r=n("0f7c");e.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},a159:function(e,t,n){var r=n("e4ae"),a=n("7e90"),i=n("1691"),o=n("5559")("IE_PROTO"),s=function(){},u="prototype",l=function(){var e,t=n("1ec9")("iframe"),r=i.length,a="<",o=">";t.style.display="none",n("32fc").appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(a+"script"+o+"document.F=Object"+a+"/script"+o),e.close(),l=e.F;while(r--)delete l[u][i[r]];return l()};e.exports=Object.create||function(e,t){var n;return null!==e?(s[u]=r(e),n=new s,s[u]=null,n[o]=e):n=l(),void 0===t?n:a(n,t)}},a16e:function(e,t,n){var r=n("f0f2"),a=n("9166"),i=n("64b2"),o=n("7073"),s=l(i),u=l(r);function l(e){var t=Object.keys(e).join("|"),n=f(e);t+="|#[xX][\\da-fA-F]+|#\\d+";var r=new RegExp("&(?:"+t+");","g");return function(e){return String(e).replace(r,n)}}var c=function(){for(var e=Object.keys(a).sort(d),t=Object.keys(r).sort(d),n=0,i=0;nv;v++)if(_=t?g(o(m=e[v])[0],m[1]):g(e[v]),_===l||_===c)return _}else for(p=y.call(e);!(m=p.next()).done;)if(_=a(p,g,m.value,t),_===l||_===c)return _};t.BREAK=l,t.RETURN=c},a25f:function(e,t,n){var r=n("7726"),a=r.navigator;e.exports=a&&a.userAgent||""},a356:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("ar-dz",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"أح_إث_ثلا_أر_خم_جم_سب".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:4}});return t}))},a481:function(e,t,n){"use strict";var r=n("cb7c"),a=n("4bf8"),i=n("9def"),o=n("4588"),s=n("0390"),u=n("5f1b"),l=Math.max,c=Math.min,d=Math.floor,f=/\$([$&`']|\d\d?|<[^>]*>)/g,h=/\$([$&`']|\d\d?)/g,m=function(e){return void 0===e?e:String(e)};n("214f")("replace",2,(function(e,t,n,p){return[function(r,a){var i=e(this),o=void 0==r?void 0:r[t];return void 0!==o?o.call(r,i,a):n.call(String(i),r,a)},function(e,t){var a=p(n,e,this,t);if(a.done)return a.value;var d=r(e),f=String(this),h="function"===typeof t;h||(t=String(t));var y=d.global;if(y){var g=d.unicode;d.lastIndex=0}var v=[];while(1){var b=u(d,f);if(null===b)break;if(v.push(b),!y)break;var M=String(b[0]);""===M&&(d.lastIndex=s(f,i(d.lastIndex),g))}for(var w="",L=0,k=0;k=L&&(w+=f.slice(L,Y)+A,L=Y+x.length)}return w+f.slice(L)}];function _(e,t,r,i,o,s){var u=r+e.length,l=i.length,c=h;return void 0!==o&&(o=a(o),c=f),n.call(s,c,(function(n,a){var s;switch(a.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,r);case"'":return t.slice(u);case"<":s=o[a.slice(1,-1)];break;default:var c=+a;if(0===c)return n;if(c>l){var f=d(c/10);return 0===f?n:f<=l?void 0===i[f-1]?a.charAt(1):i[f-1]+a.charAt(1):n}s=i[c-1]}return void 0===s?"":s}))}}))},a501:function(e,t){function n(e,t){if(!Array.isArray(e)||!Array.isArray(t))throw new Error("expected both arguments to be arrays");for(var n=[],r=e.length,a=0;a-1&&-1==n.indexOf(i)&&n.push(i)}return n}e.exports=n},a524:function(e,t,n){var r=n("4245");function a(e){return r(this,e).has(e)}e.exports=a},a5b8:function(e,t,n){"use strict";var r=n("d8e8");function a(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)}e.exports.f=function(e){return new a(e)}},a745:function(e,t,n){e.exports=n("f410")},a7fa:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("bm",{months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},calendar:{sameDay:"[Bi lɛrɛ] LT",nextDay:"[Sini lɛrɛ] LT",nextWeek:"dddd [don lɛrɛ] LT",lastDay:"[Kunu lɛrɛ] LT",lastWeek:"dddd [tɛmɛnen lɛrɛ] LT",sameElse:"L"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",ss:"sekondi %d",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"},week:{dow:1,doy:4}});return t}))},aae3:function(e,t,n){var r=n("d3f4"),a=n("2d95"),i=n("2b4c")("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[i])?!!t:"RegExp"==a(e))}},aba2:function(e,t,n){var r=n("e53d"),a=n("4178").set,i=r.MutationObserver||r.WebKitMutationObserver,o=r.process,s=r.Promise,u="process"==n("6b4c")(o);e.exports=function(){var e,t,n,l=function(){var r,a;u&&(r=o.domain)&&r.exit();while(e){a=e.fn,e=e.next;try{a()}catch(i){throw e?n():t=void 0,i}}t=void 0,r&&r.enter()};if(u)n=function(){o.nextTick(l)};else if(!i||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var c=s.resolve(void 0);n=function(){c.then(l)}}else n=function(){a.call(r,l)};else{var d=!0,f=document.createTextNode("");new i(l).observe(f,{characterData:!0}),n=function(){f.data=d=!d}}return function(r){var a={fn:r,next:void 0};t&&(t.next=a),e||(e=a,n()),t=a}}},ac6a:function(e,t,n){for(var r=n("cadf"),a=n("0d58"),i=n("2aba"),o=n("7726"),s=n("32e9"),u=n("84f2"),l=n("2b4c"),c=l("iterator"),d=l("toStringTag"),f=u.Array,h={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},m=a(h),p=0;p=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},d=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=(t.children||[]).map(p.bind(null,e)),i=Object.keys(t.attributes||{}).reduce((function(e,n){var r=t.attributes[n];switch(n){case"class":e["class"]=h(r);break;case"style":e["style"]=f(r);break;default:e.attrs[n]=r}return e}),{class:{},style:{},attrs:{}}),o=r.class,s=void 0===o?{}:o,u=r.style,d=void 0===u?{}:u,_=r.attrs,y=void 0===_?{}:_,g=c(r,["class","style","attrs"]);return"string"===typeof t?t:e(t.tag,l({class:m(i.class,s),style:l({},i.style,d),attrs:l({},i.attrs,y)},g,{props:n}),a)}var _=!1;try{_=!0}catch(L){}function y(){var e;!_&&console&&"function"===typeof console.error&&(e=console).error.apply(e,arguments)}function g(e,t){return Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t?u({},e,t):{}}function v(e){var t,n=(t={"fa-spin":e.spin,"fa-pulse":e.pulse,"fa-fw":e.fixedWidth,"fa-border":e.border,"fa-li":e.listItem,"fa-inverse":e.inverse,"fa-flip-horizontal":"horizontal"===e.flip||"both"===e.flip,"fa-flip-vertical":"vertical"===e.flip||"both"===e.flip},u(t,"fa-"+e.size,null!==e.size),u(t,"fa-rotate-"+e.rotation,null!==e.rotation),u(t,"fa-pull-"+e.pull,null!==e.pull),u(t,"fa-swap-opacity",e.swapOpacity),t);return Object.keys(n).map((function(e){return n[e]?e:null})).filter((function(e){return e}))}function b(e,t){var n=0===(e||"").length?[]:[e];return n.concat(t).join(" ")}function M(e){return null===e?null:"object"===("undefined"===typeof e?"undefined":s(e))&&e.prefix&&e.iconName?e:Array.isArray(e)&&2===e.length?{prefix:e[0],iconName:e[1]}:"string"===typeof e?{prefix:"fas",iconName:e}:void 0}var w={name:"FontAwesomeIcon",functional:!0,props:{border:{type:Boolean,default:!1},fixedWidth:{type:Boolean,default:!1},flip:{type:String,default:null,validator:function(e){return["horizontal","vertical","both"].indexOf(e)>-1}},icon:{type:[Object,Array,String],required:!0},mask:{type:[Object,Array,String],default:null},listItem:{type:Boolean,default:!1},pull:{type:String,default:null,validator:function(e){return["right","left"].indexOf(e)>-1}},pulse:{type:Boolean,default:!1},rotation:{type:[String,Number],default:null,validator:function(e){return[90,180,270].indexOf(parseInt(e,10))>-1}},swapOpacity:{type:Boolean,default:!1},size:{type:String,default:null,validator:function(e){return["lg","xs","sm","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"].indexOf(e)>-1}},spin:{type:Boolean,default:!1},transform:{type:[String,Object],default:null},symbol:{type:[Boolean,String],default:!1},title:{type:String,default:null},inverse:{type:Boolean,default:!1}},render:function(e,t){var n=t.props,a=n.icon,i=n.mask,o=n.symbol,s=n.title,u=M(a),c=g("classes",v(n)),d=g("transform","string"===typeof n.transform?r["d"].transform(n.transform):n.transform),f=g("mask",M(i)),h=Object(r["b"])(u,l({},c,d,f,{symbol:o,title:s}));if(!h)return y("Could not find one or more icon(s)",u,f);var m=h.abstract,_=p.bind(null,e);return _(m[0],{},t.data)}};Boolean,Boolean}).call(this,n("c8ba"))},ada2:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";function t(e,t){var n=e.split("_");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}function n(e,n,r){var a={ss:n?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:n?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:n?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"};return"m"===r?n?"хвилина":"хвилину":"h"===r?n?"година":"годину":e+" "+t(a[r],+e)}function r(e,t){var n={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")};if(!0===e)return n["nominative"].slice(1,7).concat(n["nominative"].slice(0,1));if(!e)return n["nominative"];var r=/(\[[ВвУу]\]) ?dddd/.test(t)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(t)?"genitive":"nominative";return n[r][e.day()]}function a(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}var i=e.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:r,weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:a("[Сьогодні "),nextDay:a("[Завтра "),lastDay:a("[Вчора "),nextWeek:a("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return a("[Минулої] dddd [").call(this);case 1:case 2:case 4:return a("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",ss:n,m:n,mm:n,h:"годину",hh:n,d:"день",dd:n,M:"місяць",MM:n,y:"рік",yy:n},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}});return i}))},aebd:function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},afab:function(e,t,n){var r,a; +/*! + * URI.js - Mutating URLs + * Second Level Domain (SLD) Support + * + * Version: 1.19.2 + * + * Author: Rodney Rehm + * Web: http://medialize.github.io/URI.js/ + * + * Licensed under + * MIT License http://www.opensource.org/licenses/mit-license + * + */(function(i,o){"use strict";e.exports?e.exports=o():(r=o,a="function"===typeof r?r.call(t,n,t,e):r,void 0===a||(e.exports=a))})(0,(function(e){"use strict";var t=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;var r=e.lastIndexOf(".",t-1);if(r<=0||r>=t-1)return!1;var a=n.list[e.slice(t+1)];return!!a&&a.indexOf(" "+e.slice(r+1,t)+" ")>=0},is:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;var r=e.lastIndexOf(".",t-1);if(r>=0)return!1;var a=n.list[e.slice(t+1)];return!!a&&a.indexOf(" "+e.slice(0,t)+" ")>=0},get:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return null;var r=e.lastIndexOf(".",t-1);if(r<=0||r>=t-1)return null;var a=n.list[e.slice(t+1)];return a?a.indexOf(" "+e.slice(r+1,t)+" ")<0?null:e.slice(r+1):null},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n}))},b0b4:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n("85f2"),a=n.n(r);function i(e,t){for(var n=0;n0&&!a.call(e,0))for(var h=0;h0)for(var p=0;p0?a(r(e),9007199254740991):0}},b469:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";function t(e,t,n,r){var a={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?a[n][0]:a[n][1]}var n=e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return n}))},b4c0:function(e,t,n){var r=n("cb5a");function a(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}e.exports=a},b514:function(e){e.exports=JSON.parse('{"0":65533,"128":8364,"130":8218,"131":402,"132":8222,"133":8230,"134":8224,"135":8225,"136":710,"137":8240,"138":352,"139":8249,"140":338,"142":381,"145":8216,"146":8217,"147":8220,"148":8221,"149":8226,"150":8211,"151":8212,"152":732,"153":8482,"154":353,"155":8250,"156":339,"158":382,"159":376}')},b53d:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",ss:"%d imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}});return t}))},b540:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,t){return 12===e&&(e=0),"enjing"===t?e:"siyang"===t?e>=11?e:e+12:"sonten"===t||"ndalu"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",ss:"%d detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}});return t}))},b702:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r={prefix:"far",iconName:"circle",icon:[512,512,[],"f111","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200z"]}},b84c:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"sun_mån_tys_ons_tor_fre_lau".split("_"),weekdaysMin:"su_må_ty_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s sidan",s:"nokre sekund",ss:"%d sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return t}))},b8e3:function(e,t){e.exports=!0},b97c:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t={ss:"sekundes_sekundēm_sekunde_sekundes".split("_"),m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function n(e,t,n){return n?t%10===1&&t%100!==11?e[2]:e[3]:t%10===1&&t%100!==11?e[0]:e[1]}function r(e,r,a){return e+" "+n(t[a],e,r)}function a(e,r,a){return n(t[a],e,r)}function i(e,t){return t?"dažas sekundes":"dažām sekundēm"}var o=e.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:i,ss:r,m:a,mm:r,h:a,hh:r,d:a,dd:r,M:a,MM:r,y:a,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return o}))},bb71:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";function t(e,t,n,r){var a={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?a[n][0]:a[n][1]}var n=e.defineLocale("de-ch",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return n}))},bbc0:function(e,t,n){var r=n("6044"),a="__lodash_hash_undefined__",i=Object.prototype,o=i.hasOwnProperty;function s(e){var t=this.__data__;if(r){var n=t[e];return n===a?void 0:n}return o.call(t,e)?t[e]:void 0}e.exports=s},bc13:function(e,t,n){var r=n("e53d"),a=r.navigator;e.exports=a&&a.userAgent||""},bcaa:function(e,t,n){var r=n("cb7c"),a=n("d3f4"),i=n("a5b8");e.exports=function(e,t){if(r(e),a(t)&&t.constructor===e)return t;var n=i.f(e),o=n.resolve;return o(t),n.promise}},bd86:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n("85f2"),a=n.n(r);function i(e,t,n){return t in e?a()(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},be13:function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},bf0b:function(e,t,n){var r=n("355d"),a=n("aebd"),i=n("36c3"),o=n("1bc3"),s=n("07e3"),u=n("794b"),l=Object.getOwnPropertyDescriptor;t.f=n("8e60")?l:function(e,t){if(e=i(e),t=o(t,!0),u)try{return l(e,t)}catch(n){}if(s(e,t))return a(!r.f.call(e,t),e[t])}},c074:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return i})),n.d(t,"d",(function(){return o})),n.d(t,"e",(function(){return s})),n.d(t,"f",(function(){return u})),n.d(t,"g",(function(){return l})),n.d(t,"h",(function(){return c})),n.d(t,"i",(function(){return d})),n.d(t,"j",(function(){return f})),n.d(t,"k",(function(){return h})),n.d(t,"l",(function(){return m})),n.d(t,"m",(function(){return p})),n.d(t,"n",(function(){return _})),n.d(t,"o",(function(){return y})),n.d(t,"p",(function(){return g})),n.d(t,"q",(function(){return v})),n.d(t,"r",(function(){return b})),n.d(t,"s",(function(){return M})),n.d(t,"t",(function(){return w})),n.d(t,"u",(function(){return L})),n.d(t,"v",(function(){return k})),n.d(t,"w",(function(){return x})),n.d(t,"x",(function(){return Y})),n.d(t,"y",(function(){return D})),n.d(t,"z",(function(){return S})),n.d(t,"A",(function(){return T})),n.d(t,"B",(function(){return O}));var r={prefix:"fas",iconName:"angle-down",icon:[320,512,[],"f107","M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z"]},a={prefix:"fas",iconName:"angle-up",icon:[320,512,[],"f106","M177 159.7l136 136c9.4 9.4 9.4 24.6 0 33.9l-22.6 22.6c-9.4 9.4-24.6 9.4-33.9 0L160 255.9l-96.4 96.4c-9.4 9.4-24.6 9.4-33.9 0L7 329.7c-9.4-9.4-9.4-24.6 0-33.9l136-136c9.4-9.5 24.6-9.5 34-.1z"]},i={prefix:"fas",iconName:"arrow-circle-down",icon:[512,512,[],"f0ab","M504 256c0 137-111 248-248 248S8 393 8 256 119 8 256 8s248 111 248 248zm-143.6-28.9L288 302.6V120c0-13.3-10.7-24-24-24h-16c-13.3 0-24 10.7-24 24v182.6l-72.4-75.5c-9.3-9.7-24.8-9.9-34.3-.4l-10.9 11c-9.4 9.4-9.4 24.6 0 33.9L239 404.3c9.4 9.4 24.6 9.4 33.9 0l132.7-132.7c9.4-9.4 9.4-24.6 0-33.9l-10.9-11c-9.5-9.5-25-9.3-34.3.4z"]},o={prefix:"fas",iconName:"ban",icon:[512,512,[],"f05e","M256 8C119.034 8 8 119.033 8 256s111.034 248 248 248 248-111.034 248-248S392.967 8 256 8zm130.108 117.892c65.448 65.448 70 165.481 20.677 235.637L150.47 105.216c70.204-49.356 170.226-44.735 235.638 20.676zM125.892 386.108c-65.448-65.448-70-165.481-20.677-235.637L361.53 406.784c-70.203 49.356-170.226 44.736-235.638-20.676z"]},s={prefix:"fas",iconName:"bars",icon:[448,512,[],"f0c9","M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"]},u={prefix:"fas",iconName:"boxes",icon:[576,512,[],"f468","M560 288h-80v96l-32-21.3-32 21.3v-96h-80c-8.8 0-16 7.2-16 16v192c0 8.8 7.2 16 16 16h224c8.8 0 16-7.2 16-16V304c0-8.8-7.2-16-16-16zm-384-64h224c8.8 0 16-7.2 16-16V16c0-8.8-7.2-16-16-16h-80v96l-32-21.3L256 96V0h-80c-8.8 0-16 7.2-16 16v192c0 8.8 7.2 16 16 16zm64 64h-80v96l-32-21.3L96 384v-96H16c-8.8 0-16 7.2-16 16v192c0 8.8 7.2 16 16 16h224c8.8 0 16-7.2 16-16V304c0-8.8-7.2-16-16-16z"]},l={prefix:"fas",iconName:"bullhorn",icon:[576,512,[],"f0a1","M576 240c0-23.63-12.95-44.04-32-55.12V32.01C544 23.26 537.02 0 512 0c-7.12 0-14.19 2.38-19.98 7.02l-85.03 68.03C364.28 109.19 310.66 128 256 128H64c-35.35 0-64 28.65-64 64v96c0 35.35 28.65 64 64 64h33.7c-1.39 10.48-2.18 21.14-2.18 32 0 39.77 9.26 77.35 25.56 110.94 5.19 10.69 16.52 17.06 28.4 17.06h74.28c26.05 0 41.69-29.84 25.9-50.56-16.4-21.52-26.15-48.36-26.15-77.44 0-11.11 1.62-21.79 4.41-32H256c54.66 0 108.28 18.81 150.98 52.95l85.03 68.03a32.023 32.023 0 0 0 19.98 7.02c24.92 0 32-22.78 32-32V295.13C563.05 284.04 576 263.63 576 240zm-96 141.42l-33.05-26.44C392.95 311.78 325.12 288 256 288v-96c69.12 0 136.95-23.78 190.95-66.98L480 98.58v282.84z"]},c={prefix:"fas",iconName:"chart-bar",icon:[512,512,[],"f080","M332.8 320h38.4c6.4 0 12.8-6.4 12.8-12.8V172.8c0-6.4-6.4-12.8-12.8-12.8h-38.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h38.4c6.4 0 12.8-6.4 12.8-12.8V76.8c0-6.4-6.4-12.8-12.8-12.8h-38.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-288 0h38.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-38.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h38.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-38.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zM496 384H64V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-32c0-8.84-7.16-16-16-16z"]},d={prefix:"fas",iconName:"circle",icon:[512,512,[],"f111","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"]},f={prefix:"fas",iconName:"clock",icon:[512,512,[],"f017","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm57.1 350.1L224.9 294c-3.1-2.3-4.9-5.9-4.9-9.7V116c0-6.6 5.4-12 12-12h48c6.6 0 12 5.4 12 12v137.7l63.5 46.2c5.4 3.9 6.5 11.4 2.6 16.8l-28.2 38.8c-3.9 5.3-11.4 6.5-16.8 2.6z"]},h={prefix:"fas",iconName:"cog",icon:[512,512,[],"f013","M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z"]},m={prefix:"fas",iconName:"cube",icon:[512,512,[],"f1b2","M239.1 6.3l-208 78c-18.7 7-31.1 25-31.1 45v225.1c0 18.2 10.3 34.8 26.5 42.9l208 104c13.5 6.8 29.4 6.8 42.9 0l208-104c16.3-8.1 26.5-24.8 26.5-42.9V129.3c0-20-12.4-37.9-31.1-44.9l-208-78C262 2.2 250 2.2 239.1 6.3zM256 68.4l192 72v1.1l-192 78-192-78v-1.1l192-72zm32 356V275.5l160-65v133.9l-160 80z"]},p={prefix:"fas",iconName:"database",icon:[448,512,[],"f1c0","M448 73.143v45.714C448 159.143 347.667 192 224 192S0 159.143 0 118.857V73.143C0 32.857 100.333 0 224 0s224 32.857 224 73.143zM448 176v102.857C448 319.143 347.667 352 224 352S0 319.143 0 278.857V176c48.125 33.143 136.208 48.572 224 48.572S399.874 209.143 448 176zm0 160v102.857C448 479.143 347.667 512 224 512S0 479.143 0 438.857V336c48.125 33.143 136.208 48.572 224 48.572S399.874 369.143 448 336z"]},_={prefix:"fas",iconName:"envelope",icon:[512,512,[],"f0e0","M502.3 190.8c3.9-3.1 9.7-.2 9.7 4.7V400c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V195.6c0-5 5.7-7.8 9.7-4.7 22.4 17.4 52.1 39.5 154.1 113.6 21.1 15.4 56.7 47.8 92.2 47.6 35.7.3 72-32.8 92.3-47.6 102-74.1 131.6-96.3 154-113.7zM256 320c23.2.4 56.6-29.2 73.4-41.4 132.7-96.3 142.8-104.7 173.4-128.7 5.8-4.5 9.2-11.5 9.2-18.9v-19c0-26.5-21.5-48-48-48H48C21.5 64 0 85.5 0 112v19c0 7.4 3.4 14.3 9.2 18.9 30.6 23.9 40.7 32.4 173.4 128.7 16.8 12.2 50.2 41.8 73.4 41.4z"]},y={prefix:"fas",iconName:"exclamation-circle",icon:[512,512,[],"f06a","M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"]},g={prefix:"fas",iconName:"exclamation-triangle",icon:[576,512,[],"f071","M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"]},v={prefix:"fas",iconName:"history",icon:[512,512,[],"f1da","M504 255.531c.253 136.64-111.18 248.372-247.82 248.468-59.015.042-113.223-20.53-155.822-54.911-11.077-8.94-11.905-25.541-1.839-35.607l11.267-11.267c8.609-8.609 22.353-9.551 31.891-1.984C173.062 425.135 212.781 440 256 440c101.705 0 184-82.311 184-184 0-101.705-82.311-184-184-184-48.814 0-93.149 18.969-126.068 49.932l50.754 50.754c10.08 10.08 2.941 27.314-11.313 27.314H24c-8.837 0-16-7.163-16-16V38.627c0-14.254 17.234-21.393 27.314-11.314l49.372 49.372C129.209 34.136 189.552 8 256 8c136.81 0 247.747 110.78 248 247.531zm-180.912 78.784l9.823-12.63c8.138-10.463 6.253-25.542-4.21-33.679L288 256.349V152c0-13.255-10.745-24-24-24h-16c-13.255 0-24 10.745-24 24v135.651l65.409 50.874c10.463 8.137 25.541 6.253 33.679-4.21z"]},b={prefix:"fas",iconName:"indent",icon:[448,512,[],"f03c","M27.31 363.3l96-96a16 16 0 0 0 0-22.62l-96-96C17.27 138.66 0 145.78 0 160v192c0 14.31 17.33 21.3 27.31 11.3zM432 416H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm3.17-128H204.83A12.82 12.82 0 0 0 192 300.83v38.34A12.82 12.82 0 0 0 204.83 352h230.34A12.82 12.82 0 0 0 448 339.17v-38.34A12.82 12.82 0 0 0 435.17 288zm0-128H204.83A12.82 12.82 0 0 0 192 172.83v38.34A12.82 12.82 0 0 0 204.83 224h230.34A12.82 12.82 0 0 0 448 211.17v-38.34A12.82 12.82 0 0 0 435.17 160zM432 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"]},M={prefix:"fas",iconName:"link",icon:[512,512,[],"f0c1","M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"]},w={prefix:"fas",iconName:"list-ol",icon:[512,512,[],"f0cb","M61.77 401l17.5-20.15a19.92 19.92 0 0 0 5.07-14.19v-3.31C84.34 356 80.5 352 73 352H16a8 8 0 0 0-8 8v16a8 8 0 0 0 8 8h22.83a157.41 157.41 0 0 0-11 12.31l-5.61 7c-4 5.07-5.25 10.13-2.8 14.88l1.05 1.93c3 5.76 6.29 7.88 12.25 7.88h4.73c10.33 0 15.94 2.44 15.94 9.09 0 4.72-4.2 8.22-14.36 8.22a41.54 41.54 0 0 1-15.47-3.12c-6.49-3.88-11.74-3.5-15.6 3.12l-5.59 9.31c-3.72 6.13-3.19 11.72 2.63 15.94 7.71 4.69 20.38 9.44 37 9.44 34.16 0 48.5-22.75 48.5-44.12-.03-14.38-9.12-29.76-28.73-34.88zM496 224H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM16 160h64a8 8 0 0 0 8-8v-16a8 8 0 0 0-8-8H64V40a8 8 0 0 0-8-8H32a8 8 0 0 0-7.14 4.42l-8 16A8 8 0 0 0 24 64h8v64H16a8 8 0 0 0-8 8v16a8 8 0 0 0 8 8zm-3.91 160H80a8 8 0 0 0 8-8v-16a8 8 0 0 0-8-8H41.32c3.29-10.29 48.34-18.68 48.34-56.44 0-29.06-25-39.56-44.47-39.56-21.36 0-33.8 10-40.46 18.75-4.37 5.59-3 10.84 2.8 15.37l8.58 6.88c5.61 4.56 11 2.47 16.12-2.44a13.44 13.44 0 0 1 9.46-3.84c3.33 0 9.28 1.56 9.28 8.75C51 248.19 0 257.31 0 304.59v4C0 316 5.08 320 12.09 320z"]},L={prefix:"fas",iconName:"lock",icon:[448,512,[],"f023","M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z"]},k={prefix:"fas",iconName:"microchip",icon:[512,512,[],"f2db","M416 48v416c0 26.51-21.49 48-48 48H144c-26.51 0-48-21.49-48-48V48c0-26.51 21.49-48 48-48h224c26.51 0 48 21.49 48 48zm96 58v12a6 6 0 0 1-6 6h-18v6a6 6 0 0 1-6 6h-42V88h42a6 6 0 0 1 6 6v6h18a6 6 0 0 1 6 6zm0 96v12a6 6 0 0 1-6 6h-18v6a6 6 0 0 1-6 6h-42v-48h42a6 6 0 0 1 6 6v6h18a6 6 0 0 1 6 6zm0 96v12a6 6 0 0 1-6 6h-18v6a6 6 0 0 1-6 6h-42v-48h42a6 6 0 0 1 6 6v6h18a6 6 0 0 1 6 6zm0 96v12a6 6 0 0 1-6 6h-18v6a6 6 0 0 1-6 6h-42v-48h42a6 6 0 0 1 6 6v6h18a6 6 0 0 1 6 6zM30 376h42v48H30a6 6 0 0 1-6-6v-6H6a6 6 0 0 1-6-6v-12a6 6 0 0 1 6-6h18v-6a6 6 0 0 1 6-6zm0-96h42v48H30a6 6 0 0 1-6-6v-6H6a6 6 0 0 1-6-6v-12a6 6 0 0 1 6-6h18v-6a6 6 0 0 1 6-6zm0-96h42v48H30a6 6 0 0 1-6-6v-6H6a6 6 0 0 1-6-6v-12a6 6 0 0 1 6-6h18v-6a6 6 0 0 1 6-6zm0-96h42v48H30a6 6 0 0 1-6-6v-6H6a6 6 0 0 1-6-6v-12a6 6 0 0 1 6-6h18v-6a6 6 0 0 1 6-6z"]},x={prefix:"fas",iconName:"outdent",icon:[448,512,[],"f03b","M100.69 363.29c10 10 27.31 2.93 27.31-11.31V160c0-14.32-17.33-21.31-27.31-11.31l-96 96a16 16 0 0 0 0 22.62zM432 416H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm3.17-128H204.83A12.82 12.82 0 0 0 192 300.83v38.34A12.82 12.82 0 0 0 204.83 352h230.34A12.82 12.82 0 0 0 448 339.17v-38.34A12.82 12.82 0 0 0 435.17 288zm0-128H204.83A12.82 12.82 0 0 0 192 172.83v38.34A12.82 12.82 0 0 0 204.83 224h230.34A12.82 12.82 0 0 0 448 211.17v-38.34A12.82 12.82 0 0 0 435.17 160zM432 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"]},Y={prefix:"fas",iconName:"pencil-ruler",icon:[512,512,[],"f5ae","M109.46 244.04l134.58-134.56-44.12-44.12-61.68 61.68a7.919 7.919 0 0 1-11.21 0l-11.21-11.21c-3.1-3.1-3.1-8.12 0-11.21l61.68-61.68-33.64-33.65C131.47-3.1 111.39-3.1 99 9.29L9.29 99c-12.38 12.39-12.39 32.47 0 44.86l100.17 100.18zm388.47-116.8c18.76-18.76 18.75-49.17 0-67.93l-45.25-45.25c-18.76-18.76-49.18-18.76-67.95 0l-46.02 46.01 113.2 113.2 46.02-46.03zM316.08 82.71l-297 296.96L.32 487.11c-2.53 14.49 10.09 27.11 24.59 24.56l107.45-18.84L429.28 195.9 316.08 82.71zm186.63 285.43l-33.64-33.64-61.68 61.68c-3.1 3.1-8.12 3.1-11.21 0l-11.21-11.21c-3.09-3.1-3.09-8.12 0-11.21l61.68-61.68-44.14-44.14L267.93 402.5l100.21 100.2c12.39 12.39 32.47 12.39 44.86 0l89.71-89.7c12.39-12.39 12.39-32.47 0-44.86z"]},D={prefix:"fas",iconName:"percent",icon:[448,512,[],"f295","M112 224c61.9 0 112-50.1 112-112S173.9 0 112 0 0 50.1 0 112s50.1 112 112 112zm0-160c26.5 0 48 21.5 48 48s-21.5 48-48 48-48-21.5-48-48 21.5-48 48-48zm224 224c-61.9 0-112 50.1-112 112s50.1 112 112 112 112-50.1 112-112-50.1-112-112-112zm0 160c-26.5 0-48-21.5-48-48s21.5-48 48-48 48 21.5 48 48-21.5 48-48 48zM392.3.2l31.6-.1c19.4-.1 30.9 21.8 19.7 37.8L77.4 501.6a23.95 23.95 0 0 1-19.6 10.2l-33.4.1c-19.5 0-30.9-21.9-19.7-37.8l368-463.7C377.2 4 384.5.2 392.3.2z"]},S={prefix:"fas",iconName:"search",icon:[512,512,[],"f002","M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"]},T={prefix:"fas",iconName:"times-circle",icon:[512,512,[],"f057","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z"]},O={prefix:"fas",iconName:"user",icon:[448,512,[],"f007","M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"]}},c109:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",ss:"%d ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}});return t}))},c1df:function(e,t,n){(function(e){(function(t,n){e.exports=n()})(0,(function(){"use strict";var t,r;function a(){return t.apply(null,arguments)}function i(e){t=e}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function s(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function u(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}function l(e){return void 0===e}function c(e){return"number"===typeof e||"[object Number]"===Object.prototype.toString.call(e)}function d(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function f(e,t){var n,r=[];for(n=0;n>>0,r=0;r0)for(n=0;n0?"future":"past"];return j(n)?n(t):n.replace(/%s/i,t)}var J={};function Q(e,t){var n=e.toLowerCase();J[n]=J[n+"s"]=J[t]=e}function Z(e){return"string"===typeof e?J[e]||J[e.toLowerCase()]:void 0}function K(e){var t,n,r={};for(n in e)h(e,n)&&(t=Z(n),t&&(r[t]=e[n]));return r}var X={};function ee(e,t){X[e]=t}function te(e){var t=[];for(var n in e)t.push({unit:n,priority:X[n]});return t.sort((function(e,t){return e.priority-t.priority})),t}function ne(e,t,n){var r=""+Math.abs(e),a=t-r.length,i=e>=0;return(i?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+r}var re=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ae=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,ie={},oe={};function se(e,t,n,r){var a=r;"string"===typeof r&&(a=function(){return this[r]()}),e&&(oe[e]=a),t&&(oe[t[0]]=function(){return ne(a.apply(this,arguments),t[1],t[2])}),n&&(oe[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),e)})}function ue(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function le(e){var t,n,r=e.match(re);for(t=0,n=r.length;t=0&&ae.test(e))e=e.replace(ae,r),ae.lastIndex=0,n-=1;return e}var fe=/\d/,he=/\d\d/,me=/\d{3}/,pe=/\d{4}/,_e=/[+-]?\d{6}/,ye=/\d\d?/,ge=/\d\d\d\d?/,ve=/\d\d\d\d\d\d?/,be=/\d{1,3}/,Me=/\d{1,4}/,we=/[+-]?\d{1,6}/,Le=/\d+/,ke=/[+-]?\d+/,xe=/Z|[+-]\d\d:?\d\d/gi,Ye=/Z|[+-]\d\d(?::?\d\d)?/gi,De=/[+-]?\d+(\.\d{1,3})?/,Se=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Te={};function Oe(e,t,n){Te[e]=j(t)?t:function(e,r){return e&&n?n:t}}function Ae(e,t){return h(Te,e)?Te[e](t._strict,t._locale):new RegExp(Pe(e))}function Pe(e){return je(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,n,r,a){return t||n||r||a})))}function je(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var He={};function Ce(e,t){var n,r=t;for("string"===typeof e&&(e=[e]),c(t)&&(r=function(e,n){n[t]=Y(e)}),n=0;n68?1900:2e3)};var Je,Qe=Ke("FullYear",!0);function Ze(){return Ge(this.year())}function Ke(e,t){return function(n){return null!=n?(et(this,e,n),a.updateOffset(this,t),this):Xe(this,e)}}function Xe(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function et(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&Ge(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),at(n,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function tt(e){return e=Z(e),j(this[e])?this[e]():this}function nt(e,t){if("object"===typeof e){e=K(e);for(var n=te(e),r=0;r=0?(s=new Date(e+400,t,n,r,a,i,o),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,r,a,i,o),s}function Mt(e){var t;if(e<100&&e>=0){var n=Array.prototype.slice.call(arguments);n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)}else t=new Date(Date.UTC.apply(null,arguments));return t}function wt(e,t,n){var r=7+t-n,a=(7+Mt(e,0,r).getUTCDay()-t)%7;return-a+r-1}function Lt(e,t,n,r,a){var i,o,s=(7+n-r)%7,u=wt(e,r,a),l=1+7*(t-1)+s+u;return l<=0?(i=e-1,o=qe(i)+l):l>qe(e)?(i=e+1,o=l-qe(e)):(i=e,o=l),{year:i,dayOfYear:o}}function kt(e,t,n){var r,a,i=wt(e.year(),t,n),o=Math.floor((e.dayOfYear()-i-1)/7)+1;return o<1?(a=e.year()-1,r=o+xt(a,t,n)):o>xt(e.year(),t,n)?(r=o-xt(e.year(),t,n),a=e.year()+1):(a=e.year(),r=o),{week:r,year:a}}function xt(e,t,n){var r=wt(e,t,n),a=wt(e+1,t,n);return(qe(e)-r+a)/7}function Yt(e){return kt(e,this._week.dow,this._week.doy).week}se("w",["ww",2],"wo","week"),se("W",["WW",2],"Wo","isoWeek"),Q("week","w"),Q("isoWeek","W"),ee("week",5),ee("isoWeek",5),Oe("w",ye),Oe("ww",ye,he),Oe("W",ye),Oe("WW",ye,he),Ee(["w","ww","W","WW"],(function(e,t,n,r){t[r.substr(0,1)]=Y(e)}));var Dt={dow:0,doy:6};function St(){return this._week.dow}function Tt(){return this._week.doy}function Ot(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function At(e){var t=kt(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function Pt(e,t){return"string"!==typeof e?e:isNaN(e)?(e=t.weekdaysParse(e),"number"===typeof e?e:null):parseInt(e,10)}function jt(e,t){return"string"===typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Ht(e,t){return e.slice(t,7).concat(e.slice(0,t))}se("d",0,"do","day"),se("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),se("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),se("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),se("e",0,0,"weekday"),se("E",0,0,"isoWeekday"),Q("day","d"),Q("weekday","e"),Q("isoWeekday","E"),ee("day",11),ee("weekday",11),ee("isoWeekday",11),Oe("d",ye),Oe("e",ye),Oe("E",ye),Oe("dd",(function(e,t){return t.weekdaysMinRegex(e)})),Oe("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),Oe("dddd",(function(e,t){return t.weekdaysRegex(e)})),Ee(["dd","ddd","dddd"],(function(e,t,n,r){var a=n._locale.weekdaysParse(e,r,n._strict);null!=a?t.d=a:y(n).invalidWeekday=e})),Ee(["d","e","E"],(function(e,t,n,r){t[r]=Y(e)}));var Ct="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");function Et(e,t){var n=o(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Ht(n,this._week.dow):e?n[e.day()]:n}var zt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");function Ft(e){return!0===e?Ht(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}var It="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Nt(e){return!0===e?Ht(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Wt(e,t,n){var r,a,i,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)i=p([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(i,"").toLocaleLowerCase();return n?"dddd"===t?(a=Je.call(this._weekdaysParse,o),-1!==a?a:null):"ddd"===t?(a=Je.call(this._shortWeekdaysParse,o),-1!==a?a:null):(a=Je.call(this._minWeekdaysParse,o),-1!==a?a:null):"dddd"===t?(a=Je.call(this._weekdaysParse,o),-1!==a?a:(a=Je.call(this._shortWeekdaysParse,o),-1!==a?a:(a=Je.call(this._minWeekdaysParse,o),-1!==a?a:null))):"ddd"===t?(a=Je.call(this._shortWeekdaysParse,o),-1!==a?a:(a=Je.call(this._weekdaysParse,o),-1!==a?a:(a=Je.call(this._minWeekdaysParse,o),-1!==a?a:null))):(a=Je.call(this._minWeekdaysParse,o),-1!==a?a:(a=Je.call(this._weekdaysParse,o),-1!==a?a:(a=Je.call(this._shortWeekdaysParse,o),-1!==a?a:null)))}function Rt(e,t,n){var r,a,i;if(this._weekdaysParseExact)return Wt.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(a=p([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(i="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[r]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function Vt(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=Pt(e,this.localeData()),this.add(e-t,"d")):t}function Ut(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function $t(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=jt(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}var Bt=Se;function qt(e){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||Kt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(h(this,"_weekdaysRegex")||(this._weekdaysRegex=Bt),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}var Gt=Se;function Jt(e){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||Kt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(h(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Gt),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}var Qt=Se;function Zt(e){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||Kt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(h(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Qt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Kt(){function e(e,t){return t.length-e.length}var t,n,r,a,i,o=[],s=[],u=[],l=[];for(t=0;t<7;t++)n=p([2e3,1]).day(t),r=this.weekdaysMin(n,""),a=this.weekdaysShort(n,""),i=this.weekdays(n,""),o.push(r),s.push(a),u.push(i),l.push(r),l.push(a),l.push(i);for(o.sort(e),s.sort(e),u.sort(e),l.sort(e),t=0;t<7;t++)s[t]=je(s[t]),u[t]=je(u[t]),l[t]=je(l[t]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function Xt(){return this.hours()%12||12}function en(){return this.hours()||24}function tn(e,t){se(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function nn(e,t){return t._meridiemParse}function rn(e){return"p"===(e+"").toLowerCase().charAt(0)}se("H",["HH",2],0,"hour"),se("h",["hh",2],0,Xt),se("k",["kk",2],0,en),se("hmm",0,0,(function(){return""+Xt.apply(this)+ne(this.minutes(),2)})),se("hmmss",0,0,(function(){return""+Xt.apply(this)+ne(this.minutes(),2)+ne(this.seconds(),2)})),se("Hmm",0,0,(function(){return""+this.hours()+ne(this.minutes(),2)})),se("Hmmss",0,0,(function(){return""+this.hours()+ne(this.minutes(),2)+ne(this.seconds(),2)})),tn("a",!0),tn("A",!1),Q("hour","h"),ee("hour",13),Oe("a",nn),Oe("A",nn),Oe("H",ye),Oe("h",ye),Oe("k",ye),Oe("HH",ye,he),Oe("hh",ye,he),Oe("kk",ye,he),Oe("hmm",ge),Oe("hmmss",ve),Oe("Hmm",ge),Oe("Hmmss",ve),Ce(["H","HH"],We),Ce(["k","kk"],(function(e,t,n){var r=Y(e);t[We]=24===r?0:r})),Ce(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),Ce(["h","hh"],(function(e,t,n){t[We]=Y(e),y(n).bigHour=!0})),Ce("hmm",(function(e,t,n){var r=e.length-2;t[We]=Y(e.substr(0,r)),t[Re]=Y(e.substr(r)),y(n).bigHour=!0})),Ce("hmmss",(function(e,t,n){var r=e.length-4,a=e.length-2;t[We]=Y(e.substr(0,r)),t[Re]=Y(e.substr(r,2)),t[Ve]=Y(e.substr(a)),y(n).bigHour=!0})),Ce("Hmm",(function(e,t,n){var r=e.length-2;t[We]=Y(e.substr(0,r)),t[Re]=Y(e.substr(r))})),Ce("Hmmss",(function(e,t,n){var r=e.length-4,a=e.length-2;t[We]=Y(e.substr(0,r)),t[Re]=Y(e.substr(r,2)),t[Ve]=Y(e.substr(a))}));var an=/[ap]\.?m?\.?/i;function on(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var sn,un=Ke("Hours",!0),ln={calendar:z,longDateFormat:I,invalidDate:W,ordinal:V,dayOfMonthOrdinalParse:U,relativeTime:B,months:ot,monthsShort:ut,week:Dt,weekdays:Ct,weekdaysMin:It,weekdaysShort:zt,meridiemParse:an},cn={},dn={};function fn(e){return e?e.toLowerCase().replace("_","-"):e}function hn(e){var t,n,r,a,i=0;while(i0){if(r=mn(a.slice(0,t).join("-")),r)return r;if(n&&n.length>=t&&D(a,n,!0)>=t-1)break;t--}i++}return sn}function mn(t){var r=null;if(!cn[t]&&"undefined"!==typeof e&&e&&e.exports)try{r=sn._abbr;n("4678")("./"+t),pn(r)}catch(a){}return cn[t]}function pn(e,t){var n;return e&&(n=l(t)?gn(e):_n(e,t),n?sn=n:"undefined"!==typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),sn._abbr}function _n(e,t){if(null!==t){var n,r=ln;if(t.abbr=e,null!=cn[e])P("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=cn[e]._config;else if(null!=t.parentLocale)if(null!=cn[t.parentLocale])r=cn[t.parentLocale]._config;else{if(n=mn(t.parentLocale),null==n)return dn[t.parentLocale]||(dn[t.parentLocale]=[]),dn[t.parentLocale].push({name:e,config:t}),null;r=n._config}return cn[e]=new E(C(r,t)),dn[e]&&dn[e].forEach((function(e){_n(e.name,e.config)})),pn(e),cn[e]}return delete cn[e],null}function yn(e,t){if(null!=t){var n,r,a=ln;r=mn(e),null!=r&&(a=r._config),t=C(a,t),n=new E(t),n.parentLocale=cn[e],cn[e]=n,pn(e)}else null!=cn[e]&&(null!=cn[e].parentLocale?cn[e]=cn[e].parentLocale:null!=cn[e]&&delete cn[e]);return cn[e]}function gn(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return sn;if(!o(e)){if(t=mn(e),t)return t;e=[e]}return hn(e)}function vn(){return O(cn)}function bn(e){var t,n=e._a;return n&&-2===y(e).overflow&&(t=n[Ie]<0||n[Ie]>11?Ie:n[Ne]<1||n[Ne]>at(n[Fe],n[Ie])?Ne:n[We]<0||n[We]>24||24===n[We]&&(0!==n[Re]||0!==n[Ve]||0!==n[Ue])?We:n[Re]<0||n[Re]>59?Re:n[Ve]<0||n[Ve]>59?Ve:n[Ue]<0||n[Ue]>999?Ue:-1,y(e)._overflowDayOfYear&&(tNe)&&(t=Ne),y(e)._overflowWeeks&&-1===t&&(t=$e),y(e)._overflowWeekday&&-1===t&&(t=Be),y(e).overflow=t),e}function Mn(e,t,n){return null!=e?e:null!=t?t:n}function wn(e){var t=new Date(a.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Ln(e){var t,n,r,a,i,o=[];if(!e._d){for(r=wn(e),e._w&&null==e._a[Ne]&&null==e._a[Ie]&&kn(e),null!=e._dayOfYear&&(i=Mn(e._a[Fe],r[Fe]),(e._dayOfYear>qe(i)||0===e._dayOfYear)&&(y(e)._overflowDayOfYear=!0),n=Mt(i,0,e._dayOfYear),e._a[Ie]=n.getUTCMonth(),e._a[Ne]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=o[t]=r[t];for(;t<7;t++)e._a[t]=o[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[We]&&0===e._a[Re]&&0===e._a[Ve]&&0===e._a[Ue]&&(e._nextDay=!0,e._a[We]=0),e._d=(e._useUTC?Mt:bt).apply(null,o),a=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[We]=24),e._w&&"undefined"!==typeof e._w.d&&e._w.d!==a&&(y(e).weekdayMismatch=!0)}}function kn(e){var t,n,r,a,i,o,s,u;if(t=e._w,null!=t.GG||null!=t.W||null!=t.E)i=1,o=4,n=Mn(t.GG,e._a[Fe],kt(Jn(),1,4).year),r=Mn(t.W,1),a=Mn(t.E,1),(a<1||a>7)&&(u=!0);else{i=e._locale._week.dow,o=e._locale._week.doy;var l=kt(Jn(),i,o);n=Mn(t.gg,e._a[Fe],l.year),r=Mn(t.w,l.week),null!=t.d?(a=t.d,(a<0||a>6)&&(u=!0)):null!=t.e?(a=t.e+i,(t.e<0||t.e>6)&&(u=!0)):a=i}r<1||r>xt(n,i,o)?y(e)._overflowWeeks=!0:null!=u?y(e)._overflowWeekday=!0:(s=Lt(n,r,a,i,o),e._a[Fe]=s.year,e._dayOfYear=s.dayOfYear)}var xn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Yn=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Dn=/Z|[+-]\d\d(?::?\d\d)?/,Sn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Tn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],On=/^\/?Date\((\-?\d+)/i;function An(e){var t,n,r,a,i,o,s=e._i,u=xn.exec(s)||Yn.exec(s);if(u){for(y(e).iso=!0,t=0,n=Sn.length;t0&&y(e).unusedInput.push(o),s=s.slice(s.indexOf(n)+n.length),l+=n.length),oe[i]?(n?y(e).empty=!1:y(e).unusedTokens.push(i),ze(i,n,e)):e._strict&&!n&&y(e).unusedTokens.push(i);y(e).charsLeftOver=u-l,s.length>0&&y(e).unusedInput.push(s),e._a[We]<=12&&!0===y(e).bigHour&&e._a[We]>0&&(y(e).bigHour=void 0),y(e).parsedDateParts=e._a.slice(0),y(e).meridiem=e._meridiem,e._a[We]=Rn(e._locale,e._a[We],e._meridiem),Ln(e),bn(e)}else In(e);else An(e)}function Rn(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?(r=e.isPM(n),r&&t<12&&(t+=12),r||12!==t||(t=0),t):t}function Vn(e){var t,n,r,a,i;if(0===e._f.length)return y(e).invalidFormat=!0,void(e._d=new Date(NaN));for(a=0;athis?this:e:v()}));function Kn(e,t){var n,r;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return Jn();for(n=t[0],r=1;rthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Mr(){if(!l(this._isDSTShifted))return this._isDSTShifted;var e={};if(M(e,this),e=Bn(e),e._a){var t=e._isUTC?p(e._a):Jn(e._a);this._isDSTShifted=this.isValid()&&D(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function wr(){return!!this.isValid()&&!this._isUTC}function Lr(){return!!this.isValid()&&this._isUTC}function kr(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}a.updateOffset=function(){};var xr=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Yr=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Dr(e,t){var n,r,a,i=e,o=null;return sr(e)?i={ms:e._milliseconds,d:e._days,M:e._months}:c(e)?(i={},t?i[t]=e:i.milliseconds=e):(o=xr.exec(e))?(n="-"===o[1]?-1:1,i={y:0,d:Y(o[Ne])*n,h:Y(o[We])*n,m:Y(o[Re])*n,s:Y(o[Ve])*n,ms:Y(ur(1e3*o[Ue]))*n}):(o=Yr.exec(e))?(n="-"===o[1]?-1:1,i={y:Sr(o[2],n),M:Sr(o[3],n),w:Sr(o[4],n),d:Sr(o[5],n),h:Sr(o[6],n),m:Sr(o[7],n),s:Sr(o[8],n)}):null==i?i={}:"object"===typeof i&&("from"in i||"to"in i)&&(a=Or(Jn(i.from),Jn(i.to)),i={},i.ms=a.milliseconds,i.M=a.months),r=new or(i),sr(e)&&h(e,"_locale")&&(r._locale=e._locale),r}function Sr(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Tr(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Or(e,t){var n;return e.isValid()&&t.isValid()?(t=fr(t,e),e.isBefore(t)?n=Tr(e,t):(n=Tr(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Ar(e,t){return function(n,r){var a,i;return null===r||isNaN(+r)||(P(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=n,n=r,r=i),n="string"===typeof n?+n:n,a=Dr(n,r),Pr(this,a,e),this}}function Pr(e,t,n,r){var i=t._milliseconds,o=ur(t._days),s=ur(t._months);e.isValid()&&(r=null==r||r,s&&ft(e,Xe(e,"Month")+s*n),o&&et(e,"Date",Xe(e,"Date")+o*n),i&&e._d.setTime(e._d.valueOf()+i*n),r&&a.updateOffset(e,o||s))}Dr.fn=or.prototype,Dr.invalid=ir;var jr=Ar(1,"add"),Hr=Ar(-1,"subtract");function Cr(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function Er(e,t){var n=e||Jn(),r=fr(n,this).startOf("day"),i=a.calendarFormat(this,r)||"sameElse",o=t&&(j(t[i])?t[i].call(this,n):t[i]);return this.format(o||this.localeData().calendar(i,this,Jn(n)))}function zr(){return new L(this)}function Fr(e,t){var n=k(e)?e:Jn(e);return!(!this.isValid()||!n.isValid())&&(t=Z(t)||"millisecond","millisecond"===t?this.valueOf()>n.valueOf():n.valueOf()9999?ce(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):j(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",ce(n,"Z")):ce(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Gr(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a="-MM-DD[T]HH:mm:ss.SSS",i=t+'[")]';return this.format(n+r+a+i)}function Jr(e){e||(e=this.isUtc()?a.defaultFormatUtc:a.defaultFormat);var t=ce(this,e);return this.localeData().postformat(t)}function Qr(e,t){return this.isValid()&&(k(e)&&e.isValid()||Jn(e).isValid())?Dr({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Zr(e){return this.from(Jn(),e)}function Kr(e,t){return this.isValid()&&(k(e)&&e.isValid()||Jn(e).isValid())?Dr({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Xr(e){return this.to(Jn(),e)}function ea(e){var t;return void 0===e?this._locale._abbr:(t=gn(e),null!=t&&(this._locale=t),this)}a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",a.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var ta=T("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function na(){return this._locale}var ra=1e3,aa=60*ra,ia=60*aa,oa=3506328*ia;function sa(e,t){return(e%t+t)%t}function ua(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-oa:new Date(e,t,n).valueOf()}function la(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-oa:Date.UTC(e,t,n)}function ca(e){var t;if(e=Z(e),void 0===e||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?la:ua;switch(e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=sa(t+(this._isUTC?0:this.utcOffset()*aa),ia);break;case"minute":t=this._d.valueOf(),t-=sa(t,aa);break;case"second":t=this._d.valueOf(),t-=sa(t,ra);break}return this._d.setTime(t),a.updateOffset(this,!0),this}function da(e){var t;if(e=Z(e),void 0===e||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?la:ua;switch(e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=ia-sa(t+(this._isUTC?0:this.utcOffset()*aa),ia)-1;break;case"minute":t=this._d.valueOf(),t+=aa-sa(t,aa)-1;break;case"second":t=this._d.valueOf(),t+=ra-sa(t,ra)-1;break}return this._d.setTime(t),a.updateOffset(this,!0),this}function fa(){return this._d.valueOf()-6e4*(this._offset||0)}function ha(){return Math.floor(this.valueOf()/1e3)}function ma(){return new Date(this.valueOf())}function pa(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function _a(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function ya(){return this.isValid()?this.toISOString():null}function ga(){return g(this)}function va(){return m({},y(this))}function ba(){return y(this).overflow}function Ma(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function wa(e,t){se(0,[e,e.length],0,t)}function La(e){return Da.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function ka(e){return Da.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function xa(){return xt(this.year(),1,4)}function Ya(){var e=this.localeData()._week;return xt(this.year(),e.dow,e.doy)}function Da(e,t,n,r,a){var i;return null==e?kt(this,r,a).year:(i=xt(e,r,a),t>i&&(t=i),Sa.call(this,e,t,n,r,a))}function Sa(e,t,n,r,a){var i=Lt(e,t,n,r,a),o=Mt(i.year,0,i.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}function Ta(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}se(0,["gg",2],0,(function(){return this.weekYear()%100})),se(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),wa("gggg","weekYear"),wa("ggggg","weekYear"),wa("GGGG","isoWeekYear"),wa("GGGGG","isoWeekYear"),Q("weekYear","gg"),Q("isoWeekYear","GG"),ee("weekYear",1),ee("isoWeekYear",1),Oe("G",ke),Oe("g",ke),Oe("GG",ye,he),Oe("gg",ye,he),Oe("GGGG",Me,pe),Oe("gggg",Me,pe),Oe("GGGGG",we,_e),Oe("ggggg",we,_e),Ee(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,r){t[r.substr(0,2)]=Y(e)})),Ee(["gg","GG"],(function(e,t,n,r){t[r]=a.parseTwoDigitYear(e)})),se("Q",0,"Qo","quarter"),Q("quarter","Q"),ee("quarter",7),Oe("Q",fe),Ce("Q",(function(e,t){t[Ie]=3*(Y(e)-1)})),se("D",["DD",2],"Do","date"),Q("date","D"),ee("date",9),Oe("D",ye),Oe("DD",ye,he),Oe("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),Ce(["D","DD"],Ne),Ce("Do",(function(e,t){t[Ne]=Y(e.match(ye)[0])}));var Oa=Ke("Date",!0);function Aa(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}se("DDD",["DDDD",3],"DDDo","dayOfYear"),Q("dayOfYear","DDD"),ee("dayOfYear",4),Oe("DDD",be),Oe("DDDD",me),Ce(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=Y(e)})),se("m",["mm",2],0,"minute"),Q("minute","m"),ee("minute",14),Oe("m",ye),Oe("mm",ye,he),Ce(["m","mm"],Re);var Pa=Ke("Minutes",!1);se("s",["ss",2],0,"second"),Q("second","s"),ee("second",15),Oe("s",ye),Oe("ss",ye,he),Ce(["s","ss"],Ve);var ja,Ha=Ke("Seconds",!1);for(se("S",0,0,(function(){return~~(this.millisecond()/100)})),se(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),se(0,["SSS",3],0,"millisecond"),se(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),se(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),se(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),se(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),se(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),se(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),Q("millisecond","ms"),ee("millisecond",16),Oe("S",be,fe),Oe("SS",be,he),Oe("SSS",be,me),ja="SSSS";ja.length<=9;ja+="S")Oe(ja,Le);function Ca(e,t){t[Ue]=Y(1e3*("0."+e))}for(ja="S";ja.length<=9;ja+="S")Ce(ja,Ca);var Ea=Ke("Milliseconds",!1);function za(){return this._isUTC?"UTC":""}function Fa(){return this._isUTC?"Coordinated Universal Time":""}se("z",0,0,"zoneAbbr"),se("zz",0,0,"zoneName");var Ia=L.prototype;function Na(e){return Jn(1e3*e)}function Wa(){return Jn.apply(null,arguments).parseZone()}function Ra(e){return e}Ia.add=jr,Ia.calendar=Er,Ia.clone=zr,Ia.diff=Ur,Ia.endOf=da,Ia.format=Jr,Ia.from=Qr,Ia.fromNow=Zr,Ia.to=Kr,Ia.toNow=Xr,Ia.get=tt,Ia.invalidAt=ba,Ia.isAfter=Fr,Ia.isBefore=Ir,Ia.isBetween=Nr,Ia.isSame=Wr,Ia.isSameOrAfter=Rr,Ia.isSameOrBefore=Vr,Ia.isValid=ga,Ia.lang=ta,Ia.locale=ea,Ia.localeData=na,Ia.max=Zn,Ia.min=Qn,Ia.parsingFlags=va,Ia.set=nt,Ia.startOf=ca,Ia.subtract=Hr,Ia.toArray=pa,Ia.toObject=_a,Ia.toDate=ma,Ia.toISOString=qr,Ia.inspect=Gr,Ia.toJSON=ya,Ia.toString=Br,Ia.unix=ha,Ia.valueOf=fa,Ia.creationData=Ma,Ia.year=Qe,Ia.isLeapYear=Ze,Ia.weekYear=La,Ia.isoWeekYear=ka,Ia.quarter=Ia.quarters=Ta,Ia.month=ht,Ia.daysInMonth=mt,Ia.week=Ia.weeks=Ot,Ia.isoWeek=Ia.isoWeeks=At,Ia.weeksInYear=Ya,Ia.isoWeeksInYear=xa,Ia.date=Oa,Ia.day=Ia.days=Vt,Ia.weekday=Ut,Ia.isoWeekday=$t,Ia.dayOfYear=Aa,Ia.hour=Ia.hours=un,Ia.minute=Ia.minutes=Pa,Ia.second=Ia.seconds=Ha,Ia.millisecond=Ia.milliseconds=Ea,Ia.utcOffset=mr,Ia.utc=_r,Ia.local=yr,Ia.parseZone=gr,Ia.hasAlignedHourOffset=vr,Ia.isDST=br,Ia.isLocal=wr,Ia.isUtcOffset=Lr,Ia.isUtc=kr,Ia.isUTC=kr,Ia.zoneAbbr=za,Ia.zoneName=Fa,Ia.dates=T("dates accessor is deprecated. Use date instead.",Oa),Ia.months=T("months accessor is deprecated. Use month instead",ht),Ia.years=T("years accessor is deprecated. Use year instead",Qe),Ia.zone=T("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",pr),Ia.isDSTShifted=T("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Mr);var Va=E.prototype;function Ua(e,t,n,r){var a=gn(),i=p().set(r,t);return a[n](i,e)}function $a(e,t,n){if(c(e)&&(t=e,e=void 0),e=e||"",null!=t)return Ua(e,t,n,"month");var r,a=[];for(r=0;r<12;r++)a[r]=Ua(e,r,n,"month");return a}function Ba(e,t,n,r){"boolean"===typeof e?(c(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,c(t)&&(n=t,t=void 0),t=t||"");var a,i=gn(),o=e?i._week.dow:0;if(null!=n)return Ua(t,(n+o)%7,r,"day");var s=[];for(a=0;a<7;a++)s[a]=Ua(t,(a+o)%7,r,"day");return s}function qa(e,t){return $a(e,t,"months")}function Ga(e,t){return $a(e,t,"monthsShort")}function Ja(e,t,n){return Ba(e,t,n,"weekdays")}function Qa(e,t,n){return Ba(e,t,n,"weekdaysShort")}function Za(e,t,n){return Ba(e,t,n,"weekdaysMin")}Va.calendar=F,Va.longDateFormat=N,Va.invalidDate=R,Va.ordinal=$,Va.preparse=Ra,Va.postformat=Ra,Va.relativeTime=q,Va.pastFuture=G,Va.set=H,Va.months=st,Va.monthsShort=lt,Va.monthsParse=dt,Va.monthsRegex=gt,Va.monthsShortRegex=_t,Va.week=Yt,Va.firstDayOfYear=Tt,Va.firstDayOfWeek=St,Va.weekdays=Et,Va.weekdaysMin=Nt,Va.weekdaysShort=Ft,Va.weekdaysParse=Rt,Va.weekdaysRegex=qt,Va.weekdaysShortRegex=Jt,Va.weekdaysMinRegex=Zt,Va.isPM=rn,Va.meridiem=on,pn("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=1===Y(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}}),a.lang=T("moment.lang is deprecated. Use moment.locale instead.",pn),a.langData=T("moment.langData is deprecated. Use moment.localeData instead.",gn);var Ka=Math.abs;function Xa(){var e=this._data;return this._milliseconds=Ka(this._milliseconds),this._days=Ka(this._days),this._months=Ka(this._months),e.milliseconds=Ka(e.milliseconds),e.seconds=Ka(e.seconds),e.minutes=Ka(e.minutes),e.hours=Ka(e.hours),e.months=Ka(e.months),e.years=Ka(e.years),this}function ei(e,t,n,r){var a=Dr(t,n);return e._milliseconds+=r*a._milliseconds,e._days+=r*a._days,e._months+=r*a._months,e._bubble()}function ti(e,t){return ei(this,e,t,1)}function ni(e,t){return ei(this,e,t,-1)}function ri(e){return e<0?Math.floor(e):Math.ceil(e)}function ai(){var e,t,n,r,a,i=this._milliseconds,o=this._days,s=this._months,u=this._data;return i>=0&&o>=0&&s>=0||i<=0&&o<=0&&s<=0||(i+=864e5*ri(oi(s)+o),o=0,s=0),u.milliseconds=i%1e3,e=x(i/1e3),u.seconds=e%60,t=x(e/60),u.minutes=t%60,n=x(t/60),u.hours=n%24,o+=x(n/24),a=x(ii(o)),s+=a,o-=ri(oi(a)),r=x(s/12),s%=12,u.days=o,u.months=s,u.years=r,this}function ii(e){return 4800*e/146097}function oi(e){return 146097*e/4800}function si(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=Z(e),"month"===e||"quarter"===e||"year"===e)switch(t=this._days+r/864e5,n=this._months+ii(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(oi(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}}function ui(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*Y(this._months/12):NaN}function li(e){return function(){return this.as(e)}}var ci=li("ms"),di=li("s"),fi=li("m"),hi=li("h"),mi=li("d"),pi=li("w"),_i=li("M"),yi=li("Q"),gi=li("y");function vi(){return Dr(this)}function bi(e){return e=Z(e),this.isValid()?this[e+"s"]():NaN}function Mi(e){return function(){return this.isValid()?this._data[e]:NaN}}var wi=Mi("milliseconds"),Li=Mi("seconds"),ki=Mi("minutes"),xi=Mi("hours"),Yi=Mi("days"),Di=Mi("months"),Si=Mi("years");function Ti(){return x(this.days()/7)}var Oi=Math.round,Ai={ss:44,s:45,m:45,h:22,d:26,M:11};function Pi(e,t,n,r,a){return a.relativeTime(t||1,!!n,e,r)}function ji(e,t,n){var r=Dr(e).abs(),a=Oi(r.as("s")),i=Oi(r.as("m")),o=Oi(r.as("h")),s=Oi(r.as("d")),u=Oi(r.as("M")),l=Oi(r.as("y")),c=a<=Ai.ss&&["s",a]||a0,c[4]=n,Pi.apply(null,c)}function Hi(e){return void 0===e?Oi:"function"===typeof e&&(Oi=e,!0)}function Ci(e,t){return void 0!==Ai[e]&&(void 0===t?Ai[e]:(Ai[e]=t,"s"===e&&(Ai.ss=t-1),!0))}function Ei(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),n=ji(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)}var zi=Math.abs;function Fi(e){return(e>0)-(e<0)||+e}function Ii(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,r=zi(this._milliseconds)/1e3,a=zi(this._days),i=zi(this._months);e=x(r/60),t=x(e/60),r%=60,e%=60,n=x(i/12),i%=12;var o=n,s=i,u=a,l=t,c=e,d=r?r.toFixed(3).replace(/\.?0+$/,""):"",f=this.asSeconds();if(!f)return"P0D";var h=f<0?"-":"",m=Fi(this._months)!==Fi(f)?"-":"",p=Fi(this._days)!==Fi(f)?"-":"",_=Fi(this._milliseconds)!==Fi(f)?"-":"";return h+"P"+(o?m+o+"Y":"")+(s?m+s+"M":"")+(u?p+u+"D":"")+(l||c||d?"T":"")+(l?_+l+"H":"")+(c?_+c+"M":"")+(d?_+d+"S":"")}var Ni=or.prototype;return Ni.isValid=ar,Ni.abs=Xa,Ni.add=ti,Ni.subtract=ni,Ni.as=si,Ni.asMilliseconds=ci,Ni.asSeconds=di,Ni.asMinutes=fi,Ni.asHours=hi,Ni.asDays=mi,Ni.asWeeks=pi,Ni.asMonths=_i,Ni.asQuarters=yi,Ni.asYears=gi,Ni.valueOf=ui,Ni._bubble=ai,Ni.clone=vi,Ni.get=bi,Ni.milliseconds=wi,Ni.seconds=Li,Ni.minutes=ki,Ni.hours=xi,Ni.days=Yi,Ni.weeks=Ti,Ni.months=Di,Ni.years=Si,Ni.humanize=Ei,Ni.toISOString=Ii,Ni.toString=Ii,Ni.toJSON=Ii,Ni.locale=ea,Ni.localeData=na,Ni.toIsoString=T("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ii),Ni.lang=ta,se("X",0,0,"unix"),se("x",0,0,"valueOf"),Oe("x",ke),Oe("X",De),Ce("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))})),Ce("x",(function(e,t,n){n._d=new Date(Y(e))})),a.version="2.24.0",i(Jn),a.fn=Ia,a.min=Xn,a.max=er,a.now=tr,a.utc=p,a.unix=Na,a.months=qa,a.isDate=d,a.locale=pn,a.invalid=v,a.duration=Dr,a.isMoment=k,a.weekdays=Ja,a.parseZone=Wa,a.localeData=gn,a.isDuration=sr,a.monthsShort=Ga,a.weekdaysMin=Za,a.defineLocale=_n,a.updateLocale=yn,a.locales=vn,a.weekdaysShort=Qa,a.normalizeUnits=Z,a.relativeTimeRounding=Hi,a.relativeTimeThreshold=Ci,a.calendarFormat=Cr,a.prototype=Ia,a.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},a}))}).call(this,n("62e4")(e))},c207:function(e,t){},c26b:function(e,t,n){"use strict";var r=n("86cc").f,a=n("2aeb"),i=n("dcbc"),o=n("9b43"),s=n("f605"),u=n("4a59"),l=n("01f9"),c=n("d53b"),d=n("7a56"),f=n("9e1e"),h=n("67ab").fastKey,m=n("b39a"),p=f?"_s":"size",_=function(e,t){var n,r=h(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n};e.exports={getConstructor:function(e,t,n,l){var c=e((function(e,r){s(e,c,t,"_i"),e._t=t,e._i=a(null),e._f=void 0,e._l=void 0,e[p]=0,void 0!=r&&u(r,n,e[l],e)}));return i(c.prototype,{clear:function(){for(var e=m(this,t),n=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];e._f=e._l=void 0,e[p]=0},delete:function(e){var n=m(this,t),r=_(n,e);if(r){var a=r.n,i=r.p;delete n._i[r.i],r.r=!0,i&&(i.n=a),a&&(a.p=i),n._f==r&&(n._f=a),n._l==r&&(n._l=i),n[p]--}return!!r},forEach:function(e){m(this,t);var n,r=o(e,arguments.length>1?arguments[1]:void 0,3);while(n=n?n.n:this._f){r(n.v,n.k,this);while(n&&n.r)n=n.p}},has:function(e){return!!_(m(this,t),e)}}),f&&r(c.prototype,"size",{get:function(){return m(this,t)[p]}}),c},def:function(e,t,n){var r,a,i=_(e,t);return i?i.v=n:(e._l=i={i:a=h(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=i),r&&(r.n=i),e[p]++,"F"!==a&&(e._i[a]=i)),e},getEntry:_,setStrong:function(e,t,n){l(e,t,(function(e,n){this._t=m(e,t),this._k=n,this._l=void 0}),(function(){var e=this,t=e._k,n=e._l;while(n&&n.r)n=n.p;return e._t&&(e._l=n=n?n.n:e._t._f)?c(0,"keys"==t?n.k:"values"==t?n.v:[n.k,n.v]):(e._t=void 0,c(1))}),n?"entries":"values",!n,!0),d(t)}}},c366:function(e,t,n){var r=n("6821"),a=n("9def"),i=n("77f1");e.exports=function(e){return function(t,n,o){var s,u=r(t),l=a(u.length),c=i(o,l);if(e&&n!=n){while(l>c)if(s=u[c++],s!=s)return!0}else for(;l>c;c++)if((e||c in u)&&u[c]===n)return e||c||0;return!e&&-1}}},c367:function(e,t,n){"use strict";var r=n("8436"),a=n("50ed"),i=n("481b"),o=n("36c3");e.exports=n("30f1")(Array,"Array",(function(e,t){this._t=o(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,a(1)):a(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])}),"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},c3a1:function(e,t,n){var r=n("e6f3"),a=n("1691");e.exports=Object.keys||function(e){return r(e,a)}},c69a:function(e,t,n){e.exports=!n("9e1e")&&!n("79e5")((function(){return 7!=Object.defineProperty(n("230e")("div"),"a",{get:function(){return 7}}).a}))},c7aa:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(e){return 2===e?"שעתיים":e+" שעות"},d:"יום",dd:function(e){return 2===e?"יומיים":e+" ימים"},M:"חודש",MM:function(e){return 2===e?"חודשיים":e+" חודשים"},y:"שנה",yy:function(e){return 2===e?"שנתיים":e%10===0&&10!==e?e+" שנה":e+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(e){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(e)},meridiem:function(e,t,n){return e<5?"לפנות בוקר":e<10?"בבוקר":e<12?n?'לפנה"צ':"לפני הצהריים":e<18?n?'אחה"צ':"אחרי הצהריים":"בערב"}});return t}))},c8ba:function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}e.exports=n},c8bb:function(e,t,n){e.exports=n("54a1")},c8f3:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),weekdaysParseExact:!0,meridiemParse:/PD|MD/,isPM:function(e){return"M"===e.charAt(0)},meridiem:function(e,t,n){return e<12?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",ss:"%d sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return t}))},c909:function(e,t,n){var r,a,i; +/*! + * URI.js - Mutating URLs + * + * Version: 1.19.2 + * + * Author: Rodney Rehm + * Web: http://medialize.github.io/URI.js/ + * + * Licensed under + * MIT License http://www.opensource.org/licenses/mit-license + * + */(function(o,s){"use strict";e.exports?e.exports=s(n("63c5"),n("0056"),n("afab")):(a=[n("63c5"),n("0056"),n("afab")],r=s,i="function"===typeof r?r.apply(t,a):r,void 0===i||(e.exports=i))})(0,(function(e,t,n,r){"use strict";var a=r&&r.URI;function i(e,t){var n=arguments.length>=1,r=arguments.length>=2;if(!(this instanceof i))return n?r?new i(e,t):new i(e):new i;if(void 0===e){if(n)throw new TypeError("undefined is not a valid argument for URI");e="undefined"!==typeof location?location.href+"":""}if(null===e&&n)throw new TypeError("null is not a valid argument for URI");return this.href(e),void 0!==t?this.absoluteTo(t):this}function o(e){return/^[0-9]+$/.test(e)}i.version="1.19.2";var s=i.prototype,u=Object.prototype.hasOwnProperty;function l(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function c(e){return void 0===e?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}function d(e){return"Array"===c(e)}function f(e,t){var n,r,a={};if("RegExp"===c(t))a=null;else if(d(t))for(n=0,r=t.length;n]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,i.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},i.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},i.hostProtocols=["http","https"],i.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,i.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},i.getDomAttribute=function(e){if(e&&e.nodeName){var t=e.nodeName.toLowerCase();if("input"!==t||"image"===e.type)return i.domAttributes[t]}},i.encode=y,i.decode=decodeURIComponent,i.iso8859=function(){i.encode=escape,i.decode=unescape},i.unicode=function(){i.encode=y,i.decode=decodeURIComponent},i.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},i.encodeQuery=function(e,t){var n=i.encode(e+"");return void 0===t&&(t=i.escapeQuerySpace),t?n.replace(/%20/g,"+"):n},i.decodeQuery=function(e,t){e+="",void 0===t&&(t=i.escapeQuerySpace);try{return i.decode(t?e.replace(/\+/g,"%20"):e)}catch(n){return e}};var g,v={encode:"encode",decode:"decode"},b=function(e,t){return function(n){try{return i[t](n+"").replace(i.characters[e][t].expression,(function(n){return i.characters[e][t].map[n]}))}catch(r){return n}}};for(g in v)i[g+"PathSegment"]=b("pathname",v[g]),i[g+"UrnPathSegment"]=b("urnpath",v[g]);var M=function(e,t,n){return function(r){var a;a=n?function(e){return i[t](i[n](e))}:i[t];for(var o=(r+"").split(e),s=0,u=o.length;s-1&&(t.fragment=e.substring(n+1)||null,e=e.substring(0,n)),n=e.indexOf("?"),n>-1&&(t.query=e.substring(n+1)||null,e=e.substring(0,n)),"//"===e.substring(0,2)?(t.protocol=null,e=e.substring(2),e=i.parseAuthority(e,t)):(n=e.indexOf(":"),n>-1&&(t.protocol=e.substring(0,n)||null,t.protocol&&!t.protocol.match(i.protocol_expression)?t.protocol=void 0:"//"===e.substring(n+1,n+3)?(e=e.substring(n+3),e=i.parseAuthority(e,t)):(e=e.substring(n+1),t.urn=!0))),t.path=e,t},i.parseHost=function(e,t){e||(e=""),e=e.replace(/\\/g,"/");var n,r,a=e.indexOf("/");if(-1===a&&(a=e.length),"["===e.charAt(0))n=e.indexOf("]"),t.hostname=e.substring(1,n)||null,t.port=e.substring(n+2,a)||null,"/"===t.port&&(t.port=null);else{var o=e.indexOf(":"),s=e.indexOf("/"),u=e.indexOf(":",o+1);-1!==u&&(-1===s||u-1?r:e.length-1);return a>-1&&(-1===r||a-1?h.slice(0,m)+h.slice(m).replace(o,""):h.replace(o,""),!(h.length<=l[0].length)&&(!n.ignore||!n.ignore.test(h))){f=c+h.length;var y=t(h,c,f,e);void 0!==y?(y=String(y),e=e.slice(0,c)+y+e.slice(f),r.lastIndex=c+y.length):r.lastIndex=f}}return r.lastIndex=0,e},i.ensureValidHostname=function(t,n){var r=!!t,a=!!n,o=!1;if(a&&(o=h(i.hostProtocols,n)),o&&!r)throw new TypeError("Hostname cannot be empty, if protocol is "+n);if(t&&t.match(i.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(t).match(i.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]')}},i.ensureValidPort=function(e){if(e){var t=Number(e);if(!(o(t)&&t>0&&t<65536))throw new TypeError('Port "'+e+'" is not a valid port')}},i.noConflict=function(e){if(e){var t={URI:this.noConflict()};return r.URITemplate&&"function"===typeof r.URITemplate.noConflict&&(t.URITemplate=r.URITemplate.noConflict()),r.IPv6&&"function"===typeof r.IPv6.noConflict&&(t.IPv6=r.IPv6.noConflict()),r.SecondLevelDomains&&"function"===typeof r.SecondLevelDomains.noConflict&&(t.SecondLevelDomains=r.SecondLevelDomains.noConflict()),t}return r.URI===this&&(r.URI=a),this},s.build=function(e){return!0===e?this._deferred_build=!0:(void 0===e||this._deferred_build)&&(this._string=i.build(this._parts),this._deferred_build=!1),this},s.clone=function(){return new i(this)},s.valueOf=s.toString=function(){return this.build(!1)._string},s.protocol=w("protocol"),s.username=w("username"),s.password=w("password"),s.hostname=w("hostname"),s.port=w("port"),s.query=L("query","?"),s.fragment=L("fragment","#"),s.search=function(e,t){var n=this.query(e,t);return"string"===typeof n&&n.length?"?"+n:n},s.hash=function(e,t){var n=this.fragment(e,t);return"string"===typeof n&&n.length?"#"+n:n},s.pathname=function(e,t){if(void 0===e||!0===e){var n=this._parts.path||(this._parts.hostname?"/":"");return e?(this._parts.urn?i.decodeUrnPath:i.decodePath)(n):n}return this._parts.urn?this._parts.path=e?i.recodeUrnPath(e):"":this._parts.path=e?i.recodePath(e):"/",this.build(!t),this},s.path=s.pathname,s.href=function(e,t){var n;if(void 0===e)return this.toString();this._string="",this._parts=i._parts();var r=e instanceof i,a="object"===typeof e&&(e.hostname||e.path||e.pathname);if(e.nodeName){var o=i.getDomAttribute(e);e=e[o]||"",a=!1}if(!r&&a&&void 0!==e.pathname&&(e=e.toString()),"string"===typeof e||e instanceof String)this._parts=i.parse(String(e),this._parts);else{if(!r&&!a)throw new TypeError("invalid input");var s=r?e._parts:e;for(n in s)"query"!==n&&u.call(this._parts,n)&&(this._parts[n]=s[n]);s.query&&this.query(s.query,!1)}return this.build(!t),this},s.is=function(e){var t=!1,r=!1,a=!1,o=!1,s=!1,u=!1,l=!1,c=!this._parts.urn;switch(this._parts.hostname&&(c=!1,r=i.ip4_expression.test(this._parts.hostname),a=i.ip6_expression.test(this._parts.hostname),t=r||a,o=!t,s=o&&n&&n.has(this._parts.hostname),u=o&&i.idn_expression.test(this._parts.hostname),l=o&&i.punycode_expression.test(this._parts.hostname)),e.toLowerCase()){case"relative":return c;case"absolute":return!c;case"domain":case"name":return o;case"sld":return s;case"ip":return t;case"ip4":case"ipv4":case"inet4":return r;case"ip6":case"ipv6":case"inet6":return a;case"idn":return u;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return l}return null};var k=s.protocol,x=s.port,Y=s.hostname;s.protocol=function(e,t){if(e&&(e=e.replace(/:(\/\/)?$/,""),!e.match(i.protocol_expression)))throw new TypeError('Protocol "'+e+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return k.call(this,e,t)},s.scheme=s.protocol,s.port=function(e,t){return this._parts.urn?void 0===e?"":this:(void 0!==e&&(0===e&&(e=null),e&&(e+="",":"===e.charAt(0)&&(e=e.substring(1)),i.ensureValidPort(e))),x.call(this,e,t))},s.hostname=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0!==e){var n={preventInvalidHostname:this._parts.preventInvalidHostname},r=i.parseHost(e,n);if("/"!==r)throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');e=n.hostname,this._parts.preventInvalidHostname&&i.ensureValidHostname(e,this._parts.protocol)}return Y.call(this,e,t)},s.origin=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var n=this.protocol(),r=this.authority();return r?(n?n+"://":"")+this.authority():""}var a=i(e);return this.protocol(a.protocol()).authority(a.authority()).build(!t),this},s.host=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?i.buildHost(this._parts):"";var n=i.parseHost(e,this._parts);if("/"!==n)throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},s.authority=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?i.buildAuthority(this._parts):"";var n=i.parseAuthority(e,this._parts);if("/"!==n)throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},s.userinfo=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var n=i.buildUserinfo(this._parts);return n?n.substring(0,n.length-1):n}return"@"!==e[e.length-1]&&(e+="@"),i.parseUserinfo(e,this._parts),this.build(!t),this},s.resource=function(e,t){var n;return void 0===e?this.path()+this.search()+this.hash():(n=i.parse(e),this._parts.path=n.path,this._parts.query=n.query,this._parts.fragment=n.fragment,this.build(!t),this)},s.subdomain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,n)||""}var r=this._parts.hostname.length-this.domain().length,a=this._parts.hostname.substring(0,r),o=new RegExp("^"+l(a));if(e&&"."!==e.charAt(e.length-1)&&(e+="."),-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");return e&&i.ensureValidHostname(e,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(o,e),this.build(!t),this},s.domain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"===typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.match(/\./g);if(n&&n.length<2)return this._parts.hostname;var r=this._parts.hostname.length-this.tld(t).length-1;return r=this._parts.hostname.lastIndexOf(".",r-1)+1,this._parts.hostname.substring(r)||""}if(!e)throw new TypeError("cannot set domain empty");if(-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");if(i.ensureValidHostname(e,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=e;else{var a=new RegExp(l(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(a,e)}return this.build(!t),this},s.tld=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"===typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.lastIndexOf("."),a=this._parts.hostname.substring(r+1);return!0!==t&&n&&n.list[a.toLowerCase()]&&n.get(this._parts.hostname)||a}var i;if(!e)throw new TypeError("cannot set TLD empty");if(e.match(/[^a-zA-Z0-9-]/)){if(!n||!n.is(e))throw new TypeError('TLD "'+e+'" contains characters other than [A-Z0-9]');i=new RegExp(l(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");i=new RegExp(l(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}return this.build(!t),this},s.directory=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var n=this._parts.path.length-this.filename().length-1,r=this._parts.path.substring(0,n)||(this._parts.hostname?"/":"");return e?i.decodePath(r):r}var a=this._parts.path.length-this.filename().length,o=this._parts.path.substring(0,a),s=new RegExp("^"+l(o));return this.is("relative")||(e||(e="/"),"/"!==e.charAt(0)&&(e="/"+e)),e&&"/"!==e.charAt(e.length-1)&&(e+="/"),e=i.recodePath(e),this._parts.path=this._parts.path.replace(s,e),this.build(!t),this},s.filename=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("string"!==typeof e){if(!this._parts.path||"/"===this._parts.path)return"";var n=this._parts.path.lastIndexOf("/"),r=this._parts.path.substring(n+1);return e?i.decodePathSegment(r):r}var a=!1;"/"===e.charAt(0)&&(e=e.substring(1)),e.match(/\.?\//)&&(a=!0);var o=new RegExp(l(this.filename())+"$");return e=i.recodePath(e),this._parts.path=this._parts.path.replace(o,e),a?this.normalizePath(t):this.build(!t),this},s.suffix=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path||"/"===this._parts.path)return"";var n,r,a=this.filename(),o=a.lastIndexOf(".");return-1===o?"":(n=a.substring(o+1),r=/^[a-z0-9%]+$/i.test(n)?n:"",e?i.decodePathSegment(r):r)}"."===e.charAt(0)&&(e=e.substring(1));var s,u=this.suffix();if(u)s=e?new RegExp(l(u)+"$"):new RegExp(l("."+u)+"$");else{if(!e)return this;this._parts.path+="."+i.recodePath(e)}return s&&(e=i.recodePath(e),this._parts.path=this._parts.path.replace(s,e)),this.build(!t),this},s.segment=function(e,t,n){var r=this._parts.urn?":":"/",a=this.path(),i="/"===a.substring(0,1),o=a.split(r);if(void 0!==e&&"number"!==typeof e&&(n=t,t=e,e=void 0),void 0!==e&&"number"!==typeof e)throw new Error('Bad segment "'+e+'", must be 0-based integer');if(i&&o.shift(),e<0&&(e=Math.max(o.length+e,0)),void 0===t)return void 0===e?o:o[e];if(null===e||void 0===o[e])if(d(t)){o=[];for(var s=0,u=t.length;s=e.length?(this._t=void 0,a(1)):a(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])}),"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},cb5a:function(e,t,n){var r=n("9638");function a(e,t){var n=e.length;while(n--)if(r(e[n][0],t))return n;return-1}e.exports=a},cb7c:function(e,t,n){var r=n("d3f4");e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},ccb9:function(e,t,n){t.f=n("5168")},cd1c:function(e,t,n){var r=n("e853");e.exports=function(e,t){return new(r(e))(t)}},cd78:function(e,t,n){var r=n("e4ae"),a=n("f772"),i=n("656e");e.exports=function(e,t){if(r(e),a(t)&&t.constructor===e)return t;var n=i.f(e),o=n.resolve;return o(t),n.promise}},cdab:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("en-SG",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10,n=1===~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n},week:{dow:1,doy:4}});return t}))},ce10:function(e,t,n){var r=n("69a8"),a=n("6821"),i=n("c366")(!1),o=n("613b")("IE_PROTO");e.exports=function(e,t){var n,s=a(e),u=0,l=[];for(n in s)n!=o&&r(s,n)&&l.push(n);while(t.length>u)r(s,n=t[u++])&&(~i(l,n)||l.push(n));return l}},ce86:function(e,t,n){var r=n("9e69"),a=n("7948"),i=n("6747"),o=n("ffd6"),s=1/0,u=r?r.prototype:void 0,l=u?u.toString:void 0;function c(e){if("string"==typeof e)return e;if(i(e))return a(e,c)+"";if(o(e))return l?l.call(e):"";var t=e+"";return"0"==t&&1/e==-s?"-0":t}e.exports=c},cf1e:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t={words:{ss:["sekunda","sekunde","sekundi"],m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,r){var a=t.words[r];return 1===r.length?n?a[0]:a[1]:e+" "+t.correctGrammaticalCase(e,a)}},n=e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){var e=["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"];return e[this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}});return n}))},cf51:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,t,n){return e>11?n?"d'o":"D'O":n?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});function n(e,t,n,r){var a={s:["viensas secunds","'iensas secunds"],ss:[e+" secunds",e+" secunds"],m:["'n míut","'iens míut"],mm:[e+" míuts",e+" míuts"],h:["'n þora","'iensa þora"],hh:[e+" þoras",e+" þoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",e+" ars"]};return r?a[n][0]:t?a[n][0]:a[n][1]}return t}))},cf75:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t="pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function n(e){var t=e;return t=-1!==e.indexOf("jaj")?t.slice(0,-3)+"leS":-1!==e.indexOf("jar")?t.slice(0,-3)+"waQ":-1!==e.indexOf("DIS")?t.slice(0,-3)+"nem":t+" pIq",t}function r(e){var t=e;return t=-1!==e.indexOf("jaj")?t.slice(0,-3)+"Hu’":-1!==e.indexOf("jar")?t.slice(0,-3)+"wen":-1!==e.indexOf("DIS")?t.slice(0,-3)+"ben":t+" ret",t}function a(e,t,n,r){var a=i(e);switch(n){case"ss":return a+" lup";case"mm":return a+" tup";case"hh":return a+" rep";case"dd":return a+" jaj";case"MM":return a+" jar";case"yy":return a+" DIS"}}function i(e){var n=Math.floor(e%1e3/100),r=Math.floor(e%100/10),a=e%10,i="";return n>0&&(i+=t[n]+"vatlh"),r>0&&(i+=(""!==i?" ":"")+t[r]+"maH"),a>0&&(i+=(""!==i?" ":"")+t[a]),""===i?"pagh":i}var o=e.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:n,past:r,s:"puS lup",ss:a,m:"wa’ tup",mm:a,h:"wa’ rep",hh:a,d:"wa’ jaj",dd:a,M:"wa’ jar",MM:a,y:"wa’ DIS",yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return o}))},d225:function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",(function(){return r}))},d26a:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},n={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"},r=e.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",ss:"%d སྐར་ཆ།",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(e){return e.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(e,t){return 12===e&&(e=0),"མཚན་མོ"===t&&e>=4||"ཉིན་གུང"===t&&e<5||"དགོང་དག"===t?e+12:e},meridiem:function(e,t,n){return e<4?"མཚན་མོ":e<10?"ཞོགས་ཀས":e<17?"ཉིན་གུང":e<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}});return r}))},d2c8:function(e,t,n){var r=n("aae3"),a=n("be13");e.exports=function(e,t,n){if(r(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(a(e))}},d2d4:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("pt-br",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº"});return t}))},d2d5:function(e,t,n){n("1654"),n("549b"),e.exports=n("584a").Array.from},d3f4:function(e,t){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}},d4ab:function(e,t,n){"use strict";var r=Object.prototype.toString;e.exports=function(e){var t=r.call(e),n="[object Arguments]"===t;return n||(n="[object Array]"!==t&&null!==e&&"object"===typeof e&&"number"===typeof e.length&&e.length>=0&&"[object Function]"===r.call(e.callee)),n}},d53b:function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},d6b6:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",ss:"%d վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(e){return/^(ցերեկվա|երեկոյան)$/.test(e)},meridiem:function(e){return e<4?"գիշերվա":e<12?"առավոտվա":e<17?"ցերեկվա":"երեկոյան"},dayOfMonthOrdinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(e,t){switch(t){case"DDD":case"w":case"W":case"DDDo":return 1===e?e+"-ին":e+"-րդ";default:return e}},week:{dow:1,doy:7}});return t}))},d6c7:function(e,t,n){"use strict";var r=Array.prototype.slice,a=n("d4ab"),i=Object.keys,o=i?function(e){return i(e)}:n("b189"),s=Object.keys;o.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return a(e)?s(r.call(e)):s(e)})}else Object.keys=o;return Object.keys||o},e.exports=o},d716:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("ca",{months:{standalone:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",ss:"%d segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}});return t}))},d842:function(e,t,n){"use strict";var r=n("50d1"),a=n.n(r),i=n("7fae"),o=n.n(i),s=function(e){return u(e)&&!l(e)};function u(e){return!!e&&"object"===typeof e}function l(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||f(e)}var c="function"===typeof Symbol&&Symbol.for,d=c?Symbol.for("react.element"):60103;function f(e){return e.$$typeof===d}function h(e){return Array.isArray(e)?[]:{}}function m(e,t){return!1!==t.clone&&t.isMergeableObject(e)?y(h(e),e,t):e}function p(e,t,n){return e.concat(t).map((function(e){return m(e,n)}))}function _(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach((function(t){r[t]=m(e[t],n)})),Object.keys(t).forEach((function(a){n.isMergeableObject(t[a])&&e[a]?r[a]=y(e[a],t[a],n):r[a]=m(t[a],n)})),r}function y(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||p,n.isMergeableObject=n.isMergeableObject||s;var r=Array.isArray(t),a=Array.isArray(e),i=r===a;return i?r?n.arrayMerge(e,t,n):_(e,t,n):m(t,n)}y.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return y(e,n,t)}),{})};var g=y,v=g,b=1,M=function(e,t,n){var r=["adapter","colors","curve","dataset","decimal","discrete","donut","download","label","legend","library","max","messages","min","points","prefix","refresh","stacked","suffix","thousands","title","xmax","xmin","xtitle","ytitle"];e.component(t,{props:["data","id","width","height"].concat(r),render:function(e){return e("div",{attrs:{id:this.chartId},style:this.chartStyle},["Loading..."])},data:function(){return{chartId:null}},computed:{chartStyle:function(){return this.data,this.chartOptions,{height:this.height||"300px",lineHeight:this.height||"300px",width:this.width||"100%",textAlign:"center",color:"#999",fontSize:"14px",fontFamily:"'Lucida Grande', 'Lucida Sans Unicode', Verdana, Arial, Helvetica, sans-serif"}},chartOptions:function(){for(var e={},t=r,n=0;n=20?"ste":"de")},week:{dow:1,doy:4}});return i}))},dbdb:function(e,t,n){var r=n("584a"),a=n("e53d"),i="__core-js_shared__",o=a[i]||(a[i]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n("b8e3")?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},dc4d:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},r=e.defineLocale("hi",{months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",ss:"%d सेकंड",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(e,t){return 12===e&&(e=0),"रात"===t?e<4?e:e+12:"सुबह"===t?e:"दोपहर"===t?e>=10?e:e+12:"शाम"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"रात":e<10?"सुबह":e<17?"दोपहर":e<20?"शाम":"रात"},week:{dow:0,doy:6}});return r}))},dc57:function(e,t){var n=Function.prototype,r=n.toString;function a(e){if(null!=e){try{return r.call(e)}catch(t){}try{return e+""}catch(t){}}return""}e.exports=a},dcbc:function(e,t,n){var r=n("2aba");e.exports=function(e,t,n){for(var a in t)r(e,a,t[a],n);return e}},e0b8:function(e,t,n){"use strict";var r=n("7726"),a=n("5ca1"),i=n("2aba"),o=n("dcbc"),s=n("67ab"),u=n("4a59"),l=n("f605"),c=n("d3f4"),d=n("79e5"),f=n("5cc5"),h=n("7f20"),m=n("5dbc");e.exports=function(e,t,n,p,_,y){var g=r[e],v=g,b=_?"set":"add",M=v&&v.prototype,w={},L=function(e){var t=M[e];i(M,e,"delete"==e?function(e){return!(y&&!c(e))&&t.call(this,0===e?0:e)}:"has"==e?function(e){return!(y&&!c(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return y&&!c(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof v&&(y||M.forEach&&!d((function(){(new v).entries().next()})))){var k=new v,x=k[b](y?{}:-0,1)!=k,Y=d((function(){k.has(1)})),D=f((function(e){new v(e)})),S=!y&&d((function(){var e=new v,t=5;while(t--)e[b](t,t);return!e.has(-0)}));D||(v=t((function(t,n){l(t,v,e);var r=m(new g,t,v);return void 0!=n&&u(n,_,r[b],r),r})),v.prototype=M,M.constructor=v),(Y||S)&&(L("delete"),L("has"),_&&L("get")),(S||x)&&L(b),y&&M.clear&&delete M.clear}else v=p.getConstructor(t,e,_,b),o(v.prototype,n),s.NEED=!0;return h(v,e),w[e]=v,a(a.G+a.W+a.F*(v!=g),w),y||p.setStrong(v,e,_),v}},e0c5:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t={1:"૧",2:"૨",3:"૩",4:"૪",5:"૫",6:"૬",7:"૭",8:"૮",9:"૯",0:"૦"},n={"૧":"1","૨":"2","૩":"3","૪":"4","૫":"5","૬":"6","૭":"7","૮":"8","૯":"9","૦":"0"},r=e.defineLocale("gu",{months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),monthsParseExact:!0,weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),longDateFormat:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},calendar:{sameDay:"[આજ] LT",nextDay:"[કાલે] LT",nextWeek:"dddd, LT",lastDay:"[ગઇકાલે] LT",lastWeek:"[પાછલા] dddd, LT",sameElse:"L"},relativeTime:{future:"%s મા",past:"%s પેહલા",s:"અમુક પળો",ss:"%d સેકંડ",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"},preparse:function(e){return e.replace(/[૧૨૩૪૫૬૭૮૯૦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/રાત|બપોર|સવાર|સાંજ/,meridiemHour:function(e,t){return 12===e&&(e=0),"રાત"===t?e<4?e:e+12:"સવાર"===t?e:"બપોર"===t?e>=10?e:e+12:"સાંજ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"રાત":e<10?"સવાર":e<17?"બપોર":e<20?"સાંજ":"રાત"},week:{dow:0,doy:6}});return r}))},e0e5:function(e,t){function n(){var e=[].slice.call(arguments),t=!1;"boolean"==typeof e[0]&&(t=e.shift());var a=e[0];if(!a||"object"!=typeof a&&"function"!=typeof a)throw new Error("extendee must be an object");for(var i=e.slice(1),o=i.length,s=0;s=0&&"[object Array]"!==a.call(e)&&"[object Function]"===a.call(e.callee)},s=function(){return i(arguments)}();i.isLegacyArguments=o,e.exports=s?i:o},e4ae:function(e,t,n){var r=n("f772");e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},e53d:function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},e6f3:function(e,t,n){var r=n("07e3"),a=n("36c3"),i=n("5b4e")(!1),o=n("5559")("IE_PROTO");e.exports=function(e,t){var n,s=a(e),u=0,l=[];for(n in s)n!=o&&r(s,n)&&l.push(n);while(t.length>u)r(s,n=t[u++])&&(~i(l,n)||l.push(n));return l}},e710:function(e,t,n){"use strict";var r=n("f367"),a=n("44b7"),i=n("5708"),o=n("57ec"),s=n("1c7e"),u=a(i);r(u,{getPolyfill:o,implementation:i,shim:s}),e.exports=u},e81d:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t={1:"១",2:"២",3:"៣",4:"៤",5:"៥",6:"៦",7:"៧",8:"៨",9:"៩",0:"០"},n={"១":"1","២":"2","៣":"3","៤":"4","៥":"5","៦":"6","៧":"7","៨":"8","៩":"9","០":"0"},r=e.defineLocale("km",{months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ព្រឹក|ល្ងាច/,isPM:function(e){return"ល្ងាច"===e},meridiem:function(e,t,n){return e<12?"ព្រឹក":"ល្ងាច"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",ss:"%d វិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},dayOfMonthOrdinalParse:/ទី\d{1,2}/,ordinal:"ទី%d",preparse:function(e){return e.replace(/[១២៣៤៥៦៧៨៩០]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}});return r}))},e853:function(e,t,n){var r=n("d3f4"),a=n("1169"),i=n("2b4c")("species");e.exports=function(e){var t;return a(e)&&(t=e.constructor,"function"!=typeof t||t!==Array&&!a(t.prototype)||(t=void 0),r(t)&&(t=t[i],null===t&&(t=void 0))),void 0===t?Array:t}},e9ac:function(e,t,n){"use strict";var r,a,i,o,s=TypeError,u=Object.getOwnPropertyDescriptor,l=function(){throw new s},c=u?function(){try{return arguments.callee,l}catch(e){try{return u(arguments,"callee").get}catch(t){return l}}}():l,d=n("5156")(),f=Object.getPrototypeOf||function(e){return e.__proto__},h=a?f(a):r,m=i?i.constructor:r,p=o?f(o):r,_=o?o():r,y="undefined"===typeof Uint8Array?r:f(Uint8Array),g={"$ %Array%":Array,"$ %ArrayBuffer%":"undefined"===typeof ArrayBuffer?r:ArrayBuffer,"$ %ArrayBufferPrototype%":"undefined"===typeof ArrayBuffer?r:ArrayBuffer.prototype,"$ %ArrayIteratorPrototype%":d?f([][Symbol.iterator]()):r,"$ %ArrayPrototype%":Array.prototype,"$ %ArrayProto_entries%":Array.prototype.entries,"$ %ArrayProto_forEach%":Array.prototype.forEach,"$ %ArrayProto_keys%":Array.prototype.keys,"$ %ArrayProto_values%":Array.prototype.values,"$ %AsyncFromSyncIteratorPrototype%":r,"$ %AsyncFunction%":m,"$ %AsyncFunctionPrototype%":m?m.prototype:r,"$ %AsyncGenerator%":o?f(_):r,"$ %AsyncGeneratorFunction%":p,"$ %AsyncGeneratorPrototype%":p?p.prototype:r,"$ %AsyncIteratorPrototype%":_&&d&&Symbol.asyncIterator?_[Symbol.asyncIterator]():r,"$ %Atomics%":"undefined"===typeof Atomics?r:Atomics,"$ %Boolean%":Boolean,"$ %BooleanPrototype%":Boolean.prototype,"$ %DataView%":"undefined"===typeof DataView?r:DataView,"$ %DataViewPrototype%":"undefined"===typeof DataView?r:DataView.prototype,"$ %Date%":Date,"$ %DatePrototype%":Date.prototype,"$ %decodeURI%":decodeURI,"$ %decodeURIComponent%":decodeURIComponent,"$ %encodeURI%":encodeURI,"$ %encodeURIComponent%":encodeURIComponent,"$ %Error%":Error,"$ %ErrorPrototype%":Error.prototype,"$ %eval%":eval,"$ %EvalError%":EvalError,"$ %EvalErrorPrototype%":EvalError.prototype,"$ %Float32Array%":"undefined"===typeof Float32Array?r:Float32Array,"$ %Float32ArrayPrototype%":"undefined"===typeof Float32Array?r:Float32Array.prototype,"$ %Float64Array%":"undefined"===typeof Float64Array?r:Float64Array,"$ %Float64ArrayPrototype%":"undefined"===typeof Float64Array?r:Float64Array.prototype,"$ %Function%":Function,"$ %FunctionPrototype%":Function.prototype,"$ %Generator%":a?f(a()):r,"$ %GeneratorFunction%":h,"$ %GeneratorPrototype%":h?h.prototype:r,"$ %Int8Array%":"undefined"===typeof Int8Array?r:Int8Array,"$ %Int8ArrayPrototype%":"undefined"===typeof Int8Array?r:Int8Array.prototype,"$ %Int16Array%":"undefined"===typeof Int16Array?r:Int16Array,"$ %Int16ArrayPrototype%":"undefined"===typeof Int16Array?r:Int8Array.prototype,"$ %Int32Array%":"undefined"===typeof Int32Array?r:Int32Array,"$ %Int32ArrayPrototype%":"undefined"===typeof Int32Array?r:Int32Array.prototype,"$ %isFinite%":isFinite,"$ %isNaN%":isNaN,"$ %IteratorPrototype%":d?f(f([][Symbol.iterator]())):r,"$ %JSON%":"object"===typeof JSON?JSON:r,"$ %JSONParse%":"object"===typeof JSON?JSON.parse:r,"$ %Map%":"undefined"===typeof Map?r:Map,"$ %MapIteratorPrototype%":"undefined"!==typeof Map&&d?f((new Map)[Symbol.iterator]()):r,"$ %MapPrototype%":"undefined"===typeof Map?r:Map.prototype,"$ %Math%":Math,"$ %Number%":Number,"$ %NumberPrototype%":Number.prototype,"$ %Object%":Object,"$ %ObjectPrototype%":Object.prototype,"$ %ObjProto_toString%":Object.prototype.toString,"$ %ObjProto_valueOf%":Object.prototype.valueOf,"$ %parseFloat%":parseFloat,"$ %parseInt%":parseInt,"$ %Promise%":"undefined"===typeof Promise?r:Promise,"$ %PromisePrototype%":"undefined"===typeof Promise?r:Promise.prototype,"$ %PromiseProto_then%":"undefined"===typeof Promise?r:Promise.prototype.then,"$ %Promise_all%":"undefined"===typeof Promise?r:Promise.all,"$ %Promise_reject%":"undefined"===typeof Promise?r:Promise.reject,"$ %Promise_resolve%":"undefined"===typeof Promise?r:Promise.resolve,"$ %Proxy%":"undefined"===typeof Proxy?r:Proxy,"$ %RangeError%":RangeError,"$ %RangeErrorPrototype%":RangeError.prototype,"$ %ReferenceError%":ReferenceError,"$ %ReferenceErrorPrototype%":ReferenceError.prototype,"$ %Reflect%":"undefined"===typeof Reflect?r:Reflect,"$ %RegExp%":RegExp,"$ %RegExpPrototype%":RegExp.prototype,"$ %Set%":"undefined"===typeof Set?r:Set,"$ %SetIteratorPrototype%":"undefined"!==typeof Set&&d?f((new Set)[Symbol.iterator]()):r,"$ %SetPrototype%":"undefined"===typeof Set?r:Set.prototype,"$ %SharedArrayBuffer%":"undefined"===typeof SharedArrayBuffer?r:SharedArrayBuffer,"$ %SharedArrayBufferPrototype%":"undefined"===typeof SharedArrayBuffer?r:SharedArrayBuffer.prototype,"$ %String%":String,"$ %StringIteratorPrototype%":d?f(""[Symbol.iterator]()):r,"$ %StringPrototype%":String.prototype,"$ %Symbol%":d?Symbol:r,"$ %SymbolPrototype%":d?Symbol.prototype:r,"$ %SyntaxError%":SyntaxError,"$ %SyntaxErrorPrototype%":SyntaxError.prototype,"$ %ThrowTypeError%":c,"$ %TypedArray%":y,"$ %TypedArrayPrototype%":y?y.prototype:r,"$ %TypeError%":s,"$ %TypeErrorPrototype%":s.prototype,"$ %Uint8Array%":"undefined"===typeof Uint8Array?r:Uint8Array,"$ %Uint8ArrayPrototype%":"undefined"===typeof Uint8Array?r:Uint8Array.prototype,"$ %Uint8ClampedArray%":"undefined"===typeof Uint8ClampedArray?r:Uint8ClampedArray,"$ %Uint8ClampedArrayPrototype%":"undefined"===typeof Uint8ClampedArray?r:Uint8ClampedArray.prototype,"$ %Uint16Array%":"undefined"===typeof Uint16Array?r:Uint16Array,"$ %Uint16ArrayPrototype%":"undefined"===typeof Uint16Array?r:Uint16Array.prototype,"$ %Uint32Array%":"undefined"===typeof Uint32Array?r:Uint32Array,"$ %Uint32ArrayPrototype%":"undefined"===typeof Uint32Array?r:Uint32Array.prototype,"$ %URIError%":URIError,"$ %URIErrorPrototype%":URIError.prototype,"$ %WeakMap%":"undefined"===typeof WeakMap?r:WeakMap,"$ %WeakMapPrototype%":"undefined"===typeof WeakMap?r:WeakMap.prototype,"$ %WeakSet%":"undefined"===typeof WeakSet?r:WeakSet,"$ %WeakSetPrototype%":"undefined"===typeof WeakSet?r:WeakSet.prototype},v=n("0f7c"),b=v.call(Function.call,String.prototype.replace),M=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,w=/\\(\\)?/g,L=function(e){var t=[];return b(e,M,(function(e,n,r,a){t[t.length]=r?b(a,w,"$1"):n||e})),t},k=function(e,t){var n="$ "+e;if(!(n in g))throw new SyntaxError("intrinsic "+e+" does not exist!");if("undefined"===typeof g[n]&&!t)throw new s("intrinsic "+e+" exists, but is not available. Please file an issue!");return g[n]};e.exports=function(e,t){if(arguments.length>1&&"boolean"!==typeof t)throw new TypeError('"allowMissing" argument must be a boolean');var n=L(e);if(0===n.length)return k(e,t);for(var r=k("%"+n[0]+"%",t),a=1;a=n.length){var i=u(r,n[a]);r=i?i.get||i.value:r[n[a]]}else r=r[n[a]];return r}},ebd6:function(e,t,n){var r=n("cb7c"),a=n("d8e8"),i=n("2b4c")("species");e.exports=function(e,t){var n,o=r(e).constructor;return void 0===o||void 0==(n=r(o)[i])?t:a(n)}},ebe4:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}});return t}))},ebfd:function(e,t,n){var r=n("62a0")("meta"),a=n("f772"),i=n("07e3"),o=n("d9f6").f,s=0,u=Object.isExtensible||function(){return!0},l=!n("294c")((function(){return u(Object.preventExtensions({}))})),c=function(e){o(e,r,{value:{i:"O"+ ++s,w:{}}})},d=function(e,t){if(!a(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,r)){if(!u(e))return"F";if(!t)return"E";c(e)}return e[r].i},f=function(e,t){if(!i(e,r)){if(!u(e))return!0;if(!t)return!1;c(e)}return e[r].w},h=function(e){return l&&m.NEED&&u(e)&&!i(e,r)&&c(e),e},m=e.exports={KEY:r,NEED:!1,fastKey:d,getWeak:f,onFreeze:h}},ec18:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";function t(e,t,n,r){var a={s:["mõne sekundi","mõni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["ühe minuti","üks minut"],mm:[e+" minuti",e+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[e+" tunni",e+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[e+" kuu",e+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[e+" aasta",e+" aastat"]};return t?a[n][2]?a[n][2]:a[n][1]:r?a[n][0]:a[n][1]}var n=e.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:"%d päeva",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return n}))},ecee:function(e,t,n){"use strict";(function(e){function r(e){return r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n-1;a--){var i=n[a],o=(i.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(o)>-1&&(r=i)}return x.head.insertBefore(t,r),e}}var be="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function Me(){var e=12,t="";while(e-- >0)t+=be[62*Math.random()|0];return t}function we(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function Le(e){return Object.keys(e||{}).reduce((function(t,n){return t+"".concat(n,'="').concat(we(e[n]),'" ')}),"").trim()}function ke(e){return Object.keys(e||{}).reduce((function(t,n){return t+"".concat(n,": ").concat(e[n],";")}),"")}function xe(e){return e.size!==ge.size||e.x!==ge.x||e.y!==ge.y||e.rotate!==ge.rotate||e.flipX||e.flipY}function Ye(e){var t=e.transform,n=e.containerWidth,r=e.iconWidth,a={transform:"translate(".concat(n/2," 256)")},i="translate(".concat(32*t.x,", ").concat(32*t.y,") "),o="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),s="rotate(".concat(t.rotate," 0 0)"),u={transform:"".concat(i," ").concat(o," ").concat(s)},l={transform:"translate(".concat(r/2*-1," -256)")};return{outer:a,inner:u,path:l}}function De(e){var t=e.transform,n=e.width,r=void 0===n?O:n,a=e.height,i=void 0===a?O:a,o=e.startCentered,s=void 0!==o&&o,u="";return u+=s&&S?"translate(".concat(t.x/ye-r/2,"em, ").concat(t.y/ye-i/2,"em) "):s?"translate(calc(-50% + ".concat(t.x/ye,"em), calc(-50% + ").concat(t.y/ye,"em)) "):"translate(".concat(t.x/ye,"em, ").concat(t.y/ye,"em) "),u+="scale(".concat(t.size/ye*(t.flipX?-1:1),", ").concat(t.size/ye*(t.flipY?-1:1),") "),u+="rotate(".concat(t.rotate,"deg) "),u}var Se={x:0,y:0,width:"100%",height:"100%"};function Te(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill="black"),e}function Oe(e){return"g"===e.tag?e.children:[e]}function Ae(e){var t=e.children,n=e.attributes,r=e.main,a=e.mask,i=e.transform,o=r.width,s=r.icon,l=a.width,c=a.icon,d=Ye({transform:i,containerWidth:l,iconWidth:o}),f={tag:"rect",attributes:u({},Se,{fill:"white"})},h=s.children?{children:s.children.map(Te)}:{},m={tag:"g",attributes:u({},d.inner),children:[Te(u({tag:s.tag,attributes:u({},s.attributes,d.path)},h))]},p={tag:"g",attributes:u({},d.outer),children:[m]},_="mask-".concat(Me()),y="clip-".concat(Me()),g={tag:"mask",attributes:u({},Se,{id:_,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[f,p]},v={tag:"defs",children:[{tag:"clipPath",attributes:{id:y},children:Oe(c)},g]};return t.push(v,{tag:"rect",attributes:u({fill:"currentColor","clip-path":"url(#".concat(y,")"),mask:"url(#".concat(_,")")},Se)}),{children:t,attributes:n}}function Pe(e){var t=e.children,n=e.attributes,r=e.main,a=e.transform,i=e.styles,o=ke(i);if(o.length>0&&(n["style"]=o),xe(a)){var s=Ye({transform:a,containerWidth:r.width,iconWidth:r.width});t.push({tag:"g",attributes:u({},s.outer),children:[{tag:"g",attributes:u({},s.inner),children:[{tag:r.icon.tag,children:r.icon.children,attributes:u({},r.icon.attributes,s.path)}]}]})}else t.push(r.icon);return{children:t,attributes:n}}function je(e){var t=e.children,n=e.main,r=e.mask,a=e.attributes,i=e.styles,o=e.transform;if(xe(o)&&n.found&&!r.found){var s=n.width,l=n.height,c={x:s/l/2,y:.5};a["style"]=ke(u({},i,{"transform-origin":"".concat(c.x+o.x/16,"em ").concat(c.y+o.y/16,"em")}))}return[{tag:"svg",attributes:a,children:t}]}function He(e){var t=e.prefix,n=e.iconName,r=e.children,a=e.attributes,i=e.symbol,o=!0===i?"".concat(t,"-").concat(V.familyPrefix,"-").concat(n):i;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:u({},a,{id:o}),children:r}]}]}function Ce(e){var t=e.icons,n=t.main,r=t.mask,a=e.prefix,i=e.iconName,o=e.transform,s=e.symbol,l=e.title,c=e.extra,d=e.watchable,f=void 0!==d&&d,h=r.found?r:n,m=h.width,p=h.height,_="fa-w-".concat(Math.ceil(m/p*16)),y=[V.replacementClass,i?"".concat(V.familyPrefix,"-").concat(i):"",_].filter((function(e){return-1===c.classes.indexOf(e)})).concat(c.classes).join(" "),g={children:[],attributes:u({},c.attributes,{"data-prefix":a,"data-icon":i,class:y,role:c.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(m," ").concat(p)})};f&&(g.attributes[j]=""),l&&g.children.push({tag:"title",attributes:{id:g.attributes["aria-labelledby"]||"title-".concat(Me())},children:[l]});var v=u({},g,{prefix:a,iconName:i,main:n,mask:r,transform:o,symbol:s,styles:c.styles}),b=r.found&&n.found?Ae(v):Pe(v),M=b.children,w=b.attributes;return v.children=M,v.attributes=w,s?He(v):je(v)}function Ee(e){var t=e.content,n=e.width,r=e.height,a=e.transform,i=e.title,o=e.extra,s=e.watchable,l=void 0!==s&&s,c=u({},o.attributes,i?{title:i}:{},{class:o.classes.join(" ")});l&&(c[j]="");var d=u({},o.styles);xe(a)&&(d["transform"]=De({transform:a,startCentered:!0,width:n,height:r}),d["-webkit-transform"]=d["transform"]);var f=ke(d);f.length>0&&(c["style"]=f);var h=[];return h.push({tag:"span",attributes:c,children:[t]}),i&&h.push({tag:"span",attributes:{class:"sr-only"},children:[i]}),h}var ze=function(){},Fe=(V.measurePerformance&&Y&&Y.mark&&Y.measure,function(e,t){return function(n,r,a,i){return e.call(t,n,r,a,i)}}),Ie=function(e,t,n,r){var a,i,o,s=Object.keys(e),u=s.length,l=void 0!==r?Fe(t,r):t;for(void 0===n?(a=1,o=e[s[0]]):(a=0,o=n);a2&&void 0!==arguments[2]?arguments[2]:{},r=n.skipHooks,a=void 0!==r&&r,i=Object.keys(t).reduce((function(e,n){var r=t[n],a=!!r.icon;return a?e[r.iconName]=r.icon:e[n]=r,e}),{});"function"!==typeof $.hooks.addPack||a?$.styles[e]=u({},$.styles[e]||{},i):$.hooks.addPack(e,i),"fas"===e&&Ne("fa",t)}var We=$.styles,Re=$.shims,Ve=function(){var e=function(e){return Ie(We,(function(t,n,r){return t[r]=Ie(n,e,{}),t}),{})};e((function(e,t,n){return t[3]&&(e[t[3]]=n),e})),e((function(e,t,n){var r=t[2];return e[n]=n,r.forEach((function(t){e[t]=n})),e}));var t="far"in We;Ie(Re,(function(e,n){var r=n[0],a=n[1],i=n[2];return"far"!==a||t||(a="fas"),e[r]={prefix:a,iconName:i},e}),{})};Ve();$.styles;function Ue(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}function $e(e){var t=e.tag,n=e.attributes,r=void 0===n?{}:n,a=e.children,i=void 0===a?[]:a;return"string"===typeof e?we(e):"<".concat(t," ").concat(Le(r),">").concat(i.map($e).join(""),"")}var Be=function(e){var t={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return e?e.toLowerCase().split(" ").reduce((function(e,t){var n=t.toLowerCase().split("-"),r=n[0],a=n.slice(1).join("-");if(r&&"h"===a)return e.flipX=!0,e;if(r&&"v"===a)return e.flipY=!0,e;if(a=parseFloat(a),isNaN(a))return e;switch(r){case"grow":e.size=e.size+a;break;case"shrink":e.size=e.size-a;break;case"left":e.x=e.x-a;break;case"right":e.x=e.x+a;break;case"up":e.y=e.y-a;break;case"down":e.y=e.y+a;break;case"rotate":e.rotate=e.rotate+a;break}return e}),t):t};function qe(e){this.name="MissingIcon",this.message=e||"Icon unavailable",this.stack=(new Error).stack}qe.prototype=Object.create(Error.prototype),qe.prototype.constructor=qe;var Ge={fill:"currentColor"},Je={attributeType:"XML",repeatCount:"indefinite",dur:"2s"},Qe=(u({},Ge,{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"}),u({},Je,{attributeName:"opacity"}));u({},Ge,{cx:"256",cy:"364",r:"28"}),u({},Je,{attributeName:"r",values:"28;14;28;28;14;28;"}),u({},Qe,{values:"1;0;1;1;0;1;"}),u({},Ge,{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),u({},Qe,{values:"1;0;0;0;0;1;"}),u({},Ge,{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),u({},Qe,{values:"0;0;1;1;0;0;"}),$.styles;function Ze(e){var t=e[0],n=e[1],r=e.slice(4),a=l(r,1),i=a[0],o=null;return o=Array.isArray(i)?{tag:"g",attributes:{class:"".concat(V.familyPrefix,"-").concat(E.GROUP)},children:[{tag:"path",attributes:{class:"".concat(V.familyPrefix,"-").concat(E.SECONDARY),fill:"currentColor",d:i[0]}},{tag:"path",attributes:{class:"".concat(V.familyPrefix,"-").concat(E.PRIMARY),fill:"currentColor",d:i[1]}}]}:{tag:"path",attributes:{fill:"currentColor",d:i}},{found:!0,width:t,height:n,icon:o}}$.styles;var Ke='svg:not(:root).svg-inline--fa {\n overflow: visible;\n}\n\n.svg-inline--fa {\n display: inline-block;\n font-size: inherit;\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-lg {\n vertical-align: -0.225em;\n}\n.svg-inline--fa.fa-w-1 {\n width: 0.0625em;\n}\n.svg-inline--fa.fa-w-2 {\n width: 0.125em;\n}\n.svg-inline--fa.fa-w-3 {\n width: 0.1875em;\n}\n.svg-inline--fa.fa-w-4 {\n width: 0.25em;\n}\n.svg-inline--fa.fa-w-5 {\n width: 0.3125em;\n}\n.svg-inline--fa.fa-w-6 {\n width: 0.375em;\n}\n.svg-inline--fa.fa-w-7 {\n width: 0.4375em;\n}\n.svg-inline--fa.fa-w-8 {\n width: 0.5em;\n}\n.svg-inline--fa.fa-w-9 {\n width: 0.5625em;\n}\n.svg-inline--fa.fa-w-10 {\n width: 0.625em;\n}\n.svg-inline--fa.fa-w-11 {\n width: 0.6875em;\n}\n.svg-inline--fa.fa-w-12 {\n width: 0.75em;\n}\n.svg-inline--fa.fa-w-13 {\n width: 0.8125em;\n}\n.svg-inline--fa.fa-w-14 {\n width: 0.875em;\n}\n.svg-inline--fa.fa-w-15 {\n width: 0.9375em;\n}\n.svg-inline--fa.fa-w-16 {\n width: 1em;\n}\n.svg-inline--fa.fa-w-17 {\n width: 1.0625em;\n}\n.svg-inline--fa.fa-w-18 {\n width: 1.125em;\n}\n.svg-inline--fa.fa-w-19 {\n width: 1.1875em;\n}\n.svg-inline--fa.fa-w-20 {\n width: 1.25em;\n}\n.svg-inline--fa.fa-pull-left {\n margin-right: 0.3em;\n width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n margin-left: 0.3em;\n width: auto;\n}\n.svg-inline--fa.fa-border {\n height: 1.5em;\n}\n.svg-inline--fa.fa-li {\n width: 2em;\n}\n.svg-inline--fa.fa-fw {\n width: 1.25em;\n}\n\n.fa-layers svg.svg-inline--fa {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.fa-layers {\n display: inline-block;\n height: 1em;\n position: relative;\n text-align: center;\n vertical-align: -0.125em;\n width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter, .fa-layers-text {\n display: inline-block;\n position: absolute;\n text-align: center;\n}\n\n.fa-layers-text {\n left: 50%;\n top: 50%;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter {\n background-color: #ff253a;\n border-radius: 1em;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n color: #fff;\n height: 1.5em;\n line-height: 1;\n max-width: 5em;\n min-width: 1.5em;\n overflow: hidden;\n padding: 0.25em;\n right: 0;\n text-overflow: ellipsis;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n bottom: 0;\n right: 0;\n top: auto;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: bottom right;\n transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n bottom: 0;\n left: 0;\n right: auto;\n top: auto;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: bottom left;\n transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n right: 0;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-top-left {\n left: 0;\n right: auto;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top left;\n transform-origin: top left;\n}\n\n.fa-lg {\n font-size: 1.3333333333em;\n line-height: 0.75em;\n vertical-align: -0.0667em;\n}\n\n.fa-xs {\n font-size: 0.75em;\n}\n\n.fa-sm {\n font-size: 0.875em;\n}\n\n.fa-1x {\n font-size: 1em;\n}\n\n.fa-2x {\n font-size: 2em;\n}\n\n.fa-3x {\n font-size: 3em;\n}\n\n.fa-4x {\n font-size: 4em;\n}\n\n.fa-5x {\n font-size: 5em;\n}\n\n.fa-6x {\n font-size: 6em;\n}\n\n.fa-7x {\n font-size: 7em;\n}\n\n.fa-8x {\n font-size: 8em;\n}\n\n.fa-9x {\n font-size: 9em;\n}\n\n.fa-10x {\n font-size: 10em;\n}\n\n.fa-fw {\n text-align: center;\n width: 1.25em;\n}\n\n.fa-ul {\n list-style-type: none;\n margin-left: 2.5em;\n padding-left: 0;\n}\n.fa-ul > li {\n position: relative;\n}\n\n.fa-li {\n left: -2em;\n position: absolute;\n text-align: center;\n width: 2em;\n line-height: inherit;\n}\n\n.fa-border {\n border: solid 0.08em #eee;\n border-radius: 0.1em;\n padding: 0.2em 0.25em 0.15em;\n}\n\n.fa-pull-left {\n float: left;\n}\n\n.fa-pull-right {\n float: right;\n}\n\n.fa.fa-pull-left,\n.fas.fa-pull-left,\n.far.fa-pull-left,\n.fal.fa-pull-left,\n.fab.fa-pull-left {\n margin-right: 0.3em;\n}\n.fa.fa-pull-right,\n.fas.fa-pull-right,\n.far.fa-pull-right,\n.fal.fa-pull-right,\n.fab.fa-pull-right {\n margin-left: 0.3em;\n}\n\n.fa-spin {\n -webkit-animation: fa-spin 2s infinite linear;\n animation: fa-spin 2s infinite linear;\n}\n\n.fa-pulse {\n -webkit-animation: fa-spin 1s infinite steps(8);\n animation: fa-spin 1s infinite steps(8);\n}\n\n@-webkit-keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.fa-rotate-90 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";\n -webkit-transform: scale(-1, 1);\n transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n -webkit-transform: scale(1, -1);\n transform: scale(1, -1);\n}\n\n.fa-flip-both, .fa-flip-horizontal.fa-flip-vertical {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n -webkit-transform: scale(-1, -1);\n transform: scale(-1, -1);\n}\n\n:root .fa-rotate-90,\n:root .fa-rotate-180,\n:root .fa-rotate-270,\n:root .fa-flip-horizontal,\n:root .fa-flip-vertical,\n:root .fa-flip-both {\n -webkit-filter: none;\n filter: none;\n}\n\n.fa-stack {\n display: inline-block;\n height: 2em;\n position: relative;\n width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.svg-inline--fa.fa-stack-1x {\n height: 1em;\n width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n height: 2em;\n width: 2.5em;\n}\n\n.fa-inverse {\n color: #fff;\n}\n\n.sr-only {\n border: 0;\n clip: rect(0, 0, 0, 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n width: 1px;\n}\n\n.sr-only-focusable:active, .sr-only-focusable:focus {\n clip: auto;\n height: auto;\n margin: 0;\n overflow: visible;\n position: static;\n width: auto;\n}\n\n.svg-inline--fa .fa-primary {\n fill: var(--fa-primary-color, currentColor);\n opacity: 1;\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n fill: var(--fa-secondary-color, currentColor);\n opacity: 0.4;\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n opacity: 0.4;\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n opacity: 1;\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n fill: black;\n}\n\n.fad.fa-inverse {\n color: #fff;\n}';function Xe(){var e=A,t=P,n=V.familyPrefix,r=V.replacementClass,a=Ke;if(n!==e||r!==t){var i=new RegExp("\\.".concat(e,"\\-"),"g"),o=new RegExp("\\--".concat(e,"\\-"),"g"),s=new RegExp("\\.".concat(t),"g");a=a.replace(i,".".concat(n,"-")).replace(o,"--".concat(n,"-")).replace(s,".".concat(r))}return a}var et=function(){function e(){a(this,e),this.definitions={}}return o(e,[{key:"add",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{},r=(t||{}).icon?t:rt(t||{}),a=n.mask;return a&&(a=(a||{}).icon?a:rt(a||{})),e(r,u({},n,{mask:a}))}}var it=new et,ot=!1,st={transform:function(e){return Be(e)}},ut=at((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.transform,r=void 0===n?ge:n,a=t.symbol,i=void 0!==a&&a,o=t.mask,s=void 0===o?null:o,l=t.title,c=void 0===l?null:l,d=t.classes,f=void 0===d?[]:d,h=t.attributes,m=void 0===h?{}:h,p=t.styles,_=void 0===p?{}:p;if(e){var y=e.prefix,g=e.iconName,v=e.icon;return nt(u({type:"icon"},e),(function(){return tt(),V.autoA11y&&(c?m["aria-labelledby"]="".concat(V.replacementClass,"-title-").concat(Me()):(m["aria-hidden"]="true",m["focusable"]="false")),Ce({icons:{main:Ze(v),mask:s?Ze(s.icon):{found:!1,width:null,height:null,icon:{}}},prefix:y,iconName:g,transform:u({},ge,r),symbol:i,title:c,extra:{attributes:m,styles:_,classes:f}})}))}})),lt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.transform,r=void 0===n?ge:n,a=t.title,i=void 0===a?null:a,o=t.classes,s=void 0===o?[]:o,l=t.attributes,d=void 0===l?{}:l,f=t.styles,h=void 0===f?{}:f;return nt({type:"text",content:e},(function(){return tt(),Ee({content:e,transform:u({},ge,r),title:i,extra:{attributes:d,styles:h,classes:["".concat(V.familyPrefix,"-layers-text")].concat(c(s))}})}))}}).call(this,n("c8ba"))},eda5:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",ss:"තත්පර %d",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},dayOfMonthOrdinalParse:/\d{1,2} වැනි/,ordinal:function(e){return e+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(e){return"ප.ව."===e||"පස් වරු"===e},meridiem:function(e,t,n){return e>11?n?"ප.ව.":"පස් වරු":n?"පෙ.ව.":"පෙර වරු"}});return t}))},f0f2:function(e){e.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"Â","acirc":"â","acute":"´","Acy":"А","acy":"а","AElig":"Æ","aelig":"æ","af":"⁡","Afr":"𝔄","afr":"𝔞","Agrave":"À","agrave":"à","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"𝔸","aopf":"𝕒","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"\'","ApplyFunction":"⁡","approx":"≈","approxeq":"≊","Aring":"Å","aring":"å","Ascr":"𝒜","ascr":"𝒶","Assign":"≔","ast":"*","asymp":"≈","asympeq":"≍","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","Backslash":"∖","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","Bernoullis":"ℬ","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"𝔅","bfr":"𝔟","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bNot":"⫭","bnot":"⌐","Bopf":"𝔹","bopf":"𝕓","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"‵","breve":"˘","Breve":"˘","brvbar":"¦","bscr":"𝒷","Bscr":"ℬ","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"ⅅ","caps":"∩︀","caret":"⁁","caron":"ˇ","Cayleys":"ℭ","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"Ç","ccedil":"ç","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"¸","Cedilla":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","CenterDot":"·","cfr":"𝔠","Cfr":"ℭ","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"®","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"’","clubs":"♣","clubsuit":"♣","colon":":","Colon":"∷","Colone":"⩴","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"ℂ","cong":"≅","congdot":"⩭","Congruent":"≡","conint":"∮","Conint":"∯","ContourIntegral":"∮","copf":"𝕔","Copf":"ℂ","coprod":"∐","Coproduct":"∐","copy":"©","COPY":"©","copysr":"℗","CounterClockwiseContourIntegral":"∳","crarr":"↵","cross":"✗","Cross":"⨯","Cscr":"𝒞","cscr":"𝒸","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cupbrcap":"⩈","cupcap":"⩆","CupCap":"≍","cup":"∪","Cup":"⋓","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"∪︀","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"¤","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dagger":"†","Dagger":"‡","daleth":"ℸ","darr":"↓","Darr":"↡","dArr":"⇓","dash":"‐","Dashv":"⫤","dashv":"⊣","dbkarow":"⤏","dblac":"˝","Dcaron":"Ď","dcaron":"ď","Dcy":"Д","dcy":"д","ddagger":"‡","ddarr":"⇊","DD":"ⅅ","dd":"ⅆ","DDotrahd":"⤑","ddotseq":"⩷","deg":"°","Del":"∇","Delta":"Δ","delta":"δ","demptyv":"⦱","dfisht":"⥿","Dfr":"𝔇","dfr":"𝔡","dHar":"⥥","dharl":"⇃","dharr":"⇂","DiacriticalAcute":"´","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","diam":"⋄","diamond":"⋄","Diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"¨","DifferentialD":"ⅆ","digamma":"ϝ","disin":"⋲","div":"÷","divide":"÷","divideontimes":"⋇","divonx":"⋇","DJcy":"Ђ","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","Dopf":"𝔻","dopf":"𝕕","Dot":"¨","dot":"˙","DotDot":"⃜","doteq":"≐","doteqdot":"≑","DotEqual":"≐","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","DoubleContourIntegral":"∯","DoubleDot":"¨","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrowBar":"⤓","downarrow":"↓","DownArrow":"↓","Downarrow":"⇓","DownArrowUpArrow":"⇵","DownBreve":"̑","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVectorBar":"⥖","DownLeftVector":"↽","DownRightTeeVector":"⥟","DownRightVectorBar":"⥗","DownRightVector":"⇁","DownTeeArrow":"↧","DownTee":"⊤","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","Dscr":"𝒟","dscr":"𝒹","DScy":"Ѕ","dscy":"ѕ","dsol":"⧶","Dstrok":"Đ","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","DZcy":"Џ","dzcy":"џ","dzigrarr":"⟿","Eacute":"É","eacute":"é","easter":"⩮","Ecaron":"Ě","ecaron":"ě","Ecirc":"Ê","ecirc":"ê","ecir":"≖","ecolon":"≕","Ecy":"Э","ecy":"э","eDDot":"⩷","Edot":"Ė","edot":"ė","eDot":"≑","ee":"ⅇ","efDot":"≒","Efr":"𝔈","efr":"𝔢","eg":"⪚","Egrave":"È","egrave":"è","egs":"⪖","egsdot":"⪘","el":"⪙","Element":"∈","elinters":"⏧","ell":"ℓ","els":"⪕","elsdot":"⪗","Emacr":"Ē","emacr":"ē","empty":"∅","emptyset":"∅","EmptySmallSquare":"◻","emptyv":"∅","EmptyVerySmallSquare":"▫","emsp13":" ","emsp14":" ","emsp":" ","ENG":"Ŋ","eng":"ŋ","ensp":" ","Eogon":"Ę","eogon":"ę","Eopf":"𝔼","eopf":"𝕖","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","Epsilon":"Ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","Equal":"⩵","equals":"=","EqualTilde":"≂","equest":"≟","Equilibrium":"⇌","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erarr":"⥱","erDot":"≓","escr":"ℯ","Escr":"ℰ","esdot":"≐","Esim":"⩳","esim":"≂","Eta":"Η","eta":"η","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","euro":"€","excl":"!","exist":"∃","Exists":"∃","expectation":"ℰ","exponentiale":"ⅇ","ExponentialE":"ⅇ","fallingdotseq":"≒","Fcy":"Ф","fcy":"ф","female":"♀","ffilig":"ffi","fflig":"ff","ffllig":"ffl","Ffr":"𝔉","ffr":"𝔣","filig":"fi","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","fjlig":"fj","flat":"♭","fllig":"fl","fltns":"▱","fnof":"ƒ","Fopf":"𝔽","fopf":"𝕗","forall":"∀","ForAll":"∀","fork":"⋔","forkv":"⫙","Fouriertrf":"ℱ","fpartint":"⨍","frac12":"½","frac13":"⅓","frac14":"¼","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"¾","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"⁄","frown":"⌢","fscr":"𝒻","Fscr":"ℱ","gacute":"ǵ","Gamma":"Γ","gamma":"γ","Gammad":"Ϝ","gammad":"ϝ","gap":"⪆","Gbreve":"Ğ","gbreve":"ğ","Gcedil":"Ģ","Gcirc":"Ĝ","gcirc":"ĝ","Gcy":"Г","gcy":"г","Gdot":"Ġ","gdot":"ġ","ge":"≥","gE":"≧","gEl":"⪌","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","gescc":"⪩","ges":"⩾","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","Gfr":"𝔊","gfr":"𝔤","gg":"≫","Gg":"⋙","ggg":"⋙","gimel":"ℷ","GJcy":"Ѓ","gjcy":"ѓ","gla":"⪥","gl":"≷","glE":"⪒","glj":"⪤","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gnE":"≩","gneq":"⪈","gneqq":"≩","gnsim":"⋧","Gopf":"𝔾","gopf":"𝕘","grave":"`","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"𝒢","gscr":"ℊ","gsim":"≳","gsime":"⪎","gsiml":"⪐","gtcc":"⪧","gtcir":"⩺","gt":">","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"⁣","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"⁣","InvisibleTimes":"⁢","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"⁢","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"‎","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"​","NegativeThickSpace":"​","NegativeThinSpace":"​","NegativeVeryThinSpace":"​","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"⁠","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"‏","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"­","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":"  ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"​","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"‍","zwnj":"‌"}')},f1ae:function(e,t,n){"use strict";var r=n("86cc"),a=n("4630");e.exports=function(e,t,n){t in e?r.f(e,t,a(0,n)):e[t]=n}},f201:function(e,t,n){var r=n("e4ae"),a=n("79aa"),i=n("5168")("species");e.exports=function(e,t){var n,o=r(e).constructor;return void 0===o||void 0==(n=r(o)[i])?t:a(n)}},f260:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("pt",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}});return t}))},f367:function(e,t,n){"use strict";var r=n("d6c7"),a="function"===typeof Symbol&&"symbol"===typeof Symbol("foo"),i=Object.prototype.toString,o=Array.prototype.concat,s=Object.defineProperty,u=function(e){return"function"===typeof e&&"[object Function]"===i.call(e)},l=function(){var e={};try{for(var t in s(e,"x",{enumerable:!1,value:e}),e)return!1;return e.x===e}catch(n){return!1}},c=s&&l(),d=function(e,t,n,r){(!(t in e)||u(r)&&r())&&(c?s(e,t,{configurable:!0,enumerable:!1,value:n,writable:!0}):e[t]=n)},f=function(e,t){var n=arguments.length>2?arguments[2]:{},i=r(t);a&&(i=o.call(i,Object.getOwnPropertySymbols(t)));for(var s=0;s=10?e:e+12:"ਸ਼ਾਮ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ਰਾਤ":e<10?"ਸਵੇਰ":e<17?"ਦੁਪਹਿਰ":e<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}});return r}))},f410:function(e,t,n){n("1af6"),e.exports=n("584a").Array.isArray},f4d6:function(e,t,n){var r=n("ffd6"),a=1/0;function i(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-a?"-0":t}e.exports=i},f559:function(e,t,n){"use strict";var r=n("5ca1"),a=n("9def"),i=n("d2c8"),o="startsWith",s=""[o];r(r.P+r.F*n("5147")(o),"String",{startsWith:function(e){var t=i(this,e,o),n=a(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return s?s.call(t,r,n):t.slice(n,n+r.length)===r}})},f605:function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},f608:function(e,t,n){var r=n("6747"),a=n("ffd6"),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;function s(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!a(e))||(o.test(e)||!i.test(e)||null!=t&&e in Object(t))}e.exports=s},f6b4:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"],n=["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],r=["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],a=["Did","Dil","Dim","Dic","Dia","Dih","Dis"],i=["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],o=e.defineLocale("gd",{months:t,monthsShort:n,monthsParseExact:!0,weekdays:r,weekdaysShort:a,weekdaysMin:i,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",ss:"%d diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){var t=1===e?"d":e%10===2?"na":"mh";return e+t},week:{dow:1,doy:4}});return o}))},f751:function(e,t,n){var r=n("5ca1");r(r.S+r.F,"Object",{assign:n("73334")})},f772:function(e,t){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}},f921:function(e,t,n){n("014b"),n("c207"),n("69d3"),n("765d"),e.exports=n("584a").Symbol},fa5b:function(e,t,n){e.exports=n("5537")("native-function-to-string",Function.toString)},fab2:function(e,t,n){var r=n("7726").document;e.exports=r&&r.documentElement},facd:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),r=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],a=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,i=e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,r){return e?/-MMM-/.test(r)?n[e.month()]:t[e.month()]:t},monthsRegex:a,monthsShortRegex:a,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:r,longMonthsParse:r,shortMonthsParse:r,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}});return i}))},fba5:function(e,t,n){var r=n("cb5a");function a(e){return r(this.__data__,e)>-1}e.exports=a},fd7e:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("x-pseudo",{months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),monthsParseExact:!0,weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~ódá~ý át] LT",nextDay:"[T~ómó~rró~w át] LT",nextWeek:"dddd [át] LT",lastDay:"[Ý~ést~érdá~ý át] LT",lastWeek:"[L~ást] dddd [át] LT",sameElse:"L"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",ss:"%d s~écóñ~ds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"},dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=1===~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n},week:{dow:1,doy:4}});return t}))},ffc1:function(e,t,n){var r=n("5ca1"),a=n("504c")(!0);r(r.S,"Object",{entries:function(e){return a(e)}})},ffd6:function(e,t,n){var r=n("3729"),a=n("1310"),i="[object Symbol]";function o(e){return"symbol"==typeof e||a(e)&&r(e)==i}e.exports=o},ffff:function(e,t,n){(function(e,t){t(n("c1df"))})(0,(function(e){"use strict";var t=e.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",ss:"%d sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return t}))}}]); +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoianMvY2h1bmstdmVuZG9ycy5iNmNiZjU5NS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy9qcy9jaHVuay12ZW5kb3JzLmI2Y2JmNTk1LmpzIl0sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7OztBQW1CQTs7Ozs7O0FBNjhKQTs7QUF3M1BBOzs7Ozs7O0FBOHdKQTs7Ozs7OztBQTRpeUJBOzs7Ozs7Ozs7Ozs7O0FBMmdOQTs7Ozs7Ozs7Ozs7O0FBdTZiQSIsInNvdXJjZVJvb3QiOiIifQ== \ No newline at end of file diff --git a/Clockwork/Web/public/js/chunk-vendors.de559e1a.js b/Clockwork/Web/public/js/chunk-vendors.de559e1a.js deleted file mode 100644 index 55fca64b..00000000 --- a/Clockwork/Web/public/js/chunk-vendors.de559e1a.js +++ /dev/null @@ -1,118 +0,0 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-vendors"],{"0056":function(t,e,n){var a,r; -/*! - * URI.js - Mutating URLs - * IPv6 Support - * - * Version: 1.19.1 - * - * Author: Rodney Rehm - * Web: http://medialize.github.io/URI.js/ - * - * Licensed under - * MIT License http://www.opensource.org/licenses/mit-license - * - */ -/*! - * URI.js - Mutating URLs - * IPv6 Support - * - * Version: 1.19.1 - * - * Author: Rodney Rehm - * Web: http://medialize.github.io/URI.js/ - * - * Licensed under - * MIT License http://www.opensource.org/licenses/mit-license - * - */ -(function(i,o){"use strict";t.exports?t.exports=o():(a=o,r="function"===typeof a?a.call(e,n,e,t):a,void 0===r||(t.exports=r))})(0,function(t){"use strict";var e=t&&t.IPv6;function n(t){var e,n,a=t.toLowerCase(),r=a.split(":"),i=r.length,o=8;for(""===r[0]&&""===r[1]&&""===r[2]?(r.shift(),r.shift()):""===r[0]&&""===r[1]?r.shift():""===r[i-1]&&""===r[i-2]&&r.pop(),i=r.length,-1!==r[i-1].indexOf(".")&&(o=7),e=0;e1))break;n.splice(0,1)}r[s]=n.join("")}var d=-1,u=0,c=0,f=-1,h=!1;for(s=0;su&&(d=f,u=c)):"0"===r[s]&&(h=!0,f=s,c=1);c>u&&(d=f,u=c),u>1&&r.splice(d,u,""),i=r.length;var m="";for(""===r[0]&&(m=":"),s=0;sr)X(t,n=a[r++],e[n]);return t},Z=function(t,e){return void 0===e?x(t):Q(x(t),e)},K=function(t){var e=I.call(this,t=k(t,!0));return!(this===V&&r(R,t)&&!r(N,t))&&(!(e||!r(this,t)||!r(R,t)||r(this,E)&&this[E][t])||e)},tt=function(t,e){if(t=M(t),e=k(e,!0),t!==V||!r(R,e)||r(N,e)){var n=O(t,e);return!n||!r(R,e)||r(t,E)&&t[E][e]||(n.enumerable=!0),n}},et=function(t){var e,n=A(M(t)),a=[],i=0;while(n.length>i)r(R,e=n[i++])||e==E||e==l||a.push(e);return a},nt=function(t){var e,n=t===V,a=A(n?N:M(t)),i=[],o=0;while(a.length>o)!r(R,e=a[o++])||n&&!r(V,e)||i.push(R[e]);return i};U||(P=function(){if(this instanceof P)throw TypeError("Symbol is not a constructor!");var t=f(arguments.length>0?arguments[0]:void 0),e=function(n){this===V&&e.call(N,n),r(this,E)&&r(this[E],t)&&(this[E][t]=!1),J(this,t,w(1,n))};return i&&$&&J(V,t,{configurable:!0,set:e}),G(t)},s(P[z],"toString",function(){return this._k}),Y.f=tt,S.f=X,n("6abf").f=L.f=et,n("355d").f=K,D.f=nt,i&&!n("b8e3")&&s(V,"propertyIsEnumerable",K,!0),m.f=function(t){return G(h(t))}),o(o.G+o.W+o.F*!U,{Symbol:P});for(var at="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),rt=0;at.length>rt;)h(at[rt++]);for(var it=T(h.store),ot=0;it.length>ot;)p(it[ot++]);o(o.S+o.F*!U,"Symbol",{for:function(t){return r(W,t+="")?W[t]:W[t]=P(t)},keyFor:function(t){if(!q(t))throw TypeError(t+" is not a symbol!");for(var e in W)if(W[e]===t)return e},useSetter:function(){$=!0},useSimple:function(){$=!1}}),o(o.S+o.F*!U,"Object",{create:Z,defineProperty:X,defineProperties:Q,getOwnPropertyDescriptor:tt,getOwnPropertyNames:et,getOwnPropertySymbols:nt});var st=d(function(){D.f(1)});o(o.S+o.F*st,"Object",{getOwnPropertySymbols:function(t){return D.f(b(t))}}),j&&o(o.S+o.F*(!U||d(function(){var t=P();return"[null]"!=C([t])||"{}"!=C({a:t})||"{}"!=C(Object(t))})),"JSON",{stringify:function(t){var e,n,a=[t],r=1;while(arguments.length>r)a.push(arguments[r++]);if(n=e=a[1],(g(e)||void 0!==t)&&!q(t))return v(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!q(e))return e}),a[1]=e,C.apply(j,a)}}),P[z][F]||n("35e8")(P[z],F,P[z].valueOf),c(P,"Symbol"),c(Math,"Math",!0),c(a.JSON,"JSON",!0)},"01f9":function(t,e,n){"use strict";var a=n("2d00"),r=n("5ca1"),i=n("2aba"),o=n("32e9"),s=n("84f2"),l=n("41a0"),d=n("7f20"),u=n("38fd"),c=n("2b4c")("iterator"),f=!([].keys&&"next"in[].keys()),h="@@iterator",m="keys",p="values",_=function(){return this};t.exports=function(t,e,n,v,y,g,b){l(n,e,v);var M,k,w,x=function(t){if(!f&&t in S)return S[t];switch(t){case m:return function(){return new n(this,t)};case p:return function(){return new n(this,t)}}return function(){return new n(this,t)}},L=e+" Iterator",Y=y==p,D=!1,S=t.prototype,T=S[c]||S[h]||y&&S[y],O=T||x(y),H=y?Y?x("entries"):O:void 0,A="Array"==e&&S.entries||T;if(A&&(w=u(A.call(new t)),w!==Object.prototype&&w.next&&(d(w,L,!0),a||"function"==typeof w[c]||o(w,c,_))),Y&&T&&T.name!==p&&(D=!0,O=function(){return T.call(this)}),a&&!b||!f&&!D&&S[c]||o(S,c,O),s[e]=O,s[L]=_,y)if(M={values:Y?O:x(p),keys:g?O:x(m),entries:H},b)for(k in M)k in S||i(S,k,M[k]);else r(r.P+r.F*(f||D),e,M);return M}},"02f4":function(t,e,n){var a=n("4588"),r=n("be13");t.exports=function(t){return function(e,n){var i,o,s=String(r(e)),l=a(n),d=s.length;return l<0||l>=d?t?"":void 0:(i=s.charCodeAt(l),i<55296||i>56319||l+1===d||(o=s.charCodeAt(l+1))<56320||o>57343?t?s.charAt(l):i:t?s.slice(l,l+2):o-56320+(i-55296<<10)+65536)}}},"02fb":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",ss:"%d സെക്കൻഡ്",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(t,e){return 12===t&&(t=0),"രാത്രി"===e&&t>=4||"ഉച്ച കഴിഞ്ഞ്"===e||"വൈകുന്നേരം"===e?t+12:t},meridiem:function(t,e,n){return t<4?"രാത്രി":t<12?"രാവിലെ":t<17?"ഉച്ച കഴിഞ്ഞ്":t<20?"വൈകുന്നേരം":"രാത്രി"}});return e})},"0390":function(t,e,n){"use strict";var a=n("02f4")(!0);t.exports=function(t,e,n){return e+(n?a(t,e).length:1)}},"0395":function(t,e,n){var a=n("36c3"),r=n("6abf").f,i={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(t){try{return r(t)}catch(e){return o.slice()}};t.exports.f=function(t){return o&&"[object Window]"==i.call(t)?s(t):r(a(t))}},"03ec":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(t){var e=/сехет$/i.exec(t)?"рен":/ҫул$/i.exec(t)?"тан":"ран";return t+e},past:"%s каялла",s:"пӗр-ик ҫеккунт",ss:"%d ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},dayOfMonthOrdinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}});return e})},"0558":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";function e(t){return t%100===11||t%10!==1}function n(t,n,a,r){var i=t+" ";switch(a){case"s":return n||r?"nokkrar sekúndur":"nokkrum sekúndum";case"ss":return e(t)?i+(n||r?"sekúndur":"sekúndum"):i+"sekúnda";case"m":return n?"mínúta":"mínútu";case"mm":return e(t)?i+(n||r?"mínútur":"mínútum"):n?i+"mínúta":i+"mínútu";case"hh":return e(t)?i+(n||r?"klukkustundir":"klukkustundum"):i+"klukkustund";case"d":return n?"dagur":r?"dag":"degi";case"dd":return e(t)?n?i+"dagar":i+(r?"daga":"dögum"):n?i+"dagur":i+(r?"dag":"degi");case"M":return n?"mánuður":r?"mánuð":"mánuði";case"MM":return e(t)?n?i+"mánuðir":i+(r?"mánuði":"mánuðum"):n?i+"mánuður":i+(r?"mánuð":"mánuði");case"y":return n||r?"ár":"ári";case"yy":return e(t)?i+(n||r?"ár":"árum"):i+(n||r?"ár":"ári")}}var a=t.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:n,ss:n,m:n,mm:n,h:"klukkustund",hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return a})},"0721":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",ss:"%d sekundir",m:"ein minuttur",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaður",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return e})},"079e":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("ja",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiemParse:/午前|午後/i,isPM:function(t){return"午後"===t},meridiem:function(t,e,n){return t<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:function(t){return t.week()M;M++)if((f||M in y)&&(p=y[M],_=g(p,M,v),t))if(n)k[M]=_;else if(_)switch(t){case 3:return!0;case 5:return p;case 6:return M;case 2:k.push(p)}else if(u)return!1;return c?-1:d||u?u:k}}},"0a84":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:6,doy:12}});return e})},"0b07":function(t,e,n){var a=n("34ac"),r=n("3698");function i(t,e){var n=r(t,e);return a(n)?n:void 0}t.exports=i},"0bfb":function(t,e,n){"use strict";var a=n("cb7c");t.exports=function(){var t=a(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},"0caa":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";function e(t,e,n,a){var r={s:["thodde secondanim","thodde second"],ss:[t+" secondanim",t+" second"],m:["eka mintan","ek minute"],mm:[t+" mintanim",t+" mintam"],h:["eka voran","ek vor"],hh:[t+" voranim",t+" voram"],d:["eka disan","ek dis"],dd:[t+" disanim",t+" dis"],M:["eka mhoinean","ek mhoino"],MM:[t+" mhoineanim",t+" mhoine"],y:["eka vorsan","ek voros"],yy:[t+" vorsanim",t+" vorsam"]};return e?r[n][0]:r[n][1]}var n=t.defineLocale("gom-latn",{months:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Aitar_Somar_Mongllar_Budvar_Brestar_Sukrar_Son'var".split("_"),weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM[achea] Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"},calendar:{sameDay:"[Aiz] LT",nextDay:"[Faleam] LT",nextWeek:"[Ieta to] dddd[,] LT",lastDay:"[Kal] LT",lastWeek:"[Fatlo] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s adim",s:e,ss:e,m:e,mm:e,h:e,hh:e,d:e,dd:e,M:e,MM:e,y:e,yy:e},dayOfMonthOrdinalParse:/\d{1,2}(er)/,ordinal:function(t,e){switch(e){case"D":return t+"er";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return t}},week:{dow:1,doy:4},meridiemParse:/rati|sokalli|donparam|sanje/,meridiemHour:function(t,e){return 12===t&&(t=0),"rati"===e?t<4?t:t+12:"sokalli"===e?t:"donparam"===e?t>12?t:t+12:"sanje"===e?t+12:void 0},meridiem:function(t,e,n){return t<4?"rati":t<12?"sokalli":t<16?"donparam":t<20?"sanje":"rati"}});return n})},"0d58":function(t,e,n){var a=n("ce10"),r=n("e11e");t.exports=Object.keys||function(t){return a(t,r)}},"0e49":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(t,e){switch(e){default:case"M":case"Q":case"D":case"DDD":case"d":return t+(1===t?"er":"e");case"w":case"W":return t+(1===t?"re":"e")}},week:{dow:1,doy:4}});return e})},"0e6b":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(t){var e=t%10,n=1===~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n},week:{dow:1,doy:4}});return e})},"0e81":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"},n=t.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[gelecek] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",ss:"%d saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(t,n){switch(n){case"d":case"D":case"Do":case"DD":return t;default:if(0===t)return t+"'ıncı";var a=t%10,r=t%100-a,i=t>=100?100:null;return t+(e[a]||e[r]||e[i])}},week:{dow:1,doy:7}});return n})},"0f14":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"på dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[i] dddd[s kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",ss:"%d sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return e})},"0f38":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(t){return t},week:{dow:1,doy:4}});return e})},"0fc9":function(t,e,n){var a=n("3a38"),r=Math.max,i=Math.min;t.exports=function(t,e){return t=a(t),t<0?r(t+e,0):i(t,e)}},"0ff2":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}});return e})},"10e8":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),monthsParseExact:!0,weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(t){return"หลังเที่ยง"===t},meridiem:function(t,e,n){return t<12?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",ss:"%d วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}});return e})},1160:function(t,e){function n(t){if("function"==typeof t)return t;var e=Array.isArray(t)?[]:{};for(var r in t){var i=t[r],o={}.toString.call(i).slice(8,-1);e[r]="Array"==o||"Object"==o?n(i):"Date"==o?new Date(i.getTime()):"RegExp"==o?RegExp(i.source,a(i)):i}return e}function a(t){if("string"==typeof t.source.flags)return t.source.flags;var e=[];return t.global&&e.push("g"),t.ignoreCase&&e.push("i"),t.multiline&&e.push("m"),t.sticky&&e.push("y"),t.unicode&&e.push("u"),e.join("")}t.exports=n},1169:function(t,e,n){var a=n("2d95");t.exports=Array.isArray||function(t){return"Array"==a(t)}},"11e9":function(t,e,n){var a=n("52a7"),r=n("4630"),i=n("6821"),o=n("6a99"),s=n("69a8"),l=n("c69a"),d=Object.getOwnPropertyDescriptor;e.f=n("9e1e")?d:function(t,e){if(t=i(t),e=o(e,!0),l)try{return d(t,e)}catch(n){}if(s(t,e))return r(!a.f.call(t,e),t[e])}},1290:function(t,e){function n(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}t.exports=n},1310:function(t,e){function n(t){return null!=t&&"object"==typeof t}t.exports=n},1368:function(t,e,n){var a=n("da03"),r=function(){var t=/[^.]+$/.exec(a&&a.keys&&a.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function i(t){return!!r&&r in t}t.exports=i},"13e9":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e={words:{ss:["секунда","секунде","секунди"],m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(t,e){return 1===t?e[0]:t>=2&&t<=4?e[1]:e[2]},translate:function(t,n,a){var r=e.words[a];return 1===a.length?n?r[0]:r[1]:t+" "+e.correctGrammaticalCase(t,r)}},n=t.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){var t=["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"];return t[this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",ss:e.translate,m:e.translate,mm:e.translate,h:e.translate,hh:e.translate,d:"дан",dd:e.translate,M:"месец",MM:e.translate,y:"годину",yy:e.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}});return n})},1495:function(t,e,n){var a=n("86cc"),r=n("cb7c"),i=n("0d58");t.exports=n("9e1e")?Object.defineProperties:function(t,e){r(t);var n,o=i(e),s=o.length,l=0;while(s>l)a.f(t,n=o[l++],e[n]);return t}},1654:function(t,e,n){"use strict";var a=n("71c1")(!0);n("30f1")(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=a(e,n),this._i+=t.length,{value:t,done:!1})})},1691:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},"18d8":function(t,e,n){var a=n("234d"),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,o=a(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(r,function(t,n,a,r){e.push(a?r.replace(i,"$1"):n||t)}),e});t.exports=o},1991:function(t,e,n){var a,r,i,o=n("9b43"),s=n("31f4"),l=n("fab2"),d=n("230e"),u=n("7726"),c=u.process,f=u.setImmediate,h=u.clearImmediate,m=u.MessageChannel,p=u.Dispatch,_=0,v={},y="onreadystatechange",g=function(){var t=+this;if(v.hasOwnProperty(t)){var e=v[t];delete v[t],e()}},b=function(t){g.call(t.data)};f&&h||(f=function(t){var e=[],n=1;while(arguments.length>n)e.push(arguments[n++]);return v[++_]=function(){s("function"==typeof t?t:Function(t),e)},a(_),_},h=function(t){delete v[t]},"process"==n("2d95")(c)?a=function(t){c.nextTick(o(g,t,1))}:p&&p.now?a=function(t){p.now(o(g,t,1))}:m?(r=new m,i=r.port2,r.port1.onmessage=b,a=o(i.postMessage,i,1)):u.addEventListener&&"function"==typeof postMessage&&!u.importScripts?(a=function(t){u.postMessage(t+"","*")},u.addEventListener("message",b,!1)):a=y in d("script")?function(t){l.appendChild(d("script"))[y]=function(){l.removeChild(this),g.call(t)}}:function(t){setTimeout(o(g,t,1),0)}),t.exports={set:f,clear:h}},"1a8c":function(t,e){function n(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}t.exports=n},"1af6":function(t,e,n){var a=n("63b6");a(a.S,"Array",{isArray:n("9003")})},"1b45":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("mt",{months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Illum fil-]LT",nextDay:"[Għada fil-]LT",nextWeek:"dddd [fil-]LT",lastDay:"[Il-bieraħ fil-]LT",lastWeek:"dddd [li għadda] [fil-]LT",sameElse:"L"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",ss:"%d sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}});return e})},"1bc3":function(t,e,n){var a=n("f772");t.exports=function(t,e){if(!a(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!a(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!a(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!a(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},"1cfd":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},n=function(t){return 0===t?0:1===t?1:2===t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5},a={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},r=function(t){return function(e,r,i,o){var s=n(e),l=a[t][n(e)];return 2===s&&(l=l[r?0:1]),l.replace(/%d/i,e)}},i=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"],o=t.defineLocale("ar-ly",{months:i,monthsShort:i,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(t){return"م"===t},meridiem:function(t,e,n){return t<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:r("s"),ss:r("s"),m:r("m"),mm:r("m"),h:r("h"),hh:r("h"),d:r("d"),dd:r("d"),M:r("M"),MM:r("M"),y:r("y"),yy:r("y")},preparse:function(t){return t.replace(/،/g,",")},postformat:function(t){return t.replace(/\d/g,function(t){return e[t]}).replace(/,/g,"،")},week:{dow:6,doy:12}});return o})},"1ec9":function(t,e,n){var a=n("f772"),r=n("e53d").document,i=a(r)&&a(r.createElement);t.exports=function(t){return i?r.createElement(t):{}}},"1efc":function(t,e){function n(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}t.exports=n},"1fa8":function(t,e,n){var a=n("cb7c");t.exports=function(t,e,n,r){try{return r?e(a(n)[0],n[1]):e(n)}catch(o){var i=t["return"];throw void 0!==i&&a(i.call(t)),o}}},"1fc1":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";function e(t,e){var n=t.split("_");return e%10===1&&e%100!==11?n[0]:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?n[1]:n[2]}function n(t,n,a){var r={ss:n?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:n?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:n?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"};return"m"===a?n?"хвіліна":"хвіліну":"h"===a?n?"гадзіна":"гадзіну":t+" "+e(r[a],+t)}var a=t.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:n,mm:n,h:n,hh:n,d:"дзень",dd:n,M:"месяц",MM:n,y:"год",yy:n},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(t){return/^(дня|вечара)$/.test(t)},meridiem:function(t,e,n){return t<4?"ночы":t<12?"раніцы":t<17?"дня":"вечара"},dayOfMonthOrdinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(t,e){switch(e){case"M":case"d":case"DDD":case"w":case"W":return t%10!==2&&t%10!==3||t%100===12||t%100===13?t+"-ы":t+"-і";case"D":return t+"-га";default:return t}},week:{dow:1,doy:7}});return a})},"1fc8":function(t,e,n){var a=n("4245");function r(t,e){var n=a(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}t.exports=r},"201b":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("ka",{months:{standalone:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),format:"იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს".split("_")},monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(t){return/(წამი|წუთი|საათი|წელი)/.test(t)?t.replace(/ი$/,"ში"):t+"ში"},past:function(t){return/(წამი|წუთი|საათი|დღე|თვე)/.test(t)?t.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(t)?t.replace(/წელი$/,"წლის წინ"):void 0},s:"რამდენიმე წამი",ss:"%d წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},dayOfMonthOrdinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(t){return 0===t?t:1===t?t+"-ლი":t<20||t<=100&&t%20===0||t%100===0?"მე-"+t:t+"-ე"},week:{dow:1,doy:7}});return e})},"20fd":function(t,e,n){"use strict";var a=n("d9f6"),r=n("aebd");t.exports=function(t,e,n){e in t?a.f(t,e,r(0,n)):t[e]=n}},2103:function(t,e,n){!function(e,n){t.exports=n()}(0,function(){var t="undefined"!=typeof window,e="undefined"!=typeof navigator,n=t&&("ontouchstart"in window||e&&navigator.msMaxTouchPoints>0)?["touchstart","click"]:["click"],a=function(t){return t},r={instances:[]};function i(t){var e="function"==typeof t;if(!e&&"object"!=typeof t)throw new Error("v-click-outside: Binding value must be a function or an object");return{handler:e?t:t.handler,middleware:t.middleware||a,events:t.events||n,isActive:!(!1===t.isActive)}}function o(t){var e=t.el,n=t.event,a=t.handler,r=t.middleware;n.target!==e&&!e.contains(n.target)&&r(n,e)&&a(n,e)}function s(t){var e=t.el,n=t.handler,a=t.middleware;return{el:e,eventHandlers:t.events.map(function(t){return{event:t,handler:function(t){return o({event:t,el:e,handler:n,middleware:a})}}})}}function l(t){var e=r.instances.findIndex(function(e){return e.el===t});-1!==e&&(r.instances[e].eventHandlers.forEach(function(t){return document.removeEventListener(t.event,t.handler)}),r.instances.splice(e,1))}return r.bind=function(t,e){var n=i(e.value);if(n.isActive){var a=s({el:t,events:n.events,handler:n.handler,middleware:n.middleware});a.eventHandlers.forEach(function(t){var e=t.event,n=t.handler;return setTimeout(function(){return document.addEventListener(e,n)},0)}),r.instances.push(a)}},r.update=function(t,e){var n=e.value,a=e.oldValue;if(JSON.stringify(n)!==JSON.stringify(a)){var d=i(n),u=d.events,c=d.handler,f=d.middleware;if(d.isActive){var h=r.instances.find(function(e){return e.el===t});h?(h.eventHandlers.forEach(function(t){return document.removeEventListener(t.event,t.handler)}),h.eventHandlers=u.map(function(e){return{event:e,handler:function(e){return o({event:e,el:t,handler:c,middleware:f})}}})):(h=s({el:t,events:u,handler:c,middleware:f}),r.instances.push(h)),h.eventHandlers.forEach(function(t){var e=t.event,n=t.handler;return setTimeout(function(){return document.addEventListener(e,n)},0)})}else l(t)}},r.unbind=l,{install:function(t){t.directive("click-outside",r)},directive:r}})},"214f":function(t,e,n){"use strict";n("b0c5");var a=n("2aba"),r=n("32e9"),i=n("79e5"),o=n("be13"),s=n("2b4c"),l=n("520a"),d=s("species"),u=!i(function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$
")}),c=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();t.exports=function(t,e,n){var f=s(t),h=!i(function(){var e={};return e[f]=function(){return 7},7!=""[t](e)}),m=h?!i(function(){var e=!1,n=/a/;return n.exec=function(){return e=!0,null},"split"===t&&(n.constructor={},n.constructor[d]=function(){return n}),n[f](""),!e}):void 0;if(!h||!m||"replace"===t&&!u||"split"===t&&!c){var p=/./[f],_=n(o,f,""[t],function(t,e,n,a,r){return e.exec===l?h&&!r?{done:!0,value:p.call(e,n,a)}:{done:!0,value:t.call(n,e,a)}:{done:!1}}),v=_[0],y=_[1];a(String.prototype,t,v),r(RegExp.prototype,f,2==e?function(t,e){return y.call(t,this,e)}:function(t){return y.call(t,this)})}}},"22f8":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",ss:"%d초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"},dayOfMonthOrdinalParse:/\d{1,2}(일|월|주)/,ordinal:function(t,e){switch(e){case"d":case"D":case"DDD":return t+"일";case"M":return t+"월";case"w":case"W":return t+"주";default:return t}},meridiemParse:/오전|오후/,isPM:function(t){return"오후"===t},meridiem:function(t,e,n){return t<12?"오전":"오후"}});return e})},"230e":function(t,e,n){var a=n("d3f4"),r=n("7726").document,i=a(r)&&a(r.createElement);t.exports=function(t){return i?r.createElement(t):{}}},"234d":function(t,e,n){var a=n("e380"),r=500;function i(t){var e=a(t,function(t){return n.size===r&&n.clear(),t}),n=e.cache;return e}t.exports=i},"23c6":function(t,e,n){var a=n("2d95"),r=n("2b4c")("toStringTag"),i="Arguments"==a(function(){return arguments}()),o=function(t,e){try{return t[e]}catch(n){}};t.exports=function(t){var e,n,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=o(e=Object(t),r))?n:i?a(e):"Object"==(s=a(e))&&"function"==typeof e.callee?"Arguments":s}},"241e":function(t,e,n){var a=n("25eb");t.exports=function(t){return Object(a(t))}},2421:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},a=["کانونی دووەم","شوبات","ئازار","نیسان","ئایار","حوزەیران","تەمموز","ئاب","ئەیلوول","تشرینی یەكەم","تشرینی دووەم","كانونی یەکەم"],r=t.defineLocale("ku",{months:a,monthsShort:a,weekdays:"یه‌كشه‌ممه‌_دووشه‌ممه‌_سێشه‌ممه‌_چوارشه‌ممه‌_پێنجشه‌ممه‌_هه‌ینی_شه‌ممه‌".split("_"),weekdaysShort:"یه‌كشه‌م_دووشه‌م_سێشه‌م_چوارشه‌م_پێنجشه‌م_هه‌ینی_شه‌ممه‌".split("_"),weekdaysMin:"ی_د_س_چ_پ_ه_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ئێواره‌|به‌یانی/,isPM:function(t){return/ئێواره‌/.test(t)},meridiem:function(t,e,n){return t<12?"به‌یانی":"ئێواره‌"},calendar:{sameDay:"[ئه‌مرۆ كاتژمێر] LT",nextDay:"[به‌یانی كاتژمێر] LT",nextWeek:"dddd [كاتژمێر] LT",lastDay:"[دوێنێ كاتژمێر] LT",lastWeek:"dddd [كاتژمێر] LT",sameElse:"L"},relativeTime:{future:"له‌ %s",past:"%s",s:"چه‌ند چركه‌یه‌ك",ss:"چركه‌ %d",m:"یه‌ك خوله‌ك",mm:"%d خوله‌ك",h:"یه‌ك كاتژمێر",hh:"%d كاتژمێر",d:"یه‌ك ڕۆژ",dd:"%d ڕۆژ",M:"یه‌ك مانگ",MM:"%d مانگ",y:"یه‌ك ساڵ",yy:"%d ساڵ"},preparse:function(t){return t.replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(t){return n[t]}).replace(/،/g,",")},postformat:function(t){return t.replace(/\d/g,function(t){return e[t]}).replace(/,/g,"،")},week:{dow:6,doy:12}});return r})},2478:function(t,e,n){var a=n("4245");function r(t){return a(this,t).get(t)}t.exports=r},2524:function(t,e,n){var a=n("6044"),r="__lodash_hash_undefined__";function i(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=a&&void 0===e?r:e,this}t.exports=i},2554:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";function e(t,e,n){var a=t+" ";switch(n){case"ss":return a+=1===t?"sekunda":2===t||3===t||4===t?"sekunde":"sekundi",a;case"m":return e?"jedna minuta":"jedne minute";case"mm":return a+=1===t?"minuta":2===t||3===t||4===t?"minute":"minuta",a;case"h":return e?"jedan sat":"jednog sata";case"hh":return a+=1===t?"sat":2===t||3===t||4===t?"sata":"sati",a;case"dd":return a+=1===t?"dan":"dana",a;case"MM":return a+=1===t?"mjesec":2===t||3===t||4===t?"mjeseca":"mjeseci",a;case"yy":return a+=1===t?"godina":2===t||3===t||4===t?"godine":"godina",a}}var n=t.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:e,m:e,mm:e,h:e,hh:e,d:"dan",dd:e,M:"mjesec",MM:e,y:"godinu",yy:e},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}});return n})},"25eb":function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},2621:function(t,e){e.f=Object.getOwnPropertySymbols},"26f9":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e={ss:"sekundė_sekundžių_sekundes",m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"};function n(t,e,n,a){return e?"kelios sekundės":a?"kelių sekundžių":"kelias sekundes"}function a(t,e,n,a){return e?i(n)[0]:a?i(n)[1]:i(n)[2]}function r(t){return t%10===0||t>10&&t<20}function i(t){return e[t].split("_")}function o(t,e,n,o){var s=t+" ";return 1===t?s+a(t,e,n[0],o):e?s+(r(t)?i(n)[1]:i(n)[0]):o?s+i(n)[1]:s+(r(t)?i(n)[1]:i(n)[2])}var s=t.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:n,ss:o,m:a,mm:o,h:a,hh:o,d:a,dd:o,M:a,MM:o,y:a,yy:o},dayOfMonthOrdinalParse:/\d{1,2}-oji/,ordinal:function(t){return t+"-oji"},week:{dow:1,doy:4}});return s})},"27ee":function(t,e,n){var a=n("23c6"),r=n("2b4c")("iterator"),i=n("84f2");t.exports=n("8378").getIteratorMethod=function(t){if(void 0!=t)return t[r]||t["@@iterator"]||i[a(t)]}},2877:function(t,e,n){"use strict";function a(t,e,n,a,r,i,o,s){var l,d="function"===typeof t?t.options:t;if(e&&(d.render=e,d.staticRenderFns=n,d._compiled=!0),a&&(d.functional=!0),i&&(d._scopeId="data-v-"+i),o?(l=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},d._ssrRegister=l):r&&(l=s?function(){r.call(this,this.$root.$options.shadowRoot)}:r),l)if(d.functional){d._injectStyles=l;var u=d.render;d.render=function(t,e){return l.call(e),u(t,e)}}else{var c=d.beforeCreate;d.beforeCreate=c?[].concat(c,l):[l]}return{exports:t,options:d}}n.d(e,"a",function(){return a})},"28a5":function(t,e,n){"use strict";var a=n("aae3"),r=n("cb7c"),i=n("ebd6"),o=n("0390"),s=n("9def"),l=n("5f1b"),d=n("520a"),u=n("79e5"),c=Math.min,f=[].push,h="split",m="length",p="lastIndex",_=4294967295,v=!u(function(){RegExp(_,"y")});n("214f")("split",2,function(t,e,n,u){var y;return y="c"=="abbc"[h](/(b)*/)[1]||4!="test"[h](/(?:)/,-1)[m]||2!="ab"[h](/(?:ab)*/)[m]||4!="."[h](/(.?)(.?)/)[m]||"."[h](/()()/)[m]>1||""[h](/.?/)[m]?function(t,e){var r=String(this);if(void 0===t&&0===e)return[];if(!a(t))return n.call(r,t,e);var i,o,s,l=[],u=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),c=0,h=void 0===e?_:e>>>0,v=new RegExp(t.source,u+"g");while(i=d.call(v,r)){if(o=v[p],o>c&&(l.push(r.slice(c,i.index)),i[m]>1&&i.index=h))break;v[p]===i.index&&v[p]++}return c===r[m]?!s&&v.test("")||l.push(""):l.push(r.slice(c)),l[m]>h?l.slice(0,h):l}:"0"[h](void 0,0)[m]?function(t,e){return void 0===t&&0===e?[]:n.call(this,t,e)}:n,[function(n,a){var r=t(this),i=void 0==n?void 0:n[e];return void 0!==i?i.call(n,r,a):y.call(String(r),n,a)},function(t,e){var a=u(y,t,this,e,y!==n);if(a.done)return a.value;var d=r(t),f=String(this),h=i(d,RegExp),m=d.unicode,p=(d.ignoreCase?"i":"")+(d.multiline?"m":"")+(d.unicode?"u":"")+(v?"y":"g"),g=new h(v?d:"^(?:"+d.source+")",p),b=void 0===e?_:e>>>0;if(0===b)return[];if(0===f.length)return null===l(g,f)?[f]:[];var M=0,k=0,w=[];while(k=2&&t<=4?e[1]:e[2]},translate:function(t,n,a){var r=e.words[a];return 1===a.length?n?r[0]:r[1]:t+" "+e.correctGrammaticalCase(t,r)}},n=t.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){var t=["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"];return t[this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",ss:e.translate,m:e.translate,mm:e.translate,h:e.translate,hh:e.translate,d:"dan",dd:e.translate,M:"mjesec",MM:e.translate,y:"godinu",yy:e.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}});return n})},"294c":function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},"29f3":function(t,e){var n=Object.prototype,a=n.toString;function r(t){return a.call(t)}t.exports=r},"2aba":function(t,e,n){var a=n("7726"),r=n("32e9"),i=n("69a8"),o=n("ca5a")("src"),s=n("fa5b"),l="toString",d=(""+s).split(l);n("8378").inspectSource=function(t){return s.call(t)},(t.exports=function(t,e,n,s){var l="function"==typeof n;l&&(i(n,"name")||r(n,"name",e)),t[e]!==n&&(l&&(i(n,o)||r(n,o,t[e]?""+t[e]:d.join(String(e)))),t===a?t[e]=n:s?t[e]?t[e]=n:r(t,e,n):(delete t[e],r(t,e,n)))})(Function.prototype,l,function(){return"function"==typeof this&&this[o]||s.call(this)})},"2aeb":function(t,e,n){var a=n("cb7c"),r=n("1495"),i=n("e11e"),o=n("613b")("IE_PROTO"),s=function(){},l="prototype",d=function(){var t,e=n("230e")("iframe"),a=i.length,r="<",o=">";e.style.display="none",n("fab2").appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(r+"script"+o+"document.F=Object"+r+"/script"+o),t.close(),d=t.F;while(a--)delete d[l][i[a]];return d()};t.exports=Object.create||function(t,e){var n;return null!==t?(s[l]=a(t),n=new s,s[l]=null,n[o]=t):n=d(),void 0===e?n:r(n,e)}},"2b0e":function(t,e,n){"use strict";(function(t){ -/*! - * Vue.js v2.6.10 - * (c) 2014-2019 Evan You - * Released under the MIT License. - */ -var n=Object.freeze({});function a(t){return void 0===t||null===t}function r(t){return void 0!==t&&null!==t}function i(t){return!0===t}function o(t){return!1===t}function s(t){return"string"===typeof t||"number"===typeof t||"symbol"===typeof t||"boolean"===typeof t}function l(t){return null!==t&&"object"===typeof t}var d=Object.prototype.toString;function u(t){return"[object Object]"===d.call(t)}function c(t){return"[object RegExp]"===d.call(t)}function f(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function h(t){return r(t)&&"function"===typeof t.then&&"function"===typeof t.catch}function m(t){return null==t?"":Array.isArray(t)||u(t)&&t.toString===d?JSON.stringify(t,null,2):String(t)}function p(t){var e=parseFloat(t);return isNaN(e)?t:e}function _(t,e){for(var n=Object.create(null),a=t.split(","),r=0;r-1)return t.splice(n,1)}}var g=Object.prototype.hasOwnProperty;function b(t,e){return g.call(t,e)}function M(t){var e=Object.create(null);return function(n){var a=e[n];return a||(e[n]=t(n))}}var k=/-(\w)/g,w=M(function(t){return t.replace(k,function(t,e){return e?e.toUpperCase():""})}),x=M(function(t){return t.charAt(0).toUpperCase()+t.slice(1)}),L=/\B([A-Z])/g,Y=M(function(t){return t.replace(L,"-$1").toLowerCase()});function D(t,e){function n(n){var a=arguments.length;return a?a>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function S(t,e){return t.bind(e)}var T=Function.prototype.bind?S:D;function O(t,e){e=e||0;var n=t.length-e,a=new Array(n);while(n--)a[n]=t[n+e];return a}function H(t,e){for(var n in e)t[n]=e[n];return t}function A(t){for(var e={},n=0;n0,nt=K&&K.indexOf("edge/")>0,at=(K&&K.indexOf("android"),K&&/iphone|ipad|ipod|ios/.test(K)||"ios"===Z),rt=(K&&/chrome\/\d+/.test(K),K&&/phantomjs/.test(K),K&&K.match(/firefox\/(\d+)/)),it={}.watch,ot=!1;if(X)try{var st={};Object.defineProperty(st,"passive",{get:function(){ot=!0}}),window.addEventListener("test-passive",null,st)}catch(wo){}var lt=function(){return void 0===G&&(G=!X&&!Q&&"undefined"!==typeof t&&(t["process"]&&"server"===t["process"].env.VUE_ENV)),G},dt=X&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ut(t){return"function"===typeof t&&/native code/.test(t.toString())}var ct,ft="undefined"!==typeof Symbol&&ut(Symbol)&&"undefined"!==typeof Reflect&&ut(Reflect.ownKeys);ct="undefined"!==typeof Set&&ut(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var ht=P,mt=0,pt=function(){this.id=mt++,this.subs=[]};pt.prototype.addSub=function(t){this.subs.push(t)},pt.prototype.removeSub=function(t){y(this.subs,t)},pt.prototype.depend=function(){pt.target&&pt.target.addDep(this)},pt.prototype.notify=function(){var t=this.subs.slice();for(var e=0,n=t.length;e-1)if(i&&!b(r,"default"))o=!1;else if(""===o||o===Y(t)){var l=te(String,r.type);(l<0||s0&&(o=De(o,(e||"")+"_"+n),Ye(o[0])&&Ye(d)&&(u[l]=kt(d.text+o[0].text),o.shift()),u.push.apply(u,o)):s(o)?Ye(d)?u[l]=kt(d.text+o):""!==o&&u.push(kt(o)):Ye(o)&&Ye(d)?u[l]=kt(d.text+o.text):(i(t._isVList)&&r(o.tag)&&a(o.key)&&r(e)&&(o.key="__vlist"+e+"_"+n+"__"),u.push(o)));return u}function Se(t){var e=t.$options.provide;e&&(t._provided="function"===typeof e?e.call(t):e)}function Te(t){var e=Oe(t.$options.inject,t);e&&(Tt(!1),Object.keys(e).forEach(function(n){jt(t,n,e[n])}),Tt(!0))}function Oe(t,e){if(t){for(var n=Object.create(null),a=ft?Reflect.ownKeys(t):Object.keys(t),r=0;r0,o=t?!!t.$stable:!i,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(o&&a&&a!==n&&s===a.$key&&!i&&!a.$hasNormal)return a;for(var l in r={},t)t[l]&&"$"!==l[0]&&(r[l]=je(e,l,t[l]))}else r={};for(var d in e)d in r||(r[d]=Ce(e,d));return t&&Object.isExtensible(t)&&(t._normalized=r),B(r,"$stable",o),B(r,"$key",s),B(r,"$hasNormal",i),r}function je(t,e,n){var a=function(){var t=arguments.length?n.apply(null,arguments):n({});return t=t&&"object"===typeof t&&!Array.isArray(t)?[t]:Le(t),t&&(0===t.length||1===t.length&&t[0].isComment)?void 0:t};return n.proxy&&Object.defineProperty(t,e,{get:a,enumerable:!0,configurable:!0}),a}function Ce(t,e){return function(){return t[e]}}function ze(t,e){var n,a,i,o,s;if(Array.isArray(t)||"string"===typeof t)for(n=new Array(t.length),a=0,i=t.length;a1?O(n):n;for(var a=O(arguments,1),r='event handler for "'+t+'"',i=0,o=n.length;idocument.createEvent("Event").timeStamp&&(Gn=function(){return qn.now()})}function Xn(){var t,e;for(Jn=Gn(),Un=!0,Wn.sort(function(t,e){return t.id-e.id}),Bn=0;BnBn&&Wn[n].id>t.id)n--;Wn.splice(n+1,0,t)}else Wn.push(t);Vn||(Vn=!0,me(Xn))}}var ea=0,na=function(t,e,n,a,r){this.vm=t,r&&(t._watcher=this),t._watchers.push(this),a?(this.deep=!!a.deep,this.user=!!a.user,this.lazy=!!a.lazy,this.sync=!!a.sync,this.before=a.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++ea,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new ct,this.newDepIds=new ct,this.expression="","function"===typeof e?this.getter=e:(this.getter=J(e),this.getter||(this.getter=P)),this.value=this.lazy?void 0:this.get()};na.prototype.get=function(){var t;vt(this);var e=this.vm;try{t=this.getter.call(e,e)}catch(wo){if(!this.user)throw wo;ee(wo,e,'getter for watcher "'+this.expression+'"')}finally{this.deep&&_e(t),yt(),this.cleanupDeps()}return t},na.prototype.addDep=function(t){var e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this))},na.prototype.cleanupDeps=function(){var t=this.deps.length;while(t--){var e=this.deps[t];this.newDepIds.has(e.id)||e.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},na.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():ta(this)},na.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||l(t)||this.deep){var e=this.value;if(this.value=t,this.user)try{this.cb.call(this.vm,t,e)}catch(wo){ee(wo,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,t,e)}}},na.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},na.prototype.depend=function(){var t=this.deps.length;while(t--)this.deps[t].depend()},na.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||y(this.vm._watchers,this);var t=this.deps.length;while(t--)this.deps[t].removeSub(this);this.active=!1}};var aa={enumerable:!0,configurable:!0,get:P,set:P};function ra(t,e,n){aa.get=function(){return this[e][n]},aa.set=function(t){this[e][n]=t},Object.defineProperty(t,n,aa)}function ia(t){t._watchers=[];var e=t.$options;e.props&&oa(t,e.props),e.methods&&ma(t,e.methods),e.data?sa(t):Pt(t._data={},!0),e.computed&&ua(t,e.computed),e.watch&&e.watch!==it&&pa(t,e.watch)}function oa(t,e){var n=t.$options.propsData||{},a=t._props={},r=t.$options._propKeys=[],i=!t.$parent;i||Tt(!1);var o=function(i){r.push(i);var o=Xt(i,e,n,t);jt(a,i,o),i in t||ra(t,"_props",i)};for(var s in e)o(s);Tt(!0)}function sa(t){var e=t.$options.data;e=t._data="function"===typeof e?la(e,t):e||{},u(e)||(e={});var n=Object.keys(e),a=t.$options.props,r=(t.$options.methods,n.length);while(r--){var i=n[r];0,a&&b(a,i)||U(i)||ra(t,"_data",i)}Pt(e,!0)}function la(t,e){vt();try{return t.call(e,e)}catch(wo){return ee(wo,e,"data()"),{}}finally{yt()}}var da={lazy:!0};function ua(t,e){var n=t._computedWatchers=Object.create(null),a=lt();for(var r in e){var i=e[r],o="function"===typeof i?i:i.get;0,a||(n[r]=new na(t,o||P,P,da)),r in t||ca(t,r,i)}}function ca(t,e,n){var a=!lt();"function"===typeof n?(aa.get=a?fa(e):ha(n),aa.set=P):(aa.get=n.get?a&&!1!==n.cache?fa(e):ha(n.get):P,aa.set=n.set||P),Object.defineProperty(t,e,aa)}function fa(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),pt.target&&e.depend(),e.value}}function ha(t){return function(){return t.call(this,this)}}function ma(t,e){t.$options.props;for(var n in e)t[n]="function"!==typeof e[n]?P:T(e[n],t)}function pa(t,e){for(var n in e){var a=e[n];if(Array.isArray(a))for(var r=0;r-1)return this;var n=O(arguments,1);return n.unshift(this),"function"===typeof t.install?t.install.apply(t,n):"function"===typeof t&&t.apply(null,n),e.push(t),this}}function La(t){t.mixin=function(t){return this.options=Gt(this.options,t),this}}function Ya(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,a=n.cid,r=t._Ctor||(t._Ctor={});if(r[a])return r[a];var i=t.name||n.options.name;var o=function(t){this._init(t)};return o.prototype=Object.create(n.prototype),o.prototype.constructor=o,o.cid=e++,o.options=Gt(n.options,t),o["super"]=n,o.options.props&&Da(o),o.options.computed&&Sa(o),o.extend=n.extend,o.mixin=n.mixin,o.use=n.use,W.forEach(function(t){o[t]=n[t]}),i&&(o.options.components[i]=o),o.superOptions=n.options,o.extendOptions=t,o.sealedOptions=H({},o.options),r[a]=o,o}}function Da(t){var e=t.options.props;for(var n in e)ra(t.prototype,"_props",n)}function Sa(t){var e=t.options.computed;for(var n in e)ca(t.prototype,n,e[n])}function Ta(t){W.forEach(function(e){t[e]=function(t,n){return n?("component"===e&&u(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"===typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}})}function Oa(t){return t&&(t.Ctor.options.name||t.tag)}function Ha(t,e){return Array.isArray(t)?t.indexOf(e)>-1:"string"===typeof t?t.split(",").indexOf(e)>-1:!!c(t)&&t.test(e)}function Aa(t,e){var n=t.cache,a=t.keys,r=t._vnode;for(var i in n){var o=n[i];if(o){var s=Oa(o.componentOptions);s&&!e(s)&&Pa(n,i,a,r)}}}function Pa(t,e,n,a){var r=t[e];!r||a&&r.tag===a.tag||r.componentInstance.$destroy(),t[e]=null,y(n,e)}ga(wa),va(wa),Tn(wa),Pn(wa),yn(wa);var ja=[String,RegExp,Array],Ca={name:"keep-alive",abstract:!0,props:{include:ja,exclude:ja,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)Pa(this.cache,t,this.keys)},mounted:function(){var t=this;this.$watch("include",function(e){Aa(t,function(t){return Ha(e,t)})}),this.$watch("exclude",function(e){Aa(t,function(t){return!Ha(e,t)})})},render:function(){var t=this.$slots.default,e=wn(t),n=e&&e.componentOptions;if(n){var a=Oa(n),r=this,i=r.include,o=r.exclude;if(i&&(!a||!Ha(i,a))||o&&a&&Ha(o,a))return e;var s=this,l=s.cache,d=s.keys,u=null==e.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):e.key;l[u]?(e.componentInstance=l[u].componentInstance,y(d,u),d.push(u)):(l[u]=e,d.push(u),this.max&&d.length>parseInt(this.max)&&Pa(l,d[0],d,this._vnode)),e.data.keepAlive=!0}return e||t&&t[0]}},za={KeepAlive:Ca};function Ea(t){var e={get:function(){return N}};Object.defineProperty(t,"config",e),t.util={warn:ht,extend:H,mergeOptions:Gt,defineReactive:jt},t.set=Ct,t.delete=zt,t.nextTick=me,t.observable=function(t){return Pt(t),t},t.options=Object.create(null),W.forEach(function(e){t.options[e+"s"]=Object.create(null)}),t.options._base=t,H(t.options.components,za),xa(t),La(t),Ya(t),Ta(t)}Ea(wa),Object.defineProperty(wa.prototype,"$isServer",{get:lt}),Object.defineProperty(wa.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(wa,"FunctionalRenderContext",{value:Qe}),wa.version="2.6.10";var Fa=_("style,class"),Ia=_("input,textarea,option,select,progress"),Wa=function(t,e,n){return"value"===n&&Ia(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},Ra=_("contenteditable,draggable,spellcheck"),Na=_("events,caret,typing,plaintext-only"),Va=function(t,e){return Ga(e)||"false"===e?"false":"contenteditable"===t&&Na(e)?e:"true"},Ua=_("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Ba="http://www.w3.org/1999/xlink",$a=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Ja=function(t){return $a(t)?t.slice(6,t.length):""},Ga=function(t){return null==t||!1===t};function qa(t){var e=t.data,n=t,a=t;while(r(a.componentInstance))a=a.componentInstance._vnode,a&&a.data&&(e=Xa(a.data,e));while(r(n=n.parent))n&&n.data&&(e=Xa(e,n.data));return Qa(e.staticClass,e.class)}function Xa(t,e){return{staticClass:Za(t.staticClass,e.staticClass),class:r(t.class)?[t.class,e.class]:e.class}}function Qa(t,e){return r(t)||r(e)?Za(t,Ka(e)):""}function Za(t,e){return t?e?t+" "+e:t:e||""}function Ka(t){return Array.isArray(t)?tr(t):l(t)?er(t):"string"===typeof t?t:""}function tr(t){for(var e,n="",a=0,i=t.length;a-1?sr[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:sr[t]=/HTMLUnknownElement/.test(e.toString())}var dr=_("text,number,password,search,email,tel,url");function ur(t){if("string"===typeof t){var e=document.querySelector(t);return e||document.createElement("div")}return t}function cr(t,e){var n=document.createElement(t);return"select"!==t?n:(e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)}function fr(t,e){return document.createElementNS(nr[t],e)}function hr(t){return document.createTextNode(t)}function mr(t){return document.createComment(t)}function pr(t,e,n){t.insertBefore(e,n)}function _r(t,e){t.removeChild(e)}function vr(t,e){t.appendChild(e)}function yr(t){return t.parentNode}function gr(t){return t.nextSibling}function br(t){return t.tagName}function Mr(t,e){t.textContent=e}function kr(t,e){t.setAttribute(e,"")}var wr=Object.freeze({createElement:cr,createElementNS:fr,createTextNode:hr,createComment:mr,insertBefore:pr,removeChild:_r,appendChild:vr,parentNode:yr,nextSibling:gr,tagName:br,setTextContent:Mr,setStyleScope:kr}),xr={create:function(t,e){Lr(e)},update:function(t,e){t.data.ref!==e.data.ref&&(Lr(t,!0),Lr(e))},destroy:function(t){Lr(t,!0)}};function Lr(t,e){var n=t.data.ref;if(r(n)){var a=t.context,i=t.componentInstance||t.elm,o=a.$refs;e?Array.isArray(o[n])?y(o[n],i):o[n]===i&&(o[n]=void 0):t.data.refInFor?Array.isArray(o[n])?o[n].indexOf(i)<0&&o[n].push(i):o[n]=[i]:o[n]=i}}var Yr=new gt("",{},[]),Dr=["create","activate","update","remove","destroy"];function Sr(t,e){return t.key===e.key&&(t.tag===e.tag&&t.isComment===e.isComment&&r(t.data)===r(e.data)&&Tr(t,e)||i(t.isAsyncPlaceholder)&&t.asyncFactory===e.asyncFactory&&a(e.asyncFactory.error))}function Tr(t,e){if("input"!==t.tag)return!0;var n,a=r(n=t.data)&&r(n=n.attrs)&&n.type,i=r(n=e.data)&&r(n=n.attrs)&&n.type;return a===i||dr(a)&&dr(i)}function Or(t,e,n){var a,i,o={};for(a=e;a<=n;++a)i=t[a].key,r(i)&&(o[i]=a);return o}function Hr(t){var e,n,o={},l=t.modules,d=t.nodeOps;for(e=0;ep?(c=a(n[y+1])?null:n[y+1].elm,w(t,c,n,m,y,i)):m>y&&L(t,e,f,p)}function S(t,e,n,a){for(var i=n;i-1?Nr(t,e,n):Ua(e)?Ga(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):Ra(e)?t.setAttribute(e,Va(e,n)):$a(e)?Ga(n)?t.removeAttributeNS(Ba,Ja(e)):t.setAttributeNS(Ba,e,n):Nr(t,e,n)}function Nr(t,e,n){if(Ga(n))t.removeAttribute(e);else{if(tt&&!et&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var a=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",a)};t.addEventListener("input",a),t.__ieph=!0}t.setAttribute(e,n)}}var Vr={create:Wr,update:Wr};function Ur(t,e){var n=e.elm,i=e.data,o=t.data;if(!(a(i.staticClass)&&a(i.class)&&(a(o)||a(o.staticClass)&&a(o.class)))){var s=qa(e),l=n._transitionClasses;r(l)&&(s=Za(s,Ka(l))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}var Br,$r={create:Ur,update:Ur},Jr="__r",Gr="__c";function qr(t){if(r(t[Jr])){var e=tt?"change":"input";t[e]=[].concat(t[Jr],t[e]||[]),delete t[Jr]}r(t[Gr])&&(t.change=[].concat(t[Gr],t.change||[]),delete t[Gr])}function Xr(t,e,n){var a=Br;return function r(){var i=e.apply(null,arguments);null!==i&&Kr(t,r,n,a)}}var Qr=oe&&!(rt&&Number(rt[1])<=53);function Zr(t,e,n,a){if(Qr){var r=Jn,i=e;e=i._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=r||t.timeStamp<=0||t.target.ownerDocument!==document)return i.apply(this,arguments)}}Br.addEventListener(t,e,ot?{capture:n,passive:a}:n)}function Kr(t,e,n,a){(a||Br).removeEventListener(t,e._wrapper||e,n)}function ti(t,e){if(!a(t.data.on)||!a(e.data.on)){var n=e.data.on||{},r=t.data.on||{};Br=e.elm,qr(n),be(n,r,Zr,Kr,Xr,e.context),Br=void 0}}var ei,ni={create:ti,update:ti};function ai(t,e){if(!a(t.data.domProps)||!a(e.data.domProps)){var n,i,o=e.elm,s=t.data.domProps||{},l=e.data.domProps||{};for(n in r(l.__ob__)&&(l=e.data.domProps=H({},l)),s)n in l||(o[n]="");for(n in l){if(i=l[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),i===s[n])continue;1===o.childNodes.length&&o.removeChild(o.childNodes[0])}if("value"===n&&"PROGRESS"!==o.tagName){o._value=i;var d=a(i)?"":String(i);ri(o,d)&&(o.value=d)}else if("innerHTML"===n&&rr(o.tagName)&&a(o.innerHTML)){ei=ei||document.createElement("div"),ei.innerHTML=""+i+"";var u=ei.firstChild;while(o.firstChild)o.removeChild(o.firstChild);while(u.firstChild)o.appendChild(u.firstChild)}else if(i!==s[n])try{o[n]=i}catch(wo){}}}}function ri(t,e){return!t.composing&&("OPTION"===t.tagName||ii(t,e)||oi(t,e))}function ii(t,e){var n=!0;try{n=document.activeElement!==t}catch(wo){}return n&&t.value!==e}function oi(t,e){var n=t.value,a=t._vModifiers;if(r(a)){if(a.number)return p(n)!==p(e);if(a.trim)return n.trim()!==e.trim()}return n!==e}var si={create:ai,update:ai},li=M(function(t){var e={},n=/;(?![^(]*\))/g,a=/:(.+)/;return t.split(n).forEach(function(t){if(t){var n=t.split(a);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e});function di(t){var e=ui(t.style);return t.staticStyle?H(t.staticStyle,e):e}function ui(t){return Array.isArray(t)?A(t):"string"===typeof t?li(t):t}function ci(t,e){var n,a={};if(e){var r=t;while(r.componentInstance)r=r.componentInstance._vnode,r&&r.data&&(n=di(r.data))&&H(a,n)}(n=di(t.data))&&H(a,n);var i=t;while(i=i.parent)i.data&&(n=di(i.data))&&H(a,n);return a}var fi,hi=/^--/,mi=/\s*!important$/,pi=function(t,e,n){if(hi.test(e))t.style.setProperty(e,n);else if(mi.test(n))t.style.setProperty(Y(e),n.replace(mi,""),"important");else{var a=vi(e);if(Array.isArray(n))for(var r=0,i=n.length;r-1?e.split(bi).forEach(function(e){return t.classList.add(e)}):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function ki(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(bi).forEach(function(e){return t.classList.remove(e)}):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{var n=" "+(t.getAttribute("class")||"")+" ",a=" "+e+" ";while(n.indexOf(a)>=0)n=n.replace(a," ");n=n.trim(),n?t.setAttribute("class",n):t.removeAttribute("class")}}function wi(t){if(t){if("object"===typeof t){var e={};return!1!==t.css&&H(e,xi(t.name||"v")),H(e,t),e}return"string"===typeof t?xi(t):void 0}}var xi=M(function(t){return{enterClass:t+"-enter",enterToClass:t+"-enter-to",enterActiveClass:t+"-enter-active",leaveClass:t+"-leave",leaveToClass:t+"-leave-to",leaveActiveClass:t+"-leave-active"}}),Li=X&&!et,Yi="transition",Di="animation",Si="transition",Ti="transitionend",Oi="animation",Hi="animationend";Li&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Si="WebkitTransition",Ti="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Oi="WebkitAnimation",Hi="webkitAnimationEnd"));var Ai=X?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function Pi(t){Ai(function(){Ai(t)})}function ji(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),Mi(t,e))}function Ci(t,e){t._transitionClasses&&y(t._transitionClasses,e),ki(t,e)}function zi(t,e,n){var a=Fi(t,e),r=a.type,i=a.timeout,o=a.propCount;if(!r)return n();var s=r===Yi?Ti:Hi,l=0,d=function(){t.removeEventListener(s,u),n()},u=function(e){e.target===t&&++l>=o&&d()};setTimeout(function(){l0&&(n=Yi,u=o,c=i.length):e===Di?d>0&&(n=Di,u=d,c=l.length):(u=Math.max(o,d),n=u>0?o>d?Yi:Di:null,c=n?n===Yi?i.length:l.length:0);var f=n===Yi&&Ei.test(a[Si+"Property"]);return{type:n,timeout:u,propCount:c,hasTransform:f}}function Ii(t,e){while(t.length1}function Bi(t,e){!0!==e.data.show&&Ri(e)}var $i=X?{create:Bi,activate:Bi,remove:function(t,e){!0!==t.data.show?Ni(t,e):e()}}:{},Ji=[Vr,$r,ni,si,gi,$i],Gi=Ji.concat(Ir),qi=Hr({nodeOps:wr,modules:Gi});et&&document.addEventListener("selectionchange",function(){var t=document.activeElement;t&&t.vmodel&&ao(t,"input")});var Xi={inserted:function(t,e,n,a){"select"===n.tag?(a.elm&&!a.elm._vOptions?Me(n,"postpatch",function(){Xi.componentUpdated(t,e,n)}):Qi(t,e,n.context),t._vOptions=[].map.call(t.options,to)):("textarea"===n.tag||dr(t.type))&&(t._vModifiers=e.modifiers,e.modifiers.lazy||(t.addEventListener("compositionstart",eo),t.addEventListener("compositionend",no),t.addEventListener("change",no),et&&(t.vmodel=!0)))},componentUpdated:function(t,e,n){if("select"===n.tag){Qi(t,e,n.context);var a=t._vOptions,r=t._vOptions=[].map.call(t.options,to);if(r.some(function(t,e){return!z(t,a[e])})){var i=t.multiple?e.value.some(function(t){return Ki(t,r)}):e.value!==e.oldValue&&Ki(e.value,r);i&&ao(t,"change")}}}};function Qi(t,e,n){Zi(t,e,n),(tt||nt)&&setTimeout(function(){Zi(t,e,n)},0)}function Zi(t,e,n){var a=e.value,r=t.multiple;if(!r||Array.isArray(a)){for(var i,o,s=0,l=t.options.length;s-1,o.selected!==i&&(o.selected=i);else if(z(to(o),a))return void(t.selectedIndex!==s&&(t.selectedIndex=s));r||(t.selectedIndex=-1)}}function Ki(t,e){return e.every(function(e){return!z(e,t)})}function to(t){return"_value"in t?t._value:t.value}function eo(t){t.target.composing=!0}function no(t){t.target.composing&&(t.target.composing=!1,ao(t.target,"input"))}function ao(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function ro(t){return!t.componentInstance||t.data&&t.data.transition?t:ro(t.componentInstance._vnode)}var io={bind:function(t,e,n){var a=e.value;n=ro(n);var r=n.data&&n.data.transition,i=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;a&&r?(n.data.show=!0,Ri(n,function(){t.style.display=i})):t.style.display=a?i:"none"},update:function(t,e,n){var a=e.value,r=e.oldValue;if(!a!==!r){n=ro(n);var i=n.data&&n.data.transition;i?(n.data.show=!0,a?Ri(n,function(){t.style.display=t.__vOriginalDisplay}):Ni(n,function(){t.style.display="none"})):t.style.display=a?t.__vOriginalDisplay:"none"}},unbind:function(t,e,n,a,r){r||(t.style.display=t.__vOriginalDisplay)}},oo={model:Xi,show:io},so={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function lo(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?lo(wn(e.children)):t}function uo(t){var e={},n=t.$options;for(var a in n.propsData)e[a]=t[a];var r=n._parentListeners;for(var i in r)e[w(i)]=r[i];return e}function co(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}function fo(t){while(t=t.parent)if(t.data.transition)return!0}function ho(t,e){return e.key===t.key&&e.tag===t.tag}var mo=function(t){return t.tag||kn(t)},po=function(t){return"show"===t.name},_o={name:"transition",props:so,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(mo),n.length)){0;var a=this.mode;0;var r=n[0];if(fo(this.$vnode))return r;var i=lo(r);if(!i)return r;if(this._leaving)return co(t,r);var o="__transition-"+this._uid+"-";i.key=null==i.key?i.isComment?o+"comment":o+i.tag:s(i.key)?0===String(i.key).indexOf(o)?i.key:o+i.key:i.key;var l=(i.data||(i.data={})).transition=uo(this),d=this._vnode,u=lo(d);if(i.data.directives&&i.data.directives.some(po)&&(i.data.show=!0),u&&u.data&&!ho(i,u)&&!kn(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var c=u.data.transition=H({},l);if("out-in"===a)return this._leaving=!0,Me(c,"afterLeave",function(){e._leaving=!1,e.$forceUpdate()}),co(t,r);if("in-out"===a){if(kn(i))return d;var f,h=function(){f()};Me(l,"afterEnter",h),Me(l,"enterCancelled",h),Me(c,"delayLeave",function(t){f=t})}}return r}}},vo=H({tag:String,moveClass:String},so);delete vo.mode;var yo={props:vo,beforeMount:function(){var t=this,e=this._update;this._update=function(n,a){var r=Hn(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,r(),e.call(t,n,a)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),a=this.prevChildren=this.children,r=this.$slots.default||[],i=this.children=[],o=uo(this),s=0;s=20?"ste":"de")},week:{dow:1,doy:4}});return e})},"2d00":function(t,e){t.exports=!1},"2d95":function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},"2e8c":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",ss:"%d фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}});return e})},"2ead":function(t,e,n){(function(t){(function(t,n){n(e)})(0,function(e){"use strict";var n="undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:{};function a(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function r(t,e){return e={exports:{}},t(e,e.exports),e.exports}var i=r(function(t,e){var r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t}; -//! moment.js -//! version : 2.19.1 -//! authors : Tim Wood, Iskren Chernev, Moment.js contributors -//! license : MIT -//! momentjs.com -//! moment.js -//! version : 2.19.1 -//! authors : Tim Wood, Iskren Chernev, Moment.js contributors -//! license : MIT -//! momentjs.com -(function(n,a){"object"===r(e)?t.exports=a():n.moment=a()})(n,function(){var e,n;function i(){return e.apply(null,arguments)}function o(t){e=t}function s(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function l(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function d(t){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(t).length;var e;for(e in t)if(t.hasOwnProperty(e))return!1;return!0}function u(t){return void 0===t}function c(t){return"number"===typeof t||"[object Number]"===Object.prototype.toString.call(t)}function f(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function h(t,e){var n,a=[];for(n=0;n>>0,a=0;a0)for(n=0;n0?"future":"past"];return j(n)?n(e):n.replace(/%s/i,e)}var X={};function Q(t,e){var n=t.toLowerCase();X[n]=X[n+"s"]=X[e]=t}function Z(t){return"string"===typeof t?X[t]||X[t.toLowerCase()]:void 0}function K(t){var e,n,a={};for(n in t)m(t,n)&&(e=Z(n),e&&(a[e]=t[n]));return a}var tt={};function et(t,e){tt[t]=e}function nt(t){var e=[];for(var n in t)e.push({unit:n,priority:tt[n]});return e.sort(function(t,e){return t.priority-e.priority}),e}function at(t,e,n){var a=""+Math.abs(t),r=e-a.length,i=t>=0;return(i?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+a}var rt=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,it=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,ot={},st={};function lt(t,e,n,a){var r=a;"string"===typeof a&&(r=function(){return this[a]()}),t&&(st[t]=r),e&&(st[e[0]]=function(){return at(r.apply(this,arguments),e[1],e[2])}),n&&(st[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),t)})}function dt(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function ut(t){var e,n,a=t.match(rt);for(e=0,n=a.length;e=0&&it.test(t))t=t.replace(it,a),it.lastIndex=0,n-=1;return t}var ht=/\d/,mt=/\d\d/,pt=/\d{3}/,_t=/\d{4}/,vt=/[+-]?\d{6}/,yt=/\d\d?/,gt=/\d\d\d\d?/,bt=/\d\d\d\d\d\d?/,Mt=/\d{1,3}/,kt=/\d{1,4}/,wt=/[+-]?\d{1,6}/,xt=/\d+/,Lt=/[+-]?\d+/,Yt=/Z|[+-]\d\d:?\d\d/gi,Dt=/Z|[+-]\d\d(?::?\d\d)?/gi,St=/[+-]?\d+(\.\d{1,3})?/,Tt=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Ot={};function Ht(t,e,n){Ot[t]=j(e)?e:function(t,a){return t&&n?n:e}}function At(t,e){return m(Ot,t)?Ot[t](e._strict,e._locale):new RegExp(Pt(t))}function Pt(t){return jt(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,a,r){return e||n||a||r}))}function jt(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var Ct={};function zt(t,e){var n,a=e;for("string"===typeof t&&(t=[t]),c(e)&&(a=function(t,n){n[e]=D(t)}),n=0;n68?1900:2e3)};var Xt,Qt=Kt("FullYear",!0);function Zt(){return qt(this.year())}function Kt(t,e){return function(n){return null!=n?(ee(this,t,n),i.updateOffset(this,e),this):te(this,t)}}function te(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function ee(t,e,n){t.isValid()&&!isNaN(n)&&("FullYear"===e&&qt(t.year())?t._d["set"+(t._isUTC?"UTC":"")+e](n,t.month(),ie(n,t.month())):t._d["set"+(t._isUTC?"UTC":"")+e](n))}function ne(t){return t=Z(t),j(this[t])?this[t]():this}function ae(t,e){if("object"===("undefined"===typeof t?"undefined":r(t))){t=K(t);for(var n=nt(t),a=0;a=0&&isFinite(s.getFullYear())&&s.setFullYear(t),s}function ke(t){var e=new Date(Date.UTC.apply(null,arguments));return t<100&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function we(t,e,n){var a=7+e-n,r=(7+ke(t,0,a).getUTCDay()-e)%7;return-r+a-1}function xe(t,e,n,a,r){var i,o,s=(7+n-a)%7,l=we(t,a,r),d=1+7*(e-1)+s+l;return d<=0?(i=t-1,o=Gt(i)+d):d>Gt(t)?(i=t+1,o=d-Gt(t)):(i=t,o=d),{year:i,dayOfYear:o}}function Le(t,e,n){var a,r,i=we(t.year(),e,n),o=Math.floor((t.dayOfYear()-i-1)/7)+1;return o<1?(r=t.year()-1,a=o+Ye(r,e,n)):o>Ye(t.year(),e,n)?(a=o-Ye(t.year(),e,n),r=t.year()+1):(r=t.year(),a=o),{week:a,year:r}}function Ye(t,e,n){var a=we(t,e,n),r=we(t+1,e,n);return(Gt(t)-a+r)/7}function De(t){return Le(t,this._week.dow,this._week.doy).week}lt("w",["ww",2],"wo","week"),lt("W",["WW",2],"Wo","isoWeek"),Q("week","w"),Q("isoWeek","W"),et("week",5),et("isoWeek",5),Ht("w",yt),Ht("ww",yt,mt),Ht("W",yt),Ht("WW",yt,mt),Et(["w","ww","W","WW"],function(t,e,n,a){e[a.substr(0,1)]=D(t)});var Se={dow:0,doy:6};function Te(){return this._week.dow}function Oe(){return this._week.doy}function He(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function Ae(t){var e=Le(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function Pe(t,e){return"string"!==typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"===typeof t?t:null):parseInt(t,10)}function je(t,e){return"string"===typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}lt("d",0,"do","day"),lt("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),lt("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),lt("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),lt("e",0,0,"weekday"),lt("E",0,0,"isoWeekday"),Q("day","d"),Q("weekday","e"),Q("isoWeekday","E"),et("day",11),et("weekday",11),et("isoWeekday",11),Ht("d",yt),Ht("e",yt),Ht("E",yt),Ht("dd",function(t,e){return e.weekdaysMinRegex(t)}),Ht("ddd",function(t,e){return e.weekdaysShortRegex(t)}),Ht("dddd",function(t,e){return e.weekdaysRegex(t)}),Et(["dd","ddd","dddd"],function(t,e,n,a){var r=n._locale.weekdaysParse(t,a,n._strict);null!=r?e.d=r:y(n).invalidWeekday=t}),Et(["d","e","E"],function(t,e,n,a){e[a]=D(t)});var Ce="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");function ze(t,e){return t?s(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]:s(this._weekdays)?this._weekdays:this._weekdays["standalone"]}var Ee="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");function Fe(t){return t?this._weekdaysShort[t.day()]:this._weekdaysShort}var Ie="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function We(t){return t?this._weekdaysMin[t.day()]:this._weekdaysMin}function Re(t,e,n){var a,r,i,o=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],a=0;a<7;++a)i=_([2e3,1]).day(a),this._minWeekdaysParse[a]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[a]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[a]=this.weekdays(i,"").toLocaleLowerCase();return n?"dddd"===e?(r=Xt.call(this._weekdaysParse,o),-1!==r?r:null):"ddd"===e?(r=Xt.call(this._shortWeekdaysParse,o),-1!==r?r:null):(r=Xt.call(this._minWeekdaysParse,o),-1!==r?r:null):"dddd"===e?(r=Xt.call(this._weekdaysParse,o),-1!==r?r:(r=Xt.call(this._shortWeekdaysParse,o),-1!==r?r:(r=Xt.call(this._minWeekdaysParse,o),-1!==r?r:null))):"ddd"===e?(r=Xt.call(this._shortWeekdaysParse,o),-1!==r?r:(r=Xt.call(this._weekdaysParse,o),-1!==r?r:(r=Xt.call(this._minWeekdaysParse,o),-1!==r?r:null))):(r=Xt.call(this._minWeekdaysParse,o),-1!==r?r:(r=Xt.call(this._weekdaysParse,o),-1!==r?r:(r=Xt.call(this._shortWeekdaysParse,o),-1!==r?r:null)))}function Ne(t,e,n){var a,r,i;if(this._weekdaysParseExact)return Re.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),a=0;a<7;a++){if(r=_([2e3,1]).day(a),n&&!this._fullWeekdaysParse[a]&&(this._fullWeekdaysParse[a]=new RegExp("^"+this.weekdays(r,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[a]=new RegExp("^"+this.weekdaysShort(r,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[a]=new RegExp("^"+this.weekdaysMin(r,"").replace(".",".?")+"$","i")),this._weekdaysParse[a]||(i="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[a]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[a].test(t))return a;if(n&&"ddd"===e&&this._shortWeekdaysParse[a].test(t))return a;if(n&&"dd"===e&&this._minWeekdaysParse[a].test(t))return a;if(!n&&this._weekdaysParse[a].test(t))return a}}function Ve(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Pe(t,this.localeData()),this.add(t-e,"d")):e}function Ue(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function Be(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=je(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7}var $e=Tt;function Je(t){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Ze.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(m(this,"_weekdaysRegex")||(this._weekdaysRegex=$e),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}var Ge=Tt;function qe(t){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Ze.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(m(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ge),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}var Xe=Tt;function Qe(t){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Ze.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(m(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Xe),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ze(){function t(t,e){return e.length-t.length}var e,n,a,r,i,o=[],s=[],l=[],d=[];for(e=0;e<7;e++)n=_([2e3,1]).day(e),a=this.weekdaysMin(n,""),r=this.weekdaysShort(n,""),i=this.weekdays(n,""),o.push(a),s.push(r),l.push(i),d.push(a),d.push(r),d.push(i);for(o.sort(t),s.sort(t),l.sort(t),d.sort(t),e=0;e<7;e++)s[e]=jt(s[e]),l[e]=jt(l[e]),d[e]=jt(d[e]);this._weekdaysRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function Ke(){return this.hours()%12||12}function tn(){return this.hours()||24}function en(t,e){lt(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function nn(t,e){return e._meridiemParse}function an(t){return"p"===(t+"").toLowerCase().charAt(0)}lt("H",["HH",2],0,"hour"),lt("h",["hh",2],0,Ke),lt("k",["kk",2],0,tn),lt("hmm",0,0,function(){return""+Ke.apply(this)+at(this.minutes(),2)}),lt("hmmss",0,0,function(){return""+Ke.apply(this)+at(this.minutes(),2)+at(this.seconds(),2)}),lt("Hmm",0,0,function(){return""+this.hours()+at(this.minutes(),2)}),lt("Hmmss",0,0,function(){return""+this.hours()+at(this.minutes(),2)+at(this.seconds(),2)}),en("a",!0),en("A",!1),Q("hour","h"),et("hour",13),Ht("a",nn),Ht("A",nn),Ht("H",yt),Ht("h",yt),Ht("k",yt),Ht("HH",yt,mt),Ht("hh",yt,mt),Ht("kk",yt,mt),Ht("hmm",gt),Ht("hmmss",bt),Ht("Hmm",gt),Ht("Hmmss",bt),zt(["H","HH"],Nt),zt(["k","kk"],function(t,e,n){var a=D(t);e[Nt]=24===a?0:a}),zt(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),zt(["h","hh"],function(t,e,n){e[Nt]=D(t),y(n).bigHour=!0}),zt("hmm",function(t,e,n){var a=t.length-2;e[Nt]=D(t.substr(0,a)),e[Vt]=D(t.substr(a)),y(n).bigHour=!0}),zt("hmmss",function(t,e,n){var a=t.length-4,r=t.length-2;e[Nt]=D(t.substr(0,a)),e[Vt]=D(t.substr(a,2)),e[Ut]=D(t.substr(r)),y(n).bigHour=!0}),zt("Hmm",function(t,e,n){var a=t.length-2;e[Nt]=D(t.substr(0,a)),e[Vt]=D(t.substr(a))}),zt("Hmmss",function(t,e,n){var a=t.length-4,r=t.length-2;e[Nt]=D(t.substr(0,a)),e[Vt]=D(t.substr(a,2)),e[Ut]=D(t.substr(r))});var rn=/[ap]\.?m?\.?/i;function on(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var sn,ln=Kt("Hours",!0),dn={calendar:F,longDateFormat:W,invalidDate:N,ordinal:U,dayOfMonthOrdinalParse:B,relativeTime:J,months:se,monthsShort:de,week:Se,weekdays:Ce,weekdaysMin:Ie,weekdaysShort:Ee,meridiemParse:rn},un={},cn={};function fn(t){return t?t.toLowerCase().replace("_","-"):t}function hn(t){var e,n,a,r,i=0;while(i0){if(a=mn(r.slice(0,e).join("-")),a)return a;if(n&&n.length>=e&&S(r,n,!0)>=e-1)break;e--}i++}return null}function mn(e){var n=null;if(!un[e]&&t&&t.exports)try{n=sn._abbr;var r=a;r("./locale/"+e),pn(n)}catch(i){}return un[e]}function pn(t,e){var n;return t&&(n=u(e)?yn(t):_n(t,e),n&&(sn=n)),sn._abbr}function _n(t,e){if(null!==e){var n=dn;if(e.abbr=t,null!=un[t])P("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=un[t]._config;else if(null!=e.parentLocale){if(null==un[e.parentLocale])return cn[e.parentLocale]||(cn[e.parentLocale]=[]),cn[e.parentLocale].push({name:t,config:e}),null;n=un[e.parentLocale]._config}return un[t]=new E(z(n,e)),cn[t]&&cn[t].forEach(function(t){_n(t.name,t.config)}),pn(t),un[t]}return delete un[t],null}function vn(t,e){if(null!=e){var n,a=dn;null!=un[t]&&(a=un[t]._config),e=z(a,e),n=new E(e),n.parentLocale=un[t],un[t]=n,pn(t)}else null!=un[t]&&(null!=un[t].parentLocale?un[t]=un[t].parentLocale:null!=un[t]&&delete un[t]);return un[t]}function yn(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return sn;if(!s(t)){if(e=mn(t),e)return e;t=[t]}return hn(t)}function gn(){return H(un)}function bn(t){var e,n=t._a;return n&&-2===y(t).overflow&&(e=n[Wt]<0||n[Wt]>11?Wt:n[Rt]<1||n[Rt]>ie(n[It],n[Wt])?Rt:n[Nt]<0||n[Nt]>24||24===n[Nt]&&(0!==n[Vt]||0!==n[Ut]||0!==n[Bt])?Nt:n[Vt]<0||n[Vt]>59?Vt:n[Ut]<0||n[Ut]>59?Ut:n[Bt]<0||n[Bt]>999?Bt:-1,y(t)._overflowDayOfYear&&(eRt)&&(e=Rt),y(t)._overflowWeeks&&-1===e&&(e=$t),y(t)._overflowWeekday&&-1===e&&(e=Jt),y(t).overflow=e),t}function Mn(t,e,n){return null!=t?t:null!=e?e:n}function kn(t){var e=new Date(i.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function wn(t){var e,n,a,r,i=[];if(!t._d){for(a=kn(t),t._w&&null==t._a[Rt]&&null==t._a[Wt]&&xn(t),null!=t._dayOfYear&&(r=Mn(t._a[It],a[It]),(t._dayOfYear>Gt(r)||0===t._dayOfYear)&&(y(t)._overflowDayOfYear=!0),n=ke(r,0,t._dayOfYear),t._a[Wt]=n.getUTCMonth(),t._a[Rt]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=i[e]=a[e];for(;e<7;e++)t._a[e]=i[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[Nt]&&0===t._a[Vt]&&0===t._a[Ut]&&0===t._a[Bt]&&(t._nextDay=!0,t._a[Nt]=0),t._d=(t._useUTC?ke:Me).apply(null,i),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Nt]=24),t._w&&"undefined"!==typeof t._w.d&&t._w.d!==t._d.getDay()&&(y(t).weekdayMismatch=!0)}}function xn(t){var e,n,a,r,i,o,s,l;if(e=t._w,null!=e.GG||null!=e.W||null!=e.E)i=1,o=4,n=Mn(e.GG,t._a[It],Le(qn(),1,4).year),a=Mn(e.W,1),r=Mn(e.E,1),(r<1||r>7)&&(l=!0);else{i=t._locale._week.dow,o=t._locale._week.doy;var d=Le(qn(),i,o);n=Mn(e.gg,t._a[It],d.year),a=Mn(e.w,d.week),null!=e.d?(r=e.d,(r<0||r>6)&&(l=!0)):null!=e.e?(r=e.e+i,(e.e<0||e.e>6)&&(l=!0)):r=i}a<1||a>Ye(n,i,o)?y(t)._overflowWeeks=!0:null!=l?y(t)._overflowWeekday=!0:(s=xe(n,a,r,i,o),t._a[It]=s.year,t._dayOfYear=s.dayOfYear)}var Ln=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Yn=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Dn=/Z|[+-]\d\d(?::?\d\d)?/,Sn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Tn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],On=/^\/?Date\((\-?\d+)/i;function Hn(t){var e,n,a,r,i,o,s=t._i,l=Ln.exec(s)||Yn.exec(s);if(l){for(y(t).iso=!0,e=0,n=Sn.length;e0&&y(t).unusedInput.push(o),s=s.slice(s.indexOf(n)+n.length),d+=n.length),st[r]?(n?y(t).empty=!1:y(t).unusedTokens.push(r),Ft(r,n,t)):t._strict&&!n&&y(t).unusedTokens.push(r);y(t).charsLeftOver=l-d,s.length>0&&y(t).unusedInput.push(s),t._a[Nt]<=12&&!0===y(t).bigHour&&t._a[Nt]>0&&(y(t).bigHour=void 0),y(t).parsedDateParts=t._a.slice(0),y(t).meridiem=t._meridiem,t._a[Nt]=Nn(t._locale,t._a[Nt],t._meridiem),wn(t),bn(t)}else In(t);else Hn(t)}function Nn(t,e,n){var a;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?(a=t.isPM(n),a&&e<12&&(e+=12),a||12!==e||(e=0),e):e}function Vn(t){var e,n,a,r,i;if(0===t._f.length)return y(t).invalidFormat=!0,void(t._d=new Date(NaN));for(r=0;rthis?this:t:b()});function Zn(t,e){var n,a;if(1===e.length&&s(e[0])&&(e=e[0]),!e.length)return qn();for(n=e[0],a=1;athis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ma(){if(!u(this._isDSTShifted))return this._isDSTShifted;var t={};if(k(t,this),t=$n(t),t._a){var e=t._isUTC?_(t._a):qn(t._a);this._isDSTShifted=this.isValid()&&S(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function ka(){return!!this.isValid()&&!this._isUTC}function wa(){return!!this.isValid()&&this._isUTC}function xa(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}i.updateOffset=function(){};var La=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Ya=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Da(t,e){var n,a,i,o=t,s=null;return sa(t)?o={ms:t._milliseconds,d:t._days,M:t._months}:c(t)?(o={},e?o[e]=t:o.milliseconds=t):(s=La.exec(t))?(n="-"===s[1]?-1:1,o={y:0,d:D(s[Rt])*n,h:D(s[Nt])*n,m:D(s[Vt])*n,s:D(s[Ut])*n,ms:D(la(1e3*s[Bt]))*n}):(s=Ya.exec(t))?(n="-"===s[1]?-1:(s[1],1),o={y:Sa(s[2],n),M:Sa(s[3],n),w:Sa(s[4],n),d:Sa(s[5],n),h:Sa(s[6],n),m:Sa(s[7],n),s:Sa(s[8],n)}):null==o?o={}:"object"===("undefined"===typeof o?"undefined":r(o))&&("from"in o||"to"in o)&&(i=Oa(qn(o.from),qn(o.to)),o={},o.ms=i.milliseconds,o.M=i.months),a=new oa(o),sa(t)&&m(t,"_locale")&&(a._locale=t._locale),a}function Sa(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function Ta(t,e){var n={milliseconds:0,months:0};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function Oa(t,e){var n;return t.isValid()&&e.isValid()?(e=fa(e,t),t.isBefore(e)?n=Ta(t,e):(n=Ta(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Ha(t,e){return function(n,a){var r,i;return null===a||isNaN(+a)||(P(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=n,n=a,a=i),n="string"===typeof n?+n:n,r=Da(n,a),Aa(this,r,t),this}}function Aa(t,e,n,a){var r=e._milliseconds,o=la(e._days),s=la(e._months);t.isValid()&&(a=null==a||a,s&&he(t,te(t,"Month")+s*n),o&&ee(t,"Date",te(t,"Date")+o*n),r&&t._d.setTime(t._d.valueOf()+r*n),a&&i.updateOffset(t,o||s))}Da.fn=oa.prototype,Da.invalid=ia;var Pa=Ha(1,"add"),ja=Ha(-1,"subtract");function Ca(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function za(t,e){var n=t||qn(),a=fa(n,this).startOf("day"),r=i.calendarFormat(this,a)||"sameElse",o=e&&(j(e[r])?e[r].call(this,n):e[r]);return this.format(o||this.localeData().calendar(r,this,qn(n)))}function Ea(){return new x(this)}function Fa(t,e){var n=L(t)?t:qn(t);return!(!this.isValid()||!n.isValid())&&(e=Z(u(e)?"millisecond":e),"millisecond"===e?this.valueOf()>n.valueOf():n.valueOf()9999?ct(t,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):j(Date.prototype.toISOString)?this.toDate().toISOString():ct(t,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function Ga(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var n="["+t+'("]',a=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",r="-MM-DD[T]HH:mm:ss.SSS",i=e+'[")]';return this.format(n+a+r+i)}function qa(t){t||(t=this.isUtc()?i.defaultFormatUtc:i.defaultFormat);var e=ct(this,t);return this.localeData().postformat(e)}function Xa(t,e){return this.isValid()&&(L(t)&&t.isValid()||qn(t).isValid())?Da({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function Qa(t){return this.from(qn(),t)}function Za(t,e){return this.isValid()&&(L(t)&&t.isValid()||qn(t).isValid())?Da({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function Ka(t){return this.to(qn(),t)}function tr(t){var e;return void 0===t?this._locale._abbr:(e=yn(t),null!=e&&(this._locale=e),this)}i.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",i.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var er=O("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});function nr(){return this._locale}function ar(t){switch(t=Z(t),t){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===t&&this.weekday(0),"isoWeek"===t&&this.isoWeekday(1),"quarter"===t&&this.month(3*Math.floor(this.month()/3)),this}function rr(t){return t=Z(t),void 0===t||"millisecond"===t?this:("date"===t&&(t="day"),this.startOf(t).add(1,"isoWeek"===t?"week":t).subtract(1,"ms"))}function ir(){return this._d.valueOf()-6e4*(this._offset||0)}function or(){return Math.floor(this.valueOf()/1e3)}function sr(){return new Date(this.valueOf())}function lr(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function dr(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function ur(){return this.isValid()?this.toISOString():null}function cr(){return g(this)}function fr(){return p({},y(this))}function hr(){return y(this).overflow}function mr(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function pr(t,e){lt(0,[t,t.length],0,e)}function _r(t){return br.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function vr(t){return br.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function yr(){return Ye(this.year(),1,4)}function gr(){var t=this.localeData()._week;return Ye(this.year(),t.dow,t.doy)}function br(t,e,n,a,r){var i;return null==t?Le(this,a,r).year:(i=Ye(t,a,r),e>i&&(e=i),Mr.call(this,t,e,n,a,r))}function Mr(t,e,n,a,r){var i=xe(t,e,n,a,r),o=ke(i.year,0,i.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}function kr(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}lt(0,["gg",2],0,function(){return this.weekYear()%100}),lt(0,["GG",2],0,function(){return this.isoWeekYear()%100}),pr("gggg","weekYear"),pr("ggggg","weekYear"),pr("GGGG","isoWeekYear"),pr("GGGGG","isoWeekYear"),Q("weekYear","gg"),Q("isoWeekYear","GG"),et("weekYear",1),et("isoWeekYear",1),Ht("G",Lt),Ht("g",Lt),Ht("GG",yt,mt),Ht("gg",yt,mt),Ht("GGGG",kt,_t),Ht("gggg",kt,_t),Ht("GGGGG",wt,vt),Ht("ggggg",wt,vt),Et(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,a){e[a.substr(0,2)]=D(t)}),Et(["gg","GG"],function(t,e,n,a){e[a]=i.parseTwoDigitYear(t)}),lt("Q",0,"Qo","quarter"),Q("quarter","Q"),et("quarter",7),Ht("Q",ht),zt("Q",function(t,e){e[Wt]=3*(D(t)-1)}),lt("D",["DD",2],"Do","date"),Q("date","D"),et("date",9),Ht("D",yt),Ht("DD",yt,mt),Ht("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),zt(["D","DD"],Rt),zt("Do",function(t,e){e[Rt]=D(t.match(yt)[0],10)});var wr=Kt("Date",!0);function xr(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}lt("DDD",["DDDD",3],"DDDo","dayOfYear"),Q("dayOfYear","DDD"),et("dayOfYear",4),Ht("DDD",Mt),Ht("DDDD",pt),zt(["DDD","DDDD"],function(t,e,n){n._dayOfYear=D(t)}),lt("m",["mm",2],0,"minute"),Q("minute","m"),et("minute",14),Ht("m",yt),Ht("mm",yt,mt),zt(["m","mm"],Vt);var Lr=Kt("Minutes",!1);lt("s",["ss",2],0,"second"),Q("second","s"),et("second",15),Ht("s",yt),Ht("ss",yt,mt),zt(["s","ss"],Ut);var Yr,Dr=Kt("Seconds",!1);for(lt("S",0,0,function(){return~~(this.millisecond()/100)}),lt(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),lt(0,["SSS",3],0,"millisecond"),lt(0,["SSSS",4],0,function(){return 10*this.millisecond()}),lt(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),lt(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),lt(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),lt(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),lt(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),Q("millisecond","ms"),et("millisecond",16),Ht("S",Mt,ht),Ht("SS",Mt,mt),Ht("SSS",Mt,pt),Yr="SSSS";Yr.length<=9;Yr+="S")Ht(Yr,xt);function Sr(t,e){e[Bt]=D(1e3*("0."+t))}for(Yr="S";Yr.length<=9;Yr+="S")zt(Yr,Sr);var Tr=Kt("Milliseconds",!1);function Or(){return this._isUTC?"UTC":""}function Hr(){return this._isUTC?"Coordinated Universal Time":""}lt("z",0,0,"zoneAbbr"),lt("zz",0,0,"zoneName");var Ar=x.prototype;function Pr(t){return qn(1e3*t)}function jr(){return qn.apply(null,arguments).parseZone()}function Cr(t){return t}Ar.add=Pa,Ar.calendar=za,Ar.clone=Ea,Ar.diff=Ua,Ar.endOf=rr,Ar.format=qa,Ar.from=Xa,Ar.fromNow=Qa,Ar.to=Za,Ar.toNow=Ka,Ar.get=ne,Ar.invalidAt=hr,Ar.isAfter=Fa,Ar.isBefore=Ia,Ar.isBetween=Wa,Ar.isSame=Ra,Ar.isSameOrAfter=Na,Ar.isSameOrBefore=Va,Ar.isValid=cr,Ar.lang=er,Ar.locale=tr,Ar.localeData=nr,Ar.max=Qn,Ar.min=Xn,Ar.parsingFlags=fr,Ar.set=ae,Ar.startOf=ar,Ar.subtract=ja,Ar.toArray=lr,Ar.toObject=dr,Ar.toDate=sr,Ar.toISOString=Ja,Ar.inspect=Ga,Ar.toJSON=ur,Ar.toString=$a,Ar.unix=or,Ar.valueOf=ir,Ar.creationData=mr,Ar.year=Qt,Ar.isLeapYear=Zt,Ar.weekYear=_r,Ar.isoWeekYear=vr,Ar.quarter=Ar.quarters=kr,Ar.month=me,Ar.daysInMonth=pe,Ar.week=Ar.weeks=He,Ar.isoWeek=Ar.isoWeeks=Ae,Ar.weeksInYear=gr,Ar.isoWeeksInYear=yr,Ar.date=wr,Ar.day=Ar.days=Ve,Ar.weekday=Ue,Ar.isoWeekday=Be,Ar.dayOfYear=xr,Ar.hour=Ar.hours=ln,Ar.minute=Ar.minutes=Lr,Ar.second=Ar.seconds=Dr,Ar.millisecond=Ar.milliseconds=Tr,Ar.utcOffset=ma,Ar.utc=_a,Ar.local=va,Ar.parseZone=ya,Ar.hasAlignedHourOffset=ga,Ar.isDST=ba,Ar.isLocal=ka,Ar.isUtcOffset=wa,Ar.isUtc=xa,Ar.isUTC=xa,Ar.zoneAbbr=Or,Ar.zoneName=Hr,Ar.dates=O("dates accessor is deprecated. Use date instead.",wr),Ar.months=O("months accessor is deprecated. Use month instead",me),Ar.years=O("years accessor is deprecated. Use year instead",Qt),Ar.zone=O("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",pa),Ar.isDSTShifted=O("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Ma);var zr=E.prototype;function Er(t,e,n,a){var r=yn(),i=_().set(a,e);return r[n](i,t)}function Fr(t,e,n){if(c(t)&&(e=t,t=void 0),t=t||"",null!=e)return Er(t,e,n,"month");var a,r=[];for(a=0;a<12;a++)r[a]=Er(t,a,n,"month");return r}function Ir(t,e,n,a){"boolean"===typeof t?(c(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,c(e)&&(n=e,e=void 0),e=e||"");var r,i=yn(),o=t?i._week.dow:0;if(null!=n)return Er(e,(n+o)%7,a,"day");var s=[];for(r=0;r<7;r++)s[r]=Er(e,(r+o)%7,a,"day");return s}function Wr(t,e){return Fr(t,e,"months")}function Rr(t,e){return Fr(t,e,"monthsShort")}function Nr(t,e,n){return Ir(t,e,n,"weekdays")}function Vr(t,e,n){return Ir(t,e,n,"weekdaysShort")}function Ur(t,e,n){return Ir(t,e,n,"weekdaysMin")}zr.calendar=I,zr.longDateFormat=R,zr.invalidDate=V,zr.ordinal=$,zr.preparse=Cr,zr.postformat=Cr,zr.relativeTime=G,zr.pastFuture=q,zr.set=C,zr.months=le,zr.monthsShort=ue,zr.monthsParse=fe,zr.monthsRegex=ge,zr.monthsShortRegex=ve,zr.week=De,zr.firstDayOfYear=Oe,zr.firstDayOfWeek=Te,zr.weekdays=ze,zr.weekdaysMin=We,zr.weekdaysShort=Fe,zr.weekdaysParse=Ne,zr.weekdaysRegex=Je,zr.weekdaysShortRegex=qe,zr.weekdaysMinRegex=Qe,zr.isPM=an,zr.meridiem=on,pn("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=1===D(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n}}),i.lang=O("moment.lang is deprecated. Use moment.locale instead.",pn),i.langData=O("moment.langData is deprecated. Use moment.localeData instead.",yn);var Br=Math.abs;function $r(){var t=this._data;return this._milliseconds=Br(this._milliseconds),this._days=Br(this._days),this._months=Br(this._months),t.milliseconds=Br(t.milliseconds),t.seconds=Br(t.seconds),t.minutes=Br(t.minutes),t.hours=Br(t.hours),t.months=Br(t.months),t.years=Br(t.years),this}function Jr(t,e,n,a){var r=Da(e,n);return t._milliseconds+=a*r._milliseconds,t._days+=a*r._days,t._months+=a*r._months,t._bubble()}function Gr(t,e){return Jr(this,t,e,1)}function qr(t,e){return Jr(this,t,e,-1)}function Xr(t){return t<0?Math.floor(t):Math.ceil(t)}function Qr(){var t,e,n,a,r,i=this._milliseconds,o=this._days,s=this._months,l=this._data;return i>=0&&o>=0&&s>=0||i<=0&&o<=0&&s<=0||(i+=864e5*Xr(Kr(s)+o),o=0,s=0),l.milliseconds=i%1e3,t=Y(i/1e3),l.seconds=t%60,e=Y(t/60),l.minutes=e%60,n=Y(e/60),l.hours=n%24,o+=Y(n/24),r=Y(Zr(o)),s+=r,o-=Xr(Kr(r)),a=Y(s/12),s%=12,l.days=o,l.months=s,l.years=a,this}function Zr(t){return 4800*t/146097}function Kr(t){return 146097*t/4800}function ti(t){if(!this.isValid())return NaN;var e,n,a=this._milliseconds;if(t=Z(t),"month"===t||"year"===t)return e=this._days+a/864e5,n=this._months+Zr(e),"month"===t?n:n/12;switch(e=this._days+Math.round(Kr(this._months)),t){case"week":return e/7+a/6048e5;case"day":return e+a/864e5;case"hour":return 24*e+a/36e5;case"minute":return 1440*e+a/6e4;case"second":return 86400*e+a/1e3;case"millisecond":return Math.floor(864e5*e)+a;default:throw new Error("Unknown unit "+t)}}function ei(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*D(this._months/12):NaN}function ni(t){return function(){return this.as(t)}}var ai=ni("ms"),ri=ni("s"),ii=ni("m"),oi=ni("h"),si=ni("d"),li=ni("w"),di=ni("M"),ui=ni("y");function ci(){return Da(this)}function fi(t){return t=Z(t),this.isValid()?this[t+"s"]():NaN}function hi(t){return function(){return this.isValid()?this._data[t]:NaN}}var mi=hi("milliseconds"),pi=hi("seconds"),_i=hi("minutes"),vi=hi("hours"),yi=hi("days"),gi=hi("months"),bi=hi("years");function Mi(){return Y(this.days()/7)}var ki=Math.round,wi={ss:44,s:45,m:45,h:22,d:26,M:11};function xi(t,e,n,a,r){return r.relativeTime(e||1,!!n,t,a)}function Li(t,e,n){var a=Da(t).abs(),r=ki(a.as("s")),i=ki(a.as("m")),o=ki(a.as("h")),s=ki(a.as("d")),l=ki(a.as("M")),d=ki(a.as("y")),u=r<=wi.ss&&["s",r]||r0,u[4]=n,xi.apply(null,u)}function Yi(t){return void 0===t?ki:"function"===typeof t&&(ki=t,!0)}function Di(t,e){return void 0!==wi[t]&&(void 0===e?wi[t]:(wi[t]=e,"s"===t&&(wi.ss=e-1),!0))}function Si(t){if(!this.isValid())return this.localeData().invalidDate();var e=this.localeData(),n=Li(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)}var Ti=Math.abs;function Oi(t){return(t>0)-(t<0)||+t}function Hi(){if(!this.isValid())return this.localeData().invalidDate();var t,e,n,a=Ti(this._milliseconds)/1e3,r=Ti(this._days),i=Ti(this._months);t=Y(a/60),e=Y(t/60),a%=60,t%=60,n=Y(i/12),i%=12;var o=n,s=i,l=r,d=e,u=t,c=a?a.toFixed(3).replace(/\.?0+$/,""):"",f=this.asSeconds();if(!f)return"P0D";var h=f<0?"-":"",m=Oi(this._months)!==Oi(f)?"-":"",p=Oi(this._days)!==Oi(f)?"-":"",_=Oi(this._milliseconds)!==Oi(f)?"-":"";return h+"P"+(o?m+o+"Y":"")+(s?m+s+"M":"")+(l?p+l+"D":"")+(d||u||c?"T":"")+(d?_+d+"H":"")+(u?_+u+"M":"")+(c?_+c+"S":"")}var Ai=oa.prototype;return Ai.isValid=ra,Ai.abs=$r,Ai.add=Gr,Ai.subtract=qr,Ai.as=ti,Ai.asMilliseconds=ai,Ai.asSeconds=ri,Ai.asMinutes=ii,Ai.asHours=oi,Ai.asDays=si,Ai.asWeeks=li,Ai.asMonths=di,Ai.asYears=ui,Ai.valueOf=ei,Ai._bubble=Qr,Ai.clone=ci,Ai.get=fi,Ai.milliseconds=mi,Ai.seconds=pi,Ai.minutes=_i,Ai.hours=vi,Ai.days=yi,Ai.weeks=Mi,Ai.months=gi,Ai.years=bi,Ai.humanize=Si,Ai.toISOString=Hi,Ai.toString=Hi,Ai.toJSON=Hi,Ai.locale=tr,Ai.localeData=nr,Ai.toIsoString=O("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Hi),Ai.lang=er,lt("X",0,0,"unix"),lt("x",0,0,"valueOf"),Ht("x",Lt),Ht("X",St),zt("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),zt("x",function(t,e,n){n._d=new Date(D(t))}),i.version="2.19.1",o(qn),i.fn=Ar,i.min=Kn,i.max=ta,i.now=ea,i.utc=_,i.unix=Pr,i.months=Wr,i.isDate=f,i.locale=pn,i.invalid=b,i.duration=Da,i.isMoment=L,i.weekdays=Nr,i.parseZone=jr,i.localeData=yn,i.isDuration=sa,i.monthsShort=Rr,i.weekdaysMin=Ur,i.defineLocale=_n,i.updateLocale=vn,i.locales=gn,i.weekdaysShort=Vr,i.normalizeUnits=Z,i.relativeTimeRounding=Yi,i.relativeTimeThreshold=Di,i.calendarFormat=Ca,i.prototype=Ar,i})}),o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function s(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e1?arguments[1]:void 0)}})},"30ef":function(t,e,n){ -/*! - * Chart.js v2.8.0 - * https://www.chartjs.org - * (c) 2019 Chart.js Contributors - * Released under the MIT License - */ -(function(e,a){t.exports=a(function(){try{return n("c1df")}catch(t){}}())})(0,function(t){"use strict";t=t&&t.hasOwnProperty("default")?t["default"]:t;var e={rgb2hsl:n,rgb2hsv:a,rgb2hwb:i,rgb2cmyk:o,rgb2keyword:s,rgb2xyz:l,rgb2lab:d,rgb2lch:u,hsl2rgb:c,hsl2hsv:f,hsl2hwb:h,hsl2cmyk:m,hsl2keyword:p,hsv2rgb:_,hsv2hsl:v,hsv2hwb:y,hsv2cmyk:M,hsv2keyword:k,hwb2rgb:w,hwb2hsl:x,hwb2hsv:L,hwb2cmyk:Y,hwb2keyword:D,cmyk2rgb:S,cmyk2hsl:T,cmyk2hsv:O,cmyk2hwb:H,cmyk2keyword:A,keyword2rgb:N,keyword2hsl:V,keyword2hsv:U,keyword2hwb:B,keyword2cmyk:$,keyword2lab:J,keyword2xyz:G,xyz2rgb:P,xyz2lab:j,xyz2lch:C,lab2xyz:z,lab2rgb:F,lab2lch:E,lch2lab:I,lch2xyz:W,lch2rgb:R};function n(t){var e,n,a,r=t[0]/255,i=t[1]/255,o=t[2]/255,s=Math.min(r,i,o),l=Math.max(r,i,o),d=l-s;return l==s?e=0:r==l?e=(i-o)/d:i==l?e=2+(o-r)/d:o==l&&(e=4+(r-i)/d),e=Math.min(60*e,360),e<0&&(e+=360),a=(s+l)/2,n=l==s?0:a<=.5?d/(l+s):d/(2-l-s),[e,100*n,100*a]}function a(t){var e,n,a,r=t[0],i=t[1],o=t[2],s=Math.min(r,i,o),l=Math.max(r,i,o),d=l-s;return n=0==l?0:d/l*1e3/10,l==s?e=0:r==l?e=(i-o)/d:i==l?e=2+(o-r)/d:o==l&&(e=4+(r-i)/d),e=Math.min(60*e,360),e<0&&(e+=360),a=l/255*1e3/10,[e,n,a]}function i(t){var e=t[0],a=t[1],r=t[2],i=n(t)[0],o=1/255*Math.min(e,Math.min(a,r));r=1-1/255*Math.max(e,Math.max(a,r));return[i,100*o,100*r]}function o(t){var e,n,a,r,i=t[0]/255,o=t[1]/255,s=t[2]/255;return r=Math.min(1-i,1-o,1-s),e=(1-i-r)/(1-r)||0,n=(1-o-r)/(1-r)||0,a=(1-s-r)/(1-r)||0,[100*e,100*n,100*a,100*r]}function s(t){return X[JSON.stringify(t)]}function l(t){var e=t[0]/255,n=t[1]/255,a=t[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,a=a>.04045?Math.pow((a+.055)/1.055,2.4):a/12.92;var r=.4124*e+.3576*n+.1805*a,i=.2126*e+.7152*n+.0722*a,o=.0193*e+.1192*n+.9505*a;return[100*r,100*i,100*o]}function d(t){var e,n,a,r=l(t),i=r[0],o=r[1],s=r[2];return i/=95.047,o/=100,s/=108.883,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,e=116*o-16,n=500*(i-o),a=200*(o-s),[e,n,a]}function u(t){return E(d(t))}function c(t){var e,n,a,r,i,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0==s)return i=255*l,[i,i,i];n=l<.5?l*(1+s):l+s-l*s,e=2*l-n,r=[0,0,0];for(var d=0;d<3;d++)a=o+1/3*-(d-1),a<0&&a++,a>1&&a--,i=6*a<1?e+6*(n-e)*a:2*a<1?n:3*a<2?e+(n-e)*(2/3-a)*6:e,r[d]=255*i;return r}function f(t){var e,n,a=t[0],r=t[1]/100,i=t[2]/100;return 0===i?[0,0,0]:(i*=2,r*=i<=1?i:2-i,n=(i+r)/2,e=2*r/(i+r),[a,100*e,100*n])}function h(t){return i(c(t))}function m(t){return o(c(t))}function p(t){return s(c(t))}function _(t){var e=t[0]/60,n=t[1]/100,a=t[2]/100,r=Math.floor(e)%6,i=e-Math.floor(e),o=255*a*(1-n),s=255*a*(1-n*i),l=255*a*(1-n*(1-i));a*=255;switch(r){case 0:return[a,l,o];case 1:return[s,a,o];case 2:return[o,a,l];case 3:return[o,s,a];case 4:return[l,o,a];case 5:return[a,o,s]}}function v(t){var e,n,a=t[0],r=t[1]/100,i=t[2]/100;return n=(2-r)*i,e=r*i,e/=n<=1?n:2-n,e=e||0,n/=2,[a,100*e,100*n]}function y(t){return i(_(t))}function M(t){return o(_(t))}function k(t){return s(_(t))}function w(t){var e,n,a,i,o=t[0]/360,s=t[1]/100,l=t[2]/100,d=s+l;switch(d>1&&(s/=d,l/=d),e=Math.floor(6*o),n=1-l,a=6*o-e,0!=(1&e)&&(a=1-a),i=s+a*(n-s),e){default:case 6:case 0:r=n,g=i,b=s;break;case 1:r=i,g=n,b=s;break;case 2:r=s,g=n,b=i;break;case 3:r=s,g=i,b=n;break;case 4:r=i,g=s,b=n;break;case 5:r=n,g=s,b=i;break}return[255*r,255*g,255*b]}function x(t){return n(w(t))}function L(t){return a(w(t))}function Y(t){return o(w(t))}function D(t){return s(w(t))}function S(t){var e,n,a,r=t[0]/100,i=t[1]/100,o=t[2]/100,s=t[3]/100;return e=1-Math.min(1,r*(1-s)+s),n=1-Math.min(1,i*(1-s)+s),a=1-Math.min(1,o*(1-s)+s),[255*e,255*n,255*a]}function T(t){return n(S(t))}function O(t){return a(S(t))}function H(t){return i(S(t))}function A(t){return s(S(t))}function P(t){var e,n,a,r=t[0]/100,i=t[1]/100,o=t[2]/100;return e=3.2406*r+-1.5372*i+-.4986*o,n=-.9689*r+1.8758*i+.0415*o,a=.0557*r+-.204*i+1.057*o,e=e>.0031308?1.055*Math.pow(e,1/2.4)-.055:e*=12.92,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*=12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*=12.92,e=Math.min(Math.max(0,e),1),n=Math.min(Math.max(0,n),1),a=Math.min(Math.max(0,a),1),[255*e,255*n,255*a]}function j(t){var e,n,a,r=t[0],i=t[1],o=t[2];return r/=95.047,i/=100,o/=108.883,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,e=116*i-16,n=500*(r-i),a=200*(i-o),[e,n,a]}function C(t){return E(j(t))}function z(t){var e,n,a,r,i=t[0],o=t[1],s=t[2];return i<=8?(n=100*i/903.3,r=n/100*7.787+16/116):(n=100*Math.pow((i+16)/116,3),r=Math.pow(n/100,1/3)),e=e/95.047<=.008856?e=95.047*(o/500+r-16/116)/7.787:95.047*Math.pow(o/500+r,3),a=a/108.883<=.008859?a=108.883*(r-s/200-16/116)/7.787:108.883*Math.pow(r-s/200,3),[e,n,a]}function E(t){var e,n,a,r=t[0],i=t[1],o=t[2];return e=Math.atan2(o,i),n=360*e/2/Math.PI,n<0&&(n+=360),a=Math.sqrt(i*i+o*o),[r,a,n]}function F(t){return P(z(t))}function I(t){var e,n,a,r=t[0],i=t[1],o=t[2];return a=o/360*2*Math.PI,e=i*Math.cos(a),n=i*Math.sin(a),[r,e,n]}function W(t){return z(I(t))}function R(t){return F(I(t))}function N(t){return q[t]}function V(t){return n(N(t))}function U(t){return a(N(t))}function B(t){return i(N(t))}function $(t){return o(N(t))}function J(t){return d(N(t))}function G(t){return l(N(t))}var q={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},X={};for(var Q in q)X[JSON.stringify(q[Q])]=Q;var Z=function(){return new at};for(var K in e){Z[K+"Raw"]=function(t){return function(n){return"number"==typeof n&&(n=Array.prototype.slice.call(arguments)),e[t](n)}}(K);var tt=/(\w+)2(\w+)/.exec(K),et=tt[1],nt=tt[2];Z[et]=Z[et]||{},Z[et][nt]=Z[K]=function(t){return function(n){"number"==typeof n&&(n=Array.prototype.slice.call(arguments));var a=e[t](n);if("string"==typeof a||void 0===a)return a;for(var r=0;r=0&&e<1?wt(Math.round(255*e)):"")}function mt(t,e){return e<1||t[3]&&t[3]<1?pt(t,e):"rgb("+t[0]+", "+t[1]+", "+t[2]+")"}function pt(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function _t(t,e){if(e<1||t[3]&&t[3]<1)return vt(t,e);var n=Math.round(t[0]/255*100),a=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return"rgb("+n+"%, "+a+"%, "+r+"%)"}function vt(t,e){var n=Math.round(t[0]/255*100),a=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return"rgba("+n+"%, "+a+"%, "+r+"%, "+(e||t[3]||1)+")"}function yt(t,e){return e<1||t[3]&&t[3]<1?gt(t,e):"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"}function gt(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function bt(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"}function Mt(t){return xt[t.slice(0,3)]}function kt(t,e,n){return Math.min(Math.max(e,t),n)}function wt(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}var xt={};for(var Lt in it)xt[it[Lt]]=Lt;var Yt=function(t){return t instanceof Yt?t:this instanceof Yt?(this.valid=!1,this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1},void("string"===typeof t?(e=ot.getRgba(t),e?this.setValues("rgb",e):(e=ot.getHsla(t))?this.setValues("hsl",e):(e=ot.getHwb(t))&&this.setValues("hwb",e)):"object"===typeof t&&(e=t,void 0!==e.r||void 0!==e.red?this.setValues("rgb",e):void 0!==e.l||void 0!==e.lightness?this.setValues("hsl",e):void 0!==e.v||void 0!==e.value?this.setValues("hsv",e):void 0!==e.w||void 0!==e.whiteness?this.setValues("hwb",e):void 0===e.c&&void 0===e.cyan||this.setValues("cmyk",e)))):new Yt(t);var e};Yt.prototype={isValid:function(){return this.valid},rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var t=this.values;return 1!==t.alpha?t.hwb.concat([t.alpha]):t.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var t=this.values;return t.rgb.concat([t.alpha])},hslaArray:function(){var t=this.values;return t.hsl.concat([t.alpha])},alpha:function(t){return void 0===t?this.values.alpha:(this.setValues("alpha",t),this)},red:function(t){return this.setChannel("rgb",0,t)},green:function(t){return this.setChannel("rgb",1,t)},blue:function(t){return this.setChannel("rgb",2,t)},hue:function(t){return t&&(t%=360,t=t<0?360+t:t),this.setChannel("hsl",0,t)},saturation:function(t){return this.setChannel("hsl",1,t)},lightness:function(t){return this.setChannel("hsl",2,t)},saturationv:function(t){return this.setChannel("hsv",1,t)},whiteness:function(t){return this.setChannel("hwb",1,t)},blackness:function(t){return this.setChannel("hwb",2,t)},value:function(t){return this.setChannel("hsv",2,t)},cyan:function(t){return this.setChannel("cmyk",0,t)},magenta:function(t){return this.setChannel("cmyk",1,t)},yellow:function(t){return this.setChannel("cmyk",2,t)},black:function(t){return this.setChannel("cmyk",3,t)},hexString:function(){return ot.hexString(this.values.rgb)},rgbString:function(){return ot.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return ot.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return ot.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return ot.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return ot.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return ot.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return ot.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var t=this.values.rgb;return t[0]<<16|t[1]<<8|t[2]},luminosity:function(){for(var t=this.values.rgb,e=[],n=0;nn?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb,e=(299*t[0]+587*t[1]+114*t[2])/1e3;return e<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,n=(e[0]+t)%360;return e[0]=n<0?360+n:n,this.setValues("hsl",e),this},mix:function(t,e){var n=this,a=t,r=void 0===e?.5:e,i=2*r-1,o=n.alpha()-a.alpha(),s=((i*o===-1?i:(i+o)/(1+i*o))+1)/2,l=1-s;return this.rgb(s*n.red()+l*a.red(),s*n.green()+l*a.green(),s*n.blue()+l*a.blue()).alpha(n.alpha()*r+a.alpha()*(1-r))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new Yt,a=this.values,r=n.values;for(var i in a)a.hasOwnProperty(i)&&(t=a[i],e={}.toString.call(t),"[object Array]"===e?r[i]=t.slice(0):"[object Number]"===e?r[i]=t:console.error("unexpected color value:",t));return n}},Yt.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},Yt.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},Yt.prototype.getValues=function(t){for(var e=this.values,n={},a=0;a=0;r--)e.call(n,t[r],r);else for(r=0;r=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,n=0,a=1;return 0===t?0:1===t?1:(n||(n=.3),a<1?(a=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/a),-a*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n))},easeOutElastic:function(t){var e=1.70158,n=0,a=1;return 0===t?0:1===t?1:(n||(n=.3),a<1?(a=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/a),a*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,a=1;return 0===t?0:2===(t/=.5)?1:(n||(n=.45),a<1?(a=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/a),t<1?a*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:a*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-Ot.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*Ot.easeInBounce(2*t):.5*Ot.easeOutBounce(2*t-1)+.5}},Ht={effects:Ot};Tt.easingEffects=Ot;var At=Math.PI,Pt=At/180,jt=2*At,Ct=At/2,zt=At/4,Et=2*At/3,Ft={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,n,a,r,i){if(i){var o=Math.min(i,r/2,a/2),s=e+o,l=n+o,d=e+a-o,u=n+r-o;t.moveTo(e,l),se.left-n&&t.xe.top-n&&t.y0&&t.requestAnimationFrame()},advance:function(){var t,e,n,a,r=this.animations,i=0;while(i=n?(Bt.callback(t.onAnimationComplete,[t],e),e.animating=!1,r.splice(i,1)):++i}},ee=Bt.options.resolve,ne=["push","pop","shift","splice","unshift"];function ae(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),ne.forEach(function(e){var n="onData"+e.charAt(0).toUpperCase()+e.slice(1),a=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:function(){var e=Array.prototype.slice.call(arguments),r=a.apply(this,e);return Bt.each(t._chartjs.listeners,function(t){"function"===typeof t[n]&&t[n].apply(t,e)}),r}})}))}function re(t,e){var n=t._chartjs;if(n){var a=n.listeners,r=a.indexOf(e);-1!==r&&a.splice(r,1),a.length>0||(ne.forEach(function(e){delete t[e]}),delete t._chartjs)}}var ie=function(t,e){this.initialize(t,e)};Bt.extend(ie.prototype,{datasetElementType:null,dataElementType:null,initialize:function(t,e){var n=this;n.chart=t,n.index=e,n.linkScales(),n.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),n=t.getDataset();null!==e.xAxisID&&e.xAxisID in t.chart.scales||(e.xAxisID=n.xAxisID||t.chart.options.scales.xAxes[0].id),null!==e.yAxisID&&e.yAxisID in t.chart.scales||(e.yAxisID=n.yAxisID||t.chart.options.scales.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this.update(!0)},destroy:function(){this._data&&re(this._data,this)},createMetaDataset:function(){var t=this,e=t.datasetElementType;return e&&new e({_chart:t.chart,_datasetIndex:t.index})},createMetaData:function(t){var e=this,n=e.dataElementType;return n&&new n({_chart:e.chart,_datasetIndex:e.index,_index:t})},addElements:function(){var t,e,n=this,a=n.getMeta(),r=n.getDataset().data||[],i=a.data;for(t=0,e=r.length;ta&&t.insertElements(a,r-a)},insertElements:function(t,e){for(var n=0;ns)r-=2*Math.PI;while(r=o&&r<=s,d=i>=n.innerRadius&&i<=n.outerRadius;return l&&d}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,n=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,n=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},draw:function(){var t,e=this._chart.ctx,n=this._view,a=n.startAngle,r=n.endAngle,i="inner"===n.borderAlign?.33:0;e.save(),e.beginPath(),e.arc(n.x,n.y,Math.max(n.outerRadius-i,0),a,r),e.arc(n.x,n.y,n.innerRadius,r,a,!0),e.closePath(),e.fillStyle=n.backgroundColor,e.fill(),n.borderWidth&&("inner"===n.borderAlign?(e.beginPath(),t=i/n.outerRadius,e.arc(n.x,n.y,n.outerRadius,a-t,r+t),n.innerRadius>i?(t=i/n.innerRadius,e.arc(n.x,n.y,n.innerRadius-i,r+t,a-t,!0)):e.arc(n.x,n.y,i,r+Math.PI/2,a-Math.PI/2),e.closePath(),e.clip(),e.beginPath(),e.arc(n.x,n.y,n.outerRadius,a,r),e.arc(n.x,n.y,n.innerRadius,r,a,!0),e.closePath(),e.lineWidth=2*n.borderWidth,e.lineJoin="round"):(e.lineWidth=n.borderWidth,e.lineJoin="bevel"),e.strokeStyle=n.borderColor,e.stroke()),e.restore()}}),le=Bt.valueOrDefault,de=Rt.global.defaultColor;Rt._set("global",{elements:{line:{tension:.4,backgroundColor:de,borderWidth:3,borderColor:de,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}});var ue=Qt.extend({draw:function(){var t,e,n,a,r=this,i=r._view,o=r._chart.ctx,s=i.spanGaps,l=r._children.slice(),d=Rt.global,u=d.elements.line,c=-1;for(r._loop&&l.length&&l.push(l[0]),o.save(),o.lineCap=i.borderCapStyle||u.borderCapStyle,o.setLineDash&&o.setLineDash(i.borderDash||u.borderDash),o.lineDashOffset=le(i.borderDashOffset,u.borderDashOffset),o.lineJoin=i.borderJoinStyle||u.borderJoinStyle,o.lineWidth=le(i.borderWidth,u.borderWidth),o.strokeStyle=i.borderColor||d.defaultColor,o.beginPath(),c=-1,t=0;tt.x&&(e=ge(e,"left","right")):t.basen?n:a,r:l.right||r<0?0:r>e?e:r,b:l.bottom||i<0?0:i>n?n:i,l:l.left||o<0?0:o>e?e:o}}function ke(t){var e=ye(t),n=e.right-e.left,a=e.bottom-e.top,r=Me(t,n/2,a/2);return{outer:{x:e.left,y:e.top,w:n,h:a},inner:{x:e.left+r.l,y:e.top+r.t,w:n-r.l-r.r,h:a-r.t-r.b}}}function we(t,e,n){var a=null===e,r=null===n,i=!(!t||a&&r)&&ye(t);return i&&(a||e>=i.left&&e<=i.right)&&(r||n>=i.top&&n<=i.bottom)}Rt._set("global",{elements:{rectangle:{backgroundColor:_e,borderColor:_e,borderSkipped:"bottom",borderWidth:0}}});var xe=Qt.extend({draw:function(){var t=this._chart.ctx,e=this._view,n=ke(e),a=n.outer,r=n.inner;t.fillStyle=e.backgroundColor,t.fillRect(a.x,a.y,a.w,a.h),a.w===r.w&&a.h===r.h||(t.save(),t.beginPath(),t.rect(a.x,a.y,a.w,a.h),t.clip(),t.fillStyle=e.borderColor,t.rect(r.x,r.y,r.w,r.h),t.fill("evenodd"),t.restore())},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){return we(this._view,t,e)},inLabelRange:function(t,e){var n=this._view;return ve(n)?we(n,t,null):we(n,null,e)},inXRange:function(t){return we(this._view,t,null)},inYRange:function(t){return we(this._view,null,t)},getCenterPoint:function(){var t,e,n=this._view;return ve(n)?(t=n.x,e=(n.y+n.base)/2):(t=(n.x+n.base)/2,e=n.y),{x:t,y:e}},getArea:function(){var t=this._view;return ve(t)?t.width*Math.abs(t.y-t.base):t.height*Math.abs(t.x-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}}),Le={},Ye=se,De=ue,Se=pe,Te=xe;Le.Arc=Ye,Le.Line=De,Le.Point=Se,Le.Rectangle=Te;var Oe=Bt.options.resolve;function He(t,e){var n,a,r,i,o=t.isHorizontal()?t.width:t.height,s=t.getTicks();for(r=1,i=e.length;r0?Math.min(o,a-n):o,n=a;return o}function Ae(t,e,n){var a,r,i=n.barThickness,o=e.stackCount,s=e.pixels[t];return Bt.isNullOrUndef(i)?(a=e.min*n.categoryPercentage,r=n.barPercentage):(a=i*o,r=1),{chunk:a/o,ratio:r,start:s-a/2}}function Pe(t,e,n){var a,r,i=e.pixels,o=i[t],s=t>0?i[t-1]:null,l=t=0&&r>0)&&(y+=r));return i=c.getPixelForValue(y),o=c.getPixelForValue(y+m),s=o-i,void 0!==p&&Math.abs(s)=0&&!f||m<0&&f?i-p:i+p),{size:s,base:i,head:o,center:o+s/2}},calculateBarIndexPixels:function(t,e,n){var a=this,r=n.scale.options,i="flex"===r.barThickness?Pe(e,n,r):Ae(e,n,r),o=a.getStackIndex(t,a.getMeta().stack),s=i.start+i.chunk*o+i.chunk/2,l=Math.min(Bt.valueOrDefault(r.maxBarThickness,1/0),i.chunk*i.ratio);return{base:s-l/2,head:s+l/2,center:s,size:l}},draw:function(){var t=this,e=t.chart,n=t._getValueScale(),a=t.getMeta().data,r=t.getDataset(),i=a.length,o=0;for(Bt.canvas.clipArea(e.ctx,e.chartArea);o');var n=t.data,a=n.datasets,r=n.labels;if(a.length)for(var i=0;i'),r[i]&&e.push(r[i]),e.push("");return e.push(""),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map(function(n,a){var r=t.getDatasetMeta(0),i=e.datasets[0],o=r.data[a],s=o&&o.custom||{},l=t.options.elements.arc,d=Fe([s.backgroundColor,i.backgroundColor,l.backgroundColor],void 0,a),u=Fe([s.borderColor,i.borderColor,l.borderColor],void 0,a),c=Fe([s.borderWidth,i.borderWidth,l.borderWidth],void 0,a);return{text:n,fillStyle:d,strokeStyle:u,lineWidth:c,hidden:isNaN(i.data[a])||r.data[a].hidden,index:a}}):[]}},onClick:function(t,e){var n,a,r,i=e.index,o=this.chart;for(n=0,a=(o.data.datasets||[]).length;n=Math.PI?-1:_<-Math.PI?1:0);var v=_+m,y={x:Math.cos(_),y:Math.sin(_)},g={x:Math.cos(v),y:Math.sin(v)},b=_<=0&&v>=0||_<=2*Math.PI&&2*Math.PI<=v,M=_<=.5*Math.PI&&.5*Math.PI<=v||_<=2.5*Math.PI&&2.5*Math.PI<=v,k=_<=-Math.PI&&-Math.PI<=v||_<=Math.PI&&Math.PI<=v,w=_<=.5*-Math.PI&&.5*-Math.PI<=v||_<=1.5*Math.PI&&1.5*Math.PI<=v,x=h/100,L={x:k?-1:Math.min(y.x*(y.x<0?1:x),g.x*(g.x<0?1:x)),y:w?-1:Math.min(y.y*(y.y<0?1:x),g.y*(g.y<0?1:x))},Y={x:b?1:Math.max(y.x*(y.x>0?1:x),g.x*(g.x>0?1:x)),y:M?1:Math.max(y.y*(y.y>0?1:x),g.y*(g.y>0?1:x))},D={width:.5*(Y.x-L.x),height:.5*(Y.y-L.y)};d=Math.min(s/D.width,l/D.height),u={x:-.5*(Y.x+L.x),y:-.5*(Y.y+L.y)}}for(e=0,n=f.length;e0&&!isNaN(t)?2*Math.PI*(Math.abs(t)/e):0},getMaxBorderWidth:function(t){var e,n,a,r,i,o,s,l,d=this,u=0,c=d.chart;if(!t)for(e=0,n=c.data.datasets.length;eu?s:u,u=l>u?l:u);return u},setHoverStyle:function(t){var e=t._model,n=t._options,a=Bt.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=Ie(n.hoverBackgroundColor,a(n.backgroundColor)),e.borderColor=Ie(n.hoverBorderColor,a(n.borderColor)),e.borderWidth=Ie(n.hoverBorderWidth,n.borderWidth)},_resolveElementOptions:function(t,e){var n,a,r,i=this,o=i.chart,s=i.getDataset(),l=t.custom||{},d=o.options.elements.arc,u={},c={chart:o,dataIndex:e,dataset:s,datasetIndex:i.index},f=["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"];for(n=0,a=f.length;n0&&Ue(d[t-1]._model,l)&&(n.controlPointPreviousX=u(n.controlPointPreviousX,l.left,l.right),n.controlPointPreviousY=u(n.controlPointPreviousY,l.top,l.bottom)),t');var n=t.data,a=n.datasets,r=n.labels;if(a.length)for(var i=0;i'),r[i]&&e.push(r[i]),e.push("");return e.push(""),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map(function(n,a){var r=t.getDatasetMeta(0),i=e.datasets[0],o=r.data[a],s=o.custom||{},l=t.options.elements.arc,d=Je([s.backgroundColor,i.backgroundColor,l.backgroundColor],void 0,a),u=Je([s.borderColor,i.borderColor,l.borderColor],void 0,a),c=Je([s.borderWidth,i.borderWidth,l.borderWidth],void 0,a);return{text:n,fillStyle:d,strokeStyle:u,lineWidth:c,hidden:isNaN(i.data[a])||r.data[a].hidden,index:a}}):[]}},onClick:function(t,e){var n,a,r,i=e.index,o=this.chart;for(n=0,a=(o.data.datasets||[]).length;n0&&(i=t.getDatasetMeta(i[0]._datasetIndex).data),i},"x-axis":function(t,e){return sn(t,e,{intersect:!1})},point:function(t,e){var n=en(e,t);return an(t,n)},nearest:function(t,e,n){var a=en(e,t);n.axis=n.axis||"xy";var r=on(n.axis);return rn(t,a,n.intersect,r)},x:function(t,e,n){var a=en(e,t),r=[],i=!1;return nn(t,function(t){t.inXRange(a.x)&&r.push(t),t.inRange(a.x,a.y)&&(i=!0)}),n.intersect&&!i&&(r=[]),r},y:function(t,e,n){var a=en(e,t),r=[],i=!1;return nn(t,function(t){t.inYRange(a.y)&&r.push(t),t.inRange(a.x,a.y)&&(i=!0)}),n.intersect&&!i&&(r=[]),r}}};function dn(t,e){return Bt.where(t,function(t){return t.position===e})}function un(t,e){t.forEach(function(t,e){return t._tmpIndex_=e,t}),t.sort(function(t,n){var a=e?n:t,r=e?t:n;return a.weight===r.weight?a._tmpIndex_-r._tmpIndex_:a.weight-r.weight}),t.forEach(function(t){delete t._tmpIndex_})}function cn(t){var e=0,n=0,a=0,r=0;return Bt.each(t,function(t){if(t.getPadding){var i=t.getPadding();e=Math.max(e,i.top),n=Math.max(n,i.left),a=Math.max(a,i.bottom),r=Math.max(r,i.right)}}),{top:e,left:n,bottom:a,right:r}}function fn(t,e){Bt.each(t,function(t){e[t.position]+=t.isHorizontal()?t.height:t.width})}Rt._set("global",{layout:{padding:{top:0,right:0,bottom:0,left:0}}});var hn={defaults:{},addBox:function(t,e){t.boxes||(t.boxes=[]),e.fullWidth=e.fullWidth||!1,e.position=e.position||"top",e.weight=e.weight||0,t.boxes.push(e)},removeBox:function(t,e){var n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},configure:function(t,e,n){for(var a,r=["fullWidth","position","weight"],i=r.length,o=0;o div {\n\tposition: absolute;\n\twidth: 1000000px;\n\theight: 1000000px;\n\tleft: 0;\n\ttop: 0;\n}\n\n.chartjs-size-monitor-shrink > div {\n\tposition: absolute;\n\twidth: 200%;\n\theight: 200%;\n\tleft: 0;\n\ttop: 0;\n}\n",_n=Object.freeze({default:pn});function vn(t){return t&&t.default||t}var yn=vn(_n),gn="$chartjs",bn="chartjs-",Mn=bn+"size-monitor",kn=bn+"render-monitor",wn=bn+"render-animation",xn=["animationstart","webkitAnimationStart"],Ln={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function Yn(t,e){var n=Bt.getStyle(t,e),a=n&&n.match(/^(\d+)(\.\d+)?px$/);return a?Number(a[1]):void 0}function Dn(t,e){var n=t.style,a=t.getAttribute("height"),r=t.getAttribute("width");if(t[gn]={initial:{height:a,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===r||""===r){var i=Yn(t,"width");void 0!==i&&(t.width=i)}if(null===a||""===a)if(""===t.style.height)t.height=t.width/(e.options.aspectRatio||2);else{var o=Yn(t,"height");void 0!==i&&(t.height=o)}return t}var Sn=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(n){}return t}(),Tn=!!Sn&&{passive:!0};function On(t,e,n){t.addEventListener(e,n,Tn)}function Hn(t,e,n){t.removeEventListener(e,n,Tn)}function An(t,e,n,a,r){return{type:t,chart:e,native:r||null,x:void 0!==n?n:null,y:void 0!==a?a:null}}function Pn(t,e){var n=Ln[t.type]||t.type,a=Bt.getRelativePosition(t,e);return An(n,e,a.x,a.y,t)}function jn(t,e){var n=!1,a=[];return function(){a=Array.prototype.slice.call(arguments),e=e||this,n||(n=!0,Bt.requestAnimFrame.call(window,function(){n=!1,t.apply(e,a)}))}}function Cn(t){var e=document.createElement("div");return e.className=t||"",e}function zn(t){var e=1e6,n=Cn(Mn),a=Cn(Mn+"-expand"),r=Cn(Mn+"-shrink");a.appendChild(Cn()),r.appendChild(Cn()),n.appendChild(a),n.appendChild(r),n._reset=function(){a.scrollLeft=e,a.scrollTop=e,r.scrollLeft=e,r.scrollTop=e};var i=function(){n._reset(),t()};return On(a,"scroll",i.bind(a,"expand")),On(r,"scroll",i.bind(r,"shrink")),n}function En(t,e){var n=t[gn]||(t[gn]={}),a=n.renderProxy=function(t){t.animationName===wn&&e()};Bt.each(xn,function(e){On(t,e,a)}),n.reflow=!!t.offsetParent,t.classList.add(kn)}function Fn(t){var e=t[gn]||{},n=e.renderProxy;n&&(Bt.each(xn,function(e){Hn(t,e,n)}),delete e.renderProxy),t.classList.remove(kn)}function In(t,e,n){var a=t[gn]||(t[gn]={}),r=a.resizer=zn(jn(function(){if(a.resizer){var r=n.options.maintainAspectRatio&&t.parentNode,i=r?r.clientWidth:0;e(An("resize",n)),r&&r.clientWidth0){var i=t[0];i.label?n=i.label:i.xLabel?n=i.xLabel:r>0&&i.index-1?t.split("\n"):t}function Qn(t){var e=t._xScale,n=t._yScale||t._scale,a=t._index,r=t._datasetIndex,i=t._chart.getDatasetMeta(r).controller,o=i._getIndexScale(),s=i._getValueScale();return{xLabel:e?e.getLabelForIndex(a,r):"",yLabel:n?n.getLabelForIndex(a,r):"",label:o?""+o.getLabelForIndex(a,r):"",value:s?""+s.getLabelForIndex(a,r):"",index:a,datasetIndex:r,x:t._model.x,y:t._model.y}}function Zn(t){var e=Rt.global;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,bodyFontColor:t.bodyFontColor,_bodyFontFamily:Jn(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:Jn(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:Jn(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:Jn(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:Jn(t.titleFontStyle,e.defaultFontStyle),titleFontSize:Jn(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:Jn(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:Jn(t.footerFontStyle,e.defaultFontStyle),footerFontSize:Jn(t.footerFontSize,e.defaultFontSize),_footerAlign:t.footerAlign,footerSpacing:t.footerSpacing,footerMarginTop:t.footerMarginTop,caretSize:t.caretSize,cornerRadius:t.cornerRadius,backgroundColor:t.backgroundColor,opacity:0,legendColorBackground:t.multiKeyBackground,displayColors:t.displayColors,borderColor:t.borderColor,borderWidth:t.borderWidth}}function Kn(t,e){var n=t._chart.ctx,a=2*e.yPadding,r=0,i=e.body,o=i.reduce(function(t,e){return t+e.before.length+e.lines.length+e.after.length},0);o+=e.beforeBody.length+e.afterBody.length;var s=e.title.length,l=e.footer.length,d=e.titleFontSize,u=e.bodyFontSize,c=e.footerFontSize;a+=s*d,a+=s?(s-1)*e.titleSpacing:0,a+=s?e.titleMarginBottom:0,a+=o*u,a+=o?(o-1)*e.bodySpacing:0,a+=l?e.footerMarginTop:0,a+=l*c,a+=l?(l-1)*e.footerSpacing:0;var f=0,h=function(t){r=Math.max(r,n.measureText(t).width+f)};return n.font=Bt.fontString(d,e._titleFontStyle,e._titleFontFamily),Bt.each(e.title,h),n.font=Bt.fontString(u,e._bodyFontStyle,e._bodyFontFamily),Bt.each(e.beforeBody.concat(e.afterBody),h),f=e.displayColors?u+2:0,Bt.each(i,function(t){Bt.each(t.before,h),Bt.each(t.lines,h),Bt.each(t.after,h)}),f=0,n.font=Bt.fontString(c,e._footerFontStyle,e._footerFontFamily),Bt.each(e.footer,h),r+=2*e.xPadding,{width:r,height:a}}function ta(t,e){var n,a,r,i,o,s=t._model,l=t._chart,d=t._chart.chartArea,u="center",c="center";s.yl.height-e.height&&(c="bottom");var f=(d.left+d.right)/2,h=(d.top+d.bottom)/2;"center"===c?(n=function(t){return t<=f},a=function(t){return t>f}):(n=function(t){return t<=e.width/2},a=function(t){return t>=l.width-e.width/2}),r=function(t){return t+e.width+s.caretSize+s.caretPadding>l.width},i=function(t){return t-e.width-s.caretSize-s.caretPadding<0},o=function(t){return t<=h?"top":"bottom"},n(s.x)?(u="left",r(s.x)&&(u="center",c=o(s.y))):a(s.x)&&(u="right",i(s.x)&&(u="center",c=o(s.y)));var m=t._options;return{xAlign:m.xAlign?m.xAlign:u,yAlign:m.yAlign?m.yAlign:c}}function ea(t,e,n,a){var r=t.x,i=t.y,o=t.caretSize,s=t.caretPadding,l=t.cornerRadius,d=n.xAlign,u=n.yAlign,c=o+s,f=l+s;return"right"===d?r-=e.width:"center"===d&&(r-=e.width/2,r+e.width>a.width&&(r=a.width-e.width),r<0&&(r=0)),"top"===u?i+=c:i-="bottom"===u?e.height+c:e.height/2,"center"===u?"left"===d?r+=c:"right"===d&&(r-=c):"left"===d?r-=f:"right"===d&&(r+=f),{x:r,y:i}}function na(t,e){return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-t.xPadding:t.x+t.xPadding}function aa(t){return qn([],Xn(t))}var ra=Qt.extend({initialize:function(){this._model=Zn(this._options),this._lastActive=[]},getTitle:function(){var t=this,e=t._options,n=e.callbacks,a=n.beforeTitle.apply(t,arguments),r=n.title.apply(t,arguments),i=n.afterTitle.apply(t,arguments),o=[];return o=qn(o,Xn(a)),o=qn(o,Xn(r)),o=qn(o,Xn(i)),o},getBeforeBody:function(){return aa(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(t,e){var n=this,a=n._options.callbacks,r=[];return Bt.each(t,function(t){var i={before:[],lines:[],after:[]};qn(i.before,Xn(a.beforeLabel.call(n,t,e))),qn(i.lines,a.label.call(n,t,e)),qn(i.after,Xn(a.afterLabel.call(n,t,e))),r.push(i)}),r},getAfterBody:function(){return aa(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var t=this,e=t._options.callbacks,n=e.beforeFooter.apply(t,arguments),a=e.footer.apply(t,arguments),r=e.afterFooter.apply(t,arguments),i=[];return i=qn(i,Xn(n)),i=qn(i,Xn(a)),i=qn(i,Xn(r)),i},update:function(t){var e,n,a=this,r=a._options,i=a._model,o=a._model=Zn(r),s=a._active,l=a._data,d={xAlign:i.xAlign,yAlign:i.yAlign},u={x:i.x,y:i.y},c={width:i.width,height:i.height},f={x:i.caretX,y:i.caretY};if(s.length){o.opacity=1;var h=[],m=[];f=Gn[r.position].call(a,s,a._eventPosition);var p=[];for(e=0,n=s.length;e0&&n.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var n={width:e.width,height:e.height},a={x:e.x,y:e.y},r=Math.abs(e.opacity<.001)?0:e.opacity,i=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;this._options.enabled&&i&&(t.save(),t.globalAlpha=r,this.drawBackground(a,e,t,n),a.y+=e.yPadding,this.drawTitle(a,e,t),this.drawBody(a,e,t),this.drawFooter(a,e,t),t.restore())}},handleEvent:function(t){var e=this,n=e._options,a=!1;return e._lastActive=e._lastActive||[],"mouseout"===t.type?e._active=[]:e._active=e._chart.getElementsAtEventForMode(t,n.mode,n),a=!Bt.arrayEquals(e._active,e._lastActive),a&&(e._lastActive=e._active,(n.enabled||n.custom)&&(e._eventPosition={x:t.x,y:t.y},e.update(!0),e.pivot())),a}}),ia=Gn,oa=ra;oa.positioners=ia;var sa=Bt.valueOrDefault;function la(){return Bt.merge({},[].slice.call(arguments),{merger:function(t,e,n,a){if("xAxes"===t||"yAxes"===t){var r,i,o,s=n[t].length;for(e[t]||(e[t]=[]),r=0;r=e[t].length&&e[t].push({}),!e[t][r].type||o.type&&o.type!==e[t][r].type?Bt.merge(e[t][r],[$n.getScaleDefaults(i),o]):Bt.merge(e[t][r],o)}else Bt._merger(t,e,n,a)}})}function da(){return Bt.merge({},[].slice.call(arguments),{merger:function(t,e,n,a){var r=e[t]||{},i=n[t];"scales"===t?e[t]=la(r,i):"scale"===t?e[t]=Bt.merge(r,[$n.getScaleDefaults(i.type),i]):Bt._merger(t,e,n,a)}})}function ua(t){t=t||{};var e=t.data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=da(Rt.global,Rt[t.type],t.options||{}),t}function ca(t){var e=t.options;Bt.each(t.scales,function(e){hn.removeBox(t,e)}),e=da(Rt.global,Rt[t.config.type],e),t.options=t.config.options=e,t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.tooltip._options=e.tooltips,t.tooltip.initialize()}function fa(t){return"top"===t||"bottom"===t}Rt._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var ha=function(t,e){return this.construct(t,e),this};Bt.extend(ha.prototype,{construct:function(t,e){var n=this;e=ua(e);var a=Un.acquireContext(t,e),r=a&&a.canvas,i=r&&r.height,o=r&&r.width;n.id=Bt.uid(),n.ctx=a,n.canvas=r,n.config=e,n.width=o,n.height=i,n.aspectRatio=i?o/i:null,n.options=e.options,n._bufferedRender=!1,n.chart=n,n.controller=n,ha.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(t){n.config.data=t}}),a&&r?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return Bn.notify(t,"beforeInit"),Bt.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.initToolTip(),Bn.notify(t,"afterInit"),t},clear:function(){return Bt.canvas.clear(this),this},stop:function(){return te.cancelAnimation(this),this},resize:function(t){var e=this,n=e.options,a=e.canvas,r=n.maintainAspectRatio&&e.aspectRatio||null,i=Math.max(0,Math.floor(Bt.getMaximumWidth(a))),o=Math.max(0,Math.floor(r?i/r:Bt.getMaximumHeight(a)));if((e.width!==i||e.height!==o)&&(a.width=e.width=i,a.height=e.height=o,a.style.width=i+"px",a.style.height=o+"px",Bt.retinaScale(e,n.devicePixelRatio),!t)){var s={width:i,height:o};Bn.notify(e,"resize",[s]),n.onResize&&n.onResize(e,s),e.stop(),e.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;Bt.each(e.xAxes,function(t,e){t.id=t.id||"x-axis-"+e}),Bt.each(e.yAxes,function(t,e){t.id=t.id||"y-axis-"+e}),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var t=this,e=t.options,n=t.scales||{},a=[],r=Object.keys(n).reduce(function(t,e){return t[e]=!1,t},{});e.scales&&(a=a.concat((e.scales.xAxes||[]).map(function(t){return{options:t,dtype:"category",dposition:"bottom"}}),(e.scales.yAxes||[]).map(function(t){return{options:t,dtype:"linear",dposition:"left"}}))),e.scale&&a.push({options:e.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),Bt.each(a,function(e){var a=e.options,i=a.id,o=sa(a.type,e.dtype);fa(a.position)!==fa(e.dposition)&&(a.position=e.dposition),r[i]=!0;var s=null;if(i in n&&n[i].type===o)s=n[i],s.options=a,s.ctx=t.ctx,s.chart=t;else{var l=$n.getScaleConstructor(o);if(!l)return;s=new l({id:i,type:o,options:a,ctx:t.ctx,chart:t}),n[s.id]=s}s.mergeTicksOptions(),e.isDefault&&(t.scale=s)}),Bt.each(r,function(t,e){t||delete n[e]}),t.scales=n,$n.addScalesToLayout(this)},buildOrUpdateControllers:function(){var t=this,e=[];return Bt.each(t.data.datasets,function(n,a){var r=t.getDatasetMeta(a),i=n.type||t.config.type;if(r.type&&r.type!==i&&(t.destroyDatasetMeta(a),r=t.getDatasetMeta(a)),r.type=i,r.controller)r.controller.updateIndex(a),r.controller.linkScales();else{var o=tn[r.type];if(void 0===o)throw new Error('"'+r.type+'" is not a chart type.');r.controller=new o(t,a),e.push(r.controller)}},t),e},resetElements:function(){var t=this;Bt.each(t.data.datasets,function(e,n){t.getDatasetMeta(n).controller.reset()},t)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(t){var e=this;if(t&&"object"===typeof t||(t={duration:t,lazy:arguments[1]}),ca(e),Bn._invalidate(e),!1!==Bn.notify(e,"beforeUpdate")){e.tooltip._data=e.data;var n=e.buildOrUpdateControllers();Bt.each(e.data.datasets,function(t,n){e.getDatasetMeta(n).controller.buildOrUpdateElements()},e),e.updateLayout(),e.options.animation&&e.options.animation.duration&&Bt.each(n,function(t){t.reset()}),e.updateDatasets(),e.tooltip.initialize(),e.lastActive=[],Bn.notify(e,"afterUpdate"),e._bufferedRender?e._bufferedRequest={duration:t.duration,easing:t.easing,lazy:t.lazy}:e.render(t)}},updateLayout:function(){var t=this;!1!==Bn.notify(t,"beforeLayout")&&(hn.update(this,this.width,this.height),Bn.notify(t,"afterScaleUpdate"),Bn.notify(t,"afterLayout"))},updateDatasets:function(){var t=this;if(!1!==Bn.notify(t,"beforeDatasetsUpdate")){for(var e=0,n=t.data.datasets.length;e=0;--n)e.isDatasetVisible(n)&&e.drawDataset(n,t);Bn.notify(e,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n=this,a=n.getDatasetMeta(t),r={meta:a,index:t,easingValue:e};!1!==Bn.notify(n,"beforeDatasetDraw",[r])&&(a.controller.draw(e),Bn.notify(n,"afterDatasetDraw",[r]))},_drawTooltip:function(t){var e=this,n=e.tooltip,a={tooltip:n,easingValue:t};!1!==Bn.notify(e,"beforeTooltipDraw",[a])&&(n.draw(),Bn.notify(e,"afterTooltipDraw",[a]))},getElementAtEvent:function(t){return ln.modes.single(this,t)},getElementsAtEvent:function(t){return ln.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return ln.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,n){var a=ln.modes[e];return"function"===typeof a?a(this,t,n):[]},getDatasetAtEvent:function(t){return ln.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this,n=e.data.datasets[t];n._meta||(n._meta={});var a=n._meta[e.id];return a||(a=n._meta[e.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null}),a},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e=0;a--){var r=t[a];if(e(r))return r}},Bt.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},Bt.almostEquals=function(t,e,n){return Math.abs(t-e)t},Bt.max=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.max(t,e)},Number.NEGATIVE_INFINITY)},Bt.min=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.min(t,e)},Number.POSITIVE_INFINITY)},Bt.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return t=+t,0===t||isNaN(t)?t:t>0?1:-1},Bt.log10=Math.log10?function(t){return Math.log10(t)}:function(t){var e=Math.log(t)*Math.LOG10E,n=Math.round(e),a=t===Math.pow(10,n);return a?n:e},Bt.toRadians=function(t){return t*(Math.PI/180)},Bt.toDegrees=function(t){return t*(180/Math.PI)},Bt._decimalPlaces=function(t){if(Bt.isFinite(t)){var e=1,n=0;while(Math.round(t*e)/e!==t)e*=10,n++;return n}},Bt.getAngleFromPoint=function(t,e){var n=e.x-t.x,a=e.y-t.y,r=Math.sqrt(n*n+a*a),i=Math.atan2(a,n);return i<-.5*Math.PI&&(i+=2*Math.PI),{angle:i,distance:r}},Bt.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},Bt.aliasPixel=function(t){return t%2===0?0:.5},Bt._alignPixel=function(t,e,n){var a=t.currentDevicePixelRatio,r=n/2;return Math.round((e-r)*a)/a+r},Bt.splineCurve=function(t,e,n,a){var r=t.skip?e:t,i=e,o=n.skip?e:n,s=Math.sqrt(Math.pow(i.x-r.x,2)+Math.pow(i.y-r.y,2)),l=Math.sqrt(Math.pow(o.x-i.x,2)+Math.pow(o.y-i.y,2)),d=s/(s+l),u=l/(s+l);d=isNaN(d)?0:d,u=isNaN(u)?0:u;var c=a*d,f=a*u;return{previous:{x:i.x-c*(o.x-r.x),y:i.y-c*(o.y-r.y)},next:{x:i.x+f*(o.x-r.x),y:i.y+f*(o.y-r.y)}}},Bt.EPSILON=Number.EPSILON||1e-14,Bt.splineCurveMonotone=function(t){var e,n,a,r,i,o,s,l,d,u=(t||[]).map(function(t){return{model:t._model,deltaK:0,mK:0}}),c=u.length;for(e=0;e0?u[e-1]:null,r=e0?u[e-1]:null,r=e=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},Bt.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},Bt.niceNum=function(t,e){var n,a=Math.floor(Bt.log10(t)),r=t/Math.pow(10,a);return n=e?r<1.5?1:r<3?2:r<7?5:10:r<=1?1:r<=2?2:r<=5?5:10,n*Math.pow(10,a)},Bt.requestAnimFrame=function(){return"undefined"===typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)}}(),Bt.getRelativePosition=function(t,e){var n,a,r=t.originalEvent||t,i=t.target||t.srcElement,o=i.getBoundingClientRect(),s=r.touches;s&&s.length>0?(n=s[0].clientX,a=s[0].clientY):(n=r.clientX,a=r.clientY);var l=parseFloat(Bt.getStyle(i,"padding-left")),d=parseFloat(Bt.getStyle(i,"padding-top")),u=parseFloat(Bt.getStyle(i,"padding-right")),c=parseFloat(Bt.getStyle(i,"padding-bottom")),f=o.right-o.left-l-u,h=o.bottom-o.top-d-c;return n=Math.round((n-o.left-l)/f*i.width/e.currentDevicePixelRatio),a=Math.round((a-o.top-d)/h*i.height/e.currentDevicePixelRatio),{x:n,y:a}},Bt.getConstraintWidth=function(t){return n(t,"max-width","clientWidth")},Bt.getConstraintHeight=function(t){return n(t,"max-height","clientHeight")},Bt._calculatePadding=function(t,e,n){return e=Bt.getStyle(t,e),e.indexOf("%")>-1?n*parseInt(e,10)/100:parseInt(e,10)},Bt._getParentNode=function(t){var e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e},Bt.getMaximumWidth=function(t){var e=Bt._getParentNode(t);if(!e)return t.clientWidth;var n=e.clientWidth,a=Bt._calculatePadding(e,"padding-left",n),r=Bt._calculatePadding(e,"padding-right",n),i=n-a-r,o=Bt.getConstraintWidth(t);return isNaN(o)?i:Math.min(i,o)},Bt.getMaximumHeight=function(t){var e=Bt._getParentNode(t);if(!e)return t.clientHeight;var n=e.clientHeight,a=Bt._calculatePadding(e,"padding-top",n),r=Bt._calculatePadding(e,"padding-bottom",n),i=n-a-r,o=Bt.getConstraintHeight(t);return isNaN(o)?i:Math.min(i,o)},Bt.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},Bt.retinaScale=function(t,e){var n=t.currentDevicePixelRatio=e||"undefined"!==typeof window&&window.devicePixelRatio||1;if(1!==n){var a=t.canvas,r=t.height,i=t.width;a.height=r*n,a.width=i*n,t.ctx.scale(n,n),a.style.height||a.style.width||(a.style.height=r+"px",a.style.width=i+"px")}},Bt.fontString=function(t,e,n){return e+" "+t+"px "+n},Bt.longestText=function(t,e,n,a){a=a||{};var r=a.data=a.data||{},i=a.garbageCollect=a.garbageCollect||[];a.font!==e&&(r=a.data={},i=a.garbageCollect=[],a.font=e),t.font=e;var o=0;Bt.each(n,function(e){void 0!==e&&null!==e&&!0!==Bt.isArray(e)?o=Bt.measureText(t,r,i,o,e):Bt.isArray(e)&&Bt.each(e,function(e){void 0===e||null===e||Bt.isArray(e)||(o=Bt.measureText(t,r,i,o,e))})});var s=i.length/2;if(s>n.length){for(var l=0;la&&(a=i),a},Bt.numberOfLabelLines=function(t){var e=1;return Bt.each(t,function(t){Bt.isArray(t)&&t.length>e&&(e=t.length)}),e},Bt.color=Dt?function(t){return t instanceof CanvasGradient&&(t=Rt.global.defaultColor),Dt(t)}:function(t){return console.error("Color.js not found!"),t},Bt.getHoverColor=function(t){return t instanceof CanvasPattern||t instanceof CanvasGradient?t:Bt.color(t).saturate(.5).darken(.1).rgbString()}};function _a(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}function va(t){this.options=t||{}}Bt.extend(va.prototype,{formats:_a,parse:_a,format:_a,add:_a,diff:_a,startOf:_a,endOf:_a,_create:function(t){return t}}),va.override=function(t){Bt.extend(va.prototype,t)};var ya=va,ga={_date:ya},ba={formatters:{values:function(t){return Bt.isArray(t)?t:""+t},linear:function(t,e,n){var a=n.length>3?n[2]-n[1]:n[1]-n[0];Math.abs(a)>1&&t!==Math.floor(t)&&(a=t-Math.floor(t));var r=Bt.log10(Math.abs(a)),i="";if(0!==t){var o=Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]));if(o<1e-4){var s=Bt.log10(Math.abs(t));i=t.toExponential(Math.floor(s)-Math.floor(r))}else{var l=-1*Math.floor(r);l=Math.max(Math.min(l,20),0),i=t.toFixed(l)}}else i="0";return i},logarithmic:function(t,e,n){var a=t/Math.pow(10,Math.floor(Bt.log10(t)));return 0===t?"0":1===a||2===a||5===a||0===e||e===n.length-1?t.toExponential():""}}},Ma=Bt.valueOrDefault,ka=Bt.valueAtIndexOrDefault;function wa(t){var e,n,a=[];for(e=0,n=t.length;eu&&it.maxHeight){i--;break}i++,d=o*l}}t.labelRotation=i},afterCalculateTickRotation:function(){Bt.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){Bt.callback(this.options.beforeFit,[this])},fit:function(){var t=this,e=t.minSize={width:0,height:0},n=wa(t._ticks),a=t.options,r=a.ticks,i=a.scaleLabel,o=a.gridLines,s=t._isVisible(),l=a.position,d=t.isHorizontal(),u=Bt.options._parseFont,c=u(r),f=a.gridLines.tickMarkLength;if(e.width=d?t.isFullWidth()?t.maxWidth-t.margins.left-t.margins.right:t.maxWidth:s&&o.drawTicks?f:0,e.height=d?s&&o.drawTicks?f:0:t.maxHeight,i.display&&s){var h=u(i),m=Bt.options.toPadding(i.padding),p=h.lineHeight+m.height;d?e.height+=p:e.width+=p}if(r.display&&s){var _=Bt.longestText(t.ctx,c.string,n,t.longestTextCache),v=Bt.numberOfLabelLines(n),y=.5*c.size,g=t.options.ticks.padding;if(t._maxLabelLines=v,t.longestLabelWidth=_,d){var b=Bt.toRadians(t.labelRotation),M=Math.cos(b),k=Math.sin(b),w=k*_+c.lineHeight*v+y;e.height=Math.min(t.maxHeight,e.height+w+g),t.ctx.font=c.string;var x,L,Y=La(t.ctx,n[0],c.string),D=La(t.ctx,n[n.length-1],c.string),S=t.getPixelForTick(0)-t.left,T=t.right-t.getPixelForTick(n.length-1);0!==t.labelRotation?(x="bottom"===l?M*Y:M*y,L="bottom"===l?M*y:M*D):(x=Y/2,L=D/2),t.paddingLeft=Math.max(x-S,0)+3,t.paddingRight=Math.max(L-T,0)+3}else r.mirror?_=0:_+=g+y,e.width=Math.min(t.maxWidth,e.width+_),t.paddingTop=c.size/2,t.paddingBottom=c.size/2}t.handleMargins(),t.width=e.width,t.height=e.height},handleMargins:function(){var t=this;t.margins&&(t.paddingLeft=Math.max(t.paddingLeft-t.margins.left,0),t.paddingTop=Math.max(t.paddingTop-t.margins.top,0),t.paddingRight=Math.max(t.paddingRight-t.margins.right,0),t.paddingBottom=Math.max(t.paddingBottom-t.margins.bottom,0))},afterFit:function(){Bt.callback(this.options.afterFit,[this])},isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(Bt.isNullOrUndef(t))return NaN;if(("number"===typeof t||t instanceof Number)&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},getLabelForIndex:Bt.noop,getPixelForValue:Bt.noop,getValueForPixel:Bt.noop,getPixelForTick:function(t){var e=this,n=e.options.offset;if(e.isHorizontal()){var a=e.width-(e.paddingLeft+e.paddingRight),r=a/Math.max(e._ticks.length-(n?0:1),1),i=r*t+e.paddingLeft;n&&(i+=r/2);var o=e.left+i;return o+=e.isFullWidth()?e.margins.left:0,o}var s=e.height-(e.paddingTop+e.paddingBottom);return e.top+t*(s/(e._ticks.length-1))},getPixelForDecimal:function(t){var e=this;if(e.isHorizontal()){var n=e.width-(e.paddingLeft+e.paddingRight),a=n*t+e.paddingLeft,r=e.left+a;return r+=e.isFullWidth()?e.margins.left:0,r}return e.top+t*e.height},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this,e=t.min,n=t.max;return t.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0},_autoSkip:function(t){var e,n,a=this,r=a.isHorizontal(),i=a.options.ticks.minor,o=t.length,s=!1,l=i.maxTicksLimit,d=a._tickSize()*(o-1),u=r?a.width-(a.paddingLeft+a.paddingRight):a.height-(a.paddingTop+a.PaddingBottom),c=[];for(d>u&&(s=1+Math.floor(d/u)),o>l&&(s=Math.max(s,1+Math.floor(o/l))),e=0;e1&&e%s>0&&delete n.label,c.push(n);return c},_tickSize:function(){var t=this,e=t.isHorizontal(),n=t.options.ticks.minor,a=Bt.toRadians(t.labelRotation),r=Math.abs(Math.cos(a)),i=Math.abs(Math.sin(a)),o=n.autoSkipPadding||0,s=t.longestLabelWidth+o||0,l=Bt.options._parseFont(n),d=t._maxLabelLines*l.lineHeight+o||0;return e?d*r>s*i?s/r:d/i:d*iu&&(_=Bt.niceNum(i*_/u/d)*d),l||Ha(h)?n=Math.pow(10,Bt._decimalPlaces(_)):(n=Math.pow(10,h),_=Math.ceil(_*n)/n),a=Math.floor(m/_)*_,r=Math.ceil(p/_)*_,l&&(!Ha(c)&&Bt.almostWhole(c/_,_/1e3)&&(a=c),!Ha(f)&&Bt.almostWhole(f/_,_/1e3)&&(r=f)),i=(r-a)/_,i=Bt.almostEquals(i,Math.round(i),_/1e3)?Math.round(i):Math.ceil(i),a=Math.round(a*n)/n,r=Math.round(r*n)/n,o.push(Ha(c)?a:c);for(var v=1;v0&&r>0&&(t.min=0)}var i=void 0!==n.min||void 0!==n.suggestedMin,o=void 0!==n.max||void 0!==n.suggestedMax;void 0!==n.min?t.min=n.min:void 0!==n.suggestedMin&&(null===t.min?t.min=n.suggestedMin:t.min=Math.min(t.min,n.suggestedMin)),void 0!==n.max?t.max=n.max:void 0!==n.suggestedMax&&(null===t.max?t.max=n.suggestedMax:t.max=Math.max(t.max,n.suggestedMax)),i!==o&&t.min>=t.max&&(i?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,n.beginAtZero||t.min--)},getTickLimit:function(){var t,e=this,n=e.options.ticks,a=n.stepSize,r=n.maxTicksLimit;return a?t=Math.ceil(e.max/a)-Math.floor(e.min/a)+1:(t=e._computeTickLimit(),r=r||11),r&&(t=Math.min(r,t)),t},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:Oa,buildTicks:function(){var t=this,e=t.options,n=e.ticks,a=t.getTickLimit();a=Math.max(2,a);var r={maxTicks:a,min:n.min,max:n.max,precision:n.precision,stepSize:Bt.valueOrDefault(n.fixedStepSize,n.stepSize)},i=t.ticks=Aa(r,t);t.handleDirectionalChanges(),t.max=Bt.max(i),t.min=Bt.min(i),n.reverse?(i.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){var t=this;t.ticksAsNumbers=t.ticks.slice(),t.zeroLineIndex=t.ticks.indexOf(0),Ya.prototype.convertTicksToLabels.call(t)}}),ja={position:"left",ticks:{callback:ba.formatters.linear}},Ca=Pa.extend({determineDataLimits:function(){var t=this,e=t.options,n=t.chart,a=n.data,r=a.datasets,i=t.isHorizontal(),o=0,s=1;function l(e){return i?e.xAxisID===t.id:e.yAxisID===t.id}t.min=null,t.max=null;var d=e.stacked;if(void 0===d&&Bt.each(r,function(t,e){if(!d){var a=n.getDatasetMeta(e);n.isDatasetVisible(e)&&l(a)&&void 0!==a.stack&&(d=!0)}}),e.stacked||d){var u={};Bt.each(r,function(a,r){var i=n.getDatasetMeta(r),o=[i.type,void 0===e.stacked&&void 0===i.stack?r:"",i.stack].join(".");void 0===u[o]&&(u[o]={positiveValues:[],negativeValues:[]});var s=u[o].positiveValues,d=u[o].negativeValues;n.isDatasetVisible(r)&&l(i)&&Bt.each(a.data,function(n,a){var r=+t.getRightValue(n);isNaN(r)||i.data[a].hidden||(s[a]=s[a]||0,d[a]=d[a]||0,e.relativePoints?s[a]=100:r<0?d[a]+=r:s[a]+=r)})}),Bt.each(u,function(e){var n=e.positiveValues.concat(e.negativeValues),a=Bt.min(n),r=Bt.max(n);t.min=null===t.min?a:Math.min(t.min,a),t.max=null===t.max?r:Math.max(t.max,r)})}else Bt.each(r,function(e,a){var r=n.getDatasetMeta(a);n.isDatasetVisible(a)&&l(r)&&Bt.each(e.data,function(e,n){var a=+t.getRightValue(e);isNaN(a)||r.data[n].hidden||(null===t.min?t.min=a:at.max&&(t.max=a))})});t.min=isFinite(t.min)&&!isNaN(t.min)?t.min:o,t.max=isFinite(t.max)&&!isNaN(t.max)?t.max:s,this.handleTickRangeOptions()},_computeTickLimit:function(){var t,e=this;return e.isHorizontal()?Math.ceil(e.width/40):(t=Bt.options._parseFont(e.options.ticks),Math.ceil(e.height/t.lineHeight))},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},getPixelForValue:function(t){var e,n=this,a=n.start,r=+n.getRightValue(t),i=n.end-a;return e=n.isHorizontal()?n.left+n.width/i*(r-a):n.bottom-n.height/i*(r-a),e},getValueForPixel:function(t){var e=this,n=e.isHorizontal(),a=n?e.width:e.height,r=(n?t-e.left:e.bottom-t)/a;return e.start+(e.end-e.start)*r},getPixelForTick:function(t){return this.getPixelForValue(this.ticksAsNumbers[t])}}),za=ja;Ca._defaults=za;var Ea=Bt.valueOrDefault;function Fa(t,e){var n,a,r=[],i=Ea(t.min,Math.pow(10,Math.floor(Bt.log10(e.min)))),o=Math.floor(Bt.log10(e.max)),s=Math.ceil(e.max/Math.pow(10,o));0===i?(n=Math.floor(Bt.log10(e.minNotZero)),a=Math.floor(e.minNotZero/Math.pow(10,n)),r.push(i),i=a*Math.pow(10,n)):(n=Math.floor(Bt.log10(i)),a=Math.floor(i/Math.pow(10,n)));var l=n<0?Math.pow(10,Math.abs(n)):1;do{r.push(i),++a,10===a&&(a=1,++n,l=n>=0?1:l),i=Math.round(a*Math.pow(10,n)*l)/l}while(n=0?t:e}var Ra=Ya.extend({determineDataLimits:function(){var t=this,e=t.options,n=t.chart,a=n.data,r=a.datasets,i=t.isHorizontal();function o(e){return i?e.xAxisID===t.id:e.yAxisID===t.id}t.min=null,t.max=null,t.minNotZero=null;var s=e.stacked;if(void 0===s&&Bt.each(r,function(t,e){if(!s){var a=n.getDatasetMeta(e);n.isDatasetVisible(e)&&o(a)&&void 0!==a.stack&&(s=!0)}}),e.stacked||s){var l={};Bt.each(r,function(a,r){var i=n.getDatasetMeta(r),s=[i.type,void 0===e.stacked&&void 0===i.stack?r:"",i.stack].join(".");n.isDatasetVisible(r)&&o(i)&&(void 0===l[s]&&(l[s]=[]),Bt.each(a.data,function(e,n){var a=l[s],r=+t.getRightValue(e);isNaN(r)||i.data[n].hidden||r<0||(a[n]=a[n]||0,a[n]+=r)}))}),Bt.each(l,function(e){if(e.length>0){var n=Bt.min(e),a=Bt.max(e);t.min=null===t.min?n:Math.min(t.min,n),t.max=null===t.max?a:Math.max(t.max,a)}})}else Bt.each(r,function(e,a){var r=n.getDatasetMeta(a);n.isDatasetVisible(a)&&o(r)&&Bt.each(e.data,function(e,n){var a=+t.getRightValue(e);isNaN(a)||r.data[n].hidden||a<0||(null===t.min?t.min=a:at.max&&(t.max=a),0!==a&&(null===t.minNotZero||a0?t.minNotZero=t.min:t.max<1?t.minNotZero=Math.pow(10,Math.floor(Bt.log10(t.max))):t.minNotZero=n)},buildTicks:function(){var t=this,e=t.options.ticks,n=!t.isHorizontal(),a={min:Wa(e.min),max:Wa(e.max)},r=t.ticks=Fa(a,t);t.max=Bt.max(r),t.min=Bt.min(r),e.reverse?(n=!n,t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),n&&r.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),Ya.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},getPixelForTick:function(t){return this.getPixelForValue(this.tickValues[t])},_getFirstTickValue:function(t){var e=Math.floor(Bt.log10(t)),n=Math.floor(t/Math.pow(10,e));return n*Math.pow(10,e)},getPixelForValue:function(t){var e,n,a,r,i,o=this,s=o.options.ticks,l=s.reverse,d=Bt.log10,u=o._getFirstTickValue(o.minNotZero),c=0;return t=+o.getRightValue(t),l?(a=o.end,r=o.start,i=-1):(a=o.start,r=o.end,i=1),o.isHorizontal()?(e=o.width,n=l?o.right:o.left):(e=o.height,i*=-1,n=l?o.top:o.bottom),t!==a&&(0===a&&(c=Ea(s.fontSize,Rt.global.defaultFontSize),e-=c,a=u),0!==t&&(c+=e/(d(r)-d(a))*(d(t)-d(a))),n+=i*c),n},getValueForPixel:function(t){var e,n,a,r,i=this,o=i.options.ticks,s=o.reverse,l=Bt.log10,d=i._getFirstTickValue(i.minNotZero);if(s?(n=i.end,a=i.start):(n=i.start,a=i.end),i.isHorizontal()?(e=i.width,r=s?i.right-t:t-i.left):(e=i.height,r=s?t-i.top:i.bottom-t),r!==n){if(0===n){var u=Ea(o.fontSize,Rt.global.defaultFontSize);r-=u,e-=u,n=d}r*=l(a)-l(n),r/=e,r=Math.pow(10,l(n)+r)}return r}}),Na=Ia;Ra._defaults=Na;var Va=Bt.valueOrDefault,Ua=Bt.valueAtIndexOrDefault,Ba=Bt.options.resolve,$a={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0, 0, 0, 0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:ba.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}};function Ja(t){var e=t.options;return e.angleLines.display||e.pointLabels.display?t.chart.data.labels.length:0}function Ga(t){var e=t.ticks;return e.display&&t.display?Va(e.fontSize,Rt.global.defaultFontSize)+2*e.backdropPaddingY:0}function qa(t,e,n){return Bt.isArray(n)?{w:Bt.longestText(t,t.font,n),h:n.length*e}:{w:t.measureText(n).width,h:e}}function Xa(t,e,n,a,r){return t===a||t===r?{start:e-n/2,end:e+n/2}:tr?{start:e-n,end:e}:{start:e,end:e+n}}function Qa(t){var e,n,a,r=Bt.options._parseFont(t.options.pointLabels),i={l:0,r:t.width,t:0,b:t.height-t.paddingTop},o={};t.ctx.font=r.string,t._pointLabelSizes=[];var s=Ja(t);for(e=0;ei.r&&(i.r=u.end,o.r=l),c.starti.b&&(i.b=c.end,o.b=l)}t.setReductions(t.drawingArea,i,o)}function Za(t){return 0===t||180===t?"center":t<180?"left":"right"}function Ka(t,e,n,a){var r,i,o=n.y+a/2;if(Bt.isArray(e))for(r=0,i=e.length;r270||t<90)&&(n.y-=e.h)}function er(t){var e=t.ctx,n=t.options,a=n.angleLines,r=n.gridLines,i=n.pointLabels,o=Va(a.lineWidth,r.lineWidth),s=Va(a.color,r.color),l=Ga(n);e.save(),e.lineWidth=o,e.strokeStyle=s,e.setLineDash&&(e.setLineDash(Ba([a.borderDash,r.borderDash,[]])),e.lineDashOffset=Ba([a.borderDashOffset,r.borderDashOffset,0]));var d=t.getDistanceFromCenterForValue(n.ticks.reverse?t.min:t.max),u=Bt.options._parseFont(i);e.font=u.string,e.textBaseline="middle";for(var c=Ja(t)-1;c>=0;c--){if(a.display&&o&&s){var f=t.getPointPosition(c,d);e.beginPath(),e.moveTo(t.xCenter,t.yCenter),e.lineTo(f.x,f.y),e.stroke()}if(i.display){var h=0===c?l/2:0,m=t.getPointPosition(c,d+h+5),p=Ua(i.fontColor,c,Rt.global.defaultFontColor);e.fillStyle=p;var _=t.getIndexAngle(c),v=Bt.toDegrees(_);e.textAlign=Za(v),tr(v,t._pointLabelSizes[c],m),Ka(e,t.pointLabels[c]||"",m,u.lineHeight)}}e.restore()}function nr(t,e,n,a){var r,i=t.ctx,o=e.circular,s=Ja(t),l=Ua(e.color,a-1),d=Ua(e.lineWidth,a-1);if((o||s)&&l&&d){if(i.save(),i.strokeStyle=l,i.lineWidth=d,i.setLineDash&&(i.setLineDash(e.borderDash||[]),i.lineDashOffset=e.borderDashOffset||0),i.beginPath(),o)i.arc(t.xCenter,t.yCenter,n,0,2*Math.PI);else{r=t.getPointPosition(0,n),i.moveTo(r.x,r.y);for(var u=1;u0&&n>0?e:0)},draw:function(){var t=this,e=t.options,n=e.gridLines,a=e.ticks;if(e.display){var r=t.ctx,i=this.getIndexAngle(0),o=Bt.options._parseFont(a);(e.angleLines.display||e.pointLabels.display)&&er(t),Bt.each(t.ticks,function(e,s){if(s>0||a.reverse){var l=t.getDistanceFromCenterForValue(t.ticksAsNumbers[s]);if(n.display&&0!==s&&nr(t,n,l,s),a.display){var d=Va(a.fontColor,Rt.global.defaultFontColor);if(r.font=o.string,r.save(),r.translate(t.xCenter,t.yCenter),r.rotate(i),a.showLabelBackdrop){var u=r.measureText(e).width;r.fillStyle=a.backdropColor,r.fillRect(-u/2-a.backdropPaddingX,-l-o.size/2-a.backdropPaddingY,u+2*a.backdropPaddingX,o.size+2*a.backdropPaddingY)}r.textAlign="center",r.textBaseline="middle",r.fillStyle=d,r.fillText(e,0,-l),r.restore()}}})}}}),ir=$a;rr._defaults=ir;var or=Bt.valueOrDefault,sr=Number.MIN_SAFE_INTEGER||-9007199254740991,lr=Number.MAX_SAFE_INTEGER||9007199254740991,dr={millisecond:{common:!0,size:1,steps:[1,2,5,10,20,50,100,250,500]},second:{common:!0,size:1e3,steps:[1,2,5,10,15,30]},minute:{common:!0,size:6e4,steps:[1,2,5,10,15,30]},hour:{common:!0,size:36e5,steps:[1,2,3,6,12]},day:{common:!0,size:864e5,steps:[1,2,5]},week:{common:!1,size:6048e5,steps:[1,2,3,4]},month:{common:!0,size:2628e6,steps:[1,2,3]},quarter:{common:!1,size:7884e6,steps:[1,2,3,4]},year:{common:!0,size:3154e7}},ur=Object.keys(dr);function cr(t,e){return t-e}function fr(t){var e,n,a,r={},i=[];for(e=0,n=t.length;ee&&s=0&&o<=s){if(a=o+s>>1,r=t[a-1]||null,i=t[a],!r)return{lo:null,hi:i};if(i[e]n))return{lo:r,hi:i};s=a-1}}return{lo:i,hi:null}}function pr(t,e,n,a){var r=mr(t,e,n),i=r.lo?r.hi?r.lo:t[t.length-2]:t[0],o=r.lo?r.hi?r.hi:t[t.length-1]:t[1],s=o[e]-i[e],l=s?(n-i[e])/s:0,d=(o[a]-i[a])*l;return i[a]+d}function _r(t,e){var n=t._adapter,a=t.options.time,r=a.parser,i=r||a.format,o=e;return"function"===typeof r&&(o=r(o)),Bt.isFinite(o)||(o="string"===typeof i?n.parse(o,i):n.parse(o)),null!==o?+o:(r||"function"!==typeof i||(o=i(e),Bt.isFinite(o)||(o=n.parse(o))),o)}function vr(t,e){if(Bt.isNullOrUndef(e))return null;var n=t.options.time,a=_r(t,t.getRightValue(e));return null===a?a:(n.round&&(a=+t._adapter.startOf(a,n.round)),a)}function yr(t,e,n,a){var r,i,o,s=e-t,l=dr[n],d=l.size,u=l.steps;if(!u)return Math.ceil(s/(a*d));for(r=0,i=u.length;r=ur.indexOf(n);i--)if(o=ur[i],dr[o].common&&t._adapter.diff(r,a,o)>=e.length)return o;return ur[n?ur.indexOf(n):0]}function Mr(t){for(var e=ur.indexOf(t)+1,n=ur.length;e=r&&n<=i&&d.push(n);return a.min=r,a.max=i,a._unit=s.unit||br(a,d,s.minUnit,a.min,a.max),a._majorUnit=Mr(a._unit),a._table=hr(a._timestamps.data,r,i,o.distribution),a._offsets=wr(a._table,d,r,i,o),o.ticks.reverse&&d.reverse(),xr(a,d,a._majorUnit)},getLabelForIndex:function(t,e){var n=this,a=n._adapter,r=n.chart.data,i=n.options.time,o=r.labels&&t=0&&t0?o:1}}),Dr=Lr;Yr._defaults=Dr;var Sr={category:Sa,linear:Ca,logarithmic:Ra,radialLinear:rr,time:Yr},Tr={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};ga._date.override("function"===typeof t?{_id:"moment",formats:function(){return Tr},parse:function(e,n){return"string"===typeof e&&"string"===typeof n?e=t(e,n):e instanceof t||(e=t(e)),e.isValid()?e.valueOf():null},format:function(e,n){return t(e).format(n)},add:function(e,n,a){return t(e).add(n,a).valueOf()},diff:function(e,n,a){return t.duration(t(e).diff(t(n))).as(a)},startOf:function(e,n,a){return e=t(e),"isoWeek"===n?e.isoWeekday(a).valueOf():e.startOf(n).valueOf()},endOf:function(e,n){return t(e).endOf(n).valueOf()},_create:function(e){return t(e)}}:{}),Rt._set("global",{plugins:{filler:{propagate:!0}}});var Or={dataset:function(t){var e=t.fill,n=t.chart,a=n.getDatasetMeta(e),r=a&&n.isDatasetVisible(e),i=r&&a.dataset._children||[],o=i.length||0;return o?function(t,e){return e=n)&&a;switch(i){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return i;default:return!1}}function Ar(t){var e,n=t.el._model||{},a=t.el._scale||{},r=t.fill,i=null;if(isFinite(r))return null;if("start"===r?i=void 0===n.scaleBottom?a.bottom:n.scaleBottom:"end"===r?i=void 0===n.scaleTop?a.top:n.scaleTop:void 0!==n.scaleZero?i=n.scaleZero:a.getBasePosition?i=a.getBasePosition():a.getBasePixel&&(i=a.getBasePixel()),void 0!==i&&null!==i){if(void 0!==i.x&&void 0!==i.y)return i;if(Bt.isFinite(i))return e=a.isHorizontal(),{x:e?i:null,y:e?null:i}}return null}function Pr(t,e,n){var a,r=t[e],i=r.fill,o=[e];if(!n)return i;while(!1!==i&&-1===o.indexOf(i)){if(!isFinite(i))return i;if(a=t[i],!a)return!1;if(a.visible)return i;o.push(i),i=a.fill}return!1}function jr(t){var e=t.fill,n="dataset";return!1===e?null:(isFinite(e)||(n="boundary"),Or[n](t))}function Cr(t){return t&&!t.skip}function zr(t,e,n,a,r){var i;if(a&&r){for(t.moveTo(e[0].x,e[0].y),i=1;i0;--i)Bt.canvas.lineTo(t,n[i],n[i-1],!0)}}function Er(t,e,n,a,r,i){var o,s,l,d,u,c,f,h=e.length,m=a.spanGaps,p=[],_=[],v=0,y=0;for(t.beginPath(),o=0,s=h+!!i;oe?e:t.boxWidth}Rt._set("global",{legend:{display:!0,position:"top",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var n=e.datasetIndex,a=this.chart,r=a.getDatasetMeta(n);r.hidden=null===r.hidden?!a.data.datasets[n].hidden:null,a.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data;return Bt.isArray(e.datasets)?e.datasets.map(function(e,n){return{text:e.label,fillStyle:Bt.isArray(e.backgroundColor)?e.backgroundColor[0]:e.backgroundColor,hidden:!t.isDatasetVisible(n),lineCap:e.borderCapStyle,lineDash:e.borderDash,lineDashOffset:e.borderDashOffset,lineJoin:e.borderJoinStyle,lineWidth:e.borderWidth,strokeStyle:e.borderColor,pointStyle:e.pointStyle,datasetIndex:n}},this):[]}}},legendCallback:function(t){var e=[];e.push('
    ');for(var n=0;n'),t.data.datasets[n].label&&e.push(t.data.datasets[n].label),e.push("");return e.push("
"),e.join("")}});var Nr=Qt.extend({initialize:function(t){Bt.extend(this,t),this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1},beforeUpdate:Ir,update:function(t,e,n){var a=this;return a.beforeUpdate(),a.maxWidth=t,a.maxHeight=e,a.margins=n,a.beforeSetDimensions(),a.setDimensions(),a.afterSetDimensions(),a.beforeBuildLabels(),a.buildLabels(),a.afterBuildLabels(),a.beforeFit(),a.fit(),a.afterFit(),a.afterUpdate(),a.minSize},afterUpdate:Ir,beforeSetDimensions:Ir,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:Ir,beforeBuildLabels:Ir,buildLabels:function(){var t=this,e=t.options.labels||{},n=Bt.callback(e.generateLabels,[t.chart],t)||[];e.filter&&(n=n.filter(function(n){return e.filter(n,t.chart.data)})),t.options.reverse&&n.reverse(),t.legendItems=n},afterBuildLabels:Ir,beforeFit:Ir,fit:function(){var t=this,e=t.options,n=e.labels,a=e.display,r=t.ctx,i=Bt.options._parseFont(n),o=i.size,s=t.legendHitBoxes=[],l=t.minSize,d=t.isHorizontal();if(d?(l.width=t.maxWidth,l.height=a?10:0):(l.width=a?10:0,l.height=t.maxHeight),a)if(r.font=i.string,d){var u=t.lineWidths=[0],c=0;r.textAlign="left",r.textBaseline="top",Bt.each(t.legendItems,function(t,e){var a=Rr(n,o),i=a+o/2+r.measureText(t.text).width;(0===e||u[u.length-1]+i+n.padding>l.width)&&(c+=o+n.padding,u[u.length-(e>0?0:1)]=n.padding),s[e]={left:0,top:0,width:i,height:o},u[u.length-1]+=i+n.padding}),l.height+=c}else{var f=n.padding,h=t.columnWidths=[],m=n.padding,p=0,_=0,v=o+f;Bt.each(t.legendItems,function(t,e){var a=Rr(n,o),i=a+o/2+r.measureText(t.text).width;e>0&&_+v>l.height-f&&(m+=p+n.padding,h.push(p),p=0,_=0),p=Math.max(p,i),_+=v,s[e]={left:0,top:0,width:i,height:o}}),m+=p,h.push(p),l.width+=m}t.width=l.width,t.height=l.height},afterFit:Ir,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,e=t.options,n=e.labels,a=Rt.global,r=a.defaultColor,i=a.elements.line,o=t.width,s=t.lineWidths;if(e.display){var l,d=t.ctx,u=Wr(n.fontColor,a.defaultFontColor),c=Bt.options._parseFont(n),f=c.size;d.textAlign="left",d.textBaseline="middle",d.lineWidth=.5,d.strokeStyle=u,d.fillStyle=u,d.font=c.string;var h=Rr(n,f),m=t.legendHitBoxes,p=function(t,n,a){if(!(isNaN(h)||h<=0)){d.save();var o=Wr(a.lineWidth,i.borderWidth);if(d.fillStyle=Wr(a.fillStyle,r),d.lineCap=Wr(a.lineCap,i.borderCapStyle),d.lineDashOffset=Wr(a.lineDashOffset,i.borderDashOffset),d.lineJoin=Wr(a.lineJoin,i.borderJoinStyle),d.lineWidth=o,d.strokeStyle=Wr(a.strokeStyle,r),d.setLineDash&&d.setLineDash(Wr(a.lineDash,i.borderDash)),e.labels&&e.labels.usePointStyle){var s=h*Math.SQRT2/2,l=t+h/2,u=n+f/2;Bt.canvas.drawPoint(d,a.pointStyle,s,l,u)}else 0!==o&&d.strokeRect(t,n,h,f),d.fillRect(t,n,h,f);d.restore()}},_=function(t,e,n,a){var r=f/2,i=h+r+t,o=e+r;d.fillText(n.text,i,o),n.hidden&&(d.beginPath(),d.lineWidth=2,d.moveTo(i,o),d.lineTo(i+a,o),d.stroke())},v=t.isHorizontal();l=v?{x:t.left+(o-s[0])/2+n.padding,y:t.top+n.padding,line:0}:{x:t.left+n.padding,y:t.top+n.padding,line:0};var y=f+n.padding;Bt.each(t.legendItems,function(e,a){var r=d.measureText(e.text).width,i=h+f/2+r,u=l.x,c=l.y;v?a>0&&u+i+n.padding>t.left+t.minSize.width&&(c=l.y+=y,l.line++,u=l.x=t.left+(o-s[l.line])/2+n.padding):a>0&&c+y>t.top+t.minSize.height&&(u=l.x=u+t.columnWidths[l.line]+n.padding,c=l.y=t.top+n.padding,l.line++),p(u,c,e),m[a].left=u,m[a].top=c,_(u,c,e,r),v?l.x+=i+n.padding:l.y+=y})}},_getLegendItemAt:function(t,e){var n,a,r,i=this;if(t>=i.left&&t<=i.right&&e>=i.top&&e<=i.bottom)for(r=i.legendHitBoxes,n=0;n=a.left&&t<=a.left+a.width&&e>=a.top&&e<=a.top+a.height)return i.legendItems[n];return null},handleEvent:function(t){var e,n=this,a=n.options,r="mouseup"===t.type?"click":t.type;if("mousemove"===r){if(!a.onHover&&!a.onLeave)return}else{if("click"!==r)return;if(!a.onClick)return}e=n._getLegendItemAt(t.x,t.y),"click"===r?e&&a.onClick&&a.onClick.call(n,t.native,e):(a.onLeave&&e!==n._hoveredItem&&(n._hoveredItem&&a.onLeave.call(n,t.native,n._hoveredItem),n._hoveredItem=e),a.onHover&&e&&a.onHover.call(n,t.native,e))}});function Vr(t,e){var n=new Nr({ctx:t.ctx,options:e,chart:t});hn.configure(t,n,e),hn.addBox(t,n),t.legend=n}var Ur={id:"legend",_element:Nr,beforeInit:function(t){var e=t.options.legend;e&&Vr(t,e)},beforeUpdate:function(t){var e=t.options.legend,n=t.legend;e?(Bt.mergeIf(e,Rt.global.legend),n?(hn.configure(t,n,e),n.options=e):Vr(t,e)):n&&(hn.removeBox(t,n),delete t.legend)},afterEvent:function(t,e){var n=t.legend;n&&n.handleEvent(e)}},Br=Bt.noop;Rt._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var $r=Qt.extend({initialize:function(t){var e=this;Bt.extend(e,t),e.legendHitBoxes=[]},beforeUpdate:Br,update:function(t,e,n){var a=this;return a.beforeUpdate(),a.maxWidth=t,a.maxHeight=e,a.margins=n,a.beforeSetDimensions(),a.setDimensions(),a.afterSetDimensions(),a.beforeBuildLabels(),a.buildLabels(),a.afterBuildLabels(),a.beforeFit(),a.fit(),a.afterFit(),a.afterUpdate(),a.minSize},afterUpdate:Br,beforeSetDimensions:Br,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:Br,beforeBuildLabels:Br,buildLabels:Br,afterBuildLabels:Br,beforeFit:Br,fit:function(){var t=this,e=t.options,n=e.display,a=t.minSize,r=Bt.isArray(e.text)?e.text.length:1,i=Bt.options._parseFont(e),o=n?r*i.lineHeight+2*e.padding:0;t.isHorizontal()?(a.width=t.maxWidth,a.height=o):(a.width=o,a.height=t.maxHeight),t.width=a.width,t.height=a.height},afterFit:Br,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,n=t.options;if(n.display){var a,r,i,o=Bt.options._parseFont(n),s=o.lineHeight,l=s/2+n.padding,d=0,u=t.top,c=t.left,f=t.bottom,h=t.right;e.fillStyle=Bt.valueOrDefault(n.fontColor,Rt.global.defaultFontColor),e.font=o.string,t.isHorizontal()?(r=c+(h-c)/2,i=u+l,a=h-c):(r="left"===n.position?c+l:h-l,i=u+(f-u)/2,a=f-u,d=Math.PI*("left"===n.position?-.5:.5)),e.save(),e.translate(r,i),e.rotate(d),e.textAlign="center",e.textBaseline="middle";var m=n.text;if(Bt.isArray(m))for(var p=0,_=0;_1?arguments[1]:void 0,n),l=o>2?arguments[2]:void 0,d=void 0===l?n:r(l,n);while(d>s)e[s++]=t;return e}},"36c3":function(t,e,n){var a=n("335c"),r=n("25eb");t.exports=function(t){return a(r(t))}},3702:function(t,e,n){var a=n("481b"),r=n("5168")("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(a.Array===t||i[r]===t)}},3729:function(t,e,n){var a=n("9e69"),r=n("00fd"),i=n("29f3"),o="[object Null]",s="[object Undefined]",l=a?a.toStringTag:void 0;function d(t){return null==t?void 0===t?s:o:l&&l in Object(t)?r(t):i(t)}t.exports=d},3846:function(t,e,n){n("9e1e")&&"g"!=/./g.flags&&n("86cc").f(RegExp.prototype,"flags",{configurable:!0,get:n("0bfb")})},"386d":function(t,e,n){"use strict";var a=n("cb7c"),r=n("83a1"),i=n("5f1b");n("214f")("search",1,function(t,e,n,o){return[function(n){var a=t(this),r=void 0==n?void 0:n[e];return void 0!==r?r.call(n,a):new RegExp(n)[e](String(a))},function(t){var e=o(n,t,this);if(e.done)return e.value;var s=a(t),l=String(this),d=s.lastIndex;r(d,0)||(s.lastIndex=0);var u=i(s,l);return r(s.lastIndex,d)||(s.lastIndex=d),null===u?-1:u.index}]})},3886:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(t){var e=t%10,n=1===~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n}});return e})},"38fd":function(t,e,n){var a=n("69a8"),r=n("4bf8"),i=n("613b")("IE_PROTO"),o=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=r(t),a(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?o:null}},"39a6":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(t){var e=t%10,n=1===~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n},week:{dow:1,doy:4}});return e})},"39bd":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};function a(t,e,n,a){var r="";if(e)switch(n){case"s":r="काही सेकंद";break;case"ss":r="%d सेकंद";break;case"m":r="एक मिनिट";break;case"mm":r="%d मिनिटे";break;case"h":r="एक तास";break;case"hh":r="%d तास";break;case"d":r="एक दिवस";break;case"dd":r="%d दिवस";break;case"M":r="एक महिना";break;case"MM":r="%d महिने";break;case"y":r="एक वर्ष";break;case"yy":r="%d वर्षे";break}else switch(n){case"s":r="काही सेकंदां";break;case"ss":r="%d सेकंदां";break;case"m":r="एका मिनिटा";break;case"mm":r="%d मिनिटां";break;case"h":r="एका तासा";break;case"hh":r="%d तासां";break;case"d":r="एका दिवसा";break;case"dd":r="%d दिवसां";break;case"M":r="एका महिन्या";break;case"MM":r="%d महिन्यां";break;case"y":r="एका वर्षा";break;case"yy":r="%d वर्षां";break}return r.replace(/%d/i,t)}var r=t.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},preparse:function(t){return t.replace(/[१२३४५६७८९०]/g,function(t){return n[t]})},postformat:function(t){return t.replace(/\d/g,function(t){return e[t]})},meridiemParse:/रात्री|सकाळी|दुपारी|सायंकाळी/,meridiemHour:function(t,e){return 12===t&&(t=0),"रात्री"===e?t<4?t:t+12:"सकाळी"===e?t:"दुपारी"===e?t>=10?t:t+12:"सायंकाळी"===e?t+12:void 0},meridiem:function(t,e,n){return t<4?"रात्री":t<10?"सकाळी":t<17?"दुपारी":t<20?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}});return r})},"3a38":function(t,e){var n=Math.ceil,a=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?a:n)(t)}},"3a39":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},a=t.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(t){return t.replace(/[१२३४५६७८९०]/g,function(t){return n[t]})},postformat:function(t){return t.replace(/\d/g,function(t){return e[t]})},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(t,e){return 12===t&&(t=0),"राति"===e?t<4?t:t+12:"बिहान"===e?t:"दिउँसो"===e?t>=10?t:t+12:"साँझ"===e?t+12:void 0},meridiem:function(t,e,n){return t<3?"राति":t<12?"बिहान":t<16?"दिउँसो":t<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",ss:"%d सेकेण्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}});return a})},"3b1b":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e={0:"-ум",1:"-ум",2:"-юм",3:"-юм",4:"-ум",5:"-ум",6:"-ум",7:"-ум",8:"-ум",9:"-ум",10:"-ум",12:"-ум",13:"-ум",20:"-ум",30:"-юм",40:"-ум",50:"-ум",60:"-ум",70:"-ум",80:"-ум",90:"-ум",100:"-ум"},n=t.defineLocale("tg",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе".split("_"),weekdaysShort:"яшб_дшб_сшб_чшб_пшб_ҷум_шнб".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Имрӯз соати] LT",nextDay:"[Пагоҳ соати] LT",lastDay:"[Дирӯз соати] LT",nextWeek:"dddd[и] [ҳафтаи оянда соати] LT",lastWeek:"dddd[и] [ҳафтаи гузашта соати] LT",sameElse:"L"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"},meridiemParse:/шаб|субҳ|рӯз|бегоҳ/,meridiemHour:function(t,e){return 12===t&&(t=0),"шаб"===e?t<4?t:t+12:"субҳ"===e?t:"рӯз"===e?t>=11?t:t+12:"бегоҳ"===e?t+12:void 0},meridiem:function(t,e,n){return t<4?"шаб":t<11?"субҳ":t<16?"рӯз":t<19?"бегоҳ":"шаб"},dayOfMonthOrdinalParse:/\d{1,2}-(ум|юм)/,ordinal:function(t){var n=t%10,a=t>=100?100:null;return t+(e[t]||e[n]||e[a])},week:{dow:1,doy:7}});return n})},"3b2b":function(t,e,n){var a=n("7726"),r=n("5dbc"),i=n("86cc").f,o=n("9093").f,s=n("aae3"),l=n("0bfb"),d=a.RegExp,u=d,c=d.prototype,f=/a/g,h=/a/g,m=new d(f)!==f;if(n("9e1e")&&(!m||n("79e5")(function(){return h[n("2b4c")("match")]=!1,d(f)!=f||d(h)==h||"/a/i"!=d(f,"i")}))){d=function(t,e){var n=this instanceof d,a=s(t),i=void 0===e;return!n&&a&&t.constructor===d&&i?t:r(m?new u(a&&!i?t.source:t,e):u((a=t instanceof d)?t.source:t,a&&i?l.call(t):e),n?this:c,d)};for(var p=function(t){t in d||i(d,t,{configurable:!0,get:function(){return u[t]},set:function(e){u[t]=e}})},_=o(u),v=0;_.length>v;)p(_[v++]);c.constructor=d,d.prototype=c,n("2aba")(a,"RegExp",d)}n("7a56")("RegExp")},"3c0d":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e="leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),n="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),a=[/^led/i,/^úno/i,/^bře/i,/^dub/i,/^kvě/i,/^(čvn|červen$|června)/i,/^(čvc|červenec|července)/i,/^srp/i,/^zář/i,/^říj/i,/^lis/i,/^pro/i],r=/^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;function i(t){return t>1&&t<5&&1!==~~(t/10)}function o(t,e,n,a){var r=t+" ";switch(n){case"s":return e||a?"pár sekund":"pár sekundami";case"ss":return e||a?r+(i(t)?"sekundy":"sekund"):r+"sekundami";case"m":return e?"minuta":a?"minutu":"minutou";case"mm":return e||a?r+(i(t)?"minuty":"minut"):r+"minutami";case"h":return e?"hodina":a?"hodinu":"hodinou";case"hh":return e||a?r+(i(t)?"hodiny":"hodin"):r+"hodinami";case"d":return e||a?"den":"dnem";case"dd":return e||a?r+(i(t)?"dny":"dní"):r+"dny";case"M":return e||a?"měsíc":"měsícem";case"MM":return e||a?r+(i(t)?"měsíce":"měsíců"):r+"měsíci";case"y":return e||a?"rok":"rokem";case"yy":return e||a?r+(i(t)?"roky":"let"):r+"lety"}}var s=t.defineLocale("cs",{months:e,monthsShort:n,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,monthsShortStrictRegex:/^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,monthsParse:a,longMonthsParse:a,shortMonthsParse:a,weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return s})},"3de5":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"},n={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"},a=t.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",ss:"%d விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},dayOfMonthOrdinalParse:/\d{1,2}வது/,ordinal:function(t){return t+"வது"},preparse:function(t){return t.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,function(t){return n[t]})},postformat:function(t){return t.replace(/\d/g,function(t){return e[t]})},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(t,e,n){return t<2?" யாமம்":t<6?" வைகறை":t<10?" காலை":t<14?" நண்பகல்":t<18?" எற்பாடு":t<22?" மாலை":" யாமம்"},meridiemHour:function(t,e){return 12===t&&(t=0),"யாமம்"===e?t<2?t:t+12:"வைகறை"===e||"காலை"===e?t:"நண்பகல்"===e&&t>=10?t:t+12},week:{dow:0,doy:6}});return a})},"3e92":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e={1:"೧",2:"೨",3:"೩",4:"೪",5:"೫",6:"೬",7:"೭",8:"೮",9:"೯",0:"೦"},n={"೧":"1","೨":"2","೩":"3","೪":"4","೫":"5","೬":"6","೭":"7","೮":"8","೯":"9","೦":"0"},a=t.defineLocale("kn",{months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),monthsParseExact:!0,weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[ಇಂದು] LT",nextDay:"[ನಾಳೆ] LT",nextWeek:"dddd, LT",lastDay:"[ನಿನ್ನೆ] LT",lastWeek:"[ಕೊನೆಯ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",ss:"%d ಸೆಕೆಂಡುಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"},preparse:function(t){return t.replace(/[೧೨೩೪೫೬೭೮೯೦]/g,function(t){return n[t]})},postformat:function(t){return t.replace(/\d/g,function(t){return e[t]})},meridiemParse:/ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,meridiemHour:function(t,e){return 12===t&&(t=0),"ರಾತ್ರಿ"===e?t<4?t:t+12:"ಬೆಳಿಗ್ಗೆ"===e?t:"ಮಧ್ಯಾಹ್ನ"===e?t>=10?t:t+12:"ಸಂಜೆ"===e?t+12:void 0},meridiem:function(t,e,n){return t<4?"ರಾತ್ರಿ":t<10?"ಬೆಳಿಗ್ಗೆ":t<17?"ಮಧ್ಯಾಹ್ನ":t<20?"ಸಂಜೆ":"ರಾತ್ರಿ"},dayOfMonthOrdinalParse:/\d{1,2}(ನೇ)/,ordinal:function(t){return t+"ನೇ"},week:{dow:0,doy:6}});return a})},"40c3":function(t,e,n){var a=n("6b4c"),r=n("5168")("toStringTag"),i="Arguments"==a(function(){return arguments}()),o=function(t,e){try{return t[e]}catch(n){}};t.exports=function(t){var e,n,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=o(e=Object(t),r))?n:i?a(e):"Object"==(s=a(e))&&"function"==typeof e.callee?"Arguments":s}},"41a0":function(t,e,n){"use strict";var a=n("2aeb"),r=n("4630"),i=n("7f20"),o={};n("32e9")(o,n("2b4c")("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=a(o,{next:r(1,n)}),i(t,e+" Iterator")}},"423e":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("ar-kw",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:12}});return e})},4245:function(t,e,n){var a=n("1290");function r(t,e){var n=t.__data__;return a(e)?n["string"==typeof e?"string":"hash"]:n.map}t.exports=r},"440c":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";function e(t,e,n,a){var r={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return e?r[n][0]:r[n][1]}function n(t){var e=t.substr(0,t.indexOf(" "));return r(e)?"a "+t:"an "+t}function a(t){var e=t.substr(0,t.indexOf(" "));return r(e)?"viru "+t:"virun "+t}function r(t){if(t=parseInt(t,10),isNaN(t))return!1;if(t<0)return!0;if(t<10)return 4<=t&&t<=7;if(t<100){var e=t%10,n=t/10;return r(0===e?n:e)}if(t<1e4){while(t>=10)t/=10;return r(t)}return t/=1e3,r(t)}var i=t.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:n,past:a,s:"e puer Sekonnen",ss:"%d Sekonnen",m:e,mm:"%d Minutten",h:e,hh:"%d Stonnen",d:e,dd:"%d Deeg",M:e,MM:"%d Méint",y:e,yy:"%d Joer"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return i})},"454f":function(t,e,n){n("46a7");var a=n("584a").Object;t.exports=function(t,e,n){return a.defineProperty(t,e,n)}},"456d":function(t,e,n){var a=n("4bf8"),r=n("0d58");n("5eda")("keys",function(){return function(t){return r(a(t))}})},4588:function(t,e){var n=Math.ceil,a=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?a:n)(t)}},"45f2":function(t,e,n){var a=n("d9f6").f,r=n("07e3"),i=n("5168")("toStringTag");t.exports=function(t,e,n){t&&!r(t=n?t:t.prototype,i)&&a(t,i,{configurable:!0,value:e})}},4630:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},"469f":function(t,e,n){n("6c1c"),n("1654"),t.exports=n("7d7b")},"46a7":function(t,e,n){var a=n("63b6");a(a.S+a.F*!n("8e60"),"Object",{defineProperty:n("d9f6").f})},"47ee":function(t,e,n){var a=n("c3a1"),r=n("9aa9"),i=n("355d");t.exports=function(t){var e=a(t),n=r.f;if(n){var o,s=n(t),l=i.f,d=0;while(s.length>d)l.call(t,o=s[d++])&&e.push(o)}return e}},"481b":function(t,e){t.exports={}},"485c":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"},n=t.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"birneçə saniyə",ss:"%d saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(t){return/^(gündüz|axşam)$/.test(t)},meridiem:function(t,e,n){return t<4?"gecə":t<12?"səhər":t<17?"gündüz":"axşam"},dayOfMonthOrdinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(t){if(0===t)return t+"-ıncı";var n=t%10,a=t%100-n,r=t>=100?100:null;return t+(e[n]||e[a]||e[r])},week:{dow:1,doy:7}});return n})},4917:function(t,e,n){"use strict";var a=n("cb7c"),r=n("9def"),i=n("0390"),o=n("5f1b");n("214f")("match",1,function(t,e,n,s){return[function(n){var a=t(this),r=void 0==n?void 0:n[e];return void 0!==r?r.call(n,a):new RegExp(n)[e](String(a))},function(t){var e=s(n,t,this);if(e.done)return e.value;var l=a(t),d=String(this);if(!l.global)return o(l,d);var u=l.unicode;l.lastIndex=0;var c,f=[],h=0;while(null!==(c=o(l,d))){var m=String(c[0]);f[h]=m,""===m&&(l.lastIndex=i(d,r(l.lastIndex),u)),h++}return 0===h?null:f}]})},"49ab":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(t,e){return 12===t&&(t=0),"凌晨"===e||"早上"===e||"上午"===e?t:"中午"===e?t>=11?t:t+12:"下午"===e||"晚上"===e?t+12:void 0},meridiem:function(t,e,n){var a=100*t+e;return a<600?"凌晨":a<900?"早上":a<1130?"上午":a<1230?"中午":a<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(t,e){switch(e){case"d":case"D":case"DDD":return t+"日";case"M":return t+"月";case"w":case"W":return t+"週";default:return t}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}});return e})},"49f4":function(t,e,n){var a=n("6044");function r(){this.__data__=a?a(null):{},this.size=0}t.exports=r},"4a59":function(t,e,n){var a=n("9b43"),r=n("1fa8"),i=n("33a4"),o=n("cb7c"),s=n("9def"),l=n("27ee"),d={},u={};e=t.exports=function(t,e,n,c,f){var h,m,p,_,v=f?function(){return t}:l(t),y=a(n,c,e?2:1),g=0;if("function"!=typeof v)throw TypeError(t+" is not iterable!");if(i(v)){for(h=s(t.length);h>g;g++)if(_=e?y(o(m=t[g])[0],m[1]):y(t[g]),_===d||_===u)return _}else for(p=v.call(t);!(m=p.next()).done;)if(_=r(p,y,m.value,e),_===d||_===u)return _};e.BREAK=d,e.RETURN=u},"4ba9":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";function e(t,e,n){var a=t+" ";switch(n){case"ss":return a+=1===t?"sekunda":2===t||3===t||4===t?"sekunde":"sekundi",a;case"m":return e?"jedna minuta":"jedne minute";case"mm":return a+=1===t?"minuta":2===t||3===t||4===t?"minute":"minuta",a;case"h":return e?"jedan sat":"jednog sata";case"hh":return a+=1===t?"sat":2===t||3===t||4===t?"sata":"sati",a;case"dd":return a+=1===t?"dan":"dana",a;case"MM":return a+=1===t?"mjesec":2===t||3===t||4===t?"mjeseca":"mjeseci",a;case"yy":return a+=1===t?"godina":2===t||3===t||4===t?"godine":"godina",a}}var n=t.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:e,m:e,mm:e,h:e,hh:e,d:"dan",dd:e,M:"mjesec",MM:e,y:"godinu",yy:e},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}});return n})},"4bf8":function(t,e,n){var a=n("be13");t.exports=function(t){return Object(a(t))}},"4eb5":function(t,e,n){var a=n("6981"),r={autoSetContainer:!1},i={install:function(t){t.prototype.$clipboardConfig=r,t.prototype.$copyText=function(t,e){return new Promise(function(n,r){var i=document.createElement("button"),o=new a(i,{text:function(){return t},action:function(){return"copy"},container:"object"===typeof e?e:document.body});o.on("success",function(t){o.destroy(),n(t)}),o.on("error",function(t){o.destroy(),r(t)}),i.click()})},t.directive("clipboard",{bind:function(t,e,n){if("success"===e.arg)t._v_clipboard_success=e.value;else if("error"===e.arg)t._v_clipboard_error=e.value;else{var i=new a(t,{text:function(){return e.value},action:function(){return"cut"===e.arg?"cut":"copy"},container:r.autoSetContainer?t:void 0});i.on("success",function(e){var n=t._v_clipboard_success;n&&n(e)}),i.on("error",function(e){var n=t._v_clipboard_error;n&&n(e)}),t._v_clipboard=i}},update:function(t,e){"success"===e.arg?t._v_clipboard_success=e.value:"error"===e.arg?t._v_clipboard_error=e.value:(t._v_clipboard.text=function(){return e.value},t._v_clipboard.action=function(){return"cut"===e.arg?"cut":"copy"})},unbind:function(t,e){"success"===e.arg?delete t._v_clipboard_success:"error"===e.arg?delete t._v_clipboard_error:(t._v_clipboard.destroy(),delete t._v_clipboard)}})},config:r};t.exports=i},"4ee1":function(t,e,n){var a=n("5168")("iterator"),r=!1;try{var i=[7][a]();i["return"]=function(){r=!0},Array.from(i,function(){throw 2})}catch(o){}t.exports=function(t,e){if(!e&&!r)return!1;var n=!1;try{var i=[7],s=i[a]();s.next=function(){return{done:n=!0}},i[a]=function(){return s},t(i)}catch(o){}return n}},"4f7f":function(t,e,n){"use strict";var a=n("c26b"),r=n("b39a"),i="Set";t.exports=n("e0b8")(i,function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function(t){return a.def(r(this,i),t=0===t?0:t,t)}},a)},5038:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(t,e){return 12===t&&(t=0),"pagi"===e?t:"siang"===e?t>=11?t:t+12:"sore"===e||"malam"===e?t+12:void 0},meridiem:function(t,e,n){return t<11?"pagi":t<15?"siang":t<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",ss:"%d detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}});return e})},"504c":function(t,e,n){var a=n("9e1e"),r=n("0d58"),i=n("6821"),o=n("52a7").f;t.exports=function(t){return function(e){var n,s=i(e),l=r(s),d=l.length,u=0,c=[];while(d>u)n=l[u++],a&&!o.call(s,n)||c.push(t?[n,s[n]]:s[n]);return c}}},"50d1":function(t,e,n){(function(e,n){t.exports=n()})(0,function(){"use strict";function t(t){return"[object Array]"===Object.prototype.toString.call(t)}function e(t){return t instanceof Function}function n(t){return"[object Object]"===Object.prototype.toString.call(t)}function a(e,r){var i;for(i in r)n(r[i])||t(r[i])?(n(r[i])&&!n(e[i])&&(e[i]={}),t(r[i])&&!t(e[i])&&(e[i]=[]),a(e[i],r[i])):void 0!==r[i]&&(e[i]=r[i])}function r(t,e){var n={};return a(n,t),a(n,e),n}var i=/^(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)$/i,o=/(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)(T)?(\d\d)(:)?(\d\d)?(:)?(\d\d)?([.,]\d+)?($|Z|([+-])(\d\d)(:)?(\d\d)?)/i,s=String(1.5).charAt(1);function l(t){var e,n,a,r,i,l,d,u,c,f,h;return f=Object.prototype.toString.call(t),"[object Date]"===f?t:"[object String]"===f?(a=t.match(o),a?(h=parseInt(a[1],10),l=parseInt(a[3],10)-1,e=parseInt(a[5],10),n=parseInt(a[7],10),i=a[9]?parseInt(a[9],10):0,c=a[11]?parseInt(a[11],10):0,r=a[12]?1e3*parseFloat(s+a[12].slice(1)):0,u=Date.UTC(h,l,e,n,i,c,r),a[13]&&a[14]&&(d=60*a[15],a[17]&&(d+=parseInt(a[17],10)),d*="-"===a[14]?-1:1,u-=60*d*1e3),new Date(u)):void 0):void 0}function d(t){var e,n,a;for(e=0;e=6}function L(t){return"number"===typeof t}function Y(t,e,n){if(t=t||"",n.prefix&&(e<0&&(e*=-1,t+="-"),t+=n.prefix),n.thousands||n.decimal){e=u(e);var a=e.split(".");e=a[0],n.thousands&&(e=e.replace(/\B(?=(\d{3})+(?!\d))/g,n.thousands)),a.length>1&&(e+=(n.decimal||".")+a[1])}return t+e+(n.suffix||"")}function D(t,e,n){return n in e?e[n]:n in t.options?t.options[n]:null}function S(t){var e,n,a;for(e=0;e25?a=25:a<10&&(a=10),n.scales.xAxes[0].ticks.callback||(n.scales.xAxes[0].ticks.callback=function(t){return t=u(t),t.length>a?t.substring(0,a-2)+"...":t})},U=function(e,n,a){var r={prefix:e.options.prefix,suffix:e.options.suffix,thousands:e.options.thousands,decimal:e.options.decimal};if("pie"!==a){var i=n.scales.yAxes;"bar"===a&&(i=n.scales.xAxes),i[0].ticks.callback||(i[0].ticks.callback=function(t){return Y("",t,r)})}if(!n.tooltips.callbacks.label)if("scatter"===a)n.tooltips.callbacks.label=function(t,e){var n=e.datasets[t.datasetIndex].label||"";return n&&(n+=": "),n+"("+t.xLabel+", "+t.yLabel+")"};else if("bubble"===a)n.tooltips.callbacks.label=function(t,e){var n=e.datasets[t.datasetIndex].label||"";n&&(n+=": ");var a=e.datasets[t.datasetIndex].data[t.index];return n+"("+t.xLabel+", "+t.yLabel+", "+a.v+")"};else if("pie"===a)n.tooltips.callbacks.label=function(e,n){var a=n.labels[e.index],i=": ";return t(a)?(a=a.slice(),a[0]+=i):a+=i,Y(a,n.datasets[e.datasetIndex].data[e.index],r)};else{var o="bar"===a?"xLabel":"yLabel";n.tooltips.callbacks.label=function(t,e){var n=e.datasets[t.datasetIndex].label||"";return n&&(n+=": "),Y(n,t[o],r)}}},B=m(r(T,O),A,P,j,C,F,I,W),$=function(t,e,n){var a,i=[],o=[],s=t.options.colors||H,l=!0,d=!0,u=!0,h=!0,m=!0,p=!0,_=t.data,x=0;if("bubble"===n)for(var L=0;L<_.length;L++)for(var Y=_[L],S=0;Sx&&(x=Y.data[S][2]);var T,O,A,P,j,C=[],z=[];if("bar"===n||"column"===n||"number"!==t.xtype&&"bubble"!==t.xtype){var E,F,I=[];for(T=0;T<_.length;T++)for(A=_[T],O=0;O0){var tt=(N(Z)?f(Z):o[0]).getTime(),et=(N(K)?f(K):o[0]).getTime();for(T=1;Tet&&(et=nt)}var at,rt=(et-tt)/864e5;if(!e.scales.xAxes[0].time.unit)if(h||rt>3650?(e.scales.xAxes[0].time.unit="year",at=365):u||rt>300?(e.scales.xAxes[0].time.unit="month",at=30):l||rt>10?(e.scales.xAxes[0].time.unit="day",at=1):m||rt>.5?(e.scales.xAxes[0].time.displayFormats={hour:"MMM D, h a"},e.scales.xAxes[0].time.unit="hour",at=1/24):p&&(e.scales.xAxes[0].time.displayFormats={minute:"h:mm a"},e.scales.xAxes[0].time.unit="minute",at=1/24/60),at&&rt>0){var it=Math.ceil(rt/at/(t.element.offsetWidth/100));d&&1===at&&(it=7*Math.ceil(it/7)),e.scales.xAxes[0].time.unitStepSize=it}e.scales.xAxes[0].time.tooltipFormat||(l?e.scales.xAxes[0].time.tooltipFormat="ll":m?e.scales.xAxes[0].time.tooltipFormat="MMM D, h a":p&&(e.scales.xAxes[0].time.tooltipFormat="h:mm a"))}var ot={labels:o,datasets:i};return ot},J=function(t){this.name="chartjs",this.library=t};J.prototype.renderLineChart=function(t,e){var n={};!t.options.max&&S(t.data)&&(n.max=1);var a=B(t,r(n,t.options));U(t,a,e);var i=$(t,a,e||"line");"number"===t.xtype?(a.scales.xAxes[0].type="linear",a.scales.xAxes[0].position="bottom"):a.scales.xAxes[0].type="string"===t.xtype?"category":"time",this.drawChart(t,"line",i,a)},J.prototype.renderPieChart=function(t){var e=r({},T);t.options.donut&&(e.cutoutPercentage=50),"legend"in t.options&&A(e,t.options.legend),t.options.title&&P(e,t.options.title),e=r(e,t.options.library||{}),U(t,e,"pie");for(var n=[],a=[],i=0;i● '+Y(this.series.name+": ",this.y,a)+"
"})},rt=function(t){this.name="highcharts",this.library=t};rt.prototype.renderLineChart=function(t,e){e=e||"spline";var n={};"areaspline"===e&&(n={plotOptions:{areaspline:{stacking:"normal"},area:{stacking:"normal"},series:{marker:{enabled:!1}}}}),!1===t.options.curve&&("areaspline"===e?e="area":"spline"===e&&(e="line"));var a,r,i,o=nt(t,t.options,n);o.xAxis.type="string"===t.xtype?"category":"number"===t.xtype?"linear":"datetime",o.chart.type||(o.chart.type=e),at(t,o,e);var s=t.data;for(r=0;r0)return!1;return!0}function Nt(t,e){e.options.messages&&e.options.messages.empty&&Rt(e.data,t)?Ot(e.element,e.options.messages.empty):(Vt(t,e),e.options.download&&!e.__downloadAttached&&"chartjs"===e.adapter&&jt(e))}function Vt(t,n){var a,r,i,o;for(i="render"+t,o=n.options.adapter,Wt(),a=0;a0?new Error("No charting library found for "+t):new Error("No charting libraries found - be sure to include one before your charts")}var Ut=function(t,e){return t="number"===e?c(t):"datetime"===e?f(t):u(t),t},Bt=function(t,e){var n,a,r=[];for(a=0;a1&&i.call(o[0],n,function(){for(u=1;u=11?t:t+12:"entsambama"===e||"ebusuku"===e?0===t?0:t+12:void 0},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}});return e})},"53e2":function(t,e,n){var a=n("07e3"),r=n("241e"),i=n("5559")("IE_PROTO"),o=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=r(t),a(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?o:null}},"549b":function(t,e,n){"use strict";var a=n("d864"),r=n("63b6"),i=n("241e"),o=n("b0dc"),s=n("3702"),l=n("b447"),d=n("20fd"),u=n("7cd6");r(r.S+r.F*!n("4ee1")(function(t){Array.from(t)}),"Array",{from:function(t){var e,n,r,c,f=i(t),h="function"==typeof this?this:Array,m=arguments.length,p=m>1?arguments[1]:void 0,_=void 0!==p,v=0,y=u(f);if(_&&(p=a(p,m>2?arguments[2]:void 0,2)),void 0==y||h==Array&&s(y))for(e=l(f.length),n=new h(e);e>v;v++)d(n,v,_?p(f[v],v):f[v]);else for(c=y.call(f),n=new h;!(r=c.next()).done;v++)d(n,v,_?o(c,p,[r.value,v],!0):r.value);return n.length=v,n}})},"54a1":function(t,e,n){n("6c1c"),n("1654"),t.exports=n("95d5")},"551c":function(t,e,n){"use strict";var a,r,i,o,s=n("2d00"),l=n("7726"),d=n("9b43"),u=n("23c6"),c=n("5ca1"),f=n("d3f4"),h=n("d8e8"),m=n("f605"),p=n("4a59"),_=n("ebd6"),v=n("1991").set,y=n("8079")(),g=n("a5b8"),b=n("9c80"),M=n("a25f"),k=n("bcaa"),w="Promise",x=l.TypeError,L=l.process,Y=L&&L.versions,D=Y&&Y.v8||"",S=l[w],T="process"==u(L),O=function(){},H=r=g.f,A=!!function(){try{var t=S.resolve(1),e=(t.constructor={})[n("2b4c")("species")]=function(t){t(O,O)};return(T||"function"==typeof PromiseRejectionEvent)&&t.then(O)instanceof e&&0!==D.indexOf("6.6")&&-1===M.indexOf("Chrome/66")}catch(a){}}(),P=function(t){var e;return!(!f(t)||"function"!=typeof(e=t.then))&&e},j=function(t,e){if(!t._n){t._n=!0;var n=t._c;y(function(){var a=t._v,r=1==t._s,i=0,o=function(e){var n,i,o,s=r?e.ok:e.fail,l=e.resolve,d=e.reject,u=e.domain;try{s?(r||(2==t._h&&E(t),t._h=1),!0===s?n=a:(u&&u.enter(),n=s(a),u&&(u.exit(),o=!0)),n===e.promise?d(x("Promise-chain cycle")):(i=P(n))?i.call(n,l,d):l(n)):d(a)}catch(c){u&&!o&&u.exit(),d(c)}};while(n.length>i)o(n[i++]);t._c=[],t._n=!1,e&&!t._h&&C(t)})}},C=function(t){v.call(l,function(){var e,n,a,r=t._v,i=z(t);if(i&&(e=b(function(){T?L.emit("unhandledRejection",r,t):(n=l.onunhandledrejection)?n({promise:t,reason:r}):(a=l.console)&&a.error&&a.error("Unhandled promise rejection",r)}),t._h=T||z(t)?2:1),t._a=void 0,i&&e.e)throw e.v})},z=function(t){return 1!==t._h&&0===(t._a||t._c).length},E=function(t){v.call(l,function(){var e;T?L.emit("rejectionHandled",t):(e=l.onrejectionhandled)&&e({promise:t,reason:t._v})})},F=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),j(e,!0))},I=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw x("Promise can't be resolved itself");(e=P(t))?y(function(){var a={_w:n,_d:!1};try{e.call(t,d(I,a,1),d(F,a,1))}catch(r){F.call(a,r)}}):(n._v=t,n._s=1,j(n,!1))}catch(a){F.call({_w:n,_d:!1},a)}}};A||(S=function(t){m(this,S,w,"_h"),h(t),a.call(this);try{t(d(I,this,1),d(F,this,1))}catch(e){F.call(this,e)}},a=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},a.prototype=n("dcbc")(S.prototype,{then:function(t,e){var n=H(_(this,S));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=T?L.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&j(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),i=function(){var t=new a;this.promise=t,this.resolve=d(I,t,1),this.reject=d(F,t,1)},g.f=H=function(t){return t===S||t===o?new i(t):r(t)}),c(c.G+c.W+c.F*!A,{Promise:S}),n("7f20")(S,w),n("7a56")(w),o=n("8378")[w],c(c.S+c.F*!A,w,{reject:function(t){var e=H(this),n=e.reject;return n(t),e.promise}}),c(c.S+c.F*(s||!A),w,{resolve:function(t){return k(s&&this===o?S:this,t)}}),c(c.S+c.F*!(A&&n("5cc5")(function(t){S.all(t)["catch"](O)})),w,{all:function(t){var e=this,n=H(e),a=n.resolve,r=n.reject,i=b(function(){var n=[],i=0,o=1;p(t,!1,function(t){var s=i++,l=!1;n.push(void 0),o++,e.resolve(t).then(function(t){l||(l=!0,n[s]=t,--o||a(n))},r)}),--o||a(n)});return i.e&&r(i.v),n.promise},race:function(t){var e=this,n=H(e),a=n.reject,r=b(function(){p(t,!1,function(t){e.resolve(t).then(n.resolve,a)})});return r.e&&a(r.v),n.promise}})},5537:function(t,e,n){var a=n("8378"),r=n("7726"),i="__core-js_shared__",o=r[i]||(r[i]={});(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:a.version,mode:n("2d00")?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},5559:function(t,e,n){var a=n("dbdb")("keys"),r=n("62a0");t.exports=function(t){return a[t]||(a[t]=r(t))}},"55c9":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),a=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,i=t.defineLocale("es-us",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(t,a){return t?/-MMM-/.test(a)?n[t.month()]:e[t.month()]:e},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:a,longMonthsParse:a,shortMonthsParse:a,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:6}});return i})},"55dd":function(t,e,n){"use strict";var a=n("5ca1"),r=n("d8e8"),i=n("4bf8"),o=n("79e5"),s=[].sort,l=[1,2,3];a(a.P+a.F*(o(function(){l.sort(void 0)})||!o(function(){l.sort(null)})||!n("2f21")(s)),"Array",{sort:function(t){return void 0===t?s.call(i(this)):s.call(i(this),r(t))}})},"576c":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"minutu balun",ss:"minutu %d",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(t){var e=t%10,n=1===~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n},week:{dow:1,doy:4}});return e})},"57b8":function(t,e){function n(t,e){var n={};for(var a in"string"===typeof e&&(e=[].slice.call(arguments,1)),t)t.hasOwnProperty&&!t.hasOwnProperty(a)||-1===e.indexOf(a)&&(n[a]=t[a]);return n}t.exports=n},"584a":function(t,e){var n=t.exports={version:"2.6.9"};"number"==typeof __e&&(__e=n)},"585a":function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(this,n("c8ba"))},"598a":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"],n=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"],a=t.defineLocale("dv",{months:e,monthsShort:e,weekdays:n,weekdaysShort:n,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(t){return"މފ"===t},meridiem:function(t,e,n){return t<12?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",ss:"d% ސިކުންތު",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(t){return t.replace(/،/g,",")},postformat:function(t){return t.replace(/,/g,"،")},week:{dow:7,doy:12}});return a})},"5b14":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");function n(t,e,n,a){var r=t;switch(n){case"s":return a||e?"néhány másodperc":"néhány másodperce";case"ss":return r+(a||e)?" másodperc":" másodperce";case"m":return"egy"+(a||e?" perc":" perce");case"mm":return r+(a||e?" perc":" perce");case"h":return"egy"+(a||e?" óra":" órája");case"hh":return r+(a||e?" óra":" órája");case"d":return"egy"+(a||e?" nap":" napja");case"dd":return r+(a||e?" nap":" napja");case"M":return"egy"+(a||e?" hónap":" hónapja");case"MM":return r+(a||e?" hónap":" hónapja");case"y":return"egy"+(a||e?" év":" éve");case"yy":return r+(a||e?" év":" éve")}return""}function a(t){return(t?"":"[múlt] ")+"["+e[this.day()]+"] LT[-kor]"}var r=t.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(t){return"u"===t.charAt(1).toLowerCase()},meridiem:function(t,e,n){return t<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return a.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return a.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return r})},"5b4e":function(t,e,n){var a=n("36c3"),r=n("b447"),i=n("0fc9");t.exports=function(t){return function(e,n,o){var s,l=a(e),d=r(l.length),u=i(o,d);if(t&&n!=n){while(d>u)if(s=l[u++],s!=s)return!0}else for(;d>u;u++)if((t||u in l)&&l[u]===n)return t||u||0;return!t&&-1}}},"5c3a":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(t,e){return 12===t&&(t=0),"凌晨"===e||"早上"===e||"上午"===e?t:"下午"===e||"晚上"===e?t+12:t>=11?t:t+12},meridiem:function(t,e,n){var a=100*t+e;return a<600?"凌晨":a<900?"早上":a<1130?"上午":a<1230?"中午":a<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(t,e){switch(e){case"d":case"D":case"DDD":return t+"日";case"M":return t+"月";case"w":case"W":return t+"周";default:return t}},relativeTime:{future:"%s内",past:"%s前",s:"几秒",ss:"%d 秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}});return e})},"5ca1":function(t,e,n){var a=n("7726"),r=n("8378"),i=n("32e9"),o=n("2aba"),s=n("9b43"),l="prototype",d=function(t,e,n){var u,c,f,h,m=t&d.F,p=t&d.G,_=t&d.S,v=t&d.P,y=t&d.B,g=p?a:_?a[e]||(a[e]={}):(a[e]||{})[l],b=p?r:r[e]||(r[e]={}),M=b[l]||(b[l]={});for(u in p&&(n=e),n)c=!m&&g&&void 0!==g[u],f=(c?g:n)[u],h=y&&c?s(f,a):v&&"function"==typeof f?s(Function.call,f):f,g&&o(g,u,f,t&d.U),b[u]!=f&&i(b,u,h),v&&M[u]!=f&&(M[u]=f)};a.core=r,d.F=1,d.G=2,d.S=4,d.P=8,d.B=16,d.W=32,d.U=64,d.R=128,t.exports=d},"5cbb":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",ss:"%d సెకన్లు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},dayOfMonthOrdinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(t,e){return 12===t&&(t=0),"రాత్రి"===e?t<4?t:t+12:"ఉదయం"===e?t:"మధ్యాహ్నం"===e?t>=10?t:t+12:"సాయంత్రం"===e?t+12:void 0},meridiem:function(t,e,n){return t<4?"రాత్రి":t<10?"ఉదయం":t<17?"మధ్యాహ్నం":t<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}});return e})},"5cc5":function(t,e,n){var a=n("2b4c")("iterator"),r=!1;try{var i=[7][a]();i["return"]=function(){r=!0},Array.from(i,function(){throw 2})}catch(o){}t.exports=function(t,e){if(!e&&!r)return!1;var n=!1;try{var i=[7],s=i[a]();s.next=function(){return{done:n=!0}},i[a]=function(){return s},t(i)}catch(o){}return n}},"5d58":function(t,e,n){t.exports=n("d8d6")},"5d73":function(t,e,n){t.exports=n("469f")},"5dbc":function(t,e,n){var a=n("d3f4"),r=n("8b97").set;t.exports=function(t,e,n){var i,o=e.constructor;return o!==n&&"function"==typeof o&&(i=o.prototype)!==n.prototype&&a(i)&&r&&r(t,i),t}},"5df3":function(t,e,n){"use strict";var a=n("02f4")(!0);n("01f9")(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=a(e,n),this._i+=t.length,{value:t,done:!1})})},"5e2e":function(t,e,n){var a=n("28c9"),r=n("69d5"),i=n("b4c0"),o=n("fba5"),s=n("67ca");function l(t){var e=-1,n=null==t?0:t.length;this.clear();while(++e=11?t:t+12},meridiem:function(t,e,n){var a=100*t+e;return a<600?"يېرىم كېچە":a<900?"سەھەر":a<1130?"چۈشتىن بۇرۇن":a<1230?"چۈش":a<1800?"چۈشتىن كېيىن":"كەچ"},calendar:{sameDay:"[بۈگۈن سائەت] LT",nextDay:"[ئەتە سائەت] LT",nextWeek:"[كېلەركى] dddd [سائەت] LT",lastDay:"[تۆنۈگۈن] LT",lastWeek:"[ئالدىنقى] dddd [سائەت] LT",sameElse:"L"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",ss:"%d سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"},dayOfMonthOrdinalParse:/\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,ordinal:function(t,e){switch(e){case"d":case"D":case"DDD":return t+"-كۈنى";case"w":case"W":return t+"-ھەپتە";default:return t}},preparse:function(t){return t.replace(/،/g,",")},postformat:function(t){return t.replace(/,/g,"،")},week:{dow:1,doy:7}});return e})},"613b":function(t,e,n){var a=n("5537")("keys"),r=n("ca5a");t.exports=function(t){return a[t]||(a[t]=r(t))}},"626a":function(t,e,n){var a=n("2d95");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==a(t)?t.split(""):Object(t)}},"62a0":function(t,e){var n=0,a=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+a).toString(36))}},"62e4":function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},"63b6":function(t,e,n){var a=n("e53d"),r=n("584a"),i=n("d864"),o=n("35e8"),s=n("07e3"),l="prototype",d=function(t,e,n){var u,c,f,h=t&d.F,m=t&d.G,p=t&d.S,_=t&d.P,v=t&d.B,y=t&d.W,g=m?r:r[e]||(r[e]={}),b=g[l],M=m?a:p?a[e]:(a[e]||{})[l];for(u in m&&(n=e),n)c=!h&&M&&void 0!==M[u],c&&s(g,u)||(f=c?M[u]:n[u],g[u]=m&&"function"!=typeof M[u]?n[u]:v&&c?i(f,a):y&&M[u]==f?function(t){var e=function(e,n,a){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,a)}return t.apply(this,arguments)};return e[l]=t[l],e}(f):_&&"function"==typeof f?i(Function.call,f):f,_&&((g.virtual||(g.virtual={}))[u]=f,t&d.R&&b&&!b[u]&&o(b,u,f)))};d.F=1,d.G=2,d.S=4,d.P=8,d.B=16,d.W=32,d.U=64,d.R=128,t.exports=d},"63c5":function(t,e,n){(function(t,a){var r;/*! https://mths.be/punycode v1.4.0 by @mathias */(function(i){e&&e.nodeType,t&&t.nodeType;var o="object"==typeof a&&a;o.global!==o&&o.window!==o&&o.self;var s,l=2147483647,d=36,u=1,c=26,f=38,h=700,m=72,p=128,_="-",v=/^xn--/,y=/[^\x20-\x7E]/,g=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},M=d-u,k=Math.floor,w=String.fromCharCode;function x(t){throw new RangeError(b[t])}function L(t,e){var n=t.length,a=[];while(n--)a[n]=e(t[n]);return a}function Y(t,e){var n=t.split("@"),a="";n.length>1&&(a=n[0]+"@",t=n[1]),t=t.replace(g,".");var r=t.split("."),i=L(r,e).join(".");return a+i}function D(t){var e,n,a=[],r=0,i=t.length;while(r=55296&&e<=56319&&r65535&&(t-=65536,e+=w(t>>>10&1023|55296),t=56320|1023&t),e+=w(t),e}).join("")}function T(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:d}function O(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function H(t,e,n){var a=0;for(t=n?k(t/h):t>>1,t+=k(t/e);t>M*c>>1;a+=d)t=k(t/M);return k(a+(M+1)*t/(t+f))}function A(t){var e,n,a,r,i,o,s,f,h,v,y=[],g=t.length,b=0,M=p,w=m;for(n=t.lastIndexOf(_),n<0&&(n=0),a=0;a=128&&x("not-basic"),y.push(t.charCodeAt(a));for(r=n>0?n+1:0;r=g&&x("invalid-input"),f=T(t.charCodeAt(r++)),(f>=d||f>k((l-b)/o))&&x("overflow"),b+=f*o,h=s<=w?u:s>=w+c?c:s-w,fk(l/v)&&x("overflow"),o*=v}e=y.length+1,w=H(b-i,e,0==i),k(b/e)>l-M&&x("overflow"),M+=k(b/e),b%=e,y.splice(b++,0,M)}return S(y)}function P(t){var e,n,a,r,i,o,s,f,h,v,y,g,b,M,L,Y=[];for(t=D(t),g=t.length,e=p,n=0,i=m,o=0;o=e&&yk((l-n)/b)&&x("overflow"),n+=(s-e)*b,e=s,o=0;ol&&x("overflow"),y==e){for(f=n,h=d;;h+=d){if(v=h<=i?u:h>=i+c?c:h-i,f=11?t:t+12:"petang"===e||"malam"===e?t+12:void 0},meridiem:function(t,e,n){return t<11?"pagi":t<15?"tengahari":t<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}});return e})},"656b":function(t,e,n){var a=n("e2e4"),r=n("f4d6");function i(t,e){e=a(e,t);var n=0,i=e.length;while(null!=t&&n11?n?"p.t.m.":"P.T.M.":n?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd [je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasinta] dddd [je] LT",sameElse:"L"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"sekundoj",ss:"%d sekundoj",m:"minuto",mm:"%d minutoj",h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"},dayOfMonthOrdinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}});return e})},6718:function(t,e,n){var a=n("e53d"),r=n("584a"),i=n("b8e3"),o=n("ccb9"),s=n("d9f6").f;t.exports=function(t){var e=r.Symbol||(r.Symbol=i?{}:a.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:o.f(t)})}},6747:function(t,e){var n=Array.isArray;t.exports=n},6762:function(t,e,n){"use strict";var a=n("5ca1"),r=n("c366")(!0);a(a.P,"Array",{includes:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),n("9c6c")("includes")},6784:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=["جنوري","فيبروري","مارچ","اپريل","مئي","جون","جولاءِ","آگسٽ","سيپٽمبر","آڪٽوبر","نومبر","ڊسمبر"],n=["آچر","سومر","اڱارو","اربع","خميس","جمع","ڇنڇر"],a=t.defineLocale("sd",{months:e,monthsShort:e,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(t){return"شام"===t},meridiem:function(t,e,n){return t<12?"صبح":"شام"},calendar:{sameDay:"[اڄ] LT",nextDay:"[سڀاڻي] LT",nextWeek:"dddd [اڳين هفتي تي] LT",lastDay:"[ڪالهه] LT",lastWeek:"[گزريل هفتي] dddd [تي] LT",sameElse:"L"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",ss:"%d سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"},preparse:function(t){return t.replace(/،/g,",")},postformat:function(t){return t.replace(/,/g,"،")},week:{dow:1,doy:4}});return a})},"67ab":function(t,e,n){var a=n("ca5a")("meta"),r=n("d3f4"),i=n("69a8"),o=n("86cc").f,s=0,l=Object.isExtensible||function(){return!0},d=!n("79e5")(function(){return l(Object.preventExtensions({}))}),u=function(t){o(t,a,{value:{i:"O"+ ++s,w:{}}})},c=function(t,e){if(!r(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!i(t,a)){if(!l(t))return"F";if(!e)return"E";u(t)}return t[a].i},f=function(t,e){if(!i(t,a)){if(!l(t))return!0;if(!e)return!1;u(t)}return t[a].w},h=function(t){return d&&m.NEED&&l(t)&&!i(t,a)&&u(t),t},m=t.exports={KEY:a,NEED:!1,fastKey:c,getWeak:f,onFreeze:h}},"67bb":function(t,e,n){t.exports=n("f921")},"67ca":function(t,e,n){var a=n("cb5a");function r(t,e){var n=this.__data__,r=a(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}t.exports=r},6821:function(t,e,n){var a=n("626a"),r=n("be13");t.exports=function(t){return a(r(t))}},6887:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";function e(t,e,n){var a={mm:"munutenn",MM:"miz",dd:"devezh"};return t+" "+r(a[n],t)}function n(t){switch(a(t)){case 1:case 3:case 4:case 5:case 9:return t+" bloaz";default:return t+" vloaz"}}function a(t){return t>9?a(t%10):t}function r(t,e){return 2===e?i(t):t}function i(t){var e={m:"v",b:"v",d:"z"};return void 0===e[t.charAt(0)]?t:e[t.charAt(0)]+t.substring(1)}var o=t.defineLocale("br",{months:"Genver_C'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Merc'her_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h[e]mm A",LTS:"h[e]mm:ss A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY h[e]mm A",LLLL:"dddd, D [a viz] MMMM YYYY h[e]mm A"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warc'hoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Dec'h da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s 'zo",s:"un nebeud segondennoù",ss:"%d eilenn",m:"ur vunutenn",mm:e,h:"un eur",hh:"%d eur",d:"un devezh",dd:e,M:"ur miz",MM:e,y:"ur bloaz",yy:n},dayOfMonthOrdinalParse:/\d{1,2}(añ|vet)/,ordinal:function(t){var e=1===t?"añ":"vet";return t+e},week:{dow:1,doy:4}});return o})},"688b":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("mi",{months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",ss:"%d hēkona",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}});return e})},6909:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"после %s",past:"пред %s",s:"неколку секунди",ss:"%d секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеци",y:"година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(t){var e=t%10,n=t%100;return 0===t?t+"-ев":0===n?t+"-ен":n>10&&n<20?t+"-ти":1===e?t+"-ви":2===e?t+"-ри":7===e||8===e?t+"-ми":t+"-ти"},week:{dow:1,doy:7}});return e})},6981:function(t,e,n){ -/*! - * clipboard.js v2.0.4 - * https://zenorocha.github.io/clipboard.js - * - * Licensed MIT © Zeno Rocha - */ -!function(e,n){t.exports=n()}(0,function(){return function(t){var e={};function n(a){if(e[a])return e[a].exports;var r=e[a]={i:a,l:!1,exports:{}};return t[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,a){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(a,r,function(e){return t[e]}.bind(null,r));return a},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){function t(t,e){for(var n=0;n=100?100:null;return t+(e[t]||e[n]||e[a])},week:{dow:1,doy:7}});return n})},"6d83":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}});return e})},"6e98":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(t){return(/^[0-9].+$/.test(t)?"tra":"in")+" "+t},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}});return e})},"6f12":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("it-ch",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(t){return(/^[0-9].+$/.test(t)?"tra":"in")+" "+t},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}});return e})},"6f50":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(t){var e=t%10,n=1===~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n},week:{dow:1,doy:4}});return e})},7118:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),n="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),a=t.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(t,a){return t?/-MMM-/.test(a)?n[t.month()]:e[t.month()]:e},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",ss:"%d sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(t){return t+(1===t||8===t||t>=20?"ste":"de")},week:{dow:1,doy:4}});return a})},"71c1":function(t,e,n){var a=n("3a38"),r=n("25eb");t.exports=function(t){return function(e,n){var i,o,s=String(r(e)),l=a(n),d=s.length;return l<0||l>=d?t?"":void 0:(i=s.charCodeAt(l),i<55296||i>56319||l+1===d||(o=s.charCodeAt(l+1))<56320||o>57343?t?s.charAt(l):i:t?s.slice(l,l+2):o-56320+(i-55296<<10)+65536)}}},7333:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("en-il",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(t){var e=t%10,n=1===~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n}});return e})},73334:function(t,e,n){"use strict";var a=n("9e1e"),r=n("0d58"),i=n("2621"),o=n("52a7"),s=n("4bf8"),l=n("626a"),d=Object.assign;t.exports=!d||n("79e5")(function(){var t={},e={},n=Symbol(),a="abcdefghijklmnopqrst";return t[n]=7,a.split("").forEach(function(t){e[t]=t}),7!=d({},t)[n]||Object.keys(d({},e)).join("")!=a})?function(t,e){var n=s(t),d=arguments.length,u=1,c=i.f,f=o.f;while(d>u){var h,m=l(arguments[u++]),p=c?r(m).concat(c(m)):r(m),_=p.length,v=0;while(_>v)h=p[v++],a&&!f.call(m,h)||(n[h]=m[h])}return n}:d},"74dc":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",ss:"sekunde %d",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"masiku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}});return e})},7514:function(t,e,n){"use strict";var a=n("5ca1"),r=n("0a49")(5),i="find",o=!0;i in[]&&Array(1)[i](function(){o=!1}),a(a.P+a.F*o,"Array",{find:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),n("9c6c")(i)},"75fc":function(t,e,n){"use strict";var a=n("a745"),r=n.n(a);function i(t){if(r()(t)){for(var e=0,n=new Array(t.length);e1&&t<5}function r(t,e,n,r){var i=t+" ";switch(n){case"s":return e||r?"pár sekúnd":"pár sekundami";case"ss":return e||r?i+(a(t)?"sekundy":"sekúnd"):i+"sekundami";case"m":return e?"minúta":r?"minútu":"minútou";case"mm":return e||r?i+(a(t)?"minúty":"minút"):i+"minútami";case"h":return e?"hodina":r?"hodinu":"hodinou";case"hh":return e||r?i+(a(t)?"hodiny":"hodín"):i+"hodinami";case"d":return e||r?"deň":"dňom";case"dd":return e||r?i+(a(t)?"dni":"dní"):i+"dňami";case"M":return e||r?"mesiac":"mesiacom";case"MM":return e||r?i+(a(t)?"mesiace":"mesiacov"):i+"mesiacmi";case"y":return e||r?"rok":"rokom";case"yy":return e||r?i+(a(t)?"roky":"rokov"):i+"rokmi"}}var i=t.defineLocale("sk",{months:e,monthsShort:n,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:r,ss:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return i})},"7c64":function(t,e,n){var a=n("e24b"),r=n("5e2e"),i=n("79bc");function o(){this.size=0,this.__data__={hash:new a,map:new(i||r),string:new a}}t.exports=o},"7cd6":function(t,e,n){var a=n("40c3"),r=n("5168")("iterator"),i=n("481b");t.exports=n("584a").getIteratorMethod=function(t){if(void 0!=t)return t[r]||t["@@iterator"]||i[a(t)]}},"7d7b":function(t,e,n){var a=n("e4ae"),r=n("7cd6");t.exports=n("584a").getIterator=function(t){var e=r(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return a(e.call(t))}},"7e90":function(t,e,n){var a=n("d9f6"),r=n("e4ae"),i=n("c3a1");t.exports=n("8e60")?Object.defineProperties:function(t,e){r(t);var n,o=i(e),s=o.length,l=0;while(s>l)a.f(t,n=o[l++],e[n]);return t}},"7f20":function(t,e,n){var a=n("86cc").f,r=n("69a8"),i=n("2b4c")("toStringTag");t.exports=function(t,e,n){t&&!r(t=n?t:t.prototype,i)&&a(t,i,{configurable:!0,value:e})}},"7f33":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("yo",{months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Ònì ni] LT",nextDay:"[Ọ̀la ni] LT",nextWeek:"dddd [Ọsẹ̀ tón'bọ] [ni] LT",lastDay:"[Àna ni] LT",lastWeek:"dddd [Ọsẹ̀ tólọ́] [ni] LT",sameElse:"L"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",ss:"aayá %d",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"},dayOfMonthOrdinalParse:/ọjọ́\s\d{1,2}/,ordinal:"ọjọ́ %d",week:{dow:1,doy:4}});return e})},"7f7f":function(t,e,n){var a=n("86cc").f,r=Function.prototype,i=/^\s*function ([^ (]*)/,o="name";o in r||n("9e1e")&&a(r,o,{configurable:!0,get:function(){try{return(""+this).match(i)[1]}catch(t){return""}}})},"7fae":function(t,e,n){var a=Array.prototype.slice,r=n("3260"),i=n("997d"),o=t.exports=function(t,e,n){return n||(n={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?n.strict?t===e:t==e:d(t,e,n))};function s(t){return null===t||void 0===t}function l(t){return!(!t||"object"!==typeof t||"number"!==typeof t.length)&&("function"===typeof t.copy&&"function"===typeof t.slice&&!(t.length>0&&"number"!==typeof t[0]))}function d(t,e,n){var d,u;if(s(t)||s(e))return!1;if(t.prototype!==e.prototype)return!1;if(i(t))return!!i(e)&&(t=a.call(t),e=a.call(e),o(t,e,n));if(l(t)){if(!l(e))return!1;if(t.length!==e.length)return!1;for(d=0;d=0;d--)if(c[d]!=f[d])return!1;for(d=c.length-1;d>=0;d--)if(u=c[d],!o(t[u],e[u],n))return!1;return typeof t===typeof e}},8079:function(t,e,n){var a=n("7726"),r=n("1991").set,i=a.MutationObserver||a.WebKitMutationObserver,o=a.process,s=a.Promise,l="process"==n("2d95")(o);t.exports=function(){var t,e,n,d=function(){var a,r;l&&(a=o.domain)&&a.exit();while(t){r=t.fn,t=t.next;try{r()}catch(i){throw t?n():e=void 0,i}}e=void 0,a&&a.enter()};if(l)n=function(){o.nextTick(d)};else if(!i||a.navigator&&a.navigator.standalone)if(s&&s.resolve){var u=s.resolve(void 0);n=function(){u.then(d)}}else n=function(){r.call(a,d)};else{var c=!0,f=document.createTextNode("");new i(d).observe(f,{characterData:!0}),n=function(){f.data=c=!c}}return function(a){var r={fn:a,next:void 0};e&&(e.next=r),t||(t=r,n()),e=r}}},8155:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";function e(t,e,n,a){var r=t+" ";switch(n){case"s":return e||a?"nekaj sekund":"nekaj sekundami";case"ss":return r+=1===t?e?"sekundo":"sekundi":2===t?e||a?"sekundi":"sekundah":t<5?e||a?"sekunde":"sekundah":"sekund",r;case"m":return e?"ena minuta":"eno minuto";case"mm":return r+=1===t?e?"minuta":"minuto":2===t?e||a?"minuti":"minutama":t<5?e||a?"minute":"minutami":e||a?"minut":"minutami",r;case"h":return e?"ena ura":"eno uro";case"hh":return r+=1===t?e?"ura":"uro":2===t?e||a?"uri":"urama":t<5?e||a?"ure":"urami":e||a?"ur":"urami",r;case"d":return e||a?"en dan":"enim dnem";case"dd":return r+=1===t?e||a?"dan":"dnem":2===t?e||a?"dni":"dnevoma":e||a?"dni":"dnevi",r;case"M":return e||a?"en mesec":"enim mesecem";case"MM":return r+=1===t?e||a?"mesec":"mesecem":2===t?e||a?"meseca":"mesecema":t<5?e||a?"mesece":"meseci":e||a?"mesecev":"meseci",r;case"y":return e||a?"eno leto":"enim letom";case"yy":return r+=1===t?e||a?"leto":"letom":2===t?e||a?"leti":"letoma":t<5?e||a?"leta":"leti":e||a?"let":"leti",r}}var n=t.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:e,ss:e,m:e,mm:e,h:e,hh:e,d:e,dd:e,M:e,MM:e,y:e,yy:e},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}});return n})},"81e9":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),n=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",e[7],e[8],e[9]];function a(t,e,n,a){var i="";switch(n){case"s":return a?"muutaman sekunnin":"muutama sekunti";case"ss":return a?"sekunnin":"sekuntia";case"m":return a?"minuutin":"minuutti";case"mm":i=a?"minuutin":"minuuttia";break;case"h":return a?"tunnin":"tunti";case"hh":i=a?"tunnin":"tuntia";break;case"d":return a?"päivän":"päivä";case"dd":i=a?"päivän":"päivää";break;case"M":return a?"kuukauden":"kuukausi";case"MM":i=a?"kuukauden":"kuukautta";break;case"y":return a?"vuoden":"vuosi";case"yy":i=a?"vuoden":"vuotta";break}return i=r(t,a)+" "+i,i}function r(t,a){return t<10?a?n[t]:e[t]:t}var i=t.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return i})},8230:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},a=t.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(t){return"م"===t},meridiem:function(t,e,n){return t<12?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(t){return t.replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(t){return n[t]}).replace(/،/g,",")},postformat:function(t){return t.replace(/\d/g,function(t){return e[t]}).replace(/,/g,"،")},week:{dow:0,doy:6}});return a})},8378:function(t,e){var n=t.exports={version:"2.6.9"};"number"==typeof __e&&(__e=n)},"83a1":function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t===1/e:t!=t&&e!=e}},8436:function(t,e){t.exports=function(){}},"84aa":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[В изминалата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[В изминалия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",ss:"%d секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дни",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(t){var e=t%10,n=t%100;return 0===t?t+"-ев":0===n?t+"-ен":n>10&&n<20?t+"-ти":1===e?t+"-ви":2===e?t+"-ри":7===e||8===e?t+"-ми":t+"-ти"},week:{dow:1,doy:7}});return e})},"84f2":function(t,e){t.exports={}},"85f2":function(t,e,n){t.exports=n("454f")},8615:function(t,e,n){var a=n("5ca1"),r=n("504c")(!1);a(a.S,"Object",{values:function(t){return r(t)}})},8689:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e={1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"},n={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"},a=t.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",ss:"%d စက္ကန့်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(t){return t.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,function(t){return n[t]})},postformat:function(t){return t.replace(/\d/g,function(t){return e[t]})},week:{dow:1,doy:4}});return a})},"86cc":function(t,e,n){var a=n("cb7c"),r=n("c69a"),i=n("6a99"),o=Object.defineProperty;e.f=n("9e1e")?Object.defineProperty:function(t,e,n){if(a(t),e=i(e,!0),a(n),r)try{return o(t,e,n)}catch(s){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},8840:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("gl",{months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(t){return 0===t.indexOf("un")?"n"+t:"en "+t},past:"hai %s",s:"uns segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}});return e})},"898b":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),a=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,i=t.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(t,a){return t?/-MMM-/.test(a)?n[t.month()]:e[t.month()]:e},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:a,longMonthsParse:a,shortMonthsParse:a,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}});return i})},"8b97":function(t,e,n){var a=n("d3f4"),r=n("cb7c"),i=function(t,e){if(r(t),!a(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,a){try{a=n("9b43")(Function.call,n("11e9").f(Object.prototype,"__proto__").set,2),a(t,[]),e=!(t instanceof Array)}catch(r){e=!0}return function(t,n){return i(t,n),e?t.__proto__=n:a(t,n),t}}({},!1):void 0),check:i}},"8d47":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";function e(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}var n=t.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(t,e){return t?"string"===typeof e&&/D/.test(e.substring(0,e.indexOf("MMMM")))?this._monthsGenitiveEl[t.month()]:this._monthsNominativeEl[t.month()]:this._monthsNominativeEl},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(t,e,n){return t>11?n?"μμ":"ΜΜ":n?"πμ":"ΠΜ"},isPM:function(t){return"μ"===(t+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(t,n){var a=this._calendarEl[t],r=n&&n.hours();return e(a)&&(a=a.apply(n)),a.replace("{}",r%12===1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",ss:"%d δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},dayOfMonthOrdinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}});return n})},"8d57":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_");function a(t){return t%10<5&&t%10>1&&~~(t/10)%10!==1}function r(t,e,n){var r=t+" ";switch(n){case"ss":return r+(a(t)?"sekundy":"sekund");case"m":return e?"minuta":"minutę";case"mm":return r+(a(t)?"minuty":"minut");case"h":return e?"godzina":"godzinę";case"hh":return r+(a(t)?"godziny":"godzin");case"MM":return r+(a(t)?"miesiące":"miesięcy");case"yy":return r+(a(t)?"lata":"lat")}}var i=t.defineLocale("pl",{months:function(t,a){return t?""===a?"("+n[t.month()]+"|"+e[t.month()]+")":/D MMMM/.test(a)?n[t.month()]:e[t.month()]:e},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedzielę o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W środę o] LT";case 6:return"[W sobotę o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",ss:r,m:r,mm:r,h:r,hh:r,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:r,y:"rok",yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return i})},"8df4":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},n={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"},a=t.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(t){return/بعد از ظهر/.test(t)},meridiem:function(t,e,n){return t<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",ss:"ثانیه d%",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(t){return t.replace(/[۰-۹]/g,function(t){return n[t]}).replace(/،/g,",")},postformat:function(t){return t.replace(/\d/g,function(t){return e[t]}).replace(/,/g,"،")},dayOfMonthOrdinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}});return a})},"8e60":function(t,e,n){t.exports=!n("294c")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},"8e6e":function(t,e,n){var a=n("5ca1"),r=n("990b"),i=n("6821"),o=n("11e9"),s=n("f1ae");a(a.S,"Object",{getOwnPropertyDescriptors:function(t){var e,n,a=i(t),l=o.f,d=r(a),u={},c=0;while(d.length>c)n=l(a,e=d[c++]),void 0!==n&&s(u,e,n);return u}})},"8e73":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},a=function(t){return 0===t?0:1===t?1:2===t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5},r={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},i=function(t){return function(e,n,i,o){var s=a(e),l=r[t][a(e)];return 2===s&&(l=l[n?0:1]),l.replace(/%d/i,e)}},o=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"],s=t.defineLocale("ar",{months:o,monthsShort:o,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(t){return"م"===t},meridiem:function(t,e,n){return t<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:i("s"),ss:i("s"),m:i("m"),mm:i("m"),h:i("h"),hh:i("h"),d:i("d"),dd:i("d"),M:i("M"),MM:i("M"),y:i("y"),yy:i("y")},preparse:function(t){return t.replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(t){return n[t]}).replace(/،/g,",")},postformat:function(t){return t.replace(/\d/g,function(t){return e[t]}).replace(/,/g,"،")},week:{dow:6,doy:12}});return s})},"8f60":function(t,e,n){"use strict";var a=n("a159"),r=n("aebd"),i=n("45f2"),o={};n("35e8")(o,n("5168")("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=a(o,{next:r(1,n)}),i(t,e+" Iterator")}},9003:function(t,e,n){var a=n("6b4c");t.exports=Array.isArray||function(t){return"Array"==a(t)}},9043:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"},a=t.defineLocale("bn",{months:"জানুয়ারী_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব_মার্চ_এপ্র_মে_জুন_জুল_আগ_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(t){return t.replace(/[১২৩৪৫৬৭৮৯০]/g,function(t){return n[t]})},postformat:function(t){return t.replace(/\d/g,function(t){return e[t]})},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(t,e){return 12===t&&(t=0),"রাত"===e&&t>=4||"দুপুর"===e&&t<5||"বিকাল"===e?t+12:t},meridiem:function(t,e,n){return t<4?"রাত":t<10?"সকাল":t<17?"দুপুর":t<20?"বিকাল":"রাত"},week:{dow:0,doy:6}});return a})},9093:function(t,e,n){var a=n("ce10"),r=n("e11e").concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return a(t,r)}},"90ea":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(t,e){return 12===t&&(t=0),"凌晨"===e||"早上"===e||"上午"===e?t:"中午"===e?t>=11?t:t+12:"下午"===e||"晚上"===e?t+12:void 0},meridiem:function(t,e,n){var a=100*t+e;return a<600?"凌晨":a<900?"早上":a<1130?"上午":a<1230?"中午":a<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(t,e){switch(e){case"d":case"D":case"DDD":return t+"日";case"M":return t+"月";case"w":case"W":return t+"週";default:return t}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}});return e})},9138:function(t,e,n){t.exports=n("35e8")},"93ed":function(t,e,n){var a=n("4245");function r(t){var e=a(this,t)["delete"](t);return this.size-=e?1:0,e}t.exports=r},9520:function(t,e,n){var a=n("3729"),r=n("1a8c"),i="[object AsyncFunction]",o="[object Function]",s="[object GeneratorFunction]",l="[object Proxy]";function d(t){if(!r(t))return!1;var e=a(t);return e==o||e==s||e==i||e==l}t.exports=d},"957c":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";function e(t,e){var n=t.split("_");return e%10===1&&e%100!==11?n[0]:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?n[1]:n[2]}function n(t,n,a){var r={ss:n?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:n?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"};return"m"===a?n?"минута":"минуту":t+" "+e(r[a],+t)}var a=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i],r=t.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:a,longMonthsParse:a,shortMonthsParse:a,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},calendar:{sameDay:"[Сегодня, в] LT",nextDay:"[Завтра, в] LT",lastDay:"[Вчера, в] LT",nextWeek:function(t){if(t.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В следующее] dddd, [в] LT";case 1:case 2:case 4:return"[В следующий] dddd, [в] LT";case 3:case 5:case 6:return"[В следующую] dddd, [в] LT"}},lastWeek:function(t){if(t.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd, [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd, [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd, [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",ss:n,m:n,mm:n,h:"час",hh:n,d:"день",dd:n,M:"месяц",MM:n,y:"год",yy:n},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(t){return/^(дня|вечера)$/.test(t)},meridiem:function(t,e,n){return t<4?"ночи":t<12?"утра":t<17?"дня":"вечера"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(t,e){switch(e){case"M":case"d":case"DDD":return t+"-й";case"D":return t+"-го";case"w":case"W":return t+"-я";default:return t}},week:{dow:1,doy:4}});return r})},"958b":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";function e(t,e,n,a){switch(n){case"s":return e?"хэдхэн секунд":"хэдхэн секундын";case"ss":return t+(e?" секунд":" секундын");case"m":case"mm":return t+(e?" минут":" минутын");case"h":case"hh":return t+(e?" цаг":" цагийн");case"d":case"dd":return t+(e?" өдөр":" өдрийн");case"M":case"MM":return t+(e?" сар":" сарын");case"y":case"yy":return t+(e?" жил":" жилийн");default:return t}}var n=t.defineLocale("mn",{months:"Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),monthsParseExact:!0,weekdays:"Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба".split("_"),weekdaysShort:"Ням_Дав_Мяг_Лха_Пүр_Баа_Бям".split("_"),weekdaysMin:"Ня_Да_Мя_Лх_Пү_Ба_Бя".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},meridiemParse:/ҮӨ|ҮХ/i,isPM:function(t){return"ҮХ"===t},meridiem:function(t,e,n){return t<12?"ҮӨ":"ҮХ"},calendar:{sameDay:"[Өнөөдөр] LT",nextDay:"[Маргааш] LT",nextWeek:"[Ирэх] dddd LT",lastDay:"[Өчигдөр] LT",lastWeek:"[Өнгөрсөн] dddd LT",sameElse:"L"},relativeTime:{future:"%s дараа",past:"%s өмнө",s:e,ss:e,m:e,mm:e,h:e,hh:e,d:e,dd:e,M:e,MM:e,y:e,yy:e},dayOfMonthOrdinalParse:/\d{1,2} өдөр/,ordinal:function(t,e){switch(e){case"d":case"D":case"DDD":return t+" өдөр";default:return t}}});return n})},"95d5":function(t,e,n){var a=n("40c3"),r=n("5168")("iterator"),i=n("481b");t.exports=n("584a").isIterable=function(t){var e=Object(t);return void 0!==e[r]||"@@iterator"in e||i.hasOwnProperty(a(e))}},9609:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"},n=t.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кечээ саат] LT",lastWeek:"[Өткөн аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",ss:"%d секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(t){var n=t%10,a=t>=100?100:null;return t+(e[t]||e[n]||e[a])},week:{dow:1,doy:7}});return n})},9638:function(t,e){function n(t,e){return t===e||t!==t&&e!==e}t.exports=n},"972c":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";function e(t,e,n){var a={ss:"secunde",mm:"minute",hh:"ore",dd:"zile",MM:"luni",yy:"ani"},r=" ";return(t%100>=20||t>=100&&t%100===0)&&(r=" de "),t+r+a[n]}var n=t.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",ss:e,m:"un minut",mm:e,h:"o oră",hh:e,d:"o zi",dd:e,M:"o lună",MM:e,y:"un an",yy:e},week:{dow:1,doy:7}});return n})},9797:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",ss:"%d eiliad",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},dayOfMonthOrdinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(t){var e=t,n="",a=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"];return e>20?n=40===e||50===e||60===e||80===e||100===e?"fed":"ain":e>0&&(n=a[e]),t+n},week:{dow:1,doy:4}});return e})},"990b":function(t,e,n){var a=n("9093"),r=n("2621"),i=n("cb7c"),o=n("7726").Reflect;t.exports=o&&o.ownKeys||function(t){var e=a.f(i(t)),n=r.f;return n?e.concat(n(t)):e}},"997d":function(t,e){var n="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();function a(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function r(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}e=t.exports=n?a:r,e.supported=a,e.unsupported=r},"9aa9":function(t,e){e.f=Object.getOwnPropertySymbols},"9b02":function(t,e,n){var a=n("656b");function r(t,e,n){var r=null==t?void 0:a(t,e);return void 0===r?n:r}t.exports=r},"9b43":function(t,e,n){var a=n("d8e8");t.exports=function(t,e,n){if(a(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,a){return t.call(e,n,a)};case 3:return function(n,a,r){return t.call(e,n,a,r)}}return function(){return t.apply(e,arguments)}}},"9c6c":function(t,e,n){var a=n("2b4c")("unscopables"),r=Array.prototype;void 0==r[a]&&n("32e9")(r,a,{}),t.exports=function(t){r[a][t]=!0}},"9c80":function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(e){return{e:!0,v:e}}}},"9def":function(t,e,n){var a=n("4588"),r=Math.min;t.exports=function(t){return t>0?r(a(t),9007199254740991):0}},"9e1e":function(t,e,n){t.exports=!n("79e5")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},"9e69":function(t,e,n){var a=n("2b3e"),r=a.Symbol;t.exports=r},"9f26":function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(t,e){switch(e){case"D":return t+(1===t?"er":"");default:case"M":case"Q":case"DDD":case"d":return t+(1===t?"er":"e");case"w":case"W":return t+(1===t?"re":"e")}},week:{dow:1,doy:4}});return e})},a159:function(t,e,n){var a=n("e4ae"),r=n("7e90"),i=n("1691"),o=n("5559")("IE_PROTO"),s=function(){},l="prototype",d=function(){var t,e=n("1ec9")("iframe"),a=i.length,r="<",o=">";e.style.display="none",n("32fc").appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(r+"script"+o+"document.F=Object"+r+"/script"+o),t.close(),d=t.F;while(a--)delete d[l][i[a]];return d()};t.exports=Object.create||function(t,e){var n;return null!==t?(s[l]=a(t),n=new s,s[l]=null,n[o]=t):n=d(),void 0===e?n:r(n,e)}},a25f:function(t,e,n){var a=n("7726"),r=a.navigator;t.exports=r&&r.userAgent||""},a356:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("ar-dz",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"أح_إث_ثلا_أر_خم_جم_سب".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:4}});return e})},a481:function(t,e,n){"use strict";var a=n("cb7c"),r=n("4bf8"),i=n("9def"),o=n("4588"),s=n("0390"),l=n("5f1b"),d=Math.max,u=Math.min,c=Math.floor,f=/\$([$&`']|\d\d?|<[^>]*>)/g,h=/\$([$&`']|\d\d?)/g,m=function(t){return void 0===t?t:String(t)};n("214f")("replace",2,function(t,e,n,p){return[function(a,r){var i=t(this),o=void 0==a?void 0:a[e];return void 0!==o?o.call(a,i,r):n.call(String(i),a,r)},function(t,e){var r=p(n,t,this,e);if(r.done)return r.value;var c=a(t),f=String(this),h="function"===typeof e;h||(e=String(e));var v=c.global;if(v){var y=c.unicode;c.lastIndex=0}var g=[];while(1){var b=l(c,f);if(null===b)break;if(g.push(b),!v)break;var M=String(b[0]);""===M&&(c.lastIndex=s(f,i(c.lastIndex),y))}for(var k="",w=0,x=0;x=w&&(k+=f.slice(w,Y)+H,w=Y+L.length)}return k+f.slice(w)}];function _(t,e,a,i,o,s){var l=a+t.length,d=i.length,u=h;return void 0!==o&&(o=r(o),u=f),n.call(s,u,function(n,r){var s;switch(r.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,a);case"'":return e.slice(l);case"<":s=o[r.slice(1,-1)];break;default:var u=+r;if(0===u)return n;if(u>d){var f=c(u/10);return 0===f?n:f<=d?void 0===i[f-1]?r.charAt(1):i[f-1]+r.charAt(1):n}s=i[u-1]}return void 0===s?"":s})}})},a524:function(t,e,n){var a=n("4245");function r(t){return a(this,t).has(t)}t.exports=r},a5b8:function(t,e,n){"use strict";var a=n("d8e8");function r(t){var e,n;this.promise=new t(function(t,a){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=a}),this.resolve=a(e),this.reject=a(n)}t.exports.f=function(t){return new r(t)}},a745:function(t,e,n){t.exports=n("f410")},a7fa:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("bm",{months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},calendar:{sameDay:"[Bi lɛrɛ] LT",nextDay:"[Sini lɛrɛ] LT",nextWeek:"dddd [don lɛrɛ] LT",lastDay:"[Kunu lɛrɛ] LT",lastWeek:"dddd [tɛmɛnen lɛrɛ] LT",sameElse:"L"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",ss:"sekondi %d",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"},week:{dow:1,doy:4}});return e})},aae3:function(t,e,n){var a=n("d3f4"),r=n("2d95"),i=n("2b4c")("match");t.exports=function(t){var e;return a(t)&&(void 0!==(e=t[i])?!!e:"RegExp"==r(t))}},ac6a:function(t,e,n){for(var a=n("cadf"),r=n("0d58"),i=n("2aba"),o=n("7726"),s=n("32e9"),l=n("84f2"),d=n("2b4c"),u=d("iterator"),c=d("toStringTag"),f=l.Array,h={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},m=r(h),p=0;p=0||Object.prototype.hasOwnProperty.call(t,a)&&(n[a]=t[a]);return n},c=function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=(e.children||[]).map(p.bind(null,t)),i=Object.keys(e.attributes||{}).reduce(function(t,n){var a=e.attributes[n];switch(n){case"class":t["class"]=h(a);break;case"style":t["style"]=f(a);break;default:t.attrs[n]=a}return t},{class:{},style:{},attrs:{}}),o=a.class,s=void 0===o?{}:o,l=a.style,c=void 0===l?{}:l,_=a.attrs,v=void 0===_?{}:_,y=u(a,["class","style","attrs"]);return"string"===typeof e?e:t(e.tag,d({class:m(i.class,s),style:d({},i.style,c),attrs:d({},i.attrs,v)},y,{props:n}),r)}var _=!1;try{_=!0}catch(w){}function v(){var t;!_&&console&&"function"===typeof console.error&&(t=console).error.apply(t,arguments)}function y(t,e){return Array.isArray(e)&&e.length>0||!Array.isArray(e)&&e?l({},t,e):{}}function g(t){var e,n=(e={"fa-spin":t.spin,"fa-pulse":t.pulse,"fa-fw":t.fixedWidth,"fa-border":t.border,"fa-li":t.listItem,"fa-flip-horizontal":"horizontal"===t.flip||"both"===t.flip,"fa-flip-vertical":"vertical"===t.flip||"both"===t.flip},l(e,"fa-"+t.size,null!==t.size),l(e,"fa-rotate-"+t.rotation,null!==t.rotation),l(e,"fa-pull-"+t.pull,null!==t.pull),e);return Object.keys(n).map(function(t){return n[t]?t:null}).filter(function(t){return t})}function b(t,e){var n=0===(t||"").length?[]:[t];return n.concat(e).join(" ")}function M(t){return null===t?null:"object"===("undefined"===typeof t?"undefined":s(t))&&t.prefix&&t.iconName?t:Array.isArray(t)&&2===t.length?{prefix:t[0],iconName:t[1]}:"string"===typeof t?{prefix:"fas",iconName:t}:void 0}var k={name:"FontAwesomeIcon",functional:!0,props:{border:{type:Boolean,default:!1},fixedWidth:{type:Boolean,default:!1},flip:{type:String,default:null,validator:function(t){return["horizontal","vertical","both"].indexOf(t)>-1}},icon:{type:[Object,Array,String],required:!0},mask:{type:[Object,Array,String],default:null},listItem:{type:Boolean,default:!1},pull:{type:String,default:null,validator:function(t){return["right","left"].indexOf(t)>-1}},pulse:{type:Boolean,default:!1},rotation:{type:[String,Number],default:null,validator:function(t){return[90,180,270].indexOf(parseInt(t,10))>-1}},size:{type:String,default:null,validator:function(t){return["lg","xs","sm","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"].indexOf(t)>-1}},spin:{type:Boolean,default:!1},transform:{type:[String,Object],default:null},symbol:{type:[Boolean,String],default:!1},title:{type:String,default:null}},render:function(t,e){var n=e.props,r=n.icon,i=n.mask,o=n.symbol,s=n.title,l=M(r),u=y("classes",g(n)),c=y("transform","string"===typeof n.transform?a["d"].transform(n.transform):n.transform),f=y("mask",M(i)),h=Object(a["b"])(l,d({},u,c,f,{symbol:o,title:s}));if(!h)return v("Could not find one or more icon(s)",l,f);var m=h.abstract,_=p.bind(null,t);return _(m[0],{},e.data)}};Boolean,String,Number,String,Object}).call(this,n("c8ba"))},ada2:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";function e(t,e){var n=t.split("_");return e%10===1&&e%100!==11?n[0]:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?n[1]:n[2]}function n(t,n,a){var r={ss:n?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:n?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:n?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"};return"m"===a?n?"хвилина":"хвилину":"h"===a?n?"година":"годину":t+" "+e(r[a],+t)}function a(t,e){var n={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")};if(!0===t)return n["nominative"].slice(1,7).concat(n["nominative"].slice(0,1));if(!t)return n["nominative"];var a=/(\[[ВвУу]\]) ?dddd/.test(e)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(e)?"genitive":"nominative";return n[a][t.day()]}function r(t){return function(){return t+"о"+(11===this.hours()?"б":"")+"] LT"}}var i=t.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:a,weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:r("[Сьогодні "),nextDay:r("[Завтра "),lastDay:r("[Вчора "),nextWeek:r("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return r("[Минулої] dddd [").call(this);case 1:case 2:case 4:return r("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",ss:n,m:n,mm:n,h:"годину",hh:n,d:"день",dd:n,M:"місяць",MM:n,y:"рік",yy:n},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(t){return/^(дня|вечора)$/.test(t)},meridiem:function(t,e,n){return t<4?"ночі":t<12?"ранку":t<17?"дня":"вечора"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го)/,ordinal:function(t,e){switch(e){case"M":case"d":case"DDD":case"w":case"W":return t+"-й";case"D":return t+"-го";default:return t}},week:{dow:1,doy:7}});return i})},aebd:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},afab:function(t,e,n){var a,r; -/*! - * URI.js - Mutating URLs - * Second Level Domain (SLD) Support - * - * Version: 1.19.1 - * - * Author: Rodney Rehm - * Web: http://medialize.github.io/URI.js/ - * - * Licensed under - * MIT License http://www.opensource.org/licenses/mit-license - * - */ -/*! - * URI.js - Mutating URLs - * Second Level Domain (SLD) Support - * - * Version: 1.19.1 - * - * Author: Rodney Rehm - * Web: http://medialize.github.io/URI.js/ - * - * Licensed under - * MIT License http://www.opensource.org/licenses/mit-license - * - */ -(function(i,o){"use strict";t.exports?t.exports=o():(a=o,r="function"===typeof a?a.call(e,n,e,t):a,void 0===r||(t.exports=r))})(0,function(t){"use strict";var e=t&&t.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(t){var e=t.lastIndexOf(".");if(e<=0||e>=t.length-1)return!1;var a=t.lastIndexOf(".",e-1);if(a<=0||a>=e-1)return!1;var r=n.list[t.slice(e+1)];return!!r&&r.indexOf(" "+t.slice(a+1,e)+" ")>=0},is:function(t){var e=t.lastIndexOf(".");if(e<=0||e>=t.length-1)return!1;var a=t.lastIndexOf(".",e-1);if(a>=0)return!1;var r=n.list[t.slice(e+1)];return!!r&&r.indexOf(" "+t.slice(0,e)+" ")>=0},get:function(t){var e=t.lastIndexOf(".");if(e<=0||e>=t.length-1)return null;var a=t.lastIndexOf(".",e-1);if(a<=0||a>=e-1)return null;var r=n.list[t.slice(e+1)];return r?r.indexOf(" "+t.slice(a+1,e)+" ")<0?null:t.slice(a+1):null},noConflict:function(){return t.SecondLevelDomains===this&&(t.SecondLevelDomains=e),this}};return n})},b0b4:function(t,e,n){"use strict";n.d(e,"a",function(){return o});var a=n("85f2"),r=n.n(a);function i(t,e){for(var n=0;n0?r(a(t),9007199254740991):0}},b469:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";function e(t,e,n,a){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[t+" Tage",t+" Tagen"],M:["ein Monat","einem Monat"],MM:[t+" Monate",t+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[t+" Jahre",t+" Jahren"]};return e?r[n][0]:r[n][1]}var n=t.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:e,mm:"%d Minuten",h:e,hh:"%d Stunden",d:e,dd:e,M:e,MM:e,y:e,yy:e},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return n})},b4c0:function(t,e,n){var a=n("cb5a");function r(t){var e=this.__data__,n=a(e,t);return n<0?void 0:e[n][1]}t.exports=r},b53d:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",ss:"%d imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}});return e})},b540:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(t,e){return 12===t&&(t=0),"enjing"===e?t:"siyang"===e?t>=11?t:t+12:"sonten"===e||"ndalu"===e?t+12:void 0},meridiem:function(t,e,n){return t<11?"enjing":t<15?"siyang":t<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",ss:"%d detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}});return e})},b702:function(t,e,n){"use strict";n.d(e,"a",function(){return a});var a={prefix:"far",iconName:"circle",icon:[512,512,[],"f111","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200z"]}},b84c:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"sun_mån_tys_ons_tor_fre_lau".split("_"),weekdaysMin:"su_må_ty_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s sidan",s:"nokre sekund",ss:"%d sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return e})},b8e3:function(t,e){t.exports=!0},b97c:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e={ss:"sekundes_sekundēm_sekunde_sekundes".split("_"),m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function n(t,e,n){return n?e%10===1&&e%100!==11?t[2]:t[3]:e%10===1&&e%100!==11?t[0]:t[1]}function a(t,a,r){return t+" "+n(e[r],t,a)}function r(t,a,r){return n(e[r],t,a)}function i(t,e){return e?"dažas sekundes":"dažām sekundēm"}var o=t.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:i,ss:a,m:r,mm:a,h:r,hh:a,d:r,dd:a,M:r,MM:a,y:r,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return o})},bb71:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";function e(t,e,n,a){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[t+" Tage",t+" Tagen"],M:["ein Monat","einem Monat"],MM:[t+" Monate",t+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[t+" Jahre",t+" Jahren"]};return e?r[n][0]:r[n][1]}var n=t.defineLocale("de-ch",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:e,mm:"%d Minuten",h:e,hh:"%d Stunden",d:e,dd:e,M:e,MM:e,y:e,yy:e},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return n})},bbc0:function(t,e,n){var a=n("6044"),r="__lodash_hash_undefined__",i=Object.prototype,o=i.hasOwnProperty;function s(t){var e=this.__data__;if(a){var n=e[t];return n===r?void 0:n}return o.call(e,t)?e[t]:void 0}t.exports=s},bcaa:function(t,e,n){var a=n("cb7c"),r=n("d3f4"),i=n("a5b8");t.exports=function(t,e){if(a(t),r(e)&&e.constructor===t)return e;var n=i.f(t),o=n.resolve;return o(e),n.promise}},bd86:function(t,e,n){"use strict";n.d(e,"a",function(){return i});var a=n("85f2"),r=n.n(a);function i(t,e,n){return e in t?r()(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},be13:function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},bf0b:function(t,e,n){var a=n("355d"),r=n("aebd"),i=n("36c3"),o=n("1bc3"),s=n("07e3"),l=n("794b"),d=Object.getOwnPropertyDescriptor;e.f=n("8e60")?d:function(t,e){if(t=i(t),e=o(e,!0),l)try{return d(t,e)}catch(n){}if(s(t,e))return r(!a.f.call(t,e),t[e])}},c074:function(t,e,n){"use strict";n.d(e,"a",function(){return a}),n.d(e,"b",function(){return r}),n.d(e,"c",function(){return i}),n.d(e,"d",function(){return o}),n.d(e,"e",function(){return s}),n.d(e,"f",function(){return l}),n.d(e,"g",function(){return d}),n.d(e,"h",function(){return u}),n.d(e,"i",function(){return c}),n.d(e,"j",function(){return f}),n.d(e,"k",function(){return h}),n.d(e,"l",function(){return m}),n.d(e,"m",function(){return p}),n.d(e,"n",function(){return _}),n.d(e,"o",function(){return v}),n.d(e,"p",function(){return y}),n.d(e,"q",function(){return g}),n.d(e,"r",function(){return b}),n.d(e,"s",function(){return M}),n.d(e,"t",function(){return k}),n.d(e,"u",function(){return w});var a={prefix:"fas",iconName:"angle-down",icon:[320,512,[],"f107","M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z"]},r={prefix:"fas",iconName:"angle-up",icon:[320,512,[],"f106","M177 159.7l136 136c9.4 9.4 9.4 24.6 0 33.9l-22.6 22.6c-9.4 9.4-24.6 9.4-33.9 0L160 255.9l-96.4 96.4c-9.4 9.4-24.6 9.4-33.9 0L7 329.7c-9.4-9.4-9.4-24.6 0-33.9l136-136c9.4-9.5 24.6-9.5 34-.1z"]},i={prefix:"fas",iconName:"arrow-circle-down",icon:[512,512,[],"f0ab","M504 256c0 137-111 248-248 248S8 393 8 256 119 8 256 8s248 111 248 248zm-143.6-28.9L288 302.6V120c0-13.3-10.7-24-24-24h-16c-13.3 0-24 10.7-24 24v182.6l-72.4-75.5c-9.3-9.7-24.8-9.9-34.3-.4l-10.9 11c-9.4 9.4-9.4 24.6 0 33.9L239 404.3c9.4 9.4 24.6 9.4 33.9 0l132.7-132.7c9.4-9.4 9.4-24.6 0-33.9l-10.9-11c-9.5-9.5-25-9.3-34.3.4z"]},o={prefix:"fas",iconName:"ban",icon:[512,512,[],"f05e","M256 8C119.034 8 8 119.033 8 256s111.034 248 248 248 248-111.034 248-248S392.967 8 256 8zm130.108 117.892c65.448 65.448 70 165.481 20.677 235.637L150.47 105.216c70.204-49.356 170.226-44.735 235.638 20.676zM125.892 386.108c-65.448-65.448-70-165.481-20.677-235.637L361.53 406.784c-70.203 49.356-170.226 44.736-235.638-20.676z"]},s={prefix:"fas",iconName:"bars",icon:[448,512,[],"f0c9","M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"]},l={prefix:"fas",iconName:"chart-bar",icon:[512,512,[],"f080","M332.8 320h38.4c6.4 0 12.8-6.4 12.8-12.8V172.8c0-6.4-6.4-12.8-12.8-12.8h-38.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h38.4c6.4 0 12.8-6.4 12.8-12.8V76.8c0-6.4-6.4-12.8-12.8-12.8h-38.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-288 0h38.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-38.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h38.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-38.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zM496 384H64V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-32c0-8.84-7.16-16-16-16z"]},d={prefix:"fas",iconName:"circle",icon:[512,512,[],"f111","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"]},u={prefix:"fas",iconName:"clock",icon:[512,512,[],"f017","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm57.1 350.1L224.9 294c-3.1-2.3-4.9-5.9-4.9-9.7V116c0-6.6 5.4-12 12-12h48c6.6 0 12 5.4 12 12v137.7l63.5 46.2c5.4 3.9 6.5 11.4 2.6 16.8l-28.2 38.8c-3.9 5.3-11.4 6.5-16.8 2.6z"]},c={prefix:"fas",iconName:"cog",icon:[512,512,[],"f013","M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z"]},f={prefix:"fas",iconName:"exclamation-circle",icon:[512,512,[],"f06a","M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"]},h={prefix:"fas",iconName:"exclamation-triangle",icon:[576,512,[],"f071","M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"]},m={prefix:"fas",iconName:"indent",icon:[448,512,[],"f03c","M27.31 363.3l96-96a16 16 0 0 0 0-22.62l-96-96C17.27 138.66 0 145.78 0 160v192c0 14.31 17.33 21.3 27.31 11.3zM432 416H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm3.17-128H204.83A12.82 12.82 0 0 0 192 300.83v38.34A12.82 12.82 0 0 0 204.83 352h230.34A12.82 12.82 0 0 0 448 339.17v-38.34A12.82 12.82 0 0 0 435.17 288zm0-128H204.83A12.82 12.82 0 0 0 192 172.83v38.34A12.82 12.82 0 0 0 204.83 224h230.34A12.82 12.82 0 0 0 448 211.17v-38.34A12.82 12.82 0 0 0 435.17 160zM432 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"]},p={prefix:"fas",iconName:"link",icon:[512,512,[],"f0c1","M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"]},_={prefix:"fas",iconName:"list-ol",icon:[512,512,[],"f0cb","M61.77 401l17.5-20.15a19.92 19.92 0 0 0 5.07-14.19v-3.31C84.34 356 80.5 352 73 352H16a8 8 0 0 0-8 8v16a8 8 0 0 0 8 8h22.83a157.41 157.41 0 0 0-11 12.31l-5.61 7c-4 5.07-5.25 10.13-2.8 14.88l1.05 1.93c3 5.76 6.29 7.88 12.25 7.88h4.73c10.33 0 15.94 2.44 15.94 9.09 0 4.72-4.2 8.22-14.36 8.22a41.54 41.54 0 0 1-15.47-3.12c-6.49-3.88-11.74-3.5-15.6 3.12l-5.59 9.31c-3.72 6.13-3.19 11.72 2.63 15.94 7.71 4.69 20.38 9.44 37 9.44 34.16 0 48.5-22.75 48.5-44.12-.03-14.38-9.12-29.76-28.73-34.88zM496 224H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM16 160h64a8 8 0 0 0 8-8v-16a8 8 0 0 0-8-8H64V40a8 8 0 0 0-8-8H32a8 8 0 0 0-7.14 4.42l-8 16A8 8 0 0 0 24 64h8v64H16a8 8 0 0 0-8 8v16a8 8 0 0 0 8 8zm-3.91 160H80a8 8 0 0 0 8-8v-16a8 8 0 0 0-8-8H41.32c3.29-10.29 48.34-18.68 48.34-56.44 0-29.06-25-39.56-44.47-39.56-21.36 0-33.8 10-40.46 18.75-4.37 5.59-3 10.84 2.8 15.37l8.58 6.88c5.61 4.56 11 2.47 16.12-2.44a13.44 13.44 0 0 1 9.46-3.84c3.33 0 9.28 1.56 9.28 8.75C51 248.19 0 257.31 0 304.59v4C0 316 5.08 320 12.09 320z"]},v={prefix:"fas",iconName:"lock",icon:[448,512,[],"f023","M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z"]},y={prefix:"fas",iconName:"microchip",icon:[512,512,[],"f2db","M416 48v416c0 26.51-21.49 48-48 48H144c-26.51 0-48-21.49-48-48V48c0-26.51 21.49-48 48-48h224c26.51 0 48 21.49 48 48zm96 58v12a6 6 0 0 1-6 6h-18v6a6 6 0 0 1-6 6h-42V88h42a6 6 0 0 1 6 6v6h18a6 6 0 0 1 6 6zm0 96v12a6 6 0 0 1-6 6h-18v6a6 6 0 0 1-6 6h-42v-48h42a6 6 0 0 1 6 6v6h18a6 6 0 0 1 6 6zm0 96v12a6 6 0 0 1-6 6h-18v6a6 6 0 0 1-6 6h-42v-48h42a6 6 0 0 1 6 6v6h18a6 6 0 0 1 6 6zm0 96v12a6 6 0 0 1-6 6h-18v6a6 6 0 0 1-6 6h-42v-48h42a6 6 0 0 1 6 6v6h18a6 6 0 0 1 6 6zM30 376h42v48H30a6 6 0 0 1-6-6v-6H6a6 6 0 0 1-6-6v-12a6 6 0 0 1 6-6h18v-6a6 6 0 0 1 6-6zm0-96h42v48H30a6 6 0 0 1-6-6v-6H6a6 6 0 0 1-6-6v-12a6 6 0 0 1 6-6h18v-6a6 6 0 0 1 6-6zm0-96h42v48H30a6 6 0 0 1-6-6v-6H6a6 6 0 0 1-6-6v-12a6 6 0 0 1 6-6h18v-6a6 6 0 0 1 6-6zm0-96h42v48H30a6 6 0 0 1-6-6v-6H6a6 6 0 0 1-6-6v-12a6 6 0 0 1 6-6h18v-6a6 6 0 0 1 6-6z"]},g={prefix:"fas",iconName:"outdent",icon:[448,512,[],"f03b","M100.69 363.29c10 10 27.31 2.93 27.31-11.31V160c0-14.32-17.33-21.31-27.31-11.31l-96 96a16 16 0 0 0 0 22.62zM432 416H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm3.17-128H204.83A12.82 12.82 0 0 0 192 300.83v38.34A12.82 12.82 0 0 0 204.83 352h230.34A12.82 12.82 0 0 0 448 339.17v-38.34A12.82 12.82 0 0 0 435.17 288zm0-128H204.83A12.82 12.82 0 0 0 192 172.83v38.34A12.82 12.82 0 0 0 204.83 224h230.34A12.82 12.82 0 0 0 448 211.17v-38.34A12.82 12.82 0 0 0 435.17 160zM432 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"]},b={prefix:"fas",iconName:"percent",icon:[448,512,[],"f295","M112 224c61.9 0 112-50.1 112-112S173.9 0 112 0 0 50.1 0 112s50.1 112 112 112zm0-160c26.5 0 48 21.5 48 48s-21.5 48-48 48-48-21.5-48-48 21.5-48 48-48zm224 224c-61.9 0-112 50.1-112 112s50.1 112 112 112 112-50.1 112-112-50.1-112-112-112zm0 160c-26.5 0-48-21.5-48-48s21.5-48 48-48 48 21.5 48 48-21.5 48-48 48zM392.3.2l31.6-.1c19.4-.1 30.9 21.8 19.7 37.8L77.4 501.6a23.95 23.95 0 0 1-19.6 10.2l-33.4.1c-19.5 0-30.9-21.9-19.7-37.8l368-463.7C377.2 4 384.5.2 392.3.2z"]},M={prefix:"fas",iconName:"search",icon:[512,512,[],"f002","M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"]},k={prefix:"fas",iconName:"times-circle",icon:[512,512,[],"f057","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z"]},w={prefix:"fas",iconName:"user",icon:[448,512,[],"f007","M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"]}},c109:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",ss:"%d ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}});return e})},c1df:function(t,e,n){(function(t){(function(e,n){t.exports=n()})(0,function(){"use strict";var e,a;function r(){return e.apply(null,arguments)}function i(t){e=t}function o(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function s(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function l(t){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(t).length;var e;for(e in t)if(t.hasOwnProperty(e))return!1;return!0}function d(t){return void 0===t}function u(t){return"number"===typeof t||"[object Number]"===Object.prototype.toString.call(t)}function c(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function f(t,e){var n,a=[];for(n=0;n>>0,a=0;a0)for(n=0;n0?"future":"past"];return P(n)?n(e):n.replace(/%s/i,e)}var q={};function X(t,e){var n=t.toLowerCase();q[n]=q[n+"s"]=q[e]=t}function Q(t){return"string"===typeof t?q[t]||q[t.toLowerCase()]:void 0}function Z(t){var e,n,a={};for(n in t)h(t,n)&&(e=Q(n),e&&(a[e]=t[n]));return a}var K={};function tt(t,e){K[t]=e}function et(t){var e=[];for(var n in t)e.push({unit:n,priority:K[n]});return e.sort(function(t,e){return t.priority-e.priority}),e}function nt(t,e,n){var a=""+Math.abs(t),r=e-a.length,i=t>=0;return(i?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+a}var at=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,rt=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,it={},ot={};function st(t,e,n,a){var r=a;"string"===typeof a&&(r=function(){return this[a]()}),t&&(ot[t]=r),e&&(ot[e[0]]=function(){return nt(r.apply(this,arguments),e[1],e[2])}),n&&(ot[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),t)})}function lt(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function dt(t){var e,n,a=t.match(at);for(e=0,n=a.length;e=0&&rt.test(t))t=t.replace(rt,a),rt.lastIndex=0,n-=1;return t}var ft=/\d/,ht=/\d\d/,mt=/\d{3}/,pt=/\d{4}/,_t=/[+-]?\d{6}/,vt=/\d\d?/,yt=/\d\d\d\d?/,gt=/\d\d\d\d\d\d?/,bt=/\d{1,3}/,Mt=/\d{1,4}/,kt=/[+-]?\d{1,6}/,wt=/\d+/,xt=/[+-]?\d+/,Lt=/Z|[+-]\d\d:?\d\d/gi,Yt=/Z|[+-]\d\d(?::?\d\d)?/gi,Dt=/[+-]?\d+(\.\d{1,3})?/,St=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Tt={};function Ot(t,e,n){Tt[t]=P(e)?e:function(t,a){return t&&n?n:e}}function Ht(t,e){return h(Tt,t)?Tt[t](e._strict,e._locale):new RegExp(At(t))}function At(t){return Pt(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,a,r){return e||n||a||r}))}function Pt(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var jt={};function Ct(t,e){var n,a=e;for("string"===typeof t&&(t=[t]),u(e)&&(a=function(t,n){n[e]=Y(t)}),n=0;n68?1900:2e3)};var qt,Xt=Zt("FullYear",!0);function Qt(){return Gt(this.year())}function Zt(t,e){return function(n){return null!=n?(te(this,t,n),r.updateOffset(this,e),this):Kt(this,t)}}function Kt(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function te(t,e,n){t.isValid()&&!isNaN(n)&&("FullYear"===e&&Gt(t.year())&&1===t.month()&&29===t.date()?t._d["set"+(t._isUTC?"UTC":"")+e](n,t.month(),re(n,t.month())):t._d["set"+(t._isUTC?"UTC":"")+e](n))}function ee(t){return t=Q(t),P(this[t])?this[t]():this}function ne(t,e){if("object"===typeof t){t=Z(t);for(var n=et(t),a=0;a=0?(s=new Date(t+400,e,n,a,r,i,o),isFinite(s.getFullYear())&&s.setFullYear(t)):s=new Date(t,e,n,a,r,i,o),s}function Me(t){var e;if(t<100&&t>=0){var n=Array.prototype.slice.call(arguments);n[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)}else e=new Date(Date.UTC.apply(null,arguments));return e}function ke(t,e,n){var a=7+e-n,r=(7+Me(t,0,a).getUTCDay()-e)%7;return-r+a-1}function we(t,e,n,a,r){var i,o,s=(7+n-a)%7,l=ke(t,a,r),d=1+7*(e-1)+s+l;return d<=0?(i=t-1,o=Jt(i)+d):d>Jt(t)?(i=t+1,o=d-Jt(t)):(i=t,o=d),{year:i,dayOfYear:o}}function xe(t,e,n){var a,r,i=ke(t.year(),e,n),o=Math.floor((t.dayOfYear()-i-1)/7)+1;return o<1?(r=t.year()-1,a=o+Le(r,e,n)):o>Le(t.year(),e,n)?(a=o-Le(t.year(),e,n),r=t.year()+1):(r=t.year(),a=o),{week:a,year:r}}function Le(t,e,n){var a=ke(t,e,n),r=ke(t+1,e,n);return(Jt(t)-a+r)/7}function Ye(t){return xe(t,this._week.dow,this._week.doy).week}st("w",["ww",2],"wo","week"),st("W",["WW",2],"Wo","isoWeek"),X("week","w"),X("isoWeek","W"),tt("week",5),tt("isoWeek",5),Ot("w",vt),Ot("ww",vt,ht),Ot("W",vt),Ot("WW",vt,ht),zt(["w","ww","W","WW"],function(t,e,n,a){e[a.substr(0,1)]=Y(t)});var De={dow:0,doy:6};function Se(){return this._week.dow}function Te(){return this._week.doy}function Oe(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function He(t){var e=xe(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function Ae(t,e){return"string"!==typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"===typeof t?t:null):parseInt(t,10)}function Pe(t,e){return"string"===typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function je(t,e){return t.slice(e,7).concat(t.slice(0,e))}st("d",0,"do","day"),st("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),st("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),st("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),st("e",0,0,"weekday"),st("E",0,0,"isoWeekday"),X("day","d"),X("weekday","e"),X("isoWeekday","E"),tt("day",11),tt("weekday",11),tt("isoWeekday",11),Ot("d",vt),Ot("e",vt),Ot("E",vt),Ot("dd",function(t,e){return e.weekdaysMinRegex(t)}),Ot("ddd",function(t,e){return e.weekdaysShortRegex(t)}),Ot("dddd",function(t,e){return e.weekdaysRegex(t)}),zt(["dd","ddd","dddd"],function(t,e,n,a){var r=n._locale.weekdaysParse(t,a,n._strict);null!=r?e.d=r:v(n).invalidWeekday=t}),zt(["d","e","E"],function(t,e,n,a){e[a]=Y(t)});var Ce="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");function ze(t,e){var n=o(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?je(n,this._week.dow):t?n[t.day()]:n}var Ee="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");function Fe(t){return!0===t?je(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}var Ie="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function We(t){return!0===t?je(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function Re(t,e,n){var a,r,i,o=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],a=0;a<7;++a)i=p([2e3,1]).day(a),this._minWeekdaysParse[a]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[a]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[a]=this.weekdays(i,"").toLocaleLowerCase();return n?"dddd"===e?(r=qt.call(this._weekdaysParse,o),-1!==r?r:null):"ddd"===e?(r=qt.call(this._shortWeekdaysParse,o),-1!==r?r:null):(r=qt.call(this._minWeekdaysParse,o),-1!==r?r:null):"dddd"===e?(r=qt.call(this._weekdaysParse,o),-1!==r?r:(r=qt.call(this._shortWeekdaysParse,o),-1!==r?r:(r=qt.call(this._minWeekdaysParse,o),-1!==r?r:null))):"ddd"===e?(r=qt.call(this._shortWeekdaysParse,o),-1!==r?r:(r=qt.call(this._weekdaysParse,o),-1!==r?r:(r=qt.call(this._minWeekdaysParse,o),-1!==r?r:null))):(r=qt.call(this._minWeekdaysParse,o),-1!==r?r:(r=qt.call(this._weekdaysParse,o),-1!==r?r:(r=qt.call(this._shortWeekdaysParse,o),-1!==r?r:null)))}function Ne(t,e,n){var a,r,i;if(this._weekdaysParseExact)return Re.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),a=0;a<7;a++){if(r=p([2e3,1]).day(a),n&&!this._fullWeekdaysParse[a]&&(this._fullWeekdaysParse[a]=new RegExp("^"+this.weekdays(r,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[a]=new RegExp("^"+this.weekdaysShort(r,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[a]=new RegExp("^"+this.weekdaysMin(r,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[a]||(i="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[a]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[a].test(t))return a;if(n&&"ddd"===e&&this._shortWeekdaysParse[a].test(t))return a;if(n&&"dd"===e&&this._minWeekdaysParse[a].test(t))return a;if(!n&&this._weekdaysParse[a].test(t))return a}}function Ve(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Ae(t,this.localeData()),this.add(t-e,"d")):e}function Ue(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function Be(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=Pe(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7}var $e=St;function Je(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||Ze.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(h(this,"_weekdaysRegex")||(this._weekdaysRegex=$e),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}var Ge=St;function qe(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||Ze.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(h(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ge),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}var Xe=St;function Qe(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||Ze.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(h(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Xe),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ze(){function t(t,e){return e.length-t.length}var e,n,a,r,i,o=[],s=[],l=[],d=[];for(e=0;e<7;e++)n=p([2e3,1]).day(e),a=this.weekdaysMin(n,""),r=this.weekdaysShort(n,""),i=this.weekdays(n,""),o.push(a),s.push(r),l.push(i),d.push(a),d.push(r),d.push(i);for(o.sort(t),s.sort(t),l.sort(t),d.sort(t),e=0;e<7;e++)s[e]=Pt(s[e]),l[e]=Pt(l[e]),d[e]=Pt(d[e]);this._weekdaysRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function Ke(){return this.hours()%12||12}function tn(){return this.hours()||24}function en(t,e){st(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function nn(t,e){return e._meridiemParse}function an(t){return"p"===(t+"").toLowerCase().charAt(0)}st("H",["HH",2],0,"hour"),st("h",["hh",2],0,Ke),st("k",["kk",2],0,tn),st("hmm",0,0,function(){return""+Ke.apply(this)+nt(this.minutes(),2)}),st("hmmss",0,0,function(){return""+Ke.apply(this)+nt(this.minutes(),2)+nt(this.seconds(),2)}),st("Hmm",0,0,function(){return""+this.hours()+nt(this.minutes(),2)}),st("Hmmss",0,0,function(){return""+this.hours()+nt(this.minutes(),2)+nt(this.seconds(),2)}),en("a",!0),en("A",!1),X("hour","h"),tt("hour",13),Ot("a",nn),Ot("A",nn),Ot("H",vt),Ot("h",vt),Ot("k",vt),Ot("HH",vt,ht),Ot("hh",vt,ht),Ot("kk",vt,ht),Ot("hmm",yt),Ot("hmmss",gt),Ot("Hmm",yt),Ot("Hmmss",gt),Ct(["H","HH"],Rt),Ct(["k","kk"],function(t,e,n){var a=Y(t);e[Rt]=24===a?0:a}),Ct(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),Ct(["h","hh"],function(t,e,n){e[Rt]=Y(t),v(n).bigHour=!0}),Ct("hmm",function(t,e,n){var a=t.length-2;e[Rt]=Y(t.substr(0,a)),e[Nt]=Y(t.substr(a)),v(n).bigHour=!0}),Ct("hmmss",function(t,e,n){var a=t.length-4,r=t.length-2;e[Rt]=Y(t.substr(0,a)),e[Nt]=Y(t.substr(a,2)),e[Vt]=Y(t.substr(r)),v(n).bigHour=!0}),Ct("Hmm",function(t,e,n){var a=t.length-2;e[Rt]=Y(t.substr(0,a)),e[Nt]=Y(t.substr(a))}),Ct("Hmmss",function(t,e,n){var a=t.length-4,r=t.length-2;e[Rt]=Y(t.substr(0,a)),e[Nt]=Y(t.substr(a,2)),e[Vt]=Y(t.substr(r))});var rn=/[ap]\.?m?\.?/i;function on(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var sn,ln=Zt("Hours",!0),dn={calendar:E,longDateFormat:I,invalidDate:R,ordinal:V,dayOfMonthOrdinalParse:U,relativeTime:$,months:oe,monthsShort:le,week:De,weekdays:Ce,weekdaysMin:Ie,weekdaysShort:Ee,meridiemParse:rn},un={},cn={};function fn(t){return t?t.toLowerCase().replace("_","-"):t}function hn(t){var e,n,a,r,i=0;while(i0){if(a=mn(r.slice(0,e).join("-")),a)return a;if(n&&n.length>=e&&D(r,n,!0)>=e-1)break;e--}i++}return sn}function mn(e){var a=null;if(!un[e]&&"undefined"!==typeof t&&t&&t.exports)try{a=sn._abbr;n("4678")("./"+e),pn(a)}catch(r){}return un[e]}function pn(t,e){var n;return t&&(n=d(e)?yn(t):_n(t,e),n?sn=n:"undefined"!==typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),sn._abbr}function _n(t,e){if(null!==e){var n,a=dn;if(e.abbr=t,null!=un[t])A("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),a=un[t]._config;else if(null!=e.parentLocale)if(null!=un[e.parentLocale])a=un[e.parentLocale]._config;else{if(n=mn(e.parentLocale),null==n)return cn[e.parentLocale]||(cn[e.parentLocale]=[]),cn[e.parentLocale].push({name:t,config:e}),null;a=n._config}return un[t]=new z(C(a,e)),cn[t]&&cn[t].forEach(function(t){_n(t.name,t.config)}),pn(t),un[t]}return delete un[t],null}function vn(t,e){if(null!=e){var n,a,r=dn;a=mn(t),null!=a&&(r=a._config),e=C(r,e),n=new z(e),n.parentLocale=un[t],un[t]=n,pn(t)}else null!=un[t]&&(null!=un[t].parentLocale?un[t]=un[t].parentLocale:null!=un[t]&&delete un[t]);return un[t]}function yn(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return sn;if(!o(t)){if(e=mn(t),e)return e;t=[t]}return hn(t)}function gn(){return O(un)}function bn(t){var e,n=t._a;return n&&-2===v(t).overflow&&(e=n[It]<0||n[It]>11?It:n[Wt]<1||n[Wt]>re(n[Ft],n[It])?Wt:n[Rt]<0||n[Rt]>24||24===n[Rt]&&(0!==n[Nt]||0!==n[Vt]||0!==n[Ut])?Rt:n[Nt]<0||n[Nt]>59?Nt:n[Vt]<0||n[Vt]>59?Vt:n[Ut]<0||n[Ut]>999?Ut:-1,v(t)._overflowDayOfYear&&(eWt)&&(e=Wt),v(t)._overflowWeeks&&-1===e&&(e=Bt),v(t)._overflowWeekday&&-1===e&&(e=$t),v(t).overflow=e),t}function Mn(t,e,n){return null!=t?t:null!=e?e:n}function kn(t){var e=new Date(r.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function wn(t){var e,n,a,r,i,o=[];if(!t._d){for(a=kn(t),t._w&&null==t._a[Wt]&&null==t._a[It]&&xn(t),null!=t._dayOfYear&&(i=Mn(t._a[Ft],a[Ft]),(t._dayOfYear>Jt(i)||0===t._dayOfYear)&&(v(t)._overflowDayOfYear=!0),n=Me(i,0,t._dayOfYear),t._a[It]=n.getUTCMonth(),t._a[Wt]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=o[e]=a[e];for(;e<7;e++)t._a[e]=o[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[Rt]&&0===t._a[Nt]&&0===t._a[Vt]&&0===t._a[Ut]&&(t._nextDay=!0,t._a[Rt]=0),t._d=(t._useUTC?Me:be).apply(null,o),r=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Rt]=24),t._w&&"undefined"!==typeof t._w.d&&t._w.d!==r&&(v(t).weekdayMismatch=!0)}}function xn(t){var e,n,a,r,i,o,s,l;if(e=t._w,null!=e.GG||null!=e.W||null!=e.E)i=1,o=4,n=Mn(e.GG,t._a[Ft],xe(qn(),1,4).year),a=Mn(e.W,1),r=Mn(e.E,1),(r<1||r>7)&&(l=!0);else{i=t._locale._week.dow,o=t._locale._week.doy;var d=xe(qn(),i,o);n=Mn(e.gg,t._a[Ft],d.year),a=Mn(e.w,d.week),null!=e.d?(r=e.d,(r<0||r>6)&&(l=!0)):null!=e.e?(r=e.e+i,(e.e<0||e.e>6)&&(l=!0)):r=i}a<1||a>Le(n,i,o)?v(t)._overflowWeeks=!0:null!=l?v(t)._overflowWeekday=!0:(s=we(n,a,r,i,o),t._a[Ft]=s.year,t._dayOfYear=s.dayOfYear)}var Ln=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Yn=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Dn=/Z|[+-]\d\d(?::?\d\d)?/,Sn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Tn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],On=/^\/?Date\((\-?\d+)/i;function Hn(t){var e,n,a,r,i,o,s=t._i,l=Ln.exec(s)||Yn.exec(s);if(l){for(v(t).iso=!0,e=0,n=Sn.length;e0&&v(t).unusedInput.push(o),s=s.slice(s.indexOf(n)+n.length),d+=n.length),ot[i]?(n?v(t).empty=!1:v(t).unusedTokens.push(i),Et(i,n,t)):t._strict&&!n&&v(t).unusedTokens.push(i);v(t).charsLeftOver=l-d,s.length>0&&v(t).unusedInput.push(s),t._a[Rt]<=12&&!0===v(t).bigHour&&t._a[Rt]>0&&(v(t).bigHour=void 0),v(t).parsedDateParts=t._a.slice(0),v(t).meridiem=t._meridiem,t._a[Rt]=Nn(t._locale,t._a[Rt],t._meridiem),wn(t),bn(t)}else In(t);else Hn(t)}function Nn(t,e,n){var a;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?(a=t.isPM(n),a&&e<12&&(e+=12),a||12!==e||(e=0),e):e}function Vn(t){var e,n,a,r,i;if(0===t._f.length)return v(t).invalidFormat=!0,void(t._d=new Date(NaN));for(r=0;rthis?this:t:g()});function Zn(t,e){var n,a;if(1===e.length&&o(e[0])&&(e=e[0]),!e.length)return qn();for(n=e[0],a=1;athis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ma(){if(!d(this._isDSTShifted))return this._isDSTShifted;var t={};if(M(t,this),t=$n(t),t._a){var e=t._isUTC?p(t._a):qn(t._a);this._isDSTShifted=this.isValid()&&D(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function ka(){return!!this.isValid()&&!this._isUTC}function wa(){return!!this.isValid()&&this._isUTC}function xa(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}r.updateOffset=function(){};var La=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Ya=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Da(t,e){var n,a,r,i=t,o=null;return sa(t)?i={ms:t._milliseconds,d:t._days,M:t._months}:u(t)?(i={},e?i[e]=t:i.milliseconds=t):(o=La.exec(t))?(n="-"===o[1]?-1:1,i={y:0,d:Y(o[Wt])*n,h:Y(o[Rt])*n,m:Y(o[Nt])*n,s:Y(o[Vt])*n,ms:Y(la(1e3*o[Ut]))*n}):(o=Ya.exec(t))?(n="-"===o[1]?-1:1,i={y:Sa(o[2],n),M:Sa(o[3],n),w:Sa(o[4],n),d:Sa(o[5],n),h:Sa(o[6],n),m:Sa(o[7],n),s:Sa(o[8],n)}):null==i?i={}:"object"===typeof i&&("from"in i||"to"in i)&&(r=Oa(qn(i.from),qn(i.to)),i={},i.ms=r.milliseconds,i.M=r.months),a=new oa(i),sa(t)&&h(t,"_locale")&&(a._locale=t._locale),a}function Sa(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function Ta(t,e){var n={};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function Oa(t,e){var n;return t.isValid()&&e.isValid()?(e=fa(e,t),t.isBefore(e)?n=Ta(t,e):(n=Ta(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Ha(t,e){return function(n,a){var r,i;return null===a||isNaN(+a)||(A(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=n,n=a,a=i),n="string"===typeof n?+n:n,r=Da(n,a),Aa(this,r,t),this}}function Aa(t,e,n,a){var i=e._milliseconds,o=la(e._days),s=la(e._months);t.isValid()&&(a=null==a||a,s&&fe(t,Kt(t,"Month")+s*n),o&&te(t,"Date",Kt(t,"Date")+o*n),i&&t._d.setTime(t._d.valueOf()+i*n),a&&r.updateOffset(t,o||s))}Da.fn=oa.prototype,Da.invalid=ia;var Pa=Ha(1,"add"),ja=Ha(-1,"subtract");function Ca(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function za(t,e){var n=t||qn(),a=fa(n,this).startOf("day"),i=r.calendarFormat(this,a)||"sameElse",o=e&&(P(e[i])?e[i].call(this,n):e[i]);return this.format(o||this.localeData().calendar(i,this,qn(n)))}function Ea(){return new w(this)}function Fa(t,e){var n=x(t)?t:qn(t);return!(!this.isValid()||!n.isValid())&&(e=Q(e)||"millisecond","millisecond"===e?this.valueOf()>n.valueOf():n.valueOf()9999?ut(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):P(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",ut(n,"Z")):ut(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Ga(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var n="["+t+'("]',a=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",r="-MM-DD[T]HH:mm:ss.SSS",i=e+'[")]';return this.format(n+a+r+i)}function qa(t){t||(t=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var e=ut(this,t);return this.localeData().postformat(e)}function Xa(t,e){return this.isValid()&&(x(t)&&t.isValid()||qn(t).isValid())?Da({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function Qa(t){return this.from(qn(),t)}function Za(t,e){return this.isValid()&&(x(t)&&t.isValid()||qn(t).isValid())?Da({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function Ka(t){return this.to(qn(),t)}function tr(t){var e;return void 0===t?this._locale._abbr:(e=yn(t),null!=e&&(this._locale=e),this)}r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",r.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var er=T("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});function nr(){return this._locale}var ar=1e3,rr=60*ar,ir=60*rr,or=3506328*ir;function sr(t,e){return(t%e+e)%e}function lr(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-or:new Date(t,e,n).valueOf()}function dr(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-or:Date.UTC(t,e,n)}function ur(t){var e;if(t=Q(t),void 0===t||"millisecond"===t||!this.isValid())return this;var n=this._isUTC?dr:lr;switch(t){case"year":e=n(this.year(),0,1);break;case"quarter":e=n(this.year(),this.month()-this.month()%3,1);break;case"month":e=n(this.year(),this.month(),1);break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=n(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=sr(e+(this._isUTC?0:this.utcOffset()*rr),ir);break;case"minute":e=this._d.valueOf(),e-=sr(e,rr);break;case"second":e=this._d.valueOf(),e-=sr(e,ar);break}return this._d.setTime(e),r.updateOffset(this,!0),this}function cr(t){var e;if(t=Q(t),void 0===t||"millisecond"===t||!this.isValid())return this;var n=this._isUTC?dr:lr;switch(t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=ir-sr(e+(this._isUTC?0:this.utcOffset()*rr),ir)-1;break;case"minute":e=this._d.valueOf(),e+=rr-sr(e,rr)-1;break;case"second":e=this._d.valueOf(),e+=ar-sr(e,ar)-1;break}return this._d.setTime(e),r.updateOffset(this,!0),this}function fr(){return this._d.valueOf()-6e4*(this._offset||0)}function hr(){return Math.floor(this.valueOf()/1e3)}function mr(){return new Date(this.valueOf())}function pr(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function _r(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function vr(){return this.isValid()?this.toISOString():null}function yr(){return y(this)}function gr(){return m({},v(this))}function br(){return v(this).overflow}function Mr(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function kr(t,e){st(0,[t,t.length],0,e)}function wr(t){return Dr.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function xr(t){return Dr.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function Lr(){return Le(this.year(),1,4)}function Yr(){var t=this.localeData()._week;return Le(this.year(),t.dow,t.doy)}function Dr(t,e,n,a,r){var i;return null==t?xe(this,a,r).year:(i=Le(t,a,r),e>i&&(e=i),Sr.call(this,t,e,n,a,r))}function Sr(t,e,n,a,r){var i=we(t,e,n,a,r),o=Me(i.year,0,i.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}function Tr(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}st(0,["gg",2],0,function(){return this.weekYear()%100}),st(0,["GG",2],0,function(){return this.isoWeekYear()%100}),kr("gggg","weekYear"),kr("ggggg","weekYear"),kr("GGGG","isoWeekYear"),kr("GGGGG","isoWeekYear"),X("weekYear","gg"),X("isoWeekYear","GG"),tt("weekYear",1),tt("isoWeekYear",1),Ot("G",xt),Ot("g",xt),Ot("GG",vt,ht),Ot("gg",vt,ht),Ot("GGGG",Mt,pt),Ot("gggg",Mt,pt),Ot("GGGGG",kt,_t),Ot("ggggg",kt,_t),zt(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,a){e[a.substr(0,2)]=Y(t)}),zt(["gg","GG"],function(t,e,n,a){e[a]=r.parseTwoDigitYear(t)}),st("Q",0,"Qo","quarter"),X("quarter","Q"),tt("quarter",7),Ot("Q",ft),Ct("Q",function(t,e){e[It]=3*(Y(t)-1)}),st("D",["DD",2],"Do","date"),X("date","D"),tt("date",9),Ot("D",vt),Ot("DD",vt,ht),Ot("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),Ct(["D","DD"],Wt),Ct("Do",function(t,e){e[Wt]=Y(t.match(vt)[0])});var Or=Zt("Date",!0);function Hr(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}st("DDD",["DDDD",3],"DDDo","dayOfYear"),X("dayOfYear","DDD"),tt("dayOfYear",4),Ot("DDD",bt),Ot("DDDD",mt),Ct(["DDD","DDDD"],function(t,e,n){n._dayOfYear=Y(t)}),st("m",["mm",2],0,"minute"),X("minute","m"),tt("minute",14),Ot("m",vt),Ot("mm",vt,ht),Ct(["m","mm"],Nt);var Ar=Zt("Minutes",!1);st("s",["ss",2],0,"second"),X("second","s"),tt("second",15),Ot("s",vt),Ot("ss",vt,ht),Ct(["s","ss"],Vt);var Pr,jr=Zt("Seconds",!1);for(st("S",0,0,function(){return~~(this.millisecond()/100)}),st(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),st(0,["SSS",3],0,"millisecond"),st(0,["SSSS",4],0,function(){return 10*this.millisecond()}),st(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),st(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),st(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),st(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),st(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),X("millisecond","ms"),tt("millisecond",16),Ot("S",bt,ft),Ot("SS",bt,ht),Ot("SSS",bt,mt),Pr="SSSS";Pr.length<=9;Pr+="S")Ot(Pr,wt);function Cr(t,e){e[Ut]=Y(1e3*("0."+t))}for(Pr="S";Pr.length<=9;Pr+="S")Ct(Pr,Cr);var zr=Zt("Milliseconds",!1);function Er(){return this._isUTC?"UTC":""}function Fr(){return this._isUTC?"Coordinated Universal Time":""}st("z",0,0,"zoneAbbr"),st("zz",0,0,"zoneName");var Ir=w.prototype;function Wr(t){return qn(1e3*t)}function Rr(){return qn.apply(null,arguments).parseZone()}function Nr(t){return t}Ir.add=Pa,Ir.calendar=za,Ir.clone=Ea,Ir.diff=Ua,Ir.endOf=cr,Ir.format=qa,Ir.from=Xa,Ir.fromNow=Qa,Ir.to=Za,Ir.toNow=Ka,Ir.get=ee,Ir.invalidAt=br,Ir.isAfter=Fa,Ir.isBefore=Ia,Ir.isBetween=Wa,Ir.isSame=Ra,Ir.isSameOrAfter=Na,Ir.isSameOrBefore=Va,Ir.isValid=yr,Ir.lang=er,Ir.locale=tr,Ir.localeData=nr,Ir.max=Qn,Ir.min=Xn,Ir.parsingFlags=gr,Ir.set=ne,Ir.startOf=ur,Ir.subtract=ja,Ir.toArray=pr,Ir.toObject=_r,Ir.toDate=mr,Ir.toISOString=Ja,Ir.inspect=Ga,Ir.toJSON=vr,Ir.toString=$a,Ir.unix=hr,Ir.valueOf=fr,Ir.creationData=Mr,Ir.year=Xt,Ir.isLeapYear=Qt,Ir.weekYear=wr,Ir.isoWeekYear=xr,Ir.quarter=Ir.quarters=Tr,Ir.month=he,Ir.daysInMonth=me,Ir.week=Ir.weeks=Oe,Ir.isoWeek=Ir.isoWeeks=He,Ir.weeksInYear=Yr,Ir.isoWeeksInYear=Lr,Ir.date=Or,Ir.day=Ir.days=Ve,Ir.weekday=Ue,Ir.isoWeekday=Be,Ir.dayOfYear=Hr,Ir.hour=Ir.hours=ln,Ir.minute=Ir.minutes=Ar,Ir.second=Ir.seconds=jr,Ir.millisecond=Ir.milliseconds=zr,Ir.utcOffset=ma,Ir.utc=_a,Ir.local=va,Ir.parseZone=ya,Ir.hasAlignedHourOffset=ga,Ir.isDST=ba,Ir.isLocal=ka,Ir.isUtcOffset=wa,Ir.isUtc=xa,Ir.isUTC=xa,Ir.zoneAbbr=Er,Ir.zoneName=Fr,Ir.dates=T("dates accessor is deprecated. Use date instead.",Or),Ir.months=T("months accessor is deprecated. Use month instead",he),Ir.years=T("years accessor is deprecated. Use year instead",Xt),Ir.zone=T("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",pa),Ir.isDSTShifted=T("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Ma);var Vr=z.prototype;function Ur(t,e,n,a){var r=yn(),i=p().set(a,e);return r[n](i,t)}function Br(t,e,n){if(u(t)&&(e=t,t=void 0),t=t||"",null!=e)return Ur(t,e,n,"month");var a,r=[];for(a=0;a<12;a++)r[a]=Ur(t,a,n,"month");return r}function $r(t,e,n,a){"boolean"===typeof t?(u(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,u(e)&&(n=e,e=void 0),e=e||"");var r,i=yn(),o=t?i._week.dow:0;if(null!=n)return Ur(e,(n+o)%7,a,"day");var s=[];for(r=0;r<7;r++)s[r]=Ur(e,(r+o)%7,a,"day");return s}function Jr(t,e){return Br(t,e,"months")}function Gr(t,e){return Br(t,e,"monthsShort")}function qr(t,e,n){return $r(t,e,n,"weekdays")}function Xr(t,e,n){return $r(t,e,n,"weekdaysShort")}function Qr(t,e,n){return $r(t,e,n,"weekdaysMin")}Vr.calendar=F,Vr.longDateFormat=W,Vr.invalidDate=N,Vr.ordinal=B,Vr.preparse=Nr,Vr.postformat=Nr,Vr.relativeTime=J,Vr.pastFuture=G,Vr.set=j,Vr.months=se,Vr.monthsShort=de,Vr.monthsParse=ce,Vr.monthsRegex=ye,Vr.monthsShortRegex=_e,Vr.week=Ye,Vr.firstDayOfYear=Te,Vr.firstDayOfWeek=Se,Vr.weekdays=ze,Vr.weekdaysMin=We,Vr.weekdaysShort=Fe,Vr.weekdaysParse=Ne,Vr.weekdaysRegex=Je,Vr.weekdaysShortRegex=qe,Vr.weekdaysMinRegex=Qe,Vr.isPM=an,Vr.meridiem=on,pn("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=1===Y(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n}}),r.lang=T("moment.lang is deprecated. Use moment.locale instead.",pn),r.langData=T("moment.langData is deprecated. Use moment.localeData instead.",yn);var Zr=Math.abs;function Kr(){var t=this._data;return this._milliseconds=Zr(this._milliseconds),this._days=Zr(this._days),this._months=Zr(this._months),t.milliseconds=Zr(t.milliseconds),t.seconds=Zr(t.seconds),t.minutes=Zr(t.minutes),t.hours=Zr(t.hours),t.months=Zr(t.months),t.years=Zr(t.years),this}function ti(t,e,n,a){var r=Da(e,n);return t._milliseconds+=a*r._milliseconds,t._days+=a*r._days,t._months+=a*r._months,t._bubble()}function ei(t,e){return ti(this,t,e,1)}function ni(t,e){return ti(this,t,e,-1)}function ai(t){return t<0?Math.floor(t):Math.ceil(t)}function ri(){var t,e,n,a,r,i=this._milliseconds,o=this._days,s=this._months,l=this._data;return i>=0&&o>=0&&s>=0||i<=0&&o<=0&&s<=0||(i+=864e5*ai(oi(s)+o),o=0,s=0),l.milliseconds=i%1e3,t=L(i/1e3),l.seconds=t%60,e=L(t/60),l.minutes=e%60,n=L(e/60),l.hours=n%24,o+=L(n/24),r=L(ii(o)),s+=r,o-=ai(oi(r)),a=L(s/12),s%=12,l.days=o,l.months=s,l.years=a,this}function ii(t){return 4800*t/146097}function oi(t){return 146097*t/4800}function si(t){if(!this.isValid())return NaN;var e,n,a=this._milliseconds;if(t=Q(t),"month"===t||"quarter"===t||"year"===t)switch(e=this._days+a/864e5,n=this._months+ii(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(oi(this._months)),t){case"week":return e/7+a/6048e5;case"day":return e+a/864e5;case"hour":return 24*e+a/36e5;case"minute":return 1440*e+a/6e4;case"second":return 86400*e+a/1e3;case"millisecond":return Math.floor(864e5*e)+a;default:throw new Error("Unknown unit "+t)}}function li(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*Y(this._months/12):NaN}function di(t){return function(){return this.as(t)}}var ui=di("ms"),ci=di("s"),fi=di("m"),hi=di("h"),mi=di("d"),pi=di("w"),_i=di("M"),vi=di("Q"),yi=di("y");function gi(){return Da(this)}function bi(t){return t=Q(t),this.isValid()?this[t+"s"]():NaN}function Mi(t){return function(){return this.isValid()?this._data[t]:NaN}}var ki=Mi("milliseconds"),wi=Mi("seconds"),xi=Mi("minutes"),Li=Mi("hours"),Yi=Mi("days"),Di=Mi("months"),Si=Mi("years");function Ti(){return L(this.days()/7)}var Oi=Math.round,Hi={ss:44,s:45,m:45,h:22,d:26,M:11};function Ai(t,e,n,a,r){return r.relativeTime(e||1,!!n,t,a)}function Pi(t,e,n){var a=Da(t).abs(),r=Oi(a.as("s")),i=Oi(a.as("m")),o=Oi(a.as("h")),s=Oi(a.as("d")),l=Oi(a.as("M")),d=Oi(a.as("y")),u=r<=Hi.ss&&["s",r]||r0,u[4]=n,Ai.apply(null,u)}function ji(t){return void 0===t?Oi:"function"===typeof t&&(Oi=t,!0)}function Ci(t,e){return void 0!==Hi[t]&&(void 0===e?Hi[t]:(Hi[t]=e,"s"===t&&(Hi.ss=e-1),!0))}function zi(t){if(!this.isValid())return this.localeData().invalidDate();var e=this.localeData(),n=Pi(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)}var Ei=Math.abs;function Fi(t){return(t>0)-(t<0)||+t}function Ii(){if(!this.isValid())return this.localeData().invalidDate();var t,e,n,a=Ei(this._milliseconds)/1e3,r=Ei(this._days),i=Ei(this._months);t=L(a/60),e=L(t/60),a%=60,t%=60,n=L(i/12),i%=12;var o=n,s=i,l=r,d=e,u=t,c=a?a.toFixed(3).replace(/\.?0+$/,""):"",f=this.asSeconds();if(!f)return"P0D";var h=f<0?"-":"",m=Fi(this._months)!==Fi(f)?"-":"",p=Fi(this._days)!==Fi(f)?"-":"",_=Fi(this._milliseconds)!==Fi(f)?"-":"";return h+"P"+(o?m+o+"Y":"")+(s?m+s+"M":"")+(l?p+l+"D":"")+(d||u||c?"T":"")+(d?_+d+"H":"")+(u?_+u+"M":"")+(c?_+c+"S":"")}var Wi=oa.prototype;return Wi.isValid=ra,Wi.abs=Kr,Wi.add=ei,Wi.subtract=ni,Wi.as=si,Wi.asMilliseconds=ui,Wi.asSeconds=ci,Wi.asMinutes=fi,Wi.asHours=hi,Wi.asDays=mi,Wi.asWeeks=pi,Wi.asMonths=_i,Wi.asQuarters=vi,Wi.asYears=yi,Wi.valueOf=li,Wi._bubble=ri,Wi.clone=gi,Wi.get=bi,Wi.milliseconds=ki,Wi.seconds=wi,Wi.minutes=xi,Wi.hours=Li,Wi.days=Yi,Wi.weeks=Ti,Wi.months=Di,Wi.years=Si,Wi.humanize=zi,Wi.toISOString=Ii,Wi.toString=Ii,Wi.toJSON=Ii,Wi.locale=tr,Wi.localeData=nr,Wi.toIsoString=T("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ii),Wi.lang=er,st("X",0,0,"unix"),st("x",0,0,"valueOf"),Ot("x",xt),Ot("X",Dt),Ct("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),Ct("x",function(t,e,n){n._d=new Date(Y(t))}),r.version="2.24.0",i(qn),r.fn=Ir,r.min=Kn,r.max=ta,r.now=ea,r.utc=p,r.unix=Wr,r.months=Jr,r.isDate=c,r.locale=pn,r.invalid=g,r.duration=Da,r.isMoment=x,r.weekdays=qr,r.parseZone=Rr,r.localeData=yn,r.isDuration=sa,r.monthsShort=Gr,r.weekdaysMin=Qr,r.defineLocale=_n,r.updateLocale=vn,r.locales=gn,r.weekdaysShort=Xr,r.normalizeUnits=Q,r.relativeTimeRounding=ji,r.relativeTimeThreshold=Ci,r.calendarFormat=Ca,r.prototype=Ir,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r})}).call(this,n("62e4")(t))},c207:function(t,e){},c26b:function(t,e,n){"use strict";var a=n("86cc").f,r=n("2aeb"),i=n("dcbc"),o=n("9b43"),s=n("f605"),l=n("4a59"),d=n("01f9"),u=n("d53b"),c=n("7a56"),f=n("9e1e"),h=n("67ab").fastKey,m=n("b39a"),p=f?"_s":"size",_=function(t,e){var n,a=h(e);if("F"!==a)return t._i[a];for(n=t._f;n;n=n.n)if(n.k==e)return n};t.exports={getConstructor:function(t,e,n,d){var u=t(function(t,a){s(t,u,e,"_i"),t._t=e,t._i=r(null),t._f=void 0,t._l=void 0,t[p]=0,void 0!=a&&l(a,n,t[d],t)});return i(u.prototype,{clear:function(){for(var t=m(this,e),n=t._i,a=t._f;a;a=a.n)a.r=!0,a.p&&(a.p=a.p.n=void 0),delete n[a.i];t._f=t._l=void 0,t[p]=0},delete:function(t){var n=m(this,e),a=_(n,t);if(a){var r=a.n,i=a.p;delete n._i[a.i],a.r=!0,i&&(i.n=r),r&&(r.p=i),n._f==a&&(n._f=r),n._l==a&&(n._l=i),n[p]--}return!!a},forEach:function(t){m(this,e);var n,a=o(t,arguments.length>1?arguments[1]:void 0,3);while(n=n?n.n:this._f){a(n.v,n.k,this);while(n&&n.r)n=n.p}},has:function(t){return!!_(m(this,e),t)}}),f&&a(u.prototype,"size",{get:function(){return m(this,e)[p]}}),u},def:function(t,e,n){var a,r,i=_(t,e);return i?i.v=n:(t._l=i={i:r=h(e,!0),k:e,v:n,p:a=t._l,n:void 0,r:!1},t._f||(t._f=i),a&&(a.n=i),t[p]++,"F"!==r&&(t._i[r]=i)),t},getEntry:_,setStrong:function(t,e,n){d(t,e,function(t,n){this._t=m(t,e),this._k=n,this._l=void 0},function(){var t=this,e=t._k,n=t._l;while(n&&n.r)n=n.p;return t._t&&(t._l=n=n?n.n:t._t._f)?u(0,"keys"==e?n.k:"values"==e?n.v:[n.k,n.v]):(t._t=void 0,u(1))},n?"entries":"values",!n,!0),c(e)}}},c366:function(t,e,n){var a=n("6821"),r=n("9def"),i=n("77f1");t.exports=function(t){return function(e,n,o){var s,l=a(e),d=r(l.length),u=i(o,d);if(t&&n!=n){while(d>u)if(s=l[u++],s!=s)return!0}else for(;d>u;u++)if((t||u in l)&&l[u]===n)return t||u||0;return!t&&-1}}},c367:function(t,e,n){"use strict";var a=n("8436"),r=n("50ed"),i=n("481b"),o=n("36c3");t.exports=n("30f1")(Array,"Array",function(t,e){this._t=o(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,r(1)):r(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values"),i.Arguments=i.Array,a("keys"),a("values"),a("entries")},c3a1:function(t,e,n){var a=n("e6f3"),r=n("1691");t.exports=Object.keys||function(t){return a(t,r)}},c69a:function(t,e,n){t.exports=!n("9e1e")&&!n("79e5")(function(){return 7!=Object.defineProperty(n("230e")("div"),"a",{get:function(){return 7}}).a})},c7aa:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(t){return 2===t?"שעתיים":t+" שעות"},d:"יום",dd:function(t){return 2===t?"יומיים":t+" ימים"},M:"חודש",MM:function(t){return 2===t?"חודשיים":t+" חודשים"},y:"שנה",yy:function(t){return 2===t?"שנתיים":t%10===0&&10!==t?t+" שנה":t+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(t){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(t)},meridiem:function(t,e,n){return t<5?"לפנות בוקר":t<10?"בבוקר":t<12?n?'לפנה"צ':"לפני הצהריים":t<18?n?'אחה"צ':"אחרי הצהריים":"בערב"}});return e})},c8ba:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(a){"object"===typeof window&&(n=window)}t.exports=n},c8bb:function(t,e,n){t.exports=n("54a1")},c8f3:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),weekdaysParseExact:!0,meridiemParse:/PD|MD/,isPM:function(t){return"M"===t.charAt(0)},meridiem:function(t,e,n){return t<12?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",ss:"%d sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return e})},c909:function(t,e,n){var a,r,i; -/*! - * URI.js - Mutating URLs - * - * Version: 1.19.1 - * - * Author: Rodney Rehm - * Web: http://medialize.github.io/URI.js/ - * - * Licensed under - * MIT License http://www.opensource.org/licenses/mit-license - * - */ -/*! - * URI.js - Mutating URLs - * - * Version: 1.19.1 - * - * Author: Rodney Rehm - * Web: http://medialize.github.io/URI.js/ - * - * Licensed under - * MIT License http://www.opensource.org/licenses/mit-license - * - */ -(function(o,s){"use strict";t.exports?t.exports=s(n("63c5"),n("0056"),n("afab")):(r=[n("63c5"),n("0056"),n("afab")],a=s,i="function"===typeof a?a.apply(e,r):a,void 0===i||(t.exports=i))})(0,function(t,e,n,a){"use strict";var r=a&&a.URI;function i(t,e){var n=arguments.length>=1,a=arguments.length>=2;if(!(this instanceof i))return n?a?new i(t,e):new i(t):new i;if(void 0===t){if(n)throw new TypeError("undefined is not a valid argument for URI");t="undefined"!==typeof location?location.href+"":""}if(null===t&&n)throw new TypeError("null is not a valid argument for URI");return this.href(t),void 0!==e?this.absoluteTo(e):this}function o(t){return/^[0-9]+$/.test(t)}i.version="1.19.1";var s=i.prototype,l=Object.prototype.hasOwnProperty;function d(t){return t.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function u(t){return void 0===t?"Undefined":String(Object.prototype.toString.call(t)).slice(8,-1)}function c(t){return"Array"===u(t)}function f(t,e){var n,a,r={};if("RegExp"===u(e))r=null;else if(c(e))for(n=0,a=e.length;n]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,i.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},i.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},i.hostProtocols=["http","https"],i.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,i.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},i.getDomAttribute=function(t){if(t&&t.nodeName){var e=t.nodeName.toLowerCase();if("input"!==e||"image"===t.type)return i.domAttributes[e]}},i.encode=v,i.decode=decodeURIComponent,i.iso8859=function(){i.encode=escape,i.decode=unescape},i.unicode=function(){i.encode=v,i.decode=decodeURIComponent},i.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},i.encodeQuery=function(t,e){var n=i.encode(t+"");return void 0===e&&(e=i.escapeQuerySpace),e?n.replace(/%20/g,"+"):n},i.decodeQuery=function(t,e){t+="",void 0===e&&(e=i.escapeQuerySpace);try{return i.decode(e?t.replace(/\+/g,"%20"):t)}catch(n){return t}};var y,g={encode:"encode",decode:"decode"},b=function(t,e){return function(n){try{return i[e](n+"").replace(i.characters[t][e].expression,function(n){return i.characters[t][e].map[n]})}catch(a){return n}}};for(y in g)i[y+"PathSegment"]=b("pathname",g[y]),i[y+"UrnPathSegment"]=b("urnpath",g[y]);var M=function(t,e,n){return function(a){var r;r=n?function(t){return i[e](i[n](t))}:i[e];for(var o=(a+"").split(t),s=0,l=o.length;s-1&&(e.fragment=t.substring(n+1)||null,t=t.substring(0,n)),n=t.indexOf("?"),n>-1&&(e.query=t.substring(n+1)||null,t=t.substring(0,n)),"//"===t.substring(0,2)?(e.protocol=null,t=t.substring(2),t=i.parseAuthority(t,e)):(n=t.indexOf(":"),n>-1&&(e.protocol=t.substring(0,n)||null,e.protocol&&!e.protocol.match(i.protocol_expression)?e.protocol=void 0:"//"===t.substring(n+1,n+3)?(t=t.substring(n+3),t=i.parseAuthority(t,e)):(t=t.substring(n+1),e.urn=!0))),e.path=t,e},i.parseHost=function(t,e){t||(t=""),t=t.replace(/\\/g,"/");var n,a,r=t.indexOf("/");if(-1===r&&(r=t.length),"["===t.charAt(0))n=t.indexOf("]"),e.hostname=t.substring(1,n)||null,e.port=t.substring(n+2,r)||null,"/"===e.port&&(e.port=null);else{var o=t.indexOf(":"),s=t.indexOf("/"),l=t.indexOf(":",o+1);-1!==l&&(-1===s||l-1?a:t.length-1);return r>-1&&(-1===a||r-1?h.slice(0,m)+h.slice(m).replace(o,""):h.replace(o,""),!(h.length<=d[0].length)&&(!n.ignore||!n.ignore.test(h))){f=u+h.length;var v=e(h,u,f,t);void 0!==v?(v=String(v),t=t.slice(0,u)+v+t.slice(f),a.lastIndex=u+v.length):a.lastIndex=f}}return a.lastIndex=0,t},i.ensureValidHostname=function(e,n){var a=!!e,r=!!n,o=!1;if(r&&(o=h(i.hostProtocols,n)),o&&!a)throw new TypeError("Hostname cannot be empty, if protocol is "+n);if(e&&e.match(i.invalid_hostname_characters)){if(!t)throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(t.toASCII(e).match(i.invalid_hostname_characters))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-:_]')}},i.ensureValidPort=function(t){if(t){var e=Number(t);if(!(o(e)&&e>0&&e<65536))throw new TypeError('Port "'+t+'" is not a valid port')}},i.noConflict=function(t){if(t){var e={URI:this.noConflict()};return a.URITemplate&&"function"===typeof a.URITemplate.noConflict&&(e.URITemplate=a.URITemplate.noConflict()),a.IPv6&&"function"===typeof a.IPv6.noConflict&&(e.IPv6=a.IPv6.noConflict()),a.SecondLevelDomains&&"function"===typeof a.SecondLevelDomains.noConflict&&(e.SecondLevelDomains=a.SecondLevelDomains.noConflict()),e}return a.URI===this&&(a.URI=r),this},s.build=function(t){return!0===t?this._deferred_build=!0:(void 0===t||this._deferred_build)&&(this._string=i.build(this._parts),this._deferred_build=!1),this},s.clone=function(){return new i(this)},s.valueOf=s.toString=function(){return this.build(!1)._string},s.protocol=k("protocol"),s.username=k("username"),s.password=k("password"),s.hostname=k("hostname"),s.port=k("port"),s.query=w("query","?"),s.fragment=w("fragment","#"),s.search=function(t,e){var n=this.query(t,e);return"string"===typeof n&&n.length?"?"+n:n},s.hash=function(t,e){var n=this.fragment(t,e);return"string"===typeof n&&n.length?"#"+n:n},s.pathname=function(t,e){if(void 0===t||!0===t){var n=this._parts.path||(this._parts.hostname?"/":"");return t?(this._parts.urn?i.decodeUrnPath:i.decodePath)(n):n}return this._parts.urn?this._parts.path=t?i.recodeUrnPath(t):"":this._parts.path=t?i.recodePath(t):"/",this.build(!e),this},s.path=s.pathname,s.href=function(t,e){var n;if(void 0===t)return this.toString();this._string="",this._parts=i._parts();var a=t instanceof i,r="object"===typeof t&&(t.hostname||t.path||t.pathname);if(t.nodeName){var o=i.getDomAttribute(t);t=t[o]||"",r=!1}if(!a&&r&&void 0!==t.pathname&&(t=t.toString()),"string"===typeof t||t instanceof String)this._parts=i.parse(String(t),this._parts);else{if(!a&&!r)throw new TypeError("invalid input");var s=a?t._parts:t;for(n in s)"query"!==n&&l.call(this._parts,n)&&(this._parts[n]=s[n]);s.query&&this.query(s.query,!1)}return this.build(!e),this},s.is=function(t){var e=!1,a=!1,r=!1,o=!1,s=!1,l=!1,d=!1,u=!this._parts.urn;switch(this._parts.hostname&&(u=!1,a=i.ip4_expression.test(this._parts.hostname),r=i.ip6_expression.test(this._parts.hostname),e=a||r,o=!e,s=o&&n&&n.has(this._parts.hostname),l=o&&i.idn_expression.test(this._parts.hostname),d=o&&i.punycode_expression.test(this._parts.hostname)),t.toLowerCase()){case"relative":return u;case"absolute":return!u;case"domain":case"name":return o;case"sld":return s;case"ip":return e;case"ip4":case"ipv4":case"inet4":return a;case"ip6":case"ipv6":case"inet6":return r;case"idn":return l;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return d}return null};var x=s.protocol,L=s.port,Y=s.hostname;s.protocol=function(t,e){if(t&&(t=t.replace(/:(\/\/)?$/,""),!t.match(i.protocol_expression)))throw new TypeError('Protocol "'+t+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return x.call(this,t,e)},s.scheme=s.protocol,s.port=function(t,e){return this._parts.urn?void 0===t?"":this:(void 0!==t&&(0===t&&(t=null),t&&(t+="",":"===t.charAt(0)&&(t=t.substring(1)),i.ensureValidPort(t))),L.call(this,t,e))},s.hostname=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0!==t){var n={preventInvalidHostname:this._parts.preventInvalidHostname},a=i.parseHost(t,n);if("/"!==a)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');t=n.hostname,this._parts.preventInvalidHostname&&i.ensureValidHostname(t,this._parts.protocol)}return Y.call(this,t,e)},s.origin=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t){var n=this.protocol(),a=this.authority();return a?(n?n+"://":"")+this.authority():""}var r=i(t);return this.protocol(r.protocol()).authority(r.authority()).build(!e),this},s.host=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t)return this._parts.hostname?i.buildHost(this._parts):"";var n=i.parseHost(t,this._parts);if("/"!==n)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');return this.build(!e),this},s.authority=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t)return this._parts.hostname?i.buildAuthority(this._parts):"";var n=i.parseAuthority(t,this._parts);if("/"!==n)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');return this.build(!e),this},s.userinfo=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t){var n=i.buildUserinfo(this._parts);return n?n.substring(0,n.length-1):n}return"@"!==t[t.length-1]&&(t+="@"),i.parseUserinfo(t,this._parts),this.build(!e),this},s.resource=function(t,e){var n;return void 0===t?this.path()+this.search()+this.hash():(n=i.parse(t),this._parts.path=n.path,this._parts.query=n.query,this._parts.fragment=n.fragment,this.build(!e),this)},s.subdomain=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,n)||""}var a=this._parts.hostname.length-this.domain().length,r=this._parts.hostname.substring(0,a),o=new RegExp("^"+d(r));if(t&&"."!==t.charAt(t.length-1)&&(t+="."),-1!==t.indexOf(":"))throw new TypeError("Domains cannot contain colons");return t&&i.ensureValidHostname(t,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(o,t),this.build(!e),this},s.domain=function(t,e){if(this._parts.urn)return void 0===t?"":this;if("boolean"===typeof t&&(e=t,t=void 0),void 0===t){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.match(/\./g);if(n&&n.length<2)return this._parts.hostname;var a=this._parts.hostname.length-this.tld(e).length-1;return a=this._parts.hostname.lastIndexOf(".",a-1)+1,this._parts.hostname.substring(a)||""}if(!t)throw new TypeError("cannot set domain empty");if(-1!==t.indexOf(":"))throw new TypeError("Domains cannot contain colons");if(i.ensureValidHostname(t,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=t;else{var r=new RegExp(d(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(r,t)}return this.build(!e),this},s.tld=function(t,e){if(this._parts.urn)return void 0===t?"":this;if("boolean"===typeof t&&(e=t,t=void 0),void 0===t){if(!this._parts.hostname||this.is("IP"))return"";var a=this._parts.hostname.lastIndexOf("."),r=this._parts.hostname.substring(a+1);return!0!==e&&n&&n.list[r.toLowerCase()]&&n.get(this._parts.hostname)||r}var i;if(!t)throw new TypeError("cannot set TLD empty");if(t.match(/[^a-zA-Z0-9-]/)){if(!n||!n.is(t))throw new TypeError('TLD "'+t+'" contains characters other than [A-Z0-9]');i=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,t)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");i=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,t)}return this.build(!e),this},s.directory=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t||!0===t){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var n=this._parts.path.length-this.filename().length-1,a=this._parts.path.substring(0,n)||(this._parts.hostname?"/":"");return t?i.decodePath(a):a}var r=this._parts.path.length-this.filename().length,o=this._parts.path.substring(0,r),s=new RegExp("^"+d(o));return this.is("relative")||(t||(t="/"),"/"!==t.charAt(0)&&(t="/"+t)),t&&"/"!==t.charAt(t.length-1)&&(t+="/"),t=i.recodePath(t),this._parts.path=this._parts.path.replace(s,t),this.build(!e),this},s.filename=function(t,e){if(this._parts.urn)return void 0===t?"":this;if("string"!==typeof t){if(!this._parts.path||"/"===this._parts.path)return"";var n=this._parts.path.lastIndexOf("/"),a=this._parts.path.substring(n+1);return t?i.decodePathSegment(a):a}var r=!1;"/"===t.charAt(0)&&(t=t.substring(1)),t.match(/\.?\//)&&(r=!0);var o=new RegExp(d(this.filename())+"$");return t=i.recodePath(t),this._parts.path=this._parts.path.replace(o,t),r?this.normalizePath(e):this.build(!e),this},s.suffix=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t||!0===t){if(!this._parts.path||"/"===this._parts.path)return"";var n,a,r=this.filename(),o=r.lastIndexOf(".");return-1===o?"":(n=r.substring(o+1),a=/^[a-z0-9%]+$/i.test(n)?n:"",t?i.decodePathSegment(a):a)}"."===t.charAt(0)&&(t=t.substring(1));var s,l=this.suffix();if(l)s=t?new RegExp(d(l)+"$"):new RegExp(d("."+l)+"$");else{if(!t)return this;this._parts.path+="."+i.recodePath(t)}return s&&(t=i.recodePath(t),this._parts.path=this._parts.path.replace(s,t)),this.build(!e),this},s.segment=function(t,e,n){var a=this._parts.urn?":":"/",r=this.path(),i="/"===r.substring(0,1),o=r.split(a);if(void 0!==t&&"number"!==typeof t&&(n=e,e=t,t=void 0),void 0!==t&&"number"!==typeof t)throw new Error('Bad segment "'+t+'", must be 0-based integer');if(i&&o.shift(),t<0&&(t=Math.max(o.length+t,0)),void 0===e)return void 0===t?o:o[t];if(null===t||void 0===o[t])if(c(e)){o=[];for(var s=0,l=e.length;s=t.length?(this._t=void 0,r(1)):r(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values"),i.Arguments=i.Array,a("keys"),a("values"),a("entries")},cb5a:function(t,e,n){var a=n("9638");function r(t,e){var n=t.length;while(n--)if(a(t[n][0],e))return n;return-1}t.exports=r},cb7c:function(t,e,n){var a=n("d3f4");t.exports=function(t){if(!a(t))throw TypeError(t+" is not an object!");return t}},ccb9:function(t,e,n){e.f=n("5168")},cd1c:function(t,e,n){var a=n("e853");t.exports=function(t,e){return new(a(t))(e)}},cdab:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("en-SG",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(t){var e=t%10,n=1===~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n},week:{dow:1,doy:4}});return e})},ce10:function(t,e,n){var a=n("69a8"),r=n("6821"),i=n("c366")(!1),o=n("613b")("IE_PROTO");t.exports=function(t,e){var n,s=r(t),l=0,d=[];for(n in s)n!=o&&a(s,n)&&d.push(n);while(e.length>l)a(s,n=e[l++])&&(~i(d,n)||d.push(n));return d}},ce86:function(t,e,n){var a=n("9e69"),r=n("7948"),i=n("6747"),o=n("ffd6"),s=1/0,l=a?a.prototype:void 0,d=l?l.toString:void 0;function u(t){if("string"==typeof t)return t;if(i(t))return r(t,u)+"";if(o(t))return d?d.call(t):"";var e=t+"";return"0"==e&&1/t==-s?"-0":e}t.exports=u},cf1e:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e={words:{ss:["sekunda","sekunde","sekundi"],m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(t,e){return 1===t?e[0]:t>=2&&t<=4?e[1]:e[2]},translate:function(t,n,a){var r=e.words[a];return 1===a.length?n?r[0]:r[1]:t+" "+e.correctGrammaticalCase(t,r)}},n=t.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){var t=["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"];return t[this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",ss:e.translate,m:e.translate,mm:e.translate,h:e.translate,hh:e.translate,d:"dan",dd:e.translate,M:"mesec",MM:e.translate,y:"godinu",yy:e.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}});return n})},cf51:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(t){return"d'o"===t.toLowerCase()},meridiem:function(t,e,n){return t>11?n?"d'o":"D'O":n?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});function n(t,e,n,a){var r={s:["viensas secunds","'iensas secunds"],ss:[t+" secunds",t+" secunds"],m:["'n míut","'iens míut"],mm:[t+" míuts",t+" míuts"],h:["'n þora","'iensa þora"],hh:[t+" þoras",t+" þoras"],d:["'n ziua","'iensa ziua"],dd:[t+" ziuas",t+" ziuas"],M:["'n mes","'iens mes"],MM:[t+" mesen",t+" mesen"],y:["'n ar","'iens ar"],yy:[t+" ars",t+" ars"]};return a?r[n][0]:e?r[n][0]:r[n][1]}return e})},cf75:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e="pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function n(t){var e=t;return e=-1!==t.indexOf("jaj")?e.slice(0,-3)+"leS":-1!==t.indexOf("jar")?e.slice(0,-3)+"waQ":-1!==t.indexOf("DIS")?e.slice(0,-3)+"nem":e+" pIq",e}function a(t){var e=t;return e=-1!==t.indexOf("jaj")?e.slice(0,-3)+"Hu’":-1!==t.indexOf("jar")?e.slice(0,-3)+"wen":-1!==t.indexOf("DIS")?e.slice(0,-3)+"ben":e+" ret",e}function r(t,e,n,a){var r=i(t);switch(n){case"ss":return r+" lup";case"mm":return r+" tup";case"hh":return r+" rep";case"dd":return r+" jaj";case"MM":return r+" jar";case"yy":return r+" DIS"}}function i(t){var n=Math.floor(t%1e3/100),a=Math.floor(t%100/10),r=t%10,i="";return n>0&&(i+=e[n]+"vatlh"),a>0&&(i+=(""!==i?" ":"")+e[a]+"maH"),r>0&&(i+=(""!==i?" ":"")+e[r]),""===i?"pagh":i}var o=t.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:n,past:a,s:"puS lup",ss:r,m:"wa’ tup",mm:r,h:"wa’ rep",hh:r,d:"wa’ jaj",dd:r,M:"wa’ jar",MM:r,y:"wa’ DIS",yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return o})},d225:function(t,e,n){"use strict";function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,"a",function(){return a})},d26a:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},n={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"},a=t.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",ss:"%d སྐར་ཆ།",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(t){return t.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,function(t){return n[t]})},postformat:function(t){return t.replace(/\d/g,function(t){return e[t]})},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(t,e){return 12===t&&(t=0),"མཚན་མོ"===e&&t>=4||"ཉིན་གུང"===e&&t<5||"དགོང་དག"===e?t+12:t},meridiem:function(t,e,n){return t<4?"མཚན་མོ":t<10?"ཞོགས་ཀས":t<17?"ཉིན་གུང":t<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}});return a})},d2c8:function(t,e,n){var a=n("aae3"),r=n("be13");t.exports=function(t,e,n){if(a(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(r(t))}},d2d4:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("pt-br",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº"});return e})},d2d5:function(t,e,n){n("1654"),n("549b"),t.exports=n("584a").Array.from},d3f4:function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},d53b:function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},d6b6:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",ss:"%d վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(t){return/^(ցերեկվա|երեկոյան)$/.test(t)},meridiem:function(t){return t<4?"գիշերվա":t<12?"առավոտվա":t<17?"ցերեկվա":"երեկոյան"},dayOfMonthOrdinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(t,e){switch(e){case"DDD":case"w":case"W":case"DDDo":return 1===t?t+"-ին":t+"-րդ";default:return t}},week:{dow:1,doy:7}});return e})},d716:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("ca",{months:{standalone:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",ss:"%d segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(t,e){var n=1===t?"r":2===t?"n":3===t?"r":4===t?"t":"è";return"w"!==e&&"W"!==e||(n="a"),t+n},week:{dow:1,doy:4}});return e})},d842:function(t,e,n){"use strict";var a=n("50d1"),r=n.n(a),i=n("7fae"),o=n.n(i),s=function(t){return l(t)&&!d(t)};function l(t){return!!t&&"object"===typeof t}function d(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||f(t)}var u="function"===typeof Symbol&&Symbol.for,c=u?Symbol.for("react.element"):60103;function f(t){return t.$$typeof===c}function h(t){return Array.isArray(t)?[]:{}}function m(t,e){return!1!==e.clone&&e.isMergeableObject(t)?v(h(t),t,e):t}function p(t,e,n){return t.concat(e).map(function(t){return m(t,n)})}function _(t,e,n){var a={};return n.isMergeableObject(t)&&Object.keys(t).forEach(function(e){a[e]=m(t[e],n)}),Object.keys(e).forEach(function(r){n.isMergeableObject(e[r])&&t[r]?a[r]=v(t[r],e[r],n):a[r]=m(e[r],n)}),a}function v(t,e,n){n=n||{},n.arrayMerge=n.arrayMerge||p,n.isMergeableObject=n.isMergeableObject||s;var a=Array.isArray(e),r=Array.isArray(t),i=a===r;return i?a?n.arrayMerge(t,e,n):_(t,e,n):m(e,n)}v.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(t,n){return v(t,n,e)},{})};var y=v,g=y,b=1,M=function(t,e,n){var a=["adapter","colors","curve","dataset","decimal","discrete","donut","download","label","legend","library","max","messages","min","points","prefix","refresh","stacked","suffix","thousands","title","xmax","xmin","xtitle","ytitle"];t.component(e,{props:["data","id","width","height"].concat(a),render:function(t){return t("div",{attrs:{id:this.chartId},style:this.chartStyle},["Loading..."])},data:function(){return{chartId:null}},computed:{chartStyle:function(){return this.data,this.chartOptions,{height:this.height||"300px",lineHeight:this.height||"300px",width:this.width||"100%",textAlign:"center",color:"#999",fontSize:"14px",fontFamily:"'Lucida Grande', 'Lucida Sans Unicode', Verdana, Arial, Helvetica, sans-serif"}},chartOptions:function(){for(var t={},e=a,n=0;n=20?"ste":"de")},week:{dow:1,doy:4}});return i})},dbdb:function(t,e,n){var a=n("584a"),r=n("e53d"),i="__core-js_shared__",o=r[i]||(r[i]={});(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:a.version,mode:n("b8e3")?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},dc4d:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},a=t.defineLocale("hi",{months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",ss:"%d सेकंड",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(t){return t.replace(/[१२३४५६७८९०]/g,function(t){return n[t]})},postformat:function(t){return t.replace(/\d/g,function(t){return e[t]})},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(t,e){return 12===t&&(t=0),"रात"===e?t<4?t:t+12:"सुबह"===e?t:"दोपहर"===e?t>=10?t:t+12:"शाम"===e?t+12:void 0},meridiem:function(t,e,n){return t<4?"रात":t<10?"सुबह":t<17?"दोपहर":t<20?"शाम":"रात"},week:{dow:0,doy:6}});return a})},dc57:function(t,e){var n=Function.prototype,a=n.toString;function r(t){if(null!=t){try{return a.call(t)}catch(e){}try{return t+""}catch(e){}}return""}t.exports=r},dcbc:function(t,e,n){var a=n("2aba");t.exports=function(t,e,n){for(var r in e)a(t,r,e[r],n);return t}},e0b8:function(t,e,n){"use strict";var a=n("7726"),r=n("5ca1"),i=n("2aba"),o=n("dcbc"),s=n("67ab"),l=n("4a59"),d=n("f605"),u=n("d3f4"),c=n("79e5"),f=n("5cc5"),h=n("7f20"),m=n("5dbc");t.exports=function(t,e,n,p,_,v){var y=a[t],g=y,b=_?"set":"add",M=g&&g.prototype,k={},w=function(t){var e=M[t];i(M,t,"delete"==t?function(t){return!(v&&!u(t))&&e.call(this,0===t?0:t)}:"has"==t?function(t){return!(v&&!u(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return v&&!u(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,n){return e.call(this,0===t?0:t,n),this})};if("function"==typeof g&&(v||M.forEach&&!c(function(){(new g).entries().next()}))){var x=new g,L=x[b](v?{}:-0,1)!=x,Y=c(function(){x.has(1)}),D=f(function(t){new g(t)}),S=!v&&c(function(){var t=new g,e=5;while(e--)t[b](e,e);return!t.has(-0)});D||(g=e(function(e,n){d(e,g,t);var a=m(new y,e,g);return void 0!=n&&l(n,_,a[b],a),a}),g.prototype=M,M.constructor=g),(Y||S)&&(w("delete"),w("has"),_&&w("get")),(S||L)&&w(b),v&&M.clear&&delete M.clear}else g=p.getConstructor(e,t,_,b),o(g.prototype,n),s.NEED=!0;return h(g,t),k[t]=g,r(r.G+r.W+r.F*(g!=y),k),v||p.setStrong(g,t,_),g}},e0c5:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e={1:"૧",2:"૨",3:"૩",4:"૪",5:"૫",6:"૬",7:"૭",8:"૮",9:"૯",0:"૦"},n={"૧":"1","૨":"2","૩":"3","૪":"4","૫":"5","૬":"6","૭":"7","૮":"8","૯":"9","૦":"0"},a=t.defineLocale("gu",{months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),monthsParseExact:!0,weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),longDateFormat:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},calendar:{sameDay:"[આજ] LT",nextDay:"[કાલે] LT",nextWeek:"dddd, LT",lastDay:"[ગઇકાલે] LT",lastWeek:"[પાછલા] dddd, LT",sameElse:"L"},relativeTime:{future:"%s મા",past:"%s પેહલા",s:"અમુક પળો",ss:"%d સેકંડ",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"},preparse:function(t){return t.replace(/[૧૨૩૪૫૬૭૮૯૦]/g,function(t){return n[t]})},postformat:function(t){return t.replace(/\d/g,function(t){return e[t]})},meridiemParse:/રાત|બપોર|સવાર|સાંજ/,meridiemHour:function(t,e){return 12===t&&(t=0),"રાત"===e?t<4?t:t+12:"સવાર"===e?t:"બપોર"===e?t>=10?t:t+12:"સાંજ"===e?t+12:void 0},meridiem:function(t,e,n){return t<4?"રાત":t<10?"સવાર":t<17?"બપોર":t<20?"સાંજ":"રાત"},week:{dow:0,doy:6}});return a})},e0e5:function(t,e){function n(){var t=[].slice.call(arguments),e=!1;"boolean"==typeof t[0]&&(e=t.shift());var r=t[0];if(!r||"object"!=typeof r&&"function"!=typeof r)throw new Error("extendee must be an object");for(var i=t.slice(1),o=i.length,s=0;sl)a(s,n=e[l++])&&(~i(d,n)||d.push(n));return d}},e81d:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e={1:"១",2:"២",3:"៣",4:"៤",5:"៥",6:"៦",7:"៧",8:"៨",9:"៩",0:"០"},n={"១":"1","២":"2","៣":"3","៤":"4","៥":"5","៦":"6","៧":"7","៨":"8","៩":"9","០":"0"},a=t.defineLocale("km",{months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ព្រឹក|ល្ងាច/,isPM:function(t){return"ល្ងាច"===t},meridiem:function(t,e,n){return t<12?"ព្រឹក":"ល្ងាច"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",ss:"%d វិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},dayOfMonthOrdinalParse:/ទី\d{1,2}/,ordinal:"ទី%d",preparse:function(t){return t.replace(/[១២៣៤៥៦៧៨៩០]/g,function(t){return n[t]})},postformat:function(t){return t.replace(/\d/g,function(t){return e[t]})},week:{dow:1,doy:4}});return a})},e853:function(t,e,n){var a=n("d3f4"),r=n("1169"),i=n("2b4c")("species");t.exports=function(t){var e;return r(t)&&(e=t.constructor,"function"!=typeof e||e!==Array&&!r(e.prototype)||(e=void 0),a(e)&&(e=e[i],null===e&&(e=void 0))),void 0===e?Array:e}},ebd6:function(t,e,n){var a=n("cb7c"),r=n("d8e8"),i=n("2b4c")("species");t.exports=function(t,e){var n,o=a(t).constructor;return void 0===o||void 0==(n=a(o)[i])?e:r(n)}},ebe4:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(t,e){return 12===t&&(t=0),"pagi"===e?t:"tengahari"===e?t>=11?t:t+12:"petang"===e||"malam"===e?t+12:void 0},meridiem:function(t,e,n){return t<11?"pagi":t<15?"tengahari":t<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}});return e})},ebfd:function(t,e,n){var a=n("62a0")("meta"),r=n("f772"),i=n("07e3"),o=n("d9f6").f,s=0,l=Object.isExtensible||function(){return!0},d=!n("294c")(function(){return l(Object.preventExtensions({}))}),u=function(t){o(t,a,{value:{i:"O"+ ++s,w:{}}})},c=function(t,e){if(!r(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!i(t,a)){if(!l(t))return"F";if(!e)return"E";u(t)}return t[a].i},f=function(t,e){if(!i(t,a)){if(!l(t))return!0;if(!e)return!1;u(t)}return t[a].w},h=function(t){return d&&m.NEED&&l(t)&&!i(t,a)&&u(t),t},m=t.exports={KEY:a,NEED:!1,fastKey:c,getWeak:f,onFreeze:h}},ec18:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";function e(t,e,n,a){var r={s:["mõne sekundi","mõni sekund","paar sekundit"],ss:[t+"sekundi",t+"sekundit"],m:["ühe minuti","üks minut"],mm:[t+" minuti",t+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[t+" tunni",t+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[t+" kuu",t+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[t+" aasta",t+" aastat"]};return e?r[n][2]?r[n][2]:r[n][1]:a?r[n][0]:r[n][1]}var n=t.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:e,ss:e,m:e,mm:e,h:e,hh:e,d:e,dd:"%d päeva",M:e,MM:e,y:e,yy:e},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return n})},ecee:function(t,e,n){"use strict";(function(t){function a(t){return a="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n-1;r--){var i=n[r],o=(i.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(o)>-1&&(a=i)}return L.head.insertBefore(e,a),t}}var gt="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function bt(){var t=12,e="";while(t-- >0)e+=gt[62*Math.random()|0];return e}function Mt(t){return"".concat(t).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function kt(t){return Object.keys(t||{}).reduce(function(e,n){return e+"".concat(n,'="').concat(Mt(t[n]),'" ')},"").trim()}function wt(t){return Object.keys(t||{}).reduce(function(e,n){return e+"".concat(n,": ").concat(t[n],";")},"")}function xt(t){return t.size!==vt.size||t.x!==vt.x||t.y!==vt.y||t.rotate!==vt.rotate||t.flipX||t.flipY}function Lt(t){var e=t.transform,n=t.containerWidth,a=t.iconWidth,r={transform:"translate(".concat(n/2," 256)")},i="translate(".concat(32*e.x,", ").concat(32*e.y,") "),o="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),s="rotate(".concat(e.rotate," 0 0)"),l={transform:"".concat(i," ").concat(o," ").concat(s)},d={transform:"translate(".concat(a/2*-1," -256)")};return{outer:r,inner:l,path:d}}function Yt(t){var e=t.transform,n=t.width,a=void 0===n?O:n,r=t.height,i=void 0===r?O:r,o=t.startCentered,s=void 0!==o&&o,l="";return l+=s&&S?"translate(".concat(e.x/_t-a/2,"em, ").concat(e.y/_t-i/2,"em) "):s?"translate(calc(-50% + ".concat(e.x/_t,"em), calc(-50% + ").concat(e.y/_t,"em)) "):"translate(".concat(e.x/_t,"em, ").concat(e.y/_t,"em) "),l+="scale(".concat(e.size/_t*(e.flipX?-1:1),", ").concat(e.size/_t*(e.flipY?-1:1),") "),l+="rotate(".concat(e.rotate,"deg) "),l}var Dt={x:0,y:0,width:"100%",height:"100%"};function St(t){var e=t.children,n=t.attributes,a=t.main,r=t.mask,i=t.transform,o=a.width,s=a.icon,d=r.width,u=r.icon,c=Lt({transform:i,containerWidth:d,iconWidth:o}),f={tag:"rect",attributes:l({},Dt,{fill:"white"})},h={tag:"g",attributes:l({},c.inner),children:[{tag:"path",attributes:l({},s.attributes,c.path,{fill:"black"})}]},m={tag:"g",attributes:l({},c.outer),children:[h]},p="mask-".concat(bt()),_="clip-".concat(bt()),v={tag:"mask",attributes:l({},Dt,{id:p,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[f,m]},y={tag:"defs",children:[{tag:"clipPath",attributes:{id:_},children:[u]},v]};return e.push(y,{tag:"rect",attributes:l({fill:"currentColor","clip-path":"url(#".concat(_,")"),mask:"url(#".concat(p,")")},Dt)}),{children:e,attributes:n}}function Tt(t){var e=t.children,n=t.attributes,a=t.main,r=t.transform,i=t.styles,o=wt(i);if(o.length>0&&(n["style"]=o),xt(r)){var s=Lt({transform:r,containerWidth:a.width,iconWidth:a.width});e.push({tag:"g",attributes:l({},s.outer),children:[{tag:"g",attributes:l({},s.inner),children:[{tag:a.icon.tag,children:a.icon.children,attributes:l({},a.icon.attributes,s.path)}]}]})}else e.push(a.icon);return{children:e,attributes:n}}function Ot(t){var e=t.children,n=t.main,a=t.mask,r=t.attributes,i=t.styles,o=t.transform;if(xt(o)&&n.found&&!a.found){var s=n.width,d=n.height,u={x:s/d/2,y:.5};r["style"]=wt(l({},i,{"transform-origin":"".concat(u.x+o.x/16,"em ").concat(u.y+o.y/16,"em")}))}return[{tag:"svg",attributes:r,children:e}]}function Ht(t){var e=t.prefix,n=t.iconName,a=t.children,r=t.attributes,i=t.symbol,o=!0===i?"".concat(e,"-").concat(N.familyPrefix,"-").concat(n):i;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:l({},r,{id:o}),children:a}]}]}function At(t){var e=t.icons,n=e.main,a=e.mask,r=t.prefix,i=t.iconName,o=t.transform,s=t.symbol,d=t.title,u=t.extra,c=t.watchable,f=void 0!==c&&c,h=a.found?a:n,m=h.width,p=h.height,_="fa-w-".concat(Math.ceil(m/p*16)),v=[N.replacementClass,i?"".concat(N.familyPrefix,"-").concat(i):"",_].filter(function(t){return-1===u.classes.indexOf(t)}).concat(u.classes).join(" "),y={children:[],attributes:l({},u.attributes,{"data-prefix":r,"data-icon":i,class:v,role:u.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(m," ").concat(p)})};f&&(y.attributes[P]=""),d&&y.children.push({tag:"title",attributes:{id:y.attributes["aria-labelledby"]||"title-".concat(bt())},children:[d]});var g=l({},y,{prefix:r,iconName:i,main:n,mask:a,transform:o,symbol:s,styles:u.styles}),b=a.found&&n.found?St(g):Tt(g),M=b.children,k=b.attributes;return g.children=M,g.attributes=k,s?Ht(g):Ot(g)}function Pt(t){var e=t.content,n=t.width,a=t.height,r=t.transform,i=t.title,o=t.extra,s=t.watchable,d=void 0!==s&&s,u=l({},o.attributes,i?{title:i}:{},{class:o.classes.join(" ")});d&&(u[P]="");var c=l({},o.styles);xt(r)&&(c["transform"]=Yt({transform:r,startCentered:!0,width:n,height:a}),c["-webkit-transform"]=c["transform"]);var f=wt(c);f.length>0&&(u["style"]=f);var h=[];return h.push({tag:"span",attributes:u,children:[e]}),i&&h.push({tag:"span",attributes:{class:"sr-only"},children:[i]}),h}var jt=function(){},Ct=(N.measurePerformance&&Y&&Y.mark&&Y.measure,function(t,e){return function(n,a,r,i){return t.call(e,n,a,r,i)}}),zt=function(t,e,n,a){var r,i,o,s=Object.keys(t),l=s.length,d=void 0!==a?Ct(e,a):e;for(void 0===n?(r=1,o=t[s[0]]):(r=0,o=n);r2&&void 0!==arguments[2]?arguments[2]:{},a=n.skipHooks,r=void 0!==a&&a,i=Object.keys(e).reduce(function(t,n){var a=e[n],r=!!a.icon;return r?t[a.iconName]=a.icon:t[n]=a,t},{});"function"!==typeof U.hooks.addPack||r?U.styles[t]=l({},U.styles[t]||{},i):U.hooks.addPack(t,i),"fas"===t&&Et("fa",e)}var Ft=U.styles,It=U.shims,Wt=function(){var t=function(t){return zt(Ft,function(e,n,a){return e[a]=zt(n,t,{}),e},{})};t(function(t,e,n){return e[3]&&(t[e[3]]=n),t}),t(function(t,e,n){var a=e[2];return t[n]=n,a.forEach(function(e){t[e]=n}),t});var e="far"in Ft;zt(It,function(t,n){var a=n[0],r=n[1],i=n[2];return"far"!==r||e||(r="fas"),t[a]={prefix:r,iconName:i},t},{})};Wt();U.styles;function Rt(t,e,n){if(t&&t[e]&&t[e][n])return{prefix:e,iconName:n,icon:t[e][n]}}function Nt(t){var e=t.tag,n=t.attributes,a=void 0===n?{}:n,r=t.children,i=void 0===r?[]:r;return"string"===typeof t?Mt(t):"<".concat(e," ").concat(kt(a),">").concat(i.map(Nt).join(""),"")}var Vt=function(t){var e={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return t?t.toLowerCase().split(" ").reduce(function(t,e){var n=e.toLowerCase().split("-"),a=n[0],r=n.slice(1).join("-");if(a&&"h"===r)return t.flipX=!0,t;if(a&&"v"===r)return t.flipY=!0,t;if(r=parseFloat(r),isNaN(r))return t;switch(a){case"grow":t.size=t.size+r;break;case"shrink":t.size=t.size-r;break;case"left":t.x=t.x-r;break;case"right":t.x=t.x+r;break;case"up":t.y=t.y-r;break;case"down":t.y=t.y+r;break;case"rotate":t.rotate=t.rotate+r;break}return t},e):e};function Ut(t){this.name="MissingIcon",this.message=t||"Icon unavailable",this.stack=(new Error).stack}Ut.prototype=Object.create(Error.prototype),Ut.prototype.constructor=Ut;var Bt={fill:"currentColor"},$t={attributeType:"XML",repeatCount:"indefinite",dur:"2s"},Jt=(l({},Bt,{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"}),l({},$t,{attributeName:"opacity"}));l({},Bt,{cx:"256",cy:"364",r:"28"}),l({},$t,{attributeName:"r",values:"28;14;28;28;14;28;"}),l({},Jt,{values:"1;0;1;1;0;1;"}),l({},Bt,{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),l({},Jt,{values:"1;0;0;0;0;1;"}),l({},Bt,{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),l({},Jt,{values:"0;0;1;1;0;0;"}),U.styles;U.styles;var Gt='svg:not(:root).svg-inline--fa {\n overflow: visible;\n}\n\n.svg-inline--fa {\n display: inline-block;\n font-size: inherit;\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-lg {\n vertical-align: -0.225em;\n}\n.svg-inline--fa.fa-w-1 {\n width: 0.0625em;\n}\n.svg-inline--fa.fa-w-2 {\n width: 0.125em;\n}\n.svg-inline--fa.fa-w-3 {\n width: 0.1875em;\n}\n.svg-inline--fa.fa-w-4 {\n width: 0.25em;\n}\n.svg-inline--fa.fa-w-5 {\n width: 0.3125em;\n}\n.svg-inline--fa.fa-w-6 {\n width: 0.375em;\n}\n.svg-inline--fa.fa-w-7 {\n width: 0.4375em;\n}\n.svg-inline--fa.fa-w-8 {\n width: 0.5em;\n}\n.svg-inline--fa.fa-w-9 {\n width: 0.5625em;\n}\n.svg-inline--fa.fa-w-10 {\n width: 0.625em;\n}\n.svg-inline--fa.fa-w-11 {\n width: 0.6875em;\n}\n.svg-inline--fa.fa-w-12 {\n width: 0.75em;\n}\n.svg-inline--fa.fa-w-13 {\n width: 0.8125em;\n}\n.svg-inline--fa.fa-w-14 {\n width: 0.875em;\n}\n.svg-inline--fa.fa-w-15 {\n width: 0.9375em;\n}\n.svg-inline--fa.fa-w-16 {\n width: 1em;\n}\n.svg-inline--fa.fa-w-17 {\n width: 1.0625em;\n}\n.svg-inline--fa.fa-w-18 {\n width: 1.125em;\n}\n.svg-inline--fa.fa-w-19 {\n width: 1.1875em;\n}\n.svg-inline--fa.fa-w-20 {\n width: 1.25em;\n}\n.svg-inline--fa.fa-pull-left {\n margin-right: 0.3em;\n width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n margin-left: 0.3em;\n width: auto;\n}\n.svg-inline--fa.fa-border {\n height: 1.5em;\n}\n.svg-inline--fa.fa-li {\n width: 2em;\n}\n.svg-inline--fa.fa-fw {\n width: 1.25em;\n}\n\n.fa-layers svg.svg-inline--fa {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.fa-layers {\n display: inline-block;\n height: 1em;\n position: relative;\n text-align: center;\n vertical-align: -0.125em;\n width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter, .fa-layers-text {\n display: inline-block;\n position: absolute;\n text-align: center;\n}\n\n.fa-layers-text {\n left: 50%;\n top: 50%;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter {\n background-color: #ff253a;\n border-radius: 1em;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n color: #fff;\n height: 1.5em;\n line-height: 1;\n max-width: 5em;\n min-width: 1.5em;\n overflow: hidden;\n padding: 0.25em;\n right: 0;\n text-overflow: ellipsis;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n bottom: 0;\n right: 0;\n top: auto;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: bottom right;\n transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n bottom: 0;\n left: 0;\n right: auto;\n top: auto;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: bottom left;\n transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n right: 0;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-top-left {\n left: 0;\n right: auto;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top left;\n transform-origin: top left;\n}\n\n.fa-lg {\n font-size: 1.3333333333em;\n line-height: 0.75em;\n vertical-align: -0.0667em;\n}\n\n.fa-xs {\n font-size: 0.75em;\n}\n\n.fa-sm {\n font-size: 0.875em;\n}\n\n.fa-1x {\n font-size: 1em;\n}\n\n.fa-2x {\n font-size: 2em;\n}\n\n.fa-3x {\n font-size: 3em;\n}\n\n.fa-4x {\n font-size: 4em;\n}\n\n.fa-5x {\n font-size: 5em;\n}\n\n.fa-6x {\n font-size: 6em;\n}\n\n.fa-7x {\n font-size: 7em;\n}\n\n.fa-8x {\n font-size: 8em;\n}\n\n.fa-9x {\n font-size: 9em;\n}\n\n.fa-10x {\n font-size: 10em;\n}\n\n.fa-fw {\n text-align: center;\n width: 1.25em;\n}\n\n.fa-ul {\n list-style-type: none;\n margin-left: 2.5em;\n padding-left: 0;\n}\n.fa-ul > li {\n position: relative;\n}\n\n.fa-li {\n left: -2em;\n position: absolute;\n text-align: center;\n width: 2em;\n line-height: inherit;\n}\n\n.fa-border {\n border: solid 0.08em #eee;\n border-radius: 0.1em;\n padding: 0.2em 0.25em 0.15em;\n}\n\n.fa-pull-left {\n float: left;\n}\n\n.fa-pull-right {\n float: right;\n}\n\n.fa.fa-pull-left,\n.fas.fa-pull-left,\n.far.fa-pull-left,\n.fal.fa-pull-left,\n.fab.fa-pull-left {\n margin-right: 0.3em;\n}\n.fa.fa-pull-right,\n.fas.fa-pull-right,\n.far.fa-pull-right,\n.fal.fa-pull-right,\n.fab.fa-pull-right {\n margin-left: 0.3em;\n}\n\n.fa-spin {\n -webkit-animation: fa-spin 2s infinite linear;\n animation: fa-spin 2s infinite linear;\n}\n\n.fa-pulse {\n -webkit-animation: fa-spin 1s infinite steps(8);\n animation: fa-spin 1s infinite steps(8);\n}\n\n@-webkit-keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.fa-rotate-90 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";\n -webkit-transform: scale(-1, 1);\n transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n -webkit-transform: scale(1, -1);\n transform: scale(1, -1);\n}\n\n.fa-flip-both, .fa-flip-horizontal.fa-flip-vertical {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n -webkit-transform: scale(-1, -1);\n transform: scale(-1, -1);\n}\n\n:root .fa-rotate-90,\n:root .fa-rotate-180,\n:root .fa-rotate-270,\n:root .fa-flip-horizontal,\n:root .fa-flip-vertical,\n:root .fa-flip-both {\n -webkit-filter: none;\n filter: none;\n}\n\n.fa-stack {\n display: inline-block;\n height: 2em;\n position: relative;\n width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.svg-inline--fa.fa-stack-1x {\n height: 1em;\n width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n height: 2em;\n width: 2.5em;\n}\n\n.fa-inverse {\n color: #fff;\n}\n\n.sr-only {\n border: 0;\n clip: rect(0, 0, 0, 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n width: 1px;\n}\n\n.sr-only-focusable:active, .sr-only-focusable:focus {\n clip: auto;\n height: auto;\n margin: 0;\n overflow: visible;\n position: static;\n width: auto;\n}';function qt(){var t=H,e=A,n=N.familyPrefix,a=N.replacementClass,r=Gt;if(n!==t||a!==e){var i=new RegExp("\\.".concat(t,"\\-"),"g"),o=new RegExp("\\.".concat(e),"g");r=r.replace(i,".".concat(n,"-")).replace(o,".".concat(a))}return r}var Xt=function(){function t(){r(this,t),this.definitions={}}return o(t,[{key:"add",value:function(){for(var t=this,e=arguments.length,n=new Array(e),a=0;a1&&void 0!==arguments[1]?arguments[1]:{},a=(e||{}).icon?e:te(e||{}),r=n.mask;return r&&(r=(r||{}).icon?r:te(r||{})),t(a,l({},n,{mask:r}))}}var ne=new Xt,ae=!1,re={transform:function(t){return Vt(t)}},ie=ee(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.transform,a=void 0===n?vt:n,r=e.symbol,i=void 0!==r&&r,o=e.mask,s=void 0===o?null:o,d=e.title,u=void 0===d?null:d,c=e.classes,f=void 0===c?[]:c,h=e.attributes,m=void 0===h?{}:h,p=e.styles,_=void 0===p?{}:p;if(t){var v=t.prefix,y=t.iconName,g=t.icon;return Kt(l({type:"icon"},t),function(){return Zt(),N.autoA11y&&(u?m["aria-labelledby"]="".concat(N.replacementClass,"-title-").concat(bt()):(m["aria-hidden"]="true",m["focusable"]="false")),At({icons:{main:Qt(g),mask:s?Qt(s.icon):{found:!1,width:null,height:null,icon:{}}},prefix:v,iconName:y,transform:l({},vt,a),symbol:i,title:u,extra:{attributes:m,styles:_,classes:f}})})}}),oe=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.transform,a=void 0===n?vt:n,r=e.title,i=void 0===r?null:r,o=e.classes,s=void 0===o?[]:o,d=e.attributes,c=void 0===d?{}:d,f=e.styles,h=void 0===f?{}:f;return Kt({type:"text",content:t},function(){return Zt(),Pt({content:t,transform:l({},vt,a),title:i,extra:{attributes:c,styles:h,classes:["".concat(N.familyPrefix,"-layers-text")].concat(u(s))}})})}}).call(this,n("c8ba"))},eda5:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",ss:"තත්පර %d",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},dayOfMonthOrdinalParse:/\d{1,2} වැනි/,ordinal:function(t){return t+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(t){return"ප.ව."===t||"පස් වරු"===t},meridiem:function(t,e,n){return t>11?n?"ප.ව.":"පස් වරු":n?"පෙ.ව.":"පෙර වරු"}});return e})},f035:function(t,e,n){ -/*! - * vue-spinkit v1.4.1 - * (c) 2018-present Chanwit Piromplad - * Released under the MIT License. - */ -!function(e,n){t.exports=n()}(0,function(){"use strict";var t={circle:{className:"sk-circle",divCount:12},"cube-grid":{className:"sk-cube-grid",divCount:9},wave:{className:"sk-wave",divCount:5},"folding-cube":{className:"sk-folding-cube",divCount:4},"three-bounce":{className:"sk-three-bounce",divCount:3},"double-bounce":{className:"sk-double-bounce",divCount:2},"wandering-cubes":{className:"sk-wandering-cubes",divCount:2},"chasing-dots":{className:"sk-chasing-dots",divCount:2},"rotating-plane":{className:"sk-rotating-plane",divCount:1},pulse:{className:"sk-pulse",divCount:1},wordpress:{className:"sk-wordpress",divCount:1},"fading-circle":{className:"sk-fading-circle",divCount:12}},e={"ball-grid-beat":{divCount:9},"ball-grid-pulse":{divCount:9},"line-spin-fade-loader":{divCount:8},"ball-spin-fade-loader":{divCount:8},"ball-pulse-rise":{divCount:5},"line-scale":{divCount:5},"line-scale-pulse-out":{divCount:5},"line-scale-pulse-out-rapid":{divCount:5},pacman:{divCount:5},"line-scale-party":{divCount:4},"ball-triangle-path":{divCount:3},"ball-scale-multiple":{divCount:3},"ball-scale-ripple-multiple":{divCount:3},"ball-pulse-sync":{divCount:3},"ball-beat":{divCount:3},"ball-zig-zag":{divCount:2},"ball-zig-zag-deflect":{divCount:2},"ball-clip-rotate-pulse":{divCount:2},"ball-clip-rotate-multiple":{divCount:2},"ball-clip-rotate":{divCount:1},"ball-scale-ripple":{divCount:1},"triangle-skew-spin":{divCount:1}},n={spinkitSpinners:t,loadersCssSpinners:e,allSpinners:Object.assign({},t,e)};return function(){if("undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],e=document.createElement("style"),n="/** * * All animations must live in their own file * in the animations directory and be included * here. * */ /** * Styles shared by multiple animations */ /** * Dots */ @-webkit-keyframes scale { 0% { -webkit-transform: scale(1); transform: scale(1); opacity: 1; } 45% { -webkit-transform: scale(0.1); transform: scale(0.1); opacity: 0.7; } 80% { -webkit-transform: scale(1); transform: scale(1); opacity: 1; } } @keyframes scale { 0% { -webkit-transform: scale(1); transform: scale(1); opacity: 1; } 45% { -webkit-transform: scale(0.1); transform: scale(0.1); opacity: 0.7; } 80% { -webkit-transform: scale(1); transform: scale(1); opacity: 1; } } .ball-pulse > div[data-v-39432f99]:nth-child(0) { -webkit-animation: scale 0.75s -0.36s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); animation: scale 0.75s -0.36s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); } .ball-pulse > div[data-v-39432f99]:nth-child(1) { -webkit-animation: scale 0.75s -0.24s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); animation: scale 0.75s -0.24s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); } .ball-pulse > div[data-v-39432f99]:nth-child(2) { -webkit-animation: scale 0.75s -0.12s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); animation: scale 0.75s -0.12s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); } .ball-pulse > div[data-v-39432f99]:nth-child(3) { -webkit-animation: scale 0.75s 0s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); animation: scale 0.75s 0s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); } .ball-pulse > div[data-v-39432f99] { background-color: #fff; width: 15px; height: 15px; border-radius: 100%; margin: 2px; -webkit-animation-fill-mode: both; animation-fill-mode: both; display: inline-block; } @-webkit-keyframes ball-pulse-sync { 33% { -webkit-transform: translateY(10px); transform: translateY(10px); } 66% { -webkit-transform: translateY(-10px); transform: translateY(-10px); } 100% { -webkit-transform: translateY(0); transform: translateY(0); } } @keyframes ball-pulse-sync { 33% { -webkit-transform: translateY(10px); transform: translateY(10px); } 66% { -webkit-transform: translateY(-10px); transform: translateY(-10px); } 100% { -webkit-transform: translateY(0); transform: translateY(0); } } .ball-pulse-sync > div[data-v-39432f99]:nth-child(0) { -webkit-animation: ball-pulse-sync 0.6s -0.21s infinite ease-in-out; animation: ball-pulse-sync 0.6s -0.21s infinite ease-in-out; } .ball-pulse-sync > div[data-v-39432f99]:nth-child(1) { -webkit-animation: ball-pulse-sync 0.6s -0.14s infinite ease-in-out; animation: ball-pulse-sync 0.6s -0.14s infinite ease-in-out; } .ball-pulse-sync > div[data-v-39432f99]:nth-child(2) { -webkit-animation: ball-pulse-sync 0.6s -0.07s infinite ease-in-out; animation: ball-pulse-sync 0.6s -0.07s infinite ease-in-out; } .ball-pulse-sync > div[data-v-39432f99]:nth-child(3) { -webkit-animation: ball-pulse-sync 0.6s 0s infinite ease-in-out; animation: ball-pulse-sync 0.6s 0s infinite ease-in-out; } .ball-pulse-sync > div[data-v-39432f99] { background-color: #fff; width: 15px; height: 15px; border-radius: 100%; margin: 2px; -webkit-animation-fill-mode: both; animation-fill-mode: both; display: inline-block; } @-webkit-keyframes ball-scale { 0% { -webkit-transform: scale(0); transform: scale(0); } 100% { -webkit-transform: scale(1); transform: scale(1); opacity: 0; } } @keyframes ball-scale { 0% { -webkit-transform: scale(0); transform: scale(0); } 100% { -webkit-transform: scale(1); transform: scale(1); opacity: 0; } } .ball-scale > div[data-v-39432f99] { background-color: #fff; width: 15px; height: 15px; border-radius: 100%; margin: 2px; -webkit-animation-fill-mode: both; animation-fill-mode: both; display: inline-block; height: 60px; width: 60px; -webkit-animation: ball-scale 1s 0s ease-in-out infinite; animation: ball-scale 1s 0s ease-in-out infinite; } @keyframes ball-scale { 0% { -webkit-transform: scale(0); transform: scale(0); } 100% { -webkit-transform: scale(1); transform: scale(1); opacity: 0; } } .ball-scale > div[data-v-39432f99] { background-color: #fff; width: 15px; height: 15px; border-radius: 100%; margin: 2px; -webkit-animation-fill-mode: both; animation-fill-mode: both; display: inline-block; height: 60px; width: 60px; -webkit-animation: ball-scale 1s 0s ease-in-out infinite; animation: ball-scale 1s 0s ease-in-out infinite; } .ball-scale-random[data-v-39432f99] { width: 37px; height: 40px; } .ball-scale-random > div[data-v-39432f99] { background-color: #fff; width: 15px; height: 15px; border-radius: 100%; margin: 2px; -webkit-animation-fill-mode: both; animation-fill-mode: both; position: absolute; display: inline-block; height: 30px; width: 30px; -webkit-animation: ball-scale 1s 0s ease-in-out infinite; animation: ball-scale 1s 0s ease-in-out infinite; } .ball-scale-random > div[data-v-39432f99]:nth-child(1) { margin-left: -7px; -webkit-animation: ball-scale 1s 0.2s ease-in-out infinite; animation: ball-scale 1s 0.2s ease-in-out infinite; } .ball-scale-random > div[data-v-39432f99]:nth-child(3) { margin-left: -2px; margin-top: 9px; -webkit-animation: ball-scale 1s 0.5s ease-in-out infinite; animation: ball-scale 1s 0.5s ease-in-out infinite; } @-webkit-keyframes rotate { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 50% { -webkit-transform: rotate(180deg); transform: rotate(180deg); } 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } @keyframes rotate { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 50% { -webkit-transform: rotate(180deg); transform: rotate(180deg); } 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } .ball-rotate[data-v-39432f99] { position: relative; } .ball-rotate > div[data-v-39432f99] { background-color: #fff; width: 15px; height: 15px; border-radius: 100%; margin: 2px; -webkit-animation-fill-mode: both; animation-fill-mode: both; position: relative; } .ball-rotate > div[data-v-39432f99]:first-child { -webkit-animation: rotate 1s 0s cubic-bezier(0.7, -0.13, 0.22, 0.86) infinite; animation: rotate 1s 0s cubic-bezier(0.7, -0.13, 0.22, 0.86) infinite; } .ball-rotate > div[data-v-39432f99]:before, .ball-rotate > div[data-v-39432f99]:after { background-color: #fff; width: 15px; height: 15px; border-radius: 100%; margin: 2px; content: \"\"; position: absolute; opacity: 0.8; } .ball-rotate > div[data-v-39432f99]:before { top: 0px; left: -28px; } .ball-rotate > div[data-v-39432f99]:after { top: 0px; left: 25px; } @keyframes rotate { 0% { -webkit-transform: rotate(0deg) scale(1); transform: rotate(0deg) scale(1); } 50% { -webkit-transform: rotate(180deg) scale(0.6); transform: rotate(180deg) scale(0.6); } 100% { -webkit-transform: rotate(360deg) scale(1); transform: rotate(360deg) scale(1); } } .ball-clip-rotate > div[data-v-39432f99] { background-color: #fff; width: 15px; height: 15px; border-radius: 100%; margin: 2px; -webkit-animation-fill-mode: both; animation-fill-mode: both; border: 2px solid #fff; border-bottom-color: transparent; height: 25px; width: 25px; background: transparent !important; display: inline-block; -webkit-animation: rotate 0.75s 0s linear infinite; animation: rotate 0.75s 0s linear infinite; } @keyframes rotate { 0% { -webkit-transform: rotate(0deg) scale(1); transform: rotate(0deg) scale(1); } 50% { -webkit-transform: rotate(180deg) scale(0.6); transform: rotate(180deg) scale(0.6); } 100% { -webkit-transform: rotate(360deg) scale(1); transform: rotate(360deg) scale(1); } } @keyframes scale { 30% { -webkit-transform: scale(0.3); transform: scale(0.3); } 100% { -webkit-transform: scale(1); transform: scale(1); } } .ball-clip-rotate-pulse[data-v-39432f99] { position: relative; -webkit-transform: translateY(-15px); transform: translateY(-15px); } .ball-clip-rotate-pulse > div[data-v-39432f99] { -webkit-animation-fill-mode: both; animation-fill-mode: both; position: absolute; top: 0px; left: 0px; border-radius: 100%; } .ball-clip-rotate-pulse > div[data-v-39432f99]:first-child { background: #fff; height: 16px; width: 16px; top: 7px; left: -7px; -webkit-animation: scale 1s 0s cubic-bezier(0.09, 0.57, 0.49, 0.9) infinite; animation: scale 1s 0s cubic-bezier(0.09, 0.57, 0.49, 0.9) infinite; } .ball-clip-rotate-pulse > div[data-v-39432f99]:last-child { position: absolute; border: 2px solid #fff; width: 30px; height: 30px; left: -16px; top: -2px; background: transparent; border: 2px solid; border-color: #fff transparent #fff transparent; -webkit-animation: rotate 1s 0s cubic-bezier(0.09, 0.57, 0.49, 0.9) infinite; animation: rotate 1s 0s cubic-bezier(0.09, 0.57, 0.49, 0.9) infinite; -webkit-animation-duration: 1s; animation-duration: 1s; } @keyframes rotate { 0% { -webkit-transform: rotate(0deg) scale(1); transform: rotate(0deg) scale(1); } 50% { -webkit-transform: rotate(180deg) scale(0.6); transform: rotate(180deg) scale(0.6); } 100% { -webkit-transform: rotate(360deg) scale(1); transform: rotate(360deg) scale(1); } } .ball-clip-rotate-multiple[data-v-39432f99] { position: relative; } .ball-clip-rotate-multiple > div[data-v-39432f99] { -webkit-animation-fill-mode: both; animation-fill-mode: both; position: absolute; left: -20px; top: -20px; border: 2px solid #fff; border-bottom-color: transparent; border-top-color: transparent; border-radius: 100%; height: 35px; width: 35px; -webkit-animation: rotate 1s 0s ease-in-out infinite; animation: rotate 1s 0s ease-in-out infinite; } .ball-clip-rotate-multiple > div[data-v-39432f99]:last-child { display: inline-block; top: -10px; left: -10px; width: 15px; height: 15px; -webkit-animation-duration: 0.5s; animation-duration: 0.5s; border-color: #fff transparent #fff transparent; -webkit-animation-direction: reverse; animation-direction: reverse; } @-webkit-keyframes ball-scale-ripple { 0% { -webkit-transform: scale(0.1); transform: scale(0.1); opacity: 1; } 70% { -webkit-transform: scale(1); transform: scale(1); opacity: 0.7; } 100% { opacity: 0.0; } } @keyframes ball-scale-ripple { 0% { -webkit-transform: scale(0.1); transform: scale(0.1); opacity: 1; } 70% { -webkit-transform: scale(1); transform: scale(1); opacity: 0.7; } 100% { opacity: 0.0; } } .ball-scale-ripple > div[data-v-39432f99] { -webkit-animation-fill-mode: both; animation-fill-mode: both; height: 50px; width: 50px; border-radius: 100%; border: 2px solid #fff; -webkit-animation: ball-scale-ripple 1s 0s infinite cubic-bezier(0.21, 0.53, 0.56, 0.8); animation: ball-scale-ripple 1s 0s infinite cubic-bezier(0.21, 0.53, 0.56, 0.8); } @-webkit-keyframes ball-scale-ripple-multiple { 0% { -webkit-transform: scale(0.1); transform: scale(0.1); opacity: 1; } 70% { -webkit-transform: scale(1); transform: scale(1); opacity: 0.7; } 100% { opacity: 0.0; } } @keyframes ball-scale-ripple-multiple { 0% { -webkit-transform: scale(0.1); transform: scale(0.1); opacity: 1; } 70% { -webkit-transform: scale(1); transform: scale(1); opacity: 0.7; } 100% { opacity: 0.0; } } .ball-scale-ripple-multiple[data-v-39432f99] { position: relative; -webkit-transform: translateY(-25px); transform: translateY(-25px); } .ball-scale-ripple-multiple > div[data-v-39432f99]:nth-child(0) { -webkit-animation-delay: -0.8s; animation-delay: -0.8s; } .ball-scale-ripple-multiple > div[data-v-39432f99]:nth-child(1) { -webkit-animation-delay: -0.6s; animation-delay: -0.6s; } .ball-scale-ripple-multiple > div[data-v-39432f99]:nth-child(2) { -webkit-animation-delay: -0.4s; animation-delay: -0.4s; } .ball-scale-ripple-multiple > div[data-v-39432f99]:nth-child(3) { -webkit-animation-delay: -0.2s; animation-delay: -0.2s; } .ball-scale-ripple-multiple > div[data-v-39432f99] { -webkit-animation-fill-mode: both; animation-fill-mode: both; position: absolute; top: -2px; left: -26px; width: 50px; height: 50px; border-radius: 100%; border: 2px solid #fff; -webkit-animation: ball-scale-ripple-multiple 1.25s 0s infinite cubic-bezier(0.21, 0.53, 0.56, 0.8); animation: ball-scale-ripple-multiple 1.25s 0s infinite cubic-bezier(0.21, 0.53, 0.56, 0.8); } @-webkit-keyframes ball-beat { 50% { opacity: 0.2; -webkit-transform: scale(0.75); transform: scale(0.75); } 100% { opacity: 1; -webkit-transform: scale(1); transform: scale(1); } } @keyframes ball-beat { 50% { opacity: 0.2; -webkit-transform: scale(0.75); transform: scale(0.75); } 100% { opacity: 1; -webkit-transform: scale(1); transform: scale(1); } } .ball-beat > div[data-v-39432f99] { background-color: #fff; width: 15px; height: 15px; border-radius: 100%; margin: 2px; -webkit-animation-fill-mode: both; animation-fill-mode: both; display: inline-block; -webkit-animation: ball-beat 0.7s 0s infinite linear; animation: ball-beat 0.7s 0s infinite linear; } .ball-beat > div[data-v-39432f99]:nth-child(2n-1) { -webkit-animation-delay: -0.35s !important; animation-delay: -0.35s !important; } @-webkit-keyframes ball-scale-multiple { 0% { -webkit-transform: scale(0); transform: scale(0); opacity: 0; } 5% { opacity: 1; } 100% { -webkit-transform: scale(1); transform: scale(1); opacity: 0; } } @keyframes ball-scale-multiple { 0% { -webkit-transform: scale(0); transform: scale(0); opacity: 0; } 5% { opacity: 1; } 100% { -webkit-transform: scale(1); transform: scale(1); opacity: 0; } } .ball-scale-multiple[data-v-39432f99] { position: relative; -webkit-transform: translateY(-30px); transform: translateY(-30px); } .ball-scale-multiple > div[data-v-39432f99]:nth-child(2) { -webkit-animation-delay: -0.4s; animation-delay: -0.4s; } .ball-scale-multiple > div[data-v-39432f99]:nth-child(3) { -webkit-animation-delay: -0.2s; animation-delay: -0.2s; } .ball-scale-multiple > div[data-v-39432f99] { background-color: #fff; width: 15px; height: 15px; border-radius: 100%; margin: 2px; -webkit-animation-fill-mode: both; animation-fill-mode: both; position: absolute; left: -30px; top: 0px; opacity: 0; margin: 0; width: 60px; height: 60px; -webkit-animation: ball-scale-multiple 1s 0s linear infinite; animation: ball-scale-multiple 1s 0s linear infinite; } @-webkit-keyframes ball-triangle-path-1 { 33% { -webkit-transform: translate(25px, -50px); transform: translate(25px, -50px); } 66% { -webkit-transform: translate(50px, 0px); transform: translate(50px, 0px); } 100% { -webkit-transform: translate(0px, 0px); transform: translate(0px, 0px); } } @keyframes ball-triangle-path-1 { 33% { -webkit-transform: translate(25px, -50px); transform: translate(25px, -50px); } 66% { -webkit-transform: translate(50px, 0px); transform: translate(50px, 0px); } 100% { -webkit-transform: translate(0px, 0px); transform: translate(0px, 0px); } } @-webkit-keyframes ball-triangle-path-2 { 33% { -webkit-transform: translate(25px, 50px); transform: translate(25px, 50px); } 66% { -webkit-transform: translate(-25px, 50px); transform: translate(-25px, 50px); } 100% { -webkit-transform: translate(0px, 0px); transform: translate(0px, 0px); } } @keyframes ball-triangle-path-2 { 33% { -webkit-transform: translate(25px, 50px); transform: translate(25px, 50px); } 66% { -webkit-transform: translate(-25px, 50px); transform: translate(-25px, 50px); } 100% { -webkit-transform: translate(0px, 0px); transform: translate(0px, 0px); } } @-webkit-keyframes ball-triangle-path-3 { 33% { -webkit-transform: translate(-50px, 0px); transform: translate(-50px, 0px); } 66% { -webkit-transform: translate(-25px, -50px); transform: translate(-25px, -50px); } 100% { -webkit-transform: translate(0px, 0px); transform: translate(0px, 0px); } } @keyframes ball-triangle-path-3 { 33% { -webkit-transform: translate(-50px, 0px); transform: translate(-50px, 0px); } 66% { -webkit-transform: translate(-25px, -50px); transform: translate(-25px, -50px); } 100% { -webkit-transform: translate(0px, 0px); transform: translate(0px, 0px); } } .ball-triangle-path[data-v-39432f99] { position: relative; -webkit-transform: translate(-29.994px, -37.50938px); transform: translate(-29.994px, -37.50938px); } .ball-triangle-path > div[data-v-39432f99]:nth-child(1) { -webkit-animation-name: ball-triangle-path-1; animation-name: ball-triangle-path-1; -webkit-animation-delay: 0; animation-delay: 0; -webkit-animation-duration: 2s; animation-duration: 2s; -webkit-animation-timing-function: ease-in-out; animation-timing-function: ease-in-out; -webkit-animation-iteration-count: infinite; animation-iteration-count: infinite; } .ball-triangle-path > div[data-v-39432f99]:nth-child(2) { -webkit-animation-name: ball-triangle-path-2; animation-name: ball-triangle-path-2; -webkit-animation-delay: 0; animation-delay: 0; -webkit-animation-duration: 2s; animation-duration: 2s; -webkit-animation-timing-function: ease-in-out; animation-timing-function: ease-in-out; -webkit-animation-iteration-count: infinite; animation-iteration-count: infinite; } .ball-triangle-path > div[data-v-39432f99]:nth-child(3) { -webkit-animation-name: ball-triangle-path-3; animation-name: ball-triangle-path-3; -webkit-animation-delay: 0; animation-delay: 0; -webkit-animation-duration: 2s; animation-duration: 2s; -webkit-animation-timing-function: ease-in-out; animation-timing-function: ease-in-out; -webkit-animation-iteration-count: infinite; animation-iteration-count: infinite; } .ball-triangle-path > div[data-v-39432f99] { -webkit-animation-fill-mode: both; animation-fill-mode: both; position: absolute; width: 10px; height: 10px; border-radius: 100%; border: 1px solid #fff; } .ball-triangle-path > div[data-v-39432f99]:nth-of-type(1) { top: 50px; } .ball-triangle-path > div[data-v-39432f99]:nth-of-type(2) { left: 25px; } .ball-triangle-path > div[data-v-39432f99]:nth-of-type(3) { top: 50px; left: 50px; } @-webkit-keyframes ball-pulse-rise-even { 0% { -webkit-transform: scale(1.1); transform: scale(1.1); } 25% { -webkit-transform: translateY(-30px); transform: translateY(-30px); } 50% { -webkit-transform: scale(0.4); transform: scale(0.4); } 75% { -webkit-transform: translateY(30px); transform: translateY(30px); } 100% { -webkit-transform: translateY(0); transform: translateY(0); -webkit-transform: scale(1); transform: scale(1); } } @keyframes ball-pulse-rise-even { 0% { -webkit-transform: scale(1.1); transform: scale(1.1); } 25% { -webkit-transform: translateY(-30px); transform: translateY(-30px); } 50% { -webkit-transform: scale(0.4); transform: scale(0.4); } 75% { -webkit-transform: translateY(30px); transform: translateY(30px); } 100% { -webkit-transform: translateY(0); transform: translateY(0); -webkit-transform: scale(1); transform: scale(1); } } @-webkit-keyframes ball-pulse-rise-odd { 0% { -webkit-transform: scale(0.4); transform: scale(0.4); } 25% { -webkit-transform: translateY(30px); transform: translateY(30px); } 50% { -webkit-transform: scale(1.1); transform: scale(1.1); } 75% { -webkit-transform: translateY(-30px); transform: translateY(-30px); } 100% { -webkit-transform: translateY(0); transform: translateY(0); -webkit-transform: scale(0.75); transform: scale(0.75); } } @keyframes ball-pulse-rise-odd { 0% { -webkit-transform: scale(0.4); transform: scale(0.4); } 25% { -webkit-transform: translateY(30px); transform: translateY(30px); } 50% { -webkit-transform: scale(1.1); transform: scale(1.1); } 75% { -webkit-transform: translateY(-30px); transform: translateY(-30px); } 100% { -webkit-transform: translateY(0); transform: translateY(0); -webkit-transform: scale(0.75); transform: scale(0.75); } } .ball-pulse-rise > div[data-v-39432f99] { background-color: #fff; width: 15px; height: 15px; border-radius: 100%; margin: 2px; -webkit-animation-fill-mode: both; animation-fill-mode: both; display: inline-block; -webkit-animation-duration: 1s; animation-duration: 1s; -webkit-animation-timing-function: cubic-bezier(0.15, 0.46, 0.9, 0.6); animation-timing-function: cubic-bezier(0.15, 0.46, 0.9, 0.6); -webkit-animation-iteration-count: infinite; animation-iteration-count: infinite; -webkit-animation-delay: 0; animation-delay: 0; } .ball-pulse-rise > div[data-v-39432f99]:nth-child(2n) { -webkit-animation-name: ball-pulse-rise-even; animation-name: ball-pulse-rise-even; } .ball-pulse-rise > div[data-v-39432f99]:nth-child(2n-1) { -webkit-animation-name: ball-pulse-rise-odd; animation-name: ball-pulse-rise-odd; } @-webkit-keyframes ball-grid-beat { 50% { opacity: 0.7; } 100% { opacity: 1; } } @keyframes ball-grid-beat { 50% { opacity: 0.7; } 100% { opacity: 1; } } .ball-grid-beat[data-v-39432f99] { width: 57px; } .ball-grid-beat > div[data-v-39432f99]:nth-child(1) { -webkit-animation-delay: 0.44s; animation-delay: 0.44s; -webkit-animation-duration: 1.27s; animation-duration: 1.27s; } .ball-grid-beat > div[data-v-39432f99]:nth-child(2) { -webkit-animation-delay: 0.2s; animation-delay: 0.2s; -webkit-animation-duration: 1.52s; animation-duration: 1.52s; } .ball-grid-beat > div[data-v-39432f99]:nth-child(3) { -webkit-animation-delay: 0.14s; animation-delay: 0.14s; -webkit-animation-duration: 0.61s; animation-duration: 0.61s; } .ball-grid-beat > div[data-v-39432f99]:nth-child(4) { -webkit-animation-delay: 0.15s; animation-delay: 0.15s; -webkit-animation-duration: 0.82s; animation-duration: 0.82s; } .ball-grid-beat > div[data-v-39432f99]:nth-child(5) { -webkit-animation-delay: -0.01s; animation-delay: -0.01s; -webkit-animation-duration: 1.24s; animation-duration: 1.24s; } .ball-grid-beat > div[data-v-39432f99]:nth-child(6) { -webkit-animation-delay: -0.07s; animation-delay: -0.07s; -webkit-animation-duration: 1.35s; animation-duration: 1.35s; } .ball-grid-beat > div[data-v-39432f99]:nth-child(7) { -webkit-animation-delay: 0.29s; animation-delay: 0.29s; -webkit-animation-duration: 1.44s; animation-duration: 1.44s; } .ball-grid-beat > div[data-v-39432f99]:nth-child(8) { -webkit-animation-delay: 0.63s; animation-delay: 0.63s; -webkit-animation-duration: 1.19s; animation-duration: 1.19s; } .ball-grid-beat > div[data-v-39432f99]:nth-child(9) { -webkit-animation-delay: -0.18s; animation-delay: -0.18s; -webkit-animation-duration: 1.48s; animation-duration: 1.48s; } .ball-grid-beat > div[data-v-39432f99] { background-color: #fff; width: 15px; height: 15px; border-radius: 100%; margin: 2px; -webkit-animation-fill-mode: both; animation-fill-mode: both; display: inline-block; float: left; -webkit-animation-name: ball-grid-beat; animation-name: ball-grid-beat; -webkit-animation-iteration-count: infinite; animation-iteration-count: infinite; -webkit-animation-delay: 0; animation-delay: 0; } @-webkit-keyframes ball-grid-pulse { 0% { -webkit-transform: scale(1); transform: scale(1); } 50% { -webkit-transform: scale(0.5); transform: scale(0.5); opacity: 0.7; } 100% { -webkit-transform: scale(1); transform: scale(1); opacity: 1; } } @keyframes ball-grid-pulse { 0% { -webkit-transform: scale(1); transform: scale(1); } 50% { -webkit-transform: scale(0.5); transform: scale(0.5); opacity: 0.7; } 100% { -webkit-transform: scale(1); transform: scale(1); opacity: 1; } } .ball-grid-pulse[data-v-39432f99] { width: 57px; } .ball-grid-pulse > div[data-v-39432f99]:nth-child(1) { -webkit-animation-delay: 0.58s; animation-delay: 0.58s; -webkit-animation-duration: 0.9s; animation-duration: 0.9s; } .ball-grid-pulse > div[data-v-39432f99]:nth-child(2) { -webkit-animation-delay: 0.01s; animation-delay: 0.01s; -webkit-animation-duration: 0.94s; animation-duration: 0.94s; } .ball-grid-pulse > div[data-v-39432f99]:nth-child(3) { -webkit-animation-delay: 0.25s; animation-delay: 0.25s; -webkit-animation-duration: 1.43s; animation-duration: 1.43s; } .ball-grid-pulse > div[data-v-39432f99]:nth-child(4) { -webkit-animation-delay: -0.03s; animation-delay: -0.03s; -webkit-animation-duration: 0.74s; animation-duration: 0.74s; } .ball-grid-pulse > div[data-v-39432f99]:nth-child(5) { -webkit-animation-delay: 0.21s; animation-delay: 0.21s; -webkit-animation-duration: 0.68s; animation-duration: 0.68s; } .ball-grid-pulse > div[data-v-39432f99]:nth-child(6) { -webkit-animation-delay: 0.25s; animation-delay: 0.25s; -webkit-animation-duration: 1.17s; animation-duration: 1.17s; } .ball-grid-pulse > div[data-v-39432f99]:nth-child(7) { -webkit-animation-delay: 0.46s; animation-delay: 0.46s; -webkit-animation-duration: 1.41s; animation-duration: 1.41s; } .ball-grid-pulse > div[data-v-39432f99]:nth-child(8) { -webkit-animation-delay: 0.02s; animation-delay: 0.02s; -webkit-animation-duration: 1.56s; animation-duration: 1.56s; } .ball-grid-pulse > div[data-v-39432f99]:nth-child(9) { -webkit-animation-delay: 0.13s; animation-delay: 0.13s; -webkit-animation-duration: 0.78s; animation-duration: 0.78s; } .ball-grid-pulse > div[data-v-39432f99] { background-color: #fff; width: 15px; height: 15px; border-radius: 100%; margin: 2px; -webkit-animation-fill-mode: both; animation-fill-mode: both; display: inline-block; float: left; -webkit-animation-name: ball-grid-pulse; animation-name: ball-grid-pulse; -webkit-animation-iteration-count: infinite; animation-iteration-count: infinite; -webkit-animation-delay: 0; animation-delay: 0; } @-webkit-keyframes ball-spin-fade-loader { 50% { opacity: 0.3; -webkit-transform: scale(0.4); transform: scale(0.4); } 100% { opacity: 1; -webkit-transform: scale(1); transform: scale(1); } } @keyframes ball-spin-fade-loader { 50% { opacity: 0.3; -webkit-transform: scale(0.4); transform: scale(0.4); } 100% { opacity: 1; -webkit-transform: scale(1); transform: scale(1); } } .ball-spin-fade-loader[data-v-39432f99] { position: relative; top: -10px; left: -10px; } .ball-spin-fade-loader > div[data-v-39432f99]:nth-child(1) { top: 25px; left: 0; -webkit-animation: ball-spin-fade-loader 1s -0.96s infinite linear; animation: ball-spin-fade-loader 1s -0.96s infinite linear; } .ball-spin-fade-loader > div[data-v-39432f99]:nth-child(2) { top: 17.04545px; left: 17.04545px; -webkit-animation: ball-spin-fade-loader 1s -0.84s infinite linear; animation: ball-spin-fade-loader 1s -0.84s infinite linear; } .ball-spin-fade-loader > div[data-v-39432f99]:nth-child(3) { top: 0; left: 25px; -webkit-animation: ball-spin-fade-loader 1s -0.72s infinite linear; animation: ball-spin-fade-loader 1s -0.72s infinite linear; } .ball-spin-fade-loader > div[data-v-39432f99]:nth-child(4) { top: -17.04545px; left: 17.04545px; -webkit-animation: ball-spin-fade-loader 1s -0.6s infinite linear; animation: ball-spin-fade-loader 1s -0.6s infinite linear; } .ball-spin-fade-loader > div[data-v-39432f99]:nth-child(5) { top: -25px; left: 0; -webkit-animation: ball-spin-fade-loader 1s -0.48s infinite linear; animation: ball-spin-fade-loader 1s -0.48s infinite linear; } .ball-spin-fade-loader > div[data-v-39432f99]:nth-child(6) { top: -17.04545px; left: -17.04545px; -webkit-animation: ball-spin-fade-loader 1s -0.36s infinite linear; animation: ball-spin-fade-loader 1s -0.36s infinite linear; } .ball-spin-fade-loader > div[data-v-39432f99]:nth-child(7) { top: 0; left: -25px; -webkit-animation: ball-spin-fade-loader 1s -0.24s infinite linear; animation: ball-spin-fade-loader 1s -0.24s infinite linear; } .ball-spin-fade-loader > div[data-v-39432f99]:nth-child(8) { top: 17.04545px; left: -17.04545px; -webkit-animation: ball-spin-fade-loader 1s -0.12s infinite linear; animation: ball-spin-fade-loader 1s -0.12s infinite linear; } .ball-spin-fade-loader > div[data-v-39432f99] { background-color: #fff; width: 15px; height: 15px; border-radius: 100%; margin: 2px; -webkit-animation-fill-mode: both; animation-fill-mode: both; position: absolute; } @-webkit-keyframes ball-spin-loader { 75% { opacity: 0.2; } 100% { opacity: 1; } } @keyframes ball-spin-loader { 75% { opacity: 0.2; } 100% { opacity: 1; } } .ball-spin-loader[data-v-39432f99] { position: relative; } .ball-spin-loader > span[data-v-39432f99]:nth-child(1) { top: 45px; left: 0; -webkit-animation: ball-spin-loader 2s 0.9s infinite linear; animation: ball-spin-loader 2s 0.9s infinite linear; } .ball-spin-loader > span[data-v-39432f99]:nth-child(2) { top: 30.68182px; left: 30.68182px; -webkit-animation: ball-spin-loader 2s 1.8s infinite linear; animation: ball-spin-loader 2s 1.8s infinite linear; } .ball-spin-loader > span[data-v-39432f99]:nth-child(3) { top: 0; left: 45px; -webkit-animation: ball-spin-loader 2s 2.7s infinite linear; animation: ball-spin-loader 2s 2.7s infinite linear; } .ball-spin-loader > span[data-v-39432f99]:nth-child(4) { top: -30.68182px; left: 30.68182px; -webkit-animation: ball-spin-loader 2s 3.6s infinite linear; animation: ball-spin-loader 2s 3.6s infinite linear; } .ball-spin-loader > span[data-v-39432f99]:nth-child(5) { top: -45px; left: 0; -webkit-animation: ball-spin-loader 2s 4.5s infinite linear; animation: ball-spin-loader 2s 4.5s infinite linear; } .ball-spin-loader > span[data-v-39432f99]:nth-child(6) { top: -30.68182px; left: -30.68182px; -webkit-animation: ball-spin-loader 2s 5.4s infinite linear; animation: ball-spin-loader 2s 5.4s infinite linear; } .ball-spin-loader > span[data-v-39432f99]:nth-child(7) { top: 0; left: -45px; -webkit-animation: ball-spin-loader 2s 6.3s infinite linear; animation: ball-spin-loader 2s 6.3s infinite linear; } .ball-spin-loader > span[data-v-39432f99]:nth-child(8) { top: 30.68182px; left: -30.68182px; -webkit-animation: ball-spin-loader 2s 7.2s infinite linear; animation: ball-spin-loader 2s 7.2s infinite linear; } .ball-spin-loader > div[data-v-39432f99] { -webkit-animation-fill-mode: both; animation-fill-mode: both; position: absolute; width: 15px; height: 15px; border-radius: 100%; background: green; } @-webkit-keyframes ball-zig { 33% { -webkit-transform: translate(-15px, -30px); transform: translate(-15px, -30px); } 66% { -webkit-transform: translate(15px, -30px); transform: translate(15px, -30px); } 100% { -webkit-transform: translate(0, 0); transform: translate(0, 0); } } @keyframes ball-zig { 33% { -webkit-transform: translate(-15px, -30px); transform: translate(-15px, -30px); } 66% { -webkit-transform: translate(15px, -30px); transform: translate(15px, -30px); } 100% { -webkit-transform: translate(0, 0); transform: translate(0, 0); } } @-webkit-keyframes ball-zag { 33% { -webkit-transform: translate(15px, 30px); transform: translate(15px, 30px); } 66% { -webkit-transform: translate(-15px, 30px); transform: translate(-15px, 30px); } 100% { -webkit-transform: translate(0, 0); transform: translate(0, 0); } } @keyframes ball-zag { 33% { -webkit-transform: translate(15px, 30px); transform: translate(15px, 30px); } 66% { -webkit-transform: translate(-15px, 30px); transform: translate(-15px, 30px); } 100% { -webkit-transform: translate(0, 0); transform: translate(0, 0); } } .ball-zig-zag[data-v-39432f99] { position: relative; -webkit-transform: translate(-15px, -15px); transform: translate(-15px, -15px); } .ball-zig-zag > div[data-v-39432f99] { background-color: #fff; width: 15px; height: 15px; border-radius: 100%; margin: 2px; -webkit-animation-fill-mode: both; animation-fill-mode: both; position: absolute; margin-left: 15px; top: 4px; left: -7px; } .ball-zig-zag > div[data-v-39432f99]:first-child { -webkit-animation: ball-zig 0.7s 0s infinite linear; animation: ball-zig 0.7s 0s infinite linear; } .ball-zig-zag > div[data-v-39432f99]:last-child { -webkit-animation: ball-zag 0.7s 0s infinite linear; animation: ball-zag 0.7s 0s infinite linear; } @-webkit-keyframes ball-zig-deflect { 17% { -webkit-transform: translate(-15px, -30px); transform: translate(-15px, -30px); } 34% { -webkit-transform: translate(15px, -30px); transform: translate(15px, -30px); } 50% { -webkit-transform: translate(0, 0); transform: translate(0, 0); } 67% { -webkit-transform: translate(15px, -30px); transform: translate(15px, -30px); } 84% { -webkit-transform: translate(-15px, -30px); transform: translate(-15px, -30px); } 100% { -webkit-transform: translate(0, 0); transform: translate(0, 0); } } @keyframes ball-zig-deflect { 17% { -webkit-transform: translate(-15px, -30px); transform: translate(-15px, -30px); } 34% { -webkit-transform: translate(15px, -30px); transform: translate(15px, -30px); } 50% { -webkit-transform: translate(0, 0); transform: translate(0, 0); } 67% { -webkit-transform: translate(15px, -30px); transform: translate(15px, -30px); } 84% { -webkit-transform: translate(-15px, -30px); transform: translate(-15px, -30px); } 100% { -webkit-transform: translate(0, 0); transform: translate(0, 0); } } @-webkit-keyframes ball-zag-deflect { 17% { -webkit-transform: translate(15px, 30px); transform: translate(15px, 30px); } 34% { -webkit-transform: translate(-15px, 30px); transform: translate(-15px, 30px); } 50% { -webkit-transform: translate(0, 0); transform: translate(0, 0); } 67% { -webkit-transform: translate(-15px, 30px); transform: translate(-15px, 30px); } 84% { -webkit-transform: translate(15px, 30px); transform: translate(15px, 30px); } 100% { -webkit-transform: translate(0, 0); transform: translate(0, 0); } } @keyframes ball-zag-deflect { 17% { -webkit-transform: translate(15px, 30px); transform: translate(15px, 30px); } 34% { -webkit-transform: translate(-15px, 30px); transform: translate(-15px, 30px); } 50% { -webkit-transform: translate(0, 0); transform: translate(0, 0); } 67% { -webkit-transform: translate(-15px, 30px); transform: translate(-15px, 30px); } 84% { -webkit-transform: translate(15px, 30px); transform: translate(15px, 30px); } 100% { -webkit-transform: translate(0, 0); transform: translate(0, 0); } } .ball-zig-zag-deflect[data-v-39432f99] { position: relative; -webkit-transform: translate(-15px, -15px); transform: translate(-15px, -15px); } .ball-zig-zag-deflect > div[data-v-39432f99] { background-color: #fff; width: 15px; height: 15px; border-radius: 100%; margin: 2px; -webkit-animation-fill-mode: both; animation-fill-mode: both; position: absolute; margin-left: 15px; top: 4px; left: -7px; } .ball-zig-zag-deflect > div[data-v-39432f99]:first-child { -webkit-animation: ball-zig-deflect 1.5s 0s infinite linear; animation: ball-zig-deflect 1.5s 0s infinite linear; } .ball-zig-zag-deflect > div[data-v-39432f99]:last-child { -webkit-animation: ball-zag-deflect 1.5s 0s infinite linear; animation: ball-zag-deflect 1.5s 0s infinite linear; } /** * Lines */ @-webkit-keyframes line-scale { 0% { -webkit-transform: scaley(1); transform: scaley(1); } 50% { -webkit-transform: scaley(0.4); transform: scaley(0.4); } 100% { -webkit-transform: scaley(1); transform: scaley(1); } } @keyframes line-scale { 0% { -webkit-transform: scaley(1); transform: scaley(1); } 50% { -webkit-transform: scaley(0.4); transform: scaley(0.4); } 100% { -webkit-transform: scaley(1); transform: scaley(1); } } .line-scale > div[data-v-39432f99]:nth-child(1) { -webkit-animation: line-scale 1s -0.4s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); animation: line-scale 1s -0.4s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); } .line-scale > div[data-v-39432f99]:nth-child(2) { -webkit-animation: line-scale 1s -0.3s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); animation: line-scale 1s -0.3s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); } .line-scale > div[data-v-39432f99]:nth-child(3) { -webkit-animation: line-scale 1s -0.2s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); animation: line-scale 1s -0.2s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); } .line-scale > div[data-v-39432f99]:nth-child(4) { -webkit-animation: line-scale 1s -0.1s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); animation: line-scale 1s -0.1s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); } .line-scale > div[data-v-39432f99]:nth-child(5) { -webkit-animation: line-scale 1s 0s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); animation: line-scale 1s 0s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); } .line-scale > div[data-v-39432f99] { background-color: #fff; width: 4px; height: 35px; border-radius: 2px; margin: 2px; -webkit-animation-fill-mode: both; animation-fill-mode: both; display: inline-block; } @-webkit-keyframes line-scale-party { 0% { -webkit-transform: scale(1); transform: scale(1); } 50% { -webkit-transform: scale(0.5); transform: scale(0.5); } 100% { -webkit-transform: scale(1); transform: scale(1); } } @keyframes line-scale-party { 0% { -webkit-transform: scale(1); transform: scale(1); } 50% { -webkit-transform: scale(0.5); transform: scale(0.5); } 100% { -webkit-transform: scale(1); transform: scale(1); } } .line-scale-party > div[data-v-39432f99]:nth-child(1) { -webkit-animation-delay: -0.09s; animation-delay: -0.09s; -webkit-animation-duration: 0.83s; animation-duration: 0.83s; } .line-scale-party > div[data-v-39432f99]:nth-child(2) { -webkit-animation-delay: 0.33s; animation-delay: 0.33s; -webkit-animation-duration: 0.64s; animation-duration: 0.64s; } .line-scale-party > div[data-v-39432f99]:nth-child(3) { -webkit-animation-delay: 0.32s; animation-delay: 0.32s; -webkit-animation-duration: 0.39s; animation-duration: 0.39s; } .line-scale-party > div[data-v-39432f99]:nth-child(4) { -webkit-animation-delay: 0.47s; animation-delay: 0.47s; -webkit-animation-duration: 0.52s; animation-duration: 0.52s; } .line-scale-party > div[data-v-39432f99] { background-color: #fff; width: 4px; height: 35px; border-radius: 2px; margin: 2px; -webkit-animation-fill-mode: both; animation-fill-mode: both; display: inline-block; -webkit-animation-name: line-scale-party; animation-name: line-scale-party; -webkit-animation-iteration-count: infinite; animation-iteration-count: infinite; -webkit-animation-delay: 0; animation-delay: 0; } @-webkit-keyframes line-scale-pulse-out { 0% { -webkit-transform: scaley(1); transform: scaley(1); } 50% { -webkit-transform: scaley(0.4); transform: scaley(0.4); } 100% { -webkit-transform: scaley(1); transform: scaley(1); } } @keyframes line-scale-pulse-out { 0% { -webkit-transform: scaley(1); transform: scaley(1); } 50% { -webkit-transform: scaley(0.4); transform: scaley(0.4); } 100% { -webkit-transform: scaley(1); transform: scaley(1); } } .line-scale-pulse-out > div[data-v-39432f99] { background-color: #fff; width: 4px; height: 35px; border-radius: 2px; margin: 2px; -webkit-animation-fill-mode: both; animation-fill-mode: both; display: inline-block; -webkit-animation: line-scale-pulse-out 0.9s -0.6s infinite cubic-bezier(0.85, 0.25, 0.37, 0.85); animation: line-scale-pulse-out 0.9s -0.6s infinite cubic-bezier(0.85, 0.25, 0.37, 0.85); } .line-scale-pulse-out > div[data-v-39432f99]:nth-child(2), .line-scale-pulse-out > div[data-v-39432f99]:nth-child(4) { -webkit-animation-delay: -0.4s !important; animation-delay: -0.4s !important; } .line-scale-pulse-out > div[data-v-39432f99]:nth-child(1), .line-scale-pulse-out > div[data-v-39432f99]:nth-child(5) { -webkit-animation-delay: -0.2s !important; animation-delay: -0.2s !important; } @-webkit-keyframes line-scale-pulse-out-rapid { 0% { -webkit-transform: scaley(1); transform: scaley(1); } 80% { -webkit-transform: scaley(0.3); transform: scaley(0.3); } 90% { -webkit-transform: scaley(1); transform: scaley(1); } } @keyframes line-scale-pulse-out-rapid { 0% { -webkit-transform: scaley(1); transform: scaley(1); } 80% { -webkit-transform: scaley(0.3); transform: scaley(0.3); } 90% { -webkit-transform: scaley(1); transform: scaley(1); } } .line-scale-pulse-out-rapid > div[data-v-39432f99] { background-color: #fff; width: 4px; height: 35px; border-radius: 2px; margin: 2px; -webkit-animation-fill-mode: both; animation-fill-mode: both; display: inline-block; -webkit-animation: line-scale-pulse-out-rapid 0.9s -0.5s infinite cubic-bezier(0.11, 0.49, 0.38, 0.78); animation: line-scale-pulse-out-rapid 0.9s -0.5s infinite cubic-bezier(0.11, 0.49, 0.38, 0.78); } .line-scale-pulse-out-rapid > div[data-v-39432f99]:nth-child(2), .line-scale-pulse-out-rapid > div[data-v-39432f99]:nth-child(4) { -webkit-animation-delay: -0.25s !important; animation-delay: -0.25s !important; } .line-scale-pulse-out-rapid > div[data-v-39432f99]:nth-child(1), .line-scale-pulse-out-rapid > div[data-v-39432f99]:nth-child(5) { -webkit-animation-delay: 0s !important; animation-delay: 0s !important; } @-webkit-keyframes line-spin-fade-loader { 50% { opacity: 0.3; } 100% { opacity: 1; } } @keyframes line-spin-fade-loader { 50% { opacity: 0.3; } 100% { opacity: 1; } } .line-spin-fade-loader[data-v-39432f99] { position: relative; top: -10px; left: -4px; } .line-spin-fade-loader > div[data-v-39432f99]:nth-child(1) { top: 20px; left: 0; -webkit-animation: line-spin-fade-loader 1.2s -0.84s infinite ease-in-out; animation: line-spin-fade-loader 1.2s -0.84s infinite ease-in-out; } .line-spin-fade-loader > div[data-v-39432f99]:nth-child(2) { top: 13.63636px; left: 13.63636px; -webkit-transform: rotate(-45deg); transform: rotate(-45deg); -webkit-animation: line-spin-fade-loader 1.2s -0.72s infinite ease-in-out; animation: line-spin-fade-loader 1.2s -0.72s infinite ease-in-out; } .line-spin-fade-loader > div[data-v-39432f99]:nth-child(3) { top: 0; left: 20px; -webkit-transform: rotate(90deg); transform: rotate(90deg); -webkit-animation: line-spin-fade-loader 1.2s -0.6s infinite ease-in-out; animation: line-spin-fade-loader 1.2s -0.6s infinite ease-in-out; } .line-spin-fade-loader > div[data-v-39432f99]:nth-child(4) { top: -13.63636px; left: 13.63636px; -webkit-transform: rotate(45deg); transform: rotate(45deg); -webkit-animation: line-spin-fade-loader 1.2s -0.48s infinite ease-in-out; animation: line-spin-fade-loader 1.2s -0.48s infinite ease-in-out; } .line-spin-fade-loader > div[data-v-39432f99]:nth-child(5) { top: -20px; left: 0; -webkit-animation: line-spin-fade-loader 1.2s -0.36s infinite ease-in-out; animation: line-spin-fade-loader 1.2s -0.36s infinite ease-in-out; } .line-spin-fade-loader > div[data-v-39432f99]:nth-child(6) { top: -13.63636px; left: -13.63636px; -webkit-transform: rotate(-45deg); transform: rotate(-45deg); -webkit-animation: line-spin-fade-loader 1.2s -0.24s infinite ease-in-out; animation: line-spin-fade-loader 1.2s -0.24s infinite ease-in-out; } .line-spin-fade-loader > div[data-v-39432f99]:nth-child(7) { top: 0; left: -20px; -webkit-transform: rotate(90deg); transform: rotate(90deg); -webkit-animation: line-spin-fade-loader 1.2s -0.12s infinite ease-in-out; animation: line-spin-fade-loader 1.2s -0.12s infinite ease-in-out; } .line-spin-fade-loader > div[data-v-39432f99]:nth-child(8) { top: 13.63636px; left: -13.63636px; -webkit-transform: rotate(45deg); transform: rotate(45deg); -webkit-animation: line-spin-fade-loader 1.2s 0s infinite ease-in-out; animation: line-spin-fade-loader 1.2s 0s infinite ease-in-out; } .line-spin-fade-loader > div[data-v-39432f99] { background-color: #fff; width: 4px; height: 35px; border-radius: 2px; margin: 2px; -webkit-animation-fill-mode: both; animation-fill-mode: both; position: absolute; width: 5px; height: 15px; } /** * Misc */ @-webkit-keyframes triangle-skew-spin { 25% { -webkit-transform: perspective(100px) rotateX(180deg) rotateY(0); transform: perspective(100px) rotateX(180deg) rotateY(0); } 50% { -webkit-transform: perspective(100px) rotateX(180deg) rotateY(180deg); transform: perspective(100px) rotateX(180deg) rotateY(180deg); } 75% { -webkit-transform: perspective(100px) rotateX(0) rotateY(180deg); transform: perspective(100px) rotateX(0) rotateY(180deg); } 100% { -webkit-transform: perspective(100px) rotateX(0) rotateY(0); transform: perspective(100px) rotateX(0) rotateY(0); } } @keyframes triangle-skew-spin { 25% { -webkit-transform: perspective(100px) rotateX(180deg) rotateY(0); transform: perspective(100px) rotateX(180deg) rotateY(0); } 50% { -webkit-transform: perspective(100px) rotateX(180deg) rotateY(180deg); transform: perspective(100px) rotateX(180deg) rotateY(180deg); } 75% { -webkit-transform: perspective(100px) rotateX(0) rotateY(180deg); transform: perspective(100px) rotateX(0) rotateY(180deg); } 100% { -webkit-transform: perspective(100px) rotateX(0) rotateY(0); transform: perspective(100px) rotateX(0) rotateY(0); } } .triangle-skew-spin > div[data-v-39432f99] { -webkit-animation-fill-mode: both; animation-fill-mode: both; width: 0; height: 0; border-left: 20px solid transparent; border-right: 20px solid transparent; border-bottom: 20px solid #fff; -webkit-animation: triangle-skew-spin 3s 0s cubic-bezier(0.09, 0.57, 0.49, 0.9) infinite; animation: triangle-skew-spin 3s 0s cubic-bezier(0.09, 0.57, 0.49, 0.9) infinite; } @-webkit-keyframes square-spin { 25% { -webkit-transform: perspective(100px) rotateX(180deg) rotateY(0); transform: perspective(100px) rotateX(180deg) rotateY(0); } 50% { -webkit-transform: perspective(100px) rotateX(180deg) rotateY(180deg); transform: perspective(100px) rotateX(180deg) rotateY(180deg); } 75% { -webkit-transform: perspective(100px) rotateX(0) rotateY(180deg); transform: perspective(100px) rotateX(0) rotateY(180deg); } 100% { -webkit-transform: perspective(100px) rotateX(0) rotateY(0); transform: perspective(100px) rotateX(0) rotateY(0); } } @keyframes square-spin { 25% { -webkit-transform: perspective(100px) rotateX(180deg) rotateY(0); transform: perspective(100px) rotateX(180deg) rotateY(0); } 50% { -webkit-transform: perspective(100px) rotateX(180deg) rotateY(180deg); transform: perspective(100px) rotateX(180deg) rotateY(180deg); } 75% { -webkit-transform: perspective(100px) rotateX(0) rotateY(180deg); transform: perspective(100px) rotateX(0) rotateY(180deg); } 100% { -webkit-transform: perspective(100px) rotateX(0) rotateY(0); transform: perspective(100px) rotateX(0) rotateY(0); } } .square-spin > div[data-v-39432f99] { -webkit-animation-fill-mode: both; animation-fill-mode: both; width: 50px; height: 50px; background: #fff; border: 1px solid red; -webkit-animation: square-spin 3s 0s cubic-bezier(0.09, 0.57, 0.49, 0.9) infinite; animation: square-spin 3s 0s cubic-bezier(0.09, 0.57, 0.49, 0.9) infinite; } @-webkit-keyframes rotate_pacman_half_up { 0% { -webkit-transform: rotate(270deg); transform: rotate(270deg); } 50% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } 100% { -webkit-transform: rotate(270deg); transform: rotate(270deg); } } @keyframes rotate_pacman_half_up { 0% { -webkit-transform: rotate(270deg); transform: rotate(270deg); } 50% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } 100% { -webkit-transform: rotate(270deg); transform: rotate(270deg); } } @-webkit-keyframes rotate_pacman_half_down { 0% { -webkit-transform: rotate(90deg); transform: rotate(90deg); } 50% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(90deg); transform: rotate(90deg); } } @keyframes rotate_pacman_half_down { 0% { -webkit-transform: rotate(90deg); transform: rotate(90deg); } 50% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(90deg); transform: rotate(90deg); } } @-webkit-keyframes pacman-balls { 75% { opacity: 0.7; } 100% { -webkit-transform: translate(-100px, -6.25px); transform: translate(-100px, -6.25px); } } @keyframes pacman-balls { 75% { opacity: 0.7; } 100% { -webkit-transform: translate(-100px, -6.25px); transform: translate(-100px, -6.25px); } } .pacman[data-v-39432f99] { position: relative; } .pacman > div[data-v-39432f99]:nth-child(2) { -webkit-animation: pacman-balls 1s -0.99s infinite linear; animation: pacman-balls 1s -0.99s infinite linear; } .pacman > div[data-v-39432f99]:nth-child(3) { -webkit-animation: pacman-balls 1s -0.66s infinite linear; animation: pacman-balls 1s -0.66s infinite linear; } .pacman > div[data-v-39432f99]:nth-child(4) { -webkit-animation: pacman-balls 1s -0.33s infinite linear; animation: pacman-balls 1s -0.33s infinite linear; } .pacman > div[data-v-39432f99]:nth-child(5) { -webkit-animation: pacman-balls 1s 0s infinite linear; animation: pacman-balls 1s 0s infinite linear; } .pacman > div[data-v-39432f99]:first-of-type { width: 0px; height: 0px; border-right: 25px solid transparent; border-top: 25px solid #fff; border-left: 25px solid #fff; border-bottom: 25px solid #fff; border-radius: 25px; -webkit-animation: rotate_pacman_half_up 0.5s 0s infinite; animation: rotate_pacman_half_up 0.5s 0s infinite; position: relative; left: -30px; } .pacman > div[data-v-39432f99]:nth-child(2) { width: 0px; height: 0px; border-right: 25px solid transparent; border-top: 25px solid #fff; border-left: 25px solid #fff; border-bottom: 25px solid #fff; border-radius: 25px; -webkit-animation: rotate_pacman_half_down 0.5s 0s infinite; animation: rotate_pacman_half_down 0.5s 0s infinite; margin-top: -50px; position: relative; left: -30px; } .pacman > div[data-v-39432f99]:nth-child(3), .pacman > div[data-v-39432f99]:nth-child(4), .pacman > div[data-v-39432f99]:nth-child(5), .pacman > div[data-v-39432f99]:nth-child(6) { background-color: #fff; width: 15px; height: 15px; border-radius: 100%; margin: 2px; width: 10px; height: 10px; position: absolute; -webkit-transform: translate(0, -6.25px); transform: translate(0, -6.25px); top: 25px; left: 70px; } @-webkit-keyframes cube-transition { 25% { -webkit-transform: translateX(50px) scale(0.5) rotate(-90deg); transform: translateX(50px) scale(0.5) rotate(-90deg); } 50% { -webkit-transform: translate(50px, 50px) rotate(-180deg); transform: translate(50px, 50px) rotate(-180deg); } 75% { -webkit-transform: translateY(50px) scale(0.5) rotate(-270deg); transform: translateY(50px) scale(0.5) rotate(-270deg); } 100% { -webkit-transform: rotate(-360deg); transform: rotate(-360deg); } } @keyframes cube-transition { 25% { -webkit-transform: translateX(50px) scale(0.5) rotate(-90deg); transform: translateX(50px) scale(0.5) rotate(-90deg); } 50% { -webkit-transform: translate(50px, 50px) rotate(-180deg); transform: translate(50px, 50px) rotate(-180deg); } 75% { -webkit-transform: translateY(50px) scale(0.5) rotate(-270deg); transform: translateY(50px) scale(0.5) rotate(-270deg); } 100% { -webkit-transform: rotate(-360deg); transform: rotate(-360deg); } } .cube-transition[data-v-39432f99] { position: relative; -webkit-transform: translate(-25px, -25px); transform: translate(-25px, -25px); } .cube-transition > div[data-v-39432f99] { -webkit-animation-fill-mode: both; animation-fill-mode: both; width: 10px; height: 10px; position: absolute; top: -5px; left: -5px; background-color: #fff; -webkit-animation: cube-transition 1.6s 0s infinite ease-in-out; animation: cube-transition 1.6s 0s infinite ease-in-out; } .cube-transition > div[data-v-39432f99]:last-child { -webkit-animation-delay: -0.8s; animation-delay: -0.8s; } @-webkit-keyframes spin-rotate { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 50% { -webkit-transform: rotate(180deg); transform: rotate(180deg); } 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } @keyframes spin-rotate { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 50% { -webkit-transform: rotate(180deg); transform: rotate(180deg); } 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } .semi-circle-spin[data-v-39432f99] { position: relative; width: 35px; height: 35px; overflow: hidden; } .semi-circle-spin > div[data-v-39432f99] { position: absolute; border-width: 0px; border-radius: 100%; -webkit-animation: spin-rotate 0.6s 0s infinite linear; animation: spin-rotate 0.6s 0s infinite linear; background-image: -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(70%, transparent), color-stop(30%, #fff), to(#fff)); background-image: linear-gradient(transparent 0%, transparent 70%, #fff 30%, #fff 100%); width: 100%; height: 100%; } @-webkit-keyframes bar-progress { 0% { -webkit-transform: scaleY(20%); transform: scaleY(20%); opacity: 1; } 25% { -webkit-transform: translateX(6%) scaleY(10%); transform: translateX(6%) scaleY(10%); opacity: 0.7; } 50% { -webkit-transform: translateX(20%) scaleY(20%); transform: translateX(20%) scaleY(20%); opacity: 1; } 75% { -webkit-transform: translateX(6%) scaleY(10%); transform: translateX(6%) scaleY(10%); opacity: 0.7; } 100% { -webkit-transform: scaleY(20%); transform: scaleY(20%); opacity: 1; } } @keyframes bar-progress { 0% { -webkit-transform: scaleY(20%); transform: scaleY(20%); opacity: 1; } 25% { -webkit-transform: translateX(6%) scaleY(10%); transform: translateX(6%) scaleY(10%); opacity: 0.7; } 50% { -webkit-transform: translateX(20%) scaleY(20%); transform: translateX(20%) scaleY(20%); opacity: 1; } 75% { -webkit-transform: translateX(6%) scaleY(10%); transform: translateX(6%) scaleY(10%); opacity: 0.7; } 100% { -webkit-transform: scaleY(20%); transform: scaleY(20%); opacity: 1; } } .bar-progress[data-v-39432f99] { width: 30%; height: 12px; } .bar-progress > div[data-v-39432f99] { position: relative; width: 20%; height: 12px; border-radius: 10px; background-color: #fff; -webkit-animation: bar-progress 3s cubic-bezier(0.57, 0.1, 0.44, 0.93) infinite; animation: bar-progress 3s cubic-bezier(0.57, 0.1, 0.44, 0.93) infinite; opacity: 1; } @-webkit-keyframes bar-swing { 0% { left: 0; } 50% { left: 70%; } 100% { left: 0; } } @keyframes bar-swing { 0% { left: 0; } 50% { left: 70%; } 100% { left: 0; } } .bar-swing[data-v-39432f99] { width: 30%; height: 8px; } .bar-swing > div[data-v-39432f99] { position: relative; width: 30%; height: 8px; border-radius: 10px; background-color: #fff; -webkit-animation: bar-swing 1.5s infinite; animation: bar-swing 1.5s infinite; } @-webkit-keyframes bar-swing-container { 0% { left: 0; -webkit-transform: translateX(0); transform: translateX(0); } 50% { left: 70%; -webkit-transform: translateX(-4px); transform: translateX(-4px); } 100% { left: 0; -webkit-transform: translateX(0); transform: translateX(0); } } @keyframes bar-swing-container { 0% { left: 0; -webkit-transform: translateX(0); transform: translateX(0); } 50% { left: 70%; -webkit-transform: translateX(-4px); transform: translateX(-4px); } 100% { left: 0; -webkit-transform: translateX(0); transform: translateX(0); } } .bar-swing-container[data-v-39432f99] { width: 20%; height: 8px; position: relative; } .bar-swing-container div[data-v-39432f99]:nth-child(1) { position: absolute; width: 100%; background-color: rgba(255, 255, 255, 0.2); height: 12px; border-radius: 10px; } .bar-swing-container div[data-v-39432f99]:nth-child(2) { position: absolute; width: 30%; height: 8px; border-radius: 10px; background-color: #fff; -webkit-animation: bar-swing-container 2s cubic-bezier(0.91, 0.35, 0.12, 0.6) infinite; animation: bar-swing-container 2s cubic-bezier(0.91, 0.35, 0.12, 0.6) infinite; margin: 2px 2px 0; } .sk-spinner[data-v-39432f99] { color: #333; } .sk-spinner > div[data-v-39432f99] { background-color: currentColor; } @-webkit-keyframes sk-fade-in { 0% { opacity: 0; } 50% { opacity: 0; } 100% { opacity: 1; } } @keyframes sk-fade-in { 0% { opacity: 0; } 50% { opacity: 0; } 100% { opacity: 1; } } .sk-fade-in[data-v-39432f99] { -webkit-animation: sk-fade-in 2s; animation: sk-fade-in 2s; } .sk-fade-in-half-second[data-v-39432f99] { -webkit-animation: sk-fade-in 1s; animation: sk-fade-in 1s; } .sk-fade-in-quarter-second[data-v-39432f99] { -webkit-animation: sk-fade-in 0.5s; animation: sk-fade-in 0.5s; } .sk-rotating-plane > div[data-v-39432f99] { width: 27px; height: 27px; background-color: currentColor; -webkit-animation: sk-rotateplane 1.2s infinite ease-in-out; animation: sk-rotateplane 1.2s infinite ease-in-out; } @-webkit-keyframes sk-rotateplane { 0% { -webkit-transform: perspective(120px) } 50% { -webkit-transform: perspective(120px) rotateY(180deg) } 100% { -webkit-transform: perspective(120px) rotateY(180deg) rotateX(180deg) } } @keyframes sk-rotateplane { 0% { transform: perspective(120px) rotateX(0deg) rotateY(0deg); -webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg); } 50% { transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg); -webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg); } 100% { transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg); -webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg); } } .sk-double-bounce[data-v-39432f99] { width: 27px; height: 27px; position: relative; } .sk-double-bounce > div[data-v-39432f99] { width: 100%; height: 100%; border-radius: 50%; background-color: currentColor; opacity: 0.6; position: absolute; top: 0; left: 0; -webkit-animation: sk-bounce 2.0s infinite ease-in-out; animation: sk-bounce 2.0s infinite ease-in-out; } .sk-double-bounce > div[data-v-39432f99]:last-child { -webkit-animation-delay: -1.0s; animation-delay: -1.0s; } @-webkit-keyframes sk-bounce { 0%, 100% { -webkit-transform: scale(0.0) } 50% { -webkit-transform: scale(1.0) } } @keyframes sk-bounce { 0%, 100% { transform: scale(0.0); -webkit-transform: scale(0.0); } 50% { transform: scale(1.0); -webkit-transform: scale(1.0); } } .sk-wave[data-v-39432f99] { width: 50px; height: 40px; text-align: center; font-size: 10px; } .sk-wave > div[data-v-39432f99] { background-color: currentColor; height: 100%; width: 6px; margin: 0 3px 0 0; display: inline-block; -webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out; animation: sk-stretchdelay 1.2s infinite ease-in-out; } .sk-wave > div[data-v-39432f99]:nth-child(2) { -webkit-animation-delay: -1.1s; animation-delay: -1.1s; } .sk-wave > div[data-v-39432f99]:nth-child(3) { -webkit-animation-delay: -1.0s; animation-delay: -1.0s; } .sk-wave > div[data-v-39432f99]:nth-child(4) { -webkit-animation-delay: -0.9s; animation-delay: -0.9s; } .sk-wave > div[data-v-39432f99]:nth-child(5) { -webkit-animation-delay: -0.8s; animation-delay: -0.8s; } @-webkit-keyframes sk-stretchdelay { 0%, 40%, 100% { -webkit-transform: scaleY(0.4) } 20% { -webkit-transform: scaleY(1.0) } } @keyframes sk-stretchdelay { 0%, 40%, 100% { transform: scaleY(0.4); -webkit-transform: scaleY(0.4); } 20% { transform: scaleY(1.0); -webkit-transform: scaleY(1.0); } } .sk-wandering-cubes[data-v-39432f99] { width: 52px; height: 52px; position: relative; } .sk-wandering-cubes > div[data-v-39432f99] { background-color: currentColor; width: 10px; height: 10px; position: absolute; top: 0; left: 0; -webkit-animation: sk-cubemove 1.8s infinite ease-in-out; animation: sk-cubemove 1.8s infinite ease-in-out; } .sk-wandering-cubes > div[data-v-39432f99]:last-child { -webkit-animation-delay: -0.9s; animation-delay: -0.9s; } @-webkit-keyframes sk-cubemove { 25% { -webkit-transform: translateX(42px) rotate(-90deg) scale(0.5) } 50% { -webkit-transform: translateX(42px) translateY(42px) rotate(-180deg) } 75% { -webkit-transform: translateX(0px) translateY(42px) rotate(-270deg) scale(0.5) } 100% { -webkit-transform: rotate(-360deg) } } @keyframes sk-cubemove { 25% { transform: translateX(42px) rotate(-90deg) scale(0.5); -webkit-transform: translateX(42px) rotate(-90deg) scale(0.5); } 50% { /* Hack to make FF rotate in the right direction */ transform: translateX(42px) translateY(42px) rotate(-179deg); -webkit-transform: translateX(42px) translateY(42px) rotate(-179deg); } 50.1%[data-v-39432f99] { transform: translateX(42px) translateY(42px) rotate(-180deg); -webkit-transform: translateX(42px) translateY(42px) rotate(-180deg); } 75% { transform: translateX(0px) translateY(42px) rotate(-270deg) scale(0.5); -webkit-transform: translateX(0px) translateY(42px) rotate(-270deg) scale(0.5); } 100% { transform: rotate(-360deg); -webkit-transform: rotate(-360deg); } } .sk-pulse > div[data-v-39432f99] { width: 27px; height: 27px; background-color: currentColor; border-radius: 100%; -webkit-animation: sk-scaleout 1.0s infinite ease-in-out; animation: sk-scaleout 1.0s infinite ease-in-out; } @-webkit-keyframes sk-scaleout { 0% { -webkit-transform: scale(0.0) } 100% { -webkit-transform: scale(1.0); opacity: 0; } } @keyframes sk-scaleout { 0% { transform: scale(0.0); -webkit-transform: scale(0.0); } 100% { transform: scale(1.0); -webkit-transform: scale(1.0); opacity: 0; } } .sk-chasing-dots[data-v-39432f99] { width: 27px; height: 27px; position: relative; -webkit-animation: sk-rotate 2.0s infinite linear; animation: sk-rotate 2.0s infinite linear; } .sk-chasing-dots > div[data-v-39432f99] { width: 60%; height: 60%; display: inline-block; position: absolute; top: 0; background-color: currentColor; border-radius: 100%; -webkit-animation: sk-bounce 2.0s infinite ease-in-out; animation: sk-bounce 2.0s infinite ease-in-out; } .sk-chasing-dots > div[data-v-39432f99]:last-child { top: auto; bottom: 0; -webkit-animation-delay: -1.0s; animation-delay: -1.0s; } @-webkit-keyframes sk-rotate { 100% { -webkit-transform: rotate(360deg) }} @keyframes sk-rotate { 100% { transform: rotate(360deg); -webkit-transform: rotate(360deg); } } @-webkit-keyframes sk-bounce { 0%, 100% { -webkit-transform: scale(0.0) } 50% { -webkit-transform: scale(1.0) } } @keyframes sk-bounce { 0%, 100% { transform: scale(0.0); -webkit-transform: scale(0.0); } 50% { transform: scale(1.0); -webkit-transform: scale(1.0); } } .sk-three-bounce[data-v-39432f99] { height: 18px; } .sk-three-bounce > div[data-v-39432f99] { width: 18px; height: 18px; background-color: currentColor; border-radius: 100%; display: inline-block; -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out; animation: sk-bouncedelay 1.4s infinite ease-in-out; /* Prevent first frame from flickering when animation starts */ -webkit-animation-fill-mode: both; animation-fill-mode: both; } .sk-three-bounce > div[data-v-39432f99]:first-child { -webkit-animation-delay: -0.32s; animation-delay: -0.32s; } .sk-three-bounce > div[data-v-39432f99]:nth-child(2) { -webkit-animation-delay: -0.16s; animation-delay: -0.16s; } @-webkit-keyframes sk-bouncedelay { 0%, 80%, 100% { -webkit-transform: scale(0.0) } 40% { -webkit-transform: scale(1.0) } } @keyframes sk-bouncedelay { 0%, 80%, 100% { transform: scale(0.0); -webkit-transform: scale(0.0); } 40% { transform: scale(1.0); -webkit-transform: scale(1.0); } } .sk-circle[data-v-39432f99] { width: 40px; height: 40px; position: relative; } .sk-circle > div[data-v-39432f99] { background-color: initial; width: 100%; height: 100%; position: absolute; left: 0; top: 0; } .sk-circle > div[data-v-39432f99]::before { content: ''; display: block; margin: 0 auto; width: 20%; height: 20%; background-color: currentColor; border-radius: 100%; -webkit-animation: sk-bouncedelay 1.2s infinite ease-in-out; animation: sk-bouncedelay 1.2s infinite ease-in-out; /* Prevent first frame from flickering when animation starts */ -webkit-animation-fill-mode: both; animation-fill-mode: both; } .sk-circle > div[data-v-39432f99]:nth-child(2) { -webkit-transform: rotate(30deg); transform: rotate(30deg) } .sk-circle > div[data-v-39432f99]:nth-child(3) { -webkit-transform: rotate(60deg); transform: rotate(60deg) } .sk-circle > div[data-v-39432f99]:nth-child(4) { -webkit-transform: rotate(90deg); transform: rotate(90deg) } .sk-circle > div[data-v-39432f99]:nth-child(5) { -webkit-transform: rotate(120deg); transform: rotate(120deg) } .sk-circle > div[data-v-39432f99]:nth-child(6) { -webkit-transform: rotate(150deg); transform: rotate(150deg) } .sk-circle > div[data-v-39432f99]:nth-child(7) { -webkit-transform: rotate(180deg); transform: rotate(180deg) } .sk-circle > div[data-v-39432f99]:nth-child(8) { -webkit-transform: rotate(210deg); transform: rotate(210deg) } .sk-circle > div[data-v-39432f99]:nth-child(9) { -webkit-transform: rotate(240deg); transform: rotate(240deg) } .sk-circle > div[data-v-39432f99]:nth-child(10) { -webkit-transform: rotate(270deg); transform: rotate(270deg) } .sk-circle > div[data-v-39432f99]:nth-child(11) { -webkit-transform: rotate(300deg); transform: rotate(300deg) } .sk-circle > div[data-v-39432f99]:nth-child(12) { -webkit-transform: rotate(330deg); transform: rotate(330deg) } .sk-circle > div[data-v-39432f99]:nth-child(2)::before { -webkit-animation-delay: -1.1s; animation-delay: -1.1s } .sk-circle > div[data-v-39432f99]:nth-child(3)::before { -webkit-animation-delay: -1.0s; animation-delay: -1.0s } .sk-circle > div[data-v-39432f99]:nth-child(4)::before { -webkit-animation-delay: -0.9s; animation-delay: -0.9s } .sk-circle > div[data-v-39432f99]:nth-child(5)::before { -webkit-animation-delay: -0.8s; animation-delay: -0.8s } .sk-circle > div[data-v-39432f99]:nth-child(6)::before { -webkit-animation-delay: -0.7s; animation-delay: -0.7s } .sk-circle > div[data-v-39432f99]:nth-child(7)::before { -webkit-animation-delay: -0.6s; animation-delay: -0.6s } .sk-circle > div[data-v-39432f99]:nth-child(8)::before { -webkit-animation-delay: -0.5s; animation-delay: -0.5s } .sk-circle > div[data-v-39432f99]:nth-child(9)::before { -webkit-animation-delay: -0.4s; animation-delay: -0.4s } .sk-circle > div[data-v-39432f99]:nth-child(10)::before { -webkit-animation-delay: -0.3s; animation-delay: -0.3s } .sk-circle > div[data-v-39432f99]:nth-child(11)::before { -webkit-animation-delay: -0.2s; animation-delay: -0.2s } .sk-circle > div[data-v-39432f99]:nth-child(12)::before { -webkit-animation-delay: -0.1s; animation-delay: -0.1s } @-webkit-keyframes sk-bouncedelay { 0%, 80%, 100% { -webkit-transform: scale(0.0) } 40% { -webkit-transform: scale(1.0) } } @keyframes sk-bouncedelay { 0%, 80%, 100% { -webkit-transform: scale(0.0); transform: scale(0.0); } 40% { -webkit-transform: scale(1.0); transform: scale(1.0); } } .sk-cube-grid[data-v-39432f99] { width: 40px; height: 40px; } .sk-cube-grid > div[data-v-39432f99] { width: 33%; height: 33%; background-color: currentColor; float: left; -webkit-animation: sk-scaleDelay 1.3s infinite ease-in-out; animation: sk-scaleDelay 1.3s infinite ease-in-out; } /* * Spinner positions * 1 2 3 * 4 5 6 * 7 8 9 */ .sk-cube-grid > div[data-v-39432f99]:nth-child(1) { -webkit-animation-delay: 0.2s; animation-delay: 0.2s } .sk-cube-grid > div[data-v-39432f99]:nth-child(2) { -webkit-animation-delay: 0.3s; animation-delay: 0.3s } .sk-cube-grid > div[data-v-39432f99]:nth-child(3) { -webkit-animation-delay: 0.4s; animation-delay: 0.4s } .sk-cube-grid > div[data-v-39432f99]:nth-child(4) { -webkit-animation-delay: 0.1s; animation-delay: 0.1s } .sk-cube-grid > div[data-v-39432f99]:nth-child(5) { -webkit-animation-delay: 0.2s; animation-delay: 0.2s } .sk-cube-grid > div[data-v-39432f99]:nth-child(6) { -webkit-animation-delay: 0.3s; animation-delay: 0.3s } .sk-cube-grid > div[data-v-39432f99]:nth-child(7) { -webkit-animation-delay: 0.0s; animation-delay: 0.0s } .sk-cube-grid > div[data-v-39432f99]:nth-child(8) { -webkit-animation-delay: 0.1s; animation-delay: 0.1s } .sk-cube-grid > div[data-v-39432f99]:nth-child(9) { -webkit-animation-delay: 0.2s; animation-delay: 0.2s } @-webkit-keyframes sk-scaleDelay { 0%, 70%, 100% { -webkit-transform:scale3D(1.0, 1.0, 1.0) } 35% { -webkit-transform:scale3D(0.0, 0.0, 1.0) } } @keyframes sk-scaleDelay { 0%, 70%, 100% { -webkit-transform:scale3D(1.0, 1.0, 1.0); transform:scale3D(1.0, 1.0, 1.0) } 35% { -webkit-transform:scale3D(0.0, 0.0, 1.0); transform:scale3D(0.0, 0.0, 1.0) } } .sk-fading-circle[data-v-39432f99] { width: 40px; height: 40px; position: relative; } .sk-fading-circle > div[data-v-39432f99] { background-color: initial; width: 100%; height: 100%; position: absolute; left: 0; top: 0; } .sk-fading-circle > div[data-v-39432f99]::before { content: ''; display: block; margin: 0 auto; width: 15%; height: 15%; background-color: currentColor; border-radius: 100%; -webkit-animation: sk-circleFadeDelay 1.2s infinite ease-in-out both; animation: sk-circleFadeDelay 1.2s infinite ease-in-out both; } .sk-fading-circle > div[data-v-39432f99]:nth-child(2) { -webkit-transform: rotate(30deg); transform: rotate(30deg); } .sk-fading-circle > div[data-v-39432f99]:nth-child(3) { -webkit-transform: rotate(60deg); transform: rotate(60deg); } .sk-fading-circle > div[data-v-39432f99]:nth-child(4) { -webkit-transform: rotate(90deg); transform: rotate(90deg); } .sk-fading-circle > div[data-v-39432f99]:nth-child(5) { -webkit-transform: rotate(120deg); transform: rotate(120deg); } .sk-fading-circle > div[data-v-39432f99]:nth-child(6) { -webkit-transform: rotate(150deg); transform: rotate(150deg); } .sk-fading-circle > div[data-v-39432f99]:nth-child(7) { -webkit-transform: rotate(180deg); transform: rotate(180deg); } .sk-fading-circle > div[data-v-39432f99]:nth-child(8) { -webkit-transform: rotate(210deg); transform: rotate(210deg); } .sk-fading-circle > div[data-v-39432f99]:nth-child(9) { -webkit-transform: rotate(240deg); transform: rotate(240deg); } .sk-fading-circle > div[data-v-39432f99]:nth-child(10) { -webkit-transform: rotate(270deg); transform: rotate(270deg); } .sk-fading-circle > div[data-v-39432f99]:nth-child(11) { -webkit-transform: rotate(300deg); transform: rotate(300deg); } .sk-fading-circle > div[data-v-39432f99]:nth-child(12) { -webkit-transform: rotate(330deg); transform: rotate(330deg); } .sk-fading-circle > div[data-v-39432f99]:nth-child(2)::before { -webkit-animation-delay: -1.1s; animation-delay: -1.1s; } .sk-fading-circle > div[data-v-39432f99]:nth-child(3)::before { -webkit-animation-delay: -1s; animation-delay: -1s; } .sk-fading-circle > div[data-v-39432f99]:nth-child(4)::before { -webkit-animation-delay: -0.9s; animation-delay: -0.9s; } .sk-fading-circle > div[data-v-39432f99]:nth-child(5)::before { -webkit-animation-delay: -0.8s; animation-delay: -0.8s; } .sk-fading-circle > div[data-v-39432f99]:nth-child(6)::before { -webkit-animation-delay: -0.7s; animation-delay: -0.7s; } .sk-fading-circle > div[data-v-39432f99]:nth-child(7)::before { -webkit-animation-delay: -0.6s; animation-delay: -0.6s; } .sk-fading-circle > div[data-v-39432f99]:nth-child(8)::before { -webkit-animation-delay: -0.5s; animation-delay: -0.5s; } .sk-fading-circle > div[data-v-39432f99]:nth-child(9)::before { -webkit-animation-delay: -0.4s; animation-delay: -0.4s; } .sk-fading-circle > div[data-v-39432f99]:nth-child(10)::before { -webkit-animation-delay: -0.3s; animation-delay: -0.3s; } .sk-fading-circle > div[data-v-39432f99]:nth-child(11)::before { -webkit-animation-delay: -0.2s; animation-delay: -0.2s; } .sk-fading-circle > div[data-v-39432f99]:nth-child(12)::before { -webkit-animation-delay: -0.1s; animation-delay: -0.1s; } @-webkit-keyframes sk-circleFadeDelay { 0%, 39%, 100% { opacity: 0; } 40% { opacity: 1; } } @keyframes sk-circleFadeDelay { 0%, 39%, 100% { opacity: 0; } 40% { opacity: 1; } } .sk-folding-cube[data-v-39432f99] { width: 40px; height: 40px; position: relative; -webkit-transform: rotateZ(45deg); transform: rotateZ(45deg); } .sk-folding-cube > div[data-v-39432f99] { background-color: initial; float: left; width: 50%; height: 50%; position: relative; -webkit-transform: scale(1.1); transform: scale(1.1); } .sk-folding-cube > div[data-v-39432f99]::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: currentColor; -webkit-animation: sk-foldCubeAngle 2.4s infinite linear both; animation: sk-foldCubeAngle 2.4s infinite linear both; -webkit-transform-origin: 100% 100%; transform-origin: 100% 100%; } .sk-folding-cube > div[data-v-39432f99]:nth-child(2) { -webkit-transform: scale(1.1) rotateZ(90deg); transform: scale(1.1) rotateZ(90deg); } .sk-folding-cube > div[data-v-39432f99]:nth-child(4) { -webkit-transform: scale(1.1) rotateZ(180deg); transform: scale(1.1) rotateZ(180deg); } .sk-folding-cube > div[data-v-39432f99]:nth-child(3) { -webkit-transform: scale(1.1) rotateZ(270deg); transform: scale(1.1) rotateZ(270deg); } .sk-folding-cube > div[data-v-39432f99]:nth-child(2)::before { -webkit-animation-delay: 0.3s; animation-delay: 0.3s; } .sk-folding-cube > div[data-v-39432f99]:nth-child(4)::before { -webkit-animation-delay: 0.6s; animation-delay: 0.6s; } .sk-folding-cube > div[data-v-39432f99]:nth-child(3)::before { -webkit-animation-delay: 0.9s; animation-delay: 0.9s; } @-webkit-keyframes sk-foldCubeAngle { 0%, 10% { -webkit-transform: perspective(140px) rotateX(-180deg); transform: perspective(140px) rotateX(-180deg); opacity: 0; } 25%, 75% { -webkit-transform: perspective(140px) rotateX(0deg); transform: perspective(140px) rotateX(0deg); opacity: 1; } 90%, 100% { -webkit-transform: perspective(140px) rotateY(180deg); transform: perspective(140px) rotateY(180deg); opacity: 0; } } @keyframes sk-foldCubeAngle { 0%, 10% { -webkit-transform: perspective(140px) rotateX(-180deg); transform: perspective(140px) rotateX(-180deg); opacity: 0; } 25%, 75% { -webkit-transform: perspective(140px) rotateX(0deg); transform: perspective(140px) rotateX(0deg); opacity: 1; } 90%, 100% { -webkit-transform: perspective(140px) rotateY(180deg); transform: perspective(140px) rotateY(180deg); opacity: 0; } } .sk-wordpress > div[data-v-39432f99] { width: 27px; height: 27px; background-color: currentColor; display: inline-block; border-radius: 27px; position: relative; -webkit-animation: sk-inner-circle 1s linear infinite; animation: sk-inner-circle 1s linear infinite; } .sk-wordpress > div[data-v-39432f99]::after { content: ''; display: block; background-color: #fff; width: 8px; height: 8px; position: absolute; border-radius: 8px; top: 5px; left: 5px; } @-webkit-keyframes sk-inner-circle { 0% { -webkit-transform: rotate(0); } 100% { -webkit-transform: rotate(360deg); } } @keyframes sk-inner-circle { 0% { transform: rotate(0); -webkit-transform:rotate(0); } 100% { transform: rotate(360deg); -webkit-transform:rotate(360deg); } } .ball-triangle-path > div[data-v-39432f99], .ball-scale-ripple-multiple > div[data-v-39432f99], .ball-scale-ripple > div[data-v-39432f99] { background-color: initial; border-color: currentColor; } .ball-clip-rotate > div[data-v-39432f99] { background-color: initial; border-top-color: currentColor; border-right-color: currentColor; border-left-color: currentColor; } .ball-clip-rotate-pulse > div[data-v-39432f99]:first-child { background-color: currentColor; } .ball-clip-rotate-pulse > div[data-v-39432f99]:last-child { background-color: initial; border-top-color: currentColor; border-bottom-color: currentColor; } .ball-clip-rotate-multiple > div[data-v-39432f99]:first-child { background-color: initial; border-right-color: currentColor; border-left-color: currentColor; } .ball-clip-rotate-multiple > div[data-v-39432f99]:last-child { background-color: initial; border-top-color: currentColor; border-bottom-color: currentColor; } .triangle-skew-spin > div[data-v-39432f99] { background-color: initial; border-bottom-color: currentColor; } .pacman > div[data-v-39432f99]:nth-child(1), .pacman > div[data-v-39432f99]:nth-child(2) { background-color: initial; border-top-color: currentColor; border-left-color: currentColor; border-bottom-color: currentColor; } .pacman > div[data-v-39432f99]:nth-child(3), .pacman > div[data-v-39432f99]:nth-child(4), .pacman > div[data-v-39432f99]:nth-child(5) { background-color: currentColor; } /*# sourceMappingURL=Spinner.vue.map */";e.type="text/css",e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n)),t.appendChild(e)}}(),{render:function(){var t,e,n,a=this,r=a.$createElement,i=a._self._c||r;return""!==a.loading.className?i("div",{class:[(t={"sk-fade-in":"full"===a.fadeIn&&!a.noFadeIn,"sk-fade-in-half-second":"half"===a.fadeIn&&!a.noFadeIn,"sk-fade-in-quarter-second":"quarter"===a.fadeIn&&!a.noFadeIn},e=a.className,n=!!a.className,e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t),"sk-spinner",a.loading.className],style:a.style},a._l(a.loading.divCount,function(t,e){return i("div",{key:e})})):a._e()},staticRenderFns:[],_scopeId:"data-v-39432f99",name:"Spinner",props:{name:{type:String,default:"three-bounce"},color:{type:String,default:""},noFadeIn:{type:Boolean,default:!1},fadeIn:{type:String,default:"full"},className:{type:String,default:""},width:{type:String,default:""},height:{type:String,default:""}},data:function(){return{allSpinners:n.allSpinners}},computed:{loading:function(){var t=this.allSpinners[this.name];if(void 0!==t){var e=void 0!==t.className?t.className:this.name;return Object.assign({},t,{className:e})}return{className:"",divCount:0}},style:function(){return(""!==this.color?"color: "+this.color+";":"")+(""!==this.width?"width: "+this.width+"px;":"")+(""!==this.height?"height: "+this.height+"px;":"")}}}})},f1ae:function(t,e,n){"use strict";var a=n("86cc"),r=n("4630");t.exports=function(t,e,n){e in t?a.f(t,e,r(0,n)):t[e]=n}},f260:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("pt",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}});return e})},f3ff:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e={1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"},n={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"},a=t.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"[ਅਗਲਾ] dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",ss:"%d ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(t){return t.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,function(t){return n[t]})},postformat:function(t){return t.replace(/\d/g,function(t){return e[t]})},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(t,e){return 12===t&&(t=0),"ਰਾਤ"===e?t<4?t:t+12:"ਸਵੇਰ"===e?t:"ਦੁਪਹਿਰ"===e?t>=10?t:t+12:"ਸ਼ਾਮ"===e?t+12:void 0},meridiem:function(t,e,n){return t<4?"ਰਾਤ":t<10?"ਸਵੇਰ":t<17?"ਦੁਪਹਿਰ":t<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}});return a})},f410:function(t,e,n){n("1af6"),t.exports=n("584a").Array.isArray},f4d6:function(t,e,n){var a=n("ffd6"),r=1/0;function i(t){if("string"==typeof t||a(t))return t;var e=t+"";return"0"==e&&1/t==-r?"-0":e}t.exports=i},f559:function(t,e,n){"use strict";var a=n("5ca1"),r=n("9def"),i=n("d2c8"),o="startsWith",s=""[o];a(a.P+a.F*n("5147")(o),"String",{startsWith:function(t){var e=i(this,t,o),n=r(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),a=String(t);return s?s.call(e,a,n):e.slice(n,n+a.length)===a}})},f605:function(t,e){t.exports=function(t,e,n,a){if(!(t instanceof e)||void 0!==a&&a in t)throw TypeError(n+": incorrect invocation!");return t}},f608:function(t,e,n){var a=n("6747"),r=n("ffd6"),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;function s(t,e){if(a(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!r(t))||(o.test(t)||!i.test(t)||null!=e&&t in Object(e))}t.exports=s},f6b4:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"],n=["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],a=["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],r=["Did","Dil","Dim","Dic","Dia","Dih","Dis"],i=["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],o=t.defineLocale("gd",{months:e,monthsShort:n,monthsParseExact:!0,weekdays:a,weekdaysShort:r,weekdaysMin:i,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",ss:"%d diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(t){var e=1===t?"d":t%10===2?"na":"mh";return t+e},week:{dow:1,doy:4}});return o})},f751:function(t,e,n){var a=n("5ca1");a(a.S+a.F,"Object",{assign:n("73334")})},f772:function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},f921:function(t,e,n){n("014b"),n("c207"),n("69d3"),n("765d"),t.exports=n("584a").Symbol},fa5b:function(t,e,n){t.exports=n("5537")("native-function-to-string",Function.toString)},fab2:function(t,e,n){var a=n("7726").document;t.exports=a&&a.documentElement},facd:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),a=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,i=t.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(t,a){return t?/-MMM-/.test(a)?n[t.month()]:e[t.month()]:e},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:a,longMonthsParse:a,shortMonthsParse:a,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(t){return t+(1===t||8===t||t>=20?"ste":"de")},week:{dow:1,doy:4}});return i})},fba5:function(t,e,n){var a=n("cb5a");function r(t){return a(this.__data__,t)>-1}t.exports=r},fd7e:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("x-pseudo",{months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),monthsParseExact:!0,weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~ódá~ý át] LT",nextDay:"[T~ómó~rró~w át] LT",nextWeek:"dddd [át] LT",lastDay:"[Ý~ést~érdá~ý át] LT",lastWeek:"[L~ást] dddd [át] LT",sameElse:"L"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",ss:"%d s~écóñ~ds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"},dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=1===~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n},week:{dow:1,doy:4}});return e})},ffc1:function(t,e,n){var a=n("5ca1"),r=n("504c")(!0);a(a.S,"Object",{entries:function(t){return r(t)}})},ffd6:function(t,e,n){var a=n("3729"),r=n("1310"),i="[object Symbol]";function o(t){return"symbol"==typeof t||r(t)&&a(t)==i}t.exports=o},ffff:function(t,e,n){(function(t,e){e(n("c1df"))})(0,function(t){"use strict";var e=t.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",ss:"%d sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return e})}}]); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoianMvY2h1bmstdmVuZG9ycy5kZTU1OWUxYS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy91cmlqcy9zcmMvSVB2Ni5qcyIs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XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpZiAoc2VnbWVudHNbaV0gPT09ICcwJykge1xuICAgICAgICAgIGluemVyb2VzID0gdHJ1ZTtcbiAgICAgICAgICBjdXJyZW50ID0gaTtcbiAgICAgICAgICBfY3VycmVudCA9IDE7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAoX2N1cnJlbnQgPiBfYmVzdCkge1xuICAgICAgYmVzdCA9IGN1cnJlbnQ7XG4gICAgICBfYmVzdCA9IF9jdXJyZW50O1xuICAgIH1cblxuICAgIGlmIChfYmVzdCA+IDEpIHtcbiAgICAgIHNlZ21lbnRzLnNwbGljZShiZXN0LCBfYmVzdCwgJycpO1xuICAgIH1cblxuICAgIGxlbmd0aCA9IHNlZ21lbnRzLmxlbmd0aDtcblxuICAgIC8vIGFzc2VtYmxlIHJlbWFpbmluZyBzZWdtZW50c1xuICAgIHZhciByZXN1bHQgPSAnJztcbiAgICBpZiAoc2VnbWVudHNbMF0gPT09ICcnKSAge1xuICAgICAgcmVzdWx0ID0gJzonO1xuICAgIH1cblxuICAgIGZvciAoaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykge1xuICAgICAgcmVzdWx0ICs9IHNlZ21lbnRzW2ldO1xuICAgICAgaWYgKGkgPT09IGxlbmd0aCAtIDEpIHtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG5cbiAgICAgIHJlc3VsdCArPSAnOic7XG4gICAgfVxuXG4gICAgaWYgKHNlZ21lbnRzW2xlbmd0aCAtIDFdID09PSAnJykge1xuICAgICAgcmVzdWx0ICs9ICc6JztcbiAgICB9XG5cbiAgICByZXR1cm4gcmVzdWx0O1xuICB9XG5cbiAgZnVuY3Rpb24gbm9Db25mbGljdCgpIHtcbiAgICAvKmpzaGludCB2YWxpZHRoaXM6IHRydWUgKi9cbiAgICBpZiAocm9vdC5JUHY2ID09PSB0aGlzKSB7XG4gICAgICByb290LklQdjYgPSBfSVB2NjtcbiAgICB9X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B7XG4gICAgICAgIC8vICgpID0+IFByb21pc2VcbiAgICAgICAgaWYgKGlzVW5kZWYoZmFjdG9yeS5yZXNvbHZlZCkpIHtcbiAgICAgICAgICByZXMudGhlbihyZXNvbHZlLCByZWplY3QpO1xuICAgICAgICB9XG4gICAgICB9IGVsc2UgaWYgKGlzUHJvbWlzZShyZXMuY29tcG9uZW50KSkge1xuICAgICAgICByZXMuY29tcG9uZW50LnRoZW4ocmVzb2x2ZSwgcmVqZWN0KTtcblxuICAgICAgICBpZiAoaXNEZWYocmVzLmVycm9yKSkge1xuICAgICAgICAgIGZhY3RvcnkuZXJyb3JDb21wID0gZW5zdXJlQ3RvcihyZXMuZXJyb3IsIGJhc2VDdG9yKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChpc0RlZihyZXMubG9hZGluZykpIHtcbiAgICAgICAgICBmYWN0b3J5LmxvYWRpbmdDb21wID0gZW5zdXJlQ3RvcihyZXMubG9hZGluZywgYmFzZUN0b3IpO1xuICAgICAgICAgIGlmIChyZXMuZGVsYXkgPT09IDApIHtcbiAgICAgICAgICAgIGZhY3RvcnkubG9hZGluZyA9IHRydWU7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRpbWVyTG9hZGluZyA9IHNldFRpbWVvdXQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICB0aW1lckxvYWRpbmcgPSBudWxsO1xuICAgICAgICAgICAgICBpZiAoaXNVbmRlZihmYWN0b3J5LnJlc29sdmVkKSAmJiBpc1VuZGVmKGZhY3RvcnkuZXJyb3IpKSB7XG4gICAgICAgICAgICAgICAgZmFjdG9yeS5sb2FkaW5nID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBmb3JjZVJlbmRlcihmYWxzZSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sIHJlcy5kZWxheSB8fCAyMDApO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChpc0RlZihyZXMudGltZW91dCkpIHtcbiAgICAgICAgICB0aW1lclRpbWVvdXQgPSBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHRpbWVyVGltZW91dCA9IG51bGw7XG4gICAgICAgICAgICBpZiAoaXNVbmRlZihmYWN0b3J5LnJlc29sdmVkKSkge1xuICAgICAgICAgICAgICByZWplY3QoXG4gICAgICAgICAgICAgICAgcHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJ1xuICAgICAgICAgICAgICAgICAgPyAoXCJ0aW1lb3V0IChcIiArIChyZXMudGltZW91dCkgKyBcIm1zKVwiKVxuICAgICAgICAgICAgICAgICAgOiBudWxsXG4gICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSwgcmVzLnRpbWVvdXQpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuXG4gICAgc3luYyA9IGZhbHNlO1xuICAgIC8vIHJldHVybiBpbiBjYXNlIHJlc29sdmVkIHN5bmNocm9ub3VzbHlcbiAgICByZXR1cm4gZmFjdG9yeS5sb2FkaW5nXG4gICAgICA/IGZhY3RvcnkubG9hZGluZ0NvbXBcbiAgICAgIDogZmFjdG9yeS5yZXNvbHZlZFxuICB9XG59XG5cbi8qICAqL1xuXG5mdW5jdGlvbiBpc0FzeW5jUGxhY2Vob2xkZXIgKG5vZGUpIHtcbiAgcmV0dXJuIG5vZGUuaXNDb21tZW50ICYmIG5vZGUuYXN5bmNGYWN0b3J5XG59XG5cbi8qICAqL1xuXG5mdW5jdGlvbiBnZXRGaXJzdENvbXBvbmVudENoaWxkIChjaGlsZHJlbikge1xuICBpZiAoQXJyYXkuaXNBcnJheShjaGlsZHJlbikpIHtcbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IGNoaWxkcmVuLmxlbmd0aDsgaSsrKSB7XG4gICAgICB2YXIgYyA9IGNoaWxkcmVuW2ldO1xuICAgICAgaWYgKGlzRGVmKGMpICYmICh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dWRlZFxuICAgICAgICAoaW5jbHVkZSAmJiAoIW5hbWUgfHwgIW1hdGNoZXMoaW5jbHVkZSwgbmFtZSkpKSB8fFxuICAgICAgICAvLyBleGNsdWRlZFxuICAgICAgICAoZXhjbHVkZSAmJiBuYW1lICYmIG1hdGNoZXMoZXhjbHVkZSwgbmFtZSkpXG4gICAgICApIHtcbiAgICAgICAgcmV0dXJuIHZub2RlXG4gICAgICB9XG5cbiAgICAgIHZhciByZWYkMSA9IHRoaXM7XG4gICAgICB2YXIgY2FjaGUgPSByZWYkMS5jYWNoZTtcbiAgICAgIHZhciBrZXlzID0gcmVmJDEua2V5cztcbiAgICAgIHZhciBrZXkgPSB2bm9kZS5rZXkgPT0gbnVsbFxuICAgICAgICAvLyBzYW1lIGNvbnN0cnVjdG9yIG1heSBnZXQgcmVnaXN0ZXJlZCBhcyBkaWZmZXJlbnQgbG9jYWwgY29tcG9uZW50c1xuICAgICAgICAvLyBzbyBjaWQgYWxvbmUgaXMgbm90IGVub3VnaCAoIzMyNjkpXG4gICAgICAgID8gY29tcG9uZW50T3B0aW9ucy5DdG9yLmNpZCArIChjb21wb25lbnRPcHRpb25zLnRhZyA/IChcIjo6XCIgKyAoY29tcG9uZW50T3B0aW9ucy50YWcpKSA6ICcnKVxuICAgICAgICA6IHZub2RlLmtleTtcbiAgICAgIGlmIChjYWNoZVtrZXldKSB7XG4gICAgICAgIHZub2RlLmNvbXBvbmVudEluc3RhbmNlID0gY2FjaGVba2V5XS5jb21wb25lbnRJbnN0YW5jZTtcbiAgICAgICAgLy8gbWFrZSBjdXJyZW50IGtleSBmcmVzaGVzdFxuICAgICAgICByZW1vdmUoa2V5cywga2V5KTtcbiAgICAgICAga2V5cy5wdXNoKGtleSk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBjYWNoZVtrZXldID0gdm5vZGU7XG4gICAgICAgIGtleXMucHVzaChrZXkpO1xuICAgICAgICAvLyBwcnVuZSBvbGRlc3QgZW50cnlcbiAgICAgICAga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pbGRyZW4pKSB7XG4gICAgICAgIC8vIGVtcHR5IGVsZW1lbnQsIGFsbG93IGNsaWVudCB0byBwaWNrIHVwIGFuZCBwb3B1bGF0ZSBjaGlsZHJlblxuICAgICAgICBpZiAoIWVsbS5oYXNDaGlsZE5vZGVzKCkpIHtcbiAgICAgICAgICBjcmVhdGVDaGlsZHJlbih2bm9kZSwgY2hpbGRyZW4sIGluc2VydGVkVm5vZGVRdWV1ZSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgLy8gdi1odG1sIGFuZCBkb21Qcm9wczogaW5uZXJIVE1MXG4gICAgICAgICAgaWYgKGlzRGVmKGkgPSBkYXRhKSAmJiBpc0RlZihpID0gaS5kb21Qcm9wcykgJiYgaXNEZWYoaSA9IGkuaW5uZXJIVE1MKSkge1xuICAgICAgICAgICAgaWYgKGkgIT09IGVsbS5pbm5lckhUTUwpIHtcbiAgICAgICAgICAgICAgLyogaXN0YW5idWwgaWdub3JlIGlmICovXG4gICAgICAgICAgICAgIGlmIChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nICYmXG4gICAgICAgICAgICAgICAgdHlwZW9mIGNvbnNvbGUgIT09ICd1bmRlZmluZWQnICYmXG4gICAgICAgICAgICAgICAgIWh5ZHJhdGlvbkJhaWxlZFxuICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICBoeWRyYXRpb25CYWlsZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIGNvbnNvbGUud2FybignUGFyZW50OiAnLCBlbG0pO1xuICAgICAgICAgICAgICAgIGNvbnNvbGUud2Fybignc2VydmVyIGlubmVySFRNTDogJywgaSk7XG4gICAgICAgICAgICAgICAgY29uc29sZS53YXJuKCdjbGllbnQgaW5uZXJIVE1MOiAnLCBlbG0uaW5uZXJIVE1MKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICByZXR1cm4gZmFsc2VcbiAgICAgICAgICAgIH1cbiAgICAgICA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7XG4gICAgICAgICAgICAgICAgaHlkcmF0aW9uQmFpbGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oJ1BhcmVudDogJywgZWxtKTtcbiAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oJ01pc21hdGNoaW5nIGNoaWxkTm9kZXMgdnMuIFZOb2RlczogJywgZWxtLmNoaWxkTm9kZXMsIGNoaWxkcmVuKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICByZXR1cm4gZmFsc2VcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGlmIChpc0RlZihkYXRhKSkge1xuICAgICAgICB2YXIgZnVsbEludm9rZSA9IGZhbHNlO1xuICAgICAgICBmb3IgKHZhciBrZXkgaW4gZGF0YSkge1xuICAgICAgICAgIGlmICghaXNSZW5kZXJlZE1vZHVsZShrZXkpKSB7XG4gICAgICAgICAgICBmdWxsSW52b2tlID0gdHJ1ZTtcbiAgICAgICAgICAgIGludm9rZUNyZWF0ZUhvb2tzKHZub2RlLCBpbnNlcnRlZFZub2RlUXVldWUpO1xuICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFmdWxsSW52b2tlICYmIGRhdGFbJ2NsYXNzJ10pIHtcbiAgICAgICAgICAvLyBlbnN1cmUgY29sbGVjdGluZyBkZXBzIGZvciBkZWVwIGNsYXNzIGJpbmRpbmdzIGZvciBmdXR1cmUgdXBkYXRlc1xuICAgICAgICAgIHRyYXZlcnNlKGRhdGFbJ2NsYXNzJ10pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSBlbHNlIGlmIChlbG0uZGF0YSAhPT0gdm5vZGUudGV4dCkge1xuICAgICAgZWxtLmRhdGEgPSB2bm9kZS50ZXh0O1xuICAgIH1cbiAgICByZXR1cm4gdHJ1ZVxuICB9XG5cbiAgZnVuY3Rpb24gYXNzZXJ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ICAgICAgLy8gIzY1MTNcbiAgICAgICAgICAgICAgLy8gaW52b2tlIGluc2VydCBob29rcyB0aGF0IG1heSBoYXZlIGJlZW4gbWVyZ2VkIGJ5IGNyZWF0ZSBob29rcy5cbiAgICAgICAgICAgICAgLy8gZS5nLiBmb3IgZGlyZWN0aXZlcyB0aGF0IHVzZXMgdGhlIFwiaW5zZXJ0ZWRcIiBob29rLlxuICAgICAgICAgICAgICB2YXIgaW5zZXJ0ID0gYW5jZXN0b3IuZGF0YS5ob29rLmluc2VydDtcbiAgICAgICAgICAgICAgaWYgKGluc2VydC5tZXJnZWQpIHtcbiAgICAgICAgICAgICAgICAvLyBzdGFydCBhdCBpbmRleCAxIHRvIGF2b2lkIHJlLWludm9raW5nIGNvbXBvbmVudCBtb3VudGVkIGhvb2tcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBpJDIgPSAxOyBpJDIgPCBpbnNlcnQuZm5zLmxlbmd0aDsgaSQyKyspIHtcbiAgICAgICAgICAgICAgICAgIGluc2VydC5mbnNbaSQyXSgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgcmVnaXN0ZXJSZWYoYW5jZXN0b3IpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYW5jZXN0b3IgPSBhbmNlc3Rvci5wYXJlbnQ7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gZGVzdHJveSBvbGQgbm9kZVxuICAgICAgICBpZiAoaXNEZWYocGFyZW50RWxtKSkge1xuICAgICAgICAgIHJlbW92ZVZub2RlcyhwYXJlbnRFbG0sIFtvbGRWbm9kZV0sIDAsIDApO1xuICAgICAgICB9IGVsc2UgaWYgKGlzRGVmKG9sZFZub2RlLnRhZykpIHtcbiAgICAgICAgICBpbnZva2VEZXN0cm95SG9vayhvbGRWbm9kZSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG5c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wgT2JqZWN0LnByb3RvdHlwZS50b1N0cmluZy5jYWxsKGlucHV0KSA9PT0gJ1tvYmplY3QgQXJyYXldJztcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBpc09iamVjdChpbnB1dCkge1xuICAgICAgICAvLyBJRTggd2lsbCB0cmVhdCB1bmRlZmluZWQgYW5kIG51bGwgYXMgb2JqZWN0IGlmIGl0IHdhc24ndCBmb3JcbiAgICAgICAgLy8gaW5wdXQgIT0gbnVsbFxuICAgICAgICByZXR1cm4gaW5wdXQgIT0gbnVsbCAmJiBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwoaW5wdXQpID09PSAnW29iamVjdCBPYmplY3RdJztcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBpc09iamVjdEVtcHR5KG9iaikge1xuICAgICAgICBpZiAoT2JqZWN0LmdldE93blByb3BlcnR5TmFtZXMpIHtcbiAgICAgICAgICAgIHJldHVybiBPYmplY3QuZ2V0T3duUHJvcGVydHlOYW1lcyhvYmopLmxlbmd0aCA9PT0gMDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhciBrO1xuICAgICAgICAgICAgZm9yIChrIGluIG9iaikge1xuICAgICAgICAgICAgICAgIGlmIChvYmouaGFzT3duUHJvcGVydHkoaykpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaXNVbmRlZmluZWQoaW5wdXQpIHtcbiAgICAgICAgcmV0dXJuIGlucHV0ID09PSB2b2lkIDA7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaXNOdW1iZXIoaW5wdXQpIHtcbiAgICAgICAgcmV0dXJuIHR5cGVvZiBpbnB1dCA9PT0gJ251bWJlcicgfHwgT2JqZWN0LnByb3RvdHlwZS50b1N0cmluZy5jYWxsKGlucHV0KSA9PT0gJ1tvYmplY3QgTnVtYmVyXSc7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaXNEYXRlKGlucHV0KSB7XG4gICAgICAgIHJldHVybiBpbnB1dCBpbnN0YW5jZW9mIERhdGUgfHwgT2JqZWN0LnByb3RvdHlwZS50b1N0cmluZy5jYWxsKGlucHV0KSA9PT0gJ1tvYmplY3QgRGF0ZV0nO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIG1hcChhcnIsIGZuKSB7XG4gICAgICAgIHZhciByZXMgPSBbXSxcbiAgICAgICAgICAgIGk7XG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyArK2kpIHtcbiAgICAgICAgICAgIHJlcy5wdXNoKGZuKGFycltpXSwgaSkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXM7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaGFzT3duUHJvcChhLCBiKSB7XG4gICAgICAgIHJldHVybiBPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoYSwgYik7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZXh0ZW5kKGEsIGIpIHtcbiAgICAgICAgZm9yICh2YXIgaSBpbiBiKSB7XG4gICAgICAgICAgICBpZiAoaGFzT3duUHJvcChiLCBpKSkge1xuICAgICAgICAgICAgICAgIGFbaV0gPSBiW2ldO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGhhc093blByb3AoYiwgJ3RvU3RyaW5nJykpIHtcbiAgICAgICAgICAgIGEudG9TdHJpbmcgPSBiLnRvU3RyaW5nO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGhhc093blByb3AoYiwgJ3ZhbHVlT2YnKSkge1xuICAgICAgICAgICAgYS52YWx1ZU9mID0gYi52YWx1ZU9mO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGE7XG4gICAgfVxuXG4gICAgZnV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gICB9XG5cbiAgICB2YXIgc29tZTtcbiAgICBpZiAoQXJyYXkucHJvdG90eXBlLnNvbWUpIHtcbiAgICAgICAgc29tZSA9IEFycmF5LnByb3RvdHlwZS5zb21lO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIHNvbWUgPSBmdW5jdGlvbiBzb21lKGZ1bikge1xuICAgICAgICAgICAgdmFyIHQgPSBPYmplY3QodGhpcyk7XG4gICAgICAgICAgICB2YXIgbGVuID0gdC5sZW5ndGggPj4+IDA7XG5cbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGVuOyBpKyspIHtcbiAgICAgICAgICAgICAgICBpZiAoaSBpbiB0ICYmIGZ1bi5jYWxsKHRoaXMsIHRbaV0sIGksIHQpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGlzVmFsaWQobSkge1xuICAgICAgICBpZiAobS5faXNWYWxpZCA9PSBudWxsKSB7XG4gICAgICAgICAgICB2YXIgZmxhZ3MgPSBnZXRQYXJzaW5nRmxhZ3MobSk7XG4gICAgICAgICAgICB2YXIgcGFyc2VkUGFydHMgPSBzb21lLmNhbGwoZmxhZ3MucGFyc2VkRGF0ZVBhcnRzLCBmdW5jdGlvbiAoaSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBpICE9IG51bGw7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHZhciBpc05vd1ZhbGlkID0gIWlzTmFOKG0uX2QuZ2V0VGltZSgpKSAmJiBmbGFncy5vdmVyZmxvdyA8IDAgJiYgIWZsYWdzLmVtcHR5ICYmICFmbGFncy5pbnZhbGlkTW9udGggJiYgIWZsYWdzLmludmFsaWRXZWVrZGF5ICYmICFmbGFncy53ZWVrZGF5TWlzbWF0Y2ggJiYg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RpZXMgc2hvdWxkIGFsc28gYWRkIHRoZSBrZXkgaGVyZSAobnVsbCB2YWx1ZSksXG4gICAgLy8gc28gd2UgY2FuIHByb3Blcmx5IGNsb25lIG91cnNlbHZlcy5cbiAgICB2YXIgbW9tZW50UHJvcGVydGllcyA9IGhvb2tzLm1vbWVudFByb3BlcnRpZXMgPSBbXTtcblxuICAgIGZ1bmN0aW9uIGNvcHlDb25maWcodG8sIGZyb20pIHtcbiAgICAgICAgdmFyIGksIHByb3AsIHZhbDtcblxuICAgICAgICBpZiAoIWlzVW5kZWZpbmVkKGZyb20uX2lzQU1vbWVudE9iamVjdCkpIHtcbiAgICAgICAgICAgIHRvLl9pc0FNb21lbnRPYmplY3QgPSBmcm9tLl9pc0FNb21lbnRPYmplY3Q7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFpc1VuZGVmaW5lZChmcm9tLl9pKSkge1xuICAgICAgICAgICAgdG8uX2kgPSBmcm9tLl9pO1xuICAgICAgICB9XG4gICAgICAgIGlmICghaXNVbmRlZmluZWQoZnJvbS5fZikpIHtcbiAgICAgICAgICAgIHRvLl9mID0gZnJvbS5fZjtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIWlzVW5kZWZpbmVkKGZyb20uX2wpKSB7XG4gICAgICAgICAgICB0by5fbCA9IGZyb20uX2w7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFpc1VuZGVmaW5lZChmcm9tLl9zdHJpY3QpKSB7XG4gICAgICAgICAgICB0by5fc3RyaWN0ID0gZnJvbS5fc3RyaWN0O1xuICAgICAgICB9XG4gICAgICAgIGlmICghaXNVbmRlZmluZWQoZnJvbS5fdHptKSkge1xuICAgICAgICAgICAgdG8uX3R6bSA9IGZyb20uX3R6bTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIWlzVW5kZWZpbmVkKGZyb20uX2lzVVRDKSkge1xuICAgICAgICAgICAgdG8uX2lzVVRDID0gZnJvbS5faXNVVEM7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFpc1VuZGVmaW5lZChmcm9tLl9vZmZzZXQpKSB7XG4gICAgICAgICAgICB0by5fb2Zmc2V0ID0gZnJvbS5fb2Zmc2V0O1xuICAgICAgICB9XG4gICAgICAgIGlmICghaXNVbmRlZmluZWQoZnJvbS5fcGYpKSB7XG4gICAgICAgICAgICB0by5fcGYgPSBnZXRQYXJzaW5nRmxhZ3MoZnJvbSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFpc1VuZGVmaW5lZChmcm9tLl9sb2NhbGUpKSB7XG4gICAgICAgICAgICB0by5fbG9jYWxlID0gZnJvbS5fbG9jYWxlO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKG1vbWVudFByb3BlcnRpZXMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IG1vbWVudFByb3BlcnRpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBwcm9wID0gbW9tZW50UHJvcGVydGllc1tpXTtcbiAgICAgICAgICAgICAgICB2YWwgPSBmcm9tW3Byb3BdO1xuICAgICAgICAgICAgICAgIGlmICghaXNVbmRlZmluZWQodmFsKSkge1xuICAgICAgICAgICAgICAgICAgICB0b1twcm9wXSA9IHZhbDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdG87XG4gICAgfVxuXG4gICAgdmFyIHVwZGF0ZUluUHJvZ3Jlc3MgPSBmYWxzZTtcblxuICAgIC8vIE1vbWVudCBwcm90b3R5cGUgb2JqZWN0XG4gICAgZnVuY3Rpb24gTW9tZW50KGNvbmZpZykge1xuICAgICAgICBjb3B5Q29uZmlnKHRoaXMsIGNvbmZpZyk7XG4gICAgICAgIHRoaXMuX2QgPSBuZXcgRGF0ZShjb25maWcuX2QgIT0gbnVsbCA/IGNvbmZpZy5fZC5nZXRUaW1lKCkgOiBOYU4pO1xuICAgICAgICBpZiAoIXRoaXMuaXNWYWxpZCgpKSB7XG4gICAgICAgICAgICB0aGlzLl9kID0gbmV3IERhdGUoTmFOKTtcbiAgICAgICAgfVxuICAgICAgICAvLyBQcmV2ZW50IGluZmluaXRlIGxvb3AgaW4gY2FzZSB1cGRhdGVPZmZzZXQgY3JlYXRlcyBuZXcgbW9tZW50XG4gICAgICAgIC8vIG9iamVjdHMuXG4gICAgICAgIGlmICh1cGRhdGVJblByb2dyZXNzID09PSBmYWxzZSkge1xuICAgICAgICAgICAgdXBkYXRlSW5Qcm9ncmVzcyA9IHRydWU7XG4gICAgICAgICAgICBob29rcy51cGRhdGVPZmZzZXQodGhpcyk7XG4gICAgICAgICAgICB1cGRhdGVJblByb2dyZXNzID0gZmFsc2U7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBpc01vbWVudChvYmopIHtcbiAgICAgICAgcmV0dXJuIG9iaiBpbnN0YW5jZW9mIE1vbWVudCB8fCBvYmogIT0gbnVsbCAmJiBvYmouX2lzQU1vbWVudE9iamVjdCAhPSBudWxsO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGFic0Zsb29yKG51bWJlcikge1xuICAgICAgICBpZiAobnVtYmVyIDwgMCkge1xuICAgICAgICAgICAgLy8gLTAgLT4gMFxuICAgICAgICAgICAgcmV0dXJuIE1hdGguY2VpbChudW1iZXIpIHx8IDA7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gTWF0aC5mbG9vcihudW1iZXIpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gdG9JbnQoYXJndW1lbnRGb3JDb2VyY2lvbikge1xuICAgICAgICB2YXIgY29lcmNlZE51bWJlciA9ICthcmd1bWVudEZvckNvZXJjaW9uLFxuICAgICAgICAgICAgdmFsdWUgPSAwO1xuXG4gICAgICAgIGlmIChjb2VyY2VkTnVtYmVyICE9PSAwICYmIGlzRmluaXRlKGNvZXJjZWROdW1iZXIpKSB7XG4gICAgICAgICAgICB2Y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lY2F0ZShtc2csIGZuKSB7XG4gICAgICAgIHZhciBmaXJzdFRpbWUgPSB0cnVlO1xuXG4gICAgICAgIHJldHVybiBleHRlbmQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgaWYgKGhvb2tzLmRlcHJlY2F0aW9uSGFuZGxlciAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgaG9va3MuZGVwcmVjYXRpb25IYW5kbGVyKG51bGwsIG1zZyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoZmlyc3RUaW1lKSB7XG4gICAgICAgICAgICAgICAgdmFyIGFyZ3MgPSBbXTtcbiAgICAgICAgICAgICAgICB2YXIgYXJnO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYXJndW1lbnRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGFyZyA9ICcnO1xuICAgICAgICAgICAgICAgICAgICBpZiAoX3R5cGVvZihhcmd1bWVudHNbaV0pID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgICAgICAgICAgICAgYXJnICs9ICdcXG5bJyArIGkgKyAnXSAnO1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIga2V5IGluIGFyZ3VtZW50c1swXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZyArPSBrZXkgKyAnOiAnICsgYXJndW1lbnRzWzBdW2tleV0gKyAnLCAnO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgYXJnID0gYXJnLnNsaWNlKDAsIC0yKTsgLy8gUmVtb3ZlIHRyYWlsaW5nIGNvbW1hIGFuZCBzcGFjZVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgYXJnID0gYXJndW1lbnRzW2ldO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGFyZ3MucHVzaChhcmcpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB3YXJuKG1zZyArICdcXG5Bcmd1bWVudHM6ICcgKyBBcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbChhcmdzKS5qb2luKCcnKSArICdcXG4nICsgbmV3IEVycm9yKCkuc3RhY2spO1xuICAgICAgICAgICAgICAgIGZpcnN0VGltZSA9IGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGZuLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG4gICAgICAgIH0sIGZuKTtcbiAgICB9XG5cbiAgICB2YXIgZGVwcmVjYXRpb25zID0ge307XG5cbiAgICBmdW5jdGlvbiBkZXByZWNhdGVTaW1wbGUobmFtZSwgbXNnKSB7XG4gICAgICAgIGlmIChob29rcy5kZXByZWNhdGlvbkhhbmRsZXIgIT0gbnVsbCkge1xuICAgICAgICAgICAgaG9va3MuZGVwcmVjYXRpb25IYW5kbGVyKG5hbWUsIG1zZyk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFkZXByZWNhdGlvbnNbbmFtZV0pIHtcbiAgICAgICAgICAgIHdhcm4obXNnKTtcbiAgICAgICAgICAgIGRlcHJlY2F0aW9uc1tuYW1lXSA9IHRydWU7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBob29rcy5zdXBwcmVzc0RlcHJlY2F0aW9uV2FybmluZ3MgPSBmYWxzZTtcbiAgICBob29rcy5kZXByZWNhdGlvbkhhbmRsZXIgPSBudWxsO1xuXG4gICAgZnVuY3Rpb24gaXNGdW5jdGlvbihpbnB1dCkge1xuICAgICAgICByZXR1cm4gaW5wdXQgaW5zdGFuY2VvZiBGdW5jdGlvbiB8fCBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwoaW5wdXQpID09PSAnW29iamVjdCBGdW5jdGlvbl0nO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHNldChjb25maWcpIHtcbiAgICAgICAgdmFyIHByb3AsIGk7XG4gICAgICAgIGZvciAoaSBpbiBjb25maWcpIHtcbiAgICAgICAgICAgIHByb3AgPSBjb25maWdbaV07XG4gICAgICAgICAgICBpZiAoaXNGdW5jdGlvbihwcm9wKSkge1xuICAgICAgICAgICAgICAgIHRoaXNbaV0gPSBwcm9wO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzWydfJyArIGldID0gcHJvcDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0aGlzLl9jb25maWcgPSBjb25maWc7XG4gICAgICAgIC8vIExlbmllbnQgb3JkaW5hbCBwYXJzaW5nIGFjY2VwdHMganVzdCBhIG51bWJlciBpbiBhZGRpdGlvbiB0b1xuICAgICAgICAvLyBudW1iZXIgKyAocG9zc2libHkpIHN0dWZmIGNvbWluZyBmcm9tIF9kYXlPZk1vbnRoT3JkaW5hbFBhcnNlLlxuICAgICAgICAvLyBUT0RPOiBSZW1vdmUgXCJvcmRpbmFsUGFyc2VcIiBmYWxsYmFjayBpbiBuZXh0IG1ham9yIHJlbGVhc2UuXG4gICAgICAgIHRoaXMuX2RheU9mTW9udGhPcmRpbmFsUGFyc2VMZW5pZW50ID0gbmV3IFJlZ0V4cCgodGhpcy5fZGF5T2ZNb250aE9yZGluYWxQYXJzZS5zb3VyY2UgfHwgdGhpcy5fb3JkaW5hbFBhcnNlLnNvdXJjZSkgKyAnfCcgKyAvXFxkezEsMn0vLnNvdXJjZSk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gbWVyZ2VDb25maWdzKHBhcmVudENvbmZpZywgY2hpbGRDb25maWcpIHtcbiAgICAgICAgdmFyIHJlcyA9IGV4dGVuZCh7fSwgcGFyZW50Q29uZmlnKSxcbiAgICAgICAgICAgIHByb3A7XG4gICAgICAgIGZvciAocHJvcCBpbiBjaGlsZENvbmZpZykge1xuICAgICAgICAgICAgaWYgKGhhc093blByb3AoY2hpbGRDb25maWcsIHByb3ApKSB7XG4gICAgICAgICAgICAgICAgaWYgKGlzT2JqZWN0KHBhcmVudENvbmZpZ1twcm9wXSkgJiYgaXNPYmplY3QoY2hpbGRDb25maWdbcHJvcF0pKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc1twcm9wXSA9IHt9O1xuICAgICAgICAgICAgICAgICAgICBleHRlbmQocmVzW3Byb3BdLCBwYXJlbnRDb25maWdbcHJvcF0pO1xuICAgICAgICAgICAgICAgICAgICBleHRlbmQocmVzW3Byb3BdLCBjaGlsZENvbmZpZ1twcm9wXSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaGlsZENvbmZpZ1twcm9wXSAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc1twcm9wXSA9IGNoaWxkQ29uZmlnW3Byb3BdO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSByZXNbcHJvcF07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZvciAocHJvcCBpbiBwYXJlbnRDb25maWcpIHtcbiAgICAgICAgICAgIGlmIChoYXNPd25Qcm9wKHBhcmVudENvbmZpZywgcHJvcCkgJiYgIWhhc093blByb3AoY2hpbGRDb25maWcsIHByb3ApICYmIGlzT2JqZWN0KHBhcmVudENvbmZpZ1twcm9wXSkpIHtcbiAgICAgICAgICAgICAgICAvLyBtYWtlIHN1cmUgY2hhbmdlcyB0byBwcm9wZXJ0aWVzIGRvbid0IG1vZGlmeSBwYXJlbnQgY29uZmlnXG4gICAgICAgICAgICAgICAgcmVzW3Byb3BdID0gZXh0ZW5kKHt9LCByZXNbcHJvcF0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXM7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gTG9jYWxlKGNvbmZpZykge1xuICAgICAgICBpZiAoY29uZmlnICE9IG51bGwpIHtcbiAgICAgICAgICAgIHRoaXMuc2V0KGNvbmZpZyk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICB2YXIga2V5cztcblxuICAgIGlmIChPYmplY3Qua2V5cykge1xuICAgICAgICBrZXlzID0gT2JqZWN0LmtleXM7XG4gICAgfSBlbHNlIHtcbiAgICAgICAga2V5cyA9IGZ1bmN0aW9uIGtleXMob2JqKSB7XG4gICAgICAgICAgICB2YXIgaSxcbiAgICAgICAgICAgICAgICByZXMgPSBbXTtcbiAgICAgICAgICAgIGZvciAoaSBpbiBvYmopIHtcbiAgICAgICAgICAgICAgICBpZiAoaGFzT3duUHJvcChvYmosIGkpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlcy5wdXNoKGkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiByZXM7XG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgdmFyIGRlZmF1bHRDYWxlbmRhciA9IHtcbiAgICAgICAgc2FtZURheTogJ1tUb2RheSBhdF0gTFQnLFxuICAgICAgICBuZXh0RGF5OiAnW1RvbW9ycm93IGF0XSBMVCcsXG4gICAgICAgIG5leHRXZWVrOiAnZGRkZCBbYXRdIExUJyxcbiAgICAgICAgbGFzdERheTogJ1tZZXN0ZXJkYXkgYXRdIExUJyxcbiAgICAgICAgbGFzdFdlZWs6ICdbTGFzdF0gZGRkZCBbYXRdIExUJyxcbiAgICAgICAgc2FtZUVsc2U6ICdMJ1xuICAgIH07XG5cbiAgICBmdW5jdGlvbiBjYWxlbmRhcihrZXksIG1vbSwgbm93KSB7XG4gICAgICAgIHZhciBvdXRwdXQgPSB0aGlzLl9jYWxlbmRhcltrZXldIHx8IHRoaXMuX2NhbGVuZGFyWydzYW1lRWxzZSddO1xuICAgICAgICByZXR1cm4gaXNGdW5jdGlvbihvdXRwdXQpID8gb3V0cHV0LmNhbGwobW9tLCBub3cpIDogb3V0cHV0O1xuICAgIH1cblxuICAgIHZhciBkZWZhdWx0TG9uZ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tub3JtYWxpemVkUHJvcF0gPSBpbnB1dE9iamVjdFtwcm9wXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gbm9ybWFsaXplZElucHV0O1xuICAgIH1cblxuICAgIHZhciBwcmlvcml0aWVzID0ge307XG5cbiAgICBmdW5jdGlvbiBhZGRVbml0UHJpb3JpdHkodW5pdCwgcHJpb3JpdHkpIHtcbiAgICAgICAgcHJpb3JpdGllc1t1bml0XSA9IHByaW9yaXR5O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGdldFByaW9yaXRpemVkVW5pdHModW5pdHNPYmopIHtcbiAgICAgICAgdmFyIHVuaXRzID0gW107XG4gICAgICAgIGZvciAodmFyIHUgaW4gdW5pdHNPYmopIHtcbiAgICAgICAgICAgIHVuaXRzLnB1c2goeyB1bml0OiB1LCBwcmlvcml0eTogcHJpb3JpdGllc1t1XSB9KTtcbiAgICAgICAgfVxuICAgICAgICB1bml0cy5zb3J0KGZ1bmN0aW9uIChhLCBiKSB7XG4gICAgICAgICAgICByZXR1cm4gYS5wcmlvcml0eSAtIGIucHJpb3JpdHk7XG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4gdW5pdHM7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gemVyb0ZpbGwobnVtYmVyLCB0YXJnZXRMZW5ndGgsIGZvcmNlU2lnbikge1xuICAgICAgICB2YXIgYWJzTnVtYmVyID0gJycgKyBNYXRoLmFicyhudW1iZXIpLFxuICAgICAgICAgICAgemVyb3NUb0ZpbGwgPSB0YXJnZXRMZW5ndGggLSBhYnNOdW1iZXIubGVuZ3RoLFxuICAgICAgICAgICAgc2lnbiA9IG51bWJlciA+PSAwO1xuICAgICAgICByZXR1cm4gKHNpZ24gPyBmb3JjZVNpZ24gPyAnKycgOiAnJyA6ICctJykgKyBNYXRoLnBvdygxMCwgTWF0aC5tYXgoMCwgemVyb3NUb0ZpbGwpKS50b1N0c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O1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZ2V0KHRoaXMsIHVuaXQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGdldChtb20sIHVuaXQpIHtcbiAgICAgICAgcmV0dXJuIG1vbS5pc1ZhbGlkKCkgPyBtb20uX2RbJ2dldCcgKyAobW9tLl9pc1VUQyA/ICdVVEMnIDogJycpICsgdW5pdF0oKSA6IE5hTjtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBzZXQkMShtb20sIHVuaXQsIHZhbHVlKSB7XG4gICAgICAgIGlmIChtb20uaXNWYWxpZCgpICYmICFpc05hTih2YWx1ZSkpIHtcbiAgICAgICAgICAgIGlmICh1bml0ID09PSAnRnVsbFllYXInICYmIGlzTGVhcFllYXIobW9tLnllYXIoKSkpIHtcbiAgICAgICAgICAgICAgICBtb20uX2RbJ3NldCcgKyAobW9tLl9pc1VUQyA/ICdVVEMnIDogJycpICsgdW5pdF0odmFsdWUsIG1vbS5tb250aCgpLCBkYXlzSW5Nb250aCh2YWx1ZSwgbW9tLm1vbnRoKCkpKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbW9tLl9kWydzZXQnICsgKG1vbS5faXNVVEMgPyAnVVRDJyA6ICcnKSArIHVuaXRdKHZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8vIE1PTUVOVFNcblxuICAgIGZ1bmN0aW9uIHN0cmluZ0dldCh1bml0cykge1xuICAgICAgICB1bml0cyA9IG5vcm1hbGl6ZVVuaXRzKHVuaXRzKTtcbiAgICAgICAgaWYgKGlzRnVuY3Rpb24odGhpc1t1bml0c10pKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpc1t1bml0c10oKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBzdHJpbmdTZXQodW5pdHMsIHZhbHVlKSB7XG4gICAgICAgIGlmICgodHlwZW9mIHVuaXRzID09PSAndW5kZWZpbmVkJyA/ICd1bmRlZmluZWQnIDogX3R5cGVvZih1bml0cykpID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgdW5pdHMgPSBub3JtYWxpemVPYmplY3RVbml0cyh1bml0cyk7XG4gICAgICAgICAgICB2YXIgcHJpb3JpdGl6ZWQgPSBnZXRQcmlvcml0aXplZFVuaXRzKHVuaXRzKTtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgcHJpb3JpdGl6ZWQubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICB0aGlzW3ByaW9yaXRpemVkW2ldLnVuaXRdKHVuaXRzW3ByaW9yaXRpemVkW2ldLnVuaXRdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHVuaXRzID0gbm9ybWFsaXplVW5pdHModW5pdHMpO1xuICAgICAgICAgICAgaWYgKGlzRnVuY3Rpb24odGhpc1t1bml0c10pKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXNbdW5pdHNdKHZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBtb2QobiwgeCkge1xuICAgICAgICByZXR1cm4gKG4gJSB4ICsgeCkgJSB4O1xuICAgIH1cblxuICAgIHZhciBpbmRleE9mO1xuXG4gICAgaWYgKEFycmF5LnByb3RvdHlwZS5pbmRleE9mKSB7XG4gICAgICAgIGluZGV4T2YgPSBBcnJheS5wcm90b3R5cGUuaW5kZXhPZjtcbiAgICB9IGVsc2Uge1xuICAgICAgICBpbmRleE9mID0gZnVuY3Rpb24gaW5kZXhPZihvKSB7XG4gICAgICAgICAgICAvLyBJIGtub3dcbiAgICAgICAgICAgIHZhciBpO1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHRoaXMubGVuZ3RoOyArK2kpIHtcbiAgICAgICAgICAgICAgICBpZiAodGhpc1tpXSA9PT0gbykge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gLTE7XG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZGF5c0luTW9udGgoeWVhciwgbW9udGgpIHtcbiAgICAgICAgaWYgKGlzTmFOKHllYXIpIHx8IGlzTmFOKG1vbnRoKSkge1xuICAgICAgICAgICAgcmV0dXJuIE5hTjtcbiAgICAgICAgfVxuICAgICAgICB2YXIgbW9kTW9udGggPSBtb2QobW9udGgsIDEyKTtcbiAgICAgICAgeWVhciArPSAobW9udGggLSBtb2RNb250aCkgLyAxMjtcbiAgICAgICAgcmV0dXJuIG1vZE1vbnRoID09PSAxID8gaXNMZWFwWWVhcih5ZWFyKSA/IDI5IDogMjggOiAzMSAtIG1vZE1vbnRoICUgNyAlIDI7XG4gICAgfVxuXG4gICAgLy8gRk9STUFUVElOR1xuXG4gICAgYWRkRm9ybWF0VG9rZW4oJ00nLCBbJ01NJywgMl0sICdNbycsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubW9udGgoKSArIDE7XG4gICAgfSk7XG5cbiAgICBhZGRGb3JtYXRUb2tlbignTU1NJywgMCwgMCwgZnVuY3Rpb24gKGZvcm1hdCkge1xuICAgICAgICByZXR1cm4gdGhpcy5sb2NhbGVEYXRhKCkubW9udGhzU2hvcnQodGhpcywgZm9ybWF0KTtcbiAgICB9KTtcblxuICAgIGFkZEZvcm1hdFRva2VuKCdNTU1NJywgMCwgMCwgZnVuY3Rpb24gKGZvcm1hdCkge1xuICAgICAgICByZXR1cm4gdGhpcy5sb2NhbGVEYXRhKCkubW9udGhz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1vbnRoc1Nob3J0KG0sIGZvcm1hdCkge1xuICAgICAgICBpZiAoIW0pIHtcbiAgICAgICAgICAgIHJldHVybiBpc0FycmF5KHRoaXMuX21vbnRoc1Nob3J0KSA/IHRoaXMuX21vbnRoc1Nob3J0IDogdGhpcy5fbW9udGhzU2hvcnRbJ3N0YW5kYWxvbmUnXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gaXNBcnJheSh0aGlzLl9tb250aHNTaG9ydCkgPyB0aGlzLl9tb250aHNTaG9ydFttLm1vbnRoKCldIDogdGhpcy5fbW9udGhzU2hvcnRbTU9OVEhTX0lOX0ZPUk1BVC50ZXN0KGZvcm1hdCkgPyAnZm9ybWF0JyA6ICdzdGFuZGFsb25lJ11bbS5tb250aCgpXTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBoYW5kbGVTdHJpY3RQYXJzZShtb250aE5hbWUsIGZvcm1hdCwgc3RyaWN0KSB7XG4gICAgICAgIHZhciBpLFxuICAgICAgICAgICAgaWksXG4gICAgICAgICAgICBtb20sXG4gICAgICAgICAgICBsbGMgPSBtb250aE5hbWUudG9Mb2NhbGVMb3dlckNhc2UoKTtcbiAgICAgICAgaWYgKCF0aGlzLl9tb250aHNQYXJzZSkge1xuICAgICAgICAgICAgLy8gdGhpcyBpcyBub3QgdXNlZFxuICAgICAgICAgICAgdGhpcy5fbW9udGhzUGFyc2UgPSBbXTtcbiAgICAgICAgICAgIHRoaXMuX2xvbmdNb250aHNQYXJzZSA9IFtdO1xuICAgICAgICAgICAgdGhpcy5fc2hvcnRNb250aHNQYXJzZSA9IFtdO1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDEyOyArK2kpIHtcbiAgICAgICAgICAgICAgICBtb20gPSBjcmVhdGVVVEMoWzIwMDAsIGldKTtcbiAgICAgICAgICAgICAgICB0aGlzLl9zaG9ydE1vbnRoc1BhcnNlW2ldID0gdGhpcy5tb250aHNTaG9ydChtb20sICcnKS50b0xvY2FsZUxvd2VyQ2FzZSgpO1xuICAgICAgICAgICAgICAgIHRoaXMuX2xvbmdNb250aHNQYXJzZVtpXSA9IHRoaXMubW9udGhzKG1vbSwgJycpLnRvTG9jYWxlTG93ZXJDYXNlKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoc3RyaWN0KSB7XG4gICAgICAgICAgICBpZiAoZm9ybWF0ID09PSAnTU1NJykge1xuICAgICAgICAgICAgICAgIGlpID0gaW5kZXhPZi5jYWxsKHRoaXMuX3Nob3J0TW9udGhzUGFyc2UsIGxsYyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlpICE9PSAtMSA/IGlpIDogbnVsbDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWkgPSBpbmRleE9mLmNhbGwodGhpcy5fbG9uZ01vbnRoc1BhcnNlLCBsbGMpO1xuICAgICAgICAgICAgICAgIHJldHVybiBpaSAhPT0gLTEgPyBpaSA6IG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoZm9ybWF0ID09PSAnTU1NJykge1xuICAgICAgICAgICAgICAgIGlpID0gaW5kZXhPZi5jYWxsKHRoaXMuX3Nob3J0TW9udGhzUGFyc2UsIGxsYyk7XG4gICAgICAgICAgICAgICAgaWYgKGlpICE9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaWk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlpID0gaW5kZXhPZi5jYWxsKHRoaXMuX2xvbmdNb250aHNQYXJzZSwgbGxjKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gaWkgIT09IC0xID8gaWkgOiBudWxsO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpaSA9IGluZGV4T2YuY2FsbCh0aGlzLl9sb25nTW9udGhzUGFyc2UsIGxsYyk7XG4gICAgICAgICAgICAgICAgaWYgKGlpIC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ICAgICAgICAgICAgbW9tID0gY3JlYXRlVVRDKFsyMDAwLCBpXSk7XG4gICAgICAgICAgICBpZiAoc3RyaWN0ICYmICF0aGlzLl9sb25nTW9udGhzUGFyc2VbaV0pIHtcbiAgICAgICAgICAgICAgICB0aGlzLl9sb25nTW9udGhzUGFyc2VbaV0gPSBuZXcgUmVnRXhwKCdeJyArIHRoaXMubW9udGhzKG1vbSwgJycpLnJlcGxhY2UoJy4nLCAnJykgKyAnJCcsICdpJyk7XG4gICAgICAgICAgICAgICAgdGhpcy5fc2hvcnRNb250aHNQYXJzZVtpXSA9IG5ldyBSZWdFeHAoJ14nICsgdGhpcy5tb250aHNTaG9ydChtb20sICcnKS5yZXBsYWNlKCcuJywgJycpICsgJyQnLCAnaScpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCFzdHJpY3QgJiYgIXRoaXMuX21vbnRoc1BhcnNlW2ldKSB7XG4gICAgICAgICAgICAgICAgcmVnZXggPSAnXicgKyB0aGlzLm1vbnRocyhtb20sICcnKSArICd8XicgKyB0aGlzLm1vbnRoc1Nob3J0KG1vbSwgJycpO1xuICAgICAgICAgICAgICAgIHRoaXMuX21vbnRoc1BhcnNlW2ldID0gbmV3IFJlZ0V4cChyZWdleC5yZXBsYWNlKCcuJywgJycpLCAnaScpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gdGVzdCB0aGUgcmVnZXhcbiAgICAgICAgICAgIGlmIChzdHJpY3QgJiYgZm9ybWF0ID09PSAnTU1NTScgJiYgdGhpcy5fbG9uZ01vbnRoc1BhcnNlW2ldLnRlc3QobW9udGhOYW1lKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChzdHJpY3QgJiYgZm9ybWF0ID09PSAnTU1NJyAmJiB0aGlzLl9zaG9ydE1vbnRoc1BhcnNlW2ldLnRlc3QobW9udGhOYW1lKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBpO1xuICAgICAgICAgICAgfSBlbHNlIGlmICghc3RyaWN0ICYmIHRoaXMuX21vbnRoc1BhcnNlW2ldLnRlc3QobW9udGhOYW1lKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gTU9NRU5UU1xuXG4gICAgZnVuY3Rpb24gc2V0TW9udGgobW9tLCB2YWx1ZSkge1xuICAgICAgICB2YXIgZGF5T2ZNb250aDtcblxuICAgICAgICBpZiAoIW1vbS5pc1ZhbGlkKCkpIHtcbiAgICAgICAgICAgIC8vIE5vIG9wXG4gICAgICAgICAgICByZXR1cm4gbW9tO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHR5cGVvZiB2YWx1ZSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIGlmICgvXlxcZCskLy50ZXN0KHZhbHVlKSkge1xuICAgICAgICAgICAgICAgIHZhbHVlID0gdG9JbnQodmFsdWUpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IG1vbS5sb2NhbGVEYXRhKCkubW9udGhzUGFyc2UodmFsdWUpO1xuICAgICAgICAgICAgICAgIC8vIFRPRE86IEFub3RoZXIgc2lsZW50IGZhaWx1cmU/XG4gICAgICAgICAgICAgICAgaWYgKCFpc051bWJlcih2YWx1ZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1vbTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBkYXlPZk1vbnRoID0gTWF0aC5taW4obW9tLmRhdGUoKSwgZGF5c0luTW9udGgobW9tLnllYXIoKSwgdmFsdWUpKTtcbiAgICAgICAgbW9tLl9kWydzZXQnICsgKG1vbS5faXNVVEMgPyAnVVRDJyA6ICcnKSArICdNb250aCddKHZhbHVlLCBkYXlPZk1vbnRoKTtcbiAgICAgICAgcmV0dXJuIG1vbTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBnZXRTZXRNb250aCh2YWx1ZSkge1xuICAgICAgICBpZiAodmFsdWUgIT0gbnVsbCkge1xuICAgICAgICAgICAgc2V0TW9udGgodGhpcywgdmFsdWUpO1xuICAgICAgICAgICAgaG9va3MudXBkYXRlT2Zmc2V0KHRoaXMsIHRydWUpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gZ2V0KHRoaXMsICdNb250aCcpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZ2V0RGF5c0luTW9udGgoKSB7XG4gICAgICAgIHJldHVybiBkYXlzSW5Nb250aCh0aGlzLnllYXIoKSwgdGhpcy5tb250aCgpKTtcbiAgICB9XG5cbiAgICB2YXIgZGVmYXVsdE1vbnRoc1Nob3J0UmVnZXggPSBtYXRjaFdvcmQ7XG4gICAgZnVuY3Rpb24gbW9udGhzU2hvcnRSZWdleChpc1N0cmljdCkge1xuICAgICAgICBpZiAodGhpcy5fbW9udGhzUGFyc2VFeGFjdCkge1xuICAgICAgICAgICAgaWYgKCFoYXNPd25Qcm9wKHRoaXMsICdfbW9udGhzUmVnZXgnKSkge1xuICAgICAgICAgICAgICAgIGNvbXB1dGVNb250aHNQYXJzZS5jYWxsKHRoaXMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGlzU3RyaWN0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX21vbnRoc1Nob3J0U3RyaWN0UmVnZXg7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLl9tb250aHNTaG9ydFJlZ2V4O1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKCFoYXNPd25Qcm9wKHRoaXMsICdfbW9udGhzU2hvcnRSZWdleCcpKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fbW9udGhzU2hvcnRSZWdleCA9IGRlZmF1bHRNb250aHNTaG9ydFJlZ2V4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX21vbnRoc1Nob3J0U3RyaWN0UmVnZXggJiYgaXNTdHJpY3QgPyB0aGlzLl9tb250aHNTaG9ydFN0cmljdFJlZ2V4IDogdGhpcy5fbW9udGhzU2hvcnRSZWdleDtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHZhciBkZWZhdWx0TW9udGhzUmVnZXggPSBtYXRjaFdvcmQ7XG4gICAgZnVuY3Rpb24gbW9udGhzUmVnZXgoaXNTdHJpY3QpIHtcbiAgICAgICAgaWYgKHRoaXMuX21vbnRoc1BhcnNlRXhhY3QpIHtcbiAgICAgICAgICAgIGlmICghaGFzT3duUHJvcCh0aGlzLCAnX21vbnRoc1JlZ2V4JykpIHtcbiAgICAgICAgICAgICAgICBjb21wdXRlTW9udGhzUGFyc2UuY2FsbCh0aGlzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChpc1N0cmljdCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLl9tb250aHNTdHJpY3RSZWdleDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX21vbnRoc1JlZ2V4O1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKCFoYXNPd25Qcm9wKHRoaXMsICdfbW9udGhzUmVnZXgnKSkge1xuICAgICAgICAgICAgICAgIHRoaXMuX21vbnRoc1JlZ2V4ID0gZGVmYXVsdE1vbnRoc1JlZ2V4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX21vbnRoc1N0cmljdFJlZ2V4ICYmIGlzU3RyaWN0ID8gdGhpcy5fbW9udGhzU3RyaWN0UmVnZXggOiB0aGlzLl9tb250aHNSZWdleDtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGNvbXB1dGVNb250aHNQYXJzZSgpIHtcbiAgICAgICAgZnVuY3Rpb24gY21wTGVuUmV2KGEsIGIpIHtcbiAgICAgICAgICAgIHJldHVybiBiLmxlbmd0aCAtIGEubGVuZ3RoO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIHNob3J0UGllY2VzID0gW10sXG4gICAgICAgICAgICBsb25nUGllY2VzID0gW10sXG4gICAgICAgICAgICBtaXhlZFBpZWNlcyA9IFtdLFxuICAgICAgICAgICAgaSxcbiAgICAgICAgICAgIG1vbTtcbiAgICAgICAgZm9yIChpID0gMDsgaSA8IDEyOyBpKyspIHtcbiAgICAgICAgICAgIC8vIG1ha2UgdGhlIHJlZ2V4IGlmIHdlIGRvbid0IGhhdmUgaXQgYWxyZWFkeVxuICAgICAgICAgICAgbW9tID0gY3JlYXRlVVRDKFsyMDAwLCBpXSk7XG4gICAgICAgICAgICBzaG9ydFBpZWNlcy5wdXNoKHRoaXMubW9udGhzU2hvcnQobW9tLCAnJykpO1xuICAgICAgICAgICAgbG9uZ1BpZWNlcy5wdXNoKHRoaXMubW9udGhzKG1vbSwgJycpKTtcbiAgICAgICAgICAgIG1peGVkUGllY2VzLnB1c2godGhpcy5tb250aHMobW9tLCAnJykpO1xuICAgICAgICAgICAgbWl4ZWRQaWVjZXMucHVzaCh0aGlzLm1vbnRoc1Nob3J0KG1vbSwgJycpKTtcbiAgICAgICAgfVxuICAgICAgICAvLyBTb3J0aW5nIG1ha2VzIHN1cmUgaWYgb25lIG1vbnRoIChvciBhYmJyKSBpcyBhIHByZWZpeCBvZiBhbm90aGVyIGl0XG4gICAgICAgIC8vIHdpbGwgbWF0Y2ggdGhlIGxvbmdlciBwaWVjZS5cbiAgICAgICAgc2hvcnRQaWVjZXMuc29ydChjbXBMZW5SZXYpO1xuICAgICAgICBsb25nUGllY2VzLnNvcnQoY21wTGVuUmV2KTtcbiAgICAgICAgbW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AgICAgICByZXNEYXlPZlllYXIgPSBkYXlPZlllYXI7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgeWVhcjogcmVzWWVhcixcbiAgICAgICAgICAgIGRheU9mWWVhcjogcmVzRGF5T2ZZZWFyXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gd2Vla09mWWVhcihtb20sIGRvdywgZG95KSB7XG4gICAgICAgIHZhciB3ZWVrT2Zmc2V0ID0gZmlyc3RXZWVrT2Zmc2V0KG1vbS55ZWFyKCksIGRvdywgZG95KSxcbiAgICAgICAgICAgIHdlZWsgPSBNYXRoLmZsb29yKChtb20uZGF5T2ZZZWFyKCkgLSB3ZWVrT2Zmc2V0IC0gMSkgLyA3KSArIDEsXG4gICAgICAgICAgICByZXNXZWVrLFxuICAgICAgICAgICAgcmVzWWVhcjtcblxuICAgICAgICBpZiAod2VlayA8IDEpIHtcbiAgICAgICAgICAgIHJlc1llYXIgPSBtb20ueWVhcigpIC0gMTtcbiAgICAgICAgICAgIHJlc1dlZWsgPSB3ZWVrICsgd2Vla3NJblllYXIocmVzWWVhciwgZG93LCBkb3kpO1xuICAgICAgICB9IGVsc2UgaWYgKHdlZWsgPiB3ZWVrc0luWWVhcihtb20ueWVhcigpLCBkb3csIGRveSkpIHtcbiAgICAgICAgICAgIHJlc1dlZWsgPSB3ZWVrIC0gd2Vla3NJblllYXIobW9tLnllYXIoKSwgZG93LCBkb3kpO1xuICAgICAgICAgICAgcmVzWWVhciA9IG1vbS55ZWFyKCkgKyAxO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmVzWWVhciA9IG1vbS55ZWFyKCk7XG4gICAgICAgICAgICByZXNXZWVrID0gd2VlaztcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICB3ZWVrOiByZXNXZWVrLFxuICAgICAgICAgICAgeWVhcjogcmVzWWVhclxuICAgICAgICB9O1xuICAgIH1cbl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GwodGhpcy5fd2Vla2RheXNQYXJzZSwgbGxjKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gaWkgIT09IC0xID8gaWkgOiBudWxsO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChmb3JtYXQgPT09ICdkZGQnKSB7XG4gICAgICAgICAgICAgICAgaWkgPSBpbmRleE9mLmNhbGwodGhpcy5fc2hvcnRXZWVrZGF5c1BhcnNlLCBsbGMpO1xuICAgICAgICAgICAgICAgIHJldHVybiBpaSAhPT0gLTEgPyBpaSA6IG51bGw7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlpID0gaW5kZXhPZi5jYWxsKHRoaXMuX21pbldlZWtkYXlzUGFyc2UsIGxsYyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlpICE9PSAtMSA/IGlpIDogbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmIChmb3JtYXQgPT09ICdkZGRkJykge1xuICAgICAgICAgICAgICAgIGlpID0gaW5kZXhPZi5jYWxsKHRoaXMuX3dlZWtkYXlzUGFyc2UsIGxsYyk7XG4gICAgICAgICAgICAgICAgaWYgKGlpICE9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaWk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlpID0gaW5kZXhPZi5jYWxsKHRoaXMuX3Nob3J0V2Vla2RheXNQYXJzZSwgbGxjKTtcbiAgICAgICAgICAgICAgICBpZiAoaWkgIT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBpaTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWkgPSBpbmRleE9mLmNhbGwodGhpcy5fbWluV2Vla2RheXNQYXJzZSwgbGxjKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gaWkgIT09IC0xID8gaWkgOiBudWxsO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChmb3JtYXQgPT09ICdkZGQnKSB7XG4gICAgICAgICAgICAgICAgaWkgPSBpbmRleE9mLmNhbGwodGhpcy5fc2hvcnRXZWVrZGF5c1BhcnNlLCBsbGMpO1xuICAgICAgICAgICAgICAgIGlmIChpaSAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGlpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpaSA9IGluZGV4T2YuY2FsbCh0aGlzLl93ZWVrZGF5c1BhcnNlLCBsbGMpO1xuICAgICAgICAgICAgICAgIGlmIChpaSAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGlpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpaSA9IGluZGV4T2YuY2FsbCh0aGlzLl9taW5XZWVrZGF5c1BhcnNlLCBsbGMpO1xuICAgICAgICAgICAgICAgIHJldHVybiBpaSAhPT0gLTEgPyBpaSA6IG51bGw7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlpID0gaW5kZXhPZi5jYWxsKHRoaXMuX21pbldlZWtkYXlzUGFyc2UsIGxsYyk7XG4gICAgICAgICAgICAgICAgaWYgKGlpICE9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaWk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlpID0gaW5kZXhPZi5jYWxsKHRoaXMuX3dlZWtkYXlzUGFyc2UsIGxsYyk7XG4gICAgICAgICAgICAgICAgaWYgKGlpICE9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaWk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlpID0gaW5kZXhPZi5jYWxsKHRoaXMuX3Nob3J0V2Vla2RheXNQYXJzZSwgbGxjKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gaWkgIT09IC0xID8gaWkgOiBudWxsO1xuICAgIC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F5c1JlZ2V4JykpIHtcbiAgICAgICAgICAgICAgICBjb21wdXRlV2Vla2RheXNQYXJzZS5jYWxsKHRoaXMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGlzU3RyaWN0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3dlZWtkYXlzU3RyaWN0UmVnZXg7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLl93ZWVrZGF5c1JlZ2V4O1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKCFoYXNPd25Qcm9wKHRoaXMsICdfd2Vla2RheXNSZWdleCcpKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fd2Vla2RheXNSZWdleCA9IGRlZmF1bHRXZWVrZGF5c1JlZ2V4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3dlZWtkYXlzU3RyaWN0UmVnZXggJiYgaXNTdHJpY3QgPyB0aGlzLl93ZWVrZGF5c1N0cmljdFJlZ2V4IDogdGhpcy5fd2Vla2RheXNSZWdleDtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHZhciBkZWZhdWx0V2Vla2RheXNTaG9ydFJlZ2V4ID0gbWF0Y2hXb3JkO1xuICAgIGZ1bmN0aW9uIHdlZWtkYXlzU2hvcnRSZWdleChpc1N0cmljdCkge1xuICAgICAgICBpZiAodGhpcy5fd2Vla2RheXNQYXJzZUV4YWN0KSB7XG4gICAgICAgICAgICBpZiAoIWhhc093blByb3AodGhpcywgJ193ZWVrZGF5c1JlZ2V4JykpIHtcbiAgICAgICAgICAgICAgICBjb21wdXRlV2Vla2RheXNQYXJzZS5jYWxsKHRoaXMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGlzU3RyaWN0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3dlZWtkYXlzU2hvcnRTdHJpY3RSZWdleDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3dlZWtkYXlzU2hvcnRSZWdleDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmICghaGFzT3duUHJvcCh0aGlzLCAnX3dlZWtkYXlzU2hvcnRSZWdleCcpKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fd2Vla2RheXNTaG9ydFJlZ2V4ID0gZGVmYXVsdFdlZWtkYXlzU2hvcnRSZWdleDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzLl93ZWVrZGF5c1Nob3J0U3RyaWN0UmVnZXggJiYgaXNTdHJpY3QgPyB0aGlzLl93ZWVrZGF5c1Nob3J0U3RyaWN0UmVnZXggOiB0aGlzLl93ZWVrZGF5c1Nob3J0UmVnZXg7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICB2YXIgZGVmYXVsdFdlZWtkYXlzTWluUmVnZXggPSBtYXRjaFdvcmQ7XG4gICAgZnVuY3Rpb24gd2Vla2RheXNNaW5SZWdleChpc1N0cmljdCkge1xuICAgICAgICBpZiAodGhpcy5fd2Vla2RheXNQYXJzZUV4YWN0KSB7XG4gICAgICAgICAgICBpZiAoIWhhc093blByb3AodGhpcywgJ193ZWVrZGF5c1JlZ2V4JykpIHtcbiAgICAgICAgICAgICAgICBjb21wdXRlV2Vla2RheXNQYXJzZS5jYWxsKHRoaXMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGlzU3RyaWN0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3dlZWtkYXlzTWluU3RyaWN0UmVnZXg7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLl93ZWVrZGF5c01pblJlZ2V4O1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKCFoYXNPd25Qcm9wKHRoaXMsICdfd2Vla2RheXNNaW5SZWdleCcpKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fd2Vla2RheXNNaW5SZWdleCA9IGRlZmF1bHRXZWVrZGF5c01pblJlZ2V4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3dlZWtkYXlzTWluU3RyaWN0UmVnZXggJiYgaXNTdHJpY3QgPyB0aGlzLl93ZWVrZGF5c01pblN0cmljdFJlZ2V4IDogdGhpcy5fd2Vla2RheXNNaW5SZWdleDtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGNvbXB1dGVXZWVrZGF5c1BhcnNlKCkge1xuICAgICAgICBmdW5jdGlvbiBjbXBMZW5SZXYoYSwgYikge1xuICAgICAgICAgICAgcmV0dXJuIGIubGVuZ3RoIC0gYS5sZW5ndGg7XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgbWluUGllY2VzID0gW10sXG4gICAgICAgICAgICBzaG9ydFBpZWNlcyA9IFtdLFxuICAgICAgICAgICAgbG9uZ1BpZWNlcyA9IFtdLFxuICAgICAgICAgICAgbWl4ZWRQaWVjZXMgPSBbXSxcbiAgICAgICAgICAgIGksXG4gICAgICAgICAgICBtb20sXG4gICAgICAgICAgICBtaW5wLFxuICAgICAgICAgICAgc2hvcnRwLFxuICAgICAgICAgICAgbG9uZ3A7XG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCA3OyBpKyspIHtcbiAgICAgICAgICAgIC8vIG1ha2UgdGhlIHJlZ2V4IGlmIHdlIGRvbid0IGhhdmUgaXQgYWxyZWFkeVxuICAgICAgICAgICAgbW9tID0gY3JlYXRlVVRDKFsyMDAwLCAxXSkuZGF5KGkpO1xuICAgICAgICAgICAgbWlucCA9IHRoaXMud2Vla2RheXNNaW4obW9tLCAnJyk7XG4gICAgICAgICAgICBzaG9ydHAgPSB0aGlzLndlZWtkYXlzU2hvcnQobW9tLCAnJyk7XG4gICAgICAgICAgICBsb25ncCA9IHRoaXMud2Vla2RheXMobW9tLCAnJyk7XG4gICAgICAgICAgICBtaW5QaWVjZXMucHVzaChtaW5wKTtcbiAgICAgICAgICAgIHNob3J0UGllY2VzLnB1c2goc2hvcnRwKTtcbiAgICAgICAgICAgIGxvbmdQaWVjZXMucHVzaChsb25ncCk7XG4gICAgICAgICAgICBtaXhlZFBpZWNlcy5wdXNoKG1pbnApO1xuICAgICAgICAgICAgbWl4ZWRQaWVjZXMucHVzaChzaG9ydHApO1xuICAgICAgICAgICAgbWl4ZWRQaWVjZXMucHVzaChsb25ncCk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gU29ydGluZyBtYWtlcyBzdXJlIGlmIG9uZSB3ZWVrZGF5IChvciBhYmJyKSBpcyBhIHByZWZpeCBvZiBhbm90aGVyIGl0XG4gICAgICAgIC8vIHdpbGwgbWF0Y2ggdGhlIGxvbmdlciBwaWVjZS5cbiAgICAgICAgbWluUGllY2VzLnNvcnQoY21wTGVuUmV2KTtcbiAgICAgICAgc2hvcnRQaWVjZXMuc29ydChjbXBMZW5SZXYpO1xuICAgICAgICBsb25nUGllY2VzLnNvcnQoY21wTGVuUmV2KTtcbiAgICAgICAgbWl4ZWRQaWVjZXMuc29ydChjbXBMZW5SZXYpO1xuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNzsgaSsrKSB7XG4gICAgICAgICAgICBzaG9ydFBpZWNlc1tpXSA9IHJlZ2V4RXNjYXBlKHNob3J0UGllY2VzW2ldKTtcbiAgICAgICAgICAgIGxvbmdQaWVjZXNbaV0gPSByZWdleEVzY2FwZShsb25nUGllY2VzW2ldKTtcbiAgICAgICAgICAgIG1peGVkUGllY2VzW2ldID0gcmVnZXhFc2NhcGUobWl4ZWRQaWVjZXNbaV0pO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5fd2Vla2RheXNSZWdleCA9IG5ldyBSZWdFeHAoJ14oJyArIG1peGVkUGllY2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Ly8gbm8gYXJndW1lbnRzIGFyZSBwYXNzZWQgaW4sIGl0IHdpbGwgc2ltcGx5IHJldHVybiB0aGUgY3VycmVudCBnbG9iYWxcbiAgICAvLyBsb2NhbGUga2V5LlxuICAgIGZ1bmN0aW9uIGdldFNldEdsb2JhbExvY2FsZShrZXksIHZhbHVlcykge1xuICAgICAgICB2YXIgZGF0YTtcbiAgICAgICAgaWYgKGtleSkge1xuICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKHZhbHVlcykpIHtcbiAgICAgICAgICAgICAgICBkYXRhID0gZ2V0TG9jYWxlKGtleSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGRhdGEgPSBkZWZpbmVMb2NhbGUoa2V5LCB2YWx1ZXMpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoZGF0YSkge1xuICAgICAgICAgICAgICAgIC8vIG1vbWVudC5kdXJhdGlvbi5fbG9jYWxlID0gbW9tZW50Ll9sb2NhbGUgPSBkYXRhO1xuICAgICAgICAgICAgICAgIGdsb2JhbExvY2FsZSA9IGRhdGE7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gZ2xvYmFsTG9jYWxlLl9hYmJyO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGRlZmluZUxvY2FsZShuYW1lLCBjb25maWcpIHtcbiAgICAgICAgaWYgKGNvbmZpZyAhPT0gbnVsbCkge1xuICAgICAgICAgICAgdmFyIHBhcmVudENvbmZpZyA9IGJhc2VDb25maWc7XG4gICAgICAgICAgICBjb25maWcuYWJiciA9IG5hbWU7XG4gICAgICAgICAgICBpZiAobG9jYWxlc1tuYW1lXSAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgZGVwcmVjYXRlU2ltcGxlKCdkZWZpbmVMb2NhbGVPdmVycmlkZScsICd1c2UgbW9tZW50LnVwZGF0ZUxvY2FsZShsb2NhbGVOYW1lLCBjb25maWcpIHRvIGNoYW5nZSAnICsgJ2FuIGV4aXN0aW5nIGxvY2FsZS4gbW9tZW50LmRlZmluZUxvY2FsZShsb2NhbGVOYW1lLCAnICsgJ2NvbmZpZykgc2hvdWxkIG9ubHkgYmUgdXNlZCBmb3IgY3JlYXRpbmcgYSBuZXcgbG9jYWxlICcgKyAnU2VlIGh0dHA6Ly9tb21lbnRqcy5jb20vZ3VpZGVzLyMvd2FybmluZ3MvZGVmaW5lLWxvY2FsZS8gZm9yIG1vcmUgaW5mby4nKTtcbiAgICAgICAgICAgICAgICBwYXJlbnRDb25maWcgPSBsb2NhbGVzW25hbWVdLl9jb25maWc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNvbmZpZy5wYXJlbnRMb2NhbGUgIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIGlmIChsb2NhbGVzW2NvbmZpZy5wYXJlbnRMb2NhbGVdICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgcGFyZW50Q29uZmlnID0gbG9jYWxlc1tjb25maWcucGFyZW50TG9jYWxlXS5fY29uZmlnO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghbG9jYWxlRmFtaWxpZXNbY29uZmlnLnBhcmVudExvY2FsZV0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvY2FsZUZhbWlsaWVzW2NvbmZpZy5wYXJlbnRMb2NhbGVdID0gW107XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgbG9jYWxlRmFtaWxpZXNbY29uZmlnLnBhcmVudExvY2FsZV0ucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBuYW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnOiBjb25maWdcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxvY2FsZXNbbmFtZV0gPSBuZXcgTG9jYWxlKG1lcmdlQ29uZmlncyhwYXJlbnRDb25maWcsIGNvbmZpZykpO1xuXG4gICAgICAgICAgICBpZiAobG9jYWxlRmFtaWxpZXNbbmFtZV0pIHtcbiAgICAgICAgICAgICAgICBsb2NhbGVGYW1pbGllc1tuYW1lXS5mb3JFYWNoKGZ1bmN0aW9uICh4KSB7XG4gICAgICAgICAgICAgICAgICAgIGRlZmluZUxvY2FsZSh4Lm5hbWUsIHguY29uZmlnKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gYmFja3dhcmRzIGNvbXBhdCBmb3Igbm93OiBhbHNvIHNldCB0aGUgbG9jYWxlXG4gICAgICAgICAgICAvLyBtYWtlIHN1cmUgd2Ugc2V0IHRoZSBsb2NhbGUgQUZURVIgYWxsIGNoaWxkIGxvY2FsZXMgaGF2ZSBiZWVuXG4gICAgICAgICAgICAvLyBjcmVhdGVkLCBzbyB3ZSB3b24ndCBlbmQgdXAgd2l0aCB0aGUgY2hpbGQgbG9jYWxlIHNldC5cbiAgICAgICAgICAgIGdldFNldEdsb2JhbExvY2FsZShuYW1lKTtcblxuICAgICAgICAgICAgcmV0dXJuIGxvY2FsZXNbbmFtZV07XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvLyB1c2VmdWwgZm9yIHRlc3RpbmdcbiAgICAgICAgICAgIGRlbGV0ZSBsb2NhbGVzW25hbWVdO1xuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiB1cGRhdGVMb2NhbGUobmFtZSwgY29uZmlnKSB7XG4gICAgICAgIGlmIChjb25maWcgIT0gbnVsbCkge1xuICAgICAgICAgICAgdmFyIGxvY2FsZSxcbiAgICAgICAgICAgICAgICBwYXJlbnRDb25maWcgPSBiYXNlQ29uZmlnO1xuICAgICAgICAgICAgLy8gTUVSR0VcbiAgICAgICAgICAgIGlmIChsb2NhbGVzW25hbWVdICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICBwYXJlbnRDb25maWcgPSBsb2NhbGVzW25hbWVdLl9jb25maWc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjb25maWcgPSBtZXJnZUNvbmZpZ3MocGFyZW50Q29uZmlnLCBjb25maWcpO1xuICAgICAgICAgICAgbG9jYWxlID0gbmV3IExvY2FsZShjb25maWcpO1xuICAgICAgICAgICAgbG9jYWxlLnBhcmVudExvY2FsZSA9IGxvY2FsZXNbbmFtZV07XG4gICAgICAgICAgICBsb2NhbGVzW25hbWVdID0gbG9jYWxlO1xuXG4gICAgICAgICAgICAvLyBiYWNrd2FyZHMgY29tcGF0IGZvciBub3c6IGFsc28gc2V0IHRoZSBsb2NhbGVcbiAgICAgICAgICAgIGdldFNldEdsb2JhbExvY2FsZShuYW1lKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIC8vIHBhc3MgbnVsbCBmb3IgY29uZmlnIHRvIHVudXBkYXRlLCB1c2VmdWwgZm9yIHRlc3RzXG4gICAgICAgICAgICBpZiAobG9jYWxlc1tuYW1lXSAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgaWYgKGxvY2FsZXNbbmFtZV0ucGFyZW50TG9jYWxlICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgbG9jYWxlc1tuYW1lXSA9IGxvY2FsZXNbbmFtZV0ucGFyZW50TG9jYWxlO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobG9jYWxlc1tuYW1lXSAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBsb2NhbGVzW25hbWVdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbG9jYWxlc1tuYW1lXTtcbiAgICB9XG5cbiAgICAvLyByZXR1cm5zIGxvY2FsZSBkYXRhXG4gICAgZnVuY3Rpb24gZ2V0TG9jYWxlKGtleSkge1xuICAgICAgICB2YXIgbG9jYWxlO1xuXG4gICAgICAgIGlmIChrZXkgJiYga2V5Ll9sb2NhbGUgJiYga2V5Ll9sb2NhbGUuX2FiYnIpIHtcbiAgICAgICAgICAgIGtleSA9IGtleS5fbG9jYWxlLl9hYmJyO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCFrZXkpIHtcbiAgICAgICAgICAgIHJldHVybiBnbG9iYWxMb2NhbGU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIWlzQXJyYXkoa2V5KSkge1xuICAgICAgICAgICAgLy9zaG9ydC1jaXJjdWl0IGV2ZXJ5dGhpbmcgZWxzZVxuICAgICAgICAgICAgbG9jYWxlID0gbG9hZExvY2FsZShrZXkpO1xuICAgICAgICAgICAgaWYgKGxvY2FsZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBsb2NhbGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBrZXkgPSBba2V5XTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBjaG9vc2VMb2NhbGUoa2V5KTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBsaXN0TG9jYWxlcygpIHtcbiAgICAgICAgcmV0dXJuIGtleXMobG9jYWxlcyk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gY2hlY2tPdmVyZmxvdyhtKSB7XG4gICAgICAgIHZhciBvdmVyZmxvdztcbiAgICAgICAgdmFyIGEgPSBtLl9hO1xuXG4gICAgICAgIGlmIChhICYmIGdldFBhcnNpbmdGbGFncyhtKS5vdmVyZmxvdyA9PT0gLTIpIHtcbiAgICAgICAgICAgIG92ZXJmbG93ID0gYVtNT05USF0gPCAwIHx8IGFbTU9OVEhdID4gMTEgPyBNT05USCA6IGFbREFURV0gPCAxIHx8IGFbREFURV0gPiBkYXlzSW5Nb250aChhW1lFQVJdLCBhW01PTlRIXSkgPyBEQVR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maWcpIHtcbiAgICAgICAgdmFyIGksXG4gICAgICAgICAgICBkYXRlLFxuICAgICAgICAgICAgaW5wdXQgPSBbXSxcbiAgICAgICAgICAgIGN1cnJlbnREYXRlLFxuICAgICAgICAgICAgeWVhclRvVXNlO1xuXG4gICAgICAgIGlmIChjb25maWcuX2QpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGN1cnJlbnREYXRlID0gY3VycmVudERhdGVBcnJheShjb25maWcpO1xuXG4gICAgICAgIC8vY29tcHV0ZSBkYXkgb2YgdGhlIHllYXIgZnJvbSB3ZWVrcyBhbmQgd2Vla2RheXNcbiAgICAgICAgaWYgKGNvbmZpZy5fdyAmJiBjb25maWcuX2FbREFURV0gPT0gbnVsbCAmJiBjb25maWcuX2FbTU9OVEhdID09IG51bGwpIHtcbiAgICAgICAgICAgIGRheU9mWWVhckZyb21XZWVrSW5mbyhjb25maWcpO1xuICAgICAgICB9XG5cbiAgICAgICAgLy9pZiB0aGUgZGF5IG9mIHRoZSB5ZWFyIGlzIHNldCwgZmlndXJlIG91dCB3aGF0IGl0IGlzXG4gICAgICAgIGlmIChjb25maWcuX2RheU9mWWVhciAhPSBudWxsKSB7XG4gICAgICAgICAgICB5ZWFyVG9Vc2UgPSBkZWZhdWx0cyhjb25maWcuX2FbWUVBUl0sIGN1cnJlbnREYXRlW1lFQVJdKTtcblxuICAgICAgICAgICAgaWYgKGNvbmZpZy5fZGF5T2ZZZWFyID4gZGF5c0luWWVhcih5ZWFyVG9Vc2UpIHx8IGNvbmZpZy5fZGF5T2ZZZWFyID09PSAwKSB7XG4gICAgICAgICAgICAgICAgZ2V0UGFyc2luZ0ZsYWdzKGNvbmZpZykuX292ZXJmbG93RGF5T2ZZZWFyID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZGF0ZSA9IGNyZWF0ZVVUQ0RhdGUoeWVhclRvVXNlLCAwLCBjb25maWcuX2RheU9mWWVhcik7X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3VyV2VlayA9IHdlZWtPZlllYXIoY3JlYXRlTG9jYWwoKSwgZG93LCBkb3kpO1xuXG4gICAgICAgICAgICB3ZWVrWWVhciA9IGRlZmF1bHRzKHcuZ2csIGNvbmZpZy5fYVtZRUFSXSwgY3VyV2Vlay55ZWFyKTtcblxuICAgICAgICAgICAgLy8gRGVmYXVsdCB0byBjdXJyZW50IHdlZWsuXG4gICAgICAgICAgICB3ZWVrID0gZGVmYXVsdHMody53LCBjdXJXZWVrLndlZWspO1xuXG4gICAgICAgICAgICBpZiAody5kICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICAvLyB3ZWVrZGF5IC0tIGxvdyBkYXkgbnVtYmVycyBhcmUgY29uc2lkZXJlZCBuZXh0IHdlZWtcbiAgICAgICAgICAgICAgICB3ZWVrZGF5ID0gdy5kO1xuICAgICAgICAgICAgICAgIGlmICh3ZWVrZGF5IDwgMCB8fCB3ZWVrZGF5ID4gNikge1xuICAgICAgICAgICAgICAgICAgICB3ZWVrZGF5T3ZlcmZsb3cgPSB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAody5lICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICAvLyBsb2NhbCB3ZWVrZGF5IC0tIGNvdW50aW5nIHN0YXJ0cyBmcm9tIGJlZ2luaW5nIG9mIHdlZWtcbiAgICAgICAgICAgICAgICB3ZWVrZGF5ID0gdy5lICsgZG93O1xuICAgICAgICAgICAgICAgIGlmICh3LmUgPCAwIHx8IHcuZSA+IDYpIHtcbiAgICAgICAgICAgICAgICAgICAgd2Vla2RheU92ZXJmbG93ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIGRlZmF1bHQgdG8gYmVnaW5pbmcgb2Ygd2Vla1xuICAgICAgICAgICAgICAgIHdlZWtkYXkgPSBkb3c7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1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gICAgICBkYXRlRm9ybWF0ID0gaXNvRGF0ZXNbaV1bMF07XG4gICAgICAgICAgICAgICAgICAgIGFsbG93VGltZSA9IGlzb0RhdGVzW2ldWzJdICE9PSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGRhdGVGb3JtYXQgPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIGNvbmZpZy5faXNWYWxpZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChtYXRjaFszXSkge1xuICAgICAgICAgICAgICAgIGZvciAoaSA9IDAsIGwgPSBpc29UaW1lcy5sZW5ndGg7IGkgPCBsOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzb1RpbWVzW2ldWzFdLmV4ZWMobWF0Y2hbM10pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBtYXRjaFsyXSBzaG91bGQgYmUgJ1QnIG9yIHNwYWNlXG4gICAgICAgICAgICAgICAgICAgICAgICB0aW1lRm9ybWF0ID0gKG1hdGNoWzJdIHx8ICcgJykgKyBpc29UaW1lc1tpXVswXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICh0aW1lRm9ybWF0ID09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLl9pc1ZhbGlkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIWFsbG93VGltZSAmJiB0aW1lRm9ybWF0ICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICBjb25maWcuX2lzVmFsaWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobWF0Y2hbNF0pIHtcbiAgICAgICAgICAgICAgICBpZiAodHpSZWdleC5leGVjKG1hdGNoWzRdKSkge1xuICAgICAgICAgICAgICAgICAgICB0ekZvcm1hdCA9ICdaJztcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBjb25maWcuX2lzVmFsaWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNvbmZpZy5fZiA9IGRhdGVGb3JtYXQgKyAodGltZUZvcm1hdCB8fCAnJykgKyAodHpGb3JtYXQgfHwgJycpO1xuICAgICAgICAgICAgY29uZmlnRnJvbVN0cmluZ0FuZEZvcm1hdChjb25maWcpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgY29uZmlnLl9pc1ZhbGlkID0gZmFsc2U7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBSRkMgMjgyMiByZWdleDogRm9yIGRldGFpbHMgc2VlIGh0dHBzOi8vdG9vbHMuaWV0Zi5vcmcvaHRtbC9yZmMyODIyI3NlY3Rpb24tMy4zXG4gICAgdmFyIHJmYzI4MjIgPSAvXig/OihNb258VHVlfFdlZHxUaHV8RnJpfFNhdHxTdW4pLD9cXHMpPyhcXGR7MSwyfSlcXHMoSmFufEZlYnxNYXJ8QXByfE1heXxKdW58SnVsfEF1Z3xTZXB8T2N0fE5vdnxEZWMpXFxzKFxcZHsyLDR9KVxccyhcXGRcXGQpOihcXGRcXGQpKD86OihcXGRcXGQpKT9cXHMoPzooVVR8R01UfFtFQ01QXVtTRF1UKXwoW1p6XSl8KFsrLV1cXGR7NH0pKSQvO1xuXG4gICAgZnVuY3Rpb24gZXh0cmFjdEZyb21SRkMyODIyU3RyaW5ncyh5ZWFyU3RyLCBtb250aFN0ciwgZGF5U3RyLCBob3VyU3RyLCBtaW51dGVTdHIsIHNlY29uZFN0cikge1xuICAgICAgICB2YXIgcmVzdWx0ID0gW3VudHJ1bmNhdGVZZWFyKHllYXJTdHIpLCBkZWZhdWx0TG9jYWxlTW9udGhzU2hvcnQuaW5kZXhPZihtb250aFN0ciksIHBhcnNlSW50KGRheVN0ciwgMTApLCBwYXJzZUludChob3VyU3RyLCAxMCksIHBhcnNlSW50KG1pbnV0ZVN0ciwgMTApXTtcblxuICAgICAgICBpZiAoc2Vjb25kU3RyKSB7XG4gICAgICAgICAgICByZXN1bHQucHVzaChwYXJzZUludChzZWNvbmRTdHIsIDEwKSk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHVudHJ1bmNhdGVZZWFyKHllYXJTdHIpIHtcbiAgICAgICAgdmFyIHllYXIgPSBwYXJzZUludCh5ZWFyU3RyLCAxMCk7XG4gICAgICAgIGlmICh5ZWFyIDw9IDQ5KSB7XG4gICAgICAgICAgICByZXR1cm4gMjAwMCArIHllYXI7XG4gICAgICAgIH0gZWxzZSBpZiAoeWVhciA8PSA5OTkpIHtcbiAgICAgICAgICAgIHJldHVybiAxOTAwICsgeWVhcjtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geWVhcjtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBwcmVwcm9jZXNzUkZDMjgyMihzKSB7XG4gICAgICAgIC8vIFJlbW92ZSBjb21tZW50cyBhbmQgZm9sZGluZyB3aGl0ZXNwYWNlIGFuZCByZXBsYWNlIG11bHRpcGxlLXNwYWNlcyB3aXRoIGEgc2luZ2xlIHNwYWNlXG4gICAgICAgIHJldHVybiBzLnJlcGxhY2UoL1xcKFteKV0qXFwpfFtcXG5cXHRdL2csICcgJykucmVwbGFjZSgvKFxcc1xccyspL2csICcgJykudHJpbSgpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGNo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9XG5cbiAgICAgICAgICAgIGNvbmZpZy5fYSA9IHBhcnNlZEFycmF5O1xuICAgICAgICAgICAgY29uZmlnLl90em0gPSBjYWxjdWxhdGVPZmZzZXQobWF0Y2hbOF0sIG1hdGNoWzldLCBtYXRjaFsxMF0pO1xuXG4gICAgICAgICAgICBjb25maWcuX2QgPSBjcmVhdGVVVENEYXRlLmFwcGx5KG51bGwsIGNvbmZpZy5fYSk7XG4gICAgICAgICAgICBjb25maWcuX2Quc2V0VVRDTWludXRlcyhjb25maWcuX2QuZ2V0VVRDTWludXRlcygpIC0gY29uZmlnLl90em0pO1xuXG4gICAgICAgICAgICBnZXRQYXJzaW5nRmxhZ3MoY29uZmlnKS5yZmMyODIyID0gdHJ1ZTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNvbmZpZy5faXNWYWxpZCA9IGZhbHNlO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gZGF0ZSBmcm9tIGlzbyBmb3JtYXQgb3IgZmFsbGJhY2tcbiAgICBmdW5jdGlvbiBjb25maWdGcm9tU3RyaW5nKGNvbmZpZykge1xuICAgICAgICB2YXIgbWF0Y2hlZCA9IGFzcE5ldEpzb25SZWdleC5leGVjKGNvbmZpZy5faSk7XG5cbiAgICAgICAgaWYgKG1hdGNoZWQgIT09IG51bGwpIHtcbiAgICAgICAgICAgIGNvbmZpZy5fZCA9IG5ldyBEYXRlKCttYXRjaGVkWzFdKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGNvbmZpZ0Zyb21JU08oY29uZmlnKTtcbiAgICAgICAgaWYgKGNvbmZpZy5faXNWYWxpZCA9PT0gZmFsc2UpIHtcbiAgICAgICAgICAgIGRlbGV0ZSBjb25maWcuX2lzVmFsaWQ7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBjb25maWdGcm9tUkZDMjgyMihjb25maWcpO1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gICAgICAgICB0b3RhbFBhcnNlZElucHV0TGVuZ3RoID0gMDtcblxuICAgICAgICB0b2tlbnMgPSBleHBhbmRGb3JtYXQoY29uZmlnLl9mLCBjb25maWcuX2xvY2FsZSkubWF0Y2goZm9ybWF0dGluZ1Rva2VucykgfHwgW107XG5cbiAgICAgICAgZm9yIChpID0gMDsgaSA8IHRva2Vucy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdG9rZW4gPSB0b2tlbnNbaV07XG4gICAgICAgICAgICBwYXJzZWRJbnB1dCA9IChzdHJpbmcubWF0Y2goZ2V0UGFyc2VSZWdleEZvclRva2VuKHRva2VuLCBjb25maWcpKSB8fCBbXSlbMF07XG4gICAgICAgICAgICAvLyBjb25zb2xlLmxvZygndG9rZW4nLCB0b2tlbiwgJ3BhcnNlZElucHV0JywgcGFyc2VkSW5wdXQsXG4gICAgICAgICAgICAvLyAgICAgICAgICdyZWdleCcsIGdldFBhcnNlUmVnZXhGb3JUb2tlbih0b2tlbiwgY29uZmlnKSk7XG4gICAgICAgICAgICBpZiAocGFyc2VkSW5wdXQpIHtcbiAgICAgICAgICAgICAgICBza2lwcGVkID0gc3RyaW5nLnN1YnN0cigwLCBzdHJpbmcuaW5kZXhPZihwYXJzZWRJbnB1dCkpO1xuICAgICAgICAgICAgICAgIGlmIChza2lwcGVkLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgZ2V0UGFyc2luZ0ZsYWdzKGNvbmZpZykudW51c2VkSW5wdXQucHVzaChza2lwcGVkKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgc3RyaW5nID0gc3RyaW5nLnNsaWNlKHN0cmluZy5pbmRleE9mKHBhcnNlZElucHV0KSArIHBhcnNlZElucHV0Lmxlbmd0aCk7XG4gICAgICAgICAgICAgICAgdG90YWxQYXJzZWRJbnB1dExlbmd0aCArPSBwYXJzZWRJbnB1dC5sZW5ndGg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgIC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tcbiAgICAgICAgICAgIGlzUG0gPSBsb2NhbGUuaXNQTShtZXJpZGllbSk7XG4gICAgICAgICAgICBpZiAoaXNQbSAmJiBob3VyIDwgMTIpIHtcbiAgICAgICAgICAgICAgICBob3VyICs9IDEyO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCFpc1BtICYmIGhvdXIgPT09IDEyKSB7XG4gICAgICAgICAgICAgICAgaG91ciA9IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gaG91cjtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIC8vIHRoaXMgaXMgbm90IHN1cHBvc2VkIHRvIGhhcHBlblxuICAgICAgICAgICAgcmV0dXJuIGhvdXI7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBkYXRlIGZyb20gc3RyaW5nIGFuZCBhcnJheSBvZiBmb3JtYXQgc3RyaW5nc1xuICAgIGZ1bmN0aW9uIGNvbmZpZ0Zyb21TdHJpbmdBbmRBcnJheShjb25maWcpIHtcbiAgICAgICAgdmFyIHRlbXBDb25maWcsIGJlc3RNb21lbnQsIHNjb3JlVG9CZWF0LCBpLCBjdXJyZW50U2NvcmU7XG5cbiAgICAgICAgaWYgKGNvbmZpZy5fZi5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgIGdldFBhcnNpbmdGbGFncyhjb25maWcpLmludmFsaWRGb3JtYXQgPSB0cnVlO1xuICAgICAgICAgICAgY29uZmlnLl9kID0gbmV3IERhdGUoTmFOKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCBjb25maWcuX2YubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGN1cnJlbnRTY29yZSA9IDA7XG4gICAgICAgICAgICB0ZW1wQ29uZmlnID0gY29weUNvbmZpZyh7fSwgY29uZmlnKTtcbiAgICAgICAgICAgIGlmIChjb25maWcuX3VzZVVUQyAhPSBudWx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mdW5jdGlvbiBjb25maWdGcm9tT2JqZWN0KGNvbmZpZykge1xuICAgICAgICBpZiAoY29uZmlnLl9kKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgaSA9IG5vcm1hbGl6ZU9iamVjdFVuaXRzKGNvbmZpZy5faSk7XG4gICAgICAgIGNvbmZpZy5fYSA9IG1hcChbaS55ZWFyLCBpLm1vbnRoLCBpLmRheSB8fCBpLmRhdGUsIGkuaG91ciwgaS5taW51dGUsIGkuc2Vjb25kLCBpLm1pbGxpc2Vjb25kXSwgZnVuY3Rpb24gKG9iaikge1xuICAgICAgICAgICAgcmV0dXJuIG9iaiAmJiBwYXJzZUludChvYmosIDEwKTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgY29uZmlnRnJvbUFycmF5KGNvbmZpZyk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gY3JlYXRlRnJvbUNvbmZpZyhjb25maWcpIHtcbiAgICAgICAgdmFyIHJlcyA9IG5ldyBNb21lbnQoY2hlY2tPdmVyZmxvdyhwcmVwYXJlQ29uZmlnKGNvbmZpZykpKTtcbiAgICAgICAgaWYgKHJlcy5fbmV4dERheSkge1xuICAgICAgICAgICAgLy8gQWRkaW5nIGlzIHNtYXJ0IGVub3VnaCBhcm91bmQgRFNUXG4gICAgICAgICAgICByZXMuYWRkKDEsICdkJyk7XG4gICAgICAgICAgICByZXMuX25leHREYXkgPSB1bmRlZmluZWQ7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcmVzO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHByZXBhcmVDb25maWcoY29uZmlnKSB7XG4gICAgICAgIHZhciBpbnB1dCA9IGNvbmZpZy5faSxcbiAgICAgICAgICAgIGZvcm1hdCA9IGNvbmZpZy5fZjtcblxuICAgICAgICBjb25maWcuX2xvY2FsZSA9IGNvbmZpZy5fbG9jYWxlIHx8IGdldExvY2FsZShjb25maWcuX2wpO1xuXG4gICAgICAgIGlmIChpbnB1dCA9PT0gbnVsbCB8fCBmb3JtYXQgPT09IHVuZGVmaW5lZCAmJiBpbnB1dCA9PT0gJycpIHtcbiAgICAgICAgICAgIHJldHVybiBjcmVhdGVJbnZhbGlkKHsgbnVsbElucHV0OiB0cnVlIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHR5cGVvZiBpbnB1dCA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIGNvbmZpZy5faSA9IGlucHV0ID0gY29uZmlnLl9sb2NhbGUucHJlcGFyc2UoaW5wdXQpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGlzTW9tZW50KGlucHV0KSkge1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBNb21lbnQoY2hlY2tPdmVyZmxvdyhpbnB1dCkpO1xuICAgICAgICB9IGVsc2UgaWYgKGlzRGF0ZShpbnB1dCkpIHtcbiAgICAgICAgICAgIGNvbmZpZy5fZCA9IGlucHV0O1xuICAgICAgICB9IGVsc2UgaWYgKGlzQXJyYXkoZm9ybWF0KSkge1xuICAgICAgICAgICAgY29uZmlnRnJvbVN0cmluZ0FuZEFycmF5KGNvbmZpZyk7XG4gICAgICAgIH0gZWxzZSBpZiAoZm9ybWF0KSB7XG4gICAgICAgICAgICBjb25maWdGcm9tU3RyaW5nQW5kRm9ybWF0KGNvbmZpZyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBjb25maWdGcm9tSW5wdXQoY29uZmlnKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghaXNWYWxpZChjb25maWcpKSB7XG4gICAgICAgICAgICBjb25maWcuX2QgPSBudWxsO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGNvbmZpZztcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBjb25maWdGcm9tSW5wdXQoY29uZmlnKSB7XG4gICAgICAgIHZhciBpbnB1dCA9IGNvbmZpZy5faTtcbiAgICAgICAgaWYgKGlzVW5kZWZpbmVkKGlucHV0KSkge1xuICAgICAgICAgICAgY29uZmlnLl9kID0gbmV3IERhdGUoaG9va3Mubm93KCkpO1xuICAgICAgICB9IGVsc2UgaWYgKGlzRGF0ZShpbnB1dCkpIHtcbiAgICAgICAgICAgIGNvbmZpZy5fZCA9IG5ldyBEYXRlKGlucHV0LnZhbHVlT2YoKSk7XG4gICAgICAgIH0gZWxzZSBpZiAodHlwZW9mIGlucHV0ID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgY29uZmlnRnJvbVN0cmluZyhjb25maWcpO1xuICAgICAgICB9IGVsc2UgaWYgKGlzQXJyYXkoaW5wdXQpKSB7XG4gICAgICAgICAgICBjb25maWcuX2EgPSBtYXAoaW5wdXQuc2xpY2UoMCksIGZ1bmN0aW9uIChvYmopIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VJbnQob2JqLCAxMCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGNvbmZpZ0Zyb21BcnJheShjb25maWcpO1xuICAgICAgICB9IGVsc2UgaWYgKGlzT2JqZWN0KGlucHV0KSkge1xuICAgICAgICAgICAgY29uZmlnRnJvbU9iamVjdChjb25maWcpO1xuICAgICAgICB9IGVsc2UgaWYgKGlzTnVtYmVyKGlucHV0KSkge1xuICAgICAgICAgICAgLy8gZnJvbSBtaWxsaXNlY29uZHNcbiAgICAgICAgICAgIGNvbmZpZy5fZCA9IG5ldyBEYXRlKGlucHV0KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGhvb2tzLmNyZWF0ZUZyb21JbnB1dEZhbGxiYWNrKGNvbmZpZyk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBjcmVhdGVMb2NhbE9yVVRDKGlucHV0LCBmb3JtYXQsIGxvY2FsZSwgc3RyaWN0LCBpc1VUQykge1xuICAgICAgICB2YXIgYyA9IHt9O1xuXG4gICAgICAgIGlmIChsb2NhbGUgPT09IHRydWUgfHwgbG9j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gICB2YXIgbm93ID0gZnVuY3Rpb24gbm93KCkge1xuICAgICAgICByZXR1cm4gRGF0ZS5ub3cgPyBEYXRlLm5vdygpIDogK25ldyBEYXRlKCk7XG4gICAgfTtcblxuICAgIHZhciBvcmRlcmluZyA9IFsneWVhcicsICdxdWFydGVyJywgJ21vbnRoJywgJ3dlZWsnLCAnZGF5JywgJ2hvdXInLCAnbWludXRlJywgJ3NlY29uZCcsICdtaWxsaXNlY29uZCddO1xuXG4gICAgZnVuY3Rpb24gaXNEdXJhdGlvblZhbGlkKG0pIHtcbiAgICAgICAgZm9yICh2YXIga2V5IGluIG0pIHtcbiAgICAgICAgICAgIGlmICghKGluZGV4T2YuY2FsbChvcmRlcmluZywga2V5KSAhPT0gLTEgJiYgKG1ba2V5XSA9PSBudWxsIHx8ICFpc05hTihtW2tleV0pKSkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgdW5pdEhhc0RlY2ltYWwgPSBmYWxzZTtcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBvcmRlcmluZy5sZW5ndGg7ICsraSkge1xuICAgICAgICAgICAgaWYgKG1bb3JkZXJpbmdbaV1dKSB7XG4gICAgICAgICAgICAgICAgaWYgKHVuaXRIYXNEZWNpbWFsKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsgLy8gb25seSBhbGxvdyBub24taW50ZWdlcnMgZm9yIHNtYWxsZXN0IHVuaXRcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHBhcnNlRmxvYXQobVtvcmRlcmluZ1tpXV0pICE9PSB0b0ludChtW29yZGVyaW5nW2ldXSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdW5pdEhhc0RlY2ltYWwgPSB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAg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RPZmZzZXQoaW5wdXQsIGtlZXBMb2NhbFRpbWUsIGtlZXBNaW51dGVzKSB7XG4gICAgICAgIHZhciBvZmZzZXQgPSB0aGlzLl9vZmZzZXQgfHwgMCxcbiAgICAgICAgICAgIGxvY2FsQWRqdXN0O1xuICAgICAgICBpZiAoIXRoaXMuaXNWYWxpZCgpKSB7XG4gICAgICAgICAgICByZXR1cm4gaW5wdXQgIT0gbnVsbCA/IHRoaXMgOiBOYU47XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGlucHV0ICE9IG51bGwpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgaW5wdXQgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgaW5wdXQgPSBvZmZzZXRGcm9tU3RyaW5nKG1hdGNoU2hvcnRPZmZzZXQsIGlucHV0KTtcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmIChNYXRoLmFicyhpbnB1dCkgPCAxNiAmJiAha2VlcE1pbnV0ZXMpIHtcbiAgICAgICAgICAgICAgICBpbnB1dCA9IGlucHV0ICogNjA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIXRoaXMuX2lzVVRDICYmIGtlZXBMb2NhbFRpbWUpIHtcbiAgICAgICAgICAgICAgICBsb2NhbEFkanVzdCA9IGdldERhdGVPZmZzZXQodGhpcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLl9vZmZzZXQgPSBpbnB1dDtcbiAgICAgICAgICAgIHRoaXMuX2lzVVRDID0gdHJ1ZTtcbiAgICAgICAgICAgIGlmIChsb2NhbEFkanVzdCAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5hZGQobG9jYWxBZGp1c3QsICdtJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAob2Zmc2V0ICE9PSBpbnB1dCkge1xuICAgICAgICAgICAgICAgIGlmICgha2VlcExvY2FsVGltZSB8fCB0aGlzLl9jaGFuZ2VJblByb2dyZXNzKSB7XG4gICAgICAgICAgICAgICAgICAgIGFkZFN1YnRyYWN0KHRoaXMsIGNyZWF0ZUR1cmF0aW9uKGlucHV0IC0gb2Zmc2V0LCAnbScpLCAxLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICghdGhpcy5fY2hhbmdlSW5Qcm9ncmVzcykge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9jaGFuZ2VJblByb2dyZXNzID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgaG9va3MudXBkYXRlT2Zmc2V0KHRoaXMsIHRydWUpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9jaGFuZ2VJblByb2dyZXNzID0gbnVsbDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9pc1VUQyA/IG9mZnNldCA6IGdldERhdGVPZmZzZXQodGhpcyk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBnZXRTZXRab25lKGlucHV0LCBrZWVwTG9jYWxUaW1lKSB7XG4gICAgICAgIGlmIChpbnB1dCAhPSBudWxsKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIGlucHV0ICE9PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgIGlucHV0ID0gLWlucHV0O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB0aGlzLnV0Y09mZnNldChpbnB1dCwga2VlcExvY2FsVGltZSk7XG5cbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIC10aGlzLnV0Y09mZnNldCgpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gc2V0T2Zmc2V0VG9VVEMoa2VlcExvY2FsVGltZSkge1xuICAgICAgICByZXR1cm4gdGhpcy51dGNPZmZzZXQoMCwga2VlcExvY2FsVGltZSk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gc2V0T2Zmc2V0VG9Mb2NhbChrZWVwTG9jYWxUaW1lKSB7XG4gICAgICAgIGlmICh0aGlzLl9pc1VUQykge1xuICAgICAgICAgICAgdGhpcy51dGNPZmZzZXQoMCwga2VlcExvY2FsVGltZSk7XG4gICAgICAgICAgICB0aGlzLl9pc1VUQyA9IGZhbHNlO1xuXG4gICAgICAgICAgICBpZiAoa2VlcExvY2FsVGltZSkge1xuICAgICAgICAgICAgICAgIHRoaXMuc3VidHJhY3QoZ2V0RGF0ZU9mZnNldCh0aGlzKSwgJ20nKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBzZXRPZmZzZXRUb1BhcnNlZE9mZnNldCgpIHtcbiAgICAgICAgaWYgKHRoaXMuX3R6bSAhPSBudWxsKSB7XG4gICAgICAgICAgICB0aGlzLnV0Y09mZnNldCh0aGlzLl90em0sIGZhbHNlLCB0cnVlKTtcbiAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgdGhpcy5faSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIHZhciB0Wm9uZSA9IG9mZnNldEZyb21TdHJpbmcobWF0Y2hPZmZzZXQsIHRoaXMuX2kpO1xuICAgICAgICAgICAgaWYgKHRab25lICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnV0Y09mZnNldCh0Wm9uZSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMudXRjT2Zmc2V0KDAsIHRydWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldH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m90aCB3ZWVrIGFuZCBkYXlcbiAgICB2YXIgaXNvUmVnZXggPSAvXigtfFxcKyk/UCg/OihbLStdP1swLTksLl0qKVkpPyg/OihbLStdP1swLTksLl0qKU0pPyg/OihbLStdP1swLTksLl0qKVcpPyg/OihbLStdP1swLTksLl0qKUQpPyg/OlQoPzooWy0rXT9bMC05LC5dKilIKT8oPzooWy0rXT9bMC05LC5dKilNKT8oPzooWy0rXT9bMC05LC5dKilTKT8pPyQvO1xuXG4gICAgZnVuY3Rpb24gY3JlYXRlRHVyYXRpb24oaW5wdXQsIGtleSkge1xuICAgICAgICB2YXIgZHVyYXRpb24gPSBpbnB1dCxcblxuICAgICAgICAvLyBtYXRjaGluZyBhZ2FpbnN0IHJlZ2V4cCBpcyBleHBlbnNpdmUsIGRvIGl0IG9uIGRlbWFuZFxuICAgICAgICBtYXRjaCA9IG51bGwsXG4gICAgICAgICAgICBzaWduLFxuICAgICAgICAgICAgcmV0LFxuICAgICAgICAgICAgZGlmZlJlcztcblxuICAgICAgICBpZiAoaXNEdXJhdGlvbihpbnB1dCkpIHtcbiAgICAgICAgICAgIGR1cmF0aW9uID0ge1xuICAgICAgICAgICAgICAgIG1zOiBpbnB1dC5fbWlsbGlzZWNvbmRzLFxuICAgICAgICAgICAgICAgIGQ6IGlucHV0Ll9kYXlzLFxuICAgICAgICAgICAgICAgIE06IGlucHV0Ll9tb250aHNcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSBpZiAoaXNOdW1iZXIoaW5wdXQpKSB7XG4gICAgICAgICAgICBkdXJhdGlvbiA9IHt9O1xuICAgICAgICAgICAgaWYgKGtleSkge1xuICAgICAgICAgICAgICAgIGR1cmF0aW9uW2tleV0gPSBpbnB1dDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgZHVyYXRpb24ubWlsbGlzZWNvbmRzID0gaW5wdXQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAoISEobWF0Y2ggPSBhc3BOZXRSZWdleC5leGVjKGlucHV0KSkpIHtcbiAgICAgICAgICAgIHNpZ24gPSBtYXRjaFsxXSA9PT0gJy0nID8gLTEgOiAxO1xuICAgICAgICAgICAgZHVyYXRpb24gPSB7XG4gICAgICAgICAgICAgICAgeTogMCxcbiAgICAgICAgICAgICAgICBkOiB0b0ludChtYXRjaFtEQVRFXSkgKiBzaWduLFxuICAgICAgICAgICAgICAgIGg6IHRvSW50KG1hdGNoW0hPVVJdKSAqIHNpZ24sXG4gICAgICAgICAgICAgICAgbTogdG9JbnQobWF0Y2hbTUlOVVRFXSkgKiBzaWduLFxuICAgICAgICAgICAgICAgIHM6IHRvSW50KG1hdGNoW1NFQ09ORF0pICogc2lnbixcbiAgICAgICAgICAgICAgICBtczogdG9JbnQoYWJzUm91bmQobWF0Y2hbTUlMTElTRUNPTkRdICogMTAwMCkpICogc2lnbiAvLyB0aGUgbWlsbGlzZWNvbmQgZGVjaW1hbCBwb2ludCBpcyBpbmNsdWRlZCBpbiB0aGUgbWF0Y2hcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSBpZiAoISEobWF0Y2ggPSBpc29SZWdleC5leGVjKGlucHV0KSkpIHtcbiAgICAgICAgICAgIHNpZ24gPSBtYXRjaFsxXSA9PT0gJy0nID8gLTEgOiBtYXRjaFsxXSA9PT0gJysnID8gMSA6IDE7XG4gICAgICAgICAgICBkdXJhdGlvbiA9IHtcbiAgICAgICAgICAgICAgICB5OiBwYXJzZUlzbyhtYXRjaFsyXSwgc2lnbiksXG4gICAgICAgICAgICAgICAgTTogcGFyc2VJc28obWF0Y2hbM10sIHNpZ24pLFxuICAgICAgICAgICAgICAgIHc6IHBhcnNlSXNvKG1hdGNoWzRdLCBzaWduKSxcbiAgICAgICAgICAgICAgICBkOiBwYXJzZUlzbyhtYXRjaFs1XSwgc2lnbiksXG4gICAgICAgICAgICAgICAgaDogcGFyc2VJc28obWF0Y2hbNl0sIHNpZ24pLFxuICAgICAg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zXG4gICAgICAgIHZhciB3aG9sZU1vbnRoRGlmZiA9IChiLnllYXIoKSAtIGEueWVhcigpKSAqIDEyICsgKGIubW9udGgoKSAtIGEubW9udGgoKSksXG5cbiAgICAgICAgLy8gYiBpcyBpbiAoYW5jaG9yIC0gMSBtb250aCwgYW5jaG9yICsgMSBtb250aClcbiAgICAgICAgYW5jaG9yID0gYS5jbG9uZSgpLmFkZCh3aG9sZU1vbnRoRGlmZiwgJ21vbnRocycpLFxuICAgICAgICAgICAgYW5jaG9yMixcbiAgICAgICAgICAgIGFkanVzdDtcblxuICAgICAgICBpZiAoYiAtIGFuY2hvciA8IDApIHtcbiAgICAgICAgICAgIGFuY2hvcjIgPSBhLmNsb25lKCkuYWRkKHdob2xlTW9udGhEaWZmIC0gMSwgJ21vbnRocycpO1xuICAgICAgICAgICAgLy8gbGluZWFyIGFjcm9zcyB0aGUgbW9udGhcbiAgICAgICAgICAgIGFkanVzdCA9IChiIC0gYW5jaG9yKSAvIChhbmNob3IgLSBhbmNob3IyKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGFuY2hvcjIgPSBhLmNsb25lKCkuYWRkKHdob2xlTW9udGhEaWZmICsgMSwgJ21vbnRocycpO1xuICAgICAgICAgICAgLy8gbGluZWFyIGFjcm9zcyB0aGUgbW9udGhcbiAgICAgICAgICAgIGFkanVzdCA9IChiIC0gYW5jaG9yKSAvIChhbmNob3IyIC0gYW5jaG9yKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vY2hlY2sgZm9yIG5lZ2F0aXZlIHplcm8sIHJldHVybiB6ZXJvIGlmIG5lZ2F0aXZlIHplcm9cbiAgICAgICAgcmV0dXJuIC0od2hvbGVNb250aERpZmYgKyBhZGp1c3QpIHx8IDA7XG4gICAgfVxuXG4gICAgaG9va3MuZGVmYXVsdEZvcm1hdCA9ICdZWVlZLU1NLUREVEhIOm1tOnNzWic7XG4gICAgaG9va3MuZGVmYXVsdEZvcm1hdFV0YyA9ICdZ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AgY2FzZSAnZGF0ZSc6XG4gICAgICAgICAgICAgICAgdGhpcy5ob3VycygwKTtcbiAgICAgICAgICAgIC8qIGZhbGxzIHRocm91Z2ggKi9cbiAgICAgICAgICAgIGNhc2UgJ2hvdXInOlxuICAgICAgICAgICAgICAgIHRoaXMubWludXRlcygwKTtcbiAgICAgICAgICAgIC8qIGZhbGxzIHRocm91Z2ggKi9cbiAgICAgICAgICAgIGNhc2UgJ21pbnV0ZSc6XG4gICAgICAgICAgICAgICAgdGhpcy5zZWNvbmRzKDApO1xuICAgICAgICAgICAgLyogZmFsbHMgdGhyb3VnaCAqL1xuICAgICAgICAgICAgY2FzZSAnc2Vjb25kJzpcbiAgICAgICAgICAgICAgICB0aGlzLm1pbGxpc2Vjb25kcygwKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIHdlZWtzIGFyZSBhIHNwZWNpYWwgY2FzZVxuICAgICAgICBpZiAodW5pdHMgPT09ICd3ZWVrJykge1xuICAgICAgICAgICAgdGhpcy53ZWVrZGF5KDApO1xuICAgICAgICB9XG4gICAgICAgIGlmICh1bml0cyA9PT0gJ2lzb1dlZWsnKSB7XG4gICAgICAgICAgICB0aGlzLmlzb1dlZWtkYXkoMSk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBxdWFydGVycyBhcmUgYWxzbyBzcGVjaWFsXG4gICAgICAgIGlmICh1bml0cyA9PT0gJ3F1YXJ0ZXInKSB7XG4gICAgICAgICAgICB0aGlzLm1vbnRoKE1hdGguZmxvb3IodGhpcy5tb250aCgpIC8gMykgKiAzKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGVuZE9mKHVuaXRzKSB7XG4gICAgICAgIHVuaXRzID0gbm9ybWFsaXplVW5pdHModW5pdHMpO1xuICAgICAgICBpZiAodW5pdHMgPT09IHVuZGVmaW5lZCB8fCB1bml0cyA9PT0gJ21pbGxpc2Vjb25kJykge1xuICAgICA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vICh0cnVlLCBmbXQsIDUpXG4gICAgLy8gKHRydWUsIGZtdClcbiAgICBmdW5jdGlvbiBsaXN0V2Vla2RheXNJbXBsKGxvY2FsZVNvcnRlZCwgZm9ybWF0LCBpbmRleCwgZmllbGQpIHtcbiAgICAgICAgaWYgKHR5cGVvZiBsb2NhbGVTb3J0ZWQgPT09ICdib29sZWFuJykge1xuICAgICAgICAgICAgaWYgKGlzTnVtYmVyKGZvcm1hdCkpIHtcbiAgICAgICAgICAgICAgICBpbmRleCA9IGZvcm1hdDtcbiAgICAgICAgICAgICAgICBmb3JtYXQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZvcm1hdCA9IGZvcm1hdCB8fCAnJztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGZvcm1hdCA9IGxvY2FsZVNvcnRlZDtcbiAgICAgICAgICAgIGluZGV4ID0gZm9ybWF0O1xuICAgICAgICAgICAgbG9jYWxlU29ydGVkID0gZmFsc2U7XG5cbiAgICAgICAgICAgIGlmIChpc051bWJlcihmb3JtYXQpKSB7XG4gICAgICAgICAgICAgICAgaW5kZXggPSBmb3JtYXQ7XG4gICAgICAgICAgICAgICAgZm9ybWF0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmb3JtYXQgPSBmb3JtYXQgfHwgJyc7XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgbG9jYWxlID0gZ2V0TG9jYWxlKCksXG4gICAgICAgICAgICBzaGlmdCA9IGxvY2FsZVNvcnRlZCA/IGxvY2FsZS5fd2Vlay5kb3cgOiAwO1xuXG4gICAgICAgIGlmIChpbmRleCAhPSBudWxsKSB7XG4gICAgICAgICAgICByZXR1cm4gZ2V0JDEoZm9ybWF0LCAoaW5kZXggKyBzaGlmdCkgJSA3LCBmaWVsZCwgJ2RheScpO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIGk7XG4gICAgICAgIHZhciBvdX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AgICAgICAgbW9udGhzICU9IDEyO1xuXG4gICAgICAgIGRhdGEuZGF5cyA9IGRheXM7XG4gICAgICAgIGRhdGEubW9udGhzID0gbW9udGhzO1xuICAgICAgICBkYXRhLnllYXJzID0geWVhcnM7XG5cbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZGF5c1RvTW9udGhzKGRheXMpIHtcbiAgICAgICAgLy8gNDAwIHllYXJzIGhhdmUgMTQ2MDk3IGRheXMgKHRha2luZyBpbnRvIGFjY291bnQgbGVhcCB5ZWFyIHJ1bGVzKVxuICAgICAgICAvLyA0MDAgeWVhcnMgaGF2ZSAxMiBtb250aHMgPT09IDQ4MDBcbiAgICAgICAgcmV0dXJuIGRheXMgKiA0ODAwIC8gMTQ2MDk3O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIG1vbnRoc1RvRGF5cyhtb250aHMpIHtcbiAgICAgICAgLy8gdGhlIHJldmVyc2Ugb2YgZGF5c1RvTW9udGhzXG4gICAgICAgIHJldHVybiBtb250aHMgKiAxNDYwOTcgLyA0ODAwO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGFzKHVuaXRzKSB7XG4gICAgICAgIGlmICghdGhpcy5pc1ZhbGlkKCkpIHtcbiAgICAgICAgICAgIHJldHVybiBOYU47XG4gICAgICAgIH1cbiAgICAgICAgdmFyIGRheXM7XG4gICAgICAgIHZhciBtb250aHM7XG4gICAgICAgIHZhciBtaWxsaXNlY29uZHMgPSB0aGlzLl9taWxsaXNlY29uZHM7XG5cbiAgICAgICAgdW5pdHMgPSBub3JtYWxpemVVbml0cyh1bml0cyk7XG5cbiAgICAgICAgaWYgKHVuaXRzID09PSAnbW9udGgnIHx8IHVuaXRzID09PSAneWVhcicpIHtcbiAgICAgICAgICAgIGRheXMgPSB0aGlzLl9kYXlzICsgbWlsbGlzZWNvbmRzIC8gODY0ZTU7XG4gICAgICAgICAgICBtb250aHMgPSB0aGlzLl9tb250aHMgKyBkYXlzVG9Nb250aHMoZGF5cyk7XG4gICAgICAgICAgICByZXR1cm4gdW5pdHMgPT09ICdtb250aCcgPyBtb250aHMgOiBtb250aHMgLyAxMjtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIC8vIGhhbmRsZSBtaWxsaXNlY29uZHMgc2VwYXJhdGVseSBiZWNhdXNlIG9mIGZsb2F0aW5nIHBvaW50IG1hdGggZXJyb3JzIChpc3N1ZSAjMTg2NylcbiAgICAgICAgICAgIGRheXMgPSB0aGlzLl9kYXlzICsgTWF0aC5yb3VuZChtb250aHNUb0RheXModGhpcy5fbW9udGhzKSk7XG4gICAgICAgICAgICBzd2l0Y2ggKHVuaXRzKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAnd2Vlayc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBkYXlzIC8gNyArIG1pbGxpc2Vjb25kcyAvIDYwNDhlNTtcbiAgICAgICAgICAgICAgICBjYXNlICdkYXknOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZGF5cyArIG1pbGxpc2Vjb25kcyAvIDg2NGU1O1xuICAgICAgICAgICAgICAgIGNhc2UgJ2hvdXInOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZGF5cyAqIDI0ICsgbWlsbGlzZWNvbmRzIC8gMzZlNTtcbiAgICAgICAgICAgICAgICBjYXNlICdtaW51dGUnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZGF5cyAqIDE0NDAgKyBtaWxsaXNlY29uZHMgLyA2ZTQ7XG4gICAgICAgICAgICAgICAgY2FzZSAnc2Vjb25kJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRheXMgKiA4NjQwMCArIG1pbGxpc2Vjb25kcyAvIDEwMDA7XG4gICAgICAgICAgICAgICAgLy8gTWF0aC5mbG9vciBwcmV2ZW50cyBmbG9hdGluZyBwb2ludCBtYXRoIGVycm9ycyBoZXJlXG4gICAgICAgICAgICAgICAgY2FzZSAnbWlsbGlzZWNvbmQnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gTWF0aC5mbG9vcihkYXlzICogODY0ZTUpICsgbWlsbGlzZWNvbmRzO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignVW5rbm93biB1bml0ICcgKyB1bml0cyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBUT0RPOiBVc2UgdGhpcy5hcygnbXMnKT9cbiAgICBmdW5jdGlvbiB2YWx1ZU9mJDEoKSB7XG4gICAgICAgIGlmICghdGhpcy5pc1ZhbGlkKCkpIHtcbiAgICAgICAgICAgIHJldHVybiBOYU47XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMuX21pbGxpc2Vjb25kcyArIHRoaXMuX2RheXMgKiA4NjRlNSArIHRoaXMuX21vbnRocyAlIDEyICogMjU5MmU2ICsgdG9JbnQodGhpcy5fbW9udGhzIC8gMTIpICogMzE1MzZlNjtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBtYWtlQXMoYWxpYXMpIHtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLmFzKGFsaWFzKTtcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICB2YXIgYXNNaWxsaXNlY29uZHMgPSBtYWtlQXMoJ21zJyk7XG4gICAgdmFyIGFzU2Vjb25kcyA9IG1ha2VBcygncycpO1xuICAgIHZhciBhc01pbnV0ZXMgPSBtYWtlQXMoJ20nKTtcbiAgICB2YXIgYXNIb3VycyA9IG1ha2VBcygnaCcpO1xuICAgIHZhciBhc0RheXMgPSBtYWtlQXMoJ2QnKTtcbiAgICB2YXIgYXNXZWVrcyA9IG1ha2VBcygndycpO1xuICAgIHZhciBhc01vbnRocyA9IG1ha2VBcygnTScpO1xuICAgIHZhciBhc1llYXJzID0gbWFrZUFzKCd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pZERhdGUoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBzZWNvbmRzID0gYWJzJDEodGhpcy5fbWlsbGlzZWNvbmRzKSAvIDEwMDA7XG4gICAgICAgIHZhciBkYXlzID0gYWJzJDEodGhpcy5fZGF5cyk7XG4gICAgICAgIHZhciBtb250aHMgPSBhYnMkMSh0aGlzLl9tb250aHMpO1xuICAgICAgICB2YXIgbWludXRlcywgaG91cnMsIHllYXJzO1xuXG4gICAgICAgIC8vIDM2MDAgc2Vjb25kcyAtPiA2MCBtaW51dGVzIC0+IDEgaG91clxuICAgICAgICBtaW51dGVzID0gYWJzRmxvb3Ioc2Vjb25kcyAvIDYwKTtcbiAgICAgICAgaG91cnMgPSBhYnNGbG9vcihtaW51dGVzIC8gNjApO1xuICAgICAgICBzZWNvbmRzICU9IDYwO1xuICAgICAgICBtaW51dGVzICU9IDYwO1xuXG4gICAgICAgIC8vIDEyIG1vbnRocyAtPiAxIHllYXJcbiAgICAgICAgeWVhcnMgPSBhYnNGbG9vcihtb250aHMgLyAxMik7XG4gICAgICAgIG1vbnRocyAlPSAxMjtcblxuICAgICAgICAvLyBpbnNwaXJlZCBieSBodHRwczovL2dpdGh1Yi5jb20vZG9yZGlsbGUvbW9tZW50LWlzb2R1cmF0aW9uL2Jsb2IvbWFzdGVyL21vbWVudC5pc29kdXJhdGlvbi5qc1xuICAgICAgICB2YXIgWSA9IHllYXJzO1xuICAgICAgICB2YXIgTSA9IG1vbnRocztcbiAgICAgICAgdmFyIEQgPSBkYXlzO1xuICAgICAgICB2YXIgaCA9IGhvdXJzO1xuICAgICAgICB2YXIgbSA9IG1pbnV0ZXM7XG4gICAgICAgIHZhciBzID0gc2Vjb25kcyA/IHNlY29uZHMudG9GaXhlZCgzKS5yZXBsYWNlKC9cXC4/MCskLywgJycpIDogJyc7XG4gICAgICAgIHZhciB0b3RhbCA9IHRoaXMuYXNTZWNvbmRzKCk7XG5cbiAgICAgICAgaWYgKCF0b3RhbCkge1xuICAg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cGFyc2UoKSB7XG4gICAgICAgIHZhciBhcmd1bWVudHMkMSA9IGFyZ3VtZW50cztcblxuICAgICAgICBmb3IgKHZhciBfbGVuMiA9IGFyZ3VtZW50cy5sZW5ndGgsIGFyZ3MgPSBBcnJheShfbGVuMiksIF9rZXkyID0gMDsgX2tleTIgPCBfbGVuMjsgX2tleTIrKykge1xuICAgICAgICAgIGFyZ3NbX2tleTJdID0gYXJndW1lbnRzJDFbX2tleTJdO1xuICAgICAgICB9XG5cbiAgICAgICAgYXJncyA9IEFycmF5LnByb3RvdHlwZS5zbGljZS5jYWxsKGFyZ3MpO1xuICAgICAgICB2YXIgbWV0aG9kID0gYXJncy5zaGlmdCgpO1xuXG4gICAgICAgIHN3aXRjaCAobWV0aG9kKSB7XG4gICAgICAgICAgY2FzZSAnYWRkJzpcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgLypcbiAgICAgICAgICAgICAgKiBNdXRhdGVzIHRoZSBvcmlnaW5hbCBtb21lbnQgYnkgYWRkaW5nIHRpbWUuXG4gICAgICAgICAgICAgICogaHR0cDovL21vbWVudGpzLmNvbS9kb2NzLyMvbWFuaXB1bGF0aW5nL2FkZC9cbiAgICAgICAgICAgICAgKi9cblxuICAgICAgICAgICAgICB2YXIgYWRkZW5kcyA9IGFyZ3Muc2hpZnQoKS5zcGxpdCgnLCcpLm1hcChGdW5jdGlvbi5wcm90b3R5cGUuY2FsbCwgU3RyaW5nLnByb3RvdHlwZS50cmltKTtcbiAgICAgICAgICAgICAgdmFyIG9iaiA9IHt9O1xuXG4gICAgICAgICAgICAgIGZvciAodmFyIG4gPSAwOyBuIDwgYWRkZW5kcy5sZW5ndGg7IG4rKykge1xuICAgICAgICAgICAgICAgIHZhciBhZGRlbmQgPSBhZGRlbmRzW25dLnNwbGl0KCcgJyk7XG4gICAgICAgICAgICAgICAgb2JqW2FkZGVuZFsxXV0gPSBhZGRlbmRbMF07XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgZGF0ZS5hZGQob2JqKTtcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICBjYXNlICdzdWJ0cmFjdCc6XG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIC8qXG4gICAgICAgICAgICAgICogTXV0YXRlcyB0aGUgb3JpZ2luYWwgbW9tZW50IGJ5IHN1YnRyYWN0aW5nIHRpbWUuXG4gICAgICAgICAgICAgICogaHR0cDovL21vbWVudGpzLmNvbS9kb2NzLyMvbWFuaXB1bGF0aW5nL3N1YnRyYWN0L1xuICAgICAgICAgICAgICAqL1xuXG4gICAgICAgICAgICAgIHZhciBzdWJ0cmFoZW5kcyA9IGFyZ3Muc2hpZnQoKS5zcGxpdCgnLCcpLm1hcChGdW5jdGlvbi5wcm90b3R5cGUuY2FsbCwgU3RyaW5nLnByb3RvdHlwZS50cmltKTtcbiAgICAgICAgICAgICAgdmFyIF9vYmogPSB7fTtcblxuICAgICAgICAgICAgICBmb3IgKHZhciBfbiA9IDA7IF9uIDwgc3VidHJhaGVuZHMubGVuZ3RoOyBfbisrKSB7XG4gICAgICAgICAgICAgICAgdmFyIHN1YnRyYWhlbmQgPSBzdWJ0cmFoZW5kc1tfbl0uc3BsaXQoJyAnKTtcbiAgICAgICAgICAgICAgICBfb2JqW3N1YnRyYWhlbmRbMV1dID0gc3VidHJhaGVuZFswXTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBkYXRlLnN1YnRyYWN0KF9vYmopO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgIGNhc2UgJ2Zyb20nOlxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAvKlxuICAgICAgICAgICAgICAqIERpc3BsYXkgYSBtb21lbnQgaW4gcmVsYXRpdmUgdGltZSwgZWl0aGVyIGZyb20gbm93IG9yIGZyb20gYSBzcGVjaWZpZWQgZGF0ZS5cbiAgICAgICAgICAgICAgKiBodHRwOi8vbW9tZW50anMuY29tL2RvY3MvIy9kaXNwbGF5aW5nL2Zyb21ub3cvXG4gICAgICAgICAgICAgICovXG5cbiAgICAgICAgICAgICAgdmFyIGZyb20gPSAnbm93JztcbiAgICAgICAgICAgICAgdmFyIHJlbW92ZVN1ZmZpeCA9IGZhbHNlO1xuXG4gICAgICAgICAgICAgIGlmIChhcmdzWzBdID09PSAnbm93JykgeyBhcmdzLnNoaWZ0KCk7IH1cbiAgICAgICAgICAgICAgLy8gSWYgdmFsaWQsIGFzc3VtZSBpdCBpcyBhIGRhdGUgd2Ugd2FudCB0aGUgb3V0cHV0IGNvbXB1dGVkIGFnYWluc3QuXG4gICAgICAgICAgICAgIGlmIChtb21lbnQkJDEoYXJnc1swXSkuaXNWYWxpZCgpKSB7IGZyb20gPSBtb21lbnQkJDEoYXJncy5zaGlmdCgpKTsgfVxuXG4gICAgICAgICAgICAgIGlmIChhcmdzWzBdID09PSB0cnVlKSB7XG4gICAgICAgICAgICAgICAgYXJncy5zaGlmdCgpO1xuICAgICAgICAgICAgICAgIHJlbW92ZVN1ZmZpeCA9IHRydWU7XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBpZiAoZnJvbSAhPT0gJ25vdycpIHtcbiAgICAgICAgICAgICAgICBkYXRlID0gZGF0ZS5mcm9tKGZyb20sIHJlbW92ZVN1ZmZpeCk7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgZGF0ZSA9IGRhdGUuZnJvbU5vdyhyZW1vdmVTdWZmaXgpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgY2FzZSAnZGlmZic6XG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIC8qXG4gICAgICAgICAgICAgICogTXV0YXRlcyB0aGUgb3JpZ2luYWwgbW9tZW50IGJ5IGRvaW5nIGEgZGlmZmVyZW5jZSB3aXRoIGFub3RoZXIgZGF0ZS5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2hpZnQoKTsgfVxuXG4gICAgICAgICAgICAgIGRhdGUgPSBkYXRlLmNhbGVuZGFyKF9yZWZlcmVuY2VUaW1lLCBmb3JtYXRzKTtcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICBjYXNlICd1dGMnOlxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAvKlxuICAgICAgICAgICAgICAqIE11dGF0ZXMgdGhlIG9yaWdpbmFsIG1vbWVudCBieSBjb252ZXJ0aW5nIHRvIFVUQ1xuICAgICAgICAgICAgICAqIGh0dHBzOi8vbW9tZW50anMuY29tL2RvY3MvIy9tYW5pcHVsYXRpbmcvdXRjL1xuICAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgICBkYXRlLnV0YygpO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgIGNhc2UgJ3RpbWV6b25lJzpcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgLypcbiAgICAgICAgICAgICAgKiBNdXRhdGVzIHRoZSBvcmlnaW5hbCBtb21lbnQgYnkgY29udmVydGluZyB0byBhIG5ldyB0aW1lem9uZS5cbiAgICAgICAgICAgICAgKiBodHRwczovL21vbWVudGpzLmNvbS90aW1lem9uZS9kb2NzLyMvdXNpbmctdGltZXpvbmVzL2NvbnZlcnRpbmctdG8tem9uZS9cbiAgICAgICAgICAgICAgKi9cbiAgICAgICAgICAgICAgZGF0ZS50eihhcmdzLnNoaWZ0KCkpO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIC8qXG4gICAgICAgICAgICAgICogRm9ybWF0cyBhIGRhdGUgYnkgdGFraW5nIGEgc3RyaW5nIG9mIHRva2VucyBhbmQgcmVwbGFjaW5nXG4gICAgICAgICAgICAgICogdGhlbSB3aXRoIHRoZWlyIGNvcnJlc3Bv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c2xpY2UoMCwgMyk7XG59XG5cbmZ1bmN0aW9uIGdldEFscGhhKHN0cmluZykge1xuICAgdmFyIHZhbHMgPSBnZXRSZ2JhKHN0cmluZyk7XG4gICBpZiAodmFscykge1xuICAgICAgcmV0dXJuIHZhbHNbM107XG4gICB9XG4gICBlbHNlIGlmICh2YWxzID0gZ2V0SHNsYShzdHJpbmcpKSB7XG4gICAgICByZXR1cm4gdmFsc1szXTtcbiAgIH1cbiAgIGVsc2UgaWYgKHZhbHMgPSBnZXRId2Ioc3RyaW5nKSkge1xuICAgICAgcmV0dXJuIHZhbHNbM107XG4gICB9XG59XG5cbi8vIGdlbmVyYXRvcnNcbmZ1bmN0aW9uIGhleFN0cmluZyhyZ2JhLCBhKSB7XG4gICB2YXIgYSA9IChhICE9PSB1bmRlZmluZWQgJiYgcmdiYS5sZW5ndGggPT09IDMpID8gYSA6IHJnYmFbM107XG4gICByZXR1cm4gXCIjXCIgKyBoZXhEb3VibGUocmdiYVswXSkgXG4gICAgICAgICAgICAgICsgaGV4RG91YmxlKHJnYmFbMV0pXG4gICAgICAgICAgICAgICsgaGV4RG91YmxlKHJnYmFbMl0pXG4gICAgICAgICAgICAgICsgKFxuICAgICAgICAgICAgICAgICAoYSA+PSAwICYmIGEgPCAxKVxuICAgICAgICAgICAgICAgICA/IGhleERvdWJsZShNYXRoLnJvdW5kKGEgKiAyNTUpKVxuICAgICAgICAgICAgICAgICA6IFwiXCJcbiAgICAgICAgICAgICAgKTtcbn1cblxuZnVuY3Rpb24gcmdiU3RyaW5nKHJnYmEsIGFscGhhKSB7XG4gICBpZiAoYWxwaGEgPCAxIHx8IChyZ2JhWzNdICYmIHJnYmFbM10gPCAxKSkge1xuICAgICAgcmV0dXJuIHJnYmFTdHJpbmcocmdiYSwgYWxwaGEpO1xuICAgfVxuICAgcmV0dXJuIFwicmdiKFwiICsgcmdiYVswXSArIFwiLCBcIiArIHJnYmFbMV0gKyBcIiwgXCIgKyByZ2JhWzJdICsgXCIpXCI7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0tLS0tLS0tLS0tLS0tLS0tLS0tLS18XG5cdFx0Ly8gfCAgICAgICAgICAgICAgICAgIFQxIChGdWxsIFdpZHRoKSAgICAgICAgICAgICAgICAgICB8XG5cdFx0Ly8gfC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS18XG5cdFx0Ly8gfCAgICB8ICAgIHwgICAgICAgICAgICAgICAgIFQyICAgICAgICAgICAgICAgICAgfCAgICB8XG5cdFx0Ly8gfCAgICB8LS0tLXwtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tfC0tLS18XG5cdFx0Ly8gfCAgICB8ICAgIHwgQzEgfCAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgQzIgfCAgICB8XG5cdFx0Ly8gfCAgICB8ICAgIHwtLS0tfCAgICAgICAgICAgICAgICAgICAgICAgICAgIHwtLS0tfCAgICB8XG5cdFx0Ly8gfCAgICB8ICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICB8XG5cdFx0Ly8gfCBMMSB8IEwyIHwgICAgICAgICAgIENoYXJ0QXJlYSAoQzApICAgICAgICAgICAgfCBSMSB8XG5cdFx0Ly8gfCAgICB8ICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICB8XG5cdFx0Ly8gfCAgICB8ICAgIHwtLS0tfCAgICAgICAgICAgICAgICAgICAgICAgICAgIHwtLS0tfCAgICB8XG5cdFx0Ly8gfCAgICB8ICAgIHwgQzMgfCAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgQzQgfCAgICB8XG5cdFx0Ly8gfCAgICB8LS0tLXwtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tfC0tLS18XG5cdFx0Ly8gfCAgICB8ICAgIHwgICAgICAgICAgICAgICAgIEIxICAgICAgICAgICAgICAgICAgfCAgICB8XG5cdFx0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ZGUgPSBzdHJpY3RFbmNvZGVVUklDb21wb25lbnQ7XG4gICAgVVJJLmRlY29kZSA9IGRlY29kZVVSSUNvbXBvbmVudDtcbiAgfTtcbiAgVVJJLmNoYXJhY3RlcnMgPSB7XG4gICAgcGF0aG5hbWU6IHtcbiAgICAgIGVuY29kZToge1xuICAgICAgICAvLyBSRkMzOTg2IDIuMTogRm9yIGNvbnNpc3RlbmN5LCBVUkkgcHJvZHVjZXJzIGFuZCBub3JtYWxpemVycyBzaG91bGRcbiAgICAgICAgLy8gdXNlIHVwcGVyY2FzZSBoZXhhZGVjaW1hbCBkaWdpdHMgZm9yIGFsbCBwZXJjZW50LWVuY29kaW5ncy5cbiAgICAgICAgZXhwcmVzc2lvbjogLyUoMjR8MjZ8MkJ8MkN8M0J8M0R8M0F8NDApL2lnLFxuICAgICAgICBtYXA6IHtcbiAgICAgICAgICAvLyAtLl9+IScoKSpcbiAgICAgICAgICAnJTI0JzogJyQnLFxuICAgICAgICAgICclMjYnOiAnJicsXG4gICAgICAgICAgJyUyQic6ICcrJyxcbiAgICAgICAgICAnJTJDJzogJywnLFxuICAgICAgICAgICclM0InOiAnOycsXG4gICAgICAgICAgJyUzRCc6ICc9JyxcbiAgICAgICAgICAnJTNBJzogJzonLFxuICAgICAgICAgICclNDAnOiAnQCdcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIGRlY29kZToge1xuICAgICAgICBleHByZXNzaW9uOiAvW1xcL1xcPyNdL2csXG4gICAgICAgIG1hcDoge1xuICAgICAgICAgICcvJzogJyUyRicsXG4gICAgICAgICAgJz8nOiAnJTNGJyxcbiAgICAgICAgICAnIyc6ICclMjMnXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9LFxuICAgIHJlc2VydmVkOiB7XG4gICAgICBlbmNvZGU6IHtcbiAgICAgICAgLy8gUkZDMzk4NiAyLjE6IEZvciBjb25zaXN0ZW5jeSwgVVJJIHByb2R1Y2VycyBhbmQgbm9ybWFsaXplcnMgc2hvdWxkXG4gICAgICAgIC8vIHVzZSB1cHBlcmNhc2UgaGV4YWRlY2ltYWwgZGlnaXRzIGZvciBhbGwgcGVyY2VudC1lbmNvZGluZ3MuXG4gICAgICAgIGV4cHJlc3Npb246IC8lKDIxfDIzfDI0fDI2fDI3fDI4fDI5fDJBfDJCfDJDfDJGfDNBfDNCfDNEfDNGfDQwfDVCfDVEKS9pZyxcbiAgICAgICAgbWFwOiB7XG4gICAgICAgICAgLy8gZ2VuLWRlbGltc1xuICAgICAgICAgICclM0EnOiAnOicsXG4gICAgICAgICAgJyUyRic6ICcvJyxcbiAgICAgICAgICAnJTNGJzogJz8nLFxuICAgICAgICAgICclMjMnOiAnIycsXG4gICAgICAgICAgJyU1Qic6ICdbJyxcbiAgICAgICAgICAnJTVEJzogJ10nLFxuICAgICAgICAgICclNDAnOiAnQCcsXG4gICAgICAgICAgLy8gc3ViLWRlbGltc1xuICAgICAgICAgICclMjEnOiAnIScsXG4gICAgICAgICAgJyUyNCc6ICckJyxcbiAgICAgICAgICAnJTI2JzogJyYnLFxuICAgICAgICAgICclMjcnOiAnXFwnJyxcbiAgICAgICAgICAnJTI4JzogJygnLFxuICAgICAgICAgICclMjknOiAnKScsXG4gICAgICAgICAgJyUyQSc6ICcqJyxcbiAgICAgICAgICAnJTJCJzogJysnLFxuICAgICAgICAgICclMkMnOiAnLCcsXG4gICAgICAgICAgJyUzQic6ICc7JyxcbiAgICAgICAgICAnJTNEJzogJz0nXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9LFxuICAgIHVybnBhdGg6IHtcbiAgICAgIC8vIFRoZSBjaGFyYWN0ZXJzIHVuZGVyIGBlbmNvZGVgIGFyZSB0aGUgY2hhcmFjdGVycyBjYWxsZWQgb3V0IGJ5IFJGQyAyMTQxIGFzIGJlaW5nIGFjY2VwdGFibGVcbiAgICAgIC8vIGZvciB1c2FnZSBpbiBhIFVSTi4gUkZDMjE0MSBhbHNvIGNhbGxzIG91dCBcIi1cIiwgXCIuXCIsI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W9uKHYsIGJ1aWxkKSB7XG4gICAgaWYgKHRoaXMuX3BhcnRzLnVybikge1xuICAgICAgcmV0dXJuIHYgPT09IHVuZGVmaW5lZCA/ICcnIDogdGhpcztcbiAgICB9XG5cbiAgICBpZiAodiA9PT0gdW5kZWZpbmVkIHx8IHYgPT09IHRydWUpIHtcbiAgICAgIGlmICghdGhpcy5fcGFydHMucGF0aCB8fCB0aGlzLl9wYXJ0cy5wYXRoID09PSAnLycpIHtcbiAgICAgICAgcmV0dXJuICcnO1xuICAgICAgfVxuXG4gICAgICB2YXIgZmlsZW5hbWUgPSB0aGlzLmZpbGVuYW1lKCk7XG4gICAgICB2YXIgcG9zID0gZmlsZW5hbWUubGFzdEluZGV4T2YoJy4nKTtcbiAgICAgIHZhciBzLCByZXM7XG5cbiAgICAgIGlmIChwb3MgPT09IC0xKSB7XG4gICAgICAgIHJldHVybiAnJztcbiAgICAgIH1cblxuICAgICAgLy8gc3VmZml4IG1heSBvbmx5IGNvbnRhaW4gYWxudW0gY2hhcmFjdGVycyAoeXVwLCBJIG1hZGUgdGhpcyB1cC4pXG4gICAgICBzID0gZmlsZW5hbWUuc3Vic3RyaW5nKHBvcysxKTtcbiAgICAgIHJlcyA9ICgvXlthLXowLTklXSskL2kpLnRlc3QocykgPyBzIDogJyc7XG4gICAgICByZXR1cm4gdiA/IFVSSS5kZWNvZGVQYXRoU2VnbWVudChyZXMpIDogcmVzO1xuICAgIH0gZWxzZSB7XG4gICAgICBpZiAodi5jaGFyQXQoMCkgPT09ICcuJykge1xuICAgICAgICB2ID0gdi5zdWJzdHJpbmcoMSk7XG4gICAgICB9XG5cbiAgICAgIHZhciBzdWZmaXggPSB0aGlzLnN1ZmZpeCgpO1xuICAgICAgdmFyIHJlcGxhY2U7XG5cbiAgICAgIGlmICghc3VmZml4KSB7XG4gICAgICAgIGlmICghdikge1xuICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5fcGFydHMucGF0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B9fSxzdHlsZTpmdW5jdGlvbigpe3JldHVybihcIlwiIT09dGhpcy5jb2xvcj9cImNvbG9yOiBcIit0aGlzLmNvbG9yK1wiO1wiOlwiXCIpKyhcIlwiIT09dGhpcy53aWR0aD9cIndpZHRoOiBcIit0aGlzLndpZHRoK1wicHg7XCI6XCJcIikrKFwiXCIhPT10aGlzLmhlaWdodD9cImhlaWdodDogXCIrdGhpcy5oZWlnaHQrXCJweDtcIjpcIlwiKX19fX0pO1xuLy8jIHNvdXJjZU1hcHBpbmdVUkw9dnVlLXNwaW5raXQubWluLmpzLm1hcFxuIl0sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBY0E7Ozs7OztBQ1BBOzs7Ozs7Ozs7OztBQ29CQTs7Ozs7OztBQ3JCQTs7Ozs7OztBQ0FBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUNRQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQ0ZBOzs7Ozs7QUNQQSIsInNvdXJjZVJvb3QiOiIifQ== \ No newline at end of file diff --git a/Clockwork/Web/public/precache-manifest.60580a4a01df21af4b92012884177b63.js b/Clockwork/Web/public/precache-manifest.60580a4a01df21af4b92012884177b63.js deleted file mode 100644 index 0d133ddf..00000000 --- a/Clockwork/Web/public/precache-manifest.60580a4a01df21af4b92012884177b63.js +++ /dev/null @@ -1,18 +0,0 @@ -self.__precacheManifest = [ - { - "revision": "27f9d6bf662609d9c263", - "url": "css/app.c0baaa16.css" - }, - { - "revision": "27f9d6bf662609d9c263", - "url": "js/app.fe8ebfde.js" - }, - { - "revision": "d70b6adec04e39b28c68", - "url": "js/chunk-vendors.de559e1a.js" - }, - { - "revision": "c6bc180e72cf7813846da67d321afb39", - "url": "index.html" - } -]; \ No newline at end of file diff --git a/Clockwork/Web/public/precache-manifest.7001230d47cfb6c10a9439330c17a5e2.js b/Clockwork/Web/public/precache-manifest.7001230d47cfb6c10a9439330c17a5e2.js new file mode 100644 index 00000000..5c020aec --- /dev/null +++ b/Clockwork/Web/public/precache-manifest.7001230d47cfb6c10a9439330c17a5e2.js @@ -0,0 +1,50 @@ +self.__precacheManifest = [ + { + "revision": "5e3a02c36b4e5e2a9e38", + "url": "css/app.af135e9c.css" + }, + { + "revision": "5e3a02c36b4e5e2a9e38", + "url": "js/app.648811c2.js" + }, + { + "revision": "9b438ea0b3dc7b4a5be1", + "url": "js/chunk-vendors.b6cbf595.js" + }, + { + "revision": "2fb83bc56cee691a7facbd3c80f3275f", + "url": "index.html" + }, + { + "revision": "611a8f3ac0aa856f4018f676d719c67f", + "url": "img/appearance-auto-icon.png" + }, + { + "revision": "2439692fa652a49e5c3d820fd67cdc27", + "url": "img/appearance-light-icon.png" + }, + { + "revision": "4a9a5b7dee3fc2c7d2a684e63c447b55", + "url": "img/appearance-dark-icon.png" + }, + { + "revision": "cda1fba54a095fd43346d9f3fe06669a", + "url": "img/whats-new/4.1/commands-profiling.png" + }, + { + "revision": "03d36de2be5c98c325c6d7b115f81ace", + "url": "img/whats-new/4.1/extended-timeline.png" + }, + { + "revision": "bdb3d5c5df863ae277204f869eb12ed7", + "url": "img/whats-new/4.1/queue-jobs-profiling.png" + }, + { + "revision": "2ad52c54fbe33fd038d800d1f634bbaf", + "url": "img/whats-new/4.1/new-settings-modal.png" + }, + { + "revision": "40982c718da4cf42285e32d3e1a9649f", + "url": "img/whats-new/4.1/tests-profiling.png" + } +]; \ No newline at end of file diff --git a/Clockwork/Web/public/service-worker.js b/Clockwork/Web/public/service-worker.js index d61657b3..792cf881 100644 --- a/Clockwork/Web/public/service-worker.js +++ b/Clockwork/Web/public/service-worker.js @@ -14,7 +14,7 @@ importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js"); importScripts( - "precache-manifest.60580a4a01df21af4b92012884177b63.js" + "precache-manifest.7001230d47cfb6c10a9439330c17a5e2.js" ); workbox.core.setCacheNameDetails({prefix: "Clockwork"});