diff --git a/Aeria/Aeria.php b/Aeria/Aeria.php index d2f87d7..1336e90 100755 --- a/Aeria/Aeria.php +++ b/Aeria/Aeria.php @@ -25,7 +25,7 @@ class Aeria extends Container { - public const VERSION = '3.0.1'; + public const VERSION = '3.0.2'; public function __construct() { diff --git a/Aeria/Config/Config.php b/Aeria/Config/Config.php index a77edf7..0b03c71 100755 --- a/Aeria/Config/Config.php +++ b/Aeria/Config/Config.php @@ -27,6 +27,7 @@ class Config implements ExtensibleInterface, JsonSerializable, ValidateConfInter protected $drivers = []; protected $root_path = ''; protected $active_driver = 'json'; + private $_kind; public function __construct() { @@ -36,19 +37,151 @@ public function __construct() public function getValidationStructure() : array { + switch ($this->_kind){ + case 'meta': + $spec = [ + 'title' => $this->makeRegExValidator( + "/^.{1,30}$/" + ), + 'context' => $this->makeRegExValidator( + "/^normal|side|advanced$/" + ), + 'post_type' => function ($value) { + return [ + 'result' => is_array($value), + 'message' => 'post_type should be an array' + ]; + }, + 'fields' => function ($value) { + return [ + 'result' => is_array($value), + 'message' => 'fields should be an array' + ]; + } + ]; + break; + case 'post-type': + $spec = [ + 'menu_icon' => $this->makeRegExValidator( + "/^[a-z0-9_-]{1,30}$/" + ), + 'labels' => function ($value) { + return [ + 'result' => is_array($value), + 'message' => 'labels should be an array' + ]; + }, + 'public' => function ($value) { + return [ + 'result' => is_bool($value), + 'message' => 'public should be a bool' + ]; + }, + 'show_ui' => function ($value) { + return [ + 'result' => is_bool($value), + 'message' => 'show_ui should be a bool' + ]; + }, + 'show_in_menu' => function ($value) { + return [ + 'result' => is_bool($value), + 'message' => 'show_in_menu should be a bool' + ]; + }, + 'menu_position' => function ($value) { + return [ + 'result' => is_int($value), + 'message' => 'menu_position should be an int' + ]; + } + ]; + break; + case 'taxonomy': + $spec = [ + 'label' => $this->makeRegExValidator( + "/^.{1,30}$/" + ), + 'labels' => function ($value) { + return [ + 'result' => is_array($value), + 'message' => 'labels should be an array' + ]; + } + ]; + break; + case 'section': + $spec = [ + 'id' => $this->makeRegExValidator( + "/^[a-z0-9_-]{1,20}$/" + ), + 'label' => $this->makeRegExValidator( + "/^.{1,30}$/" + ), + 'description' => $this->makeRegExValidator( + "/^.{1,60}$/" + ), + 'fields' => function ($value) { + return [ + 'result' => is_array($value), + 'message' => 'fields should be an array' + ]; + } + ]; + break; + case 'controller': + $spec = [ + 'namespace' => $this->makeRegExValidator( + "/^[A-Za-z0-9_-]{1,30}$/" + ), + ]; + break; + case 'route': + $spec = [ + 'path' => $this->makeRegExValidator( + "/^[a-z0-9_-]{1,20}$/" + ), + 'method' => $this->makeRegExValidator( + "/^POST|GET|PUT|DELETE$/" + ), + 'handler' => $this->makeRegExValidator( + "/^[a-z0-9_-]{1,50}$/" + ) + ]; + break; + case 'options': + $spec = [ + 'title' => $this->makeRegExValidator( + "/^.{1,40}$/" + ), + 'menu-slug' => $this->makeRegExValidator( + "/^[a-z0-9_-]{1,20}$/" + ), + 'capability' => $this->makeRegExValidator( + "/^[a-z0-9_-]{1,30}$/" + ), + 'parent' => $this->makeRegExValidator( + "/^[a-z0-9_-]{1,30}$/" + ), + 'fields' => function ($value) { + return [ + 'result' => is_array($value), + 'message' => 'fields should be an array' + ]; + } + ]; + break; + default: + $spec = []; + break; + } return [ 'name' => $this->makeRegExValidator( "/^[a-z0-9_-]{1,20}$/" ), - 'spec' => function ($value) { - return [ - 'result' => is_array($value), - 'message' => 'Spec should be an array' - ]; - }, + 'spec' => $spec, 'kind' => $this->makeRegExValidator( - // TODO: Aggiungere i vari tipi nella validazione - "/^post-type|renderer|taxonomy|meta|section|controller|route|options$/" + "/^post-type|taxonomy|meta|section|controller|route|options$/" ) ]; } @@ -124,6 +257,7 @@ protected static function createNamespaceTree( public function isValidStandardConfiguration($data) { + $this->_kind = $data['kind']; $exeption = $this->isValid($data); if (!is_null($exeption)) { throw $exeption; diff --git a/Aeria/Config/Traits/ValidateConfTrait.php b/Aeria/Config/Traits/ValidateConfTrait.php index 849b36c..2cae477 100755 --- a/Aeria/Config/Traits/ValidateConfTrait.php +++ b/Aeria/Config/Traits/ValidateConfTrait.php @@ -190,16 +190,19 @@ public static function validateStructure( ) { foreach ($validation_structure as $key => $value) { if (isset($array_to_validate[$key])) { - $error = static::handleClosure( - $array_to_validate[$key], - $value, - $key - ); - if (!is_null($error)) { - return $error; + if (is_array($value)) { + $error = static::validateStructure($value, $array_to_validate[$key]); + } else { + $error = static::handleClosure( + $array_to_validate[$key], + $value, + $key + ); } - } else { - return "key:{$key} is not present in the configuration"; + if (!is_null($error)) { + return $error; + } + } } return null; diff --git a/Aeria/Field/Fields/SectionsField.php b/Aeria/Field/Fields/SectionsField.php index 82600f3..dac43bf 100644 --- a/Aeria/Field/Fields/SectionsField.php +++ b/Aeria/Field/Fields/SectionsField.php @@ -67,41 +67,43 @@ public function get(array $metas, bool $skipFilter = false) { } public function getAdmin(array $metas, array $errors) { - $stored_value = parent::get($metas, true); - $stored_value = (bool)$stored_value ? explode(',', $stored_value) : []; - - $children = []; - - foreach ($stored_value as $type_index => $type) { - $section_config = $this->getSectionConfig($type); - - $fields = []; - - foreach ($section_config['fields'] as $field_index => $field_config) { - $fields[] = array_merge( - $field_config, - FieldNodeFactory::make( - $this->key, $field_config, $this->sections, $type_index - )->getAdmin($metas, $errors) - ); + $stored_value = parent::get($metas, true); + $stored_value = (bool)$stored_value ? explode(',', $stored_value) : []; + + $children = []; + + foreach ($stored_value as $type_index => $type) { + $section_config = $this->getSectionConfig($type); + + $fields = []; + if (isset($section_config['fields'])) { + foreach ($section_config['fields'] as $field_index => $field_config) { + $fields[] = array_merge( + $field_config, + FieldNodeFactory::make( + $this->key, $field_config, $this->sections, $type_index + )->getAdmin($metas, $errors) + ); + } + } + if (is_array($section_config)) { + $children[] = array_merge( + $section_config, + [ + 'title' => $this->getTitle($type_index)->get($metas), + 'isDraft' => $this->getDraftMode($type_index)->get($metas), + 'fields' => $fields + ] + ); + } } - - $children[] = array_merge( - $section_config, - [ - 'title' => $this->getTitle($type_index)->get($metas), - 'isDraft' => $this->getDraftMode($type_index)->get($metas), - 'fields' => $fields - ] + return array_merge( + $this->config, + [ + "value" => $stored_value, + "children" => $children + ] ); - } - return array_merge( - $this->config, - [ - "value" => $stored_value, - "children" => $children - ] - ); } public function set($context_ID, $context_type, array $metas, array $newValues, $validator_service, $query_service) { diff --git a/Aeria/Kernel/AbstractClasses/Task.php b/Aeria/Kernel/AbstractClasses/Task.php new file mode 100644 index 0000000..1ff80bb --- /dev/null +++ b/Aeria/Kernel/AbstractClasses/Task.php @@ -0,0 +1,16 @@ +driver_name = $name; + $key = get_class($task); + $key = substr($key, strrpos($key, '\\')+1); + $key = toSnake($key); + $this->set($key, $task); } - public function loadConfig(Config $config) + // Booter + public function boot(Container $container) { - $root_path = $config->getRootPath(); - $this->recursiveLoad($config, $root_path); - } - - - public function loadViews($base_path, $render_service, $context = '') - { - $new_base_path = Kernel::joinPaths($base_path, $context); - if (!is_dir('/'.$new_base_path)) - return null; - $listDir = array_filter( - scandir('/' . $new_base_path), - function ($path) { return $path !== '.' && $path !== '..'; } - ); - foreach ($listDir as $dir_or_file_name) { - $absolute_path = '/' . Kernel::joinPaths( - $new_base_path, - $dir_or_file_name - ); - if (is_dir($absolute_path)) { - $this->loadViews($new_base_path, $render_service, $dir_or_file_name); - } else { - $render_service->register(ViewFactory::make($absolute_path)); - } + // Services + $service_abstracts = ['meta', 'validator', 'query', 'router', 'controller', + 'taxonomy', 'updater', 'render_engine', 'field', 'options', 'post_type']; + foreach ($service_abstracts as $abstract) { + $service[$abstract] = $container->make($abstract); } - } - public function recursiveLoad( - Config $config, - string $base_path, - string $context = '' - ) { - $permitted_file_extensions = ['json', 'php', 'yml', 'ini']; - $new_base_path = Kernel::joinPaths($base_path, $context); - if (!is_dir('/'.$new_base_path)) - return null; - $listDir = array_filter( - scandir('/' . $new_base_path), - function ($path) { return $path !== '.' && $path !== '..'; } - ); - foreach ($listDir as $dir_or_file_name) { - $absolute_path = '/' . Kernel::joinPaths( - $new_base_path, - $dir_or_file_name - ); - if (is_dir($absolute_path)) { - $this->recursiveLoad($config, $new_base_path, $dir_or_file_name); - } else if (in_array(substr($dir_or_file_name, strrpos($dir_or_file_name, '.')+1), $permitted_file_extensions)){ - try{ - $this->loadSettings( - $config, - $absolute_path, - $context - ); - }catch (\Exception $e){ - add_action( 'admin_notices', function () use ($absolute_path) { - ?> -
-

Aeria: A wrong configuration file was found in

-
- -
-

Aeria: You inserted a file with an unsupported extension in the config folder:

-
- $container->make('config')->all(), + 'service' => $service, + 'container' => $container + ]; + $tasks = $this->all(); + uasort($tasks, array($this, 'compareTasks')); + foreach ($tasks as $task){ + if(is_admin() && $task->admin_only) + $task->do($args); + else if (!$task->admin_only) + $task->do($args); } } - private function loadSettings(Config $config, string $file_path, string $context) - { - $parsed_file = $config-> - { Config::getParserMethod($config->getDriverInUse($file_path)) }($file_path); - - $config->isValidStandardConfiguration($parsed_file); - - $name = $parsed_file['name']; - $spec_list = $parsed_file['spec']; - $kind = $parsed_file['kind']; - $namespace = $kind == 'controller' || $kind == 'route' ? - "global.{$kind}.{$name}" : - "aeria.{$kind}.{$name}"; - - $config-> - { Config::getLoaderMethod($config->getDriverInUse($file_path)) }( - $spec_list, - $namespace - ); - } - - private static function joinPaths() + private function compareTasks(Task $a, Task $b) { - $args = func_get_args(); - $paths = array(); - foreach ($args as $arg) { - $paths = array_merge($paths, (array)$arg); - } - - $paths = array_map(function ($p) { return trim($p, "/"); }, $paths); - $paths = array_filter($paths); - return join('/', $paths); + if ($a->priority == $b->priority) + return 0; + return ($a->priority < $b->priority) ? -1 : 1; } - - public function createMeta(Container $container) - { - $meta_service = $container->make('meta'); - $metas = $container->make('config')->get('aeria.meta', []); - $sections = $container->make('config')->get('aeria.section', []); - $validator_service=$container->make('validator'); - $query_service=$container->make('query'); - $render_service = $container->make('render_engine'); - foreach ($metas as $name => $data) { - $meta_config = array_merge( - ['id' => $name], - $data - ); - add_action( - 'add_meta_boxes', - function () use ($meta_config, $meta_service, $sections, $render_service) { - $meta = $meta_service->create($meta_config, $sections, $render_service); - } - ); - add_action('save_post', Meta::save($meta_config, $_POST, $validator_service, $query_service, $sections), 10, 2); - } - - add_action( 'admin_print_scripts', function () use ($sections) { - ?> - - colors; - ?> - - make('post_type'); - $post_types = $container->make('config')->get('aeria.post-type', []); - foreach ($post_types as $name => $data) { - $post_type = $post_type_service->create( - array_merge( - ['post_type' => $name], - $data - ) - ); - } - } - - public function createRouter(Container $container) - { - $router_service = $container->make('router'); - $validator_service = $container->make('validator'); - $query_service = $container->make('query'); - $routes = $container->make('config')->get('global.route'); - $metaboxes = $container->make('config')->get('aeria.meta'); - - $router_service->get( - "/validate", function ($request) use ($validator_service) { - $wp_req = $request->wp_request; - return $validator_service->validate($wp_req["field"], $wp_req["validators"]); - } - ); - $router_service->get( - "/search", function ($request) use ($query_service) { - $wp_req = $request->wp_request; - return $query_service->getPosts($wp_req->get_params()); - } - ); - $router_service->get( - "/post-types", function ($request) use ($query_service) { - $wp_req = $request->wp_request; - return $query_service->getPostTypes($wp_req->get_params()); - } - ); - $router_service->get( - "/taxonomies", function ($request) use ($query_service) { - $wp_req = $request->wp_request; - return $query_service->getTaxonomies($wp_req->get_params()); - } - ); - $router_service->get( - "/validate-by-id", function ($request) use ($validator_service, $metaboxes) { - $wp_req = $request->wp_request; - return $validator_service->validateByID($wp_req["field_id"], $wp_req["value"], $metaboxes); - } - ); - - if (is_array($routes)){ - $routes_config = array_flat($routes, 1); - - foreach ($routes_config as $config) { - $route = RouteFactory::make($config); - $router_service->register($route); - } - } - - $router_service->boot(); - } - - public function createControllers(Container $container) - { - $router_service = $container->make('router'); - $controllers_service = $container->make('controller'); - $controllers = $container->make('config')->get('global.controller'); - if (!is_null($controllers)){ - foreach ($controllers as $name => $controller_config) { - $controllers_service->register($controller_config['namespace']); - } - } - } - - public function createTaxonomy(Container $container) - { - $taxonomy_service = $container->make('taxonomy'); - $taxonomies = $container->make('config')->get('aeria.taxonomy', []); - foreach ($taxonomies as $name => $data) { - $taxonomy = $taxonomy_service->create( - array_merge( - ['taxonomy' => $name], - $data - ) - ); - } - } - - public function createValidator (Container $container) - { - $validator_service = $container->make('validator'); - } - - public function createQuery (Container $container) - { - $query_service = $container->make('query'); - } - - public function createUpdater (Container $container) - { - $updater_service = $container->make('updater'); - $updater_service->config([ - // "access_token" => "", - "slug" => 'aeria/aeria.php', - "version" => $container->version(), - "proper_folder_name" => 'aeria' - ]); - - } - - public function createRenderer(Container $container) - { - $render_service = $container->make('render_engine'); - $root_paths = $render_service->getRootPaths(); - foreach ($root_paths as $root_path) { - $this->loadViews($root_path, $render_service); - } - } - - public function createField(Container $container) - { - $field_service = $container->make('field'); - - $field_service->register('base', \Aeria\Field\Fields\BaseField::class); - $field_service->register('repeater', \Aeria\Field\Fields\RepeaterField::class); - $field_service->register('gallery', \Aeria\Field\Fields\GalleryField::class); - $field_service->register('picture', \Aeria\Field\Fields\PictureField::class); - $field_service->register('sections', \Aeria\Field\Fields\SectionsField::class); - $field_service->register('select', \Aeria\Field\Fields\SelectField::class); - $field_service->register('switch', \Aeria\Field\Fields\SwitchField::class); - $field_service->register('relation', \Aeria\Field\Fields\RelationField::class); - - // example of multiple registered fields with the same handler; not - // really needed in this case, as they use the default BaseField, but - // colud be useful; `register` accepts a third value: `override`. - // So, having the list of overridable fields here it's not a bad idea. - $field_service->register('text', \Aeria\Field\Fields\BaseField::class); - $field_service->register('textarea', \Aeria\Field\Fields\BaseField::class); - $field_service->register('wysiwyg', \Aeria\Field\Fields\BaseField::class); - $field_service->register('number', \Aeria\Field\Fields\BaseField::class); - $field_service->register('email', \Aeria\Field\Fields\BaseField::class); - $field_service->register('url', \Aeria\Field\Fields\BaseField::class); - - do_action('aeria_register_field', $field_service, $container); - } - - public function createOptionsPage(Container $container) - { - $options_service = $container->make('options'); - $options = $container->make('config')->get('aeria.options', []); - $sections = $container->make('config')->get('aeria.section', []); - $validator_service=$container->make('validator'); - $query_service=$container->make('query'); - $render_service = $container->make('render_engine'); - $aeriaConfig = $container->make('config')->all(); - $default_icon_data = file_get_contents(dirname(__DIR__).'/aeria.svg'); - $default_icon = 'data:image/svg+xml;base64,'.base64_encode($default_icon_data); - // Registering other pages - foreach ($options as $name => $data) { - $option_config =[]; - $option_config = array_merge( - ['id' => $name], - $data - ); - - $theOptionPage = [ - "title" => $option_config["title"], - "menu_title" => $option_config["title"], - "capability" => isset($option_config["capability"]) ? $option_config["capability"] : "manage_options", - "menu_slug" => $option_config["menu_slug"], - "parent" => isset($option_config["parent"]) ? $option_config["parent"] : "options-general.php", - "parent_title" => isset($option_config["parent_title"]) ? $option_config["parent_title"] : "", - "parent_icon" => isset($option_config["parent_icon"]) ? $option_config["parent_icon"] : $default_icon, - "config" => $option_config, - "sections" => $sections, - "validator_service" => $validator_service, - "query_service" => $query_service - ]; - $options_service->register($theOptionPage); - } - add_action( - 'admin_menu', - function () use ($options_service, $aeriaConfig, $render_service) { - $options_service->boot($aeriaConfig, $render_service); - } - ); - } - - -} +} \ No newline at end of file diff --git a/Aeria/Kernel/Loader.php b/Aeria/Kernel/Loader.php new file mode 100644 index 0000000..5b9d3db --- /dev/null +++ b/Aeria/Kernel/Loader.php @@ -0,0 +1,132 @@ +getRootPath(); + $render_service = $container->make('render_engine'); + static::recursiveLoad($config, $root_path, $render_service); + } + + + public static function loadViews($base_path, $render_service, $context = '') + { + $new_base_path = static::joinPaths($base_path, $context); + if (!is_dir('/'.$new_base_path)) + return null; + $listDir = array_filter( + scandir('/' . $new_base_path), + function ($path) { return $path !== '.' && $path !== '..'; } + ); + foreach ($listDir as $dir_or_file_name) { + $absolute_path = '/' . static::joinPaths( + $new_base_path, + $dir_or_file_name + ); + if (is_dir($absolute_path)) { + static::loadViews($new_base_path, $render_service, $dir_or_file_name); + } else { + $render_service->register(ViewFactory::make($absolute_path)); + } + } + } + public static function recursiveLoad( + Config $config, + string $base_path, + $render_service, + string $context = '' + ) { + $permitted_file_extensions = ['json', 'php', 'yml', 'ini']; + $new_base_path = static::joinPaths($base_path, $context); + if (!is_dir('/'.$new_base_path)) + return null; + $listDir = array_filter( + scandir('/' . $new_base_path), + function ($path) { return $path !== '.' && $path !== '..'; } + ); + foreach ($listDir as $dir_or_file_name) { + $absolute_path = '/' . static::joinPaths( + $new_base_path, + $dir_or_file_name + ); + if (is_dir($absolute_path)) { + static::recursiveLoad($config, $new_base_path, $render_service, $dir_or_file_name); + } else if (in_array(substr($dir_or_file_name, strrpos($dir_or_file_name, '.')+1), $permitted_file_extensions)) { + try{ + static::loadSettings( + $config, + $absolute_path, + $context + ); + }catch (\Exception $e){ + add_action( + 'admin_notices', + function () use ($absolute_path, $render_service, $e) { + $render_service->render( + 'admin_notice_template', + ['type' => 'error', + 'dismissible' => false, + 'message' => 'A wrong configuration file was found in '.$absolute_path.' - '.$e->getMessage()] + ); + } + ); + } + } else { + add_action( + 'admin_notices', + function () use ($absolute_path, $render_service) { + $render_service->render( + 'admin_notice_template', + ['type' => 'warning', + 'dismissible' => true, + 'message' => 'You inserted a file with an unsupported extension in the config folder: '.$absolute_path] + ); + } + ); + } + } + } + + private static function loadSettings(Config $config, string $file_path, string $context) + { + $parsed_file = $config-> + { Config::getParserMethod($config->getDriverInUse($file_path)) }($file_path); + + $config->isValidStandardConfiguration($parsed_file); + + $name = $parsed_file['name']; + $spec_list = $parsed_file['spec']; + $kind = $parsed_file['kind']; + $namespace = $kind == 'controller' || $kind == 'route' ? + "global.{$kind}.{$name}" : + "aeria.{$kind}.{$name}"; + + $config-> + { Config::getLoaderMethod($config->getDriverInUse($file_path)) }( + $spec_list, + $namespace + ); + } + private static function joinPaths() + { + $args = func_get_args(); + $paths = array(); + foreach ($args as $arg) { + $paths = array_merge($paths, (array)$arg); + } + + $paths = array_map(function ($p) { return trim($p, "/"); }, $paths); + $paths = array_filter($paths); + return join('/', $paths); + } +} \ No newline at end of file diff --git a/Aeria/Kernel/ServiceProviders/KernelServiceProvider.php b/Aeria/Kernel/ServiceProviders/KernelServiceProvider.php index 315fb70..ef780d7 100755 --- a/Aeria/Kernel/ServiceProviders/KernelServiceProvider.php +++ b/Aeria/Kernel/ServiceProviders/KernelServiceProvider.php @@ -8,6 +8,19 @@ use Aeria\Config\Config; use Aeria\PostType\PostType; use Aeria\Taxonomy\Taxonomy; +use Aeria\Kernel\Loader; +use Aeria\Kernel\Tasks\{ + CreateControllers, + CreateField, + CreateMeta, + CreateOptions, + CreatePostType, + CreateRenderer, + CreateRouter, + CreateTaxonomy, + CreateUpdater +}; + class KernelServiceProvider implements ServiceProviderInterface { @@ -20,29 +33,17 @@ public function boot(Container $container): bool { $kernel = $container->make('kernel'); $config = $container->make('config'); - - $kernel->driverType($config->getDriverInUse()); - - $kernel->loadConfig($config); - $kernel->createPostType($container); - $kernel->createField($container); - $kernel->createMeta($container); - $kernel->createTaxonomy($container); - $kernel->createValidator($container); - $kernel->createQuery($container); - if (is_admin()) { - $kernel->createUpdater($container); - $kernel->createOptionsPage($container); - } - $kernel->createRenderer($container); - - // ... other create - - - // and finally create the router and allow all services - // to create own route - $kernel->createControllers($container); - $kernel->createRouter($container); + Loader::loadConfig($config, $container); + $kernel->register(new CreateControllers()); + $kernel->register(new CreateField()); + $kernel->register(new CreateMeta()); + $kernel->register(new CreateOptions()); + $kernel->register(new CreatePostType()); + $kernel->register(new CreateRenderer()); + $kernel->register(new CreateRouter()); + $kernel->register(new CreateTaxonomy()); + $kernel->register(new CreateUpdater()); + $kernel->boot($container); do_action('aeria_booted'); return true; } diff --git a/Aeria/Kernel/Tasks/CreateControllers.php b/Aeria/Kernel/Tasks/CreateControllers.php new file mode 100644 index 0000000..0593692 --- /dev/null +++ b/Aeria/Kernel/Tasks/CreateControllers.php @@ -0,0 +1,22 @@ + $config) { + $args['service']['controller']->register($config['namespace']); + } + } + } + +} \ No newline at end of file diff --git a/Aeria/Kernel/Tasks/CreateField.php b/Aeria/Kernel/Tasks/CreateField.php new file mode 100644 index 0000000..98a3818 --- /dev/null +++ b/Aeria/Kernel/Tasks/CreateField.php @@ -0,0 +1,36 @@ +register('base', \Aeria\Field\Fields\BaseField::class); + $args['service']['field']->register('repeater', \Aeria\Field\Fields\RepeaterField::class); + $args['service']['field']->register('gallery', \Aeria\Field\Fields\GalleryField::class); + $args['service']['field']->register('picture', \Aeria\Field\Fields\PictureField::class); + $args['service']['field']->register('sections', \Aeria\Field\Fields\SectionsField::class); + $args['service']['field']->register('select', \Aeria\Field\Fields\SelectField::class); + $args['service']['field']->register('switch', \Aeria\Field\Fields\SwitchField::class); + $args['service']['field']->register('relation', \Aeria\Field\Fields\RelationField::class); + // example of multiple registered fields with the same handler; not + // really needed in this case, as they use the default BaseField, but + // colud be useful; `register` accepts a third value: `override`. + // So, having the list of overridable fields here it's not a bad idea. + $args['service']['field']->register('text', \Aeria\Field\Fields\BaseField::class); + $args['service']['field']->register('textarea', \Aeria\Field\Fields\BaseField::class); + $args['service']['field']->register('wysiwyg', \Aeria\Field\Fields\BaseField::class); + $args['service']['field']->register('number', \Aeria\Field\Fields\BaseField::class); + $args['service']['field']->register('email', \Aeria\Field\Fields\BaseField::class); + $args['service']['field']->register('url', \Aeria\Field\Fields\BaseField::class); + + do_action('aeria_register_field', $args['service']['field'], $args['container']); + } + +} \ No newline at end of file diff --git a/Aeria/Kernel/Tasks/CreateMeta.php b/Aeria/Kernel/Tasks/CreateMeta.php new file mode 100644 index 0000000..71a551f --- /dev/null +++ b/Aeria/Kernel/Tasks/CreateMeta.php @@ -0,0 +1,54 @@ + $data) { + $meta_config = array_merge( + ['id' => $name], + $data + ); + + add_action( + 'add_meta_boxes', + function () use ($meta_config, $args, $section_config) { + $meta = $args['service']['meta']->create( + $meta_config, + $section_config, + $args['service']['render_engine'] + ); + } + ); + add_action('save_post', Meta::save($meta_config, $_POST, $args['service']['validator'], $args['service']['query'], $section_config), 10, 2); + } + + add_action( + 'admin_print_scripts', function () use ($args, $section_config) { + $args['service']['render_engine']->render('section_encoder_template', ['section_config' => $section_config]); + } + ); + + add_action( + 'admin_head', + function () use ($args) { + global $_wp_admin_css_colors; + $admin_colors = $_wp_admin_css_colors; + $aeria_colors = $admin_colors[get_user_option('admin_color')]->colors; + $args['service']['render_engine']->render('color_encoder_template', ['colors' => $aeria_colors]); + } + ); + } + } +} \ No newline at end of file diff --git a/Aeria/Kernel/Tasks/CreateOptions.php b/Aeria/Kernel/Tasks/CreateOptions.php new file mode 100644 index 0000000..776ca38 --- /dev/null +++ b/Aeria/Kernel/Tasks/CreateOptions.php @@ -0,0 +1,51 @@ + $data) { + $config =[]; + $config = array_merge( + ['id' => $name], + $data + ); + + $theOptionPage = [ + "title" => $config["title"], + "menu_title" => $config["title"], + "capability" => isset($config["capability"]) ? $config["capability"] : "manage_options", + "menu_slug" => $config["menu_slug"], + "parent" => isset($config["parent"]) ? $config["parent"] : "options-general.php", + "parent_title" => isset($config["parent_title"]) ? $config["parent_title"] : "", + "parent_icon" => isset($config["parent_icon"]) ? $config["parent_icon"] : $default_icon, + "config" => $config, + "sections" => $section_config, + "validator_service" => $args['service']['validator'], + "query_service" => $args['service']['query'] + ]; + $args['service']['options']->register($theOptionPage); + } + } + add_action( + 'admin_menu', + function () use ($args) { + $args['service']['options']->boot($args['config'], $args['service']['render_engine']); + } + ); + } + +} \ No newline at end of file diff --git a/Aeria/Kernel/Tasks/CreatePostType.php b/Aeria/Kernel/Tasks/CreatePostType.php new file mode 100644 index 0000000..bd3450f --- /dev/null +++ b/Aeria/Kernel/Tasks/CreatePostType.php @@ -0,0 +1,26 @@ + $data) { + $post_type = $args['service']['post_type']->create( + array_merge( + ['post_type' => $name], + $data + ) + ); + } + } + } +} \ No newline at end of file diff --git a/Aeria/Kernel/Tasks/CreateRenderer.php b/Aeria/Kernel/Tasks/CreateRenderer.php new file mode 100644 index 0000000..27076bc --- /dev/null +++ b/Aeria/Kernel/Tasks/CreateRenderer.php @@ -0,0 +1,21 @@ +getRootPaths() as $root_path) { + Loader::loadViews($root_path, $args['service']['render_engine']); + } + } + +} \ No newline at end of file diff --git a/Aeria/Kernel/Tasks/CreateRouter.php b/Aeria/Kernel/Tasks/CreateRouter.php new file mode 100644 index 0000000..493f338 --- /dev/null +++ b/Aeria/Kernel/Tasks/CreateRouter.php @@ -0,0 +1,59 @@ +get( + "/validate", function ($request) use ($args) { + $wp_req = $request->wp_request; + return $args['service']['validator']->validate($wp_req["field"], $wp_req["validators"]); + } + ); + $args['service']['router']->get( + "/search", function ($request) use ($args) { + $wp_req = $request->wp_request; + return $args['service']['query']->getPosts($wp_req->get_params()); + } + ); + $args['service']['router']->get( + "/post-types", function ($request) use ($args) { + $wp_req = $request->wp_request; + return $args['service']['query']->getPostTypes($wp_req->get_params()); + } + ); + $args['service']['router']->get( + "/taxonomies", function ($request) use ($args) { + $wp_req = $request->wp_request; + return $args['service']['query']->getTaxonomies($wp_req->get_params()); + } + ); + $args['service']['router']->get( + "/validate-by-id", function ($request) use ($args) { + $wp_req = $request->wp_request; + $meta = isset($args['config']['aeria']['meta']) ? $args['config']['aeria']['meta'] : null; + return $args['service']['validator']->validateByID($wp_req["field_id"], $wp_req["value"], $meta); + } + ); + + if (isset($args['config']['global']['route'])) { + if (is_array($args['config']['global']['route'])) { + $routes_config = array_flat($args['config']['global']['route'], 1); + foreach ($routes_config as $config) { + $route = RouteFactory::make($config); + $args['service']['router']->register($route); + } + } + } + $args['service']['router']->boot(); + } +} \ No newline at end of file diff --git a/Aeria/Kernel/Tasks/CreateTaxonomy.php b/Aeria/Kernel/Tasks/CreateTaxonomy.php new file mode 100644 index 0000000..0360918 --- /dev/null +++ b/Aeria/Kernel/Tasks/CreateTaxonomy.php @@ -0,0 +1,27 @@ + $data) { + $taxonomy = $args['service']['taxonomy']->create( + array_merge( + ['taxonomy' => $name], + $data + ) + ); + } + } + } + +} \ No newline at end of file diff --git a/Aeria/Kernel/Tasks/CreateUpdater.php b/Aeria/Kernel/Tasks/CreateUpdater.php new file mode 100644 index 0000000..4bb0e39 --- /dev/null +++ b/Aeria/Kernel/Tasks/CreateUpdater.php @@ -0,0 +1,23 @@ +config( + [ + // "access_token" => "", + "slug" => 'aeria/aeria.php', + "version" => $args['container']->version(), + "proper_folder_name" => 'aeria' + ] + ); + } +} \ No newline at end of file diff --git a/Aeria/RenderEngine/Views/CoreView.php b/Aeria/RenderEngine/Views/CoreView.php index 2084e3e..4b3d81b 100644 --- a/Aeria/RenderEngine/Views/CoreView.php +++ b/Aeria/RenderEngine/Views/CoreView.php @@ -14,23 +14,11 @@ public function name():string $matches ) ) { - return $this->toSnake($matches[3][0]); + return toSnake($matches[3][0]); } else { throw new Exception("Unable to get filename for file: ".$this->view_path); } } - - public function toSnake($convertibleText) - { - $convertibleText = preg_replace('/\s+/u', '', ucwords($convertibleText)); - return strtolower( - preg_replace( - '/(.)(?=[A-Z])/u', - '$1' . '_', - $convertibleText - ) - ); - } } \ No newline at end of file diff --git a/Aeria/Updater/Updater.php b/Aeria/Updater/Updater.php index 6603de4..f3ec2a8 100644 --- a/Aeria/Updater/Updater.php +++ b/Aeria/Updater/Updater.php @@ -5,7 +5,7 @@ class Updater{ public function __construct() { // define the alternative API for updating checking - add_filter( "pre_site_transient_update_plugins", array( $this, "checkVersion" ) ); + add_filter( "pre_set_site_transient_update_plugins", array( $this, "checkVersion" ) ); // Define the alternative response for information checking add_filter( "plugins_api", array( $this, "setPluginInfo" ), 10, 3 ); // reactivate plugin @@ -40,6 +40,11 @@ private function getRepoReleaseInfo() { if ( !empty( $this->githubAPIResult ) ) { return; } + + $transient = get_transient( "{$this->github["user"]}_{$this->github["repository"]}_transient_update"); + if($transient !== false){ + return $transient; + } // Query the GitHub API $url = "https://api.github.com/repos/{$this->github["user"]}/{$this->github["repository"]}/releases"; // We need the access token for private repos @@ -56,6 +61,7 @@ private function getRepoReleaseInfo() { if ( is_array( $this->githubAPIResult ) ) { $this->githubAPIResult = $this->githubAPIResult[0]; } + set_transient( "{$this->github["user"]}_{$this->github["repository"]}_transient_update", $this->githubAPIResult, 3.600 ); } public function checkVersion( $transient ) { @@ -68,11 +74,10 @@ public function checkVersion( $transient ) { $this->getPluginData(); $this->getRepoReleaseInfo(); - if(!isset($this->githubAPIResult->name)){ + if(!isset($this->githubAPIResult->tag_name)){ return $transient; } - - $doUpdate = version_compare( $this->githubAPIResult->name, $this->config['version'] ); + $doUpdate = version_compare( $this->githubAPIResult->tag_name, $transient->checked[$this->config['slug']] ); if ( $doUpdate == 1 ) { $package = $this->githubAPIResult->zipball_url; diff --git a/Aeria/helpers.php b/Aeria/helpers.php index 3bd5ab8..40fb6b8 100755 --- a/Aeria/helpers.php +++ b/Aeria/helpers.php @@ -53,6 +53,21 @@ function dd(...$args) } } +if (!function_exists('toSnake')) { + function toSnake($convertibleText) + { + $convertibleText = preg_replace('/\s+/u', '', ucwords($convertibleText)); + return strtolower( + preg_replace( + '/(.)(?=[A-Z])/u', + '$1' . '_', + $convertibleText + ) + ); + } +} + + if (!function_exists('aeria')) { function aeria(/* ?string */ $abstract = null) { diff --git a/Resources/Templates/AdminNoticeTemplate.php b/Resources/Templates/AdminNoticeTemplate.php new file mode 100644 index 0000000..2139407 --- /dev/null +++ b/Resources/Templates/AdminNoticeTemplate.php @@ -0,0 +1,10 @@ +
+

Aeria:

+
\ No newline at end of file diff --git a/Resources/Templates/ColorEncoderTemplate.php b/Resources/Templates/ColorEncoderTemplate.php new file mode 100644 index 0000000..62fc631 --- /dev/null +++ b/Resources/Templates/ColorEncoderTemplate.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/Resources/Templates/SectionEncoderTemplate.php b/Resources/Templates/SectionEncoderTemplate.php new file mode 100644 index 0000000..c2b46fd --- /dev/null +++ b/Resources/Templates/SectionEncoderTemplate.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/aeria.php b/aeria.php index b761f34..f65af47 100755 --- a/aeria.php +++ b/aeria.php @@ -11,7 +11,7 @@ * Plugin Name: Aeria * Plugin URI: https://github.com/caffeinalab/aeria * Description: Aeria is a modular, lightweight, fast WordPress Application development kit. - * Version: 3.0.1 + * Version: 3.0.2 * Author: Caffeina * Author URI: https://caffeina.com * Text Domain: aeria diff --git a/assets/js/aeria-editor.js b/assets/js/aeria-editor.js index 6d22ee9..c2f9f1a 100644 --- a/assets/js/aeria-editor.js +++ b/assets/js/aeria-editor.js @@ -50,4 +50,4 @@ Object.defineProperty(t,"__esModule",{value:!0});var n=null,r=!1,o=3,i=-1,a=-1,u * @author Feross Aboukhadijeh * @license MIT */ -e.exports=function(e){return null!=e&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}},function(e,t,n){"use strict";var r=n(24),o=n(147),i=n(210),a=n(211),u=n(152);function s(e){this.defaults=e,this.interceptors={request:new i,response:new i}}s.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=u(this.defaults,e)).method=e.method?e.method.toLowerCase():"get";var t=[a,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)n=n.then(t.shift(),t.shift());return n},s.prototype.getUri=function(e){return e=u(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],function(e){s.prototype[e]=function(t,n){return this.request(r.merge(n||{},{method:e,url:t}))}}),r.forEach(["post","put","patch"],function(e){s.prototype[e]=function(t,n,o){return this.request(r.merge(o||{},{method:e,url:t,data:n}))}}),e.exports=s},function(e,t,n){"use strict";var r=n(24);function o(){this.handlers=[]}o.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){r.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=o},function(e,t,n){"use strict";var r=n(24),o=n(212),i=n(148),a=n(149),u=n(219),s=n(220);function l(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return l(e),e.baseURL&&!u(e.url)&&(e.url=s(e.baseURL,e.url)),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),r.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||a.adapter)(e).then(function(t){return l(e),t.data=o(t.data,t.headers,e.transformResponse),t},function(t){return i(t)||(l(e),t&&t.response&&(t.response.data=o(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},function(e,t,n){"use strict";var r=n(24);e.exports=function(e,t,n){return r.forEach(n,function(n){e=n(e,t)}),e}},function(e,t,n){"use strict";var r=n(24);e.exports=function(e,t){r.forEach(e,function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])})}},function(e,t,n){"use strict";var r=n(151);e.exports=function(e,t,n){var o=n.config.validateStatus;!o||o(n.status)?e(n):t(r("Request failed with status code "+n.status,n.config,null,n.request,n))}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,n){"use strict";var r=n(24),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,i,a={};return e?(r.forEach(e.split("\n"),function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(a[t]&&o.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}}),a):a}},function(e,t,n){"use strict";var r=n(24);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},function(e,t,n){"use strict";var r=n(24);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,o,i,a){var u=[];u.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),r.isString(o)&&u.push("path="+o),r.isString(i)&&u.push("domain="+i),!0===a&&u.push("secure"),document.cookie=u.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,n){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,n){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,n){"use strict";var r=n(153);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;e(function(e){n.reason||(n.reason=new r(e),t(n.reason))})}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o(function(t){e=t}),cancel:e}},e.exports=o},function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,n){"use strict";var r=n(15),o=n(79),i=n(102),a=o(6),u=!0;"findIndex"in[]&&Array(1).findIndex(function(){u=!1}),r({target:"Array",proto:!0,forced:u},{findIndex:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}}),i("findIndex")},function(e,t,n){var r=n(225),o=n(72);e.exports=function(e,t,n){if(r(t))throw TypeError("String.prototype."+n+" doesn't accept regex");return String(o(e))}},function(e,t,n){var r=n(22),o=n(44),i=n(18)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[i])?!!t:"RegExp"==o(e))}},function(e,t,n){var r=n(18)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,"/./"[e](t)}catch(e){}}return!1}},function(e,t,n){(function(t){(function(){var n,r,o,i,a,u;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:null!=t&&t.hrtime?(e.exports=function(){return(n()-a)/1e6},r=t.hrtime,i=(n=function(){var e;return 1e9*(e=r())[0]+e[1]})(),u=1e9*t.uptime(),a=i-u):Date.now?(e.exports=function(){return Date.now()-o},o=Date.now()):(e.exports=function(){return(new Date).getTime()-o},o=(new Date).getTime())}).call(this)}).call(this,n(62))},function(e,t,n){var r,o=n(229),i=n(230),a=(r=[],{activateTrap:function(e){if(r.length>0){var t=r[r.length-1];t!==e&&t.pause()}var n=r.indexOf(e);-1===n?r.push(e):(r.splice(n,1),r.push(e))},deactivateTrap:function(e){var t=r.indexOf(e);-1!==t&&r.splice(t,1),r.length>0&&r[r.length-1].unpause()}});function u(e){return setTimeout(e,0)}e.exports=function(e,t){var n=document,r="string"==typeof e?n.querySelector(e):e,s=i({returnFocusOnDeactivate:!0,escapeDeactivates:!0},t),l={firstTabbableNode:null,lastTabbableNode:null,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1},c={activate:function(e){if(!l.active){w(),l.active=!0,l.paused=!1,l.nodeFocusedBeforeActivation=n.activeElement;var t=e&&e.onActivate?e.onActivate:s.onActivate;return t&&t(),p(),c}},deactivate:f,pause:function(){!l.paused&&l.active&&(l.paused=!0,d())},unpause:function(){l.paused&&l.active&&(l.paused=!1,p())}};return c;function f(e){if(l.active){d(),l.active=!1,l.paused=!1,a.deactivateTrap(c);var t=e&&void 0!==e.onDeactivate?e.onDeactivate:s.onDeactivate;return t&&t(),(e&&void 0!==e.returnFocus?e.returnFocus:s.returnFocusOnDeactivate)&&u(function(){x(l.nodeFocusedBeforeActivation)}),c}}function p(){if(l.active)return a.activateTrap(c),w(),u(function(){x(m())}),n.addEventListener("focusin",b,!0),n.addEventListener("mousedown",y,!0),n.addEventListener("touchstart",y,!0),n.addEventListener("click",g,!0),n.addEventListener("keydown",v,!0),c}function d(){if(l.active)return n.removeEventListener("focusin",b,!0),n.removeEventListener("mousedown",y,!0),n.removeEventListener("touchstart",y,!0),n.removeEventListener("click",g,!0),n.removeEventListener("keydown",v,!0),c}function h(e){var t=s[e],r=t;if(!t)return null;if("string"==typeof t&&!(r=n.querySelector(t)))throw new Error("`"+e+"` refers to no known node");if("function"==typeof t&&!(r=t()))throw new Error("`"+e+"` did not return a node");return r}function m(){var e;if(!(e=null!==h("initialFocus")?h("initialFocus"):r.contains(n.activeElement)?n.activeElement:l.firstTabbableNode||h("fallbackFocus")))throw new Error("You can't have a focus-trap without at least one focusable element");return e}function y(e){r.contains(e.target)||(s.clickOutsideDeactivates?f({returnFocus:!o.isFocusable(e.target)}):e.preventDefault())}function b(e){r.contains(e.target)||e.target instanceof Document||(e.stopImmediatePropagation(),x(l.mostRecentlyFocusedNode||m()))}function v(e){if(!1!==s.escapeDeactivates&&function(e){return"Escape"===e.key||"Esc"===e.key||27===e.keyCode}(e))return e.preventDefault(),void f();(function(e){return"Tab"===e.key||9===e.keyCode})(e)&&function(e){if(w(),e.shiftKey&&e.target===l.firstTabbableNode)return e.preventDefault(),void x(l.lastTabbableNode);e.shiftKey||e.target!==l.lastTabbableNode||(e.preventDefault(),x(l.firstTabbableNode))}(e)}function g(e){s.clickOutsideDeactivates||r.contains(e.target)||(e.preventDefault(),e.stopImmediatePropagation())}function w(){var e=o(r);l.firstTabbableNode=e[0]||m(),l.lastTabbableNode=e[e.length-1]||m()}function x(e){e!==n.activeElement&&(e&&e.focus?(e.focus(),l.mostRecentlyFocusedNode=e,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(e)&&e.select()):x(m()))}}},function(e,t){var n=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'],r=n.join(","),o="undefined"==typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;function i(e,t){t=t||{};var n,i,u,s=[],f=[],d=new p(e.ownerDocument||e),h=e.querySelectorAll(r);for(t.includeContainer&&o.call(e,r)&&(h=Array.prototype.slice.apply(h)).unshift(e),n=0;n0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):x(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?x(e,a,t,!1):S(e,a)):x(e,a,t,!1))):r||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=O?e=O:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?o.nextTick(k,e):k(e))}function k(e){d("emit readable"),e.emit("readable"),A(e)}function S(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(C,e,t))}function C(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;ei.length?i.length:e;if(a===i.length?o+=i:o+=i.slice(0,e),0===(e-=a)){a===i.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(a));break}++r}return t.length-=r,o}(e,t):function(e,t){var n=l.allocUnsafe(e),r=t.head,o=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var i=r.data,a=e>i.length?i.length:e;if(i.copy(n,n.length-e,0,a),0===(e-=a)){a===i.length?(++o,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(a));break}++o}return t.length-=o,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function I(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,o.nextTick(R,t,e))}function R(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function D(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?I(this):E(this),null;if(0===(e=_(e,t))&&t.ended)return 0===t.length&&I(this),null;var r,o=t.needReadable;return d("need readable",o),(0===t.length||t.length-e0?P(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&I(this)),null!==r&&this.emit("data",r),r},g.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},g.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,d("pipe count=%d opts=%j",i.pipesCount,t);var s=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?c:g;function l(t,r){d("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,d("cleanup"),e.removeListener("close",b),e.removeListener("finish",v),e.removeListener("drain",f),e.removeListener("error",y),e.removeListener("unpipe",l),n.removeListener("end",c),n.removeListener("end",g),n.removeListener("data",m),p=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function c(){d("onend"),e.end()}i.endEmitted?o.nextTick(s):n.once("end",s),e.on("unpipe",l);var f=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&u(e,"data")&&(t.flowing=!0,A(e))}}(n);e.on("drain",f);var p=!1;var h=!1;function m(t){d("ondata"),h=!1,!1!==e.write(t)||h||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==D(i.pipes,e))&&!p&&(d("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,h=!0),n.pause())}function y(t){d("onerror",t),g(),e.removeListener("error",y),0===u(e,"error")&&e.emit("error",t)}function b(){e.removeListener("finish",v),g()}function v(){d("onfinish"),e.removeListener("close",b),g()}function g(){d("unpipe"),n.unpipe(e)}return n.on("data",m),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",y),e.once("close",b),e.once("finish",v),e.emit("pipe",n),i.flowing||(d("pipe resume"),n.resume()),e},g.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n),this);if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(266),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(33))},function(e,t,n){"use strict";var r=n(166).Buffer,o=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=s,this.end=l,t=4;break;case"utf8":this.fillLast=u,t=4;break;case"base64":this.text=c,this.end=f,t=3;break;default:return this.write=p,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function u(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function s(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function c(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function p(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0)return o>0&&(e.lastNeed=o-1),o;if(--r=0)return o>0&&(e.lastNeed=o-2),o;if(--r=0)return o>0&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){"use strict";e.exports=a;var r=n(105),o=n(139);function i(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length>2,u=(3&t)<<4|n>>4,s=d>1?(15&n)<<2|o>>6:64,l=d>2?63&o:64,c.push(i.charAt(a)+i.charAt(u)+i.charAt(s)+i.charAt(l));return c.join("")},t.decode=function(e){var t,n,r,a,u,s,l=0,c=0;if("data:"===e.substr(0,"data:".length))throw new Error("Invalid base64 input, it looks like a data url.");var f,p=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(e.charAt(e.length-1)===i.charAt(64)&&p--,e.charAt(e.length-2)===i.charAt(64)&&p--,p%1!=0)throw new Error("Invalid base64 input, bad content length.");for(f=o.uint8array?new Uint8Array(0|p):new Array(0|p);l>4,n=(15&a)<<4|(u=i.indexOf(e.charAt(l++)))>>2,r=(3&u)<<6|(s=i.indexOf(e.charAt(l++))),f[c++]=t,64!==u&&(f[c++]=n),64!==s&&(f[c++]=r);return f}},function(e,t,n){"use strict";(function(t){var r=n(30),o=n(276),i=n(53),a=n(239),u=n(91),s=n(140),l=null;if(u.nodestream)try{l=n(277)}catch(e){}function c(e,n){return new s.Promise(function(o,i){var u=[],s=e._internalType,l=e._outputType,c=e._mimeType;e.on("data",function(e,t){u.push(e),n&&n(t)}).on("error",function(e){u=[],i(e)}).on("end",function(){try{var e=function(e,t,n){switch(e){case"blob":return r.newBlob(r.transformTo("arraybuffer",t),n);case"base64":return a.encode(t);default:return r.transformTo(e,t)}}(l,function(e,n){var r,o=0,i=null,a=0;for(r=0;r=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=i},function(e,t,n){"use strict";var r=n(30),o=n(53);function i(e){o.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}r.inherits(i,o),i.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}o.prototype.processChunk.call(this,e)},e.exports=i},function(e,t,n){"use strict";var r=n(53),o=n(193);function i(){r.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n(30).inherits(i,r),i.prototype.processChunk=function(e){this.streamInfo.crc32=o(e.data,this.streamInfo.crc32||0),this.push(e)},e.exports=i},function(e,t,n){"use strict";var r=n(53);t.STORE={magic:"\0\0",compressWorker:function(e){return new r("STORE compression")},uncompressWorker:function(){return new r("STORE decompression")}},t.DEFLATE=n(280)},function(e,t,n){"use strict";e.exports=function(e,t,n,r){for(var o=65535&e|0,i=e>>>16&65535|0,a=0;0!==n;){n-=a=n>2e3?2e3:n;do{i=i+(o=o+t[r++]|0)|0}while(--a);o%=65521,i%=65521}return o|i<<16|0}},function(e,t,n){"use strict";var r=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();e.exports=function(e,t,n,o){var i=r,a=o+n;e^=-1;for(var u=o;u>>8^i[255&(e^t[u])];return-1^e}},function(e,t,n){"use strict";var r=n(92),o=!0,i=!0;try{String.fromCharCode.apply(null,[0])}catch(e){o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){i=!1}for(var a=new r.Buf8(256),u=0;u<256;u++)a[u]=u>=252?6:u>=248?5:u>=240?4:u>=224?3:u>=192?2:1;function s(e,t){if(t<65534&&(e.subarray&&i||!e.subarray&&o))return String.fromCharCode.apply(null,r.shrinkBuf(e,t));for(var n="",a=0;a>>6,t[a++]=128|63&n):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|63&n):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|63&n);return t},t.buf2binstring=function(e){return s(e,e.length)},t.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,o=t.length;n4)l[r++]=65533,n+=i-1;else{for(o&=2===i?31:3===i?15:7;i>1&&n1?l[r++]=65533:o<65536?l[r++]=o:(o-=65536,l[r++]=55296|o>>10&1023,l[r++]=56320|1023&o)}return s(l,r)},t.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0?t:0===n?t:n+a[e[n]]>t?n:t}},function(e,t,n){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(e,t,n){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(e,t,n){"use strict";t.LOCAL_FILE_HEADER="PK",t.CENTRAL_FILE_HEADER="PK",t.CENTRAL_DIRECTORY_END="PK",t.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",t.ZIP64_CENTRAL_DIRECTORY_END="PK",t.DATA_DESCRIPTOR="PK\b"},function(e,t,n){"use strict";var r=n(30),o=n(91),i=n(253),a=n(294),u=n(295),s=n(255);e.exports=function(e){var t=r.getTypeOf(e);return r.checkSupport(t),"string"!==t||o.uint8array?"nodebuffer"===t?new u(e):o.uint8array?new s(r.transformTo("uint8array",e)):new i(r.transformTo("array",e)):new a(e)}},function(e,t,n){"use strict";var r=n(254);function o(e){r.call(this,e);for(var t=0;t=0;--i)if(this.data[i]===t&&this.data[i+1]===n&&this.data[i+2]===r&&this.data[i+3]===o)return i-this.zero;return-1},o.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),o=e.charCodeAt(3),i=this.readData(4);return t===i[0]&&n===i[1]&&r===i[2]&&o===i[3]},o.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},e.exports=o},function(e,t,n){"use strict";var r=n(30);function o(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}o.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return r.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},e.exports=o},function(e,t,n){"use strict";var r=n(253);function o(e){r.call(this,e)}n(30).inherits(o,r),o.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},e.exports=o},function(e,t,n){"use strict";function r(){if(!(this instanceof r))return new r;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files={},this.comment=null,this.root="",this.clone=function(){var e=new r;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}r.prototype=n(259),r.prototype.loadAsync=n(292),r.support=n(91),r.defaults=n(241),r.version="3.2.0",r.loadAsync=function(e,t){return(new r).loadAsync(e,t)},r.external=n(140),e.exports=r},function(e,t,n){(function(n){var r,o,i;o=[],void 0===(i="function"==typeof(r=function(){"use strict";function t(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){a(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function r(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function o(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n&&n.global===n?n:void 0,a=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype?function(e,n,a){var u=i.URL||i.webkitURL,s=document.createElement("a");n=n||e.name||"download",s.download=n,s.rel="noopener","string"==typeof e?(s.href=e,s.origin===location.origin?o(s):r(s.href)?t(e,n,a):o(s,s.target="_blank")):(s.href=u.createObjectURL(e),setTimeout(function(){u.revokeObjectURL(s.href)},4e4),setTimeout(function(){o(s)},0))}:"msSaveOrOpenBlob"in navigator?function(e,n,i){if(n=n||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}(e,i),n);else if(r(e))t(e,n,i);else{var a=document.createElement("a");a.href=e,a.target="_blank",setTimeout(function(){o(a)})}}:function(e,n,r,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof e)return t(e,n,r);var a="application/octet-stream"===e.type,u=/constructor/i.test(i.HTMLElement)||i.safari,s=/CriOS\/[\d]+/.test(navigator.userAgent);if((s||a&&u)&&"object"==typeof FileReader){var l=new FileReader;l.onloadend=function(){var e=l.result;e=s?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=e:location=e,o=null},l.readAsDataURL(e)}else{var c=i.URL||i.webkitURL,f=c.createObjectURL(e);o?o.location=f:location.href=f,o=null,setTimeout(function(){c.revokeObjectURL(f)},4e4)}});i.saveAs=a.saveAs=a,e.exports=a})?r.apply(t,o):r)||(e.exports=i)}).call(this,n(33))},function(e,t,n){e.exports=n(298)},function(e,t,n){"use strict";var r=n(114),o=n(30),i=n(53),a=n(240),u=n(241),s=n(192),l=n(278),c=n(279),f=n(167),p=n(291),d=function(e,t,n){var r,a=o.getTypeOf(t),c=o.extend(n||{},u);c.date=c.date||new Date,null!==c.compression&&(c.compression=c.compression.toUpperCase()),"string"==typeof c.unixPermissions&&(c.unixPermissions=parseInt(c.unixPermissions,8)),c.unixPermissions&&16384&c.unixPermissions&&(c.dir=!0),c.dosPermissions&&16&c.dosPermissions&&(c.dir=!0),c.dir&&(e=m(e)),c.createFolders&&(r=h(e))&&y.call(this,r,!0);var d="string"===a&&!1===c.binary&&!1===c.base64;n&&void 0!==n.binary||(c.binary=!d),(t instanceof s&&0===t.uncompressedSize||c.dir||!t||0===t.length)&&(c.base64=!1,c.binary=!0,t="",c.compression="STORE",a="string");var b=null;b=t instanceof s||t instanceof i?t:f.isNode&&f.isStream(t)?new p(e,t):o.prepareContent(e,t,c.binary,c.optimizedBinaryString,c.base64);var v=new l(e,b,c);this.files[e]=v},h=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return t>0?e.substring(0,t):""},m=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},y=function(e,t){return t=void 0!==t?t:u.createFolders,e=m(e),this.files[e]||d.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function b(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var v={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,n,r;for(t in this.files)this.files.hasOwnProperty(t)&&(r=this.files[t],(n=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(n,r))},filter:function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(r)}),t},file:function(e,t,n){if(1===arguments.length){if(b(e)){var r=e;return this.filter(function(e,t){return!t.dir&&r.test(e)})}var o=this.files[this.root+e];return o&&!o.dir?o:null}return e=this.root+e,d.call(this,e,t,n),this},folder:function(e){if(!e)return this;if(b(e))return this.filter(function(t,n){return n.dir&&e.test(t)});var t=this.root+e,n=y.call(this,t),r=this.clone();return r.root=n.name,r},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var n=this.filter(function(t,n){return n.name.slice(0,e.length)===e}),r=0;r0?r-4:r,f=0;f>16&255,u[s++]=t>>8&255,u[s++]=255&t;2===a&&(t=o[e.charCodeAt(f)]<<2|o[e.charCodeAt(f+1)]>>4,u[s++]=255&t);1===a&&(t=o[e.charCodeAt(f)]<<10|o[e.charCodeAt(f+1)]<<4|o[e.charCodeAt(f+2)]>>2,u[s++]=t>>8&255,u[s++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,u=n-o;au?u:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,s=a.length;u0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,n){for(var o,i,a=[],u=t;u>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,o){var i,a,u=8*o-r-1,s=(1<>1,c=-7,f=n?o-1:0,p=n?-1:1,d=e[t+f];for(f+=p,i=d&(1<<-c)-1,d>>=-c,c+=u;c>0;i=256*i+e[t+f],f+=p,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=r;c>0;a=256*a+e[t+f],f+=p,c-=8);if(0===i)i=1-l;else{if(i===s)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),i-=l}return(d?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,u,s,l=8*i-o-1,c=(1<>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,h=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-a))<1&&(a--,s*=2),(t+=a+f>=1?p/s:p*Math.pow(2,1-f))*s>=2&&(a++,s/=2),a+f>=c?(u=0,a=c):a+f>=1?(u=(t*s-1)*Math.pow(2,o),a+=f):(u=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[n+d]=255&u,d+=h,u/=256,o-=8);for(a=a<0;e[n+d]=255&a,d+=h,a/=256,l-=8);e[n+d-h]|=128*m}},function(e,t,n){e.exports=o;var r=n(189).EventEmitter;function o(){r.call(this)}n(115)(o,r),o.Readable=n(190),o.Writable=n(269),o.Duplex=n(270),o.Transform=n(271),o.PassThrough=n(272),o.Stream=o,o.prototype.pipe=function(e,t){var n=this;function o(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function i(){n.readable&&n.resume&&n.resume()}n.on("data",o),e.on("drain",i),e._isStdio||t&&!1===t.end||(n.on("end",u),n.on("close",s));var a=!1;function u(){a||(a=!0,e.end())}function s(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(c(),0===r.listenerCount(this,"error"))throw e}function c(){n.removeListener("data",o),e.removeListener("drain",i),n.removeListener("end",u),n.removeListener("close",s),n.removeListener("error",l),e.removeListener("error",l),n.removeListener("end",c),n.removeListener("close",c),e.removeListener("close",c)}return n.on("error",l),e.on("error",l),n.on("end",c),n.on("close",c),e.on("close",c),e.emit("pipe",n),e}},function(e,t){},function(e,t,n){"use strict";var r=n(166).Buffer,o=n(265);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,o,i=r.allocUnsafe(e>>>0),a=this.head,u=0;a;)t=a.data,n=i,o=u,t.copy(n,o),u+=a.data.length,a=a.next;return i},e}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var e=o.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,a,u,s=1,l={},c=!1,f=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick(function(){h(e)})}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(h,0,e)}:(a="setImmediate$"+Math.random()+"$",u=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&h(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",u,!1):e.attachEvent("onmessage",u),r=function(t){e.postMessage(a+t,"*")}),p.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var n=r.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==l)throw new Error(a[n]);if(t.header&&r.deflateSetHeader(this.strm,t.header),t.dictionary){var h;if(h="string"==typeof t.dictionary?i.string2buf(t.dictionary):"[object ArrayBuffer]"===s.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(n=r.deflateSetDictionary(this.strm,h))!==l)throw new Error(a[n]);this._dict_set=!0}}function h(e,t){var n=new d(t);if(n.push(e,!0),n.err)throw n.msg||a[n.err];return n.result}d.prototype.push=function(e,t){var n,a,u=this.strm,c=this.options.chunkSize;if(this.ended)return!1;a=t===~~t?t:!0===t?4:0,"string"==typeof e?u.input=i.string2buf(e):"[object ArrayBuffer]"===s.call(e)?u.input=new Uint8Array(e):u.input=e,u.next_in=0,u.avail_in=u.input.length;do{if(0===u.avail_out&&(u.output=new o.Buf8(c),u.next_out=0,u.avail_out=c),1!==(n=r.deflate(u,a))&&n!==l)return this.onEnd(n),this.ended=!0,!1;0!==u.avail_out&&(0!==u.avail_in||4!==a&&2!==a)||("string"===this.options.to?this.onData(i.buf2binstring(o.shrinkBuf(u.output,u.next_out))):this.onData(o.shrinkBuf(u.output,u.next_out)))}while((u.avail_in>0||0===u.avail_out)&&1!==n);return 4===a?(n=r.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===l):2!==a||(this.onEnd(l),u.avail_out=0,!0)},d.prototype.onData=function(e){this.chunks.push(e)},d.prototype.onEnd=function(e){e===l&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=d,t.deflate=h,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,h(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,h(e,t)}},function(e,t,n){"use strict";var r,o=n(92),i=n(284),a=n(246),u=n(247),s=n(194),l=0,c=1,f=3,p=4,d=5,h=0,m=1,y=-2,b=-3,v=-5,g=-1,w=1,x=2,O=3,_=4,E=0,k=2,S=8,C=9,j=15,T=8,A=286,P=30,I=19,R=2*A+1,D=15,F=3,L=258,M=L+F+1,N=32,z=42,B=69,U=73,V=91,W=103,H=113,q=666,$=1,Y=2,G=3,Z=4,K=3;function X(e,t){return e.msg=s[t],t}function Q(e){return(e<<1)-(e>4?9:0)}function J(e){for(var t=e.length;--t>=0;)e[t]=0}function ee(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(o.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function te(e,t){i._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ee(e.strm)}function ne(e,t){e.pending_buf[e.pending++]=t}function re(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function oe(e,t){var n,r,o=e.max_chain_length,i=e.strstart,a=e.prev_length,u=e.nice_match,s=e.strstart>e.w_size-M?e.strstart-(e.w_size-M):0,l=e.window,c=e.w_mask,f=e.prev,p=e.strstart+L,d=l[i+a-1],h=l[i+a];e.prev_length>=e.good_match&&(o>>=2),u>e.lookahead&&(u=e.lookahead);do{if(l[(n=t)+a]===h&&l[n+a-1]===d&&l[n]===l[i]&&l[++n]===l[i+1]){i+=2,n++;do{}while(l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&ia){if(e.match_start=t,a=r,r>=u)break;d=l[i+a-1],h=l[i+a]}}}while((t=f[t&c])>s&&0!=--o);return a<=e.lookahead?a:e.lookahead}function ie(e){var t,n,r,i,s,l,c,f,p,d,h=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=h+(h-M)){o.arraySet(e.window,e.window,h,h,0),e.match_start-=h,e.strstart-=h,e.block_start-=h,t=n=e.hash_size;do{r=e.head[--t],e.head[t]=r>=h?r-h:0}while(--n);t=n=h;do{r=e.prev[--t],e.prev[t]=r>=h?r-h:0}while(--n);i+=h}if(0===e.strm.avail_in)break;if(l=e.strm,c=e.window,f=e.strstart+e.lookahead,p=i,d=void 0,(d=l.avail_in)>p&&(d=p),n=0===d?0:(l.avail_in-=d,o.arraySet(c,l.input,l.next_in,d,f),1===l.state.wrap?l.adler=a(l.adler,c,d,f):2===l.state.wrap&&(l.adler=u(l.adler,c,d,f)),l.next_in+=d,l.total_in+=d,d),e.lookahead+=n,e.lookahead+e.insert>=F)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<=F&&(e.ins_h=(e.ins_h<=F)if(r=i._tr_tally(e,e.strstart-e.match_start,e.match_length-F),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=F){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=F&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=F-1)),e.prev_length>=F&&e.match_length<=e.prev_length){o=e.strstart+e.lookahead-F,r=i._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-F),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=o&&(e.ins_h=(e.ins_h<15&&(u=2,r-=16),i<1||i>C||n!==S||r<8||r>15||t<0||t>9||a<0||a>_)return X(e,y);8===r&&(r=9);var s=new le;return e.state=s,s.strm=e,s.wrap=u,s.gzhead=null,s.w_bits=r,s.w_size=1<e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(ie(e),0===e.lookahead&&t===l)return $;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,te(e,!1),0===e.strm.avail_out))return $;if(e.strstart-e.block_start>=e.w_size-M&&(te(e,!1),0===e.strm.avail_out))return $}return e.insert=0,t===p?(te(e,!0),0===e.strm.avail_out?G:Z):(e.strstart>e.block_start&&(te(e,!1),e.strm.avail_out),$)}),new se(4,4,8,4,ae),new se(4,5,16,8,ae),new se(4,6,32,32,ae),new se(4,4,16,16,ue),new se(8,16,32,32,ue),new se(8,16,128,128,ue),new se(8,32,128,256,ue),new se(32,128,258,1024,ue),new se(32,258,258,4096,ue)],t.deflateInit=function(e,t){return pe(e,t,S,j,T,E)},t.deflateInit2=pe,t.deflateReset=fe,t.deflateResetKeep=ce,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?y:(e.state.gzhead=t,h):y},t.deflate=function(e,t){var n,o,a,s;if(!e||!e.state||t>d||t<0)return e?X(e,y):y;if(o=e.state,!e.output||!e.input&&0!==e.avail_in||o.status===q&&t!==p)return X(e,0===e.avail_out?v:y);if(o.strm=e,n=o.last_flush,o.last_flush=t,o.status===z)if(2===o.wrap)e.adler=0,ne(o,31),ne(o,139),ne(o,8),o.gzhead?(ne(o,(o.gzhead.text?1:0)+(o.gzhead.hcrc?2:0)+(o.gzhead.extra?4:0)+(o.gzhead.name?8:0)+(o.gzhead.comment?16:0)),ne(o,255&o.gzhead.time),ne(o,o.gzhead.time>>8&255),ne(o,o.gzhead.time>>16&255),ne(o,o.gzhead.time>>24&255),ne(o,9===o.level?2:o.strategy>=x||o.level<2?4:0),ne(o,255&o.gzhead.os),o.gzhead.extra&&o.gzhead.extra.length&&(ne(o,255&o.gzhead.extra.length),ne(o,o.gzhead.extra.length>>8&255)),o.gzhead.hcrc&&(e.adler=u(e.adler,o.pending_buf,o.pending,0)),o.gzindex=0,o.status=B):(ne(o,0),ne(o,0),ne(o,0),ne(o,0),ne(o,0),ne(o,9===o.level?2:o.strategy>=x||o.level<2?4:0),ne(o,K),o.status=H);else{var b=S+(o.w_bits-8<<4)<<8;b|=(o.strategy>=x||o.level<2?0:o.level<6?1:6===o.level?2:3)<<6,0!==o.strstart&&(b|=N),b+=31-b%31,o.status=H,re(o,b),0!==o.strstart&&(re(o,e.adler>>>16),re(o,65535&e.adler)),e.adler=1}if(o.status===B)if(o.gzhead.extra){for(a=o.pending;o.gzindex<(65535&o.gzhead.extra.length)&&(o.pending!==o.pending_buf_size||(o.gzhead.hcrc&&o.pending>a&&(e.adler=u(e.adler,o.pending_buf,o.pending-a,a)),ee(e),a=o.pending,o.pending!==o.pending_buf_size));)ne(o,255&o.gzhead.extra[o.gzindex]),o.gzindex++;o.gzhead.hcrc&&o.pending>a&&(e.adler=u(e.adler,o.pending_buf,o.pending-a,a)),o.gzindex===o.gzhead.extra.length&&(o.gzindex=0,o.status=U)}else o.status=U;if(o.status===U)if(o.gzhead.name){a=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>a&&(e.adler=u(e.adler,o.pending_buf,o.pending-a,a)),ee(e),a=o.pending,o.pending===o.pending_buf_size)){s=1;break}s=o.gzindexa&&(e.adler=u(e.adler,o.pending_buf,o.pending-a,a)),0===s&&(o.gzindex=0,o.status=V)}else o.status=V;if(o.status===V)if(o.gzhead.comment){a=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>a&&(e.adler=u(e.adler,o.pending_buf,o.pending-a,a)),ee(e),a=o.pending,o.pending===o.pending_buf_size)){s=1;break}s=o.gzindexa&&(e.adler=u(e.adler,o.pending_buf,o.pending-a,a)),0===s&&(o.status=W)}else o.status=W;if(o.status===W&&(o.gzhead.hcrc?(o.pending+2>o.pending_buf_size&&ee(e),o.pending+2<=o.pending_buf_size&&(ne(o,255&e.adler),ne(o,e.adler>>8&255),e.adler=0,o.status=H)):o.status=H),0!==o.pending){if(ee(e),0===e.avail_out)return o.last_flush=-1,h}else if(0===e.avail_in&&Q(t)<=Q(n)&&t!==p)return X(e,v);if(o.status===q&&0!==e.avail_in)return X(e,v);if(0!==e.avail_in||0!==o.lookahead||t!==l&&o.status!==q){var g=o.strategy===x?function(e,t){for(var n;;){if(0===e.lookahead&&(ie(e),0===e.lookahead)){if(t===l)return $;break}if(e.match_length=0,n=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(te(e,!1),0===e.strm.avail_out))return $}return e.insert=0,t===p?(te(e,!0),0===e.strm.avail_out?G:Z):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?$:Y}(o,t):o.strategy===O?function(e,t){for(var n,r,o,a,u=e.window;;){if(e.lookahead<=L){if(ie(e),e.lookahead<=L&&t===l)return $;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=F&&e.strstart>0&&(r=u[o=e.strstart-1])===u[++o]&&r===u[++o]&&r===u[++o]){a=e.strstart+L;do{}while(r===u[++o]&&r===u[++o]&&r===u[++o]&&r===u[++o]&&r===u[++o]&&r===u[++o]&&r===u[++o]&&r===u[++o]&&oe.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=F?(n=i._tr_tally(e,1,e.match_length-F),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(te(e,!1),0===e.strm.avail_out))return $}return e.insert=0,t===p?(te(e,!0),0===e.strm.avail_out?G:Z):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?$:Y}(o,t):r[o.level].func(o,t);if(g!==G&&g!==Z||(o.status=q),g===$||g===G)return 0===e.avail_out&&(o.last_flush=-1),h;if(g===Y&&(t===c?i._tr_align(o):t!==d&&(i._tr_stored_block(o,0,0,!1),t===f&&(J(o.head),0===o.lookahead&&(o.strstart=0,o.block_start=0,o.insert=0))),ee(e),0===e.avail_out))return o.last_flush=-1,h}return t!==p?h:o.wrap<=0?m:(2===o.wrap?(ne(o,255&e.adler),ne(o,e.adler>>8&255),ne(o,e.adler>>16&255),ne(o,e.adler>>24&255),ne(o,255&e.total_in),ne(o,e.total_in>>8&255),ne(o,e.total_in>>16&255),ne(o,e.total_in>>24&255)):(re(o,e.adler>>>16),re(o,65535&e.adler)),ee(e),o.wrap>0&&(o.wrap=-o.wrap),0!==o.pending?h:m)},t.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==z&&t!==B&&t!==U&&t!==V&&t!==W&&t!==H&&t!==q?X(e,y):(e.state=null,t===H?X(e,b):h):y},t.deflateSetDictionary=function(e,t){var n,r,i,u,s,l,c,f,p=t.length;if(!e||!e.state)return y;if(2===(u=(n=e.state).wrap)||1===u&&n.status!==z||n.lookahead)return y;for(1===u&&(e.adler=a(e.adler,t,p,0)),n.wrap=0,p>=n.w_size&&(0===u&&(J(n.head),n.strstart=0,n.block_start=0,n.insert=0),f=new o.Buf8(n.w_size),o.arraySet(f,t,p-n.w_size,n.w_size,0),t=f,p=n.w_size),s=e.avail_in,l=e.next_in,c=e.input,e.avail_in=p,e.next_in=0,e.input=t,ie(n);n.lookahead>=F;){r=n.strstart,i=n.lookahead-(F-1);do{n.ins_h=(n.ins_h<=0;)e[t]=0}var l=0,c=1,f=2,p=29,d=256,h=d+1+p,m=30,y=19,b=2*h+1,v=15,g=16,w=7,x=256,O=16,_=17,E=18,k=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],S=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],j=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],T=new Array(2*(h+2));s(T);var A=new Array(2*m);s(A);var P=new Array(512);s(P);var I=new Array(256);s(I);var R=new Array(p);s(R);var D,F,L,M=new Array(m);function N(e,t,n,r,o){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=o,this.has_stree=e&&e.length}function z(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function B(e){return e<256?P[e]:P[256+(e>>>7)]}function U(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function V(e,t,n){e.bi_valid>g-n?(e.bi_buf|=t<>g-e.bi_valid,e.bi_valid+=n-g):(e.bi_buf|=t<>>=1,n<<=1}while(--t>0);return n>>>1}function q(e,t,n){var r,o,i=new Array(v+1),a=0;for(r=1;r<=v;r++)i[r]=a=a+n[r-1]<<1;for(o=0;o<=t;o++){var u=e[2*o+1];0!==u&&(e[2*o]=H(i[u]++,u))}}function $(e){var t;for(t=0;t8?U(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function G(e,t,n,r){var o=2*t,i=2*n;return e[o]>1;n>=1;n--)Z(e,i,n);o=s;do{n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Z(e,i,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,i[2*o]=i[2*n]+i[2*r],e.depth[o]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,i[2*n+1]=i[2*r+1]=o,e.heap[1]=o++,Z(e,i,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,o,i,a,u,s=t.dyn_tree,l=t.max_code,c=t.stat_desc.static_tree,f=t.stat_desc.has_stree,p=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,h=t.stat_desc.max_length,m=0;for(i=0;i<=v;i++)e.bl_count[i]=0;for(s[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;nh&&(i=h,m++),s[2*r+1]=i,r>l||(e.bl_count[i]++,a=0,r>=d&&(a=p[r-d]),u=s[2*r],e.opt_len+=u*(i+a),f&&(e.static_len+=u*(c[2*r+1]+a)));if(0!==m){do{for(i=h-1;0===e.bl_count[i];)i--;e.bl_count[i]--,e.bl_count[i+1]+=2,e.bl_count[h]--,m-=2}while(m>0);for(i=h;0!==i;i--)for(r=e.bl_count[i];0!==r;)(o=e.heap[--n])>l||(s[2*o+1]!==i&&(e.opt_len+=(i-s[2*o+1])*s[2*o],s[2*o+1]=i),r--)}}(e,t),q(i,l,e.bl_count)}function Q(e,t,n){var r,o,i=-1,a=t[1],u=0,s=7,l=4;for(0===a&&(s=138,l=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)o=a,a=t[2*(r+1)+1],++u>=7;r0?(e.strm.data_type===u&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return i;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return a;for(t=32;t=3&&0===e.bl_tree[2*j[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),s=e.opt_len+3+7>>>3,(l=e.static_len+3+7>>>3)<=s&&(s=l)):s=l=n+5,n+4<=s&&-1!==t?te(e,t,n,r):e.strategy===o||l===s?(V(e,(c<<1)+(r?1:0),3),K(e,T,A)):(V(e,(f<<1)+(r?1:0),3),function(e,t,n,r){var o;for(V(e,t-257,5),V(e,n-1,5),V(e,r-4,4),o=0;o>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(I[n]+d+1)]++,e.dyn_dtree[2*B(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){V(e,c<<1,3),W(e,x,T),function(e){16===e.bi_valid?(U(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},function(e,t,n){"use strict";var r=n(286),o=n(92),i=n(248),a=n(250),u=n(194),s=n(249),l=n(289),c=Object.prototype.toString;function f(e){if(!(this instanceof f))return new f(e);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var n=r.inflateInit2(this.strm,t.windowBits);if(n!==a.Z_OK)throw new Error(u[n]);if(this.header=new l,r.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=i.string2buf(t.dictionary):"[object ArrayBuffer]"===c.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=r.inflateSetDictionary(this.strm,t.dictionary))!==a.Z_OK))throw new Error(u[n])}function p(e,t){var n=new f(t);if(n.push(e,!0),n.err)throw n.msg||u[n.err];return n.result}f.prototype.push=function(e,t){var n,u,s,l,f,p=this.strm,d=this.options.chunkSize,h=this.options.dictionary,m=!1;if(this.ended)return!1;u=t===~~t?t:!0===t?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof e?p.input=i.binstring2buf(e):"[object ArrayBuffer]"===c.call(e)?p.input=new Uint8Array(e):p.input=e,p.next_in=0,p.avail_in=p.input.length;do{if(0===p.avail_out&&(p.output=new o.Buf8(d),p.next_out=0,p.avail_out=d),(n=r.inflate(p,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&h&&(n=r.inflateSetDictionary(this.strm,h)),n===a.Z_BUF_ERROR&&!0===m&&(n=a.Z_OK,m=!1),n!==a.Z_STREAM_END&&n!==a.Z_OK)return this.onEnd(n),this.ended=!0,!1;p.next_out&&(0!==p.avail_out&&n!==a.Z_STREAM_END&&(0!==p.avail_in||u!==a.Z_FINISH&&u!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(s=i.utf8border(p.output,p.next_out),l=p.next_out-s,f=i.buf2string(p.output,s),p.next_out=l,p.avail_out=d-l,l&&o.arraySet(p.output,p.output,s,l,0),this.onData(f)):this.onData(o.shrinkBuf(p.output,p.next_out)))),0===p.avail_in&&0===p.avail_out&&(m=!0)}while((p.avail_in>0||0===p.avail_out)&&n!==a.Z_STREAM_END);return n===a.Z_STREAM_END&&(u=a.Z_FINISH),u===a.Z_FINISH?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===a.Z_OK):u!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),p.avail_out=0,!0)},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=f,t.inflate=p,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,p(e,t)},t.ungzip=p},function(e,t,n){"use strict";var r=n(92),o=n(246),i=n(247),a=n(287),u=n(288),s=0,l=1,c=2,f=4,p=5,d=6,h=0,m=1,y=2,b=-2,v=-3,g=-4,w=-5,x=8,O=1,_=2,E=3,k=4,S=5,C=6,j=7,T=8,A=9,P=10,I=11,R=12,D=13,F=14,L=15,M=16,N=17,z=18,B=19,U=20,V=21,W=22,H=23,q=24,$=25,Y=26,G=27,Z=28,K=29,X=30,Q=31,J=32,ee=852,te=592,ne=15;function re(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function oe(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ie(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=O,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(ee),t.distcode=t.distdyn=new r.Buf32(te),t.sane=1,t.back=-1,h):b}function ae(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,ie(e)):b}function ue(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?b:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,ae(e))):b}function se(e,t){var n,r;return e?(r=new oe,e.state=r,r.window=null,(n=ue(e,t))!==h&&(e.state=null),n):b}var le,ce,fe=!0;function pe(e){if(fe){var t;for(le=new r.Buf32(512),ce=new r.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(u(l,e.lens,0,288,le,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;u(c,e.lens,0,32,ce,0,e.work,{bits:5}),fe=!1}e.lencode=le,e.lenbits=9,e.distcode=ce,e.distbits=5}function de(e,t,n,o){var i,a=e.state;return null===a.window&&(a.wsize=1<=a.wsize?(r.arraySet(a.window,t,n-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((i=a.wsize-a.wnext)>o&&(i=o),r.arraySet(a.window,t,n-o,i,a.wnext),(o-=i)?(r.arraySet(a.window,t,n-o,o,0),a.wnext=o,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,n.check=i(n.check,Ce,2,0),ue=0,se=0,n.mode=_;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&ue)<<8)+(ue>>8))%31){e.msg="incorrect header check",n.mode=X;break}if((15&ue)!==x){e.msg="unknown compression method",n.mode=X;break}if(se-=4,Oe=8+(15&(ue>>>=4)),0===n.wbits)n.wbits=Oe;else if(Oe>n.wbits){e.msg="invalid window size",n.mode=X;break}n.dmax=1<>8&1),512&n.flags&&(Ce[0]=255&ue,Ce[1]=ue>>>8&255,n.check=i(n.check,Ce,2,0)),ue=0,se=0,n.mode=E;case E:for(;se<32;){if(0===ie)break e;ie--,ue+=ee[ne++]<>>8&255,Ce[2]=ue>>>16&255,Ce[3]=ue>>>24&255,n.check=i(n.check,Ce,4,0)),ue=0,se=0,n.mode=k;case k:for(;se<16;){if(0===ie)break e;ie--,ue+=ee[ne++]<>8),512&n.flags&&(Ce[0]=255&ue,Ce[1]=ue>>>8&255,n.check=i(n.check,Ce,2,0)),ue=0,se=0,n.mode=S;case S:if(1024&n.flags){for(;se<16;){if(0===ie)break e;ie--,ue+=ee[ne++]<>>8&255,n.check=i(n.check,Ce,2,0)),ue=0,se=0}else n.head&&(n.head.extra=null);n.mode=C;case C:if(1024&n.flags&&((fe=n.length)>ie&&(fe=ie),fe&&(n.head&&(Oe=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,ee,ne,fe,Oe)),512&n.flags&&(n.check=i(n.check,ee,fe,ne)),ie-=fe,ne+=fe,n.length-=fe),n.length))break e;n.length=0,n.mode=j;case j:if(2048&n.flags){if(0===ie)break e;fe=0;do{Oe=ee[ne+fe++],n.head&&Oe&&n.length<65536&&(n.head.name+=String.fromCharCode(Oe))}while(Oe&&fe>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=R;break;case P:for(;se<32;){if(0===ie)break e;ie--,ue+=ee[ne++]<>>=7&se,se-=7&se,n.mode=G;break}for(;se<3;){if(0===ie)break e;ie--,ue+=ee[ne++]<>>=1)){case 0:n.mode=F;break;case 1:if(pe(n),n.mode=U,t===d){ue>>>=2,se-=2;break e}break;case 2:n.mode=N;break;case 3:e.msg="invalid block type",n.mode=X}ue>>>=2,se-=2;break;case F:for(ue>>>=7&se,se-=7&se;se<32;){if(0===ie)break e;ie--,ue+=ee[ne++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=X;break}if(n.length=65535&ue,ue=0,se=0,n.mode=L,t===d)break e;case L:n.mode=M;case M:if(fe=n.length){if(fe>ie&&(fe=ie),fe>ae&&(fe=ae),0===fe)break e;r.arraySet(te,ee,ne,fe,oe),ie-=fe,ne+=fe,ae-=fe,oe+=fe,n.length-=fe;break}n.mode=R;break;case N:for(;se<14;){if(0===ie)break e;ie--,ue+=ee[ne++]<>>=5,se-=5,n.ndist=1+(31&ue),ue>>>=5,se-=5,n.ncode=4+(15&ue),ue>>>=4,se-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=X;break}n.have=0,n.mode=z;case z:for(;n.have>>=3,se-=3}for(;n.have<19;)n.lens[je[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,Ee={bits:n.lenbits},_e=u(s,n.lens,0,19,n.lencode,0,n.work,Ee),n.lenbits=Ee.bits,_e){e.msg="invalid code lengths set",n.mode=X;break}n.have=0,n.mode=B;case B:for(;n.have>>16&255,ve=65535&Se,!((ye=Se>>>24)<=se);){if(0===ie)break e;ie--,ue+=ee[ne++]<>>=ye,se-=ye,n.lens[n.have++]=ve;else{if(16===ve){for(ke=ye+2;se>>=ye,se-=ye,0===n.have){e.msg="invalid bit length repeat",n.mode=X;break}Oe=n.lens[n.have-1],fe=3+(3&ue),ue>>>=2,se-=2}else if(17===ve){for(ke=ye+3;se>>=ye)),ue>>>=3,se-=3}else{for(ke=ye+7;se>>=ye)),ue>>>=7,se-=7}if(n.have+fe>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=X;break}for(;fe--;)n.lens[n.have++]=Oe}}if(n.mode===X)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=X;break}if(n.lenbits=9,Ee={bits:n.lenbits},_e=u(l,n.lens,0,n.nlen,n.lencode,0,n.work,Ee),n.lenbits=Ee.bits,_e){e.msg="invalid literal/lengths set",n.mode=X;break}if(n.distbits=6,n.distcode=n.distdyn,Ee={bits:n.distbits},_e=u(c,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,Ee),n.distbits=Ee.bits,_e){e.msg="invalid distances set",n.mode=X;break}if(n.mode=U,t===d)break e;case U:n.mode=V;case V:if(ie>=6&&ae>=258){e.next_out=oe,e.avail_out=ae,e.next_in=ne,e.avail_in=ie,n.hold=ue,n.bits=se,a(e,ce),oe=e.next_out,te=e.output,ae=e.avail_out,ne=e.next_in,ee=e.input,ie=e.avail_in,ue=n.hold,se=n.bits,n.mode===R&&(n.back=-1);break}for(n.back=0;be=(Se=n.lencode[ue&(1<>>16&255,ve=65535&Se,!((ye=Se>>>24)<=se);){if(0===ie)break e;ie--,ue+=ee[ne++]<>ge)])>>>16&255,ve=65535&Se,!(ge+(ye=Se>>>24)<=se);){if(0===ie)break e;ie--,ue+=ee[ne++]<>>=ge,se-=ge,n.back+=ge}if(ue>>>=ye,se-=ye,n.back+=ye,n.length=ve,0===be){n.mode=Y;break}if(32&be){n.back=-1,n.mode=R;break}if(64&be){e.msg="invalid literal/length code",n.mode=X;break}n.extra=15&be,n.mode=W;case W:if(n.extra){for(ke=n.extra;se>>=n.extra,se-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=H;case H:for(;be=(Se=n.distcode[ue&(1<>>16&255,ve=65535&Se,!((ye=Se>>>24)<=se);){if(0===ie)break e;ie--,ue+=ee[ne++]<>ge)])>>>16&255,ve=65535&Se,!(ge+(ye=Se>>>24)<=se);){if(0===ie)break e;ie--,ue+=ee[ne++]<>>=ge,se-=ge,n.back+=ge}if(ue>>>=ye,se-=ye,n.back+=ye,64&be){e.msg="invalid distance code",n.mode=X;break}n.offset=ve,n.extra=15&be,n.mode=q;case q:if(n.extra){for(ke=n.extra;se>>=n.extra,se-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=X;break}n.mode=$;case $:if(0===ae)break e;if(fe=ce-ae,n.offset>fe){if((fe=n.offset-fe)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=X;break}fe>n.wnext?(fe-=n.wnext,he=n.wsize-fe):he=n.wnext-fe,fe>n.length&&(fe=n.length),me=n.window}else me=te,he=oe-n.offset,fe=n.length;fe>ae&&(fe=ae),ae-=fe,n.length-=fe;do{te[oe++]=me[he++]}while(--fe);0===n.length&&(n.mode=V);break;case Y:if(0===ae)break e;te[oe++]=n.length,ae--,n.mode=V;break;case G:if(n.wrap){for(;se<32;){if(0===ie)break e;ie--,ue|=ee[ne++]<>>=w=g>>>24,h-=w,0===(w=g>>>16&255))S[i++]=65535&g;else{if(!(16&w)){if(0==(64&w)){g=m[(65535&g)+(d&(1<>>=w,h-=w),h<15&&(d+=k[r++]<>>=w=g>>>24,h-=w,!(16&(w=g>>>16&255))){if(0==(64&w)){g=y[(65535&g)+(d&(1<s){e.msg="invalid distance too far back",n.mode=30;break e}if(d>>>=w,h-=w,O>(w=i-a)){if((w=O-w)>c&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(_=0,E=p,0===f){if(_+=l-w,w2;)S[i++]=E[_++],S[i++]=E[_++],S[i++]=E[_++],x-=3;x&&(S[i++]=E[_++],x>1&&(S[i++]=E[_++]))}else{_=i-O;do{S[i++]=S[_++],S[i++]=S[_++],S[i++]=S[_++],x-=3}while(x>2);x&&(S[i++]=S[_++],x>1&&(S[i++]=S[_++]))}break}}break}}while(r>3,d&=(1<<(h-=x<<3))-1,e.next_in=r,e.next_out=i,e.avail_in=r=1&&0===F[S];S--);if(C>S&&(C=S),0===S)return l[c++]=20971520,l[c++]=20971520,p.bits=1,0;for(k=1;k0&&(0===e||1!==S))return-1;for(L[1]=0,_=1;_<15;_++)L[_+1]=L[_]+F[_];for(E=0;E852||2===e&&P>592)return 1;for(;;){g=_-T,f[E]v?(w=M[N+f[E]],x=R[D+f[E]]):(w=96,x=0),d=1<<_-T,k=h=1<>T)+(h-=d)]=g<<24|w<<16|x|0}while(0!==h);for(d=1<<_-1;I&d;)d>>=1;if(0!==d?(I&=d-1,I+=d):I=0,E++,0==--F[_]){if(_===S)break;_=t[n+f[E]]}if(_>C&&(I&y)!==m){for(0===T&&(T=C),b+=k,A=1<<(j=_-T);j+T852||2===e&&P>592)return 1;l[m=I&y]=C<<24|j<<16|b-c|0}}return 0!==I&&(l[b+I]=_-T<<24|64<<16|0),p.bits=C,0}},function(e,t,n){"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},function(e,t,n){"use strict";var r=n(30),o=n(53),i=n(114),a=n(193),u=n(251),s=function(e,t){var n,r="";for(n=0;n>>=8;return r},l=function(e,t,n,o,l,c){var f,p,d=e.file,h=e.compression,m=c!==i.utf8encode,y=r.transformTo("string",c(d.name)),b=r.transformTo("string",i.utf8encode(d.name)),v=d.comment,g=r.transformTo("string",c(v)),w=r.transformTo("string",i.utf8encode(v)),x=b.length!==d.name.length,O=w.length!==v.length,_="",E="",k="",S=d.dir,C=d.date,j={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(j.crc32=e.crc32,j.compressedSize=e.compressedSize,j.uncompressedSize=e.uncompressedSize);var T=0;t&&(T|=8),m||!x&&!O||(T|=2048);var A,P,I,R=0,D=0;S&&(R|=16),"UNIX"===l?(D=798,R|=(A=d.unixPermissions,P=S,I=A,A||(I=P?16893:33204),(65535&I)<<16)):(D=20,R|=63&(d.dosPermissions||0)),f=C.getUTCHours(),f<<=6,f|=C.getUTCMinutes(),f<<=5,f|=C.getUTCSeconds()/2,p=C.getUTCFullYear()-1980,p<<=4,p|=C.getUTCMonth()+1,p<<=5,p|=C.getUTCDate(),x&&(E=s(1,1)+s(a(y),4)+b,_+="up"+s(E.length,2)+E),O&&(k=s(1,1)+s(a(g),4)+w,_+="uc"+s(k.length,2)+k);var F="";return F+="\n\0",F+=s(T,2),F+=h.magic,F+=s(f,2),F+=s(p,2),F+=s(j.crc32,4),F+=s(j.compressedSize,4),F+=s(j.uncompressedSize,4),F+=s(y.length,2),F+=s(_.length,2),{fileRecord:u.LOCAL_FILE_HEADER+F+y+_,dirRecord:u.CENTRAL_FILE_HEADER+s(D,2)+F+s(g.length,2)+"\0\0\0\0"+s(R,4)+s(o,4)+y+_+g}},c=function(e){return u.DATA_DESCRIPTOR+s(e.crc32,4)+s(e.compressedSize,4)+s(e.uncompressedSize,4)};function f(e,t,n,r){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}r.inherits(f,o),f.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,o.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},f.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=l(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},f.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=l(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:c(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},f.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e0)this.isSignature(t,i.CENTRAL_FILE_HEADER)||(this.reader.zero=r);else if(r<0)throw new Error("Corrupted zip: missing "+Math.abs(r)+" bytes.")},prepareReader:function(e){this.reader=r(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=s},function(e,t,n){"use strict";var r=n(254);function o(e){r.call(this,e)}n(30).inherits(o,r),o.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},o.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},o.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},o.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},e.exports=o},function(e,t,n){"use strict";var r=n(255);function o(e){r.call(this,e)}n(30).inherits(o,r),o.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},e.exports=o},function(e,t,n){"use strict";var r=n(252),o=n(30),i=n(192),a=n(193),u=n(114),s=n(245),l=n(91);function c(e,t){this.options=e,this.loadOptions=t}c.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,n;if(e.skip(22),this.fileNameLength=e.readInt(2),n=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(n),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in s)if(s.hasOwnProperty(t)&&s[t].magic===e)return s[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+o.pretty(this.compressionMethod)+" unknown (inner file : "+o.transformTo("string",this.fileName)+")");this.decompressed=new i(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===e&&(this.dosPermissions=63&this.externalFileAttributes),3===e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=r(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(e){var t,n,r,o=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index1&&void 0!==arguments[1]?arguments[1]:function(e){return e},n=g.map(function(n){var r=function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:[],t=(arguments.length>1?arguments[1]:void 0).map(function(e){return{type:"section",titleAs:"id",labelAs:"type",fields:Object.keys(e).map(function(t){return Z({},v[t]||v.id,{id:t,label:t,defaultValue:e[t]})})}});return[].concat(Y(e),Y(t))}(t.children,n[t.id]):t.defaultValue=n[t.id],t):t})},Q=function(e,t){return Object.keys(t).map(function(n){var r=Z({},e);return r.title=n,r.fields=X(r.fields,t[n]),r})};function J(e){return(J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ee(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}}),a):a}},function(e,t,n){"use strict";var r=n(24);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},function(e,t,n){"use strict";var r=n(24);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,o,i,a){var u=[];u.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),r.isString(o)&&u.push("path="+o),r.isString(i)&&u.push("domain="+i),!0===a&&u.push("secure"),document.cookie=u.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,n){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,n){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,n){"use strict";var r=n(153);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;e(function(e){n.reason||(n.reason=new r(e),t(n.reason))})}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o(function(t){e=t}),cancel:e}},e.exports=o},function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,n){"use strict";var r=n(15),o=n(79),i=n(102),a=o(6),u=!0;"findIndex"in[]&&Array(1).findIndex(function(){u=!1}),r({target:"Array",proto:!0,forced:u},{findIndex:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}}),i("findIndex")},function(e,t,n){var r=n(225),o=n(72);e.exports=function(e,t,n){if(r(t))throw TypeError("String.prototype."+n+" doesn't accept regex");return String(o(e))}},function(e,t,n){var r=n(22),o=n(44),i=n(18)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[i])?!!t:"RegExp"==o(e))}},function(e,t,n){var r=n(18)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,"/./"[e](t)}catch(e){}}return!1}},function(e,t,n){(function(t){(function(){var n,r,o,i,a,u;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:null!=t&&t.hrtime?(e.exports=function(){return(n()-a)/1e6},r=t.hrtime,i=(n=function(){var e;return 1e9*(e=r())[0]+e[1]})(),u=1e9*t.uptime(),a=i-u):Date.now?(e.exports=function(){return Date.now()-o},o=Date.now()):(e.exports=function(){return(new Date).getTime()-o},o=(new Date).getTime())}).call(this)}).call(this,n(62))},function(e,t,n){var r,o=n(229),i=n(230),a=(r=[],{activateTrap:function(e){if(r.length>0){var t=r[r.length-1];t!==e&&t.pause()}var n=r.indexOf(e);-1===n?r.push(e):(r.splice(n,1),r.push(e))},deactivateTrap:function(e){var t=r.indexOf(e);-1!==t&&r.splice(t,1),r.length>0&&r[r.length-1].unpause()}});function u(e){return setTimeout(e,0)}e.exports=function(e,t){var n=document,r="string"==typeof e?n.querySelector(e):e,s=i({returnFocusOnDeactivate:!0,escapeDeactivates:!0},t),l={firstTabbableNode:null,lastTabbableNode:null,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1},c={activate:function(e){if(!l.active){w(),l.active=!0,l.paused=!1,l.nodeFocusedBeforeActivation=n.activeElement;var t=e&&e.onActivate?e.onActivate:s.onActivate;return t&&t(),p(),c}},deactivate:f,pause:function(){!l.paused&&l.active&&(l.paused=!0,d())},unpause:function(){l.paused&&l.active&&(l.paused=!1,p())}};return c;function f(e){if(l.active){d(),l.active=!1,l.paused=!1,a.deactivateTrap(c);var t=e&&void 0!==e.onDeactivate?e.onDeactivate:s.onDeactivate;return t&&t(),(e&&void 0!==e.returnFocus?e.returnFocus:s.returnFocusOnDeactivate)&&u(function(){x(l.nodeFocusedBeforeActivation)}),c}}function p(){if(l.active)return a.activateTrap(c),w(),u(function(){x(m())}),n.addEventListener("focusin",b,!0),n.addEventListener("mousedown",y,!0),n.addEventListener("touchstart",y,!0),n.addEventListener("click",g,!0),n.addEventListener("keydown",v,!0),c}function d(){if(l.active)return n.removeEventListener("focusin",b,!0),n.removeEventListener("mousedown",y,!0),n.removeEventListener("touchstart",y,!0),n.removeEventListener("click",g,!0),n.removeEventListener("keydown",v,!0),c}function h(e){var t=s[e],r=t;if(!t)return null;if("string"==typeof t&&!(r=n.querySelector(t)))throw new Error("`"+e+"` refers to no known node");if("function"==typeof t&&!(r=t()))throw new Error("`"+e+"` did not return a node");return r}function m(){var e;if(!(e=null!==h("initialFocus")?h("initialFocus"):r.contains(n.activeElement)?n.activeElement:l.firstTabbableNode||h("fallbackFocus")))throw new Error("You can't have a focus-trap without at least one focusable element");return e}function y(e){r.contains(e.target)||(s.clickOutsideDeactivates?f({returnFocus:!o.isFocusable(e.target)}):e.preventDefault())}function b(e){r.contains(e.target)||e.target instanceof Document||(e.stopImmediatePropagation(),x(l.mostRecentlyFocusedNode||m()))}function v(e){if(!1!==s.escapeDeactivates&&function(e){return"Escape"===e.key||"Esc"===e.key||27===e.keyCode}(e))return e.preventDefault(),void f();(function(e){return"Tab"===e.key||9===e.keyCode})(e)&&function(e){if(w(),e.shiftKey&&e.target===l.firstTabbableNode)return e.preventDefault(),void x(l.lastTabbableNode);e.shiftKey||e.target!==l.lastTabbableNode||(e.preventDefault(),x(l.firstTabbableNode))}(e)}function g(e){s.clickOutsideDeactivates||r.contains(e.target)||(e.preventDefault(),e.stopImmediatePropagation())}function w(){var e=o(r);l.firstTabbableNode=e[0]||m(),l.lastTabbableNode=e[e.length-1]||m()}function x(e){e!==n.activeElement&&(e&&e.focus?(e.focus(),l.mostRecentlyFocusedNode=e,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(e)&&e.select()):x(m()))}}},function(e,t){var n=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'],r=n.join(","),o="undefined"==typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;function i(e,t){t=t||{};var n,i,u,s=[],f=[],d=new p(e.ownerDocument||e),h=e.querySelectorAll(r);for(t.includeContainer&&o.call(e,r)&&(h=Array.prototype.slice.apply(h)).unshift(e),n=0;n0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):x(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?x(e,a,t,!1):S(e,a)):x(e,a,t,!1))):r||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=O?e=O:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?o.nextTick(k,e):k(e))}function k(e){d("emit readable"),e.emit("readable"),A(e)}function S(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(C,e,t))}function C(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;ei.length?i.length:e;if(a===i.length?o+=i:o+=i.slice(0,e),0===(e-=a)){a===i.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(a));break}++r}return t.length-=r,o}(e,t):function(e,t){var n=l.allocUnsafe(e),r=t.head,o=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var i=r.data,a=e>i.length?i.length:e;if(i.copy(n,n.length-e,0,a),0===(e-=a)){a===i.length?(++o,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(a));break}++o}return t.length-=o,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function I(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,o.nextTick(R,t,e))}function R(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function D(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?I(this):E(this),null;if(0===(e=_(e,t))&&t.ended)return 0===t.length&&I(this),null;var r,o=t.needReadable;return d("need readable",o),(0===t.length||t.length-e0?P(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&I(this)),null!==r&&this.emit("data",r),r},g.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},g.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,d("pipe count=%d opts=%j",i.pipesCount,t);var s=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?c:g;function l(t,r){d("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,d("cleanup"),e.removeListener("close",b),e.removeListener("finish",v),e.removeListener("drain",f),e.removeListener("error",y),e.removeListener("unpipe",l),n.removeListener("end",c),n.removeListener("end",g),n.removeListener("data",m),p=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function c(){d("onend"),e.end()}i.endEmitted?o.nextTick(s):n.once("end",s),e.on("unpipe",l);var f=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&u(e,"data")&&(t.flowing=!0,A(e))}}(n);e.on("drain",f);var p=!1;var h=!1;function m(t){d("ondata"),h=!1,!1!==e.write(t)||h||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==D(i.pipes,e))&&!p&&(d("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,h=!0),n.pause())}function y(t){d("onerror",t),g(),e.removeListener("error",y),0===u(e,"error")&&e.emit("error",t)}function b(){e.removeListener("finish",v),g()}function v(){d("onfinish"),e.removeListener("close",b),g()}function g(){d("unpipe"),n.unpipe(e)}return n.on("data",m),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",y),e.once("close",b),e.once("finish",v),e.emit("pipe",n),i.flowing||(d("pipe resume"),n.resume()),e},g.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n),this);if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(266),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(33))},function(e,t,n){"use strict";var r=n(166).Buffer,o=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=s,this.end=l,t=4;break;case"utf8":this.fillLast=u,t=4;break;case"base64":this.text=c,this.end=f,t=3;break;default:return this.write=p,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function u(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function s(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function c(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function p(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0)return o>0&&(e.lastNeed=o-1),o;if(--r=0)return o>0&&(e.lastNeed=o-2),o;if(--r=0)return o>0&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){"use strict";e.exports=a;var r=n(105),o=n(139);function i(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length>2,u=(3&t)<<4|n>>4,s=d>1?(15&n)<<2|o>>6:64,l=d>2?63&o:64,c.push(i.charAt(a)+i.charAt(u)+i.charAt(s)+i.charAt(l));return c.join("")},t.decode=function(e){var t,n,r,a,u,s,l=0,c=0;if("data:"===e.substr(0,"data:".length))throw new Error("Invalid base64 input, it looks like a data url.");var f,p=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(e.charAt(e.length-1)===i.charAt(64)&&p--,e.charAt(e.length-2)===i.charAt(64)&&p--,p%1!=0)throw new Error("Invalid base64 input, bad content length.");for(f=o.uint8array?new Uint8Array(0|p):new Array(0|p);l>4,n=(15&a)<<4|(u=i.indexOf(e.charAt(l++)))>>2,r=(3&u)<<6|(s=i.indexOf(e.charAt(l++))),f[c++]=t,64!==u&&(f[c++]=n),64!==s&&(f[c++]=r);return f}},function(e,t,n){"use strict";(function(t){var r=n(30),o=n(276),i=n(53),a=n(239),u=n(91),s=n(140),l=null;if(u.nodestream)try{l=n(277)}catch(e){}function c(e,n){return new s.Promise(function(o,i){var u=[],s=e._internalType,l=e._outputType,c=e._mimeType;e.on("data",function(e,t){u.push(e),n&&n(t)}).on("error",function(e){u=[],i(e)}).on("end",function(){try{var e=function(e,t,n){switch(e){case"blob":return r.newBlob(r.transformTo("arraybuffer",t),n);case"base64":return a.encode(t);default:return r.transformTo(e,t)}}(l,function(e,n){var r,o=0,i=null,a=0;for(r=0;r=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=i},function(e,t,n){"use strict";var r=n(30),o=n(53);function i(e){o.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}r.inherits(i,o),i.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}o.prototype.processChunk.call(this,e)},e.exports=i},function(e,t,n){"use strict";var r=n(53),o=n(193);function i(){r.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n(30).inherits(i,r),i.prototype.processChunk=function(e){this.streamInfo.crc32=o(e.data,this.streamInfo.crc32||0),this.push(e)},e.exports=i},function(e,t,n){"use strict";var r=n(53);t.STORE={magic:"\0\0",compressWorker:function(e){return new r("STORE compression")},uncompressWorker:function(){return new r("STORE decompression")}},t.DEFLATE=n(280)},function(e,t,n){"use strict";e.exports=function(e,t,n,r){for(var o=65535&e|0,i=e>>>16&65535|0,a=0;0!==n;){n-=a=n>2e3?2e3:n;do{i=i+(o=o+t[r++]|0)|0}while(--a);o%=65521,i%=65521}return o|i<<16|0}},function(e,t,n){"use strict";var r=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();e.exports=function(e,t,n,o){var i=r,a=o+n;e^=-1;for(var u=o;u>>8^i[255&(e^t[u])];return-1^e}},function(e,t,n){"use strict";var r=n(92),o=!0,i=!0;try{String.fromCharCode.apply(null,[0])}catch(e){o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){i=!1}for(var a=new r.Buf8(256),u=0;u<256;u++)a[u]=u>=252?6:u>=248?5:u>=240?4:u>=224?3:u>=192?2:1;function s(e,t){if(t<65534&&(e.subarray&&i||!e.subarray&&o))return String.fromCharCode.apply(null,r.shrinkBuf(e,t));for(var n="",a=0;a>>6,t[a++]=128|63&n):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|63&n):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|63&n);return t},t.buf2binstring=function(e){return s(e,e.length)},t.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,o=t.length;n4)l[r++]=65533,n+=i-1;else{for(o&=2===i?31:3===i?15:7;i>1&&n1?l[r++]=65533:o<65536?l[r++]=o:(o-=65536,l[r++]=55296|o>>10&1023,l[r++]=56320|1023&o)}return s(l,r)},t.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0?t:0===n?t:n+a[e[n]]>t?n:t}},function(e,t,n){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(e,t,n){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(e,t,n){"use strict";t.LOCAL_FILE_HEADER="PK",t.CENTRAL_FILE_HEADER="PK",t.CENTRAL_DIRECTORY_END="PK",t.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",t.ZIP64_CENTRAL_DIRECTORY_END="PK",t.DATA_DESCRIPTOR="PK\b"},function(e,t,n){"use strict";var r=n(30),o=n(91),i=n(253),a=n(294),u=n(295),s=n(255);e.exports=function(e){var t=r.getTypeOf(e);return r.checkSupport(t),"string"!==t||o.uint8array?"nodebuffer"===t?new u(e):o.uint8array?new s(r.transformTo("uint8array",e)):new i(r.transformTo("array",e)):new a(e)}},function(e,t,n){"use strict";var r=n(254);function o(e){r.call(this,e);for(var t=0;t=0;--i)if(this.data[i]===t&&this.data[i+1]===n&&this.data[i+2]===r&&this.data[i+3]===o)return i-this.zero;return-1},o.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),o=e.charCodeAt(3),i=this.readData(4);return t===i[0]&&n===i[1]&&r===i[2]&&o===i[3]},o.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},e.exports=o},function(e,t,n){"use strict";var r=n(30);function o(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}o.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return r.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},e.exports=o},function(e,t,n){"use strict";var r=n(253);function o(e){r.call(this,e)}n(30).inherits(o,r),o.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},e.exports=o},function(e,t,n){"use strict";function r(){if(!(this instanceof r))return new r;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files={},this.comment=null,this.root="",this.clone=function(){var e=new r;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}r.prototype=n(259),r.prototype.loadAsync=n(292),r.support=n(91),r.defaults=n(241),r.version="3.2.0",r.loadAsync=function(e,t){return(new r).loadAsync(e,t)},r.external=n(140),e.exports=r},function(e,t,n){(function(n){var r,o,i;o=[],void 0===(i="function"==typeof(r=function(){"use strict";function t(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){a(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function r(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function o(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n&&n.global===n?n:void 0,a=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype?function(e,n,a){var u=i.URL||i.webkitURL,s=document.createElement("a");n=n||e.name||"download",s.download=n,s.rel="noopener","string"==typeof e?(s.href=e,s.origin===location.origin?o(s):r(s.href)?t(e,n,a):o(s,s.target="_blank")):(s.href=u.createObjectURL(e),setTimeout(function(){u.revokeObjectURL(s.href)},4e4),setTimeout(function(){o(s)},0))}:"msSaveOrOpenBlob"in navigator?function(e,n,i){if(n=n||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}(e,i),n);else if(r(e))t(e,n,i);else{var a=document.createElement("a");a.href=e,a.target="_blank",setTimeout(function(){o(a)})}}:function(e,n,r,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof e)return t(e,n,r);var a="application/octet-stream"===e.type,u=/constructor/i.test(i.HTMLElement)||i.safari,s=/CriOS\/[\d]+/.test(navigator.userAgent);if((s||a&&u)&&"object"==typeof FileReader){var l=new FileReader;l.onloadend=function(){var e=l.result;e=s?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=e:location=e,o=null},l.readAsDataURL(e)}else{var c=i.URL||i.webkitURL,f=c.createObjectURL(e);o?o.location=f:location.href=f,o=null,setTimeout(function(){c.revokeObjectURL(f)},4e4)}});i.saveAs=a.saveAs=a,e.exports=a})?r.apply(t,o):r)||(e.exports=i)}).call(this,n(33))},function(e,t,n){e.exports=n(298)},function(e,t,n){"use strict";var r=n(114),o=n(30),i=n(53),a=n(240),u=n(241),s=n(192),l=n(278),c=n(279),f=n(167),p=n(291),d=function(e,t,n){var r,a=o.getTypeOf(t),c=o.extend(n||{},u);c.date=c.date||new Date,null!==c.compression&&(c.compression=c.compression.toUpperCase()),"string"==typeof c.unixPermissions&&(c.unixPermissions=parseInt(c.unixPermissions,8)),c.unixPermissions&&16384&c.unixPermissions&&(c.dir=!0),c.dosPermissions&&16&c.dosPermissions&&(c.dir=!0),c.dir&&(e=m(e)),c.createFolders&&(r=h(e))&&y.call(this,r,!0);var d="string"===a&&!1===c.binary&&!1===c.base64;n&&void 0!==n.binary||(c.binary=!d),(t instanceof s&&0===t.uncompressedSize||c.dir||!t||0===t.length)&&(c.base64=!1,c.binary=!0,t="",c.compression="STORE",a="string");var b=null;b=t instanceof s||t instanceof i?t:f.isNode&&f.isStream(t)?new p(e,t):o.prepareContent(e,t,c.binary,c.optimizedBinaryString,c.base64);var v=new l(e,b,c);this.files[e]=v},h=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return t>0?e.substring(0,t):""},m=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},y=function(e,t){return t=void 0!==t?t:u.createFolders,e=m(e),this.files[e]||d.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function b(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var v={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,n,r;for(t in this.files)this.files.hasOwnProperty(t)&&(r=this.files[t],(n=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(n,r))},filter:function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(r)}),t},file:function(e,t,n){if(1===arguments.length){if(b(e)){var r=e;return this.filter(function(e,t){return!t.dir&&r.test(e)})}var o=this.files[this.root+e];return o&&!o.dir?o:null}return e=this.root+e,d.call(this,e,t,n),this},folder:function(e){if(!e)return this;if(b(e))return this.filter(function(t,n){return n.dir&&e.test(t)});var t=this.root+e,n=y.call(this,t),r=this.clone();return r.root=n.name,r},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var n=this.filter(function(t,n){return n.name.slice(0,e.length)===e}),r=0;r0?r-4:r,f=0;f>16&255,u[s++]=t>>8&255,u[s++]=255&t;2===a&&(t=o[e.charCodeAt(f)]<<2|o[e.charCodeAt(f+1)]>>4,u[s++]=255&t);1===a&&(t=o[e.charCodeAt(f)]<<10|o[e.charCodeAt(f+1)]<<4|o[e.charCodeAt(f+2)]>>2,u[s++]=t>>8&255,u[s++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,u=n-o;au?u:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,s=a.length;u0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,n){for(var o,i,a=[],u=t;u>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,o){var i,a,u=8*o-r-1,s=(1<>1,c=-7,f=n?o-1:0,p=n?-1:1,d=e[t+f];for(f+=p,i=d&(1<<-c)-1,d>>=-c,c+=u;c>0;i=256*i+e[t+f],f+=p,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=r;c>0;a=256*a+e[t+f],f+=p,c-=8);if(0===i)i=1-l;else{if(i===s)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),i-=l}return(d?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,u,s,l=8*i-o-1,c=(1<>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,h=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-a))<1&&(a--,s*=2),(t+=a+f>=1?p/s:p*Math.pow(2,1-f))*s>=2&&(a++,s/=2),a+f>=c?(u=0,a=c):a+f>=1?(u=(t*s-1)*Math.pow(2,o),a+=f):(u=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[n+d]=255&u,d+=h,u/=256,o-=8);for(a=a<0;e[n+d]=255&a,d+=h,a/=256,l-=8);e[n+d-h]|=128*m}},function(e,t,n){e.exports=o;var r=n(189).EventEmitter;function o(){r.call(this)}n(115)(o,r),o.Readable=n(190),o.Writable=n(269),o.Duplex=n(270),o.Transform=n(271),o.PassThrough=n(272),o.Stream=o,o.prototype.pipe=function(e,t){var n=this;function o(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function i(){n.readable&&n.resume&&n.resume()}n.on("data",o),e.on("drain",i),e._isStdio||t&&!1===t.end||(n.on("end",u),n.on("close",s));var a=!1;function u(){a||(a=!0,e.end())}function s(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(c(),0===r.listenerCount(this,"error"))throw e}function c(){n.removeListener("data",o),e.removeListener("drain",i),n.removeListener("end",u),n.removeListener("close",s),n.removeListener("error",l),e.removeListener("error",l),n.removeListener("end",c),n.removeListener("close",c),e.removeListener("close",c)}return n.on("error",l),e.on("error",l),n.on("end",c),n.on("close",c),e.on("close",c),e.emit("pipe",n),e}},function(e,t){},function(e,t,n){"use strict";var r=n(166).Buffer,o=n(265);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,o,i=r.allocUnsafe(e>>>0),a=this.head,u=0;a;)t=a.data,n=i,o=u,t.copy(n,o),u+=a.data.length,a=a.next;return i},e}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var e=o.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,a,u,s=1,l={},c=!1,f=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick(function(){h(e)})}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(h,0,e)}:(a="setImmediate$"+Math.random()+"$",u=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&h(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",u,!1):e.attachEvent("onmessage",u),r=function(t){e.postMessage(a+t,"*")}),p.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var n=r.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==l)throw new Error(a[n]);if(t.header&&r.deflateSetHeader(this.strm,t.header),t.dictionary){var h;if(h="string"==typeof t.dictionary?i.string2buf(t.dictionary):"[object ArrayBuffer]"===s.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(n=r.deflateSetDictionary(this.strm,h))!==l)throw new Error(a[n]);this._dict_set=!0}}function h(e,t){var n=new d(t);if(n.push(e,!0),n.err)throw n.msg||a[n.err];return n.result}d.prototype.push=function(e,t){var n,a,u=this.strm,c=this.options.chunkSize;if(this.ended)return!1;a=t===~~t?t:!0===t?4:0,"string"==typeof e?u.input=i.string2buf(e):"[object ArrayBuffer]"===s.call(e)?u.input=new Uint8Array(e):u.input=e,u.next_in=0,u.avail_in=u.input.length;do{if(0===u.avail_out&&(u.output=new o.Buf8(c),u.next_out=0,u.avail_out=c),1!==(n=r.deflate(u,a))&&n!==l)return this.onEnd(n),this.ended=!0,!1;0!==u.avail_out&&(0!==u.avail_in||4!==a&&2!==a)||("string"===this.options.to?this.onData(i.buf2binstring(o.shrinkBuf(u.output,u.next_out))):this.onData(o.shrinkBuf(u.output,u.next_out)))}while((u.avail_in>0||0===u.avail_out)&&1!==n);return 4===a?(n=r.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===l):2!==a||(this.onEnd(l),u.avail_out=0,!0)},d.prototype.onData=function(e){this.chunks.push(e)},d.prototype.onEnd=function(e){e===l&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=d,t.deflate=h,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,h(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,h(e,t)}},function(e,t,n){"use strict";var r,o=n(92),i=n(284),a=n(246),u=n(247),s=n(194),l=0,c=1,f=3,p=4,d=5,h=0,m=1,y=-2,b=-3,v=-5,g=-1,w=1,x=2,O=3,_=4,E=0,k=2,S=8,C=9,j=15,T=8,A=286,P=30,I=19,R=2*A+1,D=15,F=3,L=258,M=L+F+1,N=32,z=42,B=69,U=73,V=91,W=103,H=113,q=666,$=1,Y=2,G=3,Z=4,K=3;function X(e,t){return e.msg=s[t],t}function Q(e){return(e<<1)-(e>4?9:0)}function J(e){for(var t=e.length;--t>=0;)e[t]=0}function ee(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(o.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function te(e,t){i._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ee(e.strm)}function ne(e,t){e.pending_buf[e.pending++]=t}function re(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function oe(e,t){var n,r,o=e.max_chain_length,i=e.strstart,a=e.prev_length,u=e.nice_match,s=e.strstart>e.w_size-M?e.strstart-(e.w_size-M):0,l=e.window,c=e.w_mask,f=e.prev,p=e.strstart+L,d=l[i+a-1],h=l[i+a];e.prev_length>=e.good_match&&(o>>=2),u>e.lookahead&&(u=e.lookahead);do{if(l[(n=t)+a]===h&&l[n+a-1]===d&&l[n]===l[i]&&l[++n]===l[i+1]){i+=2,n++;do{}while(l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&l[++i]===l[++n]&&ia){if(e.match_start=t,a=r,r>=u)break;d=l[i+a-1],h=l[i+a]}}}while((t=f[t&c])>s&&0!=--o);return a<=e.lookahead?a:e.lookahead}function ie(e){var t,n,r,i,s,l,c,f,p,d,h=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=h+(h-M)){o.arraySet(e.window,e.window,h,h,0),e.match_start-=h,e.strstart-=h,e.block_start-=h,t=n=e.hash_size;do{r=e.head[--t],e.head[t]=r>=h?r-h:0}while(--n);t=n=h;do{r=e.prev[--t],e.prev[t]=r>=h?r-h:0}while(--n);i+=h}if(0===e.strm.avail_in)break;if(l=e.strm,c=e.window,f=e.strstart+e.lookahead,p=i,d=void 0,(d=l.avail_in)>p&&(d=p),n=0===d?0:(l.avail_in-=d,o.arraySet(c,l.input,l.next_in,d,f),1===l.state.wrap?l.adler=a(l.adler,c,d,f):2===l.state.wrap&&(l.adler=u(l.adler,c,d,f)),l.next_in+=d,l.total_in+=d,d),e.lookahead+=n,e.lookahead+e.insert>=F)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<=F&&(e.ins_h=(e.ins_h<=F)if(r=i._tr_tally(e,e.strstart-e.match_start,e.match_length-F),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=F){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=F&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=F-1)),e.prev_length>=F&&e.match_length<=e.prev_length){o=e.strstart+e.lookahead-F,r=i._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-F),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=o&&(e.ins_h=(e.ins_h<15&&(u=2,r-=16),i<1||i>C||n!==S||r<8||r>15||t<0||t>9||a<0||a>_)return X(e,y);8===r&&(r=9);var s=new le;return e.state=s,s.strm=e,s.wrap=u,s.gzhead=null,s.w_bits=r,s.w_size=1<e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(ie(e),0===e.lookahead&&t===l)return $;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,te(e,!1),0===e.strm.avail_out))return $;if(e.strstart-e.block_start>=e.w_size-M&&(te(e,!1),0===e.strm.avail_out))return $}return e.insert=0,t===p?(te(e,!0),0===e.strm.avail_out?G:Z):(e.strstart>e.block_start&&(te(e,!1),e.strm.avail_out),$)}),new se(4,4,8,4,ae),new se(4,5,16,8,ae),new se(4,6,32,32,ae),new se(4,4,16,16,ue),new se(8,16,32,32,ue),new se(8,16,128,128,ue),new se(8,32,128,256,ue),new se(32,128,258,1024,ue),new se(32,258,258,4096,ue)],t.deflateInit=function(e,t){return pe(e,t,S,j,T,E)},t.deflateInit2=pe,t.deflateReset=fe,t.deflateResetKeep=ce,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?y:(e.state.gzhead=t,h):y},t.deflate=function(e,t){var n,o,a,s;if(!e||!e.state||t>d||t<0)return e?X(e,y):y;if(o=e.state,!e.output||!e.input&&0!==e.avail_in||o.status===q&&t!==p)return X(e,0===e.avail_out?v:y);if(o.strm=e,n=o.last_flush,o.last_flush=t,o.status===z)if(2===o.wrap)e.adler=0,ne(o,31),ne(o,139),ne(o,8),o.gzhead?(ne(o,(o.gzhead.text?1:0)+(o.gzhead.hcrc?2:0)+(o.gzhead.extra?4:0)+(o.gzhead.name?8:0)+(o.gzhead.comment?16:0)),ne(o,255&o.gzhead.time),ne(o,o.gzhead.time>>8&255),ne(o,o.gzhead.time>>16&255),ne(o,o.gzhead.time>>24&255),ne(o,9===o.level?2:o.strategy>=x||o.level<2?4:0),ne(o,255&o.gzhead.os),o.gzhead.extra&&o.gzhead.extra.length&&(ne(o,255&o.gzhead.extra.length),ne(o,o.gzhead.extra.length>>8&255)),o.gzhead.hcrc&&(e.adler=u(e.adler,o.pending_buf,o.pending,0)),o.gzindex=0,o.status=B):(ne(o,0),ne(o,0),ne(o,0),ne(o,0),ne(o,0),ne(o,9===o.level?2:o.strategy>=x||o.level<2?4:0),ne(o,K),o.status=H);else{var b=S+(o.w_bits-8<<4)<<8;b|=(o.strategy>=x||o.level<2?0:o.level<6?1:6===o.level?2:3)<<6,0!==o.strstart&&(b|=N),b+=31-b%31,o.status=H,re(o,b),0!==o.strstart&&(re(o,e.adler>>>16),re(o,65535&e.adler)),e.adler=1}if(o.status===B)if(o.gzhead.extra){for(a=o.pending;o.gzindex<(65535&o.gzhead.extra.length)&&(o.pending!==o.pending_buf_size||(o.gzhead.hcrc&&o.pending>a&&(e.adler=u(e.adler,o.pending_buf,o.pending-a,a)),ee(e),a=o.pending,o.pending!==o.pending_buf_size));)ne(o,255&o.gzhead.extra[o.gzindex]),o.gzindex++;o.gzhead.hcrc&&o.pending>a&&(e.adler=u(e.adler,o.pending_buf,o.pending-a,a)),o.gzindex===o.gzhead.extra.length&&(o.gzindex=0,o.status=U)}else o.status=U;if(o.status===U)if(o.gzhead.name){a=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>a&&(e.adler=u(e.adler,o.pending_buf,o.pending-a,a)),ee(e),a=o.pending,o.pending===o.pending_buf_size)){s=1;break}s=o.gzindexa&&(e.adler=u(e.adler,o.pending_buf,o.pending-a,a)),0===s&&(o.gzindex=0,o.status=V)}else o.status=V;if(o.status===V)if(o.gzhead.comment){a=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>a&&(e.adler=u(e.adler,o.pending_buf,o.pending-a,a)),ee(e),a=o.pending,o.pending===o.pending_buf_size)){s=1;break}s=o.gzindexa&&(e.adler=u(e.adler,o.pending_buf,o.pending-a,a)),0===s&&(o.status=W)}else o.status=W;if(o.status===W&&(o.gzhead.hcrc?(o.pending+2>o.pending_buf_size&&ee(e),o.pending+2<=o.pending_buf_size&&(ne(o,255&e.adler),ne(o,e.adler>>8&255),e.adler=0,o.status=H)):o.status=H),0!==o.pending){if(ee(e),0===e.avail_out)return o.last_flush=-1,h}else if(0===e.avail_in&&Q(t)<=Q(n)&&t!==p)return X(e,v);if(o.status===q&&0!==e.avail_in)return X(e,v);if(0!==e.avail_in||0!==o.lookahead||t!==l&&o.status!==q){var g=o.strategy===x?function(e,t){for(var n;;){if(0===e.lookahead&&(ie(e),0===e.lookahead)){if(t===l)return $;break}if(e.match_length=0,n=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(te(e,!1),0===e.strm.avail_out))return $}return e.insert=0,t===p?(te(e,!0),0===e.strm.avail_out?G:Z):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?$:Y}(o,t):o.strategy===O?function(e,t){for(var n,r,o,a,u=e.window;;){if(e.lookahead<=L){if(ie(e),e.lookahead<=L&&t===l)return $;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=F&&e.strstart>0&&(r=u[o=e.strstart-1])===u[++o]&&r===u[++o]&&r===u[++o]){a=e.strstart+L;do{}while(r===u[++o]&&r===u[++o]&&r===u[++o]&&r===u[++o]&&r===u[++o]&&r===u[++o]&&r===u[++o]&&r===u[++o]&&oe.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=F?(n=i._tr_tally(e,1,e.match_length-F),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(te(e,!1),0===e.strm.avail_out))return $}return e.insert=0,t===p?(te(e,!0),0===e.strm.avail_out?G:Z):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?$:Y}(o,t):r[o.level].func(o,t);if(g!==G&&g!==Z||(o.status=q),g===$||g===G)return 0===e.avail_out&&(o.last_flush=-1),h;if(g===Y&&(t===c?i._tr_align(o):t!==d&&(i._tr_stored_block(o,0,0,!1),t===f&&(J(o.head),0===o.lookahead&&(o.strstart=0,o.block_start=0,o.insert=0))),ee(e),0===e.avail_out))return o.last_flush=-1,h}return t!==p?h:o.wrap<=0?m:(2===o.wrap?(ne(o,255&e.adler),ne(o,e.adler>>8&255),ne(o,e.adler>>16&255),ne(o,e.adler>>24&255),ne(o,255&e.total_in),ne(o,e.total_in>>8&255),ne(o,e.total_in>>16&255),ne(o,e.total_in>>24&255)):(re(o,e.adler>>>16),re(o,65535&e.adler)),ee(e),o.wrap>0&&(o.wrap=-o.wrap),0!==o.pending?h:m)},t.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==z&&t!==B&&t!==U&&t!==V&&t!==W&&t!==H&&t!==q?X(e,y):(e.state=null,t===H?X(e,b):h):y},t.deflateSetDictionary=function(e,t){var n,r,i,u,s,l,c,f,p=t.length;if(!e||!e.state)return y;if(2===(u=(n=e.state).wrap)||1===u&&n.status!==z||n.lookahead)return y;for(1===u&&(e.adler=a(e.adler,t,p,0)),n.wrap=0,p>=n.w_size&&(0===u&&(J(n.head),n.strstart=0,n.block_start=0,n.insert=0),f=new o.Buf8(n.w_size),o.arraySet(f,t,p-n.w_size,n.w_size,0),t=f,p=n.w_size),s=e.avail_in,l=e.next_in,c=e.input,e.avail_in=p,e.next_in=0,e.input=t,ie(n);n.lookahead>=F;){r=n.strstart,i=n.lookahead-(F-1);do{n.ins_h=(n.ins_h<=0;)e[t]=0}var l=0,c=1,f=2,p=29,d=256,h=d+1+p,m=30,y=19,b=2*h+1,v=15,g=16,w=7,x=256,O=16,_=17,E=18,k=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],S=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],j=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],T=new Array(2*(h+2));s(T);var A=new Array(2*m);s(A);var P=new Array(512);s(P);var I=new Array(256);s(I);var R=new Array(p);s(R);var D,F,L,M=new Array(m);function N(e,t,n,r,o){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=o,this.has_stree=e&&e.length}function z(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function B(e){return e<256?P[e]:P[256+(e>>>7)]}function U(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function V(e,t,n){e.bi_valid>g-n?(e.bi_buf|=t<>g-e.bi_valid,e.bi_valid+=n-g):(e.bi_buf|=t<>>=1,n<<=1}while(--t>0);return n>>>1}function q(e,t,n){var r,o,i=new Array(v+1),a=0;for(r=1;r<=v;r++)i[r]=a=a+n[r-1]<<1;for(o=0;o<=t;o++){var u=e[2*o+1];0!==u&&(e[2*o]=H(i[u]++,u))}}function $(e){var t;for(t=0;t8?U(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function G(e,t,n,r){var o=2*t,i=2*n;return e[o]>1;n>=1;n--)Z(e,i,n);o=s;do{n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Z(e,i,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,i[2*o]=i[2*n]+i[2*r],e.depth[o]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,i[2*n+1]=i[2*r+1]=o,e.heap[1]=o++,Z(e,i,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,o,i,a,u,s=t.dyn_tree,l=t.max_code,c=t.stat_desc.static_tree,f=t.stat_desc.has_stree,p=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,h=t.stat_desc.max_length,m=0;for(i=0;i<=v;i++)e.bl_count[i]=0;for(s[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;nh&&(i=h,m++),s[2*r+1]=i,r>l||(e.bl_count[i]++,a=0,r>=d&&(a=p[r-d]),u=s[2*r],e.opt_len+=u*(i+a),f&&(e.static_len+=u*(c[2*r+1]+a)));if(0!==m){do{for(i=h-1;0===e.bl_count[i];)i--;e.bl_count[i]--,e.bl_count[i+1]+=2,e.bl_count[h]--,m-=2}while(m>0);for(i=h;0!==i;i--)for(r=e.bl_count[i];0!==r;)(o=e.heap[--n])>l||(s[2*o+1]!==i&&(e.opt_len+=(i-s[2*o+1])*s[2*o],s[2*o+1]=i),r--)}}(e,t),q(i,l,e.bl_count)}function Q(e,t,n){var r,o,i=-1,a=t[1],u=0,s=7,l=4;for(0===a&&(s=138,l=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)o=a,a=t[2*(r+1)+1],++u>=7;r0?(e.strm.data_type===u&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return i;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return a;for(t=32;t=3&&0===e.bl_tree[2*j[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),s=e.opt_len+3+7>>>3,(l=e.static_len+3+7>>>3)<=s&&(s=l)):s=l=n+5,n+4<=s&&-1!==t?te(e,t,n,r):e.strategy===o||l===s?(V(e,(c<<1)+(r?1:0),3),K(e,T,A)):(V(e,(f<<1)+(r?1:0),3),function(e,t,n,r){var o;for(V(e,t-257,5),V(e,n-1,5),V(e,r-4,4),o=0;o>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(I[n]+d+1)]++,e.dyn_dtree[2*B(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){V(e,c<<1,3),W(e,x,T),function(e){16===e.bi_valid?(U(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},function(e,t,n){"use strict";var r=n(286),o=n(92),i=n(248),a=n(250),u=n(194),s=n(249),l=n(289),c=Object.prototype.toString;function f(e){if(!(this instanceof f))return new f(e);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var n=r.inflateInit2(this.strm,t.windowBits);if(n!==a.Z_OK)throw new Error(u[n]);if(this.header=new l,r.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=i.string2buf(t.dictionary):"[object ArrayBuffer]"===c.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=r.inflateSetDictionary(this.strm,t.dictionary))!==a.Z_OK))throw new Error(u[n])}function p(e,t){var n=new f(t);if(n.push(e,!0),n.err)throw n.msg||u[n.err];return n.result}f.prototype.push=function(e,t){var n,u,s,l,f,p=this.strm,d=this.options.chunkSize,h=this.options.dictionary,m=!1;if(this.ended)return!1;u=t===~~t?t:!0===t?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof e?p.input=i.binstring2buf(e):"[object ArrayBuffer]"===c.call(e)?p.input=new Uint8Array(e):p.input=e,p.next_in=0,p.avail_in=p.input.length;do{if(0===p.avail_out&&(p.output=new o.Buf8(d),p.next_out=0,p.avail_out=d),(n=r.inflate(p,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&h&&(n=r.inflateSetDictionary(this.strm,h)),n===a.Z_BUF_ERROR&&!0===m&&(n=a.Z_OK,m=!1),n!==a.Z_STREAM_END&&n!==a.Z_OK)return this.onEnd(n),this.ended=!0,!1;p.next_out&&(0!==p.avail_out&&n!==a.Z_STREAM_END&&(0!==p.avail_in||u!==a.Z_FINISH&&u!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(s=i.utf8border(p.output,p.next_out),l=p.next_out-s,f=i.buf2string(p.output,s),p.next_out=l,p.avail_out=d-l,l&&o.arraySet(p.output,p.output,s,l,0),this.onData(f)):this.onData(o.shrinkBuf(p.output,p.next_out)))),0===p.avail_in&&0===p.avail_out&&(m=!0)}while((p.avail_in>0||0===p.avail_out)&&n!==a.Z_STREAM_END);return n===a.Z_STREAM_END&&(u=a.Z_FINISH),u===a.Z_FINISH?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===a.Z_OK):u!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),p.avail_out=0,!0)},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=f,t.inflate=p,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,p(e,t)},t.ungzip=p},function(e,t,n){"use strict";var r=n(92),o=n(246),i=n(247),a=n(287),u=n(288),s=0,l=1,c=2,f=4,p=5,d=6,h=0,m=1,y=2,b=-2,v=-3,g=-4,w=-5,x=8,O=1,_=2,E=3,k=4,S=5,C=6,j=7,T=8,A=9,P=10,I=11,R=12,D=13,F=14,L=15,M=16,N=17,z=18,B=19,U=20,V=21,W=22,H=23,q=24,$=25,Y=26,G=27,Z=28,K=29,X=30,Q=31,J=32,ee=852,te=592,ne=15;function re(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function oe(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ie(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=O,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(ee),t.distcode=t.distdyn=new r.Buf32(te),t.sane=1,t.back=-1,h):b}function ae(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,ie(e)):b}function ue(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?b:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,ae(e))):b}function se(e,t){var n,r;return e?(r=new oe,e.state=r,r.window=null,(n=ue(e,t))!==h&&(e.state=null),n):b}var le,ce,fe=!0;function pe(e){if(fe){var t;for(le=new r.Buf32(512),ce=new r.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(u(l,e.lens,0,288,le,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;u(c,e.lens,0,32,ce,0,e.work,{bits:5}),fe=!1}e.lencode=le,e.lenbits=9,e.distcode=ce,e.distbits=5}function de(e,t,n,o){var i,a=e.state;return null===a.window&&(a.wsize=1<=a.wsize?(r.arraySet(a.window,t,n-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((i=a.wsize-a.wnext)>o&&(i=o),r.arraySet(a.window,t,n-o,i,a.wnext),(o-=i)?(r.arraySet(a.window,t,n-o,o,0),a.wnext=o,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,n.check=i(n.check,Ce,2,0),ue=0,se=0,n.mode=_;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&ue)<<8)+(ue>>8))%31){e.msg="incorrect header check",n.mode=X;break}if((15&ue)!==x){e.msg="unknown compression method",n.mode=X;break}if(se-=4,Oe=8+(15&(ue>>>=4)),0===n.wbits)n.wbits=Oe;else if(Oe>n.wbits){e.msg="invalid window size",n.mode=X;break}n.dmax=1<>8&1),512&n.flags&&(Ce[0]=255&ue,Ce[1]=ue>>>8&255,n.check=i(n.check,Ce,2,0)),ue=0,se=0,n.mode=E;case E:for(;se<32;){if(0===ie)break e;ie--,ue+=ee[ne++]<>>8&255,Ce[2]=ue>>>16&255,Ce[3]=ue>>>24&255,n.check=i(n.check,Ce,4,0)),ue=0,se=0,n.mode=k;case k:for(;se<16;){if(0===ie)break e;ie--,ue+=ee[ne++]<>8),512&n.flags&&(Ce[0]=255&ue,Ce[1]=ue>>>8&255,n.check=i(n.check,Ce,2,0)),ue=0,se=0,n.mode=S;case S:if(1024&n.flags){for(;se<16;){if(0===ie)break e;ie--,ue+=ee[ne++]<>>8&255,n.check=i(n.check,Ce,2,0)),ue=0,se=0}else n.head&&(n.head.extra=null);n.mode=C;case C:if(1024&n.flags&&((fe=n.length)>ie&&(fe=ie),fe&&(n.head&&(Oe=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,ee,ne,fe,Oe)),512&n.flags&&(n.check=i(n.check,ee,fe,ne)),ie-=fe,ne+=fe,n.length-=fe),n.length))break e;n.length=0,n.mode=j;case j:if(2048&n.flags){if(0===ie)break e;fe=0;do{Oe=ee[ne+fe++],n.head&&Oe&&n.length<65536&&(n.head.name+=String.fromCharCode(Oe))}while(Oe&&fe>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=R;break;case P:for(;se<32;){if(0===ie)break e;ie--,ue+=ee[ne++]<>>=7&se,se-=7&se,n.mode=G;break}for(;se<3;){if(0===ie)break e;ie--,ue+=ee[ne++]<>>=1)){case 0:n.mode=F;break;case 1:if(pe(n),n.mode=U,t===d){ue>>>=2,se-=2;break e}break;case 2:n.mode=N;break;case 3:e.msg="invalid block type",n.mode=X}ue>>>=2,se-=2;break;case F:for(ue>>>=7&se,se-=7&se;se<32;){if(0===ie)break e;ie--,ue+=ee[ne++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=X;break}if(n.length=65535&ue,ue=0,se=0,n.mode=L,t===d)break e;case L:n.mode=M;case M:if(fe=n.length){if(fe>ie&&(fe=ie),fe>ae&&(fe=ae),0===fe)break e;r.arraySet(te,ee,ne,fe,oe),ie-=fe,ne+=fe,ae-=fe,oe+=fe,n.length-=fe;break}n.mode=R;break;case N:for(;se<14;){if(0===ie)break e;ie--,ue+=ee[ne++]<>>=5,se-=5,n.ndist=1+(31&ue),ue>>>=5,se-=5,n.ncode=4+(15&ue),ue>>>=4,se-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=X;break}n.have=0,n.mode=z;case z:for(;n.have>>=3,se-=3}for(;n.have<19;)n.lens[je[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,Ee={bits:n.lenbits},_e=u(s,n.lens,0,19,n.lencode,0,n.work,Ee),n.lenbits=Ee.bits,_e){e.msg="invalid code lengths set",n.mode=X;break}n.have=0,n.mode=B;case B:for(;n.have>>16&255,ve=65535&Se,!((ye=Se>>>24)<=se);){if(0===ie)break e;ie--,ue+=ee[ne++]<>>=ye,se-=ye,n.lens[n.have++]=ve;else{if(16===ve){for(ke=ye+2;se>>=ye,se-=ye,0===n.have){e.msg="invalid bit length repeat",n.mode=X;break}Oe=n.lens[n.have-1],fe=3+(3&ue),ue>>>=2,se-=2}else if(17===ve){for(ke=ye+3;se>>=ye)),ue>>>=3,se-=3}else{for(ke=ye+7;se>>=ye)),ue>>>=7,se-=7}if(n.have+fe>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=X;break}for(;fe--;)n.lens[n.have++]=Oe}}if(n.mode===X)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=X;break}if(n.lenbits=9,Ee={bits:n.lenbits},_e=u(l,n.lens,0,n.nlen,n.lencode,0,n.work,Ee),n.lenbits=Ee.bits,_e){e.msg="invalid literal/lengths set",n.mode=X;break}if(n.distbits=6,n.distcode=n.distdyn,Ee={bits:n.distbits},_e=u(c,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,Ee),n.distbits=Ee.bits,_e){e.msg="invalid distances set",n.mode=X;break}if(n.mode=U,t===d)break e;case U:n.mode=V;case V:if(ie>=6&&ae>=258){e.next_out=oe,e.avail_out=ae,e.next_in=ne,e.avail_in=ie,n.hold=ue,n.bits=se,a(e,ce),oe=e.next_out,te=e.output,ae=e.avail_out,ne=e.next_in,ee=e.input,ie=e.avail_in,ue=n.hold,se=n.bits,n.mode===R&&(n.back=-1);break}for(n.back=0;be=(Se=n.lencode[ue&(1<>>16&255,ve=65535&Se,!((ye=Se>>>24)<=se);){if(0===ie)break e;ie--,ue+=ee[ne++]<>ge)])>>>16&255,ve=65535&Se,!(ge+(ye=Se>>>24)<=se);){if(0===ie)break e;ie--,ue+=ee[ne++]<>>=ge,se-=ge,n.back+=ge}if(ue>>>=ye,se-=ye,n.back+=ye,n.length=ve,0===be){n.mode=Y;break}if(32&be){n.back=-1,n.mode=R;break}if(64&be){e.msg="invalid literal/length code",n.mode=X;break}n.extra=15&be,n.mode=W;case W:if(n.extra){for(ke=n.extra;se>>=n.extra,se-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=H;case H:for(;be=(Se=n.distcode[ue&(1<>>16&255,ve=65535&Se,!((ye=Se>>>24)<=se);){if(0===ie)break e;ie--,ue+=ee[ne++]<>ge)])>>>16&255,ve=65535&Se,!(ge+(ye=Se>>>24)<=se);){if(0===ie)break e;ie--,ue+=ee[ne++]<>>=ge,se-=ge,n.back+=ge}if(ue>>>=ye,se-=ye,n.back+=ye,64&be){e.msg="invalid distance code",n.mode=X;break}n.offset=ve,n.extra=15&be,n.mode=q;case q:if(n.extra){for(ke=n.extra;se>>=n.extra,se-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=X;break}n.mode=$;case $:if(0===ae)break e;if(fe=ce-ae,n.offset>fe){if((fe=n.offset-fe)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=X;break}fe>n.wnext?(fe-=n.wnext,he=n.wsize-fe):he=n.wnext-fe,fe>n.length&&(fe=n.length),me=n.window}else me=te,he=oe-n.offset,fe=n.length;fe>ae&&(fe=ae),ae-=fe,n.length-=fe;do{te[oe++]=me[he++]}while(--fe);0===n.length&&(n.mode=V);break;case Y:if(0===ae)break e;te[oe++]=n.length,ae--,n.mode=V;break;case G:if(n.wrap){for(;se<32;){if(0===ie)break e;ie--,ue|=ee[ne++]<>>=w=g>>>24,h-=w,0===(w=g>>>16&255))S[i++]=65535&g;else{if(!(16&w)){if(0==(64&w)){g=m[(65535&g)+(d&(1<>>=w,h-=w),h<15&&(d+=k[r++]<>>=w=g>>>24,h-=w,!(16&(w=g>>>16&255))){if(0==(64&w)){g=y[(65535&g)+(d&(1<s){e.msg="invalid distance too far back",n.mode=30;break e}if(d>>>=w,h-=w,O>(w=i-a)){if((w=O-w)>c&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(_=0,E=p,0===f){if(_+=l-w,w2;)S[i++]=E[_++],S[i++]=E[_++],S[i++]=E[_++],x-=3;x&&(S[i++]=E[_++],x>1&&(S[i++]=E[_++]))}else{_=i-O;do{S[i++]=S[_++],S[i++]=S[_++],S[i++]=S[_++],x-=3}while(x>2);x&&(S[i++]=S[_++],x>1&&(S[i++]=S[_++]))}break}}break}}while(r>3,d&=(1<<(h-=x<<3))-1,e.next_in=r,e.next_out=i,e.avail_in=r=1&&0===F[S];S--);if(C>S&&(C=S),0===S)return l[c++]=20971520,l[c++]=20971520,p.bits=1,0;for(k=1;k0&&(0===e||1!==S))return-1;for(L[1]=0,_=1;_<15;_++)L[_+1]=L[_]+F[_];for(E=0;E852||2===e&&P>592)return 1;for(;;){g=_-T,f[E]v?(w=M[N+f[E]],x=R[D+f[E]]):(w=96,x=0),d=1<<_-T,k=h=1<>T)+(h-=d)]=g<<24|w<<16|x|0}while(0!==h);for(d=1<<_-1;I&d;)d>>=1;if(0!==d?(I&=d-1,I+=d):I=0,E++,0==--F[_]){if(_===S)break;_=t[n+f[E]]}if(_>C&&(I&y)!==m){for(0===T&&(T=C),b+=k,A=1<<(j=_-T);j+T852||2===e&&P>592)return 1;l[m=I&y]=C<<24|j<<16|b-c|0}}return 0!==I&&(l[b+I]=_-T<<24|64<<16|0),p.bits=C,0}},function(e,t,n){"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},function(e,t,n){"use strict";var r=n(30),o=n(53),i=n(114),a=n(193),u=n(251),s=function(e,t){var n,r="";for(n=0;n>>=8;return r},l=function(e,t,n,o,l,c){var f,p,d=e.file,h=e.compression,m=c!==i.utf8encode,y=r.transformTo("string",c(d.name)),b=r.transformTo("string",i.utf8encode(d.name)),v=d.comment,g=r.transformTo("string",c(v)),w=r.transformTo("string",i.utf8encode(v)),x=b.length!==d.name.length,O=w.length!==v.length,_="",E="",k="",S=d.dir,C=d.date,j={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(j.crc32=e.crc32,j.compressedSize=e.compressedSize,j.uncompressedSize=e.uncompressedSize);var T=0;t&&(T|=8),m||!x&&!O||(T|=2048);var A,P,I,R=0,D=0;S&&(R|=16),"UNIX"===l?(D=798,R|=(A=d.unixPermissions,P=S,I=A,A||(I=P?16893:33204),(65535&I)<<16)):(D=20,R|=63&(d.dosPermissions||0)),f=C.getUTCHours(),f<<=6,f|=C.getUTCMinutes(),f<<=5,f|=C.getUTCSeconds()/2,p=C.getUTCFullYear()-1980,p<<=4,p|=C.getUTCMonth()+1,p<<=5,p|=C.getUTCDate(),x&&(E=s(1,1)+s(a(y),4)+b,_+="up"+s(E.length,2)+E),O&&(k=s(1,1)+s(a(g),4)+w,_+="uc"+s(k.length,2)+k);var F="";return F+="\n\0",F+=s(T,2),F+=h.magic,F+=s(f,2),F+=s(p,2),F+=s(j.crc32,4),F+=s(j.compressedSize,4),F+=s(j.uncompressedSize,4),F+=s(y.length,2),F+=s(_.length,2),{fileRecord:u.LOCAL_FILE_HEADER+F+y+_,dirRecord:u.CENTRAL_FILE_HEADER+s(D,2)+F+s(g.length,2)+"\0\0\0\0"+s(R,4)+s(o,4)+y+_+g}},c=function(e){return u.DATA_DESCRIPTOR+s(e.crc32,4)+s(e.compressedSize,4)+s(e.uncompressedSize,4)};function f(e,t,n,r){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}r.inherits(f,o),f.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,o.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},f.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=l(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},f.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=l(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:c(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},f.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e0)this.isSignature(t,i.CENTRAL_FILE_HEADER)||(this.reader.zero=r);else if(r<0)throw new Error("Corrupted zip: missing "+Math.abs(r)+" bytes.")},prepareReader:function(e){this.reader=r(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=s},function(e,t,n){"use strict";var r=n(254);function o(e){r.call(this,e)}n(30).inherits(o,r),o.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},o.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},o.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},o.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},e.exports=o},function(e,t,n){"use strict";var r=n(255);function o(e){r.call(this,e)}n(30).inherits(o,r),o.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},e.exports=o},function(e,t,n){"use strict";var r=n(252),o=n(30),i=n(192),a=n(193),u=n(114),s=n(245),l=n(91);function c(e,t){this.options=e,this.loadOptions=t}c.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,n;if(e.skip(22),this.fileNameLength=e.readInt(2),n=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(n),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in s)if(s.hasOwnProperty(t)&&s[t].magic===e)return s[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+o.pretty(this.compressionMethod)+" unknown (inner file : "+o.transformTo("string",this.fileName)+")");this.decompressed=new i(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===e&&(this.dosPermissions=63&this.externalFileAttributes),3===e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=r(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(e){var t,n,r,o=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index1&&void 0!==arguments[1]?arguments[1]:function(e){return e},n=g.map(function(n){var r=function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:[],t=(arguments.length>1?arguments[1]:void 0).map(function(e){return{type:"section",titleAs:"id",labelAs:"type",fields:Object.keys(e).map(function(t){return Z({},v[t]||v.id,{id:t,label:t,defaultValue:e[t]})})}});return[].concat(Y(e),Y(t))}(t.children,n[t.id]):t.defaultValue=n[t.id],t):t})},Q=function(e,t){return Object.keys(t).map(function(n){var r=Z({},e);return r.title=n,r.fields=X(r.fields,t[n]),r})};function J(e){return(J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ee(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t