﻿﻿﻿PK     M\Ԣ      -  multiple-forms/includes/class-forms-table.phpnu [        <?php

defined('ABSPATH') or exit;

if (! class_exists('WP_List_Table', false)) {
    require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
}

/**
 * Class MC4WP_Forms_Table
 */
class MC4WP_Forms_Table extends WP_List_Table
{

    /**
     * @var MC4WP_MailChimp
     */
    protected $mailchimp;

    /**
     * @var bool
     */
    public $is_trash = false;

    /**
     * Constructor
     *
     * @param MC4WP_MailChimp $mailchimp
     */
    public function __construct(MC4WP_MailChimp $mailchimp)
    {
        parent::__construct(
            array(
                'singular' => 'form',
                'plural'   => 'forms',
                'ajax'     => false
            )
        );

        $columns  = $this->get_columns();
        $sortable = $this->get_sortable_columns();
        $hidden   = array();
        $this->mailchimp = $mailchimp;
        $this->is_trash = isset($_REQUEST['post_status']) && $_REQUEST['post_status'] === 'trash';

        $this->process_bulk_action();

        $this->_column_headers = array( $columns, $hidden, $sortable );
        $this->items = $this->get_items();
        $this->set_pagination_args(
            array(
                'per_page' => 50,
                'total_items' => count($this->items)
            )
        );
    }

    /**
     * Get an associative array ( id => link ) with the list
     * of views available on this table.
     *
     * @since 3.1.0
     * @access protected
     *
     * @return array
     */
    public function get_views()
    {
        $counts = wp_count_posts('mc4wp-form');
        $current = isset($_GET['post_status']) ? $_GET['post_status'] : '';
        $search = isset($_GET['s']) ? $_GET['s'] : '';

        $count_any = $counts->publish + $counts->draft + $counts->future + $counts->pending;

        return array(
            '' => sprintf('<a href="%s" class="%s">%s</a> (%d)', remove_query_arg(array('post_status', 's')), $current === '' && $search === '' ? 'current' : '', __('All'), $count_any),
            'trash' => sprintf('<a href="%s" class="%s">%s</a> (%d)', add_query_arg(array('post_status' => 'trash' )), $current == 'trash' ? 'current' : '', __('Trash'), $counts->trash),
        );
    }

    /**
     * @return array
     */
    public function get_bulk_actions()
    {
        $actions = array();

        if ($this->is_trash) {
            $actions['untrash'] = __('Restore');
            $actions['delete'] = __('Delete Permanently');
            return $actions;
        }

        $actions['trash'] = __('Move to Trash');
        $actions['duplicate'] = __('Duplicate');
        return $actions;
    }

    public function get_default_primary_column_name()
    {
        return 'form_name';
    }

    /**
     * @return array
     */
    public function get_table_classes()
    {
        return array( 'widefat', 'fixed', 'striped', 'mc4wp-table' );
    }

    /**
     * @return array
     */
    public function get_columns()
    {
        return array(
            'cb'       => '<input type="checkbox" />',
            'form_name'    => __('Form', 'mailchimp-for-wp'),
            'ID'            => __('ID', 'mailchimp-for-wp'),
            'shortcode'     => __('Shortcode', 'mailchimp-for-wp'),
            'lists'         => __('List(s)', 'mailchimp-for-wp'),
        );
    }

    /**
     * @return array
     */
    public function get_sortable_columns()
    {
        return array();
    }

    /**
     * @return array
     */
    public function get_items()
    {
        $args = array(
            'post_status' =>  array( 'publish', 'draft', 'pending', 'future' )
        );

        if (! empty($_GET['s'])) {
            $args['s'] = sanitize_text_field($_GET['s']);
        }

        if (! empty($_GET['post_status' ])) {
            $args['post_status'] = sanitize_text_field($_GET['post_status']);
        }


        $items = mc4wp_get_forms($args);

        return $items;
    }

    /**
     * @param $item
     *
     * @return string
     */
    public function column_cb($item)
    {
        return sprintf('<input type="checkbox" name="forms[]" value="%s" />', esc_attr($item->ID));
    }

    /**
     * @param MC4WP_Form $form
     *
     * @return mixed
     */
    public function column_ID(MC4WP_Form $form)
    {
        return $form->ID;
    }

    /**
     * @param MC4WP_Form $form
     * @return string
     */
    public function column_form_name($form)
    {
        if ($this->is_trash) {
            return sprintf('<strong>%s</strong>', esc_html($form->name));
        }

        $edit_link = mc4wp_get_edit_form_url($form->ID);
        $title      = '<strong><a class="row-title" href="' . $edit_link . '">' . esc_html($form->name) . '</a></strong>';

        $actions    = array(
            'edit'   => '<a href="' . $edit_link . '">' . __('Fields', 'mailchimp-for-wp') . '</a>',
            'settings' => '<a href="'. add_query_arg(array( 'tab' => 'settings' ), $edit_link) .'">'. __('Settings', 'mailchimp-for-wp') . '</a>',
            'messages' => '<a href="'. add_query_arg(array( 'tab' => 'messages' ), $edit_link) .'">'. __('Messages', 'mailchimp-for-wp') .'</a>',
            'appearance' => '<a href="'. add_query_arg(array( 'tab' => 'appearance' ), $edit_link) .'">'. __('Appearance', 'mailchimp-for-wp') .'</a>'
        );

        return $title . $this->row_actions($actions);
    }

    /**
     * @param MC4WP_Form $form
     *
     * @return string
     */
    public function column_shortcode(MC4WP_Form $form)
    {
        return sprintf('<input type="text" onfocus="this.select();" readonly="readonly" value="%s">', esc_attr('[mc4wp_form id="' . $form->ID . '"]'));
    }

    /**
     * @param MC4WP_Form $form
     *
     * @return string
     */
    public function column_lists(MC4WP_Form $form)
    {
        $list_ids = $form->settings['lists'];

        if (empty($list_ids)) {
            $content = '<a href="'. mc4wp_get_edit_form_url($form->ID, 'settings') .'" style="color: red;">' . __('No lists selected.', 'mailchimp-for-wp') . '</a>';
            return $content;
        }

        $names = array();

        foreach ($list_ids as $list_id) {
            $list = $this->mailchimp->get_list($list_id);
            if ($list) {
                $names[] = sprintf('<a href="https://admin.mailchimp.com/lists/members/?id=%s" target="_blank">%s</a>', esc_attr($list->web_id), esc_html($list->name));
            } else {
                $names[] = 'Unknown list';
            }
        }

        return join('<br />', $names);
    }

    /**
     * The text that is shown when there are no items to show
     */
    public function no_items()
    {
        echo sprintf(__('No forms found. <a href="%s">Would you like to create one now</a>?', 'mailchimp-for-wp'), mc4wp_get_add_form_url());
    }

    /**
     *
     */
    public function process_bulk_action()
    {
        $action = $this->current_action();
        if (empty($action)) {
            return false;
        }

        $method = 'process_bulk_action_' . $action;
        $forms = (array) $_REQUEST['forms'];
        if (method_exists($this, $method)) {
            return call_user_func_array(array( $this, $method ), array( $forms ));
        }

        return false;
    }

    public function process_bulk_action_duplicate($forms)
    {
        foreach ($forms as $form_id) {
            $post = get_post($form_id);
            $post_meta = get_post_meta($form_id);

            $new_post_id = wp_insert_post(
                array(
                    'post_title' => $post->post_title,
                    'post_content' => $post->post_content,
                    'post_type' => 'mc4wp-form',
                    'post_status' => 'publish'
                )
            );
            foreach ($post_meta as $meta_key => $meta_value) {
                $meta_value = maybe_unserialize($meta_value[0]);
                update_post_meta($new_post_id, $meta_key, $meta_value);
            }
        }
    }

    public function process_bulk_action_trash($forms)
    {
        return array_map('wp_trash_post', $forms);
    }

    public function process_bulk_action_delete($forms)
    {
        return array_map('wp_delete_post', $forms);
    }

    public function process_bulk_action_untrash($forms)
    {
        return array_map('wp_untrash_post', $forms);
    }
}
PK     M\k  k  5  multiple-forms/includes/class-widget-enhancements.phpnu [        <?php

/**
 * Class MC4WP_Form_Widget_Enhancements
 *
 * @ignore
 * @access private
 */
class MC4WP_Form_Widget_Enhancements
{

    /**
     * Add hooks
     */
    public function add_hooks()
    {
        add_filter('mc4wp_form_widget_sanitize_settings', array( $this, 'sanitize_widget_settings' ), 10, 3);
        add_action('mc4wp_form_widget_form', array( $this, 'widget_form' ), 10, 2);
    }

    /**
     * @param $new_settings
     * @param $old_settings
     * @param WP_Widget $widget
     *
     * @return mixed
     */
    public function sanitize_widget_settings($new_settings, $old_settings = array(), WP_Widget $widget = null)
    {
        if (! empty($new_settings['form_id'])) {
            $new_settings['form_id'] = (int) $new_settings['form_id'];
        }

        return $new_settings;
    }

    /**
     * @param array $settings
     * @param WP_Widget $widget
     */
    public function widget_form($settings, WP_Widget $widget)
    {
        $forms = mc4wp_get_forms(); ?>
		<p>
			<label for="<?php echo $widget->get_field_id('form_id'); ?>"><?php _e('Form:', 'mailchimp-for-wp'); ?></label>
			<select class="widefat" name="<?php echo $widget->get_field_name('form_id'); ?>" id="<?php echo $widget->get_field_id('form_id'); ?>">
				<option value="0" disabled <?php selected($settings['form_id'], 0); ?>><?php _e('Select the form to show', 'mailchimp-for-wp'); ?></option>
				<?php foreach ($forms as $f) {
            ?>
					<option value="<?php echo esc_attr($f->ID); ?>" <?php selected($settings['form_id'], $f->ID); ?>><?php echo esc_html($f->name); ?></option>
				<?php
        } ?>
			</select>
		</p>

		<?php if (empty($forms)) {
            ?>
			<p class="description"><?php printf(__('You don\'t have any sign-up forms. <a href="%s">Would you like to create one now?</a>', 'mailchimp-for-wp'), mc4wp_get_add_form_url()); ?></p>
		<?php
        }
    }
}
PK     M\/m̳    '  multiple-forms/includes/class-admin.phpnu [        <?php

/**
 * Class MC4WP_Multiple_Forms_Admin
 *
 * @ignore
 */
class MC4WP_Multiple_Forms_Admin
{
    /**
     * Add general hooks
     */
    public function add_hooks()
    {
        add_filter('mc4wp_admin_menu_items', array( $this, 'remove_form_action_redirect' ));
        add_action('mc4wp_admin_show_forms_page', array( $this, 'show_forms_overview_page' ));
        add_action('mc4wp_admin_edit_form_after_title', array( $this, 'show_new_form_button' ));
    }

    public function remove_form_action_redirect($items)
    {
        $items['forms']['text'] = __('Forms', 'mailchimp-for-wp');
        unset($items['forms']['load_callback']);
        return $items;
    }

    public function show_forms_overview_page()
    {
        if (! empty($_GET['view'])) {
            return;
        }

        $table = new MC4WP_Forms_Table(new MC4WP_MailChimp());
        include __DIR__ . '/../views/forms-overview.php';
    }

    public function show_new_form_button()
    {
        ?>
		<a href="<?php echo mc4wp_get_add_form_url(); ?>" class="page-title-action">
			<span class="dashicons dashicons-plus-alt" style=""></span>
			<?php _e('Add new form', 'mailchimp-for-wp'); ?>
		</a>
	<?php
    }
}
PK     M\	pm    !  multiple-forms/multiple-forms.phpnu [        <?php

defined('ABSPATH') or exit;

$widget_enhancements = new MC4WP_Form_Widget_Enhancements();
$widget_enhancements->add_hooks();

if (is_admin() && (! defined('DOING_AJAX') || ! DOING_AJAX)) {
    $admin = new MC4WP_Multiple_Forms_Admin();
    $admin->add_hooks();
}
PK     M\U$F  F  '  multiple-forms/views/forms-overview.phpnu [        <?php defined('ABSPATH') or exit;

$search_query = ! empty($_GET['s']) ? sanitize_text_field($_GET['s']) : '';

/**
 * @var MC4WP_Forms_Table $table
 */
?>
<div id="mc4wp-admin" class="wrap">

	<p class="mc4wp-breadcrumbs">
		<span class="prefix"><?php echo __('You are here: ', 'mailchimp-for-wp'); ?></span>
		<a href="<?php echo admin_url('admin.php?page=mailchimp-for-wp'); ?>">Mailchimp for WordPress</a> &rsaquo;
		<span class="current-crumb"><strong><?php _e('Forms', 'mailchimp-for-wp'); ?></strong></span>
	</p>

	<h1 class="mc4wp-page-title">Mailchimp for WordPress: <?php _e('Forms', 'mailchimp-for-wp'); ?>
		<a href="<?php echo mc4wp_get_add_form_url(); ?>" class="page-title-action">
			<span class="dashicons dashicons-plus-alt" style=""></span>
			<?php _e('Add new form', 'mailchimp-for-wp'); ?>
		</a>

		<?php
        if ($search_query) {
            printf(' <span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', $search_query);
        }
        ?>
	</h1>

	<?php // h2 for settings errors?>
	<h2 style="display: none;"></h2>
	<?php settings_errors(); ?>

	<?php $table->views(); ?>

	<form method="get" action="<?php echo admin_url('admin.php'); ?>">
		<input type="hidden" name="page" value="<?php echo esc_attr($_GET['page']); ?>" />
		<?php if (! empty($_GET['post_status'])) {
            ?>
			<input type="hidden" name="post_status" value="<?php echo esc_attr($_GET['post_status']); ?>" />
		<?php
        } ?>
		<?php $table->search_box('search', 'mc4wp-log-search'); ?>
	</form>

	<form method="post">
		<?php $table->display(); ?>
	</form>
</div>
PK     M\U        multiple-forms/README.mdnu [        ### Mailchimp for WordPress - Multiple Forms

This add-on plugin for [Mailchimp for WordPress](https://www.mc4wp.com/) enables you to create more than one sign-up form.PK     M\E/    package-lock.jsonnu [        {
  "name": "mc4wp-premium",
  "lockfileVersion": 2,
  "requires": true,
  "packages": {
    "": {
      "name": "mc4wp-premium",
      "license": "GPL-2.0",
      "dependencies": {
        "algoliasearch": "^4.9.1",
        "chart.js": "^3.2.1",
        "mithril": "^2.0.4"
      },
      "devDependencies": {
        "@babel/core": "^7.11.4",
        "@babel/preset-env": "^7.11.0",
        "@babel/register": "^7.10.5",
        "babelify": "^10.0.0",
        "browserify": "^16.5.2",
        "gulp": "^4.0.2",
        "gulp-clean-css": "^4.3.0",
        "gulp-rename": "^2.0.0",
        "gulp-replace": "^1.0.0",
        "gulp-streamify": "^1.0.2",
        "gulp-uglify": "^3.0.2",
        "vinyl": "^2.2.0",
        "vinyl-source-stream": "^2.0.0"
      }
    },
    "node_modules/@algolia/cache-browser-local-storage": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.13.0.tgz",
      "integrity": "sha512-nj1vHRZauTqP/bluwkRIgEADEimqojJgoTRCel5f6q8WCa9Y8QeI4bpDQP28FoeKnDRYa3J5CauDlN466jqRhg==",
      "dependencies": {
        "@algolia/cache-common": "4.13.0"
      }
    },
    "node_modules/@algolia/cache-common": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/cache-common/-/cache-common-4.13.0.tgz",
      "integrity": "sha512-f9mdZjskCui/dA/fA/5a+6hZ7xnHaaZI5tM/Rw9X8rRB39SUlF/+o3P47onZ33n/AwkpSbi5QOyhs16wHd55kA=="
    },
    "node_modules/@algolia/cache-in-memory": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/cache-in-memory/-/cache-in-memory-4.13.0.tgz",
      "integrity": "sha512-hHdc+ahPiMM92CQMljmObE75laYzNFYLrNOu0Q3/eyvubZZRtY2SUsEEgyUEyzXruNdzrkcDxFYa7YpWBJYHAg==",
      "dependencies": {
        "@algolia/cache-common": "4.13.0"
      }
    },
    "node_modules/@algolia/client-account": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/client-account/-/client-account-4.13.0.tgz",
      "integrity": "sha512-FzFqFt9b0g/LKszBDoEsW+dVBuUe1K3scp2Yf7q6pgHWM1WqyqUlARwVpLxqyc+LoyJkTxQftOKjyFUqddnPKA==",
      "dependencies": {
        "@algolia/client-common": "4.13.0",
        "@algolia/client-search": "4.13.0",
        "@algolia/transporter": "4.13.0"
      }
    },
    "node_modules/@algolia/client-analytics": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-4.13.0.tgz",
      "integrity": "sha512-klmnoq2FIiiMHImkzOm+cGxqRLLu9CMHqFhbgSy9wtXZrqb8BBUIUE2VyBe7azzv1wKcxZV2RUyNOMpFqmnRZA==",
      "dependencies": {
        "@algolia/client-common": "4.13.0",
        "@algolia/client-search": "4.13.0",
        "@algolia/requester-common": "4.13.0",
        "@algolia/transporter": "4.13.0"
      }
    },
    "node_modules/@algolia/client-common": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-4.13.0.tgz",
      "integrity": "sha512-GoXfTp0kVcbgfSXOjfrxx+slSipMqGO9WnNWgeMmru5Ra09MDjrcdunsiiuzF0wua6INbIpBQFTC2Mi5lUNqGA==",
      "dependencies": {
        "@algolia/requester-common": "4.13.0",
        "@algolia/transporter": "4.13.0"
      }
    },
    "node_modules/@algolia/client-personalization": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-4.13.0.tgz",
      "integrity": "sha512-KneLz2WaehJmNfdr5yt2HQETpLaCYagRdWwIwkTqRVFCv4DxRQ2ChPVW9jeTj4YfAAhfzE6F8hn7wkQ/Jfj6ZA==",
      "dependencies": {
        "@algolia/client-common": "4.13.0",
        "@algolia/requester-common": "4.13.0",
        "@algolia/transporter": "4.13.0"
      }
    },
    "node_modules/@algolia/client-search": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-4.13.0.tgz",
      "integrity": "sha512-blgCKYbZh1NgJWzeGf+caKE32mo3j54NprOf0LZVCubQb3Kx37tk1Hc8SDs9bCAE8hUvf3cazMPIg7wscSxspA==",
      "dependencies": {
        "@algolia/client-common": "4.13.0",
        "@algolia/requester-common": "4.13.0",
        "@algolia/transporter": "4.13.0"
      }
    },
    "node_modules/@algolia/logger-common": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/logger-common/-/logger-common-4.13.0.tgz",
      "integrity": "sha512-8yqXk7rMtmQJ9wZiHOt/6d4/JDEg5VCk83gJ39I+X/pwUPzIsbKy9QiK4uJ3aJELKyoIiDT1hpYVt+5ia+94IA=="
    },
    "node_modules/@algolia/logger-console": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/logger-console/-/logger-console-4.13.0.tgz",
      "integrity": "sha512-YepRg7w2/87L0vSXRfMND6VJ5d6699sFJBRWzZPOlek2p5fLxxK7O0VncYuc/IbVHEgeApvgXx0WgCEa38GVuQ==",
      "dependencies": {
        "@algolia/logger-common": "4.13.0"
      }
    },
    "node_modules/@algolia/requester-browser-xhr": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.13.0.tgz",
      "integrity": "sha512-Dj+bnoWR5MotrnjblzGKZ2kCdQi2cK/VzPURPnE616NU/il7Ypy6U6DLGZ/ZYz+tnwPa0yypNf21uqt84fOgrg==",
      "dependencies": {
        "@algolia/requester-common": "4.13.0"
      }
    },
    "node_modules/@algolia/requester-common": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/requester-common/-/requester-common-4.13.0.tgz",
      "integrity": "sha512-BRTDj53ecK+gn7ugukDWOOcBRul59C4NblCHqj4Zm5msd5UnHFjd/sGX+RLOEoFMhetILAnmg6wMrRrQVac9vw=="
    },
    "node_modules/@algolia/requester-node-http": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-4.13.0.tgz",
      "integrity": "sha512-9b+3O4QFU4azLhGMrZAr/uZPydvzOR4aEZfSL8ZrpLZ7fbbqTO0S/5EVko+QIgglRAtVwxvf8UJ1wzTD2jvKxQ==",
      "dependencies": {
        "@algolia/requester-common": "4.13.0"
      }
    },
    "node_modules/@algolia/transporter": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/transporter/-/transporter-4.13.0.tgz",
      "integrity": "sha512-8tSQYE+ykQENAdeZdofvtkOr5uJ9VcQSWgRhQ9h01AehtBIPAczk/b2CLrMsw5yQZziLs5cZ3pJ3478yI+urhA==",
      "dependencies": {
        "@algolia/cache-common": "4.13.0",
        "@algolia/logger-common": "4.13.0",
        "@algolia/requester-common": "4.13.0"
      }
    },
    "node_modules/@ampproject/remapping": {
      "version": "2.2.0",
      "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz",
      "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==",
      "dev": true,
      "dependencies": {
        "@jridgewell/gen-mapping": "^0.1.0",
        "@jridgewell/trace-mapping": "^0.3.9"
      },
      "engines": {
        "node": ">=6.0.0"
      }
    },
    "node_modules/@babel/code-frame": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz",
      "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==",
      "dev": true,
      "dependencies": {
        "@babel/highlight": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/compat-data": {
      "version": "7.17.10",
      "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.17.10.tgz",
      "integrity": "sha512-GZt/TCsG70Ms19gfZO1tM4CVnXsPgEPBCpJu+Qz3L0LUDsY5nZqFZglIoPC1kIYOtNBZlrnFT+klg12vFGZXrw==",
      "dev": true,
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/core": {
      "version": "7.17.10",
      "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.10.tgz",
      "integrity": "sha512-liKoppandF3ZcBnIYFjfSDHZLKdLHGJRkoWtG8zQyGJBQfIYobpnVGI5+pLBNtS6psFLDzyq8+h5HiVljW9PNA==",
      "dev": true,
      "dependencies": {
        "@ampproject/remapping": "^2.1.0",
        "@babel/code-frame": "^7.16.7",
        "@babel/generator": "^7.17.10",
        "@babel/helper-compilation-targets": "^7.17.10",
        "@babel/helper-module-transforms": "^7.17.7",
        "@babel/helpers": "^7.17.9",
        "@babel/parser": "^7.17.10",
        "@babel/template": "^7.16.7",
        "@babel/traverse": "^7.17.10",
        "@babel/types": "^7.17.10",
        "convert-source-map": "^1.7.0",
        "debug": "^4.1.0",
        "gensync": "^1.0.0-beta.2",
        "json5": "^2.2.1",
        "semver": "^6.3.0"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/babel"
      }
    },
    "node_modules/@babel/generator": {
      "version": "7.17.10",
      "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.10.tgz",
      "integrity": "sha512-46MJZZo9y3o4kmhBVc7zW7i8dtR1oIK/sdO5NcfcZRhTGYi+KKJRtHNgsU6c4VUcJmUNV/LQdebD/9Dlv4K+Tg==",
      "dev": true,
      "dependencies": {
        "@babel/types": "^7.17.10",
        "@jridgewell/gen-mapping": "^0.1.0",
        "jsesc": "^2.5.1"
      },
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/helper-annotate-as-pure": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.7.tgz",
      "integrity": "sha512-s6t2w/IPQVTAET1HitoowRGXooX8mCgtuP5195wD/QJPV6wYjpujCGF7JuMODVX2ZAJOf1GT6DT9MHEZvLOFSw==",
      "dev": true,
      "dependencies": {
        "@babel/types": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.16.7.tgz",
      "integrity": "sha512-C6FdbRaxYjwVu/geKW4ZeQ0Q31AftgRcdSnZ5/jsH6BzCJbtvXvhpfkbkThYSuutZA7nCXpPR6AD9zd1dprMkA==",
      "dev": true,
      "dependencies": {
        "@babel/helper-explode-assignable-expression": "^7.16.7",
        "@babel/types": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/helper-compilation-targets": {
      "version": "7.17.10",
      "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.10.tgz",
      "integrity": "sha512-gh3RxjWbauw/dFiU/7whjd0qN9K6nPJMqe6+Er7rOavFh0CQUSwhAE3IcTho2rywPJFxej6TUUHDkWcYI6gGqQ==",
      "dev": true,
      "dependencies": {
        "@babel/compat-data": "^7.17.10",
        "@babel/helper-validator-option": "^7.16.7",
        "browserslist": "^4.20.2",
        "semver": "^6.3.0"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0"
      }
    },
    "node_modules/@babel/helper-create-class-features-plugin": {
      "version": "7.17.9",
      "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.17.9.tgz",
      "integrity": "sha512-kUjip3gruz6AJKOq5i3nC6CoCEEF/oHH3cp6tOZhB+IyyyPyW0g1Gfsxn3mkk6S08pIA2y8GQh609v9G/5sHVQ==",
      "dev": true,
      "dependencies": {
        "@babel/helper-annotate-as-pure": "^7.16.7",
        "@babel/helper-environment-visitor": "^7.16.7",
        "@babel/helper-function-name": "^7.17.9",
        "@babel/helper-member-expression-to-functions": "^7.17.7",
        "@babel/helper-optimise-call-expression": "^7.16.7",
        "@babel/helper-replace-supers": "^7.16.7",
        "@babel/helper-split-export-declaration": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0"
      }
    },
    "node_modules/@babel/helper-create-regexp-features-plugin": {
      "version": "7.17.0",
      "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.17.0.tgz",
      "integrity": "sha512-awO2So99wG6KnlE+TPs6rn83gCz5WlEePJDTnLEqbchMVrBeAujURVphRdigsk094VhvZehFoNOihSlcBjwsXA==",
      "dev": true,
      "dependencies": {
        "@babel/helper-annotate-as-pure": "^7.16.7",
        "regexpu-core": "^5.0.1"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0"
      }
    },
    "node_modules/@babel/helper-define-polyfill-provider": {
      "version": "0.3.1",
      "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.1.tgz",
      "integrity": "sha512-J9hGMpJQmtWmj46B3kBHmL38UhJGhYX7eqkcq+2gsstyYt341HmPeWspihX43yVRA0mS+8GGk2Gckc7bY/HCmA==",
      "dev": true,
      "dependencies": {
        "@babel/helper-compilation-targets": "^7.13.0",
        "@babel/helper-module-imports": "^7.12.13",
        "@babel/helper-plugin-utils": "^7.13.0",
        "@babel/traverse": "^7.13.0",
        "debug": "^4.1.1",
        "lodash.debounce": "^4.0.8",
        "resolve": "^1.14.2",
        "semver": "^6.1.2"
      },
      "peerDependencies": {
        "@babel/core": "^7.4.0-0"
      }
    },
    "node_modules/@babel/helper-environment-visitor": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz",
      "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==",
      "dev": true,
      "dependencies": {
        "@babel/types": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/helper-explode-assignable-expression": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.16.7.tgz",
      "integrity": "sha512-KyUenhWMC8VrxzkGP0Jizjo4/Zx+1nNZhgocs+gLzyZyB8SHidhoq9KK/8Ato4anhwsivfkBLftky7gvzbZMtQ==",
      "dev": true,
      "dependencies": {
        "@babel/types": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/helper-function-name": {
      "version": "7.17.9",
      "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz",
      "integrity": "sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg==",
      "dev": true,
      "dependencies": {
        "@babel/template": "^7.16.7",
        "@babel/types": "^7.17.0"
      },
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/helper-hoist-variables": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz",
      "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==",
      "dev": true,
      "dependencies": {
        "@babel/types": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/helper-member-expression-to-functions": {
      "version": "7.17.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.17.7.tgz",
      "integrity": "sha512-thxXgnQ8qQ11W2wVUObIqDL4p148VMxkt5T/qpN5k2fboRyzFGFmKsTGViquyM5QHKUy48OZoca8kw4ajaDPyw==",
      "dev": true,
      "dependencies": {
        "@babel/types": "^7.17.0"
      },
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/helper-module-imports": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz",
      "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==",
      "dev": true,
      "dependencies": {
        "@babel/types": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/helper-module-transforms": {
      "version": "7.17.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.17.7.tgz",
      "integrity": "sha512-VmZD99F3gNTYB7fJRDTi+u6l/zxY0BE6OIxPSU7a50s6ZUQkHwSDmV92FfM+oCG0pZRVojGYhkR8I0OGeCVREw==",
      "dev": true,
      "dependencies": {
        "@babel/helper-environment-visitor": "^7.16.7",
        "@babel/helper-module-imports": "^7.16.7",
        "@babel/helper-simple-access": "^7.17.7",
        "@babel/helper-split-export-declaration": "^7.16.7",
        "@babel/helper-validator-identifier": "^7.16.7",
        "@babel/template": "^7.16.7",
        "@babel/traverse": "^7.17.3",
        "@babel/types": "^7.17.0"
      },
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/helper-optimise-call-expression": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.7.tgz",
      "integrity": "sha512-EtgBhg7rd/JcnpZFXpBy0ze1YRfdm7BnBX4uKMBd3ixa3RGAE002JZB66FJyNH7g0F38U05pXmA5P8cBh7z+1w==",
      "dev": true,
      "dependencies": {
        "@babel/types": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/helper-plugin-utils": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz",
      "integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==",
      "dev": true,
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/helper-remap-async-to-generator": {
      "version": "7.16.8",
      "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.8.tgz",
      "integrity": "sha512-fm0gH7Flb8H51LqJHy3HJ3wnE1+qtYR2A99K06ahwrawLdOFsCEWjZOrYricXJHoPSudNKxrMBUPEIPxiIIvBw==",
      "dev": true,
      "dependencies": {
        "@babel/helper-annotate-as-pure": "^7.16.7",
        "@babel/helper-wrap-function": "^7.16.8",
        "@babel/types": "^7.16.8"
      },
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/helper-replace-supers": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.16.7.tgz",
      "integrity": "sha512-y9vsWilTNaVnVh6xiJfABzsNpgDPKev9HnAgz6Gb1p6UUwf9NepdlsV7VXGCftJM+jqD5f7JIEubcpLjZj5dBw==",
      "dev": true,
      "dependencies": {
        "@babel/helper-environment-visitor": "^7.16.7",
        "@babel/helper-member-expression-to-functions": "^7.16.7",
        "@babel/helper-optimise-call-expression": "^7.16.7",
        "@babel/traverse": "^7.16.7",
        "@babel/types": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/helper-simple-access": {
      "version": "7.17.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz",
      "integrity": "sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA==",
      "dev": true,
      "dependencies": {
        "@babel/types": "^7.17.0"
      },
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/helper-skip-transparent-expression-wrappers": {
      "version": "7.16.0",
      "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.16.0.tgz",
      "integrity": "sha512-+il1gTy0oHwUsBQZyJvukbB4vPMdcYBrFHa0Uc4AizLxbq6BOYC51Rv4tWocX9BLBDLZ4kc6qUFpQ6HRgL+3zw==",
      "dev": true,
      "dependencies": {
        "@babel/types": "^7.16.0"
      },
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/helper-split-export-declaration": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz",
      "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==",
      "dev": true,
      "dependencies": {
        "@babel/types": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/helper-validator-identifier": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz",
      "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==",
      "dev": true,
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/helper-validator-option": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz",
      "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==",
      "dev": true,
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/helper-wrap-function": {
      "version": "7.16.8",
      "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.16.8.tgz",
      "integrity": "sha512-8RpyRVIAW1RcDDGTA+GpPAwV22wXCfKOoM9bet6TLkGIFTkRQSkH1nMQ5Yet4MpoXe1ZwHPVtNasc2w0uZMqnw==",
      "dev": true,
      "dependencies": {
        "@babel/helper-function-name": "^7.16.7",
        "@babel/template": "^7.16.7",
        "@babel/traverse": "^7.16.8",
        "@babel/types": "^7.16.8"
      },
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/helpers": {
      "version": "7.17.9",
      "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.9.tgz",
      "integrity": "sha512-cPCt915ShDWUEzEp3+UNRktO2n6v49l5RSnG9M5pS24hA+2FAc5si+Pn1i4VVbQQ+jh+bIZhPFQOJOzbrOYY1Q==",
      "dev": true,
      "dependencies": {
        "@babel/template": "^7.16.7",
        "@babel/traverse": "^7.17.9",
        "@babel/types": "^7.17.0"
      },
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/highlight": {
      "version": "7.17.9",
      "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.9.tgz",
      "integrity": "sha512-J9PfEKCbFIv2X5bjTMiZu6Vf341N05QIY+d6FvVKynkG1S7G0j3I0QoRtWIrXhZ+/Nlb5Q0MzqL7TokEJ5BNHg==",
      "dev": true,
      "dependencies": {
        "@babel/helper-validator-identifier": "^7.16.7",
        "chalk": "^2.0.0",
        "js-tokens": "^4.0.0"
      },
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/parser": {
      "version": "7.17.10",
      "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.10.tgz",
      "integrity": "sha512-n2Q6i+fnJqzOaq2VkdXxy2TCPCWQZHiCo0XqmrCvDWcZQKRyZzYi4Z0yxlBuN0w+r2ZHmre+Q087DSrw3pbJDQ==",
      "dev": true,
      "bin": {
        "parser": "bin/babel-parser.js"
      },
      "engines": {
        "node": ">=6.0.0"
      }
    },
    "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.16.7.tgz",
      "integrity": "sha512-anv/DObl7waiGEnC24O9zqL0pSuI9hljihqiDuFHC8d7/bjr/4RLGPWuc8rYOff/QPzbEPSkzG8wGG9aDuhHRg==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0"
      }
    },
    "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.16.7.tgz",
      "integrity": "sha512-di8vUHRdf+4aJ7ltXhaDbPoszdkh59AQtJM5soLsuHpQJdFQZOA4uGj0V2u/CZ8bJ/u8ULDL5yq6FO/bCXnKHw==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0",
        "@babel/plugin-proposal-optional-chaining": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.13.0"
      }
    },
    "node_modules/@babel/plugin-proposal-async-generator-functions": {
      "version": "7.16.8",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.8.tgz",
      "integrity": "sha512-71YHIvMuiuqWJQkebWJtdhQTfd4Q4mF76q2IX37uZPkG9+olBxsX+rH1vkhFto4UeJZ9dPY2s+mDvhDm1u2BGQ==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/helper-remap-async-to-generator": "^7.16.8",
        "@babel/plugin-syntax-async-generators": "^7.8.4"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-proposal-class-properties": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.16.7.tgz",
      "integrity": "sha512-IobU0Xme31ewjYOShSIqd/ZGM/r/cuOz2z0MDbNrhF5FW+ZVgi0f2lyeoj9KFPDOAqsYxmLWZte1WOwlvY9aww==",
      "dev": true,
      "dependencies": {
        "@babel/helper-create-class-features-plugin": "^7.16.7",
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-proposal-class-static-block": {
      "version": "7.17.6",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.17.6.tgz",
      "integrity": "sha512-X/tididvL2zbs7jZCeeRJ8167U/+Ac135AM6jCAx6gYXDUviZV5Ku9UDvWS2NCuWlFjIRXklYhwo6HhAC7ETnA==",
      "dev": true,
      "dependencies": {
        "@babel/helper-create-class-features-plugin": "^7.17.6",
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/plugin-syntax-class-static-block": "^7.14.5"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.12.0"
      }
    },
    "node_modules/@babel/plugin-proposal-dynamic-import": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.16.7.tgz",
      "integrity": "sha512-I8SW9Ho3/8DRSdmDdH3gORdyUuYnk1m4cMxUAdu5oy4n3OfN8flDEH+d60iG7dUfi0KkYwSvoalHzzdRzpWHTg==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/plugin-syntax-dynamic-import": "^7.8.3"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-proposal-export-namespace-from": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.16.7.tgz",
      "integrity": "sha512-ZxdtqDXLRGBL64ocZcs7ovt71L3jhC1RGSyR996svrCi3PYqHNkb3SwPJCs8RIzD86s+WPpt2S73+EHCGO+NUA==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/plugin-syntax-export-namespace-from": "^7.8.3"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-proposal-json-strings": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.16.7.tgz",
      "integrity": "sha512-lNZ3EEggsGY78JavgbHsK9u5P3pQaW7k4axlgFLYkMd7UBsiNahCITShLjNQschPyjtO6dADrL24757IdhBrsQ==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/plugin-syntax-json-strings": "^7.8.3"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-proposal-logical-assignment-operators": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.16.7.tgz",
      "integrity": "sha512-K3XzyZJGQCr00+EtYtrDjmwX7o7PLK6U9bi1nCwkQioRFVUv6dJoxbQjtWVtP+bCPy82bONBKG8NPyQ4+i6yjg==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-proposal-nullish-coalescing-operator": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.16.7.tgz",
      "integrity": "sha512-aUOrYU3EVtjf62jQrCj63pYZ7k6vns2h/DQvHPWGmsJRYzWXZ6/AsfgpiRy6XiuIDADhJzP2Q9MwSMKauBQ+UQ==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-proposal-numeric-separator": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.16.7.tgz",
      "integrity": "sha512-vQgPMknOIgiuVqbokToyXbkY/OmmjAzr/0lhSIbG/KmnzXPGwW/AdhdKpi+O4X/VkWiWjnkKOBiqJrTaC98VKw==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/plugin-syntax-numeric-separator": "^7.10.4"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-proposal-object-rest-spread": {
      "version": "7.17.3",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.17.3.tgz",
      "integrity": "sha512-yuL5iQA/TbZn+RGAfxQXfi7CNLmKi1f8zInn4IgobuCWcAb7i+zj4TYzQ9l8cEzVyJ89PDGuqxK1xZpUDISesw==",
      "dev": true,
      "dependencies": {
        "@babel/compat-data": "^7.17.0",
        "@babel/helper-compilation-targets": "^7.16.7",
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/plugin-syntax-object-rest-spread": "^7.8.3",
        "@babel/plugin-transform-parameters": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-proposal-optional-catch-binding": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.16.7.tgz",
      "integrity": "sha512-eMOH/L4OvWSZAE1VkHbr1vckLG1WUcHGJSLqqQwl2GaUqG6QjddvrOaTUMNYiv77H5IKPMZ9U9P7EaHwvAShfA==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/plugin-syntax-optional-catch-binding": "^7.8.3"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-proposal-optional-chaining": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.16.7.tgz",
      "integrity": "sha512-eC3xy+ZrUcBtP7x+sq62Q/HYd674pPTb/77XZMb5wbDPGWIdUbSr4Agr052+zaUPSb+gGRnjxXfKFvx5iMJ+DA==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0",
        "@babel/plugin-syntax-optional-chaining": "^7.8.3"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-proposal-private-methods": {
      "version": "7.16.11",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.16.11.tgz",
      "integrity": "sha512-F/2uAkPlXDr8+BHpZvo19w3hLFKge+k75XUprE6jaqKxjGkSYcK+4c+bup5PdW/7W/Rpjwql7FTVEDW+fRAQsw==",
      "dev": true,
      "dependencies": {
        "@babel/helper-create-class-features-plugin": "^7.16.10",
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-proposal-private-property-in-object": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.16.7.tgz",
      "integrity": "sha512-rMQkjcOFbm+ufe3bTZLyOfsOUOxyvLXZJCTARhJr+8UMSoZmqTe1K1BgkFcrW37rAchWg57yI69ORxiWvUINuQ==",
      "dev": true,
      "dependencies": {
        "@babel/helper-annotate-as-pure": "^7.16.7",
        "@babel/helper-create-class-features-plugin": "^7.16.7",
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/plugin-syntax-private-property-in-object": "^7.14.5"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-proposal-unicode-property-regex": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.16.7.tgz",
      "integrity": "sha512-QRK0YI/40VLhNVGIjRNAAQkEHws0cswSdFFjpFyt943YmJIU1da9uW63Iu6NFV6CxTZW5eTDCrwZUstBWgp/Rg==",
      "dev": true,
      "dependencies": {
        "@babel/helper-create-regexp-features-plugin": "^7.16.7",
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=4"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-syntax-async-generators": {
      "version": "7.8.4",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz",
      "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.8.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-syntax-class-properties": {
      "version": "7.12.13",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz",
      "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.12.13"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-syntax-class-static-block": {
      "version": "7.14.5",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz",
      "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.14.5"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-syntax-dynamic-import": {
      "version": "7.8.3",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz",
      "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.8.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-syntax-export-namespace-from": {
      "version": "7.8.3",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz",
      "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.8.3"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-syntax-json-strings": {
      "version": "7.8.3",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz",
      "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.8.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-syntax-logical-assignment-operators": {
      "version": "7.10.4",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz",
      "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.10.4"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": {
      "version": "7.8.3",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz",
      "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.8.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-syntax-numeric-separator": {
      "version": "7.10.4",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz",
      "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.10.4"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-syntax-object-rest-spread": {
      "version": "7.8.3",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz",
      "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.8.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-syntax-optional-catch-binding": {
      "version": "7.8.3",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz",
      "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.8.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-syntax-optional-chaining": {
      "version": "7.8.3",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz",
      "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.8.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-syntax-private-property-in-object": {
      "version": "7.14.5",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz",
      "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.14.5"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-syntax-top-level-await": {
      "version": "7.14.5",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz",
      "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.14.5"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-arrow-functions": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.16.7.tgz",
      "integrity": "sha512-9ffkFFMbvzTvv+7dTp/66xvZAWASuPD5Tl9LK3Z9vhOmANo6j94rik+5YMBt4CwHVMWLWpMsriIc2zsa3WW3xQ==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-async-to-generator": {
      "version": "7.16.8",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.16.8.tgz",
      "integrity": "sha512-MtmUmTJQHCnyJVrScNzNlofQJ3dLFuobYn3mwOTKHnSCMtbNsqvF71GQmJfFjdrXSsAA7iysFmYWw4bXZ20hOg==",
      "dev": true,
      "dependencies": {
        "@babel/helper-module-imports": "^7.16.7",
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/helper-remap-async-to-generator": "^7.16.8"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-block-scoped-functions": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.16.7.tgz",
      "integrity": "sha512-JUuzlzmF40Z9cXyytcbZEZKckgrQzChbQJw/5PuEHYeqzCsvebDx0K0jWnIIVcmmDOAVctCgnYs0pMcrYj2zJg==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-block-scoping": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.16.7.tgz",
      "integrity": "sha512-ObZev2nxVAYA4bhyusELdo9hb3H+A56bxH3FZMbEImZFiEDYVHXQSJ1hQKFlDnlt8G9bBrCZ5ZpURZUrV4G5qQ==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-classes": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.16.7.tgz",
      "integrity": "sha512-WY7og38SFAGYRe64BrjKf8OrE6ulEHtr5jEYaZMwox9KebgqPi67Zqz8K53EKk1fFEJgm96r32rkKZ3qA2nCWQ==",
      "dev": true,
      "dependencies": {
        "@babel/helper-annotate-as-pure": "^7.16.7",
        "@babel/helper-environment-visitor": "^7.16.7",
        "@babel/helper-function-name": "^7.16.7",
        "@babel/helper-optimise-call-expression": "^7.16.7",
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/helper-replace-supers": "^7.16.7",
        "@babel/helper-split-export-declaration": "^7.16.7",
        "globals": "^11.1.0"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-computed-properties": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.16.7.tgz",
      "integrity": "sha512-gN72G9bcmenVILj//sv1zLNaPyYcOzUho2lIJBMh/iakJ9ygCo/hEF9cpGb61SCMEDxbbyBoVQxrt+bWKu5KGw==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-destructuring": {
      "version": "7.17.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.17.7.tgz",
      "integrity": "sha512-XVh0r5yq9sLR4vZ6eVZe8FKfIcSgaTBxVBRSYokRj2qksf6QerYnTxz9/GTuKTH/n/HwLP7t6gtlybHetJ/6hQ==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-dotall-regex": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.16.7.tgz",
      "integrity": "sha512-Lyttaao2SjZF6Pf4vk1dVKv8YypMpomAbygW+mU5cYP3S5cWTfCJjG8xV6CFdzGFlfWK81IjL9viiTvpb6G7gQ==",
      "dev": true,
      "dependencies": {
        "@babel/helper-create-regexp-features-plugin": "^7.16.7",
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-duplicate-keys": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.16.7.tgz",
      "integrity": "sha512-03DvpbRfvWIXyK0/6QiR1KMTWeT6OcQ7tbhjrXyFS02kjuX/mu5Bvnh5SDSWHxyawit2g5aWhKwI86EE7GUnTw==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-exponentiation-operator": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.16.7.tgz",
      "integrity": "sha512-8UYLSlyLgRixQvlYH3J2ekXFHDFLQutdy7FfFAMm3CPZ6q9wHCwnUyiXpQCe3gVVnQlHc5nsuiEVziteRNTXEA==",
      "dev": true,
      "dependencies": {
        "@babel/helper-builder-binary-assignment-operator-visitor": "^7.16.7",
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-for-of": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.16.7.tgz",
      "integrity": "sha512-/QZm9W92Ptpw7sjI9Nx1mbcsWz33+l8kuMIQnDwgQBG5s3fAfQvkRjQ7NqXhtNcKOnPkdICmUHyCaWW06HCsqg==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-function-name": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.16.7.tgz",
      "integrity": "sha512-SU/C68YVwTRxqWj5kgsbKINakGag0KTgq9f2iZEXdStoAbOzLHEBRYzImmA6yFo8YZhJVflvXmIHUO7GWHmxxA==",
      "dev": true,
      "dependencies": {
        "@babel/helper-compilation-targets": "^7.16.7",
        "@babel/helper-function-name": "^7.16.7",
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-literals": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.16.7.tgz",
      "integrity": "sha512-6tH8RTpTWI0s2sV6uq3e/C9wPo4PTqqZps4uF0kzQ9/xPLFQtipynvmT1g/dOfEJ+0EQsHhkQ/zyRId8J2b8zQ==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-member-expression-literals": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.16.7.tgz",
      "integrity": "sha512-mBruRMbktKQwbxaJof32LT9KLy2f3gH+27a5XSuXo6h7R3vqltl0PgZ80C8ZMKw98Bf8bqt6BEVi3svOh2PzMw==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-modules-amd": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.16.7.tgz",
      "integrity": "sha512-KaaEtgBL7FKYwjJ/teH63oAmE3lP34N3kshz8mm4VMAw7U3PxjVwwUmxEFksbgsNUaO3wId9R2AVQYSEGRa2+g==",
      "dev": true,
      "dependencies": {
        "@babel/helper-module-transforms": "^7.16.7",
        "@babel/helper-plugin-utils": "^7.16.7",
        "babel-plugin-dynamic-import-node": "^2.3.3"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-modules-commonjs": {
      "version": "7.17.9",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.17.9.tgz",
      "integrity": "sha512-2TBFd/r2I6VlYn0YRTz2JdazS+FoUuQ2rIFHoAxtyP/0G3D82SBLaRq9rnUkpqlLg03Byfl/+M32mpxjO6KaPw==",
      "dev": true,
      "dependencies": {
        "@babel/helper-module-transforms": "^7.17.7",
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/helper-simple-access": "^7.17.7",
        "babel-plugin-dynamic-import-node": "^2.3.3"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-modules-systemjs": {
      "version": "7.17.8",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.17.8.tgz",
      "integrity": "sha512-39reIkMTUVagzgA5x88zDYXPCMT6lcaRKs1+S9K6NKBPErbgO/w/kP8GlNQTC87b412ZTlmNgr3k2JrWgHH+Bw==",
      "dev": true,
      "dependencies": {
        "@babel/helper-hoist-variables": "^7.16.7",
        "@babel/helper-module-transforms": "^7.17.7",
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/helper-validator-identifier": "^7.16.7",
        "babel-plugin-dynamic-import-node": "^2.3.3"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-modules-umd": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.16.7.tgz",
      "integrity": "sha512-EMh7uolsC8O4xhudF2F6wedbSHm1HHZ0C6aJ7K67zcDNidMzVcxWdGr+htW9n21klm+bOn+Rx4CBsAntZd3rEQ==",
      "dev": true,
      "dependencies": {
        "@babel/helper-module-transforms": "^7.16.7",
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-named-capturing-groups-regex": {
      "version": "7.17.10",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.17.10.tgz",
      "integrity": "sha512-v54O6yLaJySCs6mGzaVOUw9T967GnH38T6CQSAtnzdNPwu84l2qAjssKzo/WSO8Yi7NF+7ekm5cVbF/5qiIgNA==",
      "dev": true,
      "dependencies": {
        "@babel/helper-create-regexp-features-plugin": "^7.17.0"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0"
      }
    },
    "node_modules/@babel/plugin-transform-new-target": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.16.7.tgz",
      "integrity": "sha512-xiLDzWNMfKoGOpc6t3U+etCE2yRnn3SM09BXqWPIZOBpL2gvVrBWUKnsJx0K/ADi5F5YC5f8APFfWrz25TdlGg==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-object-super": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.16.7.tgz",
      "integrity": "sha512-14J1feiQVWaGvRxj2WjyMuXS2jsBkgB3MdSN5HuC2G5nRspa5RK9COcs82Pwy5BuGcjb+fYaUj94mYcOj7rCvw==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/helper-replace-supers": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-parameters": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.7.tgz",
      "integrity": "sha512-AT3MufQ7zZEhU2hwOA11axBnExW0Lszu4RL/tAlUJBuNoRak+wehQW8h6KcXOcgjY42fHtDxswuMhMjFEuv/aw==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-property-literals": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.16.7.tgz",
      "integrity": "sha512-z4FGr9NMGdoIl1RqavCqGG+ZuYjfZ/hkCIeuH6Do7tXmSm0ls11nYVSJqFEUOSJbDab5wC6lRE/w6YjVcr6Hqw==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-regenerator": {
      "version": "7.17.9",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.17.9.tgz",
      "integrity": "sha512-Lc2TfbxR1HOyn/c6b4Y/b6NHoTb67n/IoWLxTu4kC7h4KQnWlhCq2S8Tx0t2SVvv5Uu87Hs+6JEJ5kt2tYGylQ==",
      "dev": true,
      "dependencies": {
        "regenerator-transform": "^0.15.0"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-reserved-words": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.16.7.tgz",
      "integrity": "sha512-KQzzDnZ9hWQBjwi5lpY5v9shmm6IVG0U9pB18zvMu2i4H90xpT4gmqwPYsn8rObiadYe2M0gmgsiOIF5A/2rtg==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-shorthand-properties": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.16.7.tgz",
      "integrity": "sha512-hah2+FEnoRoATdIb05IOXf+4GzXYTq75TVhIn1PewihbpyrNWUt2JbudKQOETWw6QpLe+AIUpJ5MVLYTQbeeUg==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-spread": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.16.7.tgz",
      "integrity": "sha512-+pjJpgAngb53L0iaA5gU/1MLXJIfXcYepLgXB3esVRf4fqmj8f2cxM3/FKaHsZms08hFQJkFccEWuIpm429TXg==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-sticky-regex": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.16.7.tgz",
      "integrity": "sha512-NJa0Bd/87QV5NZZzTuZG5BPJjLYadeSZ9fO6oOUoL4iQx+9EEuw/eEM92SrsT19Yc2jgB1u1hsjqDtH02c3Drw==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-template-literals": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.16.7.tgz",
      "integrity": "sha512-VwbkDDUeenlIjmfNeDX/V0aWrQH2QiVyJtwymVQSzItFDTpxfyJh3EVaQiS0rIN/CqbLGr0VcGmuwyTdZtdIsA==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-typeof-symbol": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.16.7.tgz",
      "integrity": "sha512-p2rOixCKRJzpg9JB4gjnG4gjWkWa89ZoYUnl9snJ1cWIcTH/hvxZqfO+WjG6T8DRBpctEol5jw1O5rA8gkCokQ==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-unicode-escapes": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.16.7.tgz",
      "integrity": "sha512-TAV5IGahIz3yZ9/Hfv35TV2xEm+kaBDaZQCn2S/hG9/CZ0DktxJv9eKfPc7yYCvOYR4JGx1h8C+jcSOvgaaI/Q==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/plugin-transform-unicode-regex": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.16.7.tgz",
      "integrity": "sha512-oC5tYYKw56HO75KZVLQ+R/Nl3Hro9kf8iG0hXoaHP7tjAyCpvqBiSNe6vGrZni1Z6MggmUOC6A7VP7AVmw225Q==",
      "dev": true,
      "dependencies": {
        "@babel/helper-create-regexp-features-plugin": "^7.16.7",
        "@babel/helper-plugin-utils": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/preset-env": {
      "version": "7.17.10",
      "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.17.10.tgz",
      "integrity": "sha512-YNgyBHZQpeoBSRBg0xixsZzfT58Ze1iZrajvv0lJc70qDDGuGfonEnMGfWeSY0mQ3JTuCWFbMkzFRVafOyJx4g==",
      "dev": true,
      "dependencies": {
        "@babel/compat-data": "^7.17.10",
        "@babel/helper-compilation-targets": "^7.17.10",
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/helper-validator-option": "^7.16.7",
        "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.16.7",
        "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.16.7",
        "@babel/plugin-proposal-async-generator-functions": "^7.16.8",
        "@babel/plugin-proposal-class-properties": "^7.16.7",
        "@babel/plugin-proposal-class-static-block": "^7.17.6",
        "@babel/plugin-proposal-dynamic-import": "^7.16.7",
        "@babel/plugin-proposal-export-namespace-from": "^7.16.7",
        "@babel/plugin-proposal-json-strings": "^7.16.7",
        "@babel/plugin-proposal-logical-assignment-operators": "^7.16.7",
        "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7",
        "@babel/plugin-proposal-numeric-separator": "^7.16.7",
        "@babel/plugin-proposal-object-rest-spread": "^7.17.3",
        "@babel/plugin-proposal-optional-catch-binding": "^7.16.7",
        "@babel/plugin-proposal-optional-chaining": "^7.16.7",
        "@babel/plugin-proposal-private-methods": "^7.16.11",
        "@babel/plugin-proposal-private-property-in-object": "^7.16.7",
        "@babel/plugin-proposal-unicode-property-regex": "^7.16.7",
        "@babel/plugin-syntax-async-generators": "^7.8.4",
        "@babel/plugin-syntax-class-properties": "^7.12.13",
        "@babel/plugin-syntax-class-static-block": "^7.14.5",
        "@babel/plugin-syntax-dynamic-import": "^7.8.3",
        "@babel/plugin-syntax-export-namespace-from": "^7.8.3",
        "@babel/plugin-syntax-json-strings": "^7.8.3",
        "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4",
        "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3",
        "@babel/plugin-syntax-numeric-separator": "^7.10.4",
        "@babel/plugin-syntax-object-rest-spread": "^7.8.3",
        "@babel/plugin-syntax-optional-catch-binding": "^7.8.3",
        "@babel/plugin-syntax-optional-chaining": "^7.8.3",
        "@babel/plugin-syntax-private-property-in-object": "^7.14.5",
        "@babel/plugin-syntax-top-level-await": "^7.14.5",
        "@babel/plugin-transform-arrow-functions": "^7.16.7",
        "@babel/plugin-transform-async-to-generator": "^7.16.8",
        "@babel/plugin-transform-block-scoped-functions": "^7.16.7",
        "@babel/plugin-transform-block-scoping": "^7.16.7",
        "@babel/plugin-transform-classes": "^7.16.7",
        "@babel/plugin-transform-computed-properties": "^7.16.7",
        "@babel/plugin-transform-destructuring": "^7.17.7",
        "@babel/plugin-transform-dotall-regex": "^7.16.7",
        "@babel/plugin-transform-duplicate-keys": "^7.16.7",
        "@babel/plugin-transform-exponentiation-operator": "^7.16.7",
        "@babel/plugin-transform-for-of": "^7.16.7",
        "@babel/plugin-transform-function-name": "^7.16.7",
        "@babel/plugin-transform-literals": "^7.16.7",
        "@babel/plugin-transform-member-expression-literals": "^7.16.7",
        "@babel/plugin-transform-modules-amd": "^7.16.7",
        "@babel/plugin-transform-modules-commonjs": "^7.17.9",
        "@babel/plugin-transform-modules-systemjs": "^7.17.8",
        "@babel/plugin-transform-modules-umd": "^7.16.7",
        "@babel/plugin-transform-named-capturing-groups-regex": "^7.17.10",
        "@babel/plugin-transform-new-target": "^7.16.7",
        "@babel/plugin-transform-object-super": "^7.16.7",
        "@babel/plugin-transform-parameters": "^7.16.7",
        "@babel/plugin-transform-property-literals": "^7.16.7",
        "@babel/plugin-transform-regenerator": "^7.17.9",
        "@babel/plugin-transform-reserved-words": "^7.16.7",
        "@babel/plugin-transform-shorthand-properties": "^7.16.7",
        "@babel/plugin-transform-spread": "^7.16.7",
        "@babel/plugin-transform-sticky-regex": "^7.16.7",
        "@babel/plugin-transform-template-literals": "^7.16.7",
        "@babel/plugin-transform-typeof-symbol": "^7.16.7",
        "@babel/plugin-transform-unicode-escapes": "^7.16.7",
        "@babel/plugin-transform-unicode-regex": "^7.16.7",
        "@babel/preset-modules": "^0.1.5",
        "@babel/types": "^7.17.10",
        "babel-plugin-polyfill-corejs2": "^0.3.0",
        "babel-plugin-polyfill-corejs3": "^0.5.0",
        "babel-plugin-polyfill-regenerator": "^0.3.0",
        "core-js-compat": "^3.22.1",
        "semver": "^6.3.0"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/preset-modules": {
      "version": "0.1.5",
      "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.5.tgz",
      "integrity": "sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==",
      "dev": true,
      "dependencies": {
        "@babel/helper-plugin-utils": "^7.0.0",
        "@babel/plugin-proposal-unicode-property-regex": "^7.4.4",
        "@babel/plugin-transform-dotall-regex": "^7.4.4",
        "@babel/types": "^7.4.4",
        "esutils": "^2.0.2"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/register": {
      "version": "7.17.7",
      "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.17.7.tgz",
      "integrity": "sha512-fg56SwvXRifootQEDQAu1mKdjh5uthPzdO0N6t358FktfL4XjAVXuH58ULoiW8mesxiOgNIrxiImqEwv0+hRRA==",
      "dev": true,
      "dependencies": {
        "clone-deep": "^4.0.1",
        "find-cache-dir": "^2.0.0",
        "make-dir": "^2.1.0",
        "pirates": "^4.0.5",
        "source-map-support": "^0.5.16"
      },
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/@babel/runtime": {
      "version": "7.17.9",
      "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.9.tgz",
      "integrity": "sha512-lSiBBvodq29uShpWGNbgFdKYNiFDo5/HIYsaCEY9ff4sb10x9jizo2+pRrSyF4jKZCXqgzuqBOQKbUm90gQwJg==",
      "dev": true,
      "dependencies": {
        "regenerator-runtime": "^0.13.4"
      },
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/template": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz",
      "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==",
      "dev": true,
      "dependencies": {
        "@babel/code-frame": "^7.16.7",
        "@babel/parser": "^7.16.7",
        "@babel/types": "^7.16.7"
      },
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/traverse": {
      "version": "7.17.10",
      "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.10.tgz",
      "integrity": "sha512-VmbrTHQteIdUUQNTb+zE12SHS/xQVIShmBPhlNP12hD5poF2pbITW1Z4172d03HegaQWhLffdkRJYtAzp0AGcw==",
      "dev": true,
      "dependencies": {
        "@babel/code-frame": "^7.16.7",
        "@babel/generator": "^7.17.10",
        "@babel/helper-environment-visitor": "^7.16.7",
        "@babel/helper-function-name": "^7.17.9",
        "@babel/helper-hoist-variables": "^7.16.7",
        "@babel/helper-split-export-declaration": "^7.16.7",
        "@babel/parser": "^7.17.10",
        "@babel/types": "^7.17.10",
        "debug": "^4.1.0",
        "globals": "^11.1.0"
      },
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@babel/types": {
      "version": "7.17.10",
      "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.10.tgz",
      "integrity": "sha512-9O26jG0mBYfGkUYCYZRnBwbVLd1UZOICEr2Em6InB6jVfsAv1GKgwXHmrSg+WFWDmeKTA6vyTZiN8tCSM5Oo3A==",
      "dev": true,
      "dependencies": {
        "@babel/helper-validator-identifier": "^7.16.7",
        "to-fast-properties": "^2.0.0"
      },
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/@jridgewell/gen-mapping": {
      "version": "0.1.1",
      "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz",
      "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==",
      "dev": true,
      "dependencies": {
        "@jridgewell/set-array": "^1.0.0",
        "@jridgewell/sourcemap-codec": "^1.4.10"
      },
      "engines": {
        "node": ">=6.0.0"
      }
    },
    "node_modules/@jridgewell/resolve-uri": {
      "version": "3.0.7",
      "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz",
      "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==",
      "dev": true,
      "engines": {
        "node": ">=6.0.0"
      }
    },
    "node_modules/@jridgewell/set-array": {
      "version": "1.1.1",
      "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.1.tgz",
      "integrity": "sha512-Ct5MqZkLGEXTVmQYbGtx9SVqD2fqwvdubdps5D3djjAkgkKwT918VNOz65pEHFaYTeWcukmJmH5SwsA9Tn2ObQ==",
      "dev": true,
      "engines": {
        "node": ">=6.0.0"
      }
    },
    "node_modules/@jridgewell/sourcemap-codec": {
      "version": "1.4.13",
      "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz",
      "integrity": "sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w==",
      "dev": true
    },
    "node_modules/@jridgewell/trace-mapping": {
      "version": "0.3.10",
      "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.10.tgz",
      "integrity": "sha512-Q0YbBd6OTsXm8Y21+YUSDXupHnodNC2M4O18jtd3iwJ3+vMZNdKGols0a9G6JOK0dcJ3IdUUHoh908ZI6qhk8Q==",
      "dev": true,
      "dependencies": {
        "@jridgewell/resolve-uri": "^3.0.3",
        "@jridgewell/sourcemap-codec": "^1.4.10"
      }
    },
    "node_modules/@types/expect": {
      "version": "1.20.4",
      "resolved": "https://registry.npmjs.org/@types/expect/-/expect-1.20.4.tgz",
      "integrity": "sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg==",
      "dev": true
    },
    "node_modules/@types/node": {
      "version": "14.18.16",
      "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.16.tgz",
      "integrity": "sha512-X3bUMdK/VmvrWdoTkz+VCn6nwKwrKCFTHtqwBIaQJNx4RUIBBUFXM00bqPz/DsDd+Icjmzm6/tyYZzeGVqb6/Q==",
      "dev": true
    },
    "node_modules/@types/vinyl": {
      "version": "2.0.6",
      "resolved": "https://registry.npmjs.org/@types/vinyl/-/vinyl-2.0.6.tgz",
      "integrity": "sha512-ayJ0iOCDNHnKpKTgBG6Q6JOnHTj9zFta+3j2b8Ejza0e4cvRyMn0ZoLEmbPrTHe5YYRlDYPvPWVdV4cTaRyH7g==",
      "dev": true,
      "dependencies": {
        "@types/expect": "^1.20.4",
        "@types/node": "*"
      }
    },
    "node_modules/acorn": {
      "version": "7.4.1",
      "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
      "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
      "dev": true,
      "bin": {
        "acorn": "bin/acorn"
      },
      "engines": {
        "node": ">=0.4.0"
      }
    },
    "node_modules/acorn-node": {
      "version": "1.8.2",
      "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.8.2.tgz",
      "integrity": "sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==",
      "dev": true,
      "dependencies": {
        "acorn": "^7.0.0",
        "acorn-walk": "^7.0.0",
        "xtend": "^4.0.2"
      }
    },
    "node_modules/acorn-walk": {
      "version": "7.2.0",
      "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz",
      "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==",
      "dev": true,
      "engines": {
        "node": ">=0.4.0"
      }
    },
    "node_modules/algoliasearch": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-4.13.0.tgz",
      "integrity": "sha512-oHv4faI1Vl2s+YC0YquwkK/TsaJs79g2JFg5FDm2rKN12VItPTAeQ7hyJMHarOPPYuCnNC5kixbtcqvb21wchw==",
      "dependencies": {
        "@algolia/cache-browser-local-storage": "4.13.0",
        "@algolia/cache-common": "4.13.0",
        "@algolia/cache-in-memory": "4.13.0",
        "@algolia/client-account": "4.13.0",
        "@algolia/client-analytics": "4.13.0",
        "@algolia/client-common": "4.13.0",
        "@algolia/client-personalization": "4.13.0",
        "@algolia/client-search": "4.13.0",
        "@algolia/logger-common": "4.13.0",
        "@algolia/logger-console": "4.13.0",
        "@algolia/requester-browser-xhr": "4.13.0",
        "@algolia/requester-common": "4.13.0",
        "@algolia/requester-node-http": "4.13.0",
        "@algolia/transporter": "4.13.0"
      }
    },
    "node_modules/ansi-colors": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz",
      "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==",
      "dev": true,
      "dependencies": {
        "ansi-wrap": "^0.1.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/ansi-gray": {
      "version": "0.1.1",
      "resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz",
      "integrity": "sha1-KWLPVOyXksSFEKPetSRDaGHvclE=",
      "dev": true,
      "dependencies": {
        "ansi-wrap": "0.1.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/ansi-regex": {
      "version": "2.1.1",
      "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
      "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/ansi-styles": {
      "version": "3.2.1",
      "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
      "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
      "dev": true,
      "dependencies": {
        "color-convert": "^1.9.0"
      },
      "engines": {
        "node": ">=4"
      }
    },
    "node_modules/ansi-wrap": {
      "version": "0.1.0",
      "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz",
      "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/anymatch": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz",
      "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==",
      "dev": true,
      "dependencies": {
        "micromatch": "^3.1.4",
        "normalize-path": "^2.1.1"
      }
    },
    "node_modules/anymatch/node_modules/normalize-path": {
      "version": "2.1.1",
      "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz",
      "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=",
      "dev": true,
      "dependencies": {
        "remove-trailing-separator": "^1.0.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/append-buffer": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz",
      "integrity": "sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE=",
      "dev": true,
      "dependencies": {
        "buffer-equal": "^1.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/archy": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz",
      "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=",
      "dev": true
    },
    "node_modules/arr-diff": {
      "version": "4.0.0",
      "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz",
      "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/arr-filter": {
      "version": "1.1.2",
      "resolved": "https://registry.npmjs.org/arr-filter/-/arr-filter-1.1.2.tgz",
      "integrity": "sha1-Q/3d0JHo7xGqTEXZzcGOLf8XEe4=",
      "dev": true,
      "dependencies": {
        "make-iterator": "^1.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/arr-flatten": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz",
      "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/arr-map": {
      "version": "2.0.2",
      "resolved": "https://registry.npmjs.org/arr-map/-/arr-map-2.0.2.tgz",
      "integrity": "sha1-Onc0X/wc814qkYJWAfnljy4kysQ=",
      "dev": true,
      "dependencies": {
        "make-iterator": "^1.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/arr-union": {
      "version": "3.1.0",
      "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz",
      "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/array-each": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz",
      "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/array-initial": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/array-initial/-/array-initial-1.1.0.tgz",
      "integrity": "sha1-L6dLJnOTccOUe9enrcc74zSz15U=",
      "dev": true,
      "dependencies": {
        "array-slice": "^1.0.0",
        "is-number": "^4.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/array-initial/node_modules/is-number": {
      "version": "4.0.0",
      "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz",
      "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/array-last": {
      "version": "1.3.0",
      "resolved": "https://registry.npmjs.org/array-last/-/array-last-1.3.0.tgz",
      "integrity": "sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg==",
      "dev": true,
      "dependencies": {
        "is-number": "^4.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/array-last/node_modules/is-number": {
      "version": "4.0.0",
      "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz",
      "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/array-slice": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz",
      "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/array-sort": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/array-sort/-/array-sort-1.0.0.tgz",
      "integrity": "sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg==",
      "dev": true,
      "dependencies": {
        "default-compare": "^1.0.0",
        "get-value": "^2.0.6",
        "kind-of": "^5.0.2"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/array-sort/node_modules/kind-of": {
      "version": "5.1.0",
      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
      "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/array-unique": {
      "version": "0.3.2",
      "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz",
      "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/asn1.js": {
      "version": "5.4.1",
      "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz",
      "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==",
      "dev": true,
      "dependencies": {
        "bn.js": "^4.0.0",
        "inherits": "^2.0.1",
        "minimalistic-assert": "^1.0.0",
        "safer-buffer": "^2.1.0"
      }
    },
    "node_modules/asn1.js/node_modules/bn.js": {
      "version": "4.12.0",
      "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
      "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==",
      "dev": true
    },
    "node_modules/assert": {
      "version": "1.5.0",
      "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz",
      "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==",
      "dev": true,
      "dependencies": {
        "object-assign": "^4.1.1",
        "util": "0.10.3"
      }
    },
    "node_modules/assert/node_modules/inherits": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",
      "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=",
      "dev": true
    },
    "node_modules/assert/node_modules/util": {
      "version": "0.10.3",
      "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz",
      "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=",
      "dev": true,
      "dependencies": {
        "inherits": "2.0.1"
      }
    },
    "node_modules/assign-symbols": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz",
      "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/async-done": {
      "version": "1.3.2",
      "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz",
      "integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==",
      "dev": true,
      "dependencies": {
        "end-of-stream": "^1.1.0",
        "once": "^1.3.2",
        "process-nextick-args": "^2.0.0",
        "stream-exhaust": "^1.0.1"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/async-each": {
      "version": "1.0.3",
      "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz",
      "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==",
      "dev": true
    },
    "node_modules/async-settle": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/async-settle/-/async-settle-1.0.0.tgz",
      "integrity": "sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs=",
      "dev": true,
      "dependencies": {
        "async-done": "^1.2.2"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/atob": {
      "version": "2.1.2",
      "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz",
      "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==",
      "dev": true,
      "bin": {
        "atob": "bin/atob.js"
      },
      "engines": {
        "node": ">= 4.5.0"
      }
    },
    "node_modules/babel-plugin-dynamic-import-node": {
      "version": "2.3.3",
      "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz",
      "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==",
      "dev": true,
      "dependencies": {
        "object.assign": "^4.1.0"
      }
    },
    "node_modules/babel-plugin-polyfill-corejs2": {
      "version": "0.3.1",
      "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.1.tgz",
      "integrity": "sha512-v7/T6EQcNfVLfcN2X8Lulb7DjprieyLWJK/zOWH5DUYcAgex9sP3h25Q+DLsX9TloXe3y1O8l2q2Jv9q8UVB9w==",
      "dev": true,
      "dependencies": {
        "@babel/compat-data": "^7.13.11",
        "@babel/helper-define-polyfill-provider": "^0.3.1",
        "semver": "^6.1.1"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/babel-plugin-polyfill-corejs3": {
      "version": "0.5.2",
      "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.5.2.tgz",
      "integrity": "sha512-G3uJih0XWiID451fpeFaYGVuxHEjzKTHtc9uGFEjR6hHrvNzeS/PX+LLLcetJcytsB5m4j+K3o/EpXJNb/5IEQ==",
      "dev": true,
      "dependencies": {
        "@babel/helper-define-polyfill-provider": "^0.3.1",
        "core-js-compat": "^3.21.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/babel-plugin-polyfill-regenerator": {
      "version": "0.3.1",
      "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.3.1.tgz",
      "integrity": "sha512-Y2B06tvgHYt1x0yz17jGkGeeMr5FeKUu+ASJ+N6nB5lQ8Dapfg42i0OVrf8PNGJ3zKL4A23snMi1IRwrqqND7A==",
      "dev": true,
      "dependencies": {
        "@babel/helper-define-polyfill-provider": "^0.3.1"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0-0"
      }
    },
    "node_modules/babelify": {
      "version": "10.0.0",
      "resolved": "https://registry.npmjs.org/babelify/-/babelify-10.0.0.tgz",
      "integrity": "sha512-X40FaxyH7t3X+JFAKvb1H9wooWKLRCi8pg3m8poqtdZaIng+bjzp9RvKQCvRjF9isHiPkXspbbXT/zwXLtwgwg==",
      "dev": true,
      "engines": {
        "node": ">=6.9.0"
      },
      "peerDependencies": {
        "@babel/core": "^7.0.0"
      }
    },
    "node_modules/bach": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/bach/-/bach-1.2.0.tgz",
      "integrity": "sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA=",
      "dev": true,
      "dependencies": {
        "arr-filter": "^1.1.1",
        "arr-flatten": "^1.0.1",
        "arr-map": "^2.0.0",
        "array-each": "^1.0.0",
        "array-initial": "^1.0.0",
        "array-last": "^1.1.1",
        "async-done": "^1.2.2",
        "async-settle": "^1.0.0",
        "now-and-later": "^2.0.0"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/balanced-match": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
      "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
      "dev": true
    },
    "node_modules/base": {
      "version": "0.11.2",
      "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz",
      "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==",
      "dev": true,
      "dependencies": {
        "cache-base": "^1.0.1",
        "class-utils": "^0.3.5",
        "component-emitter": "^1.2.1",
        "define-property": "^1.0.0",
        "isobject": "^3.0.1",
        "mixin-deep": "^1.2.0",
        "pascalcase": "^0.1.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/base/node_modules/define-property": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
      "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
      "dev": true,
      "dependencies": {
        "is-descriptor": "^1.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/base64-js": {
      "version": "1.5.1",
      "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
      "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
      "dev": true,
      "funding": [
        {
          "type": "github",
          "url": "https://github.com/sponsors/feross"
        },
        {
          "type": "patreon",
          "url": "https://www.patreon.com/feross"
        },
        {
          "type": "consulting",
          "url": "https://feross.org/support"
        }
      ]
    },
    "node_modules/binary-extensions": {
      "version": "1.13.1",
      "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz",
      "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/binaryextensions": {
      "version": "2.3.0",
      "resolved": "https://registry.npmjs.org/binaryextensions/-/binaryextensions-2.3.0.tgz",
      "integrity": "sha512-nAihlQsYGyc5Bwq6+EsubvANYGExeJKHDO3RjnvwU042fawQTQfM3Kxn7IHUXQOz4bzfwsGYYHGSvXyW4zOGLg==",
      "dev": true,
      "engines": {
        "node": ">=0.8"
      },
      "funding": {
        "url": "https://bevry.me/fund"
      }
    },
    "node_modules/bindings": {
      "version": "1.5.0",
      "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
      "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
      "dev": true,
      "optional": true,
      "dependencies": {
        "file-uri-to-path": "1.0.0"
      }
    },
    "node_modules/bn.js": {
      "version": "5.2.0",
      "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz",
      "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==",
      "dev": true
    },
    "node_modules/brace-expansion": {
      "version": "1.1.11",
      "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
      "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
      "dev": true,
      "dependencies": {
        "balanced-match": "^1.0.0",
        "concat-map": "0.0.1"
      }
    },
    "node_modules/braces": {
      "version": "2.3.2",
      "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz",
      "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==",
      "dev": true,
      "dependencies": {
        "arr-flatten": "^1.1.0",
        "array-unique": "^0.3.2",
        "extend-shallow": "^2.0.1",
        "fill-range": "^4.0.0",
        "isobject": "^3.0.1",
        "repeat-element": "^1.1.2",
        "snapdragon": "^0.8.1",
        "snapdragon-node": "^2.0.1",
        "split-string": "^3.0.2",
        "to-regex": "^3.0.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/brorand": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz",
      "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=",
      "dev": true
    },
    "node_modules/browser-pack": {
      "version": "6.1.0",
      "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.1.0.tgz",
      "integrity": "sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==",
      "dev": true,
      "dependencies": {
        "combine-source-map": "~0.8.0",
        "defined": "^1.0.0",
        "JSONStream": "^1.0.3",
        "safe-buffer": "^5.1.1",
        "through2": "^2.0.0",
        "umd": "^3.0.0"
      },
      "bin": {
        "browser-pack": "bin/cmd.js"
      }
    },
    "node_modules/browser-resolve": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-2.0.0.tgz",
      "integrity": "sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ==",
      "dev": true,
      "dependencies": {
        "resolve": "^1.17.0"
      }
    },
    "node_modules/browserify": {
      "version": "16.5.2",
      "resolved": "https://registry.npmjs.org/browserify/-/browserify-16.5.2.tgz",
      "integrity": "sha512-TkOR1cQGdmXU9zW4YukWzWVSJwrxmNdADFbqbE3HFgQWe5wqZmOawqZ7J/8MPCwk/W8yY7Y0h+7mOtcZxLP23g==",
      "dev": true,
      "dependencies": {
        "assert": "^1.4.0",
        "browser-pack": "^6.0.1",
        "browser-resolve": "^2.0.0",
        "browserify-zlib": "~0.2.0",
        "buffer": "~5.2.1",
        "cached-path-relative": "^1.0.0",
        "concat-stream": "^1.6.0",
        "console-browserify": "^1.1.0",
        "constants-browserify": "~1.0.0",
        "crypto-browserify": "^3.0.0",
        "defined": "^1.0.0",
        "deps-sort": "^2.0.0",
        "domain-browser": "^1.2.0",
        "duplexer2": "~0.1.2",
        "events": "^2.0.0",
        "glob": "^7.1.0",
        "has": "^1.0.0",
        "htmlescape": "^1.1.0",
        "https-browserify": "^1.0.0",
        "inherits": "~2.0.1",
        "insert-module-globals": "^7.0.0",
        "JSONStream": "^1.0.3",
        "labeled-stream-splicer": "^2.0.0",
        "mkdirp-classic": "^0.5.2",
        "module-deps": "^6.2.3",
        "os-browserify": "~0.3.0",
        "parents": "^1.0.1",
        "path-browserify": "~0.0.0",
        "process": "~0.11.0",
        "punycode": "^1.3.2",
        "querystring-es3": "~0.2.0",
        "read-only-stream": "^2.0.0",
        "readable-stream": "^2.0.2",
        "resolve": "^1.1.4",
        "shasum": "^1.0.0",
        "shell-quote": "^1.6.1",
        "stream-browserify": "^2.0.0",
        "stream-http": "^3.0.0",
        "string_decoder": "^1.1.1",
        "subarg": "^1.0.0",
        "syntax-error": "^1.1.1",
        "through2": "^2.0.0",
        "timers-browserify": "^1.0.1",
        "tty-browserify": "0.0.1",
        "url": "~0.11.0",
        "util": "~0.10.1",
        "vm-browserify": "^1.0.0",
        "xtend": "^4.0.0"
      },
      "bin": {
        "browserify": "bin/cmd.js"
      },
      "engines": {
        "node": ">= 0.8"
      }
    },
    "node_modules/browserify-aes": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
      "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==",
      "dev": true,
      "dependencies": {
        "buffer-xor": "^1.0.3",
        "cipher-base": "^1.0.0",
        "create-hash": "^1.1.0",
        "evp_bytestokey": "^1.0.3",
        "inherits": "^2.0.1",
        "safe-buffer": "^5.0.1"
      }
    },
    "node_modules/browserify-cipher": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz",
      "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==",
      "dev": true,
      "dependencies": {
        "browserify-aes": "^1.0.4",
        "browserify-des": "^1.0.0",
        "evp_bytestokey": "^1.0.0"
      }
    },
    "node_modules/browserify-des": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz",
      "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==",
      "dev": true,
      "dependencies": {
        "cipher-base": "^1.0.1",
        "des.js": "^1.0.0",
        "inherits": "^2.0.1",
        "safe-buffer": "^5.1.2"
      }
    },
    "node_modules/browserify-rsa": {
      "version": "4.1.0",
      "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz",
      "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==",
      "dev": true,
      "dependencies": {
        "bn.js": "^5.0.0",
        "randombytes": "^2.0.1"
      }
    },
    "node_modules/browserify-sign": {
      "version": "4.2.1",
      "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz",
      "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==",
      "dev": true,
      "dependencies": {
        "bn.js": "^5.1.1",
        "browserify-rsa": "^4.0.1",
        "create-hash": "^1.2.0",
        "create-hmac": "^1.1.7",
        "elliptic": "^6.5.3",
        "inherits": "^2.0.4",
        "parse-asn1": "^5.1.5",
        "readable-stream": "^3.6.0",
        "safe-buffer": "^5.2.0"
      }
    },
    "node_modules/browserify-sign/node_modules/readable-stream": {
      "version": "3.6.0",
      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
      "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
      "dev": true,
      "dependencies": {
        "inherits": "^2.0.3",
        "string_decoder": "^1.1.1",
        "util-deprecate": "^1.0.1"
      },
      "engines": {
        "node": ">= 6"
      }
    },
    "node_modules/browserify-zlib": {
      "version": "0.2.0",
      "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz",
      "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==",
      "dev": true,
      "dependencies": {
        "pako": "~1.0.5"
      }
    },
    "node_modules/browserslist": {
      "version": "4.20.3",
      "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.3.tgz",
      "integrity": "sha512-NBhymBQl1zM0Y5dQT/O+xiLP9/rzOIQdKM/eMJBAq7yBgaB6krIYLGejrwVYnSHZdqjscB1SPuAjHwxjvN6Wdg==",
      "dev": true,
      "funding": [
        {
          "type": "opencollective",
          "url": "https://opencollective.com/browserslist"
        },
        {
          "type": "tidelift",
          "url": "https://tidelift.com/funding/github/npm/browserslist"
        }
      ],
      "dependencies": {
        "caniuse-lite": "^1.0.30001332",
        "electron-to-chromium": "^1.4.118",
        "escalade": "^3.1.1",
        "node-releases": "^2.0.3",
        "picocolors": "^1.0.0"
      },
      "bin": {
        "browserslist": "cli.js"
      },
      "engines": {
        "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
      }
    },
    "node_modules/buffer": {
      "version": "5.2.1",
      "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz",
      "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==",
      "dev": true,
      "dependencies": {
        "base64-js": "^1.0.2",
        "ieee754": "^1.1.4"
      }
    },
    "node_modules/buffer-equal": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz",
      "integrity": "sha1-WWFrSYME1Var1GaWayLu2j7KX74=",
      "dev": true,
      "engines": {
        "node": ">=0.4.0"
      }
    },
    "node_modules/buffer-from": {
      "version": "1.1.2",
      "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
      "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
      "dev": true
    },
    "node_modules/buffer-xor": {
      "version": "1.0.3",
      "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz",
      "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=",
      "dev": true
    },
    "node_modules/builtin-status-codes": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz",
      "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=",
      "dev": true
    },
    "node_modules/cache-base": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz",
      "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==",
      "dev": true,
      "dependencies": {
        "collection-visit": "^1.0.0",
        "component-emitter": "^1.2.1",
        "get-value": "^2.0.6",
        "has-value": "^1.0.0",
        "isobject": "^3.0.1",
        "set-value": "^2.0.0",
        "to-object-path": "^0.3.0",
        "union-value": "^1.0.0",
        "unset-value": "^1.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/cached-path-relative": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.1.0.tgz",
      "integrity": "sha512-WF0LihfemtesFcJgO7xfOoOcnWzY/QHR4qeDqV44jPU3HTI54+LnfXK3SA27AVVGCdZFgjjFFaqUA9Jx7dMJZA==",
      "dev": true
    },
    "node_modules/call-bind": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
      "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
      "dev": true,
      "dependencies": {
        "function-bind": "^1.1.1",
        "get-intrinsic": "^1.0.2"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/camelcase": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz",
      "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/caniuse-lite": {
      "version": "1.0.30001339",
      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001339.tgz",
      "integrity": "sha512-Es8PiVqCe+uXdms0Gu5xP5PF2bxLR7OBp3wUzUnuO7OHzhOfCyg3hdiGWVPVxhiuniOzng+hTc1u3fEQ0TlkSQ==",
      "dev": true,
      "funding": [
        {
          "type": "opencollective",
          "url": "https://opencollective.com/browserslist"
        },
        {
          "type": "tidelift",
          "url": "https://tidelift.com/funding/github/npm/caniuse-lite"
        }
      ]
    },
    "node_modules/chalk": {
      "version": "2.4.2",
      "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
      "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
      "dev": true,
      "dependencies": {
        "ansi-styles": "^3.2.1",
        "escape-string-regexp": "^1.0.5",
        "supports-color": "^5.3.0"
      },
      "engines": {
        "node": ">=4"
      }
    },
    "node_modules/chart.js": {
      "version": "3.7.1",
      "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.7.1.tgz",
      "integrity": "sha512-8knRegQLFnPQAheZV8MjxIXc5gQEfDFD897BJgv/klO/vtIyFFmgMXrNfgrXpbTr/XbTturxRgxIXx/Y+ASJBA=="
    },
    "node_modules/chokidar": {
      "version": "2.1.8",
      "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz",
      "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==",
      "deprecated": "Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies",
      "dev": true,
      "dependencies": {
        "anymatch": "^2.0.0",
        "async-each": "^1.0.1",
        "braces": "^2.3.2",
        "glob-parent": "^3.1.0",
        "inherits": "^2.0.3",
        "is-binary-path": "^1.0.0",
        "is-glob": "^4.0.0",
        "normalize-path": "^3.0.0",
        "path-is-absolute": "^1.0.0",
        "readdirp": "^2.2.1",
        "upath": "^1.1.1"
      },
      "optionalDependencies": {
        "fsevents": "^1.2.7"
      }
    },
    "node_modules/cipher-base": {
      "version": "1.0.4",
      "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz",
      "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==",
      "dev": true,
      "dependencies": {
        "inherits": "^2.0.1",
        "safe-buffer": "^5.0.1"
      }
    },
    "node_modules/class-utils": {
      "version": "0.3.6",
      "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz",
      "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==",
      "dev": true,
      "dependencies": {
        "arr-union": "^3.1.0",
        "define-property": "^0.2.5",
        "isobject": "^3.0.0",
        "static-extend": "^0.1.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/class-utils/node_modules/define-property": {
      "version": "0.2.5",
      "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
      "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
      "dev": true,
      "dependencies": {
        "is-descriptor": "^0.1.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/class-utils/node_modules/is-accessor-descriptor": {
      "version": "0.1.6",
      "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
      "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
      "dev": true,
      "dependencies": {
        "kind-of": "^3.0.2"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/class-utils/node_modules/is-accessor-descriptor/node_modules/kind-of": {
      "version": "3.2.2",
      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
      "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
      "dev": true,
      "dependencies": {
        "is-buffer": "^1.1.5"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/class-utils/node_modules/is-data-descriptor": {
      "version": "0.1.4",
      "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
      "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
      "dev": true,
      "dependencies": {
        "kind-of": "^3.0.2"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/class-utils/node_modules/is-data-descriptor/node_modules/kind-of": {
      "version": "3.2.2",
      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
      "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
      "dev": true,
      "dependencies": {
        "is-buffer": "^1.1.5"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/class-utils/node_modules/is-descriptor": {
      "version": "0.1.6",
      "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
      "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
      "dev": true,
      "dependencies": {
        "is-accessor-descriptor": "^0.1.6",
        "is-data-descriptor": "^0.1.4",
        "kind-of": "^5.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/class-utils/node_modules/kind-of": {
      "version": "5.1.0",
      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
      "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/clean-css": {
      "version": "4.2.3",
      "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.3.tgz",
      "integrity": "sha512-VcMWDN54ZN/DS+g58HYL5/n4Zrqe8vHJpGA8KdgUXFU4fuP/aHNw8eld9SyEIyabIMJX/0RaY/fplOo5hYLSFA==",
      "dev": true,
      "dependencies": {
        "source-map": "~0.6.0"
      },
      "engines": {
        "node": ">= 4.0"
      }
    },
    "node_modules/clean-css/node_modules/source-map": {
      "version": "0.6.1",
      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
      "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/cliui": {
      "version": "3.2.0",
      "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
      "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=",
      "dev": true,
      "dependencies": {
        "string-width": "^1.0.1",
        "strip-ansi": "^3.0.1",
        "wrap-ansi": "^2.0.0"
      }
    },
    "node_modules/clone": {
      "version": "2.1.2",
      "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz",
      "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=",
      "dev": true,
      "engines": {
        "node": ">=0.8"
      }
    },
    "node_modules/clone-buffer": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz",
      "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=",
      "dev": true,
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/clone-deep": {
      "version": "4.0.1",
      "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz",
      "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==",
      "dev": true,
      "dependencies": {
        "is-plain-object": "^2.0.4",
        "kind-of": "^6.0.2",
        "shallow-clone": "^3.0.0"
      },
      "engines": {
        "node": ">=6"
      }
    },
    "node_modules/clone-stats": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz",
      "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=",
      "dev": true
    },
    "node_modules/cloneable-readable": {
      "version": "1.1.3",
      "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz",
      "integrity": "sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ==",
      "dev": true,
      "dependencies": {
        "inherits": "^2.0.1",
        "process-nextick-args": "^2.0.0",
        "readable-stream": "^2.3.5"
      }
    },
    "node_modules/code-point-at": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
      "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/collection-map": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/collection-map/-/collection-map-1.0.0.tgz",
      "integrity": "sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw=",
      "dev": true,
      "dependencies": {
        "arr-map": "^2.0.2",
        "for-own": "^1.0.0",
        "make-iterator": "^1.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/collection-visit": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz",
      "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=",
      "dev": true,
      "dependencies": {
        "map-visit": "^1.0.0",
        "object-visit": "^1.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/color-convert": {
      "version": "1.9.3",
      "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
      "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
      "dev": true,
      "dependencies": {
        "color-name": "1.1.3"
      }
    },
    "node_modules/color-name": {
      "version": "1.1.3",
      "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
      "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
      "dev": true
    },
    "node_modules/color-support": {
      "version": "1.1.3",
      "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz",
      "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==",
      "dev": true,
      "bin": {
        "color-support": "bin.js"
      }
    },
    "node_modules/combine-source-map": {
      "version": "0.8.0",
      "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz",
      "integrity": "sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos=",
      "dev": true,
      "dependencies": {
        "convert-source-map": "~1.1.0",
        "inline-source-map": "~0.6.0",
        "lodash.memoize": "~3.0.3",
        "source-map": "~0.5.3"
      }
    },
    "node_modules/combine-source-map/node_modules/convert-source-map": {
      "version": "1.1.3",
      "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz",
      "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=",
      "dev": true
    },
    "node_modules/commondir": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
      "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=",
      "dev": true
    },
    "node_modules/component-emitter": {
      "version": "1.3.0",
      "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
      "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==",
      "dev": true
    },
    "node_modules/concat-map": {
      "version": "0.0.1",
      "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
      "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
      "dev": true
    },
    "node_modules/concat-stream": {
      "version": "1.6.2",
      "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
      "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
      "dev": true,
      "engines": [
        "node >= 0.8"
      ],
      "dependencies": {
        "buffer-from": "^1.0.0",
        "inherits": "^2.0.3",
        "readable-stream": "^2.2.2",
        "typedarray": "^0.0.6"
      }
    },
    "node_modules/console-browserify": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz",
      "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==",
      "dev": true
    },
    "node_modules/constants-browserify": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz",
      "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=",
      "dev": true
    },
    "node_modules/convert-source-map": {
      "version": "1.8.0",
      "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz",
      "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==",
      "dev": true,
      "dependencies": {
        "safe-buffer": "~5.1.1"
      }
    },
    "node_modules/convert-source-map/node_modules/safe-buffer": {
      "version": "5.1.2",
      "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
      "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
      "dev": true
    },
    "node_modules/copy-descriptor": {
      "version": "0.1.1",
      "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz",
      "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/copy-props": {
      "version": "2.0.5",
      "resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.5.tgz",
      "integrity": "sha512-XBlx8HSqrT0ObQwmSzM7WE5k8FxTV75h1DX1Z3n6NhQ/UYYAvInWYmG06vFt7hQZArE2fuO62aihiWIVQwh1sw==",
      "dev": true,
      "dependencies": {
        "each-props": "^1.3.2",
        "is-plain-object": "^5.0.0"
      }
    },
    "node_modules/copy-props/node_modules/is-plain-object": {
      "version": "5.0.0",
      "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
      "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/core-js-compat": {
      "version": "3.22.4",
      "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.22.4.tgz",
      "integrity": "sha512-dIWcsszDezkFZrfm1cnB4f/J85gyhiCpxbgBdohWCDtSVuAaChTSpPV7ldOQf/Xds2U5xCIJZOK82G4ZPAIswA==",
      "dev": true,
      "dependencies": {
        "browserslist": "^4.20.3",
        "semver": "7.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/core-js"
      }
    },
    "node_modules/core-js-compat/node_modules/semver": {
      "version": "7.0.0",
      "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz",
      "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==",
      "dev": true,
      "bin": {
        "semver": "bin/semver.js"
      }
    },
    "node_modules/core-util-is": {
      "version": "1.0.3",
      "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
      "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
      "dev": true
    },
    "node_modules/create-ecdh": {
      "version": "4.0.4",
      "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz",
      "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==",
      "dev": true,
      "dependencies": {
        "bn.js": "^4.1.0",
        "elliptic": "^6.5.3"
      }
    },
    "node_modules/create-ecdh/node_modules/bn.js": {
      "version": "4.12.0",
      "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
      "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==",
      "dev": true
    },
    "node_modules/create-hash": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz",
      "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==",
      "dev": true,
      "dependencies": {
        "cipher-base": "^1.0.1",
        "inherits": "^2.0.1",
        "md5.js": "^1.3.4",
        "ripemd160": "^2.0.1",
        "sha.js": "^2.4.0"
      }
    },
    "node_modules/create-hmac": {
      "version": "1.1.7",
      "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz",
      "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==",
      "dev": true,
      "dependencies": {
        "cipher-base": "^1.0.3",
        "create-hash": "^1.1.0",
        "inherits": "^2.0.1",
        "ripemd160": "^2.0.0",
        "safe-buffer": "^5.0.1",
        "sha.js": "^2.4.8"
      }
    },
    "node_modules/crypto-browserify": {
      "version": "3.12.0",
      "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz",
      "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==",
      "dev": true,
      "dependencies": {
        "browserify-cipher": "^1.0.0",
        "browserify-sign": "^4.0.0",
        "create-ecdh": "^4.0.0",
        "create-hash": "^1.1.0",
        "create-hmac": "^1.1.0",
        "diffie-hellman": "^5.0.0",
        "inherits": "^2.0.1",
        "pbkdf2": "^3.0.3",
        "public-encrypt": "^4.0.0",
        "randombytes": "^2.0.0",
        "randomfill": "^1.0.3"
      },
      "engines": {
        "node": "*"
      }
    },
    "node_modules/d": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz",
      "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==",
      "dev": true,
      "dependencies": {
        "es5-ext": "^0.10.50",
        "type": "^1.0.1"
      }
    },
    "node_modules/dash-ast": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/dash-ast/-/dash-ast-1.0.0.tgz",
      "integrity": "sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA==",
      "dev": true
    },
    "node_modules/debug": {
      "version": "4.3.4",
      "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
      "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
      "dev": true,
      "dependencies": {
        "ms": "2.1.2"
      },
      "engines": {
        "node": ">=6.0"
      },
      "peerDependenciesMeta": {
        "supports-color": {
          "optional": true
        }
      }
    },
    "node_modules/decamelize": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
      "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/decode-uri-component": {
      "version": "0.2.0",
      "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz",
      "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=",
      "dev": true,
      "engines": {
        "node": ">=0.10"
      }
    },
    "node_modules/default-compare": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/default-compare/-/default-compare-1.0.0.tgz",
      "integrity": "sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ==",
      "dev": true,
      "dependencies": {
        "kind-of": "^5.0.2"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/default-compare/node_modules/kind-of": {
      "version": "5.1.0",
      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
      "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/default-resolution": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/default-resolution/-/default-resolution-2.0.0.tgz",
      "integrity": "sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ=",
      "dev": true,
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/define-properties": {
      "version": "1.1.4",
      "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz",
      "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==",
      "dev": true,
      "dependencies": {
        "has-property-descriptors": "^1.0.0",
        "object-keys": "^1.1.1"
      },
      "engines": {
        "node": ">= 0.4"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/define-property": {
      "version": "2.0.2",
      "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz",
      "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==",
      "dev": true,
      "dependencies": {
        "is-descriptor": "^1.0.2",
        "isobject": "^3.0.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/defined": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz",
      "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=",
      "dev": true
    },
    "node_modules/deps-sort": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.1.tgz",
      "integrity": "sha512-1orqXQr5po+3KI6kQb9A4jnXT1PBwggGl2d7Sq2xsnOeI9GPcE/tGcF9UiSZtZBM7MukY4cAh7MemS6tZYipfw==",
      "dev": true,
      "dependencies": {
        "JSONStream": "^1.0.3",
        "shasum-object": "^1.0.0",
        "subarg": "^1.0.0",
        "through2": "^2.0.0"
      },
      "bin": {
        "deps-sort": "bin/cmd.js"
      }
    },
    "node_modules/des.js": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz",
      "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==",
      "dev": true,
      "dependencies": {
        "inherits": "^2.0.1",
        "minimalistic-assert": "^1.0.0"
      }
    },
    "node_modules/detect-file": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz",
      "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/detective": {
      "version": "5.2.0",
      "resolved": "https://registry.npmjs.org/detective/-/detective-5.2.0.tgz",
      "integrity": "sha512-6SsIx+nUUbuK0EthKjv0zrdnajCCXVYGmbYYiYjFVpzcjwEs/JMDZ8tPRG29J/HhN56t3GJp2cGSWDRjjot8Pg==",
      "dev": true,
      "dependencies": {
        "acorn-node": "^1.6.1",
        "defined": "^1.0.0",
        "minimist": "^1.1.1"
      },
      "bin": {
        "detective": "bin/detective.js"
      },
      "engines": {
        "node": ">=0.8.0"
      }
    },
    "node_modules/diffie-hellman": {
      "version": "5.0.3",
      "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz",
      "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==",
      "dev": true,
      "dependencies": {
        "bn.js": "^4.1.0",
        "miller-rabin": "^4.0.0",
        "randombytes": "^2.0.0"
      }
    },
    "node_modules/diffie-hellman/node_modules/bn.js": {
      "version": "4.12.0",
      "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
      "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==",
      "dev": true
    },
    "node_modules/domain-browser": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz",
      "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==",
      "dev": true,
      "engines": {
        "node": ">=0.4",
        "npm": ">=1.2"
      }
    },
    "node_modules/duplexer2": {
      "version": "0.1.4",
      "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz",
      "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=",
      "dev": true,
      "dependencies": {
        "readable-stream": "^2.0.2"
      }
    },
    "node_modules/duplexify": {
      "version": "3.7.1",
      "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz",
      "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==",
      "dev": true,
      "dependencies": {
        "end-of-stream": "^1.0.0",
        "inherits": "^2.0.1",
        "readable-stream": "^2.0.0",
        "stream-shift": "^1.0.0"
      }
    },
    "node_modules/each-props": {
      "version": "1.3.2",
      "resolved": "https://registry.npmjs.org/each-props/-/each-props-1.3.2.tgz",
      "integrity": "sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA==",
      "dev": true,
      "dependencies": {
        "is-plain-object": "^2.0.1",
        "object.defaults": "^1.1.0"
      }
    },
    "node_modules/electron-to-chromium": {
      "version": "1.4.137",
      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.137.tgz",
      "integrity": "sha512-0Rcpald12O11BUogJagX3HsCN3FE83DSqWjgXoHo5a72KUKMSfI39XBgJpgNNxS9fuGzytaFjE06kZkiVFy2qA==",
      "dev": true
    },
    "node_modules/elliptic": {
      "version": "6.5.4",
      "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz",
      "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==",
      "dev": true,
      "dependencies": {
        "bn.js": "^4.11.9",
        "brorand": "^1.1.0",
        "hash.js": "^1.0.0",
        "hmac-drbg": "^1.0.1",
        "inherits": "^2.0.4",
        "minimalistic-assert": "^1.0.1",
        "minimalistic-crypto-utils": "^1.0.1"
      }
    },
    "node_modules/elliptic/node_modules/bn.js": {
      "version": "4.12.0",
      "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
      "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==",
      "dev": true
    },
    "node_modules/end-of-stream": {
      "version": "1.4.4",
      "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
      "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
      "dev": true,
      "dependencies": {
        "once": "^1.4.0"
      }
    },
    "node_modules/error-ex": {
      "version": "1.3.2",
      "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
      "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
      "dev": true,
      "dependencies": {
        "is-arrayish": "^0.2.1"
      }
    },
    "node_modules/es5-ext": {
      "version": "0.10.61",
      "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.61.tgz",
      "integrity": "sha512-yFhIqQAzu2Ca2I4SE2Au3rxVfmohU9Y7wqGR+s7+H7krk26NXhIRAZDgqd6xqjCEFUomDEA3/Bo/7fKmIkW1kA==",
      "dev": true,
      "hasInstallScript": true,
      "dependencies": {
        "es6-iterator": "^2.0.3",
        "es6-symbol": "^3.1.3",
        "next-tick": "^1.1.0"
      },
      "engines": {
        "node": ">=0.10"
      }
    },
    "node_modules/es6-iterator": {
      "version": "2.0.3",
      "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz",
      "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=",
      "dev": true,
      "dependencies": {
        "d": "1",
        "es5-ext": "^0.10.35",
        "es6-symbol": "^3.1.1"
      }
    },
    "node_modules/es6-symbol": {
      "version": "3.1.3",
      "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz",
      "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==",
      "dev": true,
      "dependencies": {
        "d": "^1.0.1",
        "ext": "^1.1.2"
      }
    },
    "node_modules/es6-weak-map": {
      "version": "2.0.3",
      "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz",
      "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==",
      "dev": true,
      "dependencies": {
        "d": "1",
        "es5-ext": "^0.10.46",
        "es6-iterator": "^2.0.3",
        "es6-symbol": "^3.1.1"
      }
    },
    "node_modules/escalade": {
      "version": "3.1.1",
      "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
      "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
      "dev": true,
      "engines": {
        "node": ">=6"
      }
    },
    "node_modules/escape-string-regexp": {
      "version": "1.0.5",
      "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
      "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
      "dev": true,
      "engines": {
        "node": ">=0.8.0"
      }
    },
    "node_modules/esutils": {
      "version": "2.0.3",
      "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
      "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/events": {
      "version": "2.1.0",
      "resolved": "https://registry.npmjs.org/events/-/events-2.1.0.tgz",
      "integrity": "sha512-3Zmiobend8P9DjmKAty0Era4jV8oJ0yGYe2nJJAxgymF9+N8F2m0hhZiMoWtcfepExzNKZumFU3ksdQbInGWCg==",
      "dev": true,
      "engines": {
        "node": ">=0.4.x"
      }
    },
    "node_modules/evp_bytestokey": {
      "version": "1.0.3",
      "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz",
      "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==",
      "dev": true,
      "dependencies": {
        "md5.js": "^1.3.4",
        "safe-buffer": "^5.1.1"
      }
    },
    "node_modules/expand-brackets": {
      "version": "2.1.4",
      "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz",
      "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=",
      "dev": true,
      "dependencies": {
        "debug": "^2.3.3",
        "define-property": "^0.2.5",
        "extend-shallow": "^2.0.1",
        "posix-character-classes": "^0.1.0",
        "regex-not": "^1.0.0",
        "snapdragon": "^0.8.1",
        "to-regex": "^3.0.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/expand-brackets/node_modules/debug": {
      "version": "2.6.9",
      "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
      "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
      "dev": true,
      "dependencies": {
        "ms": "2.0.0"
      }
    },
    "node_modules/expand-brackets/node_modules/define-property": {
      "version": "0.2.5",
      "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
      "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
      "dev": true,
      "dependencies": {
        "is-descriptor": "^0.1.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/expand-brackets/node_modules/is-accessor-descriptor": {
      "version": "0.1.6",
      "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
      "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
      "dev": true,
      "dependencies": {
        "kind-of": "^3.0.2"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of": {
      "version": "3.2.2",
      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
      "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
      "dev": true,
      "dependencies": {
        "is-buffer": "^1.1.5"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/expand-brackets/node_modules/is-data-descriptor": {
      "version": "0.1.4",
      "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
      "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
      "dev": true,
      "dependencies": {
        "kind-of": "^3.0.2"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of": {
      "version": "3.2.2",
      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
      "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
      "dev": true,
      "dependencies": {
        "is-buffer": "^1.1.5"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/expand-brackets/node_modules/is-descriptor": {
      "version": "0.1.6",
      "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
      "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
      "dev": true,
      "dependencies": {
        "is-accessor-descriptor": "^0.1.6",
        "is-data-descriptor": "^0.1.4",
        "kind-of": "^5.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/expand-brackets/node_modules/kind-of": {
      "version": "5.1.0",
      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
      "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/expand-brackets/node_modules/ms": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
      "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
      "dev": true
    },
    "node_modules/expand-tilde": {
      "version": "2.0.2",
      "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz",
      "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=",
      "dev": true,
      "dependencies": {
        "homedir-polyfill": "^1.0.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/ext": {
      "version": "1.6.0",
      "resolved": "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz",
      "integrity": "sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==",
      "dev": true,
      "dependencies": {
        "type": "^2.5.0"
      }
    },
    "node_modules/ext/node_modules/type": {
      "version": "2.6.0",
      "resolved": "https://registry.npmjs.org/type/-/type-2.6.0.tgz",
      "integrity": "sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ==",
      "dev": true
    },
    "node_modules/extend": {
      "version": "3.0.2",
      "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
      "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==",
      "dev": true
    },
    "node_modules/extend-shallow": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
      "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
      "dev": true,
      "dependencies": {
        "is-extendable": "^0.1.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/extglob": {
      "version": "2.0.4",
      "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz",
      "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==",
      "dev": true,
      "dependencies": {
        "array-unique": "^0.3.2",
        "define-property": "^1.0.0",
        "expand-brackets": "^2.1.4",
        "extend-shallow": "^2.0.1",
        "fragment-cache": "^0.2.1",
        "regex-not": "^1.0.0",
        "snapdragon": "^0.8.1",
        "to-regex": "^3.0.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/extglob/node_modules/define-property": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
      "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
      "dev": true,
      "dependencies": {
        "is-descriptor": "^1.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/fancy-log": {
      "version": "1.3.3",
      "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.3.tgz",
      "integrity": "sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw==",
      "dev": true,
      "dependencies": {
        "ansi-gray": "^0.1.1",
        "color-support": "^1.1.3",
        "parse-node-version": "^1.0.0",
        "time-stamp": "^1.0.0"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/fast-levenshtein": {
      "version": "1.1.4",
      "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-1.1.4.tgz",
      "integrity": "sha1-5qdUzI8V5YmHqpy9J69m/W9OWvk=",
      "dev": true
    },
    "node_modules/fast-safe-stringify": {
      "version": "2.1.1",
      "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz",
      "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==",
      "dev": true
    },
    "node_modules/file-uri-to-path": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
      "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
      "dev": true,
      "optional": true
    },
    "node_modules/fill-range": {
      "version": "4.0.0",
      "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
      "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=",
      "dev": true,
      "dependencies": {
        "extend-shallow": "^2.0.1",
        "is-number": "^3.0.0",
        "repeat-string": "^1.6.1",
        "to-regex-range": "^2.1.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/find-cache-dir": {
      "version": "2.1.0",
      "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz",
      "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==",
      "dev": true,
      "dependencies": {
        "commondir": "^1.0.1",
        "make-dir": "^2.0.0",
        "pkg-dir": "^3.0.0"
      },
      "engines": {
        "node": ">=6"
      }
    },
    "node_modules/find-up": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
      "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
      "dev": true,
      "dependencies": {
        "locate-path": "^3.0.0"
      },
      "engines": {
        "node": ">=6"
      }
    },
    "node_modules/findup-sync": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz",
      "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==",
      "dev": true,
      "dependencies": {
        "detect-file": "^1.0.0",
        "is-glob": "^4.0.0",
        "micromatch": "^3.0.4",
        "resolve-dir": "^1.0.1"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/fined": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz",
      "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==",
      "dev": true,
      "dependencies": {
        "expand-tilde": "^2.0.2",
        "is-plain-object": "^2.0.3",
        "object.defaults": "^1.1.0",
        "object.pick": "^1.2.0",
        "parse-filepath": "^1.0.1"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/flagged-respawn": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz",
      "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==",
      "dev": true,
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/flush-write-stream": {
      "version": "1.1.1",
      "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz",
      "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==",
      "dev": true,
      "dependencies": {
        "inherits": "^2.0.3",
        "readable-stream": "^2.3.6"
      }
    },
    "node_modules/for-in": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",
      "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/for-own": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz",
      "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=",
      "dev": true,
      "dependencies": {
        "for-in": "^1.0.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/fragment-cache": {
      "version": "0.2.1",
      "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz",
      "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=",
      "dev": true,
      "dependencies": {
        "map-cache": "^0.2.2"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/fs-mkdirp-stream": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz",
      "integrity": "sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes=",
      "dev": true,
      "dependencies": {
        "graceful-fs": "^4.1.11",
        "through2": "^2.0.3"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/fs.realpath": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
      "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
      "dev": true
    },
    "node_modules/fsevents": {
      "version": "1.2.13",
      "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
      "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
      "deprecated": "fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.",
      "dev": true,
      "hasInstallScript": true,
      "optional": true,
      "os": [
        "darwin"
      ],
      "dependencies": {
        "bindings": "^1.5.0",
        "nan": "^2.12.1"
      },
      "engines": {
        "node": ">= 4.0"
      }
    },
    "node_modules/function-bind": {
      "version": "1.1.1",
      "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
      "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
      "dev": true
    },
    "node_modules/gensync": {
      "version": "1.0.0-beta.2",
      "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
      "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==",
      "dev": true,
      "engines": {
        "node": ">=6.9.0"
      }
    },
    "node_modules/get-assigned-identifiers": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz",
      "integrity": "sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ==",
      "dev": true
    },
    "node_modules/get-caller-file": {
      "version": "1.0.3",
      "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz",
      "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==",
      "dev": true
    },
    "node_modules/get-intrinsic": {
      "version": "1.1.1",
      "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz",
      "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==",
      "dev": true,
      "dependencies": {
        "function-bind": "^1.1.1",
        "has": "^1.0.3",
        "has-symbols": "^1.0.1"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/get-value": {
      "version": "2.0.6",
      "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz",
      "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/glob": {
      "version": "7.2.0",
      "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
      "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
      "dev": true,
      "dependencies": {
        "fs.realpath": "^1.0.0",
        "inflight": "^1.0.4",
        "inherits": "2",
        "minimatch": "^3.0.4",
        "once": "^1.3.0",
        "path-is-absolute": "^1.0.0"
      },
      "engines": {
        "node": "*"
      },
      "funding": {
        "url": "https://github.com/sponsors/isaacs"
      }
    },
    "node_modules/glob-parent": {
      "version": "3.1.0",
      "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz",
      "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=",
      "dev": true,
      "dependencies": {
        "is-glob": "^3.1.0",
        "path-dirname": "^1.0.0"
      }
    },
    "node_modules/glob-parent/node_modules/is-glob": {
      "version": "3.1.0",
      "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz",
      "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=",
      "dev": true,
      "dependencies": {
        "is-extglob": "^2.1.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/glob-stream": {
      "version": "6.1.0",
      "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz",
      "integrity": "sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ=",
      "dev": true,
      "dependencies": {
        "extend": "^3.0.0",
        "glob": "^7.1.1",
        "glob-parent": "^3.1.0",
        "is-negated-glob": "^1.0.0",
        "ordered-read-streams": "^1.0.0",
        "pumpify": "^1.3.5",
        "readable-stream": "^2.1.5",
        "remove-trailing-separator": "^1.0.1",
        "to-absolute-glob": "^2.0.0",
        "unique-stream": "^2.0.2"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/glob-watcher": {
      "version": "5.0.5",
      "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-5.0.5.tgz",
      "integrity": "sha512-zOZgGGEHPklZNjZQaZ9f41i7F2YwE+tS5ZHrDhbBCk3stwahn5vQxnFmBJZHoYdusR6R1bLSXeGUy/BhctwKzw==",
      "dev": true,
      "dependencies": {
        "anymatch": "^2.0.0",
        "async-done": "^1.2.0",
        "chokidar": "^2.0.0",
        "is-negated-glob": "^1.0.0",
        "just-debounce": "^1.0.0",
        "normalize-path": "^3.0.0",
        "object.defaults": "^1.1.0"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/global-modules": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz",
      "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==",
      "dev": true,
      "dependencies": {
        "global-prefix": "^1.0.1",
        "is-windows": "^1.0.1",
        "resolve-dir": "^1.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/global-prefix": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz",
      "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=",
      "dev": true,
      "dependencies": {
        "expand-tilde": "^2.0.2",
        "homedir-polyfill": "^1.0.1",
        "ini": "^1.3.4",
        "is-windows": "^1.0.1",
        "which": "^1.2.14"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/globals": {
      "version": "11.12.0",
      "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
      "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
      "dev": true,
      "engines": {
        "node": ">=4"
      }
    },
    "node_modules/glogg": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.2.tgz",
      "integrity": "sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA==",
      "dev": true,
      "dependencies": {
        "sparkles": "^1.0.0"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/graceful-fs": {
      "version": "4.2.10",
      "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz",
      "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==",
      "dev": true
    },
    "node_modules/gulp": {
      "version": "4.0.2",
      "resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz",
      "integrity": "sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA==",
      "dev": true,
      "dependencies": {
        "glob-watcher": "^5.0.3",
        "gulp-cli": "^2.2.0",
        "undertaker": "^1.2.1",
        "vinyl-fs": "^3.0.0"
      },
      "bin": {
        "gulp": "bin/gulp.js"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/gulp-clean-css": {
      "version": "4.3.0",
      "resolved": "https://registry.npmjs.org/gulp-clean-css/-/gulp-clean-css-4.3.0.tgz",
      "integrity": "sha512-mGyeT3qqFXTy61j0zOIciS4MkYziF2U594t2Vs9rUnpkEHqfu6aDITMp8xOvZcvdX61Uz3y1mVERRYmjzQF5fg==",
      "dev": true,
      "dependencies": {
        "clean-css": "4.2.3",
        "plugin-error": "1.0.1",
        "through2": "3.0.1",
        "vinyl-sourcemaps-apply": "0.2.1"
      }
    },
    "node_modules/gulp-clean-css/node_modules/through2": {
      "version": "3.0.1",
      "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz",
      "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==",
      "dev": true,
      "dependencies": {
        "readable-stream": "2 || 3"
      }
    },
    "node_modules/gulp-cli": {
      "version": "2.3.0",
      "resolved": "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.3.0.tgz",
      "integrity": "sha512-zzGBl5fHo0EKSXsHzjspp3y5CONegCm8ErO5Qh0UzFzk2y4tMvzLWhoDokADbarfZRL2pGpRp7yt6gfJX4ph7A==",
      "dev": true,
      "dependencies": {
        "ansi-colors": "^1.0.1",
        "archy": "^1.0.0",
        "array-sort": "^1.0.0",
        "color-support": "^1.1.3",
        "concat-stream": "^1.6.0",
        "copy-props": "^2.0.1",
        "fancy-log": "^1.3.2",
        "gulplog": "^1.0.0",
        "interpret": "^1.4.0",
        "isobject": "^3.0.1",
        "liftoff": "^3.1.0",
        "matchdep": "^2.0.0",
        "mute-stdout": "^1.0.0",
        "pretty-hrtime": "^1.0.0",
        "replace-homedir": "^1.0.0",
        "semver-greatest-satisfied-range": "^1.1.0",
        "v8flags": "^3.2.0",
        "yargs": "^7.1.0"
      },
      "bin": {
        "gulp": "bin/gulp.js"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/gulp-rename": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/gulp-rename/-/gulp-rename-2.0.0.tgz",
      "integrity": "sha512-97Vba4KBzbYmR5VBs9mWmK+HwIf5mj+/zioxfZhOKeXtx5ZjBk57KFlePf5nxq9QsTtFl0ejnHE3zTC9MHXqyQ==",
      "dev": true,
      "engines": {
        "node": ">=4"
      }
    },
    "node_modules/gulp-replace": {
      "version": "1.1.3",
      "resolved": "https://registry.npmjs.org/gulp-replace/-/gulp-replace-1.1.3.tgz",
      "integrity": "sha512-HcPHpWY4XdF8zxYkDODHnG2+7a3nD/Y8Mfu3aBgMiCFDW3X2GiOKXllsAmILcxe3KZT2BXoN18WrpEFm48KfLQ==",
      "dev": true,
      "dependencies": {
        "@types/node": "^14.14.41",
        "@types/vinyl": "^2.0.4",
        "istextorbinary": "^3.0.0",
        "replacestream": "^4.0.3",
        "yargs-parser": ">=5.0.0-security.0"
      },
      "engines": {
        "node": ">=10"
      }
    },
    "node_modules/gulp-streamify": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/gulp-streamify/-/gulp-streamify-1.0.2.tgz",
      "integrity": "sha1-ANazgU1IbAiPeHOO0HZqvBY4nk0=",
      "dev": true,
      "dependencies": {
        "plexer": "1.0.1"
      },
      "engines": {
        "node": ">= 0.10.0"
      }
    },
    "node_modules/gulp-uglify": {
      "version": "3.0.2",
      "resolved": "https://registry.npmjs.org/gulp-uglify/-/gulp-uglify-3.0.2.tgz",
      "integrity": "sha512-gk1dhB74AkV2kzqPMQBLA3jPoIAPd/nlNzP2XMDSG8XZrqnlCiDGAqC+rZOumzFvB5zOphlFh6yr3lgcAb/OOg==",
      "dev": true,
      "dependencies": {
        "array-each": "^1.0.1",
        "extend-shallow": "^3.0.2",
        "gulplog": "^1.0.0",
        "has-gulplog": "^0.1.0",
        "isobject": "^3.0.1",
        "make-error-cause": "^1.1.1",
        "safe-buffer": "^5.1.2",
        "through2": "^2.0.0",
        "uglify-js": "^3.0.5",
        "vinyl-sourcemaps-apply": "^0.2.0"
      }
    },
    "node_modules/gulp-uglify/node_modules/extend-shallow": {
      "version": "3.0.2",
      "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
      "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
      "dev": true,
      "dependencies": {
        "assign-symbols": "^1.0.0",
        "is-extendable": "^1.0.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/gulp-uglify/node_modules/is-extendable": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
      "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
      "dev": true,
      "dependencies": {
        "is-plain-object": "^2.0.4"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/gulplog": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz",
      "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=",
      "dev": true,
      "dependencies": {
        "glogg": "^1.0.0"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/has": {
      "version": "1.0.3",
      "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
      "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
      "dev": true,
      "dependencies": {
        "function-bind": "^1.1.1"
      },
      "engines": {
        "node": ">= 0.4.0"
      }
    },
    "node_modules/has-flag": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
      "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
      "dev": true,
      "engines": {
        "node": ">=4"
      }
    },
    "node_modules/has-gulplog": {
      "version": "0.1.0",
      "resolved": "https://registry.npmjs.org/has-gulplog/-/has-gulplog-0.1.0.tgz",
      "integrity": "sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4=",
      "dev": true,
      "dependencies": {
        "sparkles": "^1.0.0"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/has-property-descriptors": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz",
      "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==",
      "dev": true,
      "dependencies": {
        "get-intrinsic": "^1.1.1"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/has-symbols": {
      "version": "1.0.3",
      "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
      "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==",
      "dev": true,
      "engines": {
        "node": ">= 0.4"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/has-value": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz",
      "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=",
      "dev": true,
      "dependencies": {
        "get-value": "^2.0.6",
        "has-values": "^1.0.0",
        "isobject": "^3.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/has-values": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz",
      "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=",
      "dev": true,
      "dependencies": {
        "is-number": "^3.0.0",
        "kind-of": "^4.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/has-values/node_modules/kind-of": {
      "version": "4.0.0",
      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz",
      "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=",
      "dev": true,
      "dependencies": {
        "is-buffer": "^1.1.5"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/hash-base": {
      "version": "3.1.0",
      "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz",
      "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==",
      "dev": true,
      "dependencies": {
        "inherits": "^2.0.4",
        "readable-stream": "^3.6.0",
        "safe-buffer": "^5.2.0"
      },
      "engines": {
        "node": ">=4"
      }
    },
    "node_modules/hash-base/node_modules/readable-stream": {
      "version": "3.6.0",
      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
      "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
      "dev": true,
      "dependencies": {
        "inherits": "^2.0.3",
        "string_decoder": "^1.1.1",
        "util-deprecate": "^1.0.1"
      },
      "engines": {
        "node": ">= 6"
      }
    },
    "node_modules/hash.js": {
      "version": "1.1.7",
      "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz",
      "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==",
      "dev": true,
      "dependencies": {
        "inherits": "^2.0.3",
        "minimalistic-assert": "^1.0.1"
      }
    },
    "node_modules/hmac-drbg": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
      "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=",
      "dev": true,
      "dependencies": {
        "hash.js": "^1.0.3",
        "minimalistic-assert": "^1.0.0",
        "minimalistic-crypto-utils": "^1.0.1"
      }
    },
    "node_modules/homedir-polyfill": {
      "version": "1.0.3",
      "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz",
      "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==",
      "dev": true,
      "dependencies": {
        "parse-passwd": "^1.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/hosted-git-info": {
      "version": "2.8.9",
      "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
      "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==",
      "dev": true
    },
    "node_modules/htmlescape": {
      "version": "1.1.1",
      "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz",
      "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=",
      "dev": true,
      "engines": {
        "node": ">=0.10"
      }
    },
    "node_modules/https-browserify": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz",
      "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=",
      "dev": true
    },
    "node_modules/ieee754": {
      "version": "1.2.1",
      "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
      "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
      "dev": true,
      "funding": [
        {
          "type": "github",
          "url": "https://github.com/sponsors/feross"
        },
        {
          "type": "patreon",
          "url": "https://www.patreon.com/feross"
        },
        {
          "type": "consulting",
          "url": "https://feross.org/support"
        }
      ]
    },
    "node_modules/inflight": {
      "version": "1.0.6",
      "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
      "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
      "dev": true,
      "dependencies": {
        "once": "^1.3.0",
        "wrappy": "1"
      }
    },
    "node_modules/inherits": {
      "version": "2.0.4",
      "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
      "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
      "dev": true
    },
    "node_modules/ini": {
      "version": "1.3.8",
      "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
      "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==",
      "dev": true
    },
    "node_modules/inline-source-map": {
      "version": "0.6.2",
      "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz",
      "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=",
      "dev": true,
      "dependencies": {
        "source-map": "~0.5.3"
      }
    },
    "node_modules/insert-module-globals": {
      "version": "7.2.1",
      "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.2.1.tgz",
      "integrity": "sha512-ufS5Qq9RZN+Bu899eA9QCAYThY+gGW7oRkmb0vC93Vlyu/CFGcH0OYPEjVkDXA5FEbTt1+VWzdoOD3Ny9N+8tg==",
      "dev": true,
      "dependencies": {
        "acorn-node": "^1.5.2",
        "combine-source-map": "^0.8.0",
        "concat-stream": "^1.6.1",
        "is-buffer": "^1.1.0",
        "JSONStream": "^1.0.3",
        "path-is-absolute": "^1.0.1",
        "process": "~0.11.0",
        "through2": "^2.0.0",
        "undeclared-identifiers": "^1.1.2",
        "xtend": "^4.0.0"
      },
      "bin": {
        "insert-module-globals": "bin/cmd.js"
      }
    },
    "node_modules/interpret": {
      "version": "1.4.0",
      "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz",
      "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==",
      "dev": true,
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/invert-kv": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz",
      "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/is-absolute": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz",
      "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==",
      "dev": true,
      "dependencies": {
        "is-relative": "^1.0.0",
        "is-windows": "^1.0.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/is-accessor-descriptor": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
      "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
      "dev": true,
      "dependencies": {
        "kind-of": "^6.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/is-arrayish": {
      "version": "0.2.1",
      "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
      "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=",
      "dev": true
    },
    "node_modules/is-binary-path": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz",
      "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=",
      "dev": true,
      "dependencies": {
        "binary-extensions": "^1.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/is-buffer": {
      "version": "1.1.6",
      "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
      "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==",
      "dev": true
    },
    "node_modules/is-core-module": {
      "version": "2.9.0",
      "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz",
      "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==",
      "dev": true,
      "dependencies": {
        "has": "^1.0.3"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/is-data-descriptor": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
      "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
      "dev": true,
      "dependencies": {
        "kind-of": "^6.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/is-descriptor": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
      "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
      "dev": true,
      "dependencies": {
        "is-accessor-descriptor": "^1.0.0",
        "is-data-descriptor": "^1.0.0",
        "kind-of": "^6.0.2"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/is-extendable": {
      "version": "0.1.1",
      "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
      "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/is-extglob": {
      "version": "2.1.1",
      "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
      "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/is-fullwidth-code-point": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
      "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
      "dev": true,
      "dependencies": {
        "number-is-nan": "^1.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/is-glob": {
      "version": "4.0.3",
      "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
      "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
      "dev": true,
      "dependencies": {
        "is-extglob": "^2.1.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/is-negated-glob": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz",
      "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/is-number": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
      "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=",
      "dev": true,
      "dependencies": {
        "kind-of": "^3.0.2"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/is-number/node_modules/kind-of": {
      "version": "3.2.2",
      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
      "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
      "dev": true,
      "dependencies": {
        "is-buffer": "^1.1.5"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/is-plain-object": {
      "version": "2.0.4",
      "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
      "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==",
      "dev": true,
      "dependencies": {
        "isobject": "^3.0.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/is-relative": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz",
      "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==",
      "dev": true,
      "dependencies": {
        "is-unc-path": "^1.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/is-unc-path": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz",
      "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==",
      "dev": true,
      "dependencies": {
        "unc-path-regex": "^0.1.2"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/is-utf8": {
      "version": "0.2.1",
      "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
      "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=",
      "dev": true
    },
    "node_modules/is-valid-glob": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz",
      "integrity": "sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/is-windows": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz",
      "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/isarray": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
      "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
      "dev": true
    },
    "node_modules/isexe": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
      "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
      "dev": true
    },
    "node_modules/isobject": {
      "version": "3.0.1",
      "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
      "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/isstream": {
      "version": "0.1.2",
      "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
      "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=",
      "dev": true
    },
    "node_modules/istextorbinary": {
      "version": "3.3.0",
      "resolved": "https://registry.npmjs.org/istextorbinary/-/istextorbinary-3.3.0.tgz",
      "integrity": "sha512-Tvq1W6NAcZeJ8op+Hq7tdZ434rqnMx4CCZ7H0ff83uEloDvVbqAwaMTZcafKGJT0VHkYzuXUiCY4hlXQg6WfoQ==",
      "dev": true,
      "dependencies": {
        "binaryextensions": "^2.2.0",
        "textextensions": "^3.2.0"
      },
      "engines": {
        "node": ">=8"
      },
      "funding": {
        "url": "https://bevry.me/fund"
      }
    },
    "node_modules/js-tokens": {
      "version": "4.0.0",
      "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
      "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
      "dev": true
    },
    "node_modules/jsesc": {
      "version": "2.5.2",
      "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz",
      "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==",
      "dev": true,
      "bin": {
        "jsesc": "bin/jsesc"
      },
      "engines": {
        "node": ">=4"
      }
    },
    "node_modules/json-stable-stringify": {
      "version": "0.0.1",
      "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz",
      "integrity": "sha1-YRwj6BTbN1Un34URk9tZ3Sryf0U=",
      "dev": true,
      "dependencies": {
        "jsonify": "~0.0.0"
      }
    },
    "node_modules/json-stable-stringify-without-jsonify": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
      "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=",
      "dev": true
    },
    "node_modules/json5": {
      "version": "2.2.1",
      "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz",
      "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==",
      "dev": true,
      "bin": {
        "json5": "lib/cli.js"
      },
      "engines": {
        "node": ">=6"
      }
    },
    "node_modules/jsonify": {
      "version": "0.0.0",
      "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz",
      "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=",
      "dev": true,
      "engines": {
        "node": "*"
      }
    },
    "node_modules/jsonparse": {
      "version": "1.3.1",
      "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz",
      "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=",
      "dev": true,
      "engines": [
        "node >= 0.2.0"
      ]
    },
    "node_modules/JSONStream": {
      "version": "1.3.5",
      "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz",
      "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==",
      "dev": true,
      "dependencies": {
        "jsonparse": "^1.2.0",
        "through": ">=2.2.7 <3"
      },
      "bin": {
        "JSONStream": "bin.js"
      },
      "engines": {
        "node": "*"
      }
    },
    "node_modules/just-debounce": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/just-debounce/-/just-debounce-1.1.0.tgz",
      "integrity": "sha512-qpcRocdkUmf+UTNBYx5w6dexX5J31AKK1OmPwH630a83DdVVUIngk55RSAiIGpQyoH0dlr872VHfPjnQnK1qDQ==",
      "dev": true
    },
    "node_modules/kind-of": {
      "version": "6.0.3",
      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
      "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/labeled-stream-splicer": {
      "version": "2.0.2",
      "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.2.tgz",
      "integrity": "sha512-Ca4LSXFFZUjPScRaqOcFxneA0VpKZr4MMYCljyQr4LIewTLb3Y0IUTIsnBBsVubIeEfxeSZpSjSsRM8APEQaAw==",
      "dev": true,
      "dependencies": {
        "inherits": "^2.0.1",
        "stream-splicer": "^2.0.0"
      }
    },
    "node_modules/last-run": {
      "version": "1.1.1",
      "resolved": "https://registry.npmjs.org/last-run/-/last-run-1.1.1.tgz",
      "integrity": "sha1-RblpQsF7HHnHchmCWbqUO+v4yls=",
      "dev": true,
      "dependencies": {
        "default-resolution": "^2.0.0",
        "es6-weak-map": "^2.0.1"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/lazystream": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz",
      "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==",
      "dev": true,
      "dependencies": {
        "readable-stream": "^2.0.5"
      },
      "engines": {
        "node": ">= 0.6.3"
      }
    },
    "node_modules/lcid": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz",
      "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=",
      "dev": true,
      "dependencies": {
        "invert-kv": "^1.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/lead": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz",
      "integrity": "sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI=",
      "dev": true,
      "dependencies": {
        "flush-write-stream": "^1.0.2"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/liftoff": {
      "version": "3.1.0",
      "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-3.1.0.tgz",
      "integrity": "sha512-DlIPlJUkCV0Ips2zf2pJP0unEoT1kwYhiiPUGF3s/jtxTCjziNLoiVVh+jqWOWeFi6mmwQ5fNxvAUyPad4Dfog==",
      "dev": true,
      "dependencies": {
        "extend": "^3.0.0",
        "findup-sync": "^3.0.0",
        "fined": "^1.0.1",
        "flagged-respawn": "^1.0.0",
        "is-plain-object": "^2.0.4",
        "object.map": "^1.0.0",
        "rechoir": "^0.6.2",
        "resolve": "^1.1.7"
      },
      "engines": {
        "node": ">= 0.8"
      }
    },
    "node_modules/load-json-file": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
      "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=",
      "dev": true,
      "dependencies": {
        "graceful-fs": "^4.1.2",
        "parse-json": "^2.2.0",
        "pify": "^2.0.0",
        "pinkie-promise": "^2.0.0",
        "strip-bom": "^2.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/load-json-file/node_modules/pify": {
      "version": "2.3.0",
      "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
      "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/locate-path": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
      "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
      "dev": true,
      "dependencies": {
        "p-locate": "^3.0.0",
        "path-exists": "^3.0.0"
      },
      "engines": {
        "node": ">=6"
      }
    },
    "node_modules/lodash.debounce": {
      "version": "4.0.8",
      "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz",
      "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=",
      "dev": true
    },
    "node_modules/lodash.memoize": {
      "version": "3.0.4",
      "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz",
      "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=",
      "dev": true
    },
    "node_modules/make-dir": {
      "version": "2.1.0",
      "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
      "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==",
      "dev": true,
      "dependencies": {
        "pify": "^4.0.1",
        "semver": "^5.6.0"
      },
      "engines": {
        "node": ">=6"
      }
    },
    "node_modules/make-dir/node_modules/semver": {
      "version": "5.7.1",
      "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
      "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
      "dev": true,
      "bin": {
        "semver": "bin/semver"
      }
    },
    "node_modules/make-error": {
      "version": "1.3.6",
      "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
      "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
      "dev": true
    },
    "node_modules/make-error-cause": {
      "version": "1.2.2",
      "resolved": "https://registry.npmjs.org/make-error-cause/-/make-error-cause-1.2.2.tgz",
      "integrity": "sha1-3wOI/NCzeBbf8KX7gQiTl3fcvJ0=",
      "dev": true,
      "dependencies": {
        "make-error": "^1.2.0"
      }
    },
    "node_modules/make-iterator": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz",
      "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==",
      "dev": true,
      "dependencies": {
        "kind-of": "^6.0.2"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/map-cache": {
      "version": "0.2.2",
      "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz",
      "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/map-visit": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz",
      "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=",
      "dev": true,
      "dependencies": {
        "object-visit": "^1.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/matchdep": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz",
      "integrity": "sha1-xvNINKDY28OzfCfui7yyfHd1WC4=",
      "dev": true,
      "dependencies": {
        "findup-sync": "^2.0.0",
        "micromatch": "^3.0.4",
        "resolve": "^1.4.0",
        "stack-trace": "0.0.10"
      },
      "engines": {
        "node": ">= 0.10.0"
      }
    },
    "node_modules/matchdep/node_modules/findup-sync": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz",
      "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=",
      "dev": true,
      "dependencies": {
        "detect-file": "^1.0.0",
        "is-glob": "^3.1.0",
        "micromatch": "^3.0.4",
        "resolve-dir": "^1.0.1"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/matchdep/node_modules/is-glob": {
      "version": "3.1.0",
      "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz",
      "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=",
      "dev": true,
      "dependencies": {
        "is-extglob": "^2.1.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/md5.js": {
      "version": "1.3.5",
      "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz",
      "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==",
      "dev": true,
      "dependencies": {
        "hash-base": "^3.0.0",
        "inherits": "^2.0.1",
        "safe-buffer": "^5.1.2"
      }
    },
    "node_modules/micromatch": {
      "version": "3.1.10",
      "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
      "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==",
      "dev": true,
      "dependencies": {
        "arr-diff": "^4.0.0",
        "array-unique": "^0.3.2",
        "braces": "^2.3.1",
        "define-property": "^2.0.2",
        "extend-shallow": "^3.0.2",
        "extglob": "^2.0.4",
        "fragment-cache": "^0.2.1",
        "kind-of": "^6.0.2",
        "nanomatch": "^1.2.9",
        "object.pick": "^1.3.0",
        "regex-not": "^1.0.0",
        "snapdragon": "^0.8.1",
        "to-regex": "^3.0.2"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/micromatch/node_modules/extend-shallow": {
      "version": "3.0.2",
      "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
      "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
      "dev": true,
      "dependencies": {
        "assign-symbols": "^1.0.0",
        "is-extendable": "^1.0.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/micromatch/node_modules/is-extendable": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
      "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
      "dev": true,
      "dependencies": {
        "is-plain-object": "^2.0.4"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/miller-rabin": {
      "version": "4.0.1",
      "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz",
      "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==",
      "dev": true,
      "dependencies": {
        "bn.js": "^4.0.0",
        "brorand": "^1.0.1"
      },
      "bin": {
        "miller-rabin": "bin/miller-rabin"
      }
    },
    "node_modules/miller-rabin/node_modules/bn.js": {
      "version": "4.12.0",
      "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
      "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==",
      "dev": true
    },
    "node_modules/minimalistic-assert": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz",
      "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==",
      "dev": true
    },
    "node_modules/minimalistic-crypto-utils": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz",
      "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=",
      "dev": true
    },
    "node_modules/minimatch": {
      "version": "3.1.2",
      "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
      "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
      "dev": true,
      "dependencies": {
        "brace-expansion": "^1.1.7"
      },
      "engines": {
        "node": "*"
      }
    },
    "node_modules/minimist": {
      "version": "1.2.6",
      "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
      "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==",
      "dev": true
    },
    "node_modules/mithril": {
      "version": "2.0.4",
      "resolved": "https://registry.npmjs.org/mithril/-/mithril-2.0.4.tgz",
      "integrity": "sha512-mgw+DMZlhMS4PpprF6dl7ZoeZq5GGcAuWnrg5e12MvaGauc4jzWsDZtVGRCktsiQczOEUr2K5teKbE5k44RlOg==",
      "bin": {
        "ospec": "ospec/bin/ospec"
      }
    },
    "node_modules/mixin-deep": {
      "version": "1.3.2",
      "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz",
      "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==",
      "dev": true,
      "dependencies": {
        "for-in": "^1.0.2",
        "is-extendable": "^1.0.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/mixin-deep/node_modules/is-extendable": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
      "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
      "dev": true,
      "dependencies": {
        "is-plain-object": "^2.0.4"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/mkdirp-classic": {
      "version": "0.5.3",
      "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
      "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==",
      "dev": true
    },
    "node_modules/module-deps": {
      "version": "6.2.3",
      "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.2.3.tgz",
      "integrity": "sha512-fg7OZaQBcL4/L+AK5f4iVqf9OMbCclXfy/znXRxTVhJSeW5AIlS9AwheYwDaXM3lVW7OBeaeUEY3gbaC6cLlSA==",
      "dev": true,
      "dependencies": {
        "browser-resolve": "^2.0.0",
        "cached-path-relative": "^1.0.2",
        "concat-stream": "~1.6.0",
        "defined": "^1.0.0",
        "detective": "^5.2.0",
        "duplexer2": "^0.1.2",
        "inherits": "^2.0.1",
        "JSONStream": "^1.0.3",
        "parents": "^1.0.0",
        "readable-stream": "^2.0.2",
        "resolve": "^1.4.0",
        "stream-combiner2": "^1.1.1",
        "subarg": "^1.0.0",
        "through2": "^2.0.0",
        "xtend": "^4.0.0"
      },
      "bin": {
        "module-deps": "bin/cmd.js"
      },
      "engines": {
        "node": ">= 0.8.0"
      }
    },
    "node_modules/ms": {
      "version": "2.1.2",
      "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
      "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
      "dev": true
    },
    "node_modules/mute-stdout": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.1.tgz",
      "integrity": "sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg==",
      "dev": true,
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/nan": {
      "version": "2.15.0",
      "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz",
      "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==",
      "dev": true,
      "optional": true
    },
    "node_modules/nanomatch": {
      "version": "1.2.13",
      "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz",
      "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==",
      "dev": true,
      "dependencies": {
        "arr-diff": "^4.0.0",
        "array-unique": "^0.3.2",
        "define-property": "^2.0.2",
        "extend-shallow": "^3.0.2",
        "fragment-cache": "^0.2.1",
        "is-windows": "^1.0.2",
        "kind-of": "^6.0.2",
        "object.pick": "^1.3.0",
        "regex-not": "^1.0.0",
        "snapdragon": "^0.8.1",
        "to-regex": "^3.0.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/nanomatch/node_modules/extend-shallow": {
      "version": "3.0.2",
      "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
      "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
      "dev": true,
      "dependencies": {
        "assign-symbols": "^1.0.0",
        "is-extendable": "^1.0.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/nanomatch/node_modules/is-extendable": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
      "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
      "dev": true,
      "dependencies": {
        "is-plain-object": "^2.0.4"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/next-tick": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz",
      "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==",
      "dev": true
    },
    "node_modules/node-releases": {
      "version": "2.0.4",
      "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.4.tgz",
      "integrity": "sha512-gbMzqQtTtDz/00jQzZ21PQzdI9PyLYqUSvD0p3naOhX4odFji0ZxYdnVwPTxmSwkmxhcFImpozceidSG+AgoPQ==",
      "dev": true
    },
    "node_modules/normalize-package-data": {
      "version": "2.5.0",
      "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
      "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==",
      "dev": true,
      "dependencies": {
        "hosted-git-info": "^2.1.4",
        "resolve": "^1.10.0",
        "semver": "2 || 3 || 4 || 5",
        "validate-npm-package-license": "^3.0.1"
      }
    },
    "node_modules/normalize-package-data/node_modules/semver": {
      "version": "5.7.1",
      "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
      "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
      "dev": true,
      "bin": {
        "semver": "bin/semver"
      }
    },
    "node_modules/normalize-path": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
      "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/now-and-later": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.1.tgz",
      "integrity": "sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==",
      "dev": true,
      "dependencies": {
        "once": "^1.3.2"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/number-is-nan": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
      "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/object-assign": {
      "version": "4.1.1",
      "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
      "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/object-copy": {
      "version": "0.1.0",
      "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz",
      "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=",
      "dev": true,
      "dependencies": {
        "copy-descriptor": "^0.1.0",
        "define-property": "^0.2.5",
        "kind-of": "^3.0.3"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/object-copy/node_modules/define-property": {
      "version": "0.2.5",
      "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
      "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
      "dev": true,
      "dependencies": {
        "is-descriptor": "^0.1.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/object-copy/node_modules/is-accessor-descriptor": {
      "version": "0.1.6",
      "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
      "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
      "dev": true,
      "dependencies": {
        "kind-of": "^3.0.2"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/object-copy/node_modules/is-data-descriptor": {
      "version": "0.1.4",
      "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
      "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
      "dev": true,
      "dependencies": {
        "kind-of": "^3.0.2"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/object-copy/node_modules/is-descriptor": {
      "version": "0.1.6",
      "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
      "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
      "dev": true,
      "dependencies": {
        "is-accessor-descriptor": "^0.1.6",
        "is-data-descriptor": "^0.1.4",
        "kind-of": "^5.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/object-copy/node_modules/is-descriptor/node_modules/kind-of": {
      "version": "5.1.0",
      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
      "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/object-copy/node_modules/kind-of": {
      "version": "3.2.2",
      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
      "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
      "dev": true,
      "dependencies": {
        "is-buffer": "^1.1.5"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/object-keys": {
      "version": "1.1.1",
      "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
      "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",
      "dev": true,
      "engines": {
        "node": ">= 0.4"
      }
    },
    "node_modules/object-visit": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz",
      "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=",
      "dev": true,
      "dependencies": {
        "isobject": "^3.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/object.assign": {
      "version": "4.1.2",
      "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz",
      "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==",
      "dev": true,
      "dependencies": {
        "call-bind": "^1.0.0",
        "define-properties": "^1.1.3",
        "has-symbols": "^1.0.1",
        "object-keys": "^1.1.1"
      },
      "engines": {
        "node": ">= 0.4"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/object.defaults": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz",
      "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=",
      "dev": true,
      "dependencies": {
        "array-each": "^1.0.1",
        "array-slice": "^1.0.0",
        "for-own": "^1.0.0",
        "isobject": "^3.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/object.map": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz",
      "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=",
      "dev": true,
      "dependencies": {
        "for-own": "^1.0.0",
        "make-iterator": "^1.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/object.pick": {
      "version": "1.3.0",
      "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz",
      "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=",
      "dev": true,
      "dependencies": {
        "isobject": "^3.0.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/object.reduce": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/object.reduce/-/object.reduce-1.0.1.tgz",
      "integrity": "sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60=",
      "dev": true,
      "dependencies": {
        "for-own": "^1.0.0",
        "make-iterator": "^1.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/once": {
      "version": "1.4.0",
      "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
      "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
      "dev": true,
      "dependencies": {
        "wrappy": "1"
      }
    },
    "node_modules/ordered-read-streams": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz",
      "integrity": "sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4=",
      "dev": true,
      "dependencies": {
        "readable-stream": "^2.0.1"
      }
    },
    "node_modules/os-browserify": {
      "version": "0.3.0",
      "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz",
      "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=",
      "dev": true
    },
    "node_modules/os-locale": {
      "version": "1.4.0",
      "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
      "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=",
      "dev": true,
      "dependencies": {
        "lcid": "^1.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/p-limit": {
      "version": "2.3.0",
      "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
      "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
      "dev": true,
      "dependencies": {
        "p-try": "^2.0.0"
      },
      "engines": {
        "node": ">=6"
      },
      "funding": {
        "url": "https://github.com/sponsors/sindresorhus"
      }
    },
    "node_modules/p-locate": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
      "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
      "dev": true,
      "dependencies": {
        "p-limit": "^2.0.0"
      },
      "engines": {
        "node": ">=6"
      }
    },
    "node_modules/p-try": {
      "version": "2.2.0",
      "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
      "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
      "dev": true,
      "engines": {
        "node": ">=6"
      }
    },
    "node_modules/pako": {
      "version": "1.0.11",
      "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
      "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==",
      "dev": true
    },
    "node_modules/parents": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz",
      "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=",
      "dev": true,
      "dependencies": {
        "path-platform": "~0.11.15"
      }
    },
    "node_modules/parse-asn1": {
      "version": "5.1.6",
      "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz",
      "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==",
      "dev": true,
      "dependencies": {
        "asn1.js": "^5.2.0",
        "browserify-aes": "^1.0.0",
        "evp_bytestokey": "^1.0.0",
        "pbkdf2": "^3.0.3",
        "safe-buffer": "^5.1.1"
      }
    },
    "node_modules/parse-filepath": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz",
      "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=",
      "dev": true,
      "dependencies": {
        "is-absolute": "^1.0.0",
        "map-cache": "^0.2.0",
        "path-root": "^0.1.1"
      },
      "engines": {
        "node": ">=0.8"
      }
    },
    "node_modules/parse-json": {
      "version": "2.2.0",
      "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz",
      "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=",
      "dev": true,
      "dependencies": {
        "error-ex": "^1.2.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/parse-node-version": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz",
      "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==",
      "dev": true,
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/parse-passwd": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz",
      "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/pascalcase": {
      "version": "0.1.1",
      "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz",
      "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/path-browserify": {
      "version": "0.0.1",
      "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz",
      "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==",
      "dev": true
    },
    "node_modules/path-dirname": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz",
      "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=",
      "dev": true
    },
    "node_modules/path-exists": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
      "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
      "dev": true,
      "engines": {
        "node": ">=4"
      }
    },
    "node_modules/path-is-absolute": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
      "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/path-parse": {
      "version": "1.0.7",
      "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
      "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
      "dev": true
    },
    "node_modules/path-platform": {
      "version": "0.11.15",
      "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz",
      "integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=",
      "dev": true,
      "engines": {
        "node": ">= 0.8.0"
      }
    },
    "node_modules/path-root": {
      "version": "0.1.1",
      "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz",
      "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=",
      "dev": true,
      "dependencies": {
        "path-root-regex": "^0.1.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/path-root-regex": {
      "version": "0.1.2",
      "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz",
      "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/path-type": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz",
      "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=",
      "dev": true,
      "dependencies": {
        "graceful-fs": "^4.1.2",
        "pify": "^2.0.0",
        "pinkie-promise": "^2.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/path-type/node_modules/pify": {
      "version": "2.3.0",
      "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
      "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/pbkdf2": {
      "version": "3.1.2",
      "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz",
      "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==",
      "dev": true,
      "dependencies": {
        "create-hash": "^1.1.2",
        "create-hmac": "^1.1.4",
        "ripemd160": "^2.0.1",
        "safe-buffer": "^5.0.1",
        "sha.js": "^2.4.8"
      },
      "engines": {
        "node": ">=0.12"
      }
    },
    "node_modules/picocolors": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
      "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
      "dev": true
    },
    "node_modules/pify": {
      "version": "4.0.1",
      "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
      "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
      "dev": true,
      "engines": {
        "node": ">=6"
      }
    },
    "node_modules/pinkie": {
      "version": "2.0.4",
      "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
      "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/pinkie-promise": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
      "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=",
      "dev": true,
      "dependencies": {
        "pinkie": "^2.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/pirates": {
      "version": "4.0.5",
      "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz",
      "integrity": "sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==",
      "dev": true,
      "engines": {
        "node": ">= 6"
      }
    },
    "node_modules/pkg-dir": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz",
      "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==",
      "dev": true,
      "dependencies": {
        "find-up": "^3.0.0"
      },
      "engines": {
        "node": ">=6"
      }
    },
    "node_modules/plexer": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/plexer/-/plexer-1.0.1.tgz",
      "integrity": "sha1-qAG2Ur+BRXOXlepNO/CvlGwwwN0=",
      "dev": true,
      "dependencies": {
        "isstream": "^0.1.2",
        "readable-stream": "^2.0.2"
      },
      "engines": {
        "node": ">= 0.10.0"
      }
    },
    "node_modules/plugin-error": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-1.0.1.tgz",
      "integrity": "sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA==",
      "dev": true,
      "dependencies": {
        "ansi-colors": "^1.0.1",
        "arr-diff": "^4.0.0",
        "arr-union": "^3.1.0",
        "extend-shallow": "^3.0.2"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/plugin-error/node_modules/extend-shallow": {
      "version": "3.0.2",
      "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
      "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
      "dev": true,
      "dependencies": {
        "assign-symbols": "^1.0.0",
        "is-extendable": "^1.0.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/plugin-error/node_modules/is-extendable": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
      "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
      "dev": true,
      "dependencies": {
        "is-plain-object": "^2.0.4"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/posix-character-classes": {
      "version": "0.1.1",
      "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz",
      "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/pretty-hrtime": {
      "version": "1.0.3",
      "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz",
      "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=",
      "dev": true,
      "engines": {
        "node": ">= 0.8"
      }
    },
    "node_modules/process": {
      "version": "0.11.10",
      "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
      "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=",
      "dev": true,
      "engines": {
        "node": ">= 0.6.0"
      }
    },
    "node_modules/process-nextick-args": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
      "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
      "dev": true
    },
    "node_modules/public-encrypt": {
      "version": "4.0.3",
      "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz",
      "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==",
      "dev": true,
      "dependencies": {
        "bn.js": "^4.1.0",
        "browserify-rsa": "^4.0.0",
        "create-hash": "^1.1.0",
        "parse-asn1": "^5.0.0",
        "randombytes": "^2.0.1",
        "safe-buffer": "^5.1.2"
      }
    },
    "node_modules/public-encrypt/node_modules/bn.js": {
      "version": "4.12.0",
      "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
      "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==",
      "dev": true
    },
    "node_modules/pump": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz",
      "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==",
      "dev": true,
      "dependencies": {
        "end-of-stream": "^1.1.0",
        "once": "^1.3.1"
      }
    },
    "node_modules/pumpify": {
      "version": "1.5.1",
      "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz",
      "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==",
      "dev": true,
      "dependencies": {
        "duplexify": "^3.6.0",
        "inherits": "^2.0.3",
        "pump": "^2.0.0"
      }
    },
    "node_modules/punycode": {
      "version": "1.4.1",
      "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
      "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=",
      "dev": true
    },
    "node_modules/querystring": {
      "version": "0.2.0",
      "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz",
      "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=",
      "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.",
      "dev": true,
      "engines": {
        "node": ">=0.4.x"
      }
    },
    "node_modules/querystring-es3": {
      "version": "0.2.1",
      "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz",
      "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=",
      "dev": true,
      "engines": {
        "node": ">=0.4.x"
      }
    },
    "node_modules/randombytes": {
      "version": "2.1.0",
      "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
      "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",
      "dev": true,
      "dependencies": {
        "safe-buffer": "^5.1.0"
      }
    },
    "node_modules/randomfill": {
      "version": "1.0.4",
      "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz",
      "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==",
      "dev": true,
      "dependencies": {
        "randombytes": "^2.0.5",
        "safe-buffer": "^5.1.0"
      }
    },
    "node_modules/read-only-stream": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz",
      "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=",
      "dev": true,
      "dependencies": {
        "readable-stream": "^2.0.2"
      }
    },
    "node_modules/read-pkg": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",
      "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=",
      "dev": true,
      "dependencies": {
        "load-json-file": "^1.0.0",
        "normalize-package-data": "^2.3.2",
        "path-type": "^1.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/read-pkg-up": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz",
      "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=",
      "dev": true,
      "dependencies": {
        "find-up": "^1.0.0",
        "read-pkg": "^1.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/read-pkg-up/node_modules/find-up": {
      "version": "1.1.2",
      "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
      "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=",
      "dev": true,
      "dependencies": {
        "path-exists": "^2.0.0",
        "pinkie-promise": "^2.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/read-pkg-up/node_modules/path-exists": {
      "version": "2.1.0",
      "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz",
      "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=",
      "dev": true,
      "dependencies": {
        "pinkie-promise": "^2.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/readable-stream": {
      "version": "2.3.7",
      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
      "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
      "dev": true,
      "dependencies": {
        "core-util-is": "~1.0.0",
        "inherits": "~2.0.3",
        "isarray": "~1.0.0",
        "process-nextick-args": "~2.0.0",
        "safe-buffer": "~5.1.1",
        "string_decoder": "~1.1.1",
        "util-deprecate": "~1.0.1"
      }
    },
    "node_modules/readable-stream/node_modules/safe-buffer": {
      "version": "5.1.2",
      "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
      "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
      "dev": true
    },
    "node_modules/readable-stream/node_modules/string_decoder": {
      "version": "1.1.1",
      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
      "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
      "dev": true,
      "dependencies": {
        "safe-buffer": "~5.1.0"
      }
    },
    "node_modules/readdirp": {
      "version": "2.2.1",
      "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz",
      "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==",
      "dev": true,
      "dependencies": {
        "graceful-fs": "^4.1.11",
        "micromatch": "^3.1.10",
        "readable-stream": "^2.0.2"
      },
      "engines": {
        "node": ">=0.10"
      }
    },
    "node_modules/rechoir": {
      "version": "0.6.2",
      "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
      "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=",
      "dev": true,
      "dependencies": {
        "resolve": "^1.1.6"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/regenerate": {
      "version": "1.4.2",
      "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz",
      "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==",
      "dev": true
    },
    "node_modules/regenerate-unicode-properties": {
      "version": "10.0.1",
      "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.0.1.tgz",
      "integrity": "sha512-vn5DU6yg6h8hP/2OkQo3K7uVILvY4iu0oI4t3HFa81UPkhGJwkRwM10JEc3upjdhHjs/k8GJY1sRBhk5sr69Bw==",
      "dev": true,
      "dependencies": {
        "regenerate": "^1.4.2"
      },
      "engines": {
        "node": ">=4"
      }
    },
    "node_modules/regenerator-runtime": {
      "version": "0.13.9",
      "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
      "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==",
      "dev": true
    },
    "node_modules/regenerator-transform": {
      "version": "0.15.0",
      "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.0.tgz",
      "integrity": "sha512-LsrGtPmbYg19bcPHwdtmXwbW+TqNvtY4riE3P83foeHRroMbH6/2ddFBfab3t7kbzc7v7p4wbkIecHImqt0QNg==",
      "dev": true,
      "dependencies": {
        "@babel/runtime": "^7.8.4"
      }
    },
    "node_modules/regex-not": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz",
      "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==",
      "dev": true,
      "dependencies": {
        "extend-shallow": "^3.0.2",
        "safe-regex": "^1.1.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/regex-not/node_modules/extend-shallow": {
      "version": "3.0.2",
      "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
      "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
      "dev": true,
      "dependencies": {
        "assign-symbols": "^1.0.0",
        "is-extendable": "^1.0.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/regex-not/node_modules/is-extendable": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
      "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
      "dev": true,
      "dependencies": {
        "is-plain-object": "^2.0.4"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/regexpu-core": {
      "version": "5.0.1",
      "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.0.1.tgz",
      "integrity": "sha512-CriEZlrKK9VJw/xQGJpQM5rY88BtuL8DM+AEwvcThHilbxiTAy8vq4iJnd2tqq8wLmjbGZzP7ZcKFjbGkmEFrw==",
      "dev": true,
      "dependencies": {
        "regenerate": "^1.4.2",
        "regenerate-unicode-properties": "^10.0.1",
        "regjsgen": "^0.6.0",
        "regjsparser": "^0.8.2",
        "unicode-match-property-ecmascript": "^2.0.0",
        "unicode-match-property-value-ecmascript": "^2.0.0"
      },
      "engines": {
        "node": ">=4"
      }
    },
    "node_modules/regjsgen": {
      "version": "0.6.0",
      "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.6.0.tgz",
      "integrity": "sha512-ozE883Uigtqj3bx7OhL1KNbCzGyW2NQZPl6Hs09WTvCuZD5sTI4JY58bkbQWa/Y9hxIsvJ3M8Nbf7j54IqeZbA==",
      "dev": true
    },
    "node_modules/regjsparser": {
      "version": "0.8.4",
      "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.8.4.tgz",
      "integrity": "sha512-J3LABycON/VNEu3abOviqGHuB/LOtOQj8SKmfP9anY5GfAVw/SPjwzSjxGjbZXIxbGfqTHtJw58C2Li/WkStmA==",
      "dev": true,
      "dependencies": {
        "jsesc": "~0.5.0"
      },
      "bin": {
        "regjsparser": "bin/parser"
      }
    },
    "node_modules/regjsparser/node_modules/jsesc": {
      "version": "0.5.0",
      "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
      "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=",
      "dev": true,
      "bin": {
        "jsesc": "bin/jsesc"
      }
    },
    "node_modules/remove-bom-buffer": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz",
      "integrity": "sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==",
      "dev": true,
      "dependencies": {
        "is-buffer": "^1.1.5",
        "is-utf8": "^0.2.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/remove-bom-stream": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz",
      "integrity": "sha1-BfGlk/FuQuH7kOv1nejlaVJflSM=",
      "dev": true,
      "dependencies": {
        "remove-bom-buffer": "^3.0.0",
        "safe-buffer": "^5.1.0",
        "through2": "^2.0.3"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/remove-trailing-separator": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz",
      "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=",
      "dev": true
    },
    "node_modules/repeat-element": {
      "version": "1.1.4",
      "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz",
      "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/repeat-string": {
      "version": "1.6.1",
      "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz",
      "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=",
      "dev": true,
      "engines": {
        "node": ">=0.10"
      }
    },
    "node_modules/replace-ext": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz",
      "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==",
      "dev": true,
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/replace-homedir": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/replace-homedir/-/replace-homedir-1.0.0.tgz",
      "integrity": "sha1-6H9tUTuSjd6AgmDBK+f+xv9ueYw=",
      "dev": true,
      "dependencies": {
        "homedir-polyfill": "^1.0.1",
        "is-absolute": "^1.0.0",
        "remove-trailing-separator": "^1.1.0"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/replacestream": {
      "version": "4.0.3",
      "resolved": "https://registry.npmjs.org/replacestream/-/replacestream-4.0.3.tgz",
      "integrity": "sha512-AC0FiLS352pBBiZhd4VXB1Ab/lh0lEgpP+GGvZqbQh8a5cmXVoTe5EX/YeTFArnp4SRGTHh1qCHu9lGs1qG8sA==",
      "dev": true,
      "dependencies": {
        "escape-string-regexp": "^1.0.3",
        "object-assign": "^4.0.1",
        "readable-stream": "^2.0.2"
      }
    },
    "node_modules/require-directory": {
      "version": "2.1.1",
      "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
      "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/require-main-filename": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz",
      "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=",
      "dev": true
    },
    "node_modules/resolve": {
      "version": "1.22.0",
      "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz",
      "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==",
      "dev": true,
      "dependencies": {
        "is-core-module": "^2.8.1",
        "path-parse": "^1.0.7",
        "supports-preserve-symlinks-flag": "^1.0.0"
      },
      "bin": {
        "resolve": "bin/resolve"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/resolve-dir": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz",
      "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=",
      "dev": true,
      "dependencies": {
        "expand-tilde": "^2.0.0",
        "global-modules": "^1.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/resolve-options": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/resolve-options/-/resolve-options-1.1.0.tgz",
      "integrity": "sha1-MrueOcBtZzONyTeMDW1gdFZq0TE=",
      "dev": true,
      "dependencies": {
        "value-or-function": "^3.0.0"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/resolve-url": {
      "version": "0.2.1",
      "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz",
      "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=",
      "deprecated": "https://github.com/lydell/resolve-url#deprecated",
      "dev": true
    },
    "node_modules/ret": {
      "version": "0.1.15",
      "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz",
      "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==",
      "dev": true,
      "engines": {
        "node": ">=0.12"
      }
    },
    "node_modules/ripemd160": {
      "version": "2.0.2",
      "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz",
      "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==",
      "dev": true,
      "dependencies": {
        "hash-base": "^3.0.0",
        "inherits": "^2.0.1"
      }
    },
    "node_modules/safe-buffer": {
      "version": "5.2.1",
      "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
      "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
      "dev": true,
      "funding": [
        {
          "type": "github",
          "url": "https://github.com/sponsors/feross"
        },
        {
          "type": "patreon",
          "url": "https://www.patreon.com/feross"
        },
        {
          "type": "consulting",
          "url": "https://feross.org/support"
        }
      ]
    },
    "node_modules/safe-regex": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
      "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=",
      "dev": true,
      "dependencies": {
        "ret": "~0.1.10"
      }
    },
    "node_modules/safer-buffer": {
      "version": "2.1.2",
      "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
      "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
      "dev": true
    },
    "node_modules/semver": {
      "version": "6.3.0",
      "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
      "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
      "dev": true,
      "bin": {
        "semver": "bin/semver.js"
      }
    },
    "node_modules/semver-greatest-satisfied-range": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz",
      "integrity": "sha1-E+jCZYq5aRywzXEJMkAoDTb3els=",
      "dev": true,
      "dependencies": {
        "sver-compat": "^1.5.0"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/set-blocking": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
      "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
      "dev": true
    },
    "node_modules/set-value": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz",
      "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==",
      "dev": true,
      "dependencies": {
        "extend-shallow": "^2.0.1",
        "is-extendable": "^0.1.1",
        "is-plain-object": "^2.0.3",
        "split-string": "^3.0.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/sha.js": {
      "version": "2.4.11",
      "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz",
      "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==",
      "dev": true,
      "dependencies": {
        "inherits": "^2.0.1",
        "safe-buffer": "^5.0.1"
      },
      "bin": {
        "sha.js": "bin.js"
      }
    },
    "node_modules/shallow-clone": {
      "version": "3.0.1",
      "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz",
      "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==",
      "dev": true,
      "dependencies": {
        "kind-of": "^6.0.2"
      },
      "engines": {
        "node": ">=8"
      }
    },
    "node_modules/shasum": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz",
      "integrity": "sha1-5wEjENj0F/TetXEhUOVni4euVl8=",
      "dev": true,
      "dependencies": {
        "json-stable-stringify": "~0.0.0",
        "sha.js": "~2.4.4"
      }
    },
    "node_modules/shasum-object": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/shasum-object/-/shasum-object-1.0.0.tgz",
      "integrity": "sha512-Iqo5rp/3xVi6M4YheapzZhhGPVs0yZwHj7wvwQ1B9z8H6zk+FEnI7y3Teq7qwnekfEhu8WmG2z0z4iWZaxLWVg==",
      "dev": true,
      "dependencies": {
        "fast-safe-stringify": "^2.0.7"
      }
    },
    "node_modules/shell-quote": {
      "version": "1.7.3",
      "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.3.tgz",
      "integrity": "sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==",
      "dev": true
    },
    "node_modules/simple-concat": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz",
      "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==",
      "dev": true,
      "funding": [
        {
          "type": "github",
          "url": "https://github.com/sponsors/feross"
        },
        {
          "type": "patreon",
          "url": "https://www.patreon.com/feross"
        },
        {
          "type": "consulting",
          "url": "https://feross.org/support"
        }
      ]
    },
    "node_modules/snapdragon": {
      "version": "0.8.2",
      "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
      "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==",
      "dev": true,
      "dependencies": {
        "base": "^0.11.1",
        "debug": "^2.2.0",
        "define-property": "^0.2.5",
        "extend-shallow": "^2.0.1",
        "map-cache": "^0.2.2",
        "source-map": "^0.5.6",
        "source-map-resolve": "^0.5.0",
        "use": "^3.1.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/snapdragon-node": {
      "version": "2.1.1",
      "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz",
      "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==",
      "dev": true,
      "dependencies": {
        "define-property": "^1.0.0",
        "isobject": "^3.0.0",
        "snapdragon-util": "^3.0.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/snapdragon-node/node_modules/define-property": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
      "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
      "dev": true,
      "dependencies": {
        "is-descriptor": "^1.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/snapdragon-util": {
      "version": "3.0.1",
      "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz",
      "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==",
      "dev": true,
      "dependencies": {
        "kind-of": "^3.2.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/snapdragon-util/node_modules/kind-of": {
      "version": "3.2.2",
      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
      "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
      "dev": true,
      "dependencies": {
        "is-buffer": "^1.1.5"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/snapdragon/node_modules/debug": {
      "version": "2.6.9",
      "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
      "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
      "dev": true,
      "dependencies": {
        "ms": "2.0.0"
      }
    },
    "node_modules/snapdragon/node_modules/define-property": {
      "version": "0.2.5",
      "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
      "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
      "dev": true,
      "dependencies": {
        "is-descriptor": "^0.1.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/snapdragon/node_modules/is-accessor-descriptor": {
      "version": "0.1.6",
      "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
      "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
      "dev": true,
      "dependencies": {
        "kind-of": "^3.0.2"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/snapdragon/node_modules/is-accessor-descriptor/node_modules/kind-of": {
      "version": "3.2.2",
      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
      "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
      "dev": true,
      "dependencies": {
        "is-buffer": "^1.1.5"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/snapdragon/node_modules/is-data-descriptor": {
      "version": "0.1.4",
      "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
      "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
      "dev": true,
      "dependencies": {
        "kind-of": "^3.0.2"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/snapdragon/node_modules/is-data-descriptor/node_modules/kind-of": {
      "version": "3.2.2",
      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
      "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
      "dev": true,
      "dependencies": {
        "is-buffer": "^1.1.5"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/snapdragon/node_modules/is-descriptor": {
      "version": "0.1.6",
      "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
      "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
      "dev": true,
      "dependencies": {
        "is-accessor-descriptor": "^0.1.6",
        "is-data-descriptor": "^0.1.4",
        "kind-of": "^5.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/snapdragon/node_modules/kind-of": {
      "version": "5.1.0",
      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
      "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/snapdragon/node_modules/ms": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
      "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
      "dev": true
    },
    "node_modules/source-map": {
      "version": "0.5.7",
      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
      "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/source-map-resolve": {
      "version": "0.5.3",
      "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz",
      "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==",
      "deprecated": "See https://github.com/lydell/source-map-resolve#deprecated",
      "dev": true,
      "dependencies": {
        "atob": "^2.1.2",
        "decode-uri-component": "^0.2.0",
        "resolve-url": "^0.2.1",
        "source-map-url": "^0.4.0",
        "urix": "^0.1.0"
      }
    },
    "node_modules/source-map-support": {
      "version": "0.5.21",
      "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",
      "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
      "dev": true,
      "dependencies": {
        "buffer-from": "^1.0.0",
        "source-map": "^0.6.0"
      }
    },
    "node_modules/source-map-support/node_modules/source-map": {
      "version": "0.6.1",
      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
      "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/source-map-url": {
      "version": "0.4.1",
      "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz",
      "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==",
      "deprecated": "See https://github.com/lydell/source-map-url#deprecated",
      "dev": true
    },
    "node_modules/sparkles": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz",
      "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==",
      "dev": true,
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/spdx-correct": {
      "version": "3.1.1",
      "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz",
      "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==",
      "dev": true,
      "dependencies": {
        "spdx-expression-parse": "^3.0.0",
        "spdx-license-ids": "^3.0.0"
      }
    },
    "node_modules/spdx-exceptions": {
      "version": "2.3.0",
      "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz",
      "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==",
      "dev": true
    },
    "node_modules/spdx-expression-parse": {
      "version": "3.0.1",
      "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz",
      "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==",
      "dev": true,
      "dependencies": {
        "spdx-exceptions": "^2.1.0",
        "spdx-license-ids": "^3.0.0"
      }
    },
    "node_modules/spdx-license-ids": {
      "version": "3.0.11",
      "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz",
      "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==",
      "dev": true
    },
    "node_modules/split-string": {
      "version": "3.1.0",
      "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz",
      "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==",
      "dev": true,
      "dependencies": {
        "extend-shallow": "^3.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/split-string/node_modules/extend-shallow": {
      "version": "3.0.2",
      "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
      "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
      "dev": true,
      "dependencies": {
        "assign-symbols": "^1.0.0",
        "is-extendable": "^1.0.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/split-string/node_modules/is-extendable": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
      "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
      "dev": true,
      "dependencies": {
        "is-plain-object": "^2.0.4"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/stack-trace": {
      "version": "0.0.10",
      "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz",
      "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=",
      "dev": true,
      "engines": {
        "node": "*"
      }
    },
    "node_modules/static-extend": {
      "version": "0.1.2",
      "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz",
      "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=",
      "dev": true,
      "dependencies": {
        "define-property": "^0.2.5",
        "object-copy": "^0.1.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/static-extend/node_modules/define-property": {
      "version": "0.2.5",
      "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
      "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
      "dev": true,
      "dependencies": {
        "is-descriptor": "^0.1.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/static-extend/node_modules/is-accessor-descriptor": {
      "version": "0.1.6",
      "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
      "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
      "dev": true,
      "dependencies": {
        "kind-of": "^3.0.2"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/static-extend/node_modules/is-accessor-descriptor/node_modules/kind-of": {
      "version": "3.2.2",
      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
      "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
      "dev": true,
      "dependencies": {
        "is-buffer": "^1.1.5"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/static-extend/node_modules/is-data-descriptor": {
      "version": "0.1.4",
      "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
      "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
      "dev": true,
      "dependencies": {
        "kind-of": "^3.0.2"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/static-extend/node_modules/is-data-descriptor/node_modules/kind-of": {
      "version": "3.2.2",
      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
      "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
      "dev": true,
      "dependencies": {
        "is-buffer": "^1.1.5"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/static-extend/node_modules/is-descriptor": {
      "version": "0.1.6",
      "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
      "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
      "dev": true,
      "dependencies": {
        "is-accessor-descriptor": "^0.1.6",
        "is-data-descriptor": "^0.1.4",
        "kind-of": "^5.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/static-extend/node_modules/kind-of": {
      "version": "5.1.0",
      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
      "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/stream-browserify": {
      "version": "2.0.2",
      "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz",
      "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==",
      "dev": true,
      "dependencies": {
        "inherits": "~2.0.1",
        "readable-stream": "^2.0.2"
      }
    },
    "node_modules/stream-combiner2": {
      "version": "1.1.1",
      "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz",
      "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=",
      "dev": true,
      "dependencies": {
        "duplexer2": "~0.1.0",
        "readable-stream": "^2.0.2"
      }
    },
    "node_modules/stream-exhaust": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/stream-exhaust/-/stream-exhaust-1.0.2.tgz",
      "integrity": "sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==",
      "dev": true
    },
    "node_modules/stream-http": {
      "version": "3.2.0",
      "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-3.2.0.tgz",
      "integrity": "sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A==",
      "dev": true,
      "dependencies": {
        "builtin-status-codes": "^3.0.0",
        "inherits": "^2.0.4",
        "readable-stream": "^3.6.0",
        "xtend": "^4.0.2"
      }
    },
    "node_modules/stream-http/node_modules/readable-stream": {
      "version": "3.6.0",
      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
      "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
      "dev": true,
      "dependencies": {
        "inherits": "^2.0.3",
        "string_decoder": "^1.1.1",
        "util-deprecate": "^1.0.1"
      },
      "engines": {
        "node": ">= 6"
      }
    },
    "node_modules/stream-shift": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz",
      "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==",
      "dev": true
    },
    "node_modules/stream-splicer": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.1.tgz",
      "integrity": "sha512-Xizh4/NPuYSyAXyT7g8IvdJ9HJpxIGL9PjyhtywCZvvP0OPIdqyrr4dMikeuvY8xahpdKEBlBTySe583totajg==",
      "dev": true,
      "dependencies": {
        "inherits": "^2.0.1",
        "readable-stream": "^2.0.2"
      }
    },
    "node_modules/string_decoder": {
      "version": "1.3.0",
      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
      "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
      "dev": true,
      "dependencies": {
        "safe-buffer": "~5.2.0"
      }
    },
    "node_modules/string-width": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
      "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
      "dev": true,
      "dependencies": {
        "code-point-at": "^1.0.0",
        "is-fullwidth-code-point": "^1.0.0",
        "strip-ansi": "^3.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/strip-ansi": {
      "version": "3.0.1",
      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
      "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
      "dev": true,
      "dependencies": {
        "ansi-regex": "^2.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/strip-bom": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz",
      "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=",
      "dev": true,
      "dependencies": {
        "is-utf8": "^0.2.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/subarg": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz",
      "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=",
      "dev": true,
      "dependencies": {
        "minimist": "^1.1.0"
      }
    },
    "node_modules/supports-color": {
      "version": "5.5.0",
      "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
      "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
      "dev": true,
      "dependencies": {
        "has-flag": "^3.0.0"
      },
      "engines": {
        "node": ">=4"
      }
    },
    "node_modules/supports-preserve-symlinks-flag": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
      "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
      "dev": true,
      "engines": {
        "node": ">= 0.4"
      },
      "funding": {
        "url": "https://github.com/sponsors/ljharb"
      }
    },
    "node_modules/sver-compat": {
      "version": "1.5.0",
      "resolved": "https://registry.npmjs.org/sver-compat/-/sver-compat-1.5.0.tgz",
      "integrity": "sha1-PPh9/rTQe0o/FIJ7wYaz/QxkXNg=",
      "dev": true,
      "dependencies": {
        "es6-iterator": "^2.0.1",
        "es6-symbol": "^3.1.1"
      }
    },
    "node_modules/syntax-error": {
      "version": "1.4.0",
      "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz",
      "integrity": "sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==",
      "dev": true,
      "dependencies": {
        "acorn-node": "^1.2.0"
      }
    },
    "node_modules/textextensions": {
      "version": "3.3.0",
      "resolved": "https://registry.npmjs.org/textextensions/-/textextensions-3.3.0.tgz",
      "integrity": "sha512-mk82dS8eRABNbeVJrEiN5/UMSCliINAuz8mkUwH4SwslkNP//gbEzlWNS5au0z5Dpx40SQxzqZevZkn+WYJ9Dw==",
      "dev": true,
      "engines": {
        "node": ">=8"
      },
      "funding": {
        "url": "https://bevry.me/fund"
      }
    },
    "node_modules/through": {
      "version": "2.3.8",
      "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
      "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=",
      "dev": true
    },
    "node_modules/through2": {
      "version": "2.0.5",
      "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz",
      "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==",
      "dev": true,
      "dependencies": {
        "readable-stream": "~2.3.6",
        "xtend": "~4.0.1"
      }
    },
    "node_modules/through2-filter": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz",
      "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==",
      "dev": true,
      "dependencies": {
        "through2": "~2.0.0",
        "xtend": "~4.0.0"
      }
    },
    "node_modules/time-stamp": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz",
      "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/timers-browserify": {
      "version": "1.4.2",
      "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz",
      "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=",
      "dev": true,
      "dependencies": {
        "process": "~0.11.0"
      },
      "engines": {
        "node": ">=0.6.0"
      }
    },
    "node_modules/to-absolute-glob": {
      "version": "2.0.2",
      "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz",
      "integrity": "sha1-GGX0PZ50sIItufFFt4z/fQ98hJs=",
      "dev": true,
      "dependencies": {
        "is-absolute": "^1.0.0",
        "is-negated-glob": "^1.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/to-fast-properties": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
      "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=",
      "dev": true,
      "engines": {
        "node": ">=4"
      }
    },
    "node_modules/to-object-path": {
      "version": "0.3.0",
      "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz",
      "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=",
      "dev": true,
      "dependencies": {
        "kind-of": "^3.0.2"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/to-object-path/node_modules/kind-of": {
      "version": "3.2.2",
      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
      "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
      "dev": true,
      "dependencies": {
        "is-buffer": "^1.1.5"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/to-regex": {
      "version": "3.0.2",
      "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz",
      "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==",
      "dev": true,
      "dependencies": {
        "define-property": "^2.0.2",
        "extend-shallow": "^3.0.2",
        "regex-not": "^1.0.2",
        "safe-regex": "^1.1.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/to-regex-range": {
      "version": "2.1.1",
      "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz",
      "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=",
      "dev": true,
      "dependencies": {
        "is-number": "^3.0.0",
        "repeat-string": "^1.6.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/to-regex/node_modules/extend-shallow": {
      "version": "3.0.2",
      "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
      "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
      "dev": true,
      "dependencies": {
        "assign-symbols": "^1.0.0",
        "is-extendable": "^1.0.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/to-regex/node_modules/is-extendable": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
      "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
      "dev": true,
      "dependencies": {
        "is-plain-object": "^2.0.4"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/to-through": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/to-through/-/to-through-2.0.0.tgz",
      "integrity": "sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY=",
      "dev": true,
      "dependencies": {
        "through2": "^2.0.3"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/tty-browserify": {
      "version": "0.0.1",
      "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz",
      "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==",
      "dev": true
    },
    "node_modules/type": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz",
      "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==",
      "dev": true
    },
    "node_modules/typedarray": {
      "version": "0.0.6",
      "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
      "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=",
      "dev": true
    },
    "node_modules/uglify-js": {
      "version": "3.15.4",
      "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.4.tgz",
      "integrity": "sha512-vMOPGDuvXecPs34V74qDKk4iJ/SN4vL3Ow/23ixafENYvtrNvtbcgUeugTcUGRGsOF/5fU8/NYSL5Hyb3l1OJA==",
      "dev": true,
      "bin": {
        "uglifyjs": "bin/uglifyjs"
      },
      "engines": {
        "node": ">=0.8.0"
      }
    },
    "node_modules/umd": {
      "version": "3.0.3",
      "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz",
      "integrity": "sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow==",
      "dev": true,
      "bin": {
        "umd": "bin/cli.js"
      }
    },
    "node_modules/unc-path-regex": {
      "version": "0.1.2",
      "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz",
      "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/undeclared-identifiers": {
      "version": "1.1.3",
      "resolved": "https://registry.npmjs.org/undeclared-identifiers/-/undeclared-identifiers-1.1.3.tgz",
      "integrity": "sha512-pJOW4nxjlmfwKApE4zvxLScM/njmwj/DiUBv7EabwE4O8kRUy+HIwxQtZLBPll/jx1LJyBcqNfB3/cpv9EZwOw==",
      "dev": true,
      "dependencies": {
        "acorn-node": "^1.3.0",
        "dash-ast": "^1.0.0",
        "get-assigned-identifiers": "^1.2.0",
        "simple-concat": "^1.0.0",
        "xtend": "^4.0.1"
      },
      "bin": {
        "undeclared-identifiers": "bin.js"
      }
    },
    "node_modules/undertaker": {
      "version": "1.3.0",
      "resolved": "https://registry.npmjs.org/undertaker/-/undertaker-1.3.0.tgz",
      "integrity": "sha512-/RXwi5m/Mu3H6IHQGww3GNt1PNXlbeCuclF2QYR14L/2CHPz3DFZkvB5hZ0N/QUkiXWCACML2jXViIQEQc2MLg==",
      "dev": true,
      "dependencies": {
        "arr-flatten": "^1.0.1",
        "arr-map": "^2.0.0",
        "bach": "^1.0.0",
        "collection-map": "^1.0.0",
        "es6-weak-map": "^2.0.1",
        "fast-levenshtein": "^1.0.0",
        "last-run": "^1.1.0",
        "object.defaults": "^1.0.0",
        "object.reduce": "^1.0.0",
        "undertaker-registry": "^1.0.0"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/undertaker-registry": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/undertaker-registry/-/undertaker-registry-1.0.1.tgz",
      "integrity": "sha1-XkvaMI5KiirlhPm5pDWaSZglzFA=",
      "dev": true,
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/unicode-canonical-property-names-ecmascript": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz",
      "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==",
      "dev": true,
      "engines": {
        "node": ">=4"
      }
    },
    "node_modules/unicode-match-property-ecmascript": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz",
      "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==",
      "dev": true,
      "dependencies": {
        "unicode-canonical-property-names-ecmascript": "^2.0.0",
        "unicode-property-aliases-ecmascript": "^2.0.0"
      },
      "engines": {
        "node": ">=4"
      }
    },
    "node_modules/unicode-match-property-value-ecmascript": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz",
      "integrity": "sha512-7Yhkc0Ye+t4PNYzOGKedDhXbYIBe1XEQYQxOPyhcXNMJ0WCABqqj6ckydd6pWRZTHV4GuCPKdBAUiMc60tsKVw==",
      "dev": true,
      "engines": {
        "node": ">=4"
      }
    },
    "node_modules/unicode-property-aliases-ecmascript": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz",
      "integrity": "sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ==",
      "dev": true,
      "engines": {
        "node": ">=4"
      }
    },
    "node_modules/union-value": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",
      "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==",
      "dev": true,
      "dependencies": {
        "arr-union": "^3.1.0",
        "get-value": "^2.0.6",
        "is-extendable": "^0.1.1",
        "set-value": "^2.0.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/unique-stream": {
      "version": "2.3.1",
      "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz",
      "integrity": "sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==",
      "dev": true,
      "dependencies": {
        "json-stable-stringify-without-jsonify": "^1.0.1",
        "through2-filter": "^3.0.0"
      }
    },
    "node_modules/unset-value": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz",
      "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=",
      "dev": true,
      "dependencies": {
        "has-value": "^0.3.1",
        "isobject": "^3.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/unset-value/node_modules/has-value": {
      "version": "0.3.1",
      "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz",
      "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=",
      "dev": true,
      "dependencies": {
        "get-value": "^2.0.3",
        "has-values": "^0.1.4",
        "isobject": "^2.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/unset-value/node_modules/has-value/node_modules/isobject": {
      "version": "2.1.0",
      "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz",
      "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=",
      "dev": true,
      "dependencies": {
        "isarray": "1.0.0"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/unset-value/node_modules/has-values": {
      "version": "0.1.4",
      "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz",
      "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/upath": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz",
      "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==",
      "dev": true,
      "engines": {
        "node": ">=4",
        "yarn": "*"
      }
    },
    "node_modules/urix": {
      "version": "0.1.0",
      "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz",
      "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=",
      "deprecated": "Please see https://github.com/lydell/urix#deprecated",
      "dev": true
    },
    "node_modules/url": {
      "version": "0.11.0",
      "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz",
      "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=",
      "dev": true,
      "dependencies": {
        "punycode": "1.3.2",
        "querystring": "0.2.0"
      }
    },
    "node_modules/url/node_modules/punycode": {
      "version": "1.3.2",
      "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz",
      "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=",
      "dev": true
    },
    "node_modules/use": {
      "version": "3.1.1",
      "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",
      "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==",
      "dev": true,
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/util": {
      "version": "0.10.4",
      "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz",
      "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==",
      "dev": true,
      "dependencies": {
        "inherits": "2.0.3"
      }
    },
    "node_modules/util-deprecate": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
      "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
      "dev": true
    },
    "node_modules/util/node_modules/inherits": {
      "version": "2.0.3",
      "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
      "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
      "dev": true
    },
    "node_modules/v8flags": {
      "version": "3.2.0",
      "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz",
      "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==",
      "dev": true,
      "dependencies": {
        "homedir-polyfill": "^1.0.1"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/validate-npm-package-license": {
      "version": "3.0.4",
      "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
      "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==",
      "dev": true,
      "dependencies": {
        "spdx-correct": "^3.0.0",
        "spdx-expression-parse": "^3.0.0"
      }
    },
    "node_modules/value-or-function": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz",
      "integrity": "sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM=",
      "dev": true,
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/vinyl": {
      "version": "2.2.1",
      "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz",
      "integrity": "sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==",
      "dev": true,
      "dependencies": {
        "clone": "^2.1.1",
        "clone-buffer": "^1.0.0",
        "clone-stats": "^1.0.0",
        "cloneable-readable": "^1.0.0",
        "remove-trailing-separator": "^1.0.1",
        "replace-ext": "^1.0.0"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/vinyl-fs": {
      "version": "3.0.3",
      "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz",
      "integrity": "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==",
      "dev": true,
      "dependencies": {
        "fs-mkdirp-stream": "^1.0.0",
        "glob-stream": "^6.1.0",
        "graceful-fs": "^4.0.0",
        "is-valid-glob": "^1.0.0",
        "lazystream": "^1.0.0",
        "lead": "^1.0.0",
        "object.assign": "^4.0.4",
        "pumpify": "^1.3.5",
        "readable-stream": "^2.3.3",
        "remove-bom-buffer": "^3.0.0",
        "remove-bom-stream": "^1.2.0",
        "resolve-options": "^1.1.0",
        "through2": "^2.0.0",
        "to-through": "^2.0.0",
        "value-or-function": "^3.0.0",
        "vinyl": "^2.0.0",
        "vinyl-sourcemap": "^1.1.0"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/vinyl-source-stream": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/vinyl-source-stream/-/vinyl-source-stream-2.0.0.tgz",
      "integrity": "sha1-84pa+53R6Ttl1VBGmsYYKsT1S44=",
      "dev": true,
      "dependencies": {
        "through2": "^2.0.3",
        "vinyl": "^2.1.0"
      }
    },
    "node_modules/vinyl-sourcemap": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz",
      "integrity": "sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY=",
      "dev": true,
      "dependencies": {
        "append-buffer": "^1.0.2",
        "convert-source-map": "^1.5.0",
        "graceful-fs": "^4.1.6",
        "normalize-path": "^2.1.1",
        "now-and-later": "^2.0.0",
        "remove-bom-buffer": "^3.0.0",
        "vinyl": "^2.0.0"
      },
      "engines": {
        "node": ">= 0.10"
      }
    },
    "node_modules/vinyl-sourcemap/node_modules/normalize-path": {
      "version": "2.1.1",
      "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz",
      "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=",
      "dev": true,
      "dependencies": {
        "remove-trailing-separator": "^1.0.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/vinyl-sourcemaps-apply": {
      "version": "0.2.1",
      "resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz",
      "integrity": "sha1-q2VJ1h0XLCsbh75cUI0jnI74dwU=",
      "dev": true,
      "dependencies": {
        "source-map": "^0.5.1"
      }
    },
    "node_modules/vm-browserify": {
      "version": "1.1.2",
      "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz",
      "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==",
      "dev": true
    },
    "node_modules/which": {
      "version": "1.3.1",
      "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
      "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
      "dev": true,
      "dependencies": {
        "isexe": "^2.0.0"
      },
      "bin": {
        "which": "bin/which"
      }
    },
    "node_modules/which-module": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz",
      "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=",
      "dev": true
    },
    "node_modules/wrap-ansi": {
      "version": "2.1.0",
      "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
      "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
      "dev": true,
      "dependencies": {
        "string-width": "^1.0.1",
        "strip-ansi": "^3.0.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/wrappy": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
      "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
      "dev": true
    },
    "node_modules/xtend": {
      "version": "4.0.2",
      "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
      "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
      "dev": true,
      "engines": {
        "node": ">=0.4"
      }
    },
    "node_modules/y18n": {
      "version": "3.2.2",
      "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz",
      "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==",
      "dev": true
    },
    "node_modules/yargs": {
      "version": "7.1.2",
      "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.2.tgz",
      "integrity": "sha512-ZEjj/dQYQy0Zx0lgLMLR8QuaqTihnxirir7EwUHp1Axq4e3+k8jXU5K0VLbNvedv1f4EWtBonDIZm0NUr+jCcA==",
      "dev": true,
      "dependencies": {
        "camelcase": "^3.0.0",
        "cliui": "^3.2.0",
        "decamelize": "^1.1.1",
        "get-caller-file": "^1.0.1",
        "os-locale": "^1.4.0",
        "read-pkg-up": "^1.0.1",
        "require-directory": "^2.1.1",
        "require-main-filename": "^1.0.1",
        "set-blocking": "^2.0.0",
        "string-width": "^1.0.2",
        "which-module": "^1.0.0",
        "y18n": "^3.2.1",
        "yargs-parser": "^5.0.1"
      }
    },
    "node_modules/yargs-parser": {
      "version": "21.0.1",
      "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz",
      "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==",
      "dev": true,
      "engines": {
        "node": ">=12"
      }
    },
    "node_modules/yargs/node_modules/yargs-parser": {
      "version": "5.0.1",
      "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.1.tgz",
      "integrity": "sha512-wpav5XYiddjXxirPoCTUPbqM0PXvJ9hiBMvuJgInvo4/lAOTZzUprArw17q2O1P2+GHhbBr18/iQwjL5Z9BqfA==",
      "dev": true,
      "dependencies": {
        "camelcase": "^3.0.0",
        "object.assign": "^4.1.0"
      }
    }
  },
  "dependencies": {
    "@algolia/cache-browser-local-storage": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.13.0.tgz",
      "integrity": "sha512-nj1vHRZauTqP/bluwkRIgEADEimqojJgoTRCel5f6q8WCa9Y8QeI4bpDQP28FoeKnDRYa3J5CauDlN466jqRhg==",
      "requires": {
        "@algolia/cache-common": "4.13.0"
      }
    },
    "@algolia/cache-common": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/cache-common/-/cache-common-4.13.0.tgz",
      "integrity": "sha512-f9mdZjskCui/dA/fA/5a+6hZ7xnHaaZI5tM/Rw9X8rRB39SUlF/+o3P47onZ33n/AwkpSbi5QOyhs16wHd55kA=="
    },
    "@algolia/cache-in-memory": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/cache-in-memory/-/cache-in-memory-4.13.0.tgz",
      "integrity": "sha512-hHdc+ahPiMM92CQMljmObE75laYzNFYLrNOu0Q3/eyvubZZRtY2SUsEEgyUEyzXruNdzrkcDxFYa7YpWBJYHAg==",
      "requires": {
        "@algolia/cache-common": "4.13.0"
      }
    },
    "@algolia/client-account": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/client-account/-/client-account-4.13.0.tgz",
      "integrity": "sha512-FzFqFt9b0g/LKszBDoEsW+dVBuUe1K3scp2Yf7q6pgHWM1WqyqUlARwVpLxqyc+LoyJkTxQftOKjyFUqddnPKA==",
      "requires": {
        "@algolia/client-common": "4.13.0",
        "@algolia/client-search": "4.13.0",
        "@algolia/transporter": "4.13.0"
      }
    },
    "@algolia/client-analytics": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-4.13.0.tgz",
      "integrity": "sha512-klmnoq2FIiiMHImkzOm+cGxqRLLu9CMHqFhbgSy9wtXZrqb8BBUIUE2VyBe7azzv1wKcxZV2RUyNOMpFqmnRZA==",
      "requires": {
        "@algolia/client-common": "4.13.0",
        "@algolia/client-search": "4.13.0",
        "@algolia/requester-common": "4.13.0",
        "@algolia/transporter": "4.13.0"
      }
    },
    "@algolia/client-common": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-4.13.0.tgz",
      "integrity": "sha512-GoXfTp0kVcbgfSXOjfrxx+slSipMqGO9WnNWgeMmru5Ra09MDjrcdunsiiuzF0wua6INbIpBQFTC2Mi5lUNqGA==",
      "requires": {
        "@algolia/requester-common": "4.13.0",
        "@algolia/transporter": "4.13.0"
      }
    },
    "@algolia/client-personalization": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-4.13.0.tgz",
      "integrity": "sha512-KneLz2WaehJmNfdr5yt2HQETpLaCYagRdWwIwkTqRVFCv4DxRQ2ChPVW9jeTj4YfAAhfzE6F8hn7wkQ/Jfj6ZA==",
      "requires": {
        "@algolia/client-common": "4.13.0",
        "@algolia/requester-common": "4.13.0",
        "@algolia/transporter": "4.13.0"
      }
    },
    "@algolia/client-search": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-4.13.0.tgz",
      "integrity": "sha512-blgCKYbZh1NgJWzeGf+caKE32mo3j54NprOf0LZVCubQb3Kx37tk1Hc8SDs9bCAE8hUvf3cazMPIg7wscSxspA==",
      "requires": {
        "@algolia/client-common": "4.13.0",
        "@algolia/requester-common": "4.13.0",
        "@algolia/transporter": "4.13.0"
      }
    },
    "@algolia/logger-common": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/logger-common/-/logger-common-4.13.0.tgz",
      "integrity": "sha512-8yqXk7rMtmQJ9wZiHOt/6d4/JDEg5VCk83gJ39I+X/pwUPzIsbKy9QiK4uJ3aJELKyoIiDT1hpYVt+5ia+94IA=="
    },
    "@algolia/logger-console": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/logger-console/-/logger-console-4.13.0.tgz",
      "integrity": "sha512-YepRg7w2/87L0vSXRfMND6VJ5d6699sFJBRWzZPOlek2p5fLxxK7O0VncYuc/IbVHEgeApvgXx0WgCEa38GVuQ==",
      "requires": {
        "@algolia/logger-common": "4.13.0"
      }
    },
    "@algolia/requester-browser-xhr": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.13.0.tgz",
      "integrity": "sha512-Dj+bnoWR5MotrnjblzGKZ2kCdQi2cK/VzPURPnE616NU/il7Ypy6U6DLGZ/ZYz+tnwPa0yypNf21uqt84fOgrg==",
      "requires": {
        "@algolia/requester-common": "4.13.0"
      }
    },
    "@algolia/requester-common": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/requester-common/-/requester-common-4.13.0.tgz",
      "integrity": "sha512-BRTDj53ecK+gn7ugukDWOOcBRul59C4NblCHqj4Zm5msd5UnHFjd/sGX+RLOEoFMhetILAnmg6wMrRrQVac9vw=="
    },
    "@algolia/requester-node-http": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-4.13.0.tgz",
      "integrity": "sha512-9b+3O4QFU4azLhGMrZAr/uZPydvzOR4aEZfSL8ZrpLZ7fbbqTO0S/5EVko+QIgglRAtVwxvf8UJ1wzTD2jvKxQ==",
      "requires": {
        "@algolia/requester-common": "4.13.0"
      }
    },
    "@algolia/transporter": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/@algolia/transporter/-/transporter-4.13.0.tgz",
      "integrity": "sha512-8tSQYE+ykQENAdeZdofvtkOr5uJ9VcQSWgRhQ9h01AehtBIPAczk/b2CLrMsw5yQZziLs5cZ3pJ3478yI+urhA==",
      "requires": {
        "@algolia/cache-common": "4.13.0",
        "@algolia/logger-common": "4.13.0",
        "@algolia/requester-common": "4.13.0"
      }
    },
    "@ampproject/remapping": {
      "version": "2.2.0",
      "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz",
      "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==",
      "dev": true,
      "requires": {
        "@jridgewell/gen-mapping": "^0.1.0",
        "@jridgewell/trace-mapping": "^0.3.9"
      }
    },
    "@babel/code-frame": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz",
      "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==",
      "dev": true,
      "requires": {
        "@babel/highlight": "^7.16.7"
      }
    },
    "@babel/compat-data": {
      "version": "7.17.10",
      "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.17.10.tgz",
      "integrity": "sha512-GZt/TCsG70Ms19gfZO1tM4CVnXsPgEPBCpJu+Qz3L0LUDsY5nZqFZglIoPC1kIYOtNBZlrnFT+klg12vFGZXrw==",
      "dev": true
    },
    "@babel/core": {
      "version": "7.17.10",
      "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.10.tgz",
      "integrity": "sha512-liKoppandF3ZcBnIYFjfSDHZLKdLHGJRkoWtG8zQyGJBQfIYobpnVGI5+pLBNtS6psFLDzyq8+h5HiVljW9PNA==",
      "dev": true,
      "requires": {
        "@ampproject/remapping": "^2.1.0",
        "@babel/code-frame": "^7.16.7",
        "@babel/generator": "^7.17.10",
        "@babel/helper-compilation-targets": "^7.17.10",
        "@babel/helper-module-transforms": "^7.17.7",
        "@babel/helpers": "^7.17.9",
        "@babel/parser": "^7.17.10",
        "@babel/template": "^7.16.7",
        "@babel/traverse": "^7.17.10",
        "@babel/types": "^7.17.10",
        "convert-source-map": "^1.7.0",
        "debug": "^4.1.0",
        "gensync": "^1.0.0-beta.2",
        "json5": "^2.2.1",
        "semver": "^6.3.0"
      }
    },
    "@babel/generator": {
      "version": "7.17.10",
      "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.10.tgz",
      "integrity": "sha512-46MJZZo9y3o4kmhBVc7zW7i8dtR1oIK/sdO5NcfcZRhTGYi+KKJRtHNgsU6c4VUcJmUNV/LQdebD/9Dlv4K+Tg==",
      "dev": true,
      "requires": {
        "@babel/types": "^7.17.10",
        "@jridgewell/gen-mapping": "^0.1.0",
        "jsesc": "^2.5.1"
      }
    },
    "@babel/helper-annotate-as-pure": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.7.tgz",
      "integrity": "sha512-s6t2w/IPQVTAET1HitoowRGXooX8mCgtuP5195wD/QJPV6wYjpujCGF7JuMODVX2ZAJOf1GT6DT9MHEZvLOFSw==",
      "dev": true,
      "requires": {
        "@babel/types": "^7.16.7"
      }
    },
    "@babel/helper-builder-binary-assignment-operator-visitor": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.16.7.tgz",
      "integrity": "sha512-C6FdbRaxYjwVu/geKW4ZeQ0Q31AftgRcdSnZ5/jsH6BzCJbtvXvhpfkbkThYSuutZA7nCXpPR6AD9zd1dprMkA==",
      "dev": true,
      "requires": {
        "@babel/helper-explode-assignable-expression": "^7.16.7",
        "@babel/types": "^7.16.7"
      }
    },
    "@babel/helper-compilation-targets": {
      "version": "7.17.10",
      "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.10.tgz",
      "integrity": "sha512-gh3RxjWbauw/dFiU/7whjd0qN9K6nPJMqe6+Er7rOavFh0CQUSwhAE3IcTho2rywPJFxej6TUUHDkWcYI6gGqQ==",
      "dev": true,
      "requires": {
        "@babel/compat-data": "^7.17.10",
        "@babel/helper-validator-option": "^7.16.7",
        "browserslist": "^4.20.2",
        "semver": "^6.3.0"
      }
    },
    "@babel/helper-create-class-features-plugin": {
      "version": "7.17.9",
      "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.17.9.tgz",
      "integrity": "sha512-kUjip3gruz6AJKOq5i3nC6CoCEEF/oHH3cp6tOZhB+IyyyPyW0g1Gfsxn3mkk6S08pIA2y8GQh609v9G/5sHVQ==",
      "dev": true,
      "requires": {
        "@babel/helper-annotate-as-pure": "^7.16.7",
        "@babel/helper-environment-visitor": "^7.16.7",
        "@babel/helper-function-name": "^7.17.9",
        "@babel/helper-member-expression-to-functions": "^7.17.7",
        "@babel/helper-optimise-call-expression": "^7.16.7",
        "@babel/helper-replace-supers": "^7.16.7",
        "@babel/helper-split-export-declaration": "^7.16.7"
      }
    },
    "@babel/helper-create-regexp-features-plugin": {
      "version": "7.17.0",
      "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.17.0.tgz",
      "integrity": "sha512-awO2So99wG6KnlE+TPs6rn83gCz5WlEePJDTnLEqbchMVrBeAujURVphRdigsk094VhvZehFoNOihSlcBjwsXA==",
      "dev": true,
      "requires": {
        "@babel/helper-annotate-as-pure": "^7.16.7",
        "regexpu-core": "^5.0.1"
      }
    },
    "@babel/helper-define-polyfill-provider": {
      "version": "0.3.1",
      "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.1.tgz",
      "integrity": "sha512-J9hGMpJQmtWmj46B3kBHmL38UhJGhYX7eqkcq+2gsstyYt341HmPeWspihX43yVRA0mS+8GGk2Gckc7bY/HCmA==",
      "dev": true,
      "requires": {
        "@babel/helper-compilation-targets": "^7.13.0",
        "@babel/helper-module-imports": "^7.12.13",
        "@babel/helper-plugin-utils": "^7.13.0",
        "@babel/traverse": "^7.13.0",
        "debug": "^4.1.1",
        "lodash.debounce": "^4.0.8",
        "resolve": "^1.14.2",
        "semver": "^6.1.2"
      }
    },
    "@babel/helper-environment-visitor": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz",
      "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==",
      "dev": true,
      "requires": {
        "@babel/types": "^7.16.7"
      }
    },
    "@babel/helper-explode-assignable-expression": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.16.7.tgz",
      "integrity": "sha512-KyUenhWMC8VrxzkGP0Jizjo4/Zx+1nNZhgocs+gLzyZyB8SHidhoq9KK/8Ato4anhwsivfkBLftky7gvzbZMtQ==",
      "dev": true,
      "requires": {
        "@babel/types": "^7.16.7"
      }
    },
    "@babel/helper-function-name": {
      "version": "7.17.9",
      "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz",
      "integrity": "sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg==",
      "dev": true,
      "requires": {
        "@babel/template": "^7.16.7",
        "@babel/types": "^7.17.0"
      }
    },
    "@babel/helper-hoist-variables": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz",
      "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==",
      "dev": true,
      "requires": {
        "@babel/types": "^7.16.7"
      }
    },
    "@babel/helper-member-expression-to-functions": {
      "version": "7.17.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.17.7.tgz",
      "integrity": "sha512-thxXgnQ8qQ11W2wVUObIqDL4p148VMxkt5T/qpN5k2fboRyzFGFmKsTGViquyM5QHKUy48OZoca8kw4ajaDPyw==",
      "dev": true,
      "requires": {
        "@babel/types": "^7.17.0"
      }
    },
    "@babel/helper-module-imports": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz",
      "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==",
      "dev": true,
      "requires": {
        "@babel/types": "^7.16.7"
      }
    },
    "@babel/helper-module-transforms": {
      "version": "7.17.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.17.7.tgz",
      "integrity": "sha512-VmZD99F3gNTYB7fJRDTi+u6l/zxY0BE6OIxPSU7a50s6ZUQkHwSDmV92FfM+oCG0pZRVojGYhkR8I0OGeCVREw==",
      "dev": true,
      "requires": {
        "@babel/helper-environment-visitor": "^7.16.7",
        "@babel/helper-module-imports": "^7.16.7",
        "@babel/helper-simple-access": "^7.17.7",
        "@babel/helper-split-export-declaration": "^7.16.7",
        "@babel/helper-validator-identifier": "^7.16.7",
        "@babel/template": "^7.16.7",
        "@babel/traverse": "^7.17.3",
        "@babel/types": "^7.17.0"
      }
    },
    "@babel/helper-optimise-call-expression": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.7.tgz",
      "integrity": "sha512-EtgBhg7rd/JcnpZFXpBy0ze1YRfdm7BnBX4uKMBd3ixa3RGAE002JZB66FJyNH7g0F38U05pXmA5P8cBh7z+1w==",
      "dev": true,
      "requires": {
        "@babel/types": "^7.16.7"
      }
    },
    "@babel/helper-plugin-utils": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz",
      "integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==",
      "dev": true
    },
    "@babel/helper-remap-async-to-generator": {
      "version": "7.16.8",
      "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.8.tgz",
      "integrity": "sha512-fm0gH7Flb8H51LqJHy3HJ3wnE1+qtYR2A99K06ahwrawLdOFsCEWjZOrYricXJHoPSudNKxrMBUPEIPxiIIvBw==",
      "dev": true,
      "requires": {
        "@babel/helper-annotate-as-pure": "^7.16.7",
        "@babel/helper-wrap-function": "^7.16.8",
        "@babel/types": "^7.16.8"
      }
    },
    "@babel/helper-replace-supers": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.16.7.tgz",
      "integrity": "sha512-y9vsWilTNaVnVh6xiJfABzsNpgDPKev9HnAgz6Gb1p6UUwf9NepdlsV7VXGCftJM+jqD5f7JIEubcpLjZj5dBw==",
      "dev": true,
      "requires": {
        "@babel/helper-environment-visitor": "^7.16.7",
        "@babel/helper-member-expression-to-functions": "^7.16.7",
        "@babel/helper-optimise-call-expression": "^7.16.7",
        "@babel/traverse": "^7.16.7",
        "@babel/types": "^7.16.7"
      }
    },
    "@babel/helper-simple-access": {
      "version": "7.17.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz",
      "integrity": "sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA==",
      "dev": true,
      "requires": {
        "@babel/types": "^7.17.0"
      }
    },
    "@babel/helper-skip-transparent-expression-wrappers": {
      "version": "7.16.0",
      "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.16.0.tgz",
      "integrity": "sha512-+il1gTy0oHwUsBQZyJvukbB4vPMdcYBrFHa0Uc4AizLxbq6BOYC51Rv4tWocX9BLBDLZ4kc6qUFpQ6HRgL+3zw==",
      "dev": true,
      "requires": {
        "@babel/types": "^7.16.0"
      }
    },
    "@babel/helper-split-export-declaration": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz",
      "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==",
      "dev": true,
      "requires": {
        "@babel/types": "^7.16.7"
      }
    },
    "@babel/helper-validator-identifier": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz",
      "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==",
      "dev": true
    },
    "@babel/helper-validator-option": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz",
      "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==",
      "dev": true
    },
    "@babel/helper-wrap-function": {
      "version": "7.16.8",
      "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.16.8.tgz",
      "integrity": "sha512-8RpyRVIAW1RcDDGTA+GpPAwV22wXCfKOoM9bet6TLkGIFTkRQSkH1nMQ5Yet4MpoXe1ZwHPVtNasc2w0uZMqnw==",
      "dev": true,
      "requires": {
        "@babel/helper-function-name": "^7.16.7",
        "@babel/template": "^7.16.7",
        "@babel/traverse": "^7.16.8",
        "@babel/types": "^7.16.8"
      }
    },
    "@babel/helpers": {
      "version": "7.17.9",
      "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.9.tgz",
      "integrity": "sha512-cPCt915ShDWUEzEp3+UNRktO2n6v49l5RSnG9M5pS24hA+2FAc5si+Pn1i4VVbQQ+jh+bIZhPFQOJOzbrOYY1Q==",
      "dev": true,
      "requires": {
        "@babel/template": "^7.16.7",
        "@babel/traverse": "^7.17.9",
        "@babel/types": "^7.17.0"
      }
    },
    "@babel/highlight": {
      "version": "7.17.9",
      "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.9.tgz",
      "integrity": "sha512-J9PfEKCbFIv2X5bjTMiZu6Vf341N05QIY+d6FvVKynkG1S7G0j3I0QoRtWIrXhZ+/Nlb5Q0MzqL7TokEJ5BNHg==",
      "dev": true,
      "requires": {
        "@babel/helper-validator-identifier": "^7.16.7",
        "chalk": "^2.0.0",
        "js-tokens": "^4.0.0"
      }
    },
    "@babel/parser": {
      "version": "7.17.10",
      "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.10.tgz",
      "integrity": "sha512-n2Q6i+fnJqzOaq2VkdXxy2TCPCWQZHiCo0XqmrCvDWcZQKRyZzYi4Z0yxlBuN0w+r2ZHmre+Q087DSrw3pbJDQ==",
      "dev": true
    },
    "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.16.7.tgz",
      "integrity": "sha512-anv/DObl7waiGEnC24O9zqL0pSuI9hljihqiDuFHC8d7/bjr/4RLGPWuc8rYOff/QPzbEPSkzG8wGG9aDuhHRg==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.16.7.tgz",
      "integrity": "sha512-di8vUHRdf+4aJ7ltXhaDbPoszdkh59AQtJM5soLsuHpQJdFQZOA4uGj0V2u/CZ8bJ/u8ULDL5yq6FO/bCXnKHw==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0",
        "@babel/plugin-proposal-optional-chaining": "^7.16.7"
      }
    },
    "@babel/plugin-proposal-async-generator-functions": {
      "version": "7.16.8",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.8.tgz",
      "integrity": "sha512-71YHIvMuiuqWJQkebWJtdhQTfd4Q4mF76q2IX37uZPkG9+olBxsX+rH1vkhFto4UeJZ9dPY2s+mDvhDm1u2BGQ==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/helper-remap-async-to-generator": "^7.16.8",
        "@babel/plugin-syntax-async-generators": "^7.8.4"
      }
    },
    "@babel/plugin-proposal-class-properties": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.16.7.tgz",
      "integrity": "sha512-IobU0Xme31ewjYOShSIqd/ZGM/r/cuOz2z0MDbNrhF5FW+ZVgi0f2lyeoj9KFPDOAqsYxmLWZte1WOwlvY9aww==",
      "dev": true,
      "requires": {
        "@babel/helper-create-class-features-plugin": "^7.16.7",
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/plugin-proposal-class-static-block": {
      "version": "7.17.6",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.17.6.tgz",
      "integrity": "sha512-X/tididvL2zbs7jZCeeRJ8167U/+Ac135AM6jCAx6gYXDUviZV5Ku9UDvWS2NCuWlFjIRXklYhwo6HhAC7ETnA==",
      "dev": true,
      "requires": {
        "@babel/helper-create-class-features-plugin": "^7.17.6",
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/plugin-syntax-class-static-block": "^7.14.5"
      }
    },
    "@babel/plugin-proposal-dynamic-import": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.16.7.tgz",
      "integrity": "sha512-I8SW9Ho3/8DRSdmDdH3gORdyUuYnk1m4cMxUAdu5oy4n3OfN8flDEH+d60iG7dUfi0KkYwSvoalHzzdRzpWHTg==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/plugin-syntax-dynamic-import": "^7.8.3"
      }
    },
    "@babel/plugin-proposal-export-namespace-from": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.16.7.tgz",
      "integrity": "sha512-ZxdtqDXLRGBL64ocZcs7ovt71L3jhC1RGSyR996svrCi3PYqHNkb3SwPJCs8RIzD86s+WPpt2S73+EHCGO+NUA==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/plugin-syntax-export-namespace-from": "^7.8.3"
      }
    },
    "@babel/plugin-proposal-json-strings": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.16.7.tgz",
      "integrity": "sha512-lNZ3EEggsGY78JavgbHsK9u5P3pQaW7k4axlgFLYkMd7UBsiNahCITShLjNQschPyjtO6dADrL24757IdhBrsQ==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/plugin-syntax-json-strings": "^7.8.3"
      }
    },
    "@babel/plugin-proposal-logical-assignment-operators": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.16.7.tgz",
      "integrity": "sha512-K3XzyZJGQCr00+EtYtrDjmwX7o7PLK6U9bi1nCwkQioRFVUv6dJoxbQjtWVtP+bCPy82bONBKG8NPyQ4+i6yjg==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4"
      }
    },
    "@babel/plugin-proposal-nullish-coalescing-operator": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.16.7.tgz",
      "integrity": "sha512-aUOrYU3EVtjf62jQrCj63pYZ7k6vns2h/DQvHPWGmsJRYzWXZ6/AsfgpiRy6XiuIDADhJzP2Q9MwSMKauBQ+UQ==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3"
      }
    },
    "@babel/plugin-proposal-numeric-separator": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.16.7.tgz",
      "integrity": "sha512-vQgPMknOIgiuVqbokToyXbkY/OmmjAzr/0lhSIbG/KmnzXPGwW/AdhdKpi+O4X/VkWiWjnkKOBiqJrTaC98VKw==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/plugin-syntax-numeric-separator": "^7.10.4"
      }
    },
    "@babel/plugin-proposal-object-rest-spread": {
      "version": "7.17.3",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.17.3.tgz",
      "integrity": "sha512-yuL5iQA/TbZn+RGAfxQXfi7CNLmKi1f8zInn4IgobuCWcAb7i+zj4TYzQ9l8cEzVyJ89PDGuqxK1xZpUDISesw==",
      "dev": true,
      "requires": {
        "@babel/compat-data": "^7.17.0",
        "@babel/helper-compilation-targets": "^7.16.7",
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/plugin-syntax-object-rest-spread": "^7.8.3",
        "@babel/plugin-transform-parameters": "^7.16.7"
      }
    },
    "@babel/plugin-proposal-optional-catch-binding": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.16.7.tgz",
      "integrity": "sha512-eMOH/L4OvWSZAE1VkHbr1vckLG1WUcHGJSLqqQwl2GaUqG6QjddvrOaTUMNYiv77H5IKPMZ9U9P7EaHwvAShfA==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/plugin-syntax-optional-catch-binding": "^7.8.3"
      }
    },
    "@babel/plugin-proposal-optional-chaining": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.16.7.tgz",
      "integrity": "sha512-eC3xy+ZrUcBtP7x+sq62Q/HYd674pPTb/77XZMb5wbDPGWIdUbSr4Agr052+zaUPSb+gGRnjxXfKFvx5iMJ+DA==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0",
        "@babel/plugin-syntax-optional-chaining": "^7.8.3"
      }
    },
    "@babel/plugin-proposal-private-methods": {
      "version": "7.16.11",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.16.11.tgz",
      "integrity": "sha512-F/2uAkPlXDr8+BHpZvo19w3hLFKge+k75XUprE6jaqKxjGkSYcK+4c+bup5PdW/7W/Rpjwql7FTVEDW+fRAQsw==",
      "dev": true,
      "requires": {
        "@babel/helper-create-class-features-plugin": "^7.16.10",
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/plugin-proposal-private-property-in-object": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.16.7.tgz",
      "integrity": "sha512-rMQkjcOFbm+ufe3bTZLyOfsOUOxyvLXZJCTARhJr+8UMSoZmqTe1K1BgkFcrW37rAchWg57yI69ORxiWvUINuQ==",
      "dev": true,
      "requires": {
        "@babel/helper-annotate-as-pure": "^7.16.7",
        "@babel/helper-create-class-features-plugin": "^7.16.7",
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/plugin-syntax-private-property-in-object": "^7.14.5"
      }
    },
    "@babel/plugin-proposal-unicode-property-regex": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.16.7.tgz",
      "integrity": "sha512-QRK0YI/40VLhNVGIjRNAAQkEHws0cswSdFFjpFyt943YmJIU1da9uW63Iu6NFV6CxTZW5eTDCrwZUstBWgp/Rg==",
      "dev": true,
      "requires": {
        "@babel/helper-create-regexp-features-plugin": "^7.16.7",
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/plugin-syntax-async-generators": {
      "version": "7.8.4",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz",
      "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.8.0"
      }
    },
    "@babel/plugin-syntax-class-properties": {
      "version": "7.12.13",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz",
      "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.12.13"
      }
    },
    "@babel/plugin-syntax-class-static-block": {
      "version": "7.14.5",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz",
      "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.14.5"
      }
    },
    "@babel/plugin-syntax-dynamic-import": {
      "version": "7.8.3",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz",
      "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.8.0"
      }
    },
    "@babel/plugin-syntax-export-namespace-from": {
      "version": "7.8.3",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz",
      "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.8.3"
      }
    },
    "@babel/plugin-syntax-json-strings": {
      "version": "7.8.3",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz",
      "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.8.0"
      }
    },
    "@babel/plugin-syntax-logical-assignment-operators": {
      "version": "7.10.4",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz",
      "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.10.4"
      }
    },
    "@babel/plugin-syntax-nullish-coalescing-operator": {
      "version": "7.8.3",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz",
      "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.8.0"
      }
    },
    "@babel/plugin-syntax-numeric-separator": {
      "version": "7.10.4",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz",
      "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.10.4"
      }
    },
    "@babel/plugin-syntax-object-rest-spread": {
      "version": "7.8.3",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz",
      "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.8.0"
      }
    },
    "@babel/plugin-syntax-optional-catch-binding": {
      "version": "7.8.3",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz",
      "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.8.0"
      }
    },
    "@babel/plugin-syntax-optional-chaining": {
      "version": "7.8.3",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz",
      "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.8.0"
      }
    },
    "@babel/plugin-syntax-private-property-in-object": {
      "version": "7.14.5",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz",
      "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.14.5"
      }
    },
    "@babel/plugin-syntax-top-level-await": {
      "version": "7.14.5",
      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz",
      "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.14.5"
      }
    },
    "@babel/plugin-transform-arrow-functions": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.16.7.tgz",
      "integrity": "sha512-9ffkFFMbvzTvv+7dTp/66xvZAWASuPD5Tl9LK3Z9vhOmANo6j94rik+5YMBt4CwHVMWLWpMsriIc2zsa3WW3xQ==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/plugin-transform-async-to-generator": {
      "version": "7.16.8",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.16.8.tgz",
      "integrity": "sha512-MtmUmTJQHCnyJVrScNzNlofQJ3dLFuobYn3mwOTKHnSCMtbNsqvF71GQmJfFjdrXSsAA7iysFmYWw4bXZ20hOg==",
      "dev": true,
      "requires": {
        "@babel/helper-module-imports": "^7.16.7",
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/helper-remap-async-to-generator": "^7.16.8"
      }
    },
    "@babel/plugin-transform-block-scoped-functions": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.16.7.tgz",
      "integrity": "sha512-JUuzlzmF40Z9cXyytcbZEZKckgrQzChbQJw/5PuEHYeqzCsvebDx0K0jWnIIVcmmDOAVctCgnYs0pMcrYj2zJg==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/plugin-transform-block-scoping": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.16.7.tgz",
      "integrity": "sha512-ObZev2nxVAYA4bhyusELdo9hb3H+A56bxH3FZMbEImZFiEDYVHXQSJ1hQKFlDnlt8G9bBrCZ5ZpURZUrV4G5qQ==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/plugin-transform-classes": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.16.7.tgz",
      "integrity": "sha512-WY7og38SFAGYRe64BrjKf8OrE6ulEHtr5jEYaZMwox9KebgqPi67Zqz8K53EKk1fFEJgm96r32rkKZ3qA2nCWQ==",
      "dev": true,
      "requires": {
        "@babel/helper-annotate-as-pure": "^7.16.7",
        "@babel/helper-environment-visitor": "^7.16.7",
        "@babel/helper-function-name": "^7.16.7",
        "@babel/helper-optimise-call-expression": "^7.16.7",
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/helper-replace-supers": "^7.16.7",
        "@babel/helper-split-export-declaration": "^7.16.7",
        "globals": "^11.1.0"
      }
    },
    "@babel/plugin-transform-computed-properties": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.16.7.tgz",
      "integrity": "sha512-gN72G9bcmenVILj//sv1zLNaPyYcOzUho2lIJBMh/iakJ9ygCo/hEF9cpGb61SCMEDxbbyBoVQxrt+bWKu5KGw==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/plugin-transform-destructuring": {
      "version": "7.17.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.17.7.tgz",
      "integrity": "sha512-XVh0r5yq9sLR4vZ6eVZe8FKfIcSgaTBxVBRSYokRj2qksf6QerYnTxz9/GTuKTH/n/HwLP7t6gtlybHetJ/6hQ==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/plugin-transform-dotall-regex": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.16.7.tgz",
      "integrity": "sha512-Lyttaao2SjZF6Pf4vk1dVKv8YypMpomAbygW+mU5cYP3S5cWTfCJjG8xV6CFdzGFlfWK81IjL9viiTvpb6G7gQ==",
      "dev": true,
      "requires": {
        "@babel/helper-create-regexp-features-plugin": "^7.16.7",
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/plugin-transform-duplicate-keys": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.16.7.tgz",
      "integrity": "sha512-03DvpbRfvWIXyK0/6QiR1KMTWeT6OcQ7tbhjrXyFS02kjuX/mu5Bvnh5SDSWHxyawit2g5aWhKwI86EE7GUnTw==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/plugin-transform-exponentiation-operator": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.16.7.tgz",
      "integrity": "sha512-8UYLSlyLgRixQvlYH3J2ekXFHDFLQutdy7FfFAMm3CPZ6q9wHCwnUyiXpQCe3gVVnQlHc5nsuiEVziteRNTXEA==",
      "dev": true,
      "requires": {
        "@babel/helper-builder-binary-assignment-operator-visitor": "^7.16.7",
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/plugin-transform-for-of": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.16.7.tgz",
      "integrity": "sha512-/QZm9W92Ptpw7sjI9Nx1mbcsWz33+l8kuMIQnDwgQBG5s3fAfQvkRjQ7NqXhtNcKOnPkdICmUHyCaWW06HCsqg==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/plugin-transform-function-name": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.16.7.tgz",
      "integrity": "sha512-SU/C68YVwTRxqWj5kgsbKINakGag0KTgq9f2iZEXdStoAbOzLHEBRYzImmA6yFo8YZhJVflvXmIHUO7GWHmxxA==",
      "dev": true,
      "requires": {
        "@babel/helper-compilation-targets": "^7.16.7",
        "@babel/helper-function-name": "^7.16.7",
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/plugin-transform-literals": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.16.7.tgz",
      "integrity": "sha512-6tH8RTpTWI0s2sV6uq3e/C9wPo4PTqqZps4uF0kzQ9/xPLFQtipynvmT1g/dOfEJ+0EQsHhkQ/zyRId8J2b8zQ==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/plugin-transform-member-expression-literals": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.16.7.tgz",
      "integrity": "sha512-mBruRMbktKQwbxaJof32LT9KLy2f3gH+27a5XSuXo6h7R3vqltl0PgZ80C8ZMKw98Bf8bqt6BEVi3svOh2PzMw==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/plugin-transform-modules-amd": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.16.7.tgz",
      "integrity": "sha512-KaaEtgBL7FKYwjJ/teH63oAmE3lP34N3kshz8mm4VMAw7U3PxjVwwUmxEFksbgsNUaO3wId9R2AVQYSEGRa2+g==",
      "dev": true,
      "requires": {
        "@babel/helper-module-transforms": "^7.16.7",
        "@babel/helper-plugin-utils": "^7.16.7",
        "babel-plugin-dynamic-import-node": "^2.3.3"
      }
    },
    "@babel/plugin-transform-modules-commonjs": {
      "version": "7.17.9",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.17.9.tgz",
      "integrity": "sha512-2TBFd/r2I6VlYn0YRTz2JdazS+FoUuQ2rIFHoAxtyP/0G3D82SBLaRq9rnUkpqlLg03Byfl/+M32mpxjO6KaPw==",
      "dev": true,
      "requires": {
        "@babel/helper-module-transforms": "^7.17.7",
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/helper-simple-access": "^7.17.7",
        "babel-plugin-dynamic-import-node": "^2.3.3"
      }
    },
    "@babel/plugin-transform-modules-systemjs": {
      "version": "7.17.8",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.17.8.tgz",
      "integrity": "sha512-39reIkMTUVagzgA5x88zDYXPCMT6lcaRKs1+S9K6NKBPErbgO/w/kP8GlNQTC87b412ZTlmNgr3k2JrWgHH+Bw==",
      "dev": true,
      "requires": {
        "@babel/helper-hoist-variables": "^7.16.7",
        "@babel/helper-module-transforms": "^7.17.7",
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/helper-validator-identifier": "^7.16.7",
        "babel-plugin-dynamic-import-node": "^2.3.3"
      }
    },
    "@babel/plugin-transform-modules-umd": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.16.7.tgz",
      "integrity": "sha512-EMh7uolsC8O4xhudF2F6wedbSHm1HHZ0C6aJ7K67zcDNidMzVcxWdGr+htW9n21klm+bOn+Rx4CBsAntZd3rEQ==",
      "dev": true,
      "requires": {
        "@babel/helper-module-transforms": "^7.16.7",
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/plugin-transform-named-capturing-groups-regex": {
      "version": "7.17.10",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.17.10.tgz",
      "integrity": "sha512-v54O6yLaJySCs6mGzaVOUw9T967GnH38T6CQSAtnzdNPwu84l2qAjssKzo/WSO8Yi7NF+7ekm5cVbF/5qiIgNA==",
      "dev": true,
      "requires": {
        "@babel/helper-create-regexp-features-plugin": "^7.17.0"
      }
    },
    "@babel/plugin-transform-new-target": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.16.7.tgz",
      "integrity": "sha512-xiLDzWNMfKoGOpc6t3U+etCE2yRnn3SM09BXqWPIZOBpL2gvVrBWUKnsJx0K/ADi5F5YC5f8APFfWrz25TdlGg==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/plugin-transform-object-super": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.16.7.tgz",
      "integrity": "sha512-14J1feiQVWaGvRxj2WjyMuXS2jsBkgB3MdSN5HuC2G5nRspa5RK9COcs82Pwy5BuGcjb+fYaUj94mYcOj7rCvw==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/helper-replace-supers": "^7.16.7"
      }
    },
    "@babel/plugin-transform-parameters": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.7.tgz",
      "integrity": "sha512-AT3MufQ7zZEhU2hwOA11axBnExW0Lszu4RL/tAlUJBuNoRak+wehQW8h6KcXOcgjY42fHtDxswuMhMjFEuv/aw==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/plugin-transform-property-literals": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.16.7.tgz",
      "integrity": "sha512-z4FGr9NMGdoIl1RqavCqGG+ZuYjfZ/hkCIeuH6Do7tXmSm0ls11nYVSJqFEUOSJbDab5wC6lRE/w6YjVcr6Hqw==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/plugin-transform-regenerator": {
      "version": "7.17.9",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.17.9.tgz",
      "integrity": "sha512-Lc2TfbxR1HOyn/c6b4Y/b6NHoTb67n/IoWLxTu4kC7h4KQnWlhCq2S8Tx0t2SVvv5Uu87Hs+6JEJ5kt2tYGylQ==",
      "dev": true,
      "requires": {
        "regenerator-transform": "^0.15.0"
      }
    },
    "@babel/plugin-transform-reserved-words": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.16.7.tgz",
      "integrity": "sha512-KQzzDnZ9hWQBjwi5lpY5v9shmm6IVG0U9pB18zvMu2i4H90xpT4gmqwPYsn8rObiadYe2M0gmgsiOIF5A/2rtg==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/plugin-transform-shorthand-properties": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.16.7.tgz",
      "integrity": "sha512-hah2+FEnoRoATdIb05IOXf+4GzXYTq75TVhIn1PewihbpyrNWUt2JbudKQOETWw6QpLe+AIUpJ5MVLYTQbeeUg==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/plugin-transform-spread": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.16.7.tgz",
      "integrity": "sha512-+pjJpgAngb53L0iaA5gU/1MLXJIfXcYepLgXB3esVRf4fqmj8f2cxM3/FKaHsZms08hFQJkFccEWuIpm429TXg==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0"
      }
    },
    "@babel/plugin-transform-sticky-regex": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.16.7.tgz",
      "integrity": "sha512-NJa0Bd/87QV5NZZzTuZG5BPJjLYadeSZ9fO6oOUoL4iQx+9EEuw/eEM92SrsT19Yc2jgB1u1hsjqDtH02c3Drw==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/plugin-transform-template-literals": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.16.7.tgz",
      "integrity": "sha512-VwbkDDUeenlIjmfNeDX/V0aWrQH2QiVyJtwymVQSzItFDTpxfyJh3EVaQiS0rIN/CqbLGr0VcGmuwyTdZtdIsA==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/plugin-transform-typeof-symbol": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.16.7.tgz",
      "integrity": "sha512-p2rOixCKRJzpg9JB4gjnG4gjWkWa89ZoYUnl9snJ1cWIcTH/hvxZqfO+WjG6T8DRBpctEol5jw1O5rA8gkCokQ==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/plugin-transform-unicode-escapes": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.16.7.tgz",
      "integrity": "sha512-TAV5IGahIz3yZ9/Hfv35TV2xEm+kaBDaZQCn2S/hG9/CZ0DktxJv9eKfPc7yYCvOYR4JGx1h8C+jcSOvgaaI/Q==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/plugin-transform-unicode-regex": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.16.7.tgz",
      "integrity": "sha512-oC5tYYKw56HO75KZVLQ+R/Nl3Hro9kf8iG0hXoaHP7tjAyCpvqBiSNe6vGrZni1Z6MggmUOC6A7VP7AVmw225Q==",
      "dev": true,
      "requires": {
        "@babel/helper-create-regexp-features-plugin": "^7.16.7",
        "@babel/helper-plugin-utils": "^7.16.7"
      }
    },
    "@babel/preset-env": {
      "version": "7.17.10",
      "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.17.10.tgz",
      "integrity": "sha512-YNgyBHZQpeoBSRBg0xixsZzfT58Ze1iZrajvv0lJc70qDDGuGfonEnMGfWeSY0mQ3JTuCWFbMkzFRVafOyJx4g==",
      "dev": true,
      "requires": {
        "@babel/compat-data": "^7.17.10",
        "@babel/helper-compilation-targets": "^7.17.10",
        "@babel/helper-plugin-utils": "^7.16.7",
        "@babel/helper-validator-option": "^7.16.7",
        "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.16.7",
        "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.16.7",
        "@babel/plugin-proposal-async-generator-functions": "^7.16.8",
        "@babel/plugin-proposal-class-properties": "^7.16.7",
        "@babel/plugin-proposal-class-static-block": "^7.17.6",
        "@babel/plugin-proposal-dynamic-import": "^7.16.7",
        "@babel/plugin-proposal-export-namespace-from": "^7.16.7",
        "@babel/plugin-proposal-json-strings": "^7.16.7",
        "@babel/plugin-proposal-logical-assignment-operators": "^7.16.7",
        "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7",
        "@babel/plugin-proposal-numeric-separator": "^7.16.7",
        "@babel/plugin-proposal-object-rest-spread": "^7.17.3",
        "@babel/plugin-proposal-optional-catch-binding": "^7.16.7",
        "@babel/plugin-proposal-optional-chaining": "^7.16.7",
        "@babel/plugin-proposal-private-methods": "^7.16.11",
        "@babel/plugin-proposal-private-property-in-object": "^7.16.7",
        "@babel/plugin-proposal-unicode-property-regex": "^7.16.7",
        "@babel/plugin-syntax-async-generators": "^7.8.4",
        "@babel/plugin-syntax-class-properties": "^7.12.13",
        "@babel/plugin-syntax-class-static-block": "^7.14.5",
        "@babel/plugin-syntax-dynamic-import": "^7.8.3",
        "@babel/plugin-syntax-export-namespace-from": "^7.8.3",
        "@babel/plugin-syntax-json-strings": "^7.8.3",
        "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4",
        "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3",
        "@babel/plugin-syntax-numeric-separator": "^7.10.4",
        "@babel/plugin-syntax-object-rest-spread": "^7.8.3",
        "@babel/plugin-syntax-optional-catch-binding": "^7.8.3",
        "@babel/plugin-syntax-optional-chaining": "^7.8.3",
        "@babel/plugin-syntax-private-property-in-object": "^7.14.5",
        "@babel/plugin-syntax-top-level-await": "^7.14.5",
        "@babel/plugin-transform-arrow-functions": "^7.16.7",
        "@babel/plugin-transform-async-to-generator": "^7.16.8",
        "@babel/plugin-transform-block-scoped-functions": "^7.16.7",
        "@babel/plugin-transform-block-scoping": "^7.16.7",
        "@babel/plugin-transform-classes": "^7.16.7",
        "@babel/plugin-transform-computed-properties": "^7.16.7",
        "@babel/plugin-transform-destructuring": "^7.17.7",
        "@babel/plugin-transform-dotall-regex": "^7.16.7",
        "@babel/plugin-transform-duplicate-keys": "^7.16.7",
        "@babel/plugin-transform-exponentiation-operator": "^7.16.7",
        "@babel/plugin-transform-for-of": "^7.16.7",
        "@babel/plugin-transform-function-name": "^7.16.7",
        "@babel/plugin-transform-literals": "^7.16.7",
        "@babel/plugin-transform-member-expression-literals": "^7.16.7",
        "@babel/plugin-transform-modules-amd": "^7.16.7",
        "@babel/plugin-transform-modules-commonjs": "^7.17.9",
        "@babel/plugin-transform-modules-systemjs": "^7.17.8",
        "@babel/plugin-transform-modules-umd": "^7.16.7",
        "@babel/plugin-transform-named-capturing-groups-regex": "^7.17.10",
        "@babel/plugin-transform-new-target": "^7.16.7",
        "@babel/plugin-transform-object-super": "^7.16.7",
        "@babel/plugin-transform-parameters": "^7.16.7",
        "@babel/plugin-transform-property-literals": "^7.16.7",
        "@babel/plugin-transform-regenerator": "^7.17.9",
        "@babel/plugin-transform-reserved-words": "^7.16.7",
        "@babel/plugin-transform-shorthand-properties": "^7.16.7",
        "@babel/plugin-transform-spread": "^7.16.7",
        "@babel/plugin-transform-sticky-regex": "^7.16.7",
        "@babel/plugin-transform-template-literals": "^7.16.7",
        "@babel/plugin-transform-typeof-symbol": "^7.16.7",
        "@babel/plugin-transform-unicode-escapes": "^7.16.7",
        "@babel/plugin-transform-unicode-regex": "^7.16.7",
        "@babel/preset-modules": "^0.1.5",
        "@babel/types": "^7.17.10",
        "babel-plugin-polyfill-corejs2": "^0.3.0",
        "babel-plugin-polyfill-corejs3": "^0.5.0",
        "babel-plugin-polyfill-regenerator": "^0.3.0",
        "core-js-compat": "^3.22.1",
        "semver": "^6.3.0"
      }
    },
    "@babel/preset-modules": {
      "version": "0.1.5",
      "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.5.tgz",
      "integrity": "sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==",
      "dev": true,
      "requires": {
        "@babel/helper-plugin-utils": "^7.0.0",
        "@babel/plugin-proposal-unicode-property-regex": "^7.4.4",
        "@babel/plugin-transform-dotall-regex": "^7.4.4",
        "@babel/types": "^7.4.4",
        "esutils": "^2.0.2"
      }
    },
    "@babel/register": {
      "version": "7.17.7",
      "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.17.7.tgz",
      "integrity": "sha512-fg56SwvXRifootQEDQAu1mKdjh5uthPzdO0N6t358FktfL4XjAVXuH58ULoiW8mesxiOgNIrxiImqEwv0+hRRA==",
      "dev": true,
      "requires": {
        "clone-deep": "^4.0.1",
        "find-cache-dir": "^2.0.0",
        "make-dir": "^2.1.0",
        "pirates": "^4.0.5",
        "source-map-support": "^0.5.16"
      }
    },
    "@babel/runtime": {
      "version": "7.17.9",
      "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.9.tgz",
      "integrity": "sha512-lSiBBvodq29uShpWGNbgFdKYNiFDo5/HIYsaCEY9ff4sb10x9jizo2+pRrSyF4jKZCXqgzuqBOQKbUm90gQwJg==",
      "dev": true,
      "requires": {
        "regenerator-runtime": "^0.13.4"
      }
    },
    "@babel/template": {
      "version": "7.16.7",
      "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz",
      "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==",
      "dev": true,
      "requires": {
        "@babel/code-frame": "^7.16.7",
        "@babel/parser": "^7.16.7",
        "@babel/types": "^7.16.7"
      }
    },
    "@babel/traverse": {
      "version": "7.17.10",
      "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.10.tgz",
      "integrity": "sha512-VmbrTHQteIdUUQNTb+zE12SHS/xQVIShmBPhlNP12hD5poF2pbITW1Z4172d03HegaQWhLffdkRJYtAzp0AGcw==",
      "dev": true,
      "requires": {
        "@babel/code-frame": "^7.16.7",
        "@babel/generator": "^7.17.10",
        "@babel/helper-environment-visitor": "^7.16.7",
        "@babel/helper-function-name": "^7.17.9",
        "@babel/helper-hoist-variables": "^7.16.7",
        "@babel/helper-split-export-declaration": "^7.16.7",
        "@babel/parser": "^7.17.10",
        "@babel/types": "^7.17.10",
        "debug": "^4.1.0",
        "globals": "^11.1.0"
      }
    },
    "@babel/types": {
      "version": "7.17.10",
      "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.10.tgz",
      "integrity": "sha512-9O26jG0mBYfGkUYCYZRnBwbVLd1UZOICEr2Em6InB6jVfsAv1GKgwXHmrSg+WFWDmeKTA6vyTZiN8tCSM5Oo3A==",
      "dev": true,
      "requires": {
        "@babel/helper-validator-identifier": "^7.16.7",
        "to-fast-properties": "^2.0.0"
      }
    },
    "@jridgewell/gen-mapping": {
      "version": "0.1.1",
      "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz",
      "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==",
      "dev": true,
      "requires": {
        "@jridgewell/set-array": "^1.0.0",
        "@jridgewell/sourcemap-codec": "^1.4.10"
      }
    },
    "@jridgewell/resolve-uri": {
      "version": "3.0.7",
      "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz",
      "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==",
      "dev": true
    },
    "@jridgewell/set-array": {
      "version": "1.1.1",
      "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.1.tgz",
      "integrity": "sha512-Ct5MqZkLGEXTVmQYbGtx9SVqD2fqwvdubdps5D3djjAkgkKwT918VNOz65pEHFaYTeWcukmJmH5SwsA9Tn2ObQ==",
      "dev": true
    },
    "@jridgewell/sourcemap-codec": {
      "version": "1.4.13",
      "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz",
      "integrity": "sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w==",
      "dev": true
    },
    "@jridgewell/trace-mapping": {
      "version": "0.3.10",
      "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.10.tgz",
      "integrity": "sha512-Q0YbBd6OTsXm8Y21+YUSDXupHnodNC2M4O18jtd3iwJ3+vMZNdKGols0a9G6JOK0dcJ3IdUUHoh908ZI6qhk8Q==",
      "dev": true,
      "requires": {
        "@jridgewell/resolve-uri": "^3.0.3",
        "@jridgewell/sourcemap-codec": "^1.4.10"
      }
    },
    "@types/expect": {
      "version": "1.20.4",
      "resolved": "https://registry.npmjs.org/@types/expect/-/expect-1.20.4.tgz",
      "integrity": "sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg==",
      "dev": true
    },
    "@types/node": {
      "version": "14.18.16",
      "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.16.tgz",
      "integrity": "sha512-X3bUMdK/VmvrWdoTkz+VCn6nwKwrKCFTHtqwBIaQJNx4RUIBBUFXM00bqPz/DsDd+Icjmzm6/tyYZzeGVqb6/Q==",
      "dev": true
    },
    "@types/vinyl": {
      "version": "2.0.6",
      "resolved": "https://registry.npmjs.org/@types/vinyl/-/vinyl-2.0.6.tgz",
      "integrity": "sha512-ayJ0iOCDNHnKpKTgBG6Q6JOnHTj9zFta+3j2b8Ejza0e4cvRyMn0ZoLEmbPrTHe5YYRlDYPvPWVdV4cTaRyH7g==",
      "dev": true,
      "requires": {
        "@types/expect": "^1.20.4",
        "@types/node": "*"
      }
    },
    "acorn": {
      "version": "7.4.1",
      "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
      "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
      "dev": true
    },
    "acorn-node": {
      "version": "1.8.2",
      "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.8.2.tgz",
      "integrity": "sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==",
      "dev": true,
      "requires": {
        "acorn": "^7.0.0",
        "acorn-walk": "^7.0.0",
        "xtend": "^4.0.2"
      }
    },
    "acorn-walk": {
      "version": "7.2.0",
      "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz",
      "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==",
      "dev": true
    },
    "algoliasearch": {
      "version": "4.13.0",
      "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-4.13.0.tgz",
      "integrity": "sha512-oHv4faI1Vl2s+YC0YquwkK/TsaJs79g2JFg5FDm2rKN12VItPTAeQ7hyJMHarOPPYuCnNC5kixbtcqvb21wchw==",
      "requires": {
        "@algolia/cache-browser-local-storage": "4.13.0",
        "@algolia/cache-common": "4.13.0",
        "@algolia/cache-in-memory": "4.13.0",
        "@algolia/client-account": "4.13.0",
        "@algolia/client-analytics": "4.13.0",
        "@algolia/client-common": "4.13.0",
        "@algolia/client-personalization": "4.13.0",
        "@algolia/client-search": "4.13.0",
        "@algolia/logger-common": "4.13.0",
        "@algolia/logger-console": "4.13.0",
        "@algolia/requester-browser-xhr": "4.13.0",
        "@algolia/requester-common": "4.13.0",
        "@algolia/requester-node-http": "4.13.0",
        "@algolia/transporter": "4.13.0"
      }
    },
    "ansi-colors": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz",
      "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==",
      "dev": true,
      "requires": {
        "ansi-wrap": "^0.1.0"
      }
    },
    "ansi-gray": {
      "version": "0.1.1",
      "resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz",
      "integrity": "sha1-KWLPVOyXksSFEKPetSRDaGHvclE=",
      "dev": true,
      "requires": {
        "ansi-wrap": "0.1.0"
      }
    },
    "ansi-regex": {
      "version": "2.1.1",
      "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
      "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
      "dev": true
    },
    "ansi-styles": {
      "version": "3.2.1",
      "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
      "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
      "dev": true,
      "requires": {
        "color-convert": "^1.9.0"
      }
    },
    "ansi-wrap": {
      "version": "0.1.0",
      "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz",
      "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=",
      "dev": true
    },
    "anymatch": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz",
      "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==",
      "dev": true,
      "requires": {
        "micromatch": "^3.1.4",
        "normalize-path": "^2.1.1"
      },
      "dependencies": {
        "normalize-path": {
          "version": "2.1.1",
          "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz",
          "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=",
          "dev": true,
          "requires": {
            "remove-trailing-separator": "^1.0.1"
          }
        }
      }
    },
    "append-buffer": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz",
      "integrity": "sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE=",
      "dev": true,
      "requires": {
        "buffer-equal": "^1.0.0"
      }
    },
    "archy": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz",
      "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=",
      "dev": true
    },
    "arr-diff": {
      "version": "4.0.0",
      "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz",
      "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=",
      "dev": true
    },
    "arr-filter": {
      "version": "1.1.2",
      "resolved": "https://registry.npmjs.org/arr-filter/-/arr-filter-1.1.2.tgz",
      "integrity": "sha1-Q/3d0JHo7xGqTEXZzcGOLf8XEe4=",
      "dev": true,
      "requires": {
        "make-iterator": "^1.0.0"
      }
    },
    "arr-flatten": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz",
      "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==",
      "dev": true
    },
    "arr-map": {
      "version": "2.0.2",
      "resolved": "https://registry.npmjs.org/arr-map/-/arr-map-2.0.2.tgz",
      "integrity": "sha1-Onc0X/wc814qkYJWAfnljy4kysQ=",
      "dev": true,
      "requires": {
        "make-iterator": "^1.0.0"
      }
    },
    "arr-union": {
      "version": "3.1.0",
      "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz",
      "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=",
      "dev": true
    },
    "array-each": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz",
      "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=",
      "dev": true
    },
    "array-initial": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/array-initial/-/array-initial-1.1.0.tgz",
      "integrity": "sha1-L6dLJnOTccOUe9enrcc74zSz15U=",
      "dev": true,
      "requires": {
        "array-slice": "^1.0.0",
        "is-number": "^4.0.0"
      },
      "dependencies": {
        "is-number": {
          "version": "4.0.0",
          "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz",
          "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==",
          "dev": true
        }
      }
    },
    "array-last": {
      "version": "1.3.0",
      "resolved": "https://registry.npmjs.org/array-last/-/array-last-1.3.0.tgz",
      "integrity": "sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg==",
      "dev": true,
      "requires": {
        "is-number": "^4.0.0"
      },
      "dependencies": {
        "is-number": {
          "version": "4.0.0",
          "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz",
          "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==",
          "dev": true
        }
      }
    },
    "array-slice": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz",
      "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==",
      "dev": true
    },
    "array-sort": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/array-sort/-/array-sort-1.0.0.tgz",
      "integrity": "sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg==",
      "dev": true,
      "requires": {
        "default-compare": "^1.0.0",
        "get-value": "^2.0.6",
        "kind-of": "^5.0.2"
      },
      "dependencies": {
        "kind-of": {
          "version": "5.1.0",
          "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
          "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
          "dev": true
        }
      }
    },
    "array-unique": {
      "version": "0.3.2",
      "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz",
      "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=",
      "dev": true
    },
    "asn1.js": {
      "version": "5.4.1",
      "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz",
      "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==",
      "dev": true,
      "requires": {
        "bn.js": "^4.0.0",
        "inherits": "^2.0.1",
        "minimalistic-assert": "^1.0.0",
        "safer-buffer": "^2.1.0"
      },
      "dependencies": {
        "bn.js": {
          "version": "4.12.0",
          "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
          "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==",
          "dev": true
        }
      }
    },
    "assert": {
      "version": "1.5.0",
      "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz",
      "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==",
      "dev": true,
      "requires": {
        "object-assign": "^4.1.1",
        "util": "0.10.3"
      },
      "dependencies": {
        "inherits": {
          "version": "2.0.1",
          "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",
          "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=",
          "dev": true
        },
        "util": {
          "version": "0.10.3",
          "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz",
          "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=",
          "dev": true,
          "requires": {
            "inherits": "2.0.1"
          }
        }
      }
    },
    "assign-symbols": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz",
      "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=",
      "dev": true
    },
    "async-done": {
      "version": "1.3.2",
      "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz",
      "integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==",
      "dev": true,
      "requires": {
        "end-of-stream": "^1.1.0",
        "once": "^1.3.2",
        "process-nextick-args": "^2.0.0",
        "stream-exhaust": "^1.0.1"
      }
    },
    "async-each": {
      "version": "1.0.3",
      "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz",
      "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==",
      "dev": true
    },
    "async-settle": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/async-settle/-/async-settle-1.0.0.tgz",
      "integrity": "sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs=",
      "dev": true,
      "requires": {
        "async-done": "^1.2.2"
      }
    },
    "atob": {
      "version": "2.1.2",
      "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz",
      "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==",
      "dev": true
    },
    "babel-plugin-dynamic-import-node": {
      "version": "2.3.3",
      "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz",
      "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==",
      "dev": true,
      "requires": {
        "object.assign": "^4.1.0"
      }
    },
    "babel-plugin-polyfill-corejs2": {
      "version": "0.3.1",
      "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.1.tgz",
      "integrity": "sha512-v7/T6EQcNfVLfcN2X8Lulb7DjprieyLWJK/zOWH5DUYcAgex9sP3h25Q+DLsX9TloXe3y1O8l2q2Jv9q8UVB9w==",
      "dev": true,
      "requires": {
        "@babel/compat-data": "^7.13.11",
        "@babel/helper-define-polyfill-provider": "^0.3.1",
        "semver": "^6.1.1"
      }
    },
    "babel-plugin-polyfill-corejs3": {
      "version": "0.5.2",
      "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.5.2.tgz",
      "integrity": "sha512-G3uJih0XWiID451fpeFaYGVuxHEjzKTHtc9uGFEjR6hHrvNzeS/PX+LLLcetJcytsB5m4j+K3o/EpXJNb/5IEQ==",
      "dev": true,
      "requires": {
        "@babel/helper-define-polyfill-provider": "^0.3.1",
        "core-js-compat": "^3.21.0"
      }
    },
    "babel-plugin-polyfill-regenerator": {
      "version": "0.3.1",
      "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.3.1.tgz",
      "integrity": "sha512-Y2B06tvgHYt1x0yz17jGkGeeMr5FeKUu+ASJ+N6nB5lQ8Dapfg42i0OVrf8PNGJ3zKL4A23snMi1IRwrqqND7A==",
      "dev": true,
      "requires": {
        "@babel/helper-define-polyfill-provider": "^0.3.1"
      }
    },
    "babelify": {
      "version": "10.0.0",
      "resolved": "https://registry.npmjs.org/babelify/-/babelify-10.0.0.tgz",
      "integrity": "sha512-X40FaxyH7t3X+JFAKvb1H9wooWKLRCi8pg3m8poqtdZaIng+bjzp9RvKQCvRjF9isHiPkXspbbXT/zwXLtwgwg==",
      "dev": true,
      "requires": {}
    },
    "bach": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/bach/-/bach-1.2.0.tgz",
      "integrity": "sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA=",
      "dev": true,
      "requires": {
        "arr-filter": "^1.1.1",
        "arr-flatten": "^1.0.1",
        "arr-map": "^2.0.0",
        "array-each": "^1.0.0",
        "array-initial": "^1.0.0",
        "array-last": "^1.1.1",
        "async-done": "^1.2.2",
        "async-settle": "^1.0.0",
        "now-and-later": "^2.0.0"
      }
    },
    "balanced-match": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
      "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
      "dev": true
    },
    "base": {
      "version": "0.11.2",
      "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz",
      "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==",
      "dev": true,
      "requires": {
        "cache-base": "^1.0.1",
        "class-utils": "^0.3.5",
        "component-emitter": "^1.2.1",
        "define-property": "^1.0.0",
        "isobject": "^3.0.1",
        "mixin-deep": "^1.2.0",
        "pascalcase": "^0.1.1"
      },
      "dependencies": {
        "define-property": {
          "version": "1.0.0",
          "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
          "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
          "dev": true,
          "requires": {
            "is-descriptor": "^1.0.0"
          }
        }
      }
    },
    "base64-js": {
      "version": "1.5.1",
      "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
      "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
      "dev": true
    },
    "binary-extensions": {
      "version": "1.13.1",
      "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz",
      "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==",
      "dev": true
    },
    "binaryextensions": {
      "version": "2.3.0",
      "resolved": "https://registry.npmjs.org/binaryextensions/-/binaryextensions-2.3.0.tgz",
      "integrity": "sha512-nAihlQsYGyc5Bwq6+EsubvANYGExeJKHDO3RjnvwU042fawQTQfM3Kxn7IHUXQOz4bzfwsGYYHGSvXyW4zOGLg==",
      "dev": true
    },
    "bindings": {
      "version": "1.5.0",
      "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
      "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
      "dev": true,
      "optional": true,
      "requires": {
        "file-uri-to-path": "1.0.0"
      }
    },
    "bn.js": {
      "version": "5.2.0",
      "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz",
      "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==",
      "dev": true
    },
    "brace-expansion": {
      "version": "1.1.11",
      "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
      "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
      "dev": true,
      "requires": {
        "balanced-match": "^1.0.0",
        "concat-map": "0.0.1"
      }
    },
    "braces": {
      "version": "2.3.2",
      "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz",
      "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==",
      "dev": true,
      "requires": {
        "arr-flatten": "^1.1.0",
        "array-unique": "^0.3.2",
        "extend-shallow": "^2.0.1",
        "fill-range": "^4.0.0",
        "isobject": "^3.0.1",
        "repeat-element": "^1.1.2",
        "snapdragon": "^0.8.1",
        "snapdragon-node": "^2.0.1",
        "split-string": "^3.0.2",
        "to-regex": "^3.0.1"
      }
    },
    "brorand": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz",
      "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=",
      "dev": true
    },
    "browser-pack": {
      "version": "6.1.0",
      "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.1.0.tgz",
      "integrity": "sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==",
      "dev": true,
      "requires": {
        "combine-source-map": "~0.8.0",
        "defined": "^1.0.0",
        "JSONStream": "^1.0.3",
        "safe-buffer": "^5.1.1",
        "through2": "^2.0.0",
        "umd": "^3.0.0"
      }
    },
    "browser-resolve": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-2.0.0.tgz",
      "integrity": "sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ==",
      "dev": true,
      "requires": {
        "resolve": "^1.17.0"
      }
    },
    "browserify": {
      "version": "16.5.2",
      "resolved": "https://registry.npmjs.org/browserify/-/browserify-16.5.2.tgz",
      "integrity": "sha512-TkOR1cQGdmXU9zW4YukWzWVSJwrxmNdADFbqbE3HFgQWe5wqZmOawqZ7J/8MPCwk/W8yY7Y0h+7mOtcZxLP23g==",
      "dev": true,
      "requires": {
        "assert": "^1.4.0",
        "browser-pack": "^6.0.1",
        "browser-resolve": "^2.0.0",
        "browserify-zlib": "~0.2.0",
        "buffer": "~5.2.1",
        "cached-path-relative": "^1.0.0",
        "concat-stream": "^1.6.0",
        "console-browserify": "^1.1.0",
        "constants-browserify": "~1.0.0",
        "crypto-browserify": "^3.0.0",
        "defined": "^1.0.0",
        "deps-sort": "^2.0.0",
        "domain-browser": "^1.2.0",
        "duplexer2": "~0.1.2",
        "events": "^2.0.0",
        "glob": "^7.1.0",
        "has": "^1.0.0",
        "htmlescape": "^1.1.0",
        "https-browserify": "^1.0.0",
        "inherits": "~2.0.1",
        "insert-module-globals": "^7.0.0",
        "JSONStream": "^1.0.3",
        "labeled-stream-splicer": "^2.0.0",
        "mkdirp-classic": "^0.5.2",
        "module-deps": "^6.2.3",
        "os-browserify": "~0.3.0",
        "parents": "^1.0.1",
        "path-browserify": "~0.0.0",
        "process": "~0.11.0",
        "punycode": "^1.3.2",
        "querystring-es3": "~0.2.0",
        "read-only-stream": "^2.0.0",
        "readable-stream": "^2.0.2",
        "resolve": "^1.1.4",
        "shasum": "^1.0.0",
        "shell-quote": "^1.6.1",
        "stream-browserify": "^2.0.0",
        "stream-http": "^3.0.0",
        "string_decoder": "^1.1.1",
        "subarg": "^1.0.0",
        "syntax-error": "^1.1.1",
        "through2": "^2.0.0",
        "timers-browserify": "^1.0.1",
        "tty-browserify": "0.0.1",
        "url": "~0.11.0",
        "util": "~0.10.1",
        "vm-browserify": "^1.0.0",
        "xtend": "^4.0.0"
      }
    },
    "browserify-aes": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
      "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==",
      "dev": true,
      "requires": {
        "buffer-xor": "^1.0.3",
        "cipher-base": "^1.0.0",
        "create-hash": "^1.1.0",
        "evp_bytestokey": "^1.0.3",
        "inherits": "^2.0.1",
        "safe-buffer": "^5.0.1"
      }
    },
    "browserify-cipher": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz",
      "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==",
      "dev": true,
      "requires": {
        "browserify-aes": "^1.0.4",
        "browserify-des": "^1.0.0",
        "evp_bytestokey": "^1.0.0"
      }
    },
    "browserify-des": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz",
      "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==",
      "dev": true,
      "requires": {
        "cipher-base": "^1.0.1",
        "des.js": "^1.0.0",
        "inherits": "^2.0.1",
        "safe-buffer": "^5.1.2"
      }
    },
    "browserify-rsa": {
      "version": "4.1.0",
      "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz",
      "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==",
      "dev": true,
      "requires": {
        "bn.js": "^5.0.0",
        "randombytes": "^2.0.1"
      }
    },
    "browserify-sign": {
      "version": "4.2.1",
      "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz",
      "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==",
      "dev": true,
      "requires": {
        "bn.js": "^5.1.1",
        "browserify-rsa": "^4.0.1",
        "create-hash": "^1.2.0",
        "create-hmac": "^1.1.7",
        "elliptic": "^6.5.3",
        "inherits": "^2.0.4",
        "parse-asn1": "^5.1.5",
        "readable-stream": "^3.6.0",
        "safe-buffer": "^5.2.0"
      },
      "dependencies": {
        "readable-stream": {
          "version": "3.6.0",
          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
          "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
          "dev": true,
          "requires": {
            "inherits": "^2.0.3",
            "string_decoder": "^1.1.1",
            "util-deprecate": "^1.0.1"
          }
        }
      }
    },
    "browserify-zlib": {
      "version": "0.2.0",
      "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz",
      "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==",
      "dev": true,
      "requires": {
        "pako": "~1.0.5"
      }
    },
    "browserslist": {
      "version": "4.20.3",
      "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.3.tgz",
      "integrity": "sha512-NBhymBQl1zM0Y5dQT/O+xiLP9/rzOIQdKM/eMJBAq7yBgaB6krIYLGejrwVYnSHZdqjscB1SPuAjHwxjvN6Wdg==",
      "dev": true,
      "requires": {
        "caniuse-lite": "^1.0.30001332",
        "electron-to-chromium": "^1.4.118",
        "escalade": "^3.1.1",
        "node-releases": "^2.0.3",
        "picocolors": "^1.0.0"
      }
    },
    "buffer": {
      "version": "5.2.1",
      "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz",
      "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==",
      "dev": true,
      "requires": {
        "base64-js": "^1.0.2",
        "ieee754": "^1.1.4"
      }
    },
    "buffer-equal": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz",
      "integrity": "sha1-WWFrSYME1Var1GaWayLu2j7KX74=",
      "dev": true
    },
    "buffer-from": {
      "version": "1.1.2",
      "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
      "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
      "dev": true
    },
    "buffer-xor": {
      "version": "1.0.3",
      "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz",
      "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=",
      "dev": true
    },
    "builtin-status-codes": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz",
      "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=",
      "dev": true
    },
    "cache-base": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz",
      "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==",
      "dev": true,
      "requires": {
        "collection-visit": "^1.0.0",
        "component-emitter": "^1.2.1",
        "get-value": "^2.0.6",
        "has-value": "^1.0.0",
        "isobject": "^3.0.1",
        "set-value": "^2.0.0",
        "to-object-path": "^0.3.0",
        "union-value": "^1.0.0",
        "unset-value": "^1.0.0"
      }
    },
    "cached-path-relative": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.1.0.tgz",
      "integrity": "sha512-WF0LihfemtesFcJgO7xfOoOcnWzY/QHR4qeDqV44jPU3HTI54+LnfXK3SA27AVVGCdZFgjjFFaqUA9Jx7dMJZA==",
      "dev": true
    },
    "call-bind": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
      "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
      "dev": true,
      "requires": {
        "function-bind": "^1.1.1",
        "get-intrinsic": "^1.0.2"
      }
    },
    "camelcase": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz",
      "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=",
      "dev": true
    },
    "caniuse-lite": {
      "version": "1.0.30001339",
      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001339.tgz",
      "integrity": "sha512-Es8PiVqCe+uXdms0Gu5xP5PF2bxLR7OBp3wUzUnuO7OHzhOfCyg3hdiGWVPVxhiuniOzng+hTc1u3fEQ0TlkSQ==",
      "dev": true
    },
    "chalk": {
      "version": "2.4.2",
      "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
      "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
      "dev": true,
      "requires": {
        "ansi-styles": "^3.2.1",
        "escape-string-regexp": "^1.0.5",
        "supports-color": "^5.3.0"
      }
    },
    "chart.js": {
      "version": "3.7.1",
      "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.7.1.tgz",
      "integrity": "sha512-8knRegQLFnPQAheZV8MjxIXc5gQEfDFD897BJgv/klO/vtIyFFmgMXrNfgrXpbTr/XbTturxRgxIXx/Y+ASJBA=="
    },
    "chokidar": {
      "version": "2.1.8",
      "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz",
      "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==",
      "dev": true,
      "requires": {
        "anymatch": "^2.0.0",
        "async-each": "^1.0.1",
        "braces": "^2.3.2",
        "fsevents": "^1.2.7",
        "glob-parent": "^3.1.0",
        "inherits": "^2.0.3",
        "is-binary-path": "^1.0.0",
        "is-glob": "^4.0.0",
        "normalize-path": "^3.0.0",
        "path-is-absolute": "^1.0.0",
        "readdirp": "^2.2.1",
        "upath": "^1.1.1"
      }
    },
    "cipher-base": {
      "version": "1.0.4",
      "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz",
      "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==",
      "dev": true,
      "requires": {
        "inherits": "^2.0.1",
        "safe-buffer": "^5.0.1"
      }
    },
    "class-utils": {
      "version": "0.3.6",
      "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz",
      "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==",
      "dev": true,
      "requires": {
        "arr-union": "^3.1.0",
        "define-property": "^0.2.5",
        "isobject": "^3.0.0",
        "static-extend": "^0.1.1"
      },
      "dependencies": {
        "define-property": {
          "version": "0.2.5",
          "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
          "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
          "dev": true,
          "requires": {
            "is-descriptor": "^0.1.0"
          }
        },
        "is-accessor-descriptor": {
          "version": "0.1.6",
          "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
          "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
          "dev": true,
          "requires": {
            "kind-of": "^3.0.2"
          },
          "dependencies": {
            "kind-of": {
              "version": "3.2.2",
              "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
              "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
              "dev": true,
              "requires": {
                "is-buffer": "^1.1.5"
              }
            }
          }
        },
        "is-data-descriptor": {
          "version": "0.1.4",
          "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
          "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
          "dev": true,
          "requires": {
            "kind-of": "^3.0.2"
          },
          "dependencies": {
            "kind-of": {
              "version": "3.2.2",
              "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
              "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
              "dev": true,
              "requires": {
                "is-buffer": "^1.1.5"
              }
            }
          }
        },
        "is-descriptor": {
          "version": "0.1.6",
          "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
          "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
          "dev": true,
          "requires": {
            "is-accessor-descriptor": "^0.1.6",
            "is-data-descriptor": "^0.1.4",
            "kind-of": "^5.0.0"
          }
        },
        "kind-of": {
          "version": "5.1.0",
          "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
          "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
          "dev": true
        }
      }
    },
    "clean-css": {
      "version": "4.2.3",
      "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.3.tgz",
      "integrity": "sha512-VcMWDN54ZN/DS+g58HYL5/n4Zrqe8vHJpGA8KdgUXFU4fuP/aHNw8eld9SyEIyabIMJX/0RaY/fplOo5hYLSFA==",
      "dev": true,
      "requires": {
        "source-map": "~0.6.0"
      },
      "dependencies": {
        "source-map": {
          "version": "0.6.1",
          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
          "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
          "dev": true
        }
      }
    },
    "cliui": {
      "version": "3.2.0",
      "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
      "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=",
      "dev": true,
      "requires": {
        "string-width": "^1.0.1",
        "strip-ansi": "^3.0.1",
        "wrap-ansi": "^2.0.0"
      }
    },
    "clone": {
      "version": "2.1.2",
      "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz",
      "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=",
      "dev": true
    },
    "clone-buffer": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz",
      "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=",
      "dev": true
    },
    "clone-deep": {
      "version": "4.0.1",
      "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz",
      "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==",
      "dev": true,
      "requires": {
        "is-plain-object": "^2.0.4",
        "kind-of": "^6.0.2",
        "shallow-clone": "^3.0.0"
      }
    },
    "clone-stats": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz",
      "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=",
      "dev": true
    },
    "cloneable-readable": {
      "version": "1.1.3",
      "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz",
      "integrity": "sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ==",
      "dev": true,
      "requires": {
        "inherits": "^2.0.1",
        "process-nextick-args": "^2.0.0",
        "readable-stream": "^2.3.5"
      }
    },
    "code-point-at": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
      "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
      "dev": true
    },
    "collection-map": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/collection-map/-/collection-map-1.0.0.tgz",
      "integrity": "sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw=",
      "dev": true,
      "requires": {
        "arr-map": "^2.0.2",
        "for-own": "^1.0.0",
        "make-iterator": "^1.0.0"
      }
    },
    "collection-visit": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz",
      "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=",
      "dev": true,
      "requires": {
        "map-visit": "^1.0.0",
        "object-visit": "^1.0.0"
      }
    },
    "color-convert": {
      "version": "1.9.3",
      "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
      "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
      "dev": true,
      "requires": {
        "color-name": "1.1.3"
      }
    },
    "color-name": {
      "version": "1.1.3",
      "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
      "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
      "dev": true
    },
    "color-support": {
      "version": "1.1.3",
      "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz",
      "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==",
      "dev": true
    },
    "combine-source-map": {
      "version": "0.8.0",
      "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz",
      "integrity": "sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos=",
      "dev": true,
      "requires": {
        "convert-source-map": "~1.1.0",
        "inline-source-map": "~0.6.0",
        "lodash.memoize": "~3.0.3",
        "source-map": "~0.5.3"
      },
      "dependencies": {
        "convert-source-map": {
          "version": "1.1.3",
          "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz",
          "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=",
          "dev": true
        }
      }
    },
    "commondir": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
      "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=",
      "dev": true
    },
    "component-emitter": {
      "version": "1.3.0",
      "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
      "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==",
      "dev": true
    },
    "concat-map": {
      "version": "0.0.1",
      "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
      "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
      "dev": true
    },
    "concat-stream": {
      "version": "1.6.2",
      "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
      "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
      "dev": true,
      "requires": {
        "buffer-from": "^1.0.0",
        "inherits": "^2.0.3",
        "readable-stream": "^2.2.2",
        "typedarray": "^0.0.6"
      }
    },
    "console-browserify": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz",
      "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==",
      "dev": true
    },
    "constants-browserify": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz",
      "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=",
      "dev": true
    },
    "convert-source-map": {
      "version": "1.8.0",
      "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz",
      "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==",
      "dev": true,
      "requires": {
        "safe-buffer": "~5.1.1"
      },
      "dependencies": {
        "safe-buffer": {
          "version": "5.1.2",
          "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
          "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
          "dev": true
        }
      }
    },
    "copy-descriptor": {
      "version": "0.1.1",
      "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz",
      "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=",
      "dev": true
    },
    "copy-props": {
      "version": "2.0.5",
      "resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.5.tgz",
      "integrity": "sha512-XBlx8HSqrT0ObQwmSzM7WE5k8FxTV75h1DX1Z3n6NhQ/UYYAvInWYmG06vFt7hQZArE2fuO62aihiWIVQwh1sw==",
      "dev": true,
      "requires": {
        "each-props": "^1.3.2",
        "is-plain-object": "^5.0.0"
      },
      "dependencies": {
        "is-plain-object": {
          "version": "5.0.0",
          "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
          "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==",
          "dev": true
        }
      }
    },
    "core-js-compat": {
      "version": "3.22.4",
      "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.22.4.tgz",
      "integrity": "sha512-dIWcsszDezkFZrfm1cnB4f/J85gyhiCpxbgBdohWCDtSVuAaChTSpPV7ldOQf/Xds2U5xCIJZOK82G4ZPAIswA==",
      "dev": true,
      "requires": {
        "browserslist": "^4.20.3",
        "semver": "7.0.0"
      },
      "dependencies": {
        "semver": {
          "version": "7.0.0",
          "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz",
          "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==",
          "dev": true
        }
      }
    },
    "core-util-is": {
      "version": "1.0.3",
      "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
      "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
      "dev": true
    },
    "create-ecdh": {
      "version": "4.0.4",
      "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz",
      "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==",
      "dev": true,
      "requires": {
        "bn.js": "^4.1.0",
        "elliptic": "^6.5.3"
      },
      "dependencies": {
        "bn.js": {
          "version": "4.12.0",
          "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
          "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==",
          "dev": true
        }
      }
    },
    "create-hash": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz",
      "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==",
      "dev": true,
      "requires": {
        "cipher-base": "^1.0.1",
        "inherits": "^2.0.1",
        "md5.js": "^1.3.4",
        "ripemd160": "^2.0.1",
        "sha.js": "^2.4.0"
      }
    },
    "create-hmac": {
      "version": "1.1.7",
      "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz",
      "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==",
      "dev": true,
      "requires": {
        "cipher-base": "^1.0.3",
        "create-hash": "^1.1.0",
        "inherits": "^2.0.1",
        "ripemd160": "^2.0.0",
        "safe-buffer": "^5.0.1",
        "sha.js": "^2.4.8"
      }
    },
    "crypto-browserify": {
      "version": "3.12.0",
      "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz",
      "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==",
      "dev": true,
      "requires": {
        "browserify-cipher": "^1.0.0",
        "browserify-sign": "^4.0.0",
        "create-ecdh": "^4.0.0",
        "create-hash": "^1.1.0",
        "create-hmac": "^1.1.0",
        "diffie-hellman": "^5.0.0",
        "inherits": "^2.0.1",
        "pbkdf2": "^3.0.3",
        "public-encrypt": "^4.0.0",
        "randombytes": "^2.0.0",
        "randomfill": "^1.0.3"
      }
    },
    "d": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz",
      "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==",
      "dev": true,
      "requires": {
        "es5-ext": "^0.10.50",
        "type": "^1.0.1"
      }
    },
    "dash-ast": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/dash-ast/-/dash-ast-1.0.0.tgz",
      "integrity": "sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA==",
      "dev": true
    },
    "debug": {
      "version": "4.3.4",
      "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
      "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
      "dev": true,
      "requires": {
        "ms": "2.1.2"
      }
    },
    "decamelize": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
      "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
      "dev": true
    },
    "decode-uri-component": {
      "version": "0.2.0",
      "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz",
      "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=",
      "dev": true
    },
    "default-compare": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/default-compare/-/default-compare-1.0.0.tgz",
      "integrity": "sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ==",
      "dev": true,
      "requires": {
        "kind-of": "^5.0.2"
      },
      "dependencies": {
        "kind-of": {
          "version": "5.1.0",
          "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
          "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
          "dev": true
        }
      }
    },
    "default-resolution": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/default-resolution/-/default-resolution-2.0.0.tgz",
      "integrity": "sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ=",
      "dev": true
    },
    "define-properties": {
      "version": "1.1.4",
      "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz",
      "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==",
      "dev": true,
      "requires": {
        "has-property-descriptors": "^1.0.0",
        "object-keys": "^1.1.1"
      }
    },
    "define-property": {
      "version": "2.0.2",
      "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz",
      "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==",
      "dev": true,
      "requires": {
        "is-descriptor": "^1.0.2",
        "isobject": "^3.0.1"
      }
    },
    "defined": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz",
      "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=",
      "dev": true
    },
    "deps-sort": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.1.tgz",
      "integrity": "sha512-1orqXQr5po+3KI6kQb9A4jnXT1PBwggGl2d7Sq2xsnOeI9GPcE/tGcF9UiSZtZBM7MukY4cAh7MemS6tZYipfw==",
      "dev": true,
      "requires": {
        "JSONStream": "^1.0.3",
        "shasum-object": "^1.0.0",
        "subarg": "^1.0.0",
        "through2": "^2.0.0"
      }
    },
    "des.js": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz",
      "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==",
      "dev": true,
      "requires": {
        "inherits": "^2.0.1",
        "minimalistic-assert": "^1.0.0"
      }
    },
    "detect-file": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz",
      "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=",
      "dev": true
    },
    "detective": {
      "version": "5.2.0",
      "resolved": "https://registry.npmjs.org/detective/-/detective-5.2.0.tgz",
      "integrity": "sha512-6SsIx+nUUbuK0EthKjv0zrdnajCCXVYGmbYYiYjFVpzcjwEs/JMDZ8tPRG29J/HhN56t3GJp2cGSWDRjjot8Pg==",
      "dev": true,
      "requires": {
        "acorn-node": "^1.6.1",
        "defined": "^1.0.0",
        "minimist": "^1.1.1"
      }
    },
    "diffie-hellman": {
      "version": "5.0.3",
      "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz",
      "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==",
      "dev": true,
      "requires": {
        "bn.js": "^4.1.0",
        "miller-rabin": "^4.0.0",
        "randombytes": "^2.0.0"
      },
      "dependencies": {
        "bn.js": {
          "version": "4.12.0",
          "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
          "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==",
          "dev": true
        }
      }
    },
    "domain-browser": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz",
      "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==",
      "dev": true
    },
    "duplexer2": {
      "version": "0.1.4",
      "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz",
      "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=",
      "dev": true,
      "requires": {
        "readable-stream": "^2.0.2"
      }
    },
    "duplexify": {
      "version": "3.7.1",
      "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz",
      "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==",
      "dev": true,
      "requires": {
        "end-of-stream": "^1.0.0",
        "inherits": "^2.0.1",
        "readable-stream": "^2.0.0",
        "stream-shift": "^1.0.0"
      }
    },
    "each-props": {
      "version": "1.3.2",
      "resolved": "https://registry.npmjs.org/each-props/-/each-props-1.3.2.tgz",
      "integrity": "sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA==",
      "dev": true,
      "requires": {
        "is-plain-object": "^2.0.1",
        "object.defaults": "^1.1.0"
      }
    },
    "electron-to-chromium": {
      "version": "1.4.137",
      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.137.tgz",
      "integrity": "sha512-0Rcpald12O11BUogJagX3HsCN3FE83DSqWjgXoHo5a72KUKMSfI39XBgJpgNNxS9fuGzytaFjE06kZkiVFy2qA==",
      "dev": true
    },
    "elliptic": {
      "version": "6.5.4",
      "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz",
      "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==",
      "dev": true,
      "requires": {
        "bn.js": "^4.11.9",
        "brorand": "^1.1.0",
        "hash.js": "^1.0.0",
        "hmac-drbg": "^1.0.1",
        "inherits": "^2.0.4",
        "minimalistic-assert": "^1.0.1",
        "minimalistic-crypto-utils": "^1.0.1"
      },
      "dependencies": {
        "bn.js": {
          "version": "4.12.0",
          "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
          "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==",
          "dev": true
        }
      }
    },
    "end-of-stream": {
      "version": "1.4.4",
      "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
      "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
      "dev": true,
      "requires": {
        "once": "^1.4.0"
      }
    },
    "error-ex": {
      "version": "1.3.2",
      "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
      "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
      "dev": true,
      "requires": {
        "is-arrayish": "^0.2.1"
      }
    },
    "es5-ext": {
      "version": "0.10.61",
      "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.61.tgz",
      "integrity": "sha512-yFhIqQAzu2Ca2I4SE2Au3rxVfmohU9Y7wqGR+s7+H7krk26NXhIRAZDgqd6xqjCEFUomDEA3/Bo/7fKmIkW1kA==",
      "dev": true,
      "requires": {
        "es6-iterator": "^2.0.3",
        "es6-symbol": "^3.1.3",
        "next-tick": "^1.1.0"
      }
    },
    "es6-iterator": {
      "version": "2.0.3",
      "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz",
      "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=",
      "dev": true,
      "requires": {
        "d": "1",
        "es5-ext": "^0.10.35",
        "es6-symbol": "^3.1.1"
      }
    },
    "es6-symbol": {
      "version": "3.1.3",
      "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz",
      "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==",
      "dev": true,
      "requires": {
        "d": "^1.0.1",
        "ext": "^1.1.2"
      }
    },
    "es6-weak-map": {
      "version": "2.0.3",
      "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz",
      "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==",
      "dev": true,
      "requires": {
        "d": "1",
        "es5-ext": "^0.10.46",
        "es6-iterator": "^2.0.3",
        "es6-symbol": "^3.1.1"
      }
    },
    "escalade": {
      "version": "3.1.1",
      "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
      "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
      "dev": true
    },
    "escape-string-regexp": {
      "version": "1.0.5",
      "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
      "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
      "dev": true
    },
    "esutils": {
      "version": "2.0.3",
      "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
      "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
      "dev": true
    },
    "events": {
      "version": "2.1.0",
      "resolved": "https://registry.npmjs.org/events/-/events-2.1.0.tgz",
      "integrity": "sha512-3Zmiobend8P9DjmKAty0Era4jV8oJ0yGYe2nJJAxgymF9+N8F2m0hhZiMoWtcfepExzNKZumFU3ksdQbInGWCg==",
      "dev": true
    },
    "evp_bytestokey": {
      "version": "1.0.3",
      "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz",
      "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==",
      "dev": true,
      "requires": {
        "md5.js": "^1.3.4",
        "safe-buffer": "^5.1.1"
      }
    },
    "expand-brackets": {
      "version": "2.1.4",
      "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz",
      "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=",
      "dev": true,
      "requires": {
        "debug": "^2.3.3",
        "define-property": "^0.2.5",
        "extend-shallow": "^2.0.1",
        "posix-character-classes": "^0.1.0",
        "regex-not": "^1.0.0",
        "snapdragon": "^0.8.1",
        "to-regex": "^3.0.1"
      },
      "dependencies": {
        "debug": {
          "version": "2.6.9",
          "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
          "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
          "dev": true,
          "requires": {
            "ms": "2.0.0"
          }
        },
        "define-property": {
          "version": "0.2.5",
          "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
          "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
          "dev": true,
          "requires": {
            "is-descriptor": "^0.1.0"
          }
        },
        "is-accessor-descriptor": {
          "version": "0.1.6",
          "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
          "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
          "dev": true,
          "requires": {
            "kind-of": "^3.0.2"
          },
          "dependencies": {
            "kind-of": {
              "version": "3.2.2",
              "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
              "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
              "dev": true,
              "requires": {
                "is-buffer": "^1.1.5"
              }
            }
          }
        },
        "is-data-descriptor": {
          "version": "0.1.4",
          "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
          "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
          "dev": true,
          "requires": {
            "kind-of": "^3.0.2"
          },
          "dependencies": {
            "kind-of": {
              "version": "3.2.2",
              "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
              "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
              "dev": true,
              "requires": {
                "is-buffer": "^1.1.5"
              }
            }
          }
        },
        "is-descriptor": {
          "version": "0.1.6",
          "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
          "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
          "dev": true,
          "requires": {
            "is-accessor-descriptor": "^0.1.6",
            "is-data-descriptor": "^0.1.4",
            "kind-of": "^5.0.0"
          }
        },
        "kind-of": {
          "version": "5.1.0",
          "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
          "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
          "dev": true
        },
        "ms": {
          "version": "2.0.0",
          "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
          "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
          "dev": true
        }
      }
    },
    "expand-tilde": {
      "version": "2.0.2",
      "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz",
      "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=",
      "dev": true,
      "requires": {
        "homedir-polyfill": "^1.0.1"
      }
    },
    "ext": {
      "version": "1.6.0",
      "resolved": "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz",
      "integrity": "sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==",
      "dev": true,
      "requires": {
        "type": "^2.5.0"
      },
      "dependencies": {
        "type": {
          "version": "2.6.0",
          "resolved": "https://registry.npmjs.org/type/-/type-2.6.0.tgz",
          "integrity": "sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ==",
          "dev": true
        }
      }
    },
    "extend": {
      "version": "3.0.2",
      "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
      "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==",
      "dev": true
    },
    "extend-shallow": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
      "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
      "dev": true,
      "requires": {
        "is-extendable": "^0.1.0"
      }
    },
    "extglob": {
      "version": "2.0.4",
      "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz",
      "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==",
      "dev": true,
      "requires": {
        "array-unique": "^0.3.2",
        "define-property": "^1.0.0",
        "expand-brackets": "^2.1.4",
        "extend-shallow": "^2.0.1",
        "fragment-cache": "^0.2.1",
        "regex-not": "^1.0.0",
        "snapdragon": "^0.8.1",
        "to-regex": "^3.0.1"
      },
      "dependencies": {
        "define-property": {
          "version": "1.0.0",
          "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
          "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
          "dev": true,
          "requires": {
            "is-descriptor": "^1.0.0"
          }
        }
      }
    },
    "fancy-log": {
      "version": "1.3.3",
      "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.3.tgz",
      "integrity": "sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw==",
      "dev": true,
      "requires": {
        "ansi-gray": "^0.1.1",
        "color-support": "^1.1.3",
        "parse-node-version": "^1.0.0",
        "time-stamp": "^1.0.0"
      }
    },
    "fast-levenshtein": {
      "version": "1.1.4",
      "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-1.1.4.tgz",
      "integrity": "sha1-5qdUzI8V5YmHqpy9J69m/W9OWvk=",
      "dev": true
    },
    "fast-safe-stringify": {
      "version": "2.1.1",
      "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz",
      "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==",
      "dev": true
    },
    "file-uri-to-path": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
      "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
      "dev": true,
      "optional": true
    },
    "fill-range": {
      "version": "4.0.0",
      "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
      "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=",
      "dev": true,
      "requires": {
        "extend-shallow": "^2.0.1",
        "is-number": "^3.0.0",
        "repeat-string": "^1.6.1",
        "to-regex-range": "^2.1.0"
      }
    },
    "find-cache-dir": {
      "version": "2.1.0",
      "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz",
      "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==",
      "dev": true,
      "requires": {
        "commondir": "^1.0.1",
        "make-dir": "^2.0.0",
        "pkg-dir": "^3.0.0"
      }
    },
    "find-up": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
      "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
      "dev": true,
      "requires": {
        "locate-path": "^3.0.0"
      }
    },
    "findup-sync": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz",
      "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==",
      "dev": true,
      "requires": {
        "detect-file": "^1.0.0",
        "is-glob": "^4.0.0",
        "micromatch": "^3.0.4",
        "resolve-dir": "^1.0.1"
      }
    },
    "fined": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz",
      "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==",
      "dev": true,
      "requires": {
        "expand-tilde": "^2.0.2",
        "is-plain-object": "^2.0.3",
        "object.defaults": "^1.1.0",
        "object.pick": "^1.2.0",
        "parse-filepath": "^1.0.1"
      }
    },
    "flagged-respawn": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz",
      "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==",
      "dev": true
    },
    "flush-write-stream": {
      "version": "1.1.1",
      "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz",
      "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==",
      "dev": true,
      "requires": {
        "inherits": "^2.0.3",
        "readable-stream": "^2.3.6"
      }
    },
    "for-in": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",
      "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=",
      "dev": true
    },
    "for-own": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz",
      "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=",
      "dev": true,
      "requires": {
        "for-in": "^1.0.1"
      }
    },
    "fragment-cache": {
      "version": "0.2.1",
      "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz",
      "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=",
      "dev": true,
      "requires": {
        "map-cache": "^0.2.2"
      }
    },
    "fs-mkdirp-stream": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz",
      "integrity": "sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes=",
      "dev": true,
      "requires": {
        "graceful-fs": "^4.1.11",
        "through2": "^2.0.3"
      }
    },
    "fs.realpath": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
      "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
      "dev": true
    },
    "fsevents": {
      "version": "1.2.13",
      "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
      "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
      "dev": true,
      "optional": true,
      "requires": {
        "bindings": "^1.5.0",
        "nan": "^2.12.1"
      }
    },
    "function-bind": {
      "version": "1.1.1",
      "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
      "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
      "dev": true
    },
    "gensync": {
      "version": "1.0.0-beta.2",
      "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
      "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==",
      "dev": true
    },
    "get-assigned-identifiers": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz",
      "integrity": "sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ==",
      "dev": true
    },
    "get-caller-file": {
      "version": "1.0.3",
      "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz",
      "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==",
      "dev": true
    },
    "get-intrinsic": {
      "version": "1.1.1",
      "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz",
      "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==",
      "dev": true,
      "requires": {
        "function-bind": "^1.1.1",
        "has": "^1.0.3",
        "has-symbols": "^1.0.1"
      }
    },
    "get-value": {
      "version": "2.0.6",
      "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz",
      "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=",
      "dev": true
    },
    "glob": {
      "version": "7.2.0",
      "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
      "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
      "dev": true,
      "requires": {
        "fs.realpath": "^1.0.0",
        "inflight": "^1.0.4",
        "inherits": "2",
        "minimatch": "^3.0.4",
        "once": "^1.3.0",
        "path-is-absolute": "^1.0.0"
      }
    },
    "glob-parent": {
      "version": "3.1.0",
      "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz",
      "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=",
      "dev": true,
      "requires": {
        "is-glob": "^3.1.0",
        "path-dirname": "^1.0.0"
      },
      "dependencies": {
        "is-glob": {
          "version": "3.1.0",
          "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz",
          "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=",
          "dev": true,
          "requires": {
            "is-extglob": "^2.1.0"
          }
        }
      }
    },
    "glob-stream": {
      "version": "6.1.0",
      "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz",
      "integrity": "sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ=",
      "dev": true,
      "requires": {
        "extend": "^3.0.0",
        "glob": "^7.1.1",
        "glob-parent": "^3.1.0",
        "is-negated-glob": "^1.0.0",
        "ordered-read-streams": "^1.0.0",
        "pumpify": "^1.3.5",
        "readable-stream": "^2.1.5",
        "remove-trailing-separator": "^1.0.1",
        "to-absolute-glob": "^2.0.0",
        "unique-stream": "^2.0.2"
      }
    },
    "glob-watcher": {
      "version": "5.0.5",
      "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-5.0.5.tgz",
      "integrity": "sha512-zOZgGGEHPklZNjZQaZ9f41i7F2YwE+tS5ZHrDhbBCk3stwahn5vQxnFmBJZHoYdusR6R1bLSXeGUy/BhctwKzw==",
      "dev": true,
      "requires": {
        "anymatch": "^2.0.0",
        "async-done": "^1.2.0",
        "chokidar": "^2.0.0",
        "is-negated-glob": "^1.0.0",
        "just-debounce": "^1.0.0",
        "normalize-path": "^3.0.0",
        "object.defaults": "^1.1.0"
      }
    },
    "global-modules": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz",
      "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==",
      "dev": true,
      "requires": {
        "global-prefix": "^1.0.1",
        "is-windows": "^1.0.1",
        "resolve-dir": "^1.0.0"
      }
    },
    "global-prefix": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz",
      "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=",
      "dev": true,
      "requires": {
        "expand-tilde": "^2.0.2",
        "homedir-polyfill": "^1.0.1",
        "ini": "^1.3.4",
        "is-windows": "^1.0.1",
        "which": "^1.2.14"
      }
    },
    "globals": {
      "version": "11.12.0",
      "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
      "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
      "dev": true
    },
    "glogg": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.2.tgz",
      "integrity": "sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA==",
      "dev": true,
      "requires": {
        "sparkles": "^1.0.0"
      }
    },
    "graceful-fs": {
      "version": "4.2.10",
      "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz",
      "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==",
      "dev": true
    },
    "gulp": {
      "version": "4.0.2",
      "resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz",
      "integrity": "sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA==",
      "dev": true,
      "requires": {
        "glob-watcher": "^5.0.3",
        "gulp-cli": "^2.2.0",
        "undertaker": "^1.2.1",
        "vinyl-fs": "^3.0.0"
      }
    },
    "gulp-clean-css": {
      "version": "4.3.0",
      "resolved": "https://registry.npmjs.org/gulp-clean-css/-/gulp-clean-css-4.3.0.tgz",
      "integrity": "sha512-mGyeT3qqFXTy61j0zOIciS4MkYziF2U594t2Vs9rUnpkEHqfu6aDITMp8xOvZcvdX61Uz3y1mVERRYmjzQF5fg==",
      "dev": true,
      "requires": {
        "clean-css": "4.2.3",
        "plugin-error": "1.0.1",
        "through2": "3.0.1",
        "vinyl-sourcemaps-apply": "0.2.1"
      },
      "dependencies": {
        "through2": {
          "version": "3.0.1",
          "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz",
          "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==",
          "dev": true,
          "requires": {
            "readable-stream": "2 || 3"
          }
        }
      }
    },
    "gulp-cli": {
      "version": "2.3.0",
      "resolved": "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.3.0.tgz",
      "integrity": "sha512-zzGBl5fHo0EKSXsHzjspp3y5CONegCm8ErO5Qh0UzFzk2y4tMvzLWhoDokADbarfZRL2pGpRp7yt6gfJX4ph7A==",
      "dev": true,
      "requires": {
        "ansi-colors": "^1.0.1",
        "archy": "^1.0.0",
        "array-sort": "^1.0.0",
        "color-support": "^1.1.3",
        "concat-stream": "^1.6.0",
        "copy-props": "^2.0.1",
        "fancy-log": "^1.3.2",
        "gulplog": "^1.0.0",
        "interpret": "^1.4.0",
        "isobject": "^3.0.1",
        "liftoff": "^3.1.0",
        "matchdep": "^2.0.0",
        "mute-stdout": "^1.0.0",
        "pretty-hrtime": "^1.0.0",
        "replace-homedir": "^1.0.0",
        "semver-greatest-satisfied-range": "^1.1.0",
        "v8flags": "^3.2.0",
        "yargs": "^7.1.0"
      }
    },
    "gulp-rename": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/gulp-rename/-/gulp-rename-2.0.0.tgz",
      "integrity": "sha512-97Vba4KBzbYmR5VBs9mWmK+HwIf5mj+/zioxfZhOKeXtx5ZjBk57KFlePf5nxq9QsTtFl0ejnHE3zTC9MHXqyQ==",
      "dev": true
    },
    "gulp-replace": {
      "version": "1.1.3",
      "resolved": "https://registry.npmjs.org/gulp-replace/-/gulp-replace-1.1.3.tgz",
      "integrity": "sha512-HcPHpWY4XdF8zxYkDODHnG2+7a3nD/Y8Mfu3aBgMiCFDW3X2GiOKXllsAmILcxe3KZT2BXoN18WrpEFm48KfLQ==",
      "dev": true,
      "requires": {
        "@types/node": "^14.14.41",
        "@types/vinyl": "^2.0.4",
        "istextorbinary": "^3.0.0",
        "replacestream": "^4.0.3",
        "yargs-parser": ">=5.0.0-security.0"
      }
    },
    "gulp-streamify": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/gulp-streamify/-/gulp-streamify-1.0.2.tgz",
      "integrity": "sha1-ANazgU1IbAiPeHOO0HZqvBY4nk0=",
      "dev": true,
      "requires": {
        "plexer": "1.0.1"
      }
    },
    "gulp-uglify": {
      "version": "3.0.2",
      "resolved": "https://registry.npmjs.org/gulp-uglify/-/gulp-uglify-3.0.2.tgz",
      "integrity": "sha512-gk1dhB74AkV2kzqPMQBLA3jPoIAPd/nlNzP2XMDSG8XZrqnlCiDGAqC+rZOumzFvB5zOphlFh6yr3lgcAb/OOg==",
      "dev": true,
      "requires": {
        "array-each": "^1.0.1",
        "extend-shallow": "^3.0.2",
        "gulplog": "^1.0.0",
        "has-gulplog": "^0.1.0",
        "isobject": "^3.0.1",
        "make-error-cause": "^1.1.1",
        "safe-buffer": "^5.1.2",
        "through2": "^2.0.0",
        "uglify-js": "^3.0.5",
        "vinyl-sourcemaps-apply": "^0.2.0"
      },
      "dependencies": {
        "extend-shallow": {
          "version": "3.0.2",
          "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
          "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
          "dev": true,
          "requires": {
            "assign-symbols": "^1.0.0",
            "is-extendable": "^1.0.1"
          }
        },
        "is-extendable": {
          "version": "1.0.1",
          "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
          "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
          "dev": true,
          "requires": {
            "is-plain-object": "^2.0.4"
          }
        }
      }
    },
    "gulplog": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz",
      "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=",
      "dev": true,
      "requires": {
        "glogg": "^1.0.0"
      }
    },
    "has": {
      "version": "1.0.3",
      "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
      "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
      "dev": true,
      "requires": {
        "function-bind": "^1.1.1"
      }
    },
    "has-flag": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
      "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
      "dev": true
    },
    "has-gulplog": {
      "version": "0.1.0",
      "resolved": "https://registry.npmjs.org/has-gulplog/-/has-gulplog-0.1.0.tgz",
      "integrity": "sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4=",
      "dev": true,
      "requires": {
        "sparkles": "^1.0.0"
      }
    },
    "has-property-descriptors": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz",
      "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==",
      "dev": true,
      "requires": {
        "get-intrinsic": "^1.1.1"
      }
    },
    "has-symbols": {
      "version": "1.0.3",
      "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
      "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==",
      "dev": true
    },
    "has-value": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz",
      "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=",
      "dev": true,
      "requires": {
        "get-value": "^2.0.6",
        "has-values": "^1.0.0",
        "isobject": "^3.0.0"
      }
    },
    "has-values": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz",
      "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=",
      "dev": true,
      "requires": {
        "is-number": "^3.0.0",
        "kind-of": "^4.0.0"
      },
      "dependencies": {
        "kind-of": {
          "version": "4.0.0",
          "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz",
          "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=",
          "dev": true,
          "requires": {
            "is-buffer": "^1.1.5"
          }
        }
      }
    },
    "hash-base": {
      "version": "3.1.0",
      "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz",
      "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==",
      "dev": true,
      "requires": {
        "inherits": "^2.0.4",
        "readable-stream": "^3.6.0",
        "safe-buffer": "^5.2.0"
      },
      "dependencies": {
        "readable-stream": {
          "version": "3.6.0",
          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
          "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
          "dev": true,
          "requires": {
            "inherits": "^2.0.3",
            "string_decoder": "^1.1.1",
            "util-deprecate": "^1.0.1"
          }
        }
      }
    },
    "hash.js": {
      "version": "1.1.7",
      "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz",
      "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==",
      "dev": true,
      "requires": {
        "inherits": "^2.0.3",
        "minimalistic-assert": "^1.0.1"
      }
    },
    "hmac-drbg": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
      "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=",
      "dev": true,
      "requires": {
        "hash.js": "^1.0.3",
        "minimalistic-assert": "^1.0.0",
        "minimalistic-crypto-utils": "^1.0.1"
      }
    },
    "homedir-polyfill": {
      "version": "1.0.3",
      "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz",
      "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==",
      "dev": true,
      "requires": {
        "parse-passwd": "^1.0.0"
      }
    },
    "hosted-git-info": {
      "version": "2.8.9",
      "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
      "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==",
      "dev": true
    },
    "htmlescape": {
      "version": "1.1.1",
      "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz",
      "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=",
      "dev": true
    },
    "https-browserify": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz",
      "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=",
      "dev": true
    },
    "ieee754": {
      "version": "1.2.1",
      "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
      "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
      "dev": true
    },
    "inflight": {
      "version": "1.0.6",
      "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
      "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
      "dev": true,
      "requires": {
        "once": "^1.3.0",
        "wrappy": "1"
      }
    },
    "inherits": {
      "version": "2.0.4",
      "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
      "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
      "dev": true
    },
    "ini": {
      "version": "1.3.8",
      "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
      "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==",
      "dev": true
    },
    "inline-source-map": {
      "version": "0.6.2",
      "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz",
      "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=",
      "dev": true,
      "requires": {
        "source-map": "~0.5.3"
      }
    },
    "insert-module-globals": {
      "version": "7.2.1",
      "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.2.1.tgz",
      "integrity": "sha512-ufS5Qq9RZN+Bu899eA9QCAYThY+gGW7oRkmb0vC93Vlyu/CFGcH0OYPEjVkDXA5FEbTt1+VWzdoOD3Ny9N+8tg==",
      "dev": true,
      "requires": {
        "acorn-node": "^1.5.2",
        "combine-source-map": "^0.8.0",
        "concat-stream": "^1.6.1",
        "is-buffer": "^1.1.0",
        "JSONStream": "^1.0.3",
        "path-is-absolute": "^1.0.1",
        "process": "~0.11.0",
        "through2": "^2.0.0",
        "undeclared-identifiers": "^1.1.2",
        "xtend": "^4.0.0"
      }
    },
    "interpret": {
      "version": "1.4.0",
      "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz",
      "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==",
      "dev": true
    },
    "invert-kv": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz",
      "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=",
      "dev": true
    },
    "is-absolute": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz",
      "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==",
      "dev": true,
      "requires": {
        "is-relative": "^1.0.0",
        "is-windows": "^1.0.1"
      }
    },
    "is-accessor-descriptor": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
      "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
      "dev": true,
      "requires": {
        "kind-of": "^6.0.0"
      }
    },
    "is-arrayish": {
      "version": "0.2.1",
      "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
      "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=",
      "dev": true
    },
    "is-binary-path": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz",
      "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=",
      "dev": true,
      "requires": {
        "binary-extensions": "^1.0.0"
      }
    },
    "is-buffer": {
      "version": "1.1.6",
      "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
      "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==",
      "dev": true
    },
    "is-core-module": {
      "version": "2.9.0",
      "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz",
      "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==",
      "dev": true,
      "requires": {
        "has": "^1.0.3"
      }
    },
    "is-data-descriptor": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
      "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
      "dev": true,
      "requires": {
        "kind-of": "^6.0.0"
      }
    },
    "is-descriptor": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
      "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
      "dev": true,
      "requires": {
        "is-accessor-descriptor": "^1.0.0",
        "is-data-descriptor": "^1.0.0",
        "kind-of": "^6.0.2"
      }
    },
    "is-extendable": {
      "version": "0.1.1",
      "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
      "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=",
      "dev": true
    },
    "is-extglob": {
      "version": "2.1.1",
      "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
      "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
      "dev": true
    },
    "is-fullwidth-code-point": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
      "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
      "dev": true,
      "requires": {
        "number-is-nan": "^1.0.0"
      }
    },
    "is-glob": {
      "version": "4.0.3",
      "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
      "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
      "dev": true,
      "requires": {
        "is-extglob": "^2.1.1"
      }
    },
    "is-negated-glob": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz",
      "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=",
      "dev": true
    },
    "is-number": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
      "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=",
      "dev": true,
      "requires": {
        "kind-of": "^3.0.2"
      },
      "dependencies": {
        "kind-of": {
          "version": "3.2.2",
          "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
          "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
          "dev": true,
          "requires": {
            "is-buffer": "^1.1.5"
          }
        }
      }
    },
    "is-plain-object": {
      "version": "2.0.4",
      "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
      "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==",
      "dev": true,
      "requires": {
        "isobject": "^3.0.1"
      }
    },
    "is-relative": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz",
      "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==",
      "dev": true,
      "requires": {
        "is-unc-path": "^1.0.0"
      }
    },
    "is-unc-path": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz",
      "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==",
      "dev": true,
      "requires": {
        "unc-path-regex": "^0.1.2"
      }
    },
    "is-utf8": {
      "version": "0.2.1",
      "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
      "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=",
      "dev": true
    },
    "is-valid-glob": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz",
      "integrity": "sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao=",
      "dev": true
    },
    "is-windows": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz",
      "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==",
      "dev": true
    },
    "isarray": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
      "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
      "dev": true
    },
    "isexe": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
      "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
      "dev": true
    },
    "isobject": {
      "version": "3.0.1",
      "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
      "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=",
      "dev": true
    },
    "isstream": {
      "version": "0.1.2",
      "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
      "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=",
      "dev": true
    },
    "istextorbinary": {
      "version": "3.3.0",
      "resolved": "https://registry.npmjs.org/istextorbinary/-/istextorbinary-3.3.0.tgz",
      "integrity": "sha512-Tvq1W6NAcZeJ8op+Hq7tdZ434rqnMx4CCZ7H0ff83uEloDvVbqAwaMTZcafKGJT0VHkYzuXUiCY4hlXQg6WfoQ==",
      "dev": true,
      "requires": {
        "binaryextensions": "^2.2.0",
        "textextensions": "^3.2.0"
      }
    },
    "js-tokens": {
      "version": "4.0.0",
      "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
      "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
      "dev": true
    },
    "jsesc": {
      "version": "2.5.2",
      "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz",
      "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==",
      "dev": true
    },
    "json-stable-stringify": {
      "version": "0.0.1",
      "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz",
      "integrity": "sha1-YRwj6BTbN1Un34URk9tZ3Sryf0U=",
      "dev": true,
      "requires": {
        "jsonify": "~0.0.0"
      }
    },
    "json-stable-stringify-without-jsonify": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
      "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=",
      "dev": true
    },
    "json5": {
      "version": "2.2.1",
      "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz",
      "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==",
      "dev": true
    },
    "jsonify": {
      "version": "0.0.0",
      "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz",
      "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=",
      "dev": true
    },
    "jsonparse": {
      "version": "1.3.1",
      "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz",
      "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=",
      "dev": true
    },
    "JSONStream": {
      "version": "1.3.5",
      "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz",
      "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==",
      "dev": true,
      "requires": {
        "jsonparse": "^1.2.0",
        "through": ">=2.2.7 <3"
      }
    },
    "just-debounce": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/just-debounce/-/just-debounce-1.1.0.tgz",
      "integrity": "sha512-qpcRocdkUmf+UTNBYx5w6dexX5J31AKK1OmPwH630a83DdVVUIngk55RSAiIGpQyoH0dlr872VHfPjnQnK1qDQ==",
      "dev": true
    },
    "kind-of": {
      "version": "6.0.3",
      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
      "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==",
      "dev": true
    },
    "labeled-stream-splicer": {
      "version": "2.0.2",
      "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.2.tgz",
      "integrity": "sha512-Ca4LSXFFZUjPScRaqOcFxneA0VpKZr4MMYCljyQr4LIewTLb3Y0IUTIsnBBsVubIeEfxeSZpSjSsRM8APEQaAw==",
      "dev": true,
      "requires": {
        "inherits": "^2.0.1",
        "stream-splicer": "^2.0.0"
      }
    },
    "last-run": {
      "version": "1.1.1",
      "resolved": "https://registry.npmjs.org/last-run/-/last-run-1.1.1.tgz",
      "integrity": "sha1-RblpQsF7HHnHchmCWbqUO+v4yls=",
      "dev": true,
      "requires": {
        "default-resolution": "^2.0.0",
        "es6-weak-map": "^2.0.1"
      }
    },
    "lazystream": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz",
      "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==",
      "dev": true,
      "requires": {
        "readable-stream": "^2.0.5"
      }
    },
    "lcid": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz",
      "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=",
      "dev": true,
      "requires": {
        "invert-kv": "^1.0.0"
      }
    },
    "lead": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz",
      "integrity": "sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI=",
      "dev": true,
      "requires": {
        "flush-write-stream": "^1.0.2"
      }
    },
    "liftoff": {
      "version": "3.1.0",
      "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-3.1.0.tgz",
      "integrity": "sha512-DlIPlJUkCV0Ips2zf2pJP0unEoT1kwYhiiPUGF3s/jtxTCjziNLoiVVh+jqWOWeFi6mmwQ5fNxvAUyPad4Dfog==",
      "dev": true,
      "requires": {
        "extend": "^3.0.0",
        "findup-sync": "^3.0.0",
        "fined": "^1.0.1",
        "flagged-respawn": "^1.0.0",
        "is-plain-object": "^2.0.4",
        "object.map": "^1.0.0",
        "rechoir": "^0.6.2",
        "resolve": "^1.1.7"
      }
    },
    "load-json-file": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
      "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=",
      "dev": true,
      "requires": {
        "graceful-fs": "^4.1.2",
        "parse-json": "^2.2.0",
        "pify": "^2.0.0",
        "pinkie-promise": "^2.0.0",
        "strip-bom": "^2.0.0"
      },
      "dependencies": {
        "pify": {
          "version": "2.3.0",
          "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
          "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
          "dev": true
        }
      }
    },
    "locate-path": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
      "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
      "dev": true,
      "requires": {
        "p-locate": "^3.0.0",
        "path-exists": "^3.0.0"
      }
    },
    "lodash.debounce": {
      "version": "4.0.8",
      "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz",
      "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=",
      "dev": true
    },
    "lodash.memoize": {
      "version": "3.0.4",
      "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz",
      "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=",
      "dev": true
    },
    "make-dir": {
      "version": "2.1.0",
      "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
      "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==",
      "dev": true,
      "requires": {
        "pify": "^4.0.1",
        "semver": "^5.6.0"
      },
      "dependencies": {
        "semver": {
          "version": "5.7.1",
          "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
          "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
          "dev": true
        }
      }
    },
    "make-error": {
      "version": "1.3.6",
      "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
      "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
      "dev": true
    },
    "make-error-cause": {
      "version": "1.2.2",
      "resolved": "https://registry.npmjs.org/make-error-cause/-/make-error-cause-1.2.2.tgz",
      "integrity": "sha1-3wOI/NCzeBbf8KX7gQiTl3fcvJ0=",
      "dev": true,
      "requires": {
        "make-error": "^1.2.0"
      }
    },
    "make-iterator": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz",
      "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==",
      "dev": true,
      "requires": {
        "kind-of": "^6.0.2"
      }
    },
    "map-cache": {
      "version": "0.2.2",
      "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz",
      "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=",
      "dev": true
    },
    "map-visit": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz",
      "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=",
      "dev": true,
      "requires": {
        "object-visit": "^1.0.0"
      }
    },
    "matchdep": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz",
      "integrity": "sha1-xvNINKDY28OzfCfui7yyfHd1WC4=",
      "dev": true,
      "requires": {
        "findup-sync": "^2.0.0",
        "micromatch": "^3.0.4",
        "resolve": "^1.4.0",
        "stack-trace": "0.0.10"
      },
      "dependencies": {
        "findup-sync": {
          "version": "2.0.0",
          "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz",
          "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=",
          "dev": true,
          "requires": {
            "detect-file": "^1.0.0",
            "is-glob": "^3.1.0",
            "micromatch": "^3.0.4",
            "resolve-dir": "^1.0.1"
          }
        },
        "is-glob": {
          "version": "3.1.0",
          "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz",
          "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=",
          "dev": true,
          "requires": {
            "is-extglob": "^2.1.0"
          }
        }
      }
    },
    "md5.js": {
      "version": "1.3.5",
      "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz",
      "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==",
      "dev": true,
      "requires": {
        "hash-base": "^3.0.0",
        "inherits": "^2.0.1",
        "safe-buffer": "^5.1.2"
      }
    },
    "micromatch": {
      "version": "3.1.10",
      "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
      "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==",
      "dev": true,
      "requires": {
        "arr-diff": "^4.0.0",
        "array-unique": "^0.3.2",
        "braces": "^2.3.1",
        "define-property": "^2.0.2",
        "extend-shallow": "^3.0.2",
        "extglob": "^2.0.4",
        "fragment-cache": "^0.2.1",
        "kind-of": "^6.0.2",
        "nanomatch": "^1.2.9",
        "object.pick": "^1.3.0",
        "regex-not": "^1.0.0",
        "snapdragon": "^0.8.1",
        "to-regex": "^3.0.2"
      },
      "dependencies": {
        "extend-shallow": {
          "version": "3.0.2",
          "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
          "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
          "dev": true,
          "requires": {
            "assign-symbols": "^1.0.0",
            "is-extendable": "^1.0.1"
          }
        },
        "is-extendable": {
          "version": "1.0.1",
          "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
          "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
          "dev": true,
          "requires": {
            "is-plain-object": "^2.0.4"
          }
        }
      }
    },
    "miller-rabin": {
      "version": "4.0.1",
      "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz",
      "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==",
      "dev": true,
      "requires": {
        "bn.js": "^4.0.0",
        "brorand": "^1.0.1"
      },
      "dependencies": {
        "bn.js": {
          "version": "4.12.0",
          "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
          "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==",
          "dev": true
        }
      }
    },
    "minimalistic-assert": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz",
      "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==",
      "dev": true
    },
    "minimalistic-crypto-utils": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz",
      "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=",
      "dev": true
    },
    "minimatch": {
      "version": "3.1.2",
      "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
      "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
      "dev": true,
      "requires": {
        "brace-expansion": "^1.1.7"
      }
    },
    "minimist": {
      "version": "1.2.6",
      "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
      "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==",
      "dev": true
    },
    "mithril": {
      "version": "2.0.4",
      "resolved": "https://registry.npmjs.org/mithril/-/mithril-2.0.4.tgz",
      "integrity": "sha512-mgw+DMZlhMS4PpprF6dl7ZoeZq5GGcAuWnrg5e12MvaGauc4jzWsDZtVGRCktsiQczOEUr2K5teKbE5k44RlOg=="
    },
    "mixin-deep": {
      "version": "1.3.2",
      "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz",
      "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==",
      "dev": true,
      "requires": {
        "for-in": "^1.0.2",
        "is-extendable": "^1.0.1"
      },
      "dependencies": {
        "is-extendable": {
          "version": "1.0.1",
          "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
          "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
          "dev": true,
          "requires": {
            "is-plain-object": "^2.0.4"
          }
        }
      }
    },
    "mkdirp-classic": {
      "version": "0.5.3",
      "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
      "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==",
      "dev": true
    },
    "module-deps": {
      "version": "6.2.3",
      "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.2.3.tgz",
      "integrity": "sha512-fg7OZaQBcL4/L+AK5f4iVqf9OMbCclXfy/znXRxTVhJSeW5AIlS9AwheYwDaXM3lVW7OBeaeUEY3gbaC6cLlSA==",
      "dev": true,
      "requires": {
        "browser-resolve": "^2.0.0",
        "cached-path-relative": "^1.0.2",
        "concat-stream": "~1.6.0",
        "defined": "^1.0.0",
        "detective": "^5.2.0",
        "duplexer2": "^0.1.2",
        "inherits": "^2.0.1",
        "JSONStream": "^1.0.3",
        "parents": "^1.0.0",
        "readable-stream": "^2.0.2",
        "resolve": "^1.4.0",
        "stream-combiner2": "^1.1.1",
        "subarg": "^1.0.0",
        "through2": "^2.0.0",
        "xtend": "^4.0.0"
      }
    },
    "ms": {
      "version": "2.1.2",
      "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
      "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
      "dev": true
    },
    "mute-stdout": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.1.tgz",
      "integrity": "sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg==",
      "dev": true
    },
    "nan": {
      "version": "2.15.0",
      "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz",
      "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==",
      "dev": true,
      "optional": true
    },
    "nanomatch": {
      "version": "1.2.13",
      "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz",
      "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==",
      "dev": true,
      "requires": {
        "arr-diff": "^4.0.0",
        "array-unique": "^0.3.2",
        "define-property": "^2.0.2",
        "extend-shallow": "^3.0.2",
        "fragment-cache": "^0.2.1",
        "is-windows": "^1.0.2",
        "kind-of": "^6.0.2",
        "object.pick": "^1.3.0",
        "regex-not": "^1.0.0",
        "snapdragon": "^0.8.1",
        "to-regex": "^3.0.1"
      },
      "dependencies": {
        "extend-shallow": {
          "version": "3.0.2",
          "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
          "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
          "dev": true,
          "requires": {
            "assign-symbols": "^1.0.0",
            "is-extendable": "^1.0.1"
          }
        },
        "is-extendable": {
          "version": "1.0.1",
          "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
          "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
          "dev": true,
          "requires": {
            "is-plain-object": "^2.0.4"
          }
        }
      }
    },
    "next-tick": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz",
      "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==",
      "dev": true
    },
    "node-releases": {
      "version": "2.0.4",
      "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.4.tgz",
      "integrity": "sha512-gbMzqQtTtDz/00jQzZ21PQzdI9PyLYqUSvD0p3naOhX4odFji0ZxYdnVwPTxmSwkmxhcFImpozceidSG+AgoPQ==",
      "dev": true
    },
    "normalize-package-data": {
      "version": "2.5.0",
      "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
      "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==",
      "dev": true,
      "requires": {
        "hosted-git-info": "^2.1.4",
        "resolve": "^1.10.0",
        "semver": "2 || 3 || 4 || 5",
        "validate-npm-package-license": "^3.0.1"
      },
      "dependencies": {
        "semver": {
          "version": "5.7.1",
          "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
          "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
          "dev": true
        }
      }
    },
    "normalize-path": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
      "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
      "dev": true
    },
    "now-and-later": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.1.tgz",
      "integrity": "sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==",
      "dev": true,
      "requires": {
        "once": "^1.3.2"
      }
    },
    "number-is-nan": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
      "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
      "dev": true
    },
    "object-assign": {
      "version": "4.1.1",
      "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
      "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
      "dev": true
    },
    "object-copy": {
      "version": "0.1.0",
      "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz",
      "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=",
      "dev": true,
      "requires": {
        "copy-descriptor": "^0.1.0",
        "define-property": "^0.2.5",
        "kind-of": "^3.0.3"
      },
      "dependencies": {
        "define-property": {
          "version": "0.2.5",
          "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
          "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
          "dev": true,
          "requires": {
            "is-descriptor": "^0.1.0"
          }
        },
        "is-accessor-descriptor": {
          "version": "0.1.6",
          "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
          "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
          "dev": true,
          "requires": {
            "kind-of": "^3.0.2"
          }
        },
        "is-data-descriptor": {
          "version": "0.1.4",
          "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
          "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
          "dev": true,
          "requires": {
            "kind-of": "^3.0.2"
          }
        },
        "is-descriptor": {
          "version": "0.1.6",
          "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
          "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
          "dev": true,
          "requires": {
            "is-accessor-descriptor": "^0.1.6",
            "is-data-descriptor": "^0.1.4",
            "kind-of": "^5.0.0"
          },
          "dependencies": {
            "kind-of": {
              "version": "5.1.0",
              "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
              "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
              "dev": true
            }
          }
        },
        "kind-of": {
          "version": "3.2.2",
          "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
          "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
          "dev": true,
          "requires": {
            "is-buffer": "^1.1.5"
          }
        }
      }
    },
    "object-keys": {
      "version": "1.1.1",
      "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
      "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",
      "dev": true
    },
    "object-visit": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz",
      "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=",
      "dev": true,
      "requires": {
        "isobject": "^3.0.0"
      }
    },
    "object.assign": {
      "version": "4.1.2",
      "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz",
      "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==",
      "dev": true,
      "requires": {
        "call-bind": "^1.0.0",
        "define-properties": "^1.1.3",
        "has-symbols": "^1.0.1",
        "object-keys": "^1.1.1"
      }
    },
    "object.defaults": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz",
      "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=",
      "dev": true,
      "requires": {
        "array-each": "^1.0.1",
        "array-slice": "^1.0.0",
        "for-own": "^1.0.0",
        "isobject": "^3.0.0"
      }
    },
    "object.map": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz",
      "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=",
      "dev": true,
      "requires": {
        "for-own": "^1.0.0",
        "make-iterator": "^1.0.0"
      }
    },
    "object.pick": {
      "version": "1.3.0",
      "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz",
      "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=",
      "dev": true,
      "requires": {
        "isobject": "^3.0.1"
      }
    },
    "object.reduce": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/object.reduce/-/object.reduce-1.0.1.tgz",
      "integrity": "sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60=",
      "dev": true,
      "requires": {
        "for-own": "^1.0.0",
        "make-iterator": "^1.0.0"
      }
    },
    "once": {
      "version": "1.4.0",
      "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
      "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
      "dev": true,
      "requires": {
        "wrappy": "1"
      }
    },
    "ordered-read-streams": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz",
      "integrity": "sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4=",
      "dev": true,
      "requires": {
        "readable-stream": "^2.0.1"
      }
    },
    "os-browserify": {
      "version": "0.3.0",
      "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz",
      "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=",
      "dev": true
    },
    "os-locale": {
      "version": "1.4.0",
      "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
      "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=",
      "dev": true,
      "requires": {
        "lcid": "^1.0.0"
      }
    },
    "p-limit": {
      "version": "2.3.0",
      "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
      "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
      "dev": true,
      "requires": {
        "p-try": "^2.0.0"
      }
    },
    "p-locate": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
      "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
      "dev": true,
      "requires": {
        "p-limit": "^2.0.0"
      }
    },
    "p-try": {
      "version": "2.2.0",
      "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
      "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
      "dev": true
    },
    "pako": {
      "version": "1.0.11",
      "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
      "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==",
      "dev": true
    },
    "parents": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz",
      "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=",
      "dev": true,
      "requires": {
        "path-platform": "~0.11.15"
      }
    },
    "parse-asn1": {
      "version": "5.1.6",
      "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz",
      "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==",
      "dev": true,
      "requires": {
        "asn1.js": "^5.2.0",
        "browserify-aes": "^1.0.0",
        "evp_bytestokey": "^1.0.0",
        "pbkdf2": "^3.0.3",
        "safe-buffer": "^5.1.1"
      }
    },
    "parse-filepath": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz",
      "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=",
      "dev": true,
      "requires": {
        "is-absolute": "^1.0.0",
        "map-cache": "^0.2.0",
        "path-root": "^0.1.1"
      }
    },
    "parse-json": {
      "version": "2.2.0",
      "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz",
      "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=",
      "dev": true,
      "requires": {
        "error-ex": "^1.2.0"
      }
    },
    "parse-node-version": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz",
      "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==",
      "dev": true
    },
    "parse-passwd": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz",
      "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=",
      "dev": true
    },
    "pascalcase": {
      "version": "0.1.1",
      "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz",
      "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=",
      "dev": true
    },
    "path-browserify": {
      "version": "0.0.1",
      "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz",
      "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==",
      "dev": true
    },
    "path-dirname": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz",
      "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=",
      "dev": true
    },
    "path-exists": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
      "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
      "dev": true
    },
    "path-is-absolute": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
      "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
      "dev": true
    },
    "path-parse": {
      "version": "1.0.7",
      "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
      "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
      "dev": true
    },
    "path-platform": {
      "version": "0.11.15",
      "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz",
      "integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=",
      "dev": true
    },
    "path-root": {
      "version": "0.1.1",
      "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz",
      "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=",
      "dev": true,
      "requires": {
        "path-root-regex": "^0.1.0"
      }
    },
    "path-root-regex": {
      "version": "0.1.2",
      "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz",
      "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=",
      "dev": true
    },
    "path-type": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz",
      "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=",
      "dev": true,
      "requires": {
        "graceful-fs": "^4.1.2",
        "pify": "^2.0.0",
        "pinkie-promise": "^2.0.0"
      },
      "dependencies": {
        "pify": {
          "version": "2.3.0",
          "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
          "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
          "dev": true
        }
      }
    },
    "pbkdf2": {
      "version": "3.1.2",
      "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz",
      "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==",
      "dev": true,
      "requires": {
        "create-hash": "^1.1.2",
        "create-hmac": "^1.1.4",
        "ripemd160": "^2.0.1",
        "safe-buffer": "^5.0.1",
        "sha.js": "^2.4.8"
      }
    },
    "picocolors": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
      "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
      "dev": true
    },
    "pify": {
      "version": "4.0.1",
      "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
      "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
      "dev": true
    },
    "pinkie": {
      "version": "2.0.4",
      "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
      "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=",
      "dev": true
    },
    "pinkie-promise": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
      "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=",
      "dev": true,
      "requires": {
        "pinkie": "^2.0.0"
      }
    },
    "pirates": {
      "version": "4.0.5",
      "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz",
      "integrity": "sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==",
      "dev": true
    },
    "pkg-dir": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz",
      "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==",
      "dev": true,
      "requires": {
        "find-up": "^3.0.0"
      }
    },
    "plexer": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/plexer/-/plexer-1.0.1.tgz",
      "integrity": "sha1-qAG2Ur+BRXOXlepNO/CvlGwwwN0=",
      "dev": true,
      "requires": {
        "isstream": "^0.1.2",
        "readable-stream": "^2.0.2"
      }
    },
    "plugin-error": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-1.0.1.tgz",
      "integrity": "sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA==",
      "dev": true,
      "requires": {
        "ansi-colors": "^1.0.1",
        "arr-diff": "^4.0.0",
        "arr-union": "^3.1.0",
        "extend-shallow": "^3.0.2"
      },
      "dependencies": {
        "extend-shallow": {
          "version": "3.0.2",
          "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
          "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
          "dev": true,
          "requires": {
            "assign-symbols": "^1.0.0",
            "is-extendable": "^1.0.1"
          }
        },
        "is-extendable": {
          "version": "1.0.1",
          "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
          "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
          "dev": true,
          "requires": {
            "is-plain-object": "^2.0.4"
          }
        }
      }
    },
    "posix-character-classes": {
      "version": "0.1.1",
      "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz",
      "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=",
      "dev": true
    },
    "pretty-hrtime": {
      "version": "1.0.3",
      "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz",
      "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=",
      "dev": true
    },
    "process": {
      "version": "0.11.10",
      "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
      "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=",
      "dev": true
    },
    "process-nextick-args": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
      "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
      "dev": true
    },
    "public-encrypt": {
      "version": "4.0.3",
      "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz",
      "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==",
      "dev": true,
      "requires": {
        "bn.js": "^4.1.0",
        "browserify-rsa": "^4.0.0",
        "create-hash": "^1.1.0",
        "parse-asn1": "^5.0.0",
        "randombytes": "^2.0.1",
        "safe-buffer": "^5.1.2"
      },
      "dependencies": {
        "bn.js": {
          "version": "4.12.0",
          "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
          "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==",
          "dev": true
        }
      }
    },
    "pump": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz",
      "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==",
      "dev": true,
      "requires": {
        "end-of-stream": "^1.1.0",
        "once": "^1.3.1"
      }
    },
    "pumpify": {
      "version": "1.5.1",
      "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz",
      "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==",
      "dev": true,
      "requires": {
        "duplexify": "^3.6.0",
        "inherits": "^2.0.3",
        "pump": "^2.0.0"
      }
    },
    "punycode": {
      "version": "1.4.1",
      "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
      "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=",
      "dev": true
    },
    "querystring": {
      "version": "0.2.0",
      "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz",
      "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=",
      "dev": true
    },
    "querystring-es3": {
      "version": "0.2.1",
      "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz",
      "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=",
      "dev": true
    },
    "randombytes": {
      "version": "2.1.0",
      "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
      "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",
      "dev": true,
      "requires": {
        "safe-buffer": "^5.1.0"
      }
    },
    "randomfill": {
      "version": "1.0.4",
      "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz",
      "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==",
      "dev": true,
      "requires": {
        "randombytes": "^2.0.5",
        "safe-buffer": "^5.1.0"
      }
    },
    "read-only-stream": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz",
      "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=",
      "dev": true,
      "requires": {
        "readable-stream": "^2.0.2"
      }
    },
    "read-pkg": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",
      "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=",
      "dev": true,
      "requires": {
        "load-json-file": "^1.0.0",
        "normalize-package-data": "^2.3.2",
        "path-type": "^1.0.0"
      }
    },
    "read-pkg-up": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz",
      "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=",
      "dev": true,
      "requires": {
        "find-up": "^1.0.0",
        "read-pkg": "^1.0.0"
      },
      "dependencies": {
        "find-up": {
          "version": "1.1.2",
          "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
          "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=",
          "dev": true,
          "requires": {
            "path-exists": "^2.0.0",
            "pinkie-promise": "^2.0.0"
          }
        },
        "path-exists": {
          "version": "2.1.0",
          "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz",
          "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=",
          "dev": true,
          "requires": {
            "pinkie-promise": "^2.0.0"
          }
        }
      }
    },
    "readable-stream": {
      "version": "2.3.7",
      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
      "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
      "dev": true,
      "requires": {
        "core-util-is": "~1.0.0",
        "inherits": "~2.0.3",
        "isarray": "~1.0.0",
        "process-nextick-args": "~2.0.0",
        "safe-buffer": "~5.1.1",
        "string_decoder": "~1.1.1",
        "util-deprecate": "~1.0.1"
      },
      "dependencies": {
        "safe-buffer": {
          "version": "5.1.2",
          "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
          "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
          "dev": true
        },
        "string_decoder": {
          "version": "1.1.1",
          "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
          "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
          "dev": true,
          "requires": {
            "safe-buffer": "~5.1.0"
          }
        }
      }
    },
    "readdirp": {
      "version": "2.2.1",
      "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz",
      "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==",
      "dev": true,
      "requires": {
        "graceful-fs": "^4.1.11",
        "micromatch": "^3.1.10",
        "readable-stream": "^2.0.2"
      }
    },
    "rechoir": {
      "version": "0.6.2",
      "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
      "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=",
      "dev": true,
      "requires": {
        "resolve": "^1.1.6"
      }
    },
    "regenerate": {
      "version": "1.4.2",
      "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz",
      "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==",
      "dev": true
    },
    "regenerate-unicode-properties": {
      "version": "10.0.1",
      "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.0.1.tgz",
      "integrity": "sha512-vn5DU6yg6h8hP/2OkQo3K7uVILvY4iu0oI4t3HFa81UPkhGJwkRwM10JEc3upjdhHjs/k8GJY1sRBhk5sr69Bw==",
      "dev": true,
      "requires": {
        "regenerate": "^1.4.2"
      }
    },
    "regenerator-runtime": {
      "version": "0.13.9",
      "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
      "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==",
      "dev": true
    },
    "regenerator-transform": {
      "version": "0.15.0",
      "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.0.tgz",
      "integrity": "sha512-LsrGtPmbYg19bcPHwdtmXwbW+TqNvtY4riE3P83foeHRroMbH6/2ddFBfab3t7kbzc7v7p4wbkIecHImqt0QNg==",
      "dev": true,
      "requires": {
        "@babel/runtime": "^7.8.4"
      }
    },
    "regex-not": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz",
      "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==",
      "dev": true,
      "requires": {
        "extend-shallow": "^3.0.2",
        "safe-regex": "^1.1.0"
      },
      "dependencies": {
        "extend-shallow": {
          "version": "3.0.2",
          "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
          "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
          "dev": true,
          "requires": {
            "assign-symbols": "^1.0.0",
            "is-extendable": "^1.0.1"
          }
        },
        "is-extendable": {
          "version": "1.0.1",
          "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
          "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
          "dev": true,
          "requires": {
            "is-plain-object": "^2.0.4"
          }
        }
      }
    },
    "regexpu-core": {
      "version": "5.0.1",
      "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.0.1.tgz",
      "integrity": "sha512-CriEZlrKK9VJw/xQGJpQM5rY88BtuL8DM+AEwvcThHilbxiTAy8vq4iJnd2tqq8wLmjbGZzP7ZcKFjbGkmEFrw==",
      "dev": true,
      "requires": {
        "regenerate": "^1.4.2",
        "regenerate-unicode-properties": "^10.0.1",
        "regjsgen": "^0.6.0",
        "regjsparser": "^0.8.2",
        "unicode-match-property-ecmascript": "^2.0.0",
        "unicode-match-property-value-ecmascript": "^2.0.0"
      }
    },
    "regjsgen": {
      "version": "0.6.0",
      "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.6.0.tgz",
      "integrity": "sha512-ozE883Uigtqj3bx7OhL1KNbCzGyW2NQZPl6Hs09WTvCuZD5sTI4JY58bkbQWa/Y9hxIsvJ3M8Nbf7j54IqeZbA==",
      "dev": true
    },
    "regjsparser": {
      "version": "0.8.4",
      "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.8.4.tgz",
      "integrity": "sha512-J3LABycON/VNEu3abOviqGHuB/LOtOQj8SKmfP9anY5GfAVw/SPjwzSjxGjbZXIxbGfqTHtJw58C2Li/WkStmA==",
      "dev": true,
      "requires": {
        "jsesc": "~0.5.0"
      },
      "dependencies": {
        "jsesc": {
          "version": "0.5.0",
          "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
          "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=",
          "dev": true
        }
      }
    },
    "remove-bom-buffer": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz",
      "integrity": "sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==",
      "dev": true,
      "requires": {
        "is-buffer": "^1.1.5",
        "is-utf8": "^0.2.1"
      }
    },
    "remove-bom-stream": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz",
      "integrity": "sha1-BfGlk/FuQuH7kOv1nejlaVJflSM=",
      "dev": true,
      "requires": {
        "remove-bom-buffer": "^3.0.0",
        "safe-buffer": "^5.1.0",
        "through2": "^2.0.3"
      }
    },
    "remove-trailing-separator": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz",
      "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=",
      "dev": true
    },
    "repeat-element": {
      "version": "1.1.4",
      "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz",
      "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==",
      "dev": true
    },
    "repeat-string": {
      "version": "1.6.1",
      "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz",
      "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=",
      "dev": true
    },
    "replace-ext": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz",
      "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==",
      "dev": true
    },
    "replace-homedir": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/replace-homedir/-/replace-homedir-1.0.0.tgz",
      "integrity": "sha1-6H9tUTuSjd6AgmDBK+f+xv9ueYw=",
      "dev": true,
      "requires": {
        "homedir-polyfill": "^1.0.1",
        "is-absolute": "^1.0.0",
        "remove-trailing-separator": "^1.1.0"
      }
    },
    "replacestream": {
      "version": "4.0.3",
      "resolved": "https://registry.npmjs.org/replacestream/-/replacestream-4.0.3.tgz",
      "integrity": "sha512-AC0FiLS352pBBiZhd4VXB1Ab/lh0lEgpP+GGvZqbQh8a5cmXVoTe5EX/YeTFArnp4SRGTHh1qCHu9lGs1qG8sA==",
      "dev": true,
      "requires": {
        "escape-string-regexp": "^1.0.3",
        "object-assign": "^4.0.1",
        "readable-stream": "^2.0.2"
      }
    },
    "require-directory": {
      "version": "2.1.1",
      "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
      "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
      "dev": true
    },
    "require-main-filename": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz",
      "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=",
      "dev": true
    },
    "resolve": {
      "version": "1.22.0",
      "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz",
      "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==",
      "dev": true,
      "requires": {
        "is-core-module": "^2.8.1",
        "path-parse": "^1.0.7",
        "supports-preserve-symlinks-flag": "^1.0.0"
      }
    },
    "resolve-dir": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz",
      "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=",
      "dev": true,
      "requires": {
        "expand-tilde": "^2.0.0",
        "global-modules": "^1.0.0"
      }
    },
    "resolve-options": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/resolve-options/-/resolve-options-1.1.0.tgz",
      "integrity": "sha1-MrueOcBtZzONyTeMDW1gdFZq0TE=",
      "dev": true,
      "requires": {
        "value-or-function": "^3.0.0"
      }
    },
    "resolve-url": {
      "version": "0.2.1",
      "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz",
      "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=",
      "dev": true
    },
    "ret": {
      "version": "0.1.15",
      "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz",
      "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==",
      "dev": true
    },
    "ripemd160": {
      "version": "2.0.2",
      "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz",
      "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==",
      "dev": true,
      "requires": {
        "hash-base": "^3.0.0",
        "inherits": "^2.0.1"
      }
    },
    "safe-buffer": {
      "version": "5.2.1",
      "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
      "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
      "dev": true
    },
    "safe-regex": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
      "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=",
      "dev": true,
      "requires": {
        "ret": "~0.1.10"
      }
    },
    "safer-buffer": {
      "version": "2.1.2",
      "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
      "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
      "dev": true
    },
    "semver": {
      "version": "6.3.0",
      "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
      "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
      "dev": true
    },
    "semver-greatest-satisfied-range": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz",
      "integrity": "sha1-E+jCZYq5aRywzXEJMkAoDTb3els=",
      "dev": true,
      "requires": {
        "sver-compat": "^1.5.0"
      }
    },
    "set-blocking": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
      "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
      "dev": true
    },
    "set-value": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz",
      "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==",
      "dev": true,
      "requires": {
        "extend-shallow": "^2.0.1",
        "is-extendable": "^0.1.1",
        "is-plain-object": "^2.0.3",
        "split-string": "^3.0.1"
      }
    },
    "sha.js": {
      "version": "2.4.11",
      "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz",
      "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==",
      "dev": true,
      "requires": {
        "inherits": "^2.0.1",
        "safe-buffer": "^5.0.1"
      }
    },
    "shallow-clone": {
      "version": "3.0.1",
      "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz",
      "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==",
      "dev": true,
      "requires": {
        "kind-of": "^6.0.2"
      }
    },
    "shasum": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz",
      "integrity": "sha1-5wEjENj0F/TetXEhUOVni4euVl8=",
      "dev": true,
      "requires": {
        "json-stable-stringify": "~0.0.0",
        "sha.js": "~2.4.4"
      }
    },
    "shasum-object": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/shasum-object/-/shasum-object-1.0.0.tgz",
      "integrity": "sha512-Iqo5rp/3xVi6M4YheapzZhhGPVs0yZwHj7wvwQ1B9z8H6zk+FEnI7y3Teq7qwnekfEhu8WmG2z0z4iWZaxLWVg==",
      "dev": true,
      "requires": {
        "fast-safe-stringify": "^2.0.7"
      }
    },
    "shell-quote": {
      "version": "1.7.3",
      "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.3.tgz",
      "integrity": "sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==",
      "dev": true
    },
    "simple-concat": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz",
      "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==",
      "dev": true
    },
    "snapdragon": {
      "version": "0.8.2",
      "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
      "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==",
      "dev": true,
      "requires": {
        "base": "^0.11.1",
        "debug": "^2.2.0",
        "define-property": "^0.2.5",
        "extend-shallow": "^2.0.1",
        "map-cache": "^0.2.2",
        "source-map": "^0.5.6",
        "source-map-resolve": "^0.5.0",
        "use": "^3.1.0"
      },
      "dependencies": {
        "debug": {
          "version": "2.6.9",
          "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
          "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
          "dev": true,
          "requires": {
            "ms": "2.0.0"
          }
        },
        "define-property": {
          "version": "0.2.5",
          "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
          "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
          "dev": true,
          "requires": {
            "is-descriptor": "^0.1.0"
          }
        },
        "is-accessor-descriptor": {
          "version": "0.1.6",
          "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
          "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
          "dev": true,
          "requires": {
            "kind-of": "^3.0.2"
          },
          "dependencies": {
            "kind-of": {
              "version": "3.2.2",
              "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
              "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
              "dev": true,
              "requires": {
                "is-buffer": "^1.1.5"
              }
            }
          }
        },
        "is-data-descriptor": {
          "version": "0.1.4",
          "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
          "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
          "dev": true,
          "requires": {
            "kind-of": "^3.0.2"
          },
          "dependencies": {
            "kind-of": {
              "version": "3.2.2",
              "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
              "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
              "dev": true,
              "requires": {
                "is-buffer": "^1.1.5"
              }
            }
          }
        },
        "is-descriptor": {
          "version": "0.1.6",
          "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
          "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
          "dev": true,
          "requires": {
            "is-accessor-descriptor": "^0.1.6",
            "is-data-descriptor": "^0.1.4",
            "kind-of": "^5.0.0"
          }
        },
        "kind-of": {
          "version": "5.1.0",
          "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
          "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
          "dev": true
        },
        "ms": {
          "version": "2.0.0",
          "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
          "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
          "dev": true
        }
      }
    },
    "snapdragon-node": {
      "version": "2.1.1",
      "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz",
      "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==",
      "dev": true,
      "requires": {
        "define-property": "^1.0.0",
        "isobject": "^3.0.0",
        "snapdragon-util": "^3.0.1"
      },
      "dependencies": {
        "define-property": {
          "version": "1.0.0",
          "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
          "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
          "dev": true,
          "requires": {
            "is-descriptor": "^1.0.0"
          }
        }
      }
    },
    "snapdragon-util": {
      "version": "3.0.1",
      "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz",
      "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==",
      "dev": true,
      "requires": {
        "kind-of": "^3.2.0"
      },
      "dependencies": {
        "kind-of": {
          "version": "3.2.2",
          "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
          "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
          "dev": true,
          "requires": {
            "is-buffer": "^1.1.5"
          }
        }
      }
    },
    "source-map": {
      "version": "0.5.7",
      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
      "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
      "dev": true
    },
    "source-map-resolve": {
      "version": "0.5.3",
      "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz",
      "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==",
      "dev": true,
      "requires": {
        "atob": "^2.1.2",
        "decode-uri-component": "^0.2.0",
        "resolve-url": "^0.2.1",
        "source-map-url": "^0.4.0",
        "urix": "^0.1.0"
      }
    },
    "source-map-support": {
      "version": "0.5.21",
      "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",
      "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
      "dev": true,
      "requires": {
        "buffer-from": "^1.0.0",
        "source-map": "^0.6.0"
      },
      "dependencies": {
        "source-map": {
          "version": "0.6.1",
          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
          "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
          "dev": true
        }
      }
    },
    "source-map-url": {
      "version": "0.4.1",
      "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz",
      "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==",
      "dev": true
    },
    "sparkles": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz",
      "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==",
      "dev": true
    },
    "spdx-correct": {
      "version": "3.1.1",
      "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz",
      "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==",
      "dev": true,
      "requires": {
        "spdx-expression-parse": "^3.0.0",
        "spdx-license-ids": "^3.0.0"
      }
    },
    "spdx-exceptions": {
      "version": "2.3.0",
      "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz",
      "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==",
      "dev": true
    },
    "spdx-expression-parse": {
      "version": "3.0.1",
      "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz",
      "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==",
      "dev": true,
      "requires": {
        "spdx-exceptions": "^2.1.0",
        "spdx-license-ids": "^3.0.0"
      }
    },
    "spdx-license-ids": {
      "version": "3.0.11",
      "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz",
      "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==",
      "dev": true
    },
    "split-string": {
      "version": "3.1.0",
      "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz",
      "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==",
      "dev": true,
      "requires": {
        "extend-shallow": "^3.0.0"
      },
      "dependencies": {
        "extend-shallow": {
          "version": "3.0.2",
          "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
          "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
          "dev": true,
          "requires": {
            "assign-symbols": "^1.0.0",
            "is-extendable": "^1.0.1"
          }
        },
        "is-extendable": {
          "version": "1.0.1",
          "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
          "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
          "dev": true,
          "requires": {
            "is-plain-object": "^2.0.4"
          }
        }
      }
    },
    "stack-trace": {
      "version": "0.0.10",
      "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz",
      "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=",
      "dev": true
    },
    "static-extend": {
      "version": "0.1.2",
      "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz",
      "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=",
      "dev": true,
      "requires": {
        "define-property": "^0.2.5",
        "object-copy": "^0.1.0"
      },
      "dependencies": {
        "define-property": {
          "version": "0.2.5",
          "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
          "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
          "dev": true,
          "requires": {
            "is-descriptor": "^0.1.0"
          }
        },
        "is-accessor-descriptor": {
          "version": "0.1.6",
          "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
          "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
          "dev": true,
          "requires": {
            "kind-of": "^3.0.2"
          },
          "dependencies": {
            "kind-of": {
              "version": "3.2.2",
              "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
              "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
              "dev": true,
              "requires": {
                "is-buffer": "^1.1.5"
              }
            }
          }
        },
        "is-data-descriptor": {
          "version": "0.1.4",
          "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
          "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
          "dev": true,
          "requires": {
            "kind-of": "^3.0.2"
          },
          "dependencies": {
            "kind-of": {
              "version": "3.2.2",
              "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
              "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
              "dev": true,
              "requires": {
                "is-buffer": "^1.1.5"
              }
            }
          }
        },
        "is-descriptor": {
          "version": "0.1.6",
          "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
          "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
          "dev": true,
          "requires": {
            "is-accessor-descriptor": "^0.1.6",
            "is-data-descriptor": "^0.1.4",
            "kind-of": "^5.0.0"
          }
        },
        "kind-of": {
          "version": "5.1.0",
          "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
          "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
          "dev": true
        }
      }
    },
    "stream-browserify": {
      "version": "2.0.2",
      "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz",
      "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==",
      "dev": true,
      "requires": {
        "inherits": "~2.0.1",
        "readable-stream": "^2.0.2"
      }
    },
    "stream-combiner2": {
      "version": "1.1.1",
      "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz",
      "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=",
      "dev": true,
      "requires": {
        "duplexer2": "~0.1.0",
        "readable-stream": "^2.0.2"
      }
    },
    "stream-exhaust": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/stream-exhaust/-/stream-exhaust-1.0.2.tgz",
      "integrity": "sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==",
      "dev": true
    },
    "stream-http": {
      "version": "3.2.0",
      "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-3.2.0.tgz",
      "integrity": "sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A==",
      "dev": true,
      "requires": {
        "builtin-status-codes": "^3.0.0",
        "inherits": "^2.0.4",
        "readable-stream": "^3.6.0",
        "xtend": "^4.0.2"
      },
      "dependencies": {
        "readable-stream": {
          "version": "3.6.0",
          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
          "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
          "dev": true,
          "requires": {
            "inherits": "^2.0.3",
            "string_decoder": "^1.1.1",
            "util-deprecate": "^1.0.1"
          }
        }
      }
    },
    "stream-shift": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz",
      "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==",
      "dev": true
    },
    "stream-splicer": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.1.tgz",
      "integrity": "sha512-Xizh4/NPuYSyAXyT7g8IvdJ9HJpxIGL9PjyhtywCZvvP0OPIdqyrr4dMikeuvY8xahpdKEBlBTySe583totajg==",
      "dev": true,
      "requires": {
        "inherits": "^2.0.1",
        "readable-stream": "^2.0.2"
      }
    },
    "string_decoder": {
      "version": "1.3.0",
      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
      "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
      "dev": true,
      "requires": {
        "safe-buffer": "~5.2.0"
      }
    },
    "string-width": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
      "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
      "dev": true,
      "requires": {
        "code-point-at": "^1.0.0",
        "is-fullwidth-code-point": "^1.0.0",
        "strip-ansi": "^3.0.0"
      }
    },
    "strip-ansi": {
      "version": "3.0.1",
      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
      "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
      "dev": true,
      "requires": {
        "ansi-regex": "^2.0.0"
      }
    },
    "strip-bom": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz",
      "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=",
      "dev": true,
      "requires": {
        "is-utf8": "^0.2.0"
      }
    },
    "subarg": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz",
      "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=",
      "dev": true,
      "requires": {
        "minimist": "^1.1.0"
      }
    },
    "supports-color": {
      "version": "5.5.0",
      "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
      "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
      "dev": true,
      "requires": {
        "has-flag": "^3.0.0"
      }
    },
    "supports-preserve-symlinks-flag": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
      "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
      "dev": true
    },
    "sver-compat": {
      "version": "1.5.0",
      "resolved": "https://registry.npmjs.org/sver-compat/-/sver-compat-1.5.0.tgz",
      "integrity": "sha1-PPh9/rTQe0o/FIJ7wYaz/QxkXNg=",
      "dev": true,
      "requires": {
        "es6-iterator": "^2.0.1",
        "es6-symbol": "^3.1.1"
      }
    },
    "syntax-error": {
      "version": "1.4.0",
      "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz",
      "integrity": "sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==",
      "dev": true,
      "requires": {
        "acorn-node": "^1.2.0"
      }
    },
    "textextensions": {
      "version": "3.3.0",
      "resolved": "https://registry.npmjs.org/textextensions/-/textextensions-3.3.0.tgz",
      "integrity": "sha512-mk82dS8eRABNbeVJrEiN5/UMSCliINAuz8mkUwH4SwslkNP//gbEzlWNS5au0z5Dpx40SQxzqZevZkn+WYJ9Dw==",
      "dev": true
    },
    "through": {
      "version": "2.3.8",
      "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
      "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=",
      "dev": true
    },
    "through2": {
      "version": "2.0.5",
      "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz",
      "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==",
      "dev": true,
      "requires": {
        "readable-stream": "~2.3.6",
        "xtend": "~4.0.1"
      }
    },
    "through2-filter": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz",
      "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==",
      "dev": true,
      "requires": {
        "through2": "~2.0.0",
        "xtend": "~4.0.0"
      }
    },
    "time-stamp": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz",
      "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=",
      "dev": true
    },
    "timers-browserify": {
      "version": "1.4.2",
      "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz",
      "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=",
      "dev": true,
      "requires": {
        "process": "~0.11.0"
      }
    },
    "to-absolute-glob": {
      "version": "2.0.2",
      "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz",
      "integrity": "sha1-GGX0PZ50sIItufFFt4z/fQ98hJs=",
      "dev": true,
      "requires": {
        "is-absolute": "^1.0.0",
        "is-negated-glob": "^1.0.0"
      }
    },
    "to-fast-properties": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
      "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=",
      "dev": true
    },
    "to-object-path": {
      "version": "0.3.0",
      "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz",
      "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=",
      "dev": true,
      "requires": {
        "kind-of": "^3.0.2"
      },
      "dependencies": {
        "kind-of": {
          "version": "3.2.2",
          "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
          "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
          "dev": true,
          "requires": {
            "is-buffer": "^1.1.5"
          }
        }
      }
    },
    "to-regex": {
      "version": "3.0.2",
      "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz",
      "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==",
      "dev": true,
      "requires": {
        "define-property": "^2.0.2",
        "extend-shallow": "^3.0.2",
        "regex-not": "^1.0.2",
        "safe-regex": "^1.1.0"
      },
      "dependencies": {
        "extend-shallow": {
          "version": "3.0.2",
          "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
          "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
          "dev": true,
          "requires": {
            "assign-symbols": "^1.0.0",
            "is-extendable": "^1.0.1"
          }
        },
        "is-extendable": {
          "version": "1.0.1",
          "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
          "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
          "dev": true,
          "requires": {
            "is-plain-object": "^2.0.4"
          }
        }
      }
    },
    "to-regex-range": {
      "version": "2.1.1",
      "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz",
      "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=",
      "dev": true,
      "requires": {
        "is-number": "^3.0.0",
        "repeat-string": "^1.6.1"
      }
    },
    "to-through": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/to-through/-/to-through-2.0.0.tgz",
      "integrity": "sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY=",
      "dev": true,
      "requires": {
        "through2": "^2.0.3"
      }
    },
    "tty-browserify": {
      "version": "0.0.1",
      "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz",
      "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==",
      "dev": true
    },
    "type": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz",
      "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==",
      "dev": true
    },
    "typedarray": {
      "version": "0.0.6",
      "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
      "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=",
      "dev": true
    },
    "uglify-js": {
      "version": "3.15.4",
      "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.4.tgz",
      "integrity": "sha512-vMOPGDuvXecPs34V74qDKk4iJ/SN4vL3Ow/23ixafENYvtrNvtbcgUeugTcUGRGsOF/5fU8/NYSL5Hyb3l1OJA==",
      "dev": true
    },
    "umd": {
      "version": "3.0.3",
      "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz",
      "integrity": "sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow==",
      "dev": true
    },
    "unc-path-regex": {
      "version": "0.1.2",
      "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz",
      "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=",
      "dev": true
    },
    "undeclared-identifiers": {
      "version": "1.1.3",
      "resolved": "https://registry.npmjs.org/undeclared-identifiers/-/undeclared-identifiers-1.1.3.tgz",
      "integrity": "sha512-pJOW4nxjlmfwKApE4zvxLScM/njmwj/DiUBv7EabwE4O8kRUy+HIwxQtZLBPll/jx1LJyBcqNfB3/cpv9EZwOw==",
      "dev": true,
      "requires": {
        "acorn-node": "^1.3.0",
        "dash-ast": "^1.0.0",
        "get-assigned-identifiers": "^1.2.0",
        "simple-concat": "^1.0.0",
        "xtend": "^4.0.1"
      }
    },
    "undertaker": {
      "version": "1.3.0",
      "resolved": "https://registry.npmjs.org/undertaker/-/undertaker-1.3.0.tgz",
      "integrity": "sha512-/RXwi5m/Mu3H6IHQGww3GNt1PNXlbeCuclF2QYR14L/2CHPz3DFZkvB5hZ0N/QUkiXWCACML2jXViIQEQc2MLg==",
      "dev": true,
      "requires": {
        "arr-flatten": "^1.0.1",
        "arr-map": "^2.0.0",
        "bach": "^1.0.0",
        "collection-map": "^1.0.0",
        "es6-weak-map": "^2.0.1",
        "fast-levenshtein": "^1.0.0",
        "last-run": "^1.1.0",
        "object.defaults": "^1.0.0",
        "object.reduce": "^1.0.0",
        "undertaker-registry": "^1.0.0"
      }
    },
    "undertaker-registry": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/undertaker-registry/-/undertaker-registry-1.0.1.tgz",
      "integrity": "sha1-XkvaMI5KiirlhPm5pDWaSZglzFA=",
      "dev": true
    },
    "unicode-canonical-property-names-ecmascript": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz",
      "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==",
      "dev": true
    },
    "unicode-match-property-ecmascript": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz",
      "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==",
      "dev": true,
      "requires": {
        "unicode-canonical-property-names-ecmascript": "^2.0.0",
        "unicode-property-aliases-ecmascript": "^2.0.0"
      }
    },
    "unicode-match-property-value-ecmascript": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz",
      "integrity": "sha512-7Yhkc0Ye+t4PNYzOGKedDhXbYIBe1XEQYQxOPyhcXNMJ0WCABqqj6ckydd6pWRZTHV4GuCPKdBAUiMc60tsKVw==",
      "dev": true
    },
    "unicode-property-aliases-ecmascript": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz",
      "integrity": "sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ==",
      "dev": true
    },
    "union-value": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",
      "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==",
      "dev": true,
      "requires": {
        "arr-union": "^3.1.0",
        "get-value": "^2.0.6",
        "is-extendable": "^0.1.1",
        "set-value": "^2.0.1"
      }
    },
    "unique-stream": {
      "version": "2.3.1",
      "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz",
      "integrity": "sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==",
      "dev": true,
      "requires": {
        "json-stable-stringify-without-jsonify": "^1.0.1",
        "through2-filter": "^3.0.0"
      }
    },
    "unset-value": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz",
      "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=",
      "dev": true,
      "requires": {
        "has-value": "^0.3.1",
        "isobject": "^3.0.0"
      },
      "dependencies": {
        "has-value": {
          "version": "0.3.1",
          "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz",
          "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=",
          "dev": true,
          "requires": {
            "get-value": "^2.0.3",
            "has-values": "^0.1.4",
            "isobject": "^2.0.0"
          },
          "dependencies": {
            "isobject": {
              "version": "2.1.0",
              "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz",
              "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=",
              "dev": true,
              "requires": {
                "isarray": "1.0.0"
              }
            }
          }
        },
        "has-values": {
          "version": "0.1.4",
          "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz",
          "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=",
          "dev": true
        }
      }
    },
    "upath": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz",
      "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==",
      "dev": true
    },
    "urix": {
      "version": "0.1.0",
      "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz",
      "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=",
      "dev": true
    },
    "url": {
      "version": "0.11.0",
      "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz",
      "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=",
      "dev": true,
      "requires": {
        "punycode": "1.3.2",
        "querystring": "0.2.0"
      },
      "dependencies": {
        "punycode": {
          "version": "1.3.2",
          "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz",
          "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=",
          "dev": true
        }
      }
    },
    "use": {
      "version": "3.1.1",
      "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",
      "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==",
      "dev": true
    },
    "util": {
      "version": "0.10.4",
      "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz",
      "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==",
      "dev": true,
      "requires": {
        "inherits": "2.0.3"
      },
      "dependencies": {
        "inherits": {
          "version": "2.0.3",
          "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
          "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
          "dev": true
        }
      }
    },
    "util-deprecate": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
      "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
      "dev": true
    },
    "v8flags": {
      "version": "3.2.0",
      "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz",
      "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==",
      "dev": true,
      "requires": {
        "homedir-polyfill": "^1.0.1"
      }
    },
    "validate-npm-package-license": {
      "version": "3.0.4",
      "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
      "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==",
      "dev": true,
      "requires": {
        "spdx-correct": "^3.0.0",
        "spdx-expression-parse": "^3.0.0"
      }
    },
    "value-or-function": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz",
      "integrity": "sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM=",
      "dev": true
    },
    "vinyl": {
      "version": "2.2.1",
      "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz",
      "integrity": "sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==",
      "dev": true,
      "requires": {
        "clone": "^2.1.1",
        "clone-buffer": "^1.0.0",
        "clone-stats": "^1.0.0",
        "cloneable-readable": "^1.0.0",
        "remove-trailing-separator": "^1.0.1",
        "replace-ext": "^1.0.0"
      }
    },
    "vinyl-fs": {
      "version": "3.0.3",
      "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz",
      "integrity": "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==",
      "dev": true,
      "requires": {
        "fs-mkdirp-stream": "^1.0.0",
        "glob-stream": "^6.1.0",
        "graceful-fs": "^4.0.0",
        "is-valid-glob": "^1.0.0",
        "lazystream": "^1.0.0",
        "lead": "^1.0.0",
        "object.assign": "^4.0.4",
        "pumpify": "^1.3.5",
        "readable-stream": "^2.3.3",
        "remove-bom-buffer": "^3.0.0",
        "remove-bom-stream": "^1.2.0",
        "resolve-options": "^1.1.0",
        "through2": "^2.0.0",
        "to-through": "^2.0.0",
        "value-or-function": "^3.0.0",
        "vinyl": "^2.0.0",
        "vinyl-sourcemap": "^1.1.0"
      }
    },
    "vinyl-source-stream": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/vinyl-source-stream/-/vinyl-source-stream-2.0.0.tgz",
      "integrity": "sha1-84pa+53R6Ttl1VBGmsYYKsT1S44=",
      "dev": true,
      "requires": {
        "through2": "^2.0.3",
        "vinyl": "^2.1.0"
      }
    },
    "vinyl-sourcemap": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz",
      "integrity": "sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY=",
      "dev": true,
      "requires": {
        "append-buffer": "^1.0.2",
        "convert-source-map": "^1.5.0",
        "graceful-fs": "^4.1.6",
        "normalize-path": "^2.1.1",
        "now-and-later": "^2.0.0",
        "remove-bom-buffer": "^3.0.0",
        "vinyl": "^2.0.0"
      },
      "dependencies": {
        "normalize-path": {
          "version": "2.1.1",
          "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz",
          "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=",
          "dev": true,
          "requires": {
            "remove-trailing-separator": "^1.0.1"
          }
        }
      }
    },
    "vinyl-sourcemaps-apply": {
      "version": "0.2.1",
      "resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz",
      "integrity": "sha1-q2VJ1h0XLCsbh75cUI0jnI74dwU=",
      "dev": true,
      "requires": {
        "source-map": "^0.5.1"
      }
    },
    "vm-browserify": {
      "version": "1.1.2",
      "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz",
      "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==",
      "dev": true
    },
    "which": {
      "version": "1.3.1",
      "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
      "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
      "dev": true,
      "requires": {
        "isexe": "^2.0.0"
      }
    },
    "which-module": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz",
      "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=",
      "dev": true
    },
    "wrap-ansi": {
      "version": "2.1.0",
      "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
      "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
      "dev": true,
      "requires": {
        "string-width": "^1.0.1",
        "strip-ansi": "^3.0.1"
      }
    },
    "wrappy": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
      "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
      "dev": true
    },
    "xtend": {
      "version": "4.0.2",
      "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
      "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
      "dev": true
    },
    "y18n": {
      "version": "3.2.2",
      "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz",
      "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==",
      "dev": true
    },
    "yargs": {
      "version": "7.1.2",
      "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.2.tgz",
      "integrity": "sha512-ZEjj/dQYQy0Zx0lgLMLR8QuaqTihnxirir7EwUHp1Axq4e3+k8jXU5K0VLbNvedv1f4EWtBonDIZm0NUr+jCcA==",
      "dev": true,
      "requires": {
        "camelcase": "^3.0.0",
        "cliui": "^3.2.0",
        "decamelize": "^1.1.1",
        "get-caller-file": "^1.0.1",
        "os-locale": "^1.4.0",
        "read-pkg-up": "^1.0.1",
        "require-directory": "^2.1.1",
        "require-main-filename": "^1.0.1",
        "set-blocking": "^2.0.0",
        "string-width": "^1.0.2",
        "which-module": "^1.0.0",
        "y18n": "^3.2.1",
        "yargs-parser": "^5.0.1"
      },
      "dependencies": {
        "yargs-parser": {
          "version": "5.0.1",
          "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.1.tgz",
          "integrity": "sha512-wpav5XYiddjXxirPoCTUPbqM0PXvJ9hiBMvuJgInvo4/lAOTZzUprArw17q2O1P2+GHhbBr18/iQwjL5Z9BqfA==",
          "dev": true,
          "requires": {
            "camelcase": "^3.0.0",
            "object.assign": "^4.1.0"
          }
        }
      }
    },
    "yargs-parser": {
      "version": "21.0.1",
      "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz",
      "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==",
      "dev": true
    }
  }
}
PK     M\=F  F    ecommerce2/ecommerce2.phpnu [        <?php

defined('ABSPATH') or exit;

// Check dependencies (either WooCommerce or Easy Digital Downloads)
if (! class_exists('WooCommerce') && ! class_exists('Easy_Digital_Downloads')) {
    return;
}

// load commonly used classes
require_once __DIR__ . '/includes/class-ecommerce.php';
require_once __DIR__ . '/includes/class-helper.php';
require_once __DIR__ . '/includes/class-tracker.php';
require_once __DIR__ . '/includes/class-worker.php';

// register setting
add_filter('mc4wp_settings', function ($options) {
    $defaults = array(
        'ecommerce' => 0
    );

    return array_merge($defaults, $options);
});

// setup objects
$plugin = new MC4WP_Plugin(__FILE__, MC4WP_PREMIUM_VERSION);
$opts = mc4wp_get_options();
$enabled = $opts['ecommerce'];

// setup admin stuffs?
if (is_admin()) {
    require_once __DIR__ . '/includes/class-admin.php';
    $admin = new MC4WP_Ecommerce_Admin($plugin, $enabled);
    $admin->add_hooks();
}

// are we enabled?

if ($enabled) {

    // setup tracker
    $tracker = new MC4WP_Ecommerce_Tracker();
    $tracker->hook();

    // setup ecommerce instance
    $mc4wp              = mc4wp();
    $mc4wp['ecommerce'] = $ecommerce = new MC4WP_Ecommerce($tracker);

    // setup queue
    $queue = new MC4WP_Queue('mc4wp_ecommerce_queue');

    // setup worker (adds items to queue)
    $worker = new MC4WP_Ecommerce_Worker($queue, $ecommerce);
    $worker->hook();

    // put in work when doing cron, work hard!
    if (defined('DOING_CRON') && DOING_CRON) {
        // don't work before "init", WooCommerce can't handle that.
        add_action('init', array( $worker, 'work' ));
    }

    // register command when running cli
    if (defined('WP_CLI') && WP_CLI) {
        require_once __DIR__ . '/includes/class-command.php';
        WP_CLI::add_command('mc4wp-ecommerce', 'MC4WP_Ecommerce_Command');
    }
}
PK     M\3PR	  	  $  ecommerce2/includes/class-worker.phpnu [        <?php

class MC4WP_Ecommerce_Worker
{

    /**
     * @var MC4WP_Queue
     */
    protected $queue;

    /**
     * @var MC4WP_Ecommerce
     */
    protected $ecommerce;

    /**
     * MC4WP_Ecommerce_Scheduler constructor.
     *
     * @param MC4WP_Queue $queue
     * @param MC4WP_Ecommerce $ecommerce
     */
    public function __construct(MC4WP_Queue $queue, MC4WP_Ecommerce $ecommerce)
    {
        $this->queue = $queue;
        $this->ecommerce = $ecommerce;
    }

    /**
     * Hook
     */
    public function hook()
    {
        $worker = $this;

        add_action('woocommerce_order_status_completed', array( $worker, 'schedule_add_order' ));
        add_action('edd_complete_purchase', array( $worker, 'schedule_add_order' ));

        // delete orders whenever order status changes from "completed" or "publish" to something else
        add_action('woocommerce_order_status_changed', function ($order_id, $old_status, $new_status) use ($worker) {
            if ($new_status !== 'completed' && $old_status === 'completed') {
                $worker->schedule_delete_order($order_id);
            }
        }, 10, 3);
        add_action('edd_update_payment_status', function ($order_id, $new_status, $old_status) use ($worker) {
            if ($new_status !== 'publish' && $old_status === 'publish') {
                $worker->schedule_delete_order($order_id);
            }
        }, 10, 3);
    }

    /**
     * Schedule to add an order
     *
     * @param int $order_id
     */
    public function schedule_add_order($order_id)
    {
        $this->queue->put(
            array(
            'type' => 'add',
            'order_id' => $order_id
            )
        );
    }

    /**
     * @param int $order_id
     */
    public function schedule_delete_order($order_id)
    {
        $this->queue->put(
            array(
                'type' => 'delete',
                'order_id' => $order_id,
            )
        );
    }

    /**
     * Work!
     */
    public function work()
    {
        while (($job = $this->queue->get())) {
            $type = $job->data['type'];
            $order_id = $job->data['order_id'];

            if ($type === 'delete') {
                $this->ecommerce->delete_order($order_id);
            } else {
                $this->ecommerce->add_order($order_id);
            }

            // remove job from queue
            $this->queue->delete($job);
        }
    }
}
PK     M\QK  K  %  ecommerce2/includes/class-tracker.phpnu [        <?php

class MC4WP_Ecommerce_Tracker
{

    /**
     * Add hooks
     */
    public function hook()
    {
        add_action('init', array( $this, 'listen' ));
        add_action('woocommerce_checkout_update_order_meta', array( $this, 'attach_order_meta' ), 50);
        add_action('edd_insert_payment', array( $this, 'attach_order_meta' ), 50);
    }

    /**
     * Listen for "mc_cid" and "mc_eid" in the URL.
     */
    public function listen()
    {
        static $keys = array(
            'mc_cid',
            'mc_eid',
        );

        $cookie_time = 14 * 24 * 60 * 60; // 14 days

        foreach ($keys as $key) {
            $value = $this->get_url_value($key);

            if (! empty($value)) {
                setcookie($key, $value, time() + $cookie_time, '/');
            }
        }
    }

    /**
     * @param int $order_id
     */
    public function attach_order_meta($order_id)
    {
        $campaign_id = $this->get_campaign_id();

        if (! empty($campaign_id)) {
            update_post_meta($order_id, 'mc_cid', $campaign_id);
        }

        $email_id = $this->get_email_id();
        if (! empty($email_id)) {
            update_post_meta($order_id, 'mc_eid', $email_id);
        }
    }

    /**
     * @param int $order_id (optional)
     *
     * @return string
     */
    public function get_campaign_id($order_id = null)
    {
        return $this->get_value($order_id, 'mc_cid');
    }


    /**
     * @param int $order_id (optional)
     *
     * @return string
     */
    public function get_email_id($order_id = null)
    {
        return $this->get_value($order_id, 'mc_eid');
    }

    /**
     * @param int $order_id (optional)
     * @param string $key
     * @return string
     */
    protected function get_value($order_id, $key)
    {
        $value = '';

        // first, get from order meta
        if ($order_id && is_numeric($order_id)) {
            $value = $this->get_meta_value($order_id, $key);
        }

        // then, get from URL
        if (empty($value)) {
            $value = $this->get_url_value($key);
        }

        // then, get from cookie
        if (empty($value)) {
            $value = $this->get_cookie_value($key);
        }

        // never use [UNIQID] (unreplaced email tag by Mailchimp, not sure why...)
        if ($value === '[UNIQID]') {
            $value = '';
        }

        return $value;
    }

    /**
     * @param string $key
     *
     * @return string
     */
    protected function get_url_value($key)
    {
        if (empty($_GET[ $key ])) {
            return '';
        }

        return sanitize_text_field($_GET[ $key ]);
    }

    /**
     * @param string $key
     *
     * @return string
     */
    protected function get_cookie_value($key)
    {
        if (empty($_COOKIE[ $key ])) {
            return '';
        }

        return sanitize_text_field($_COOKIE[ $key ]);
    }

    /**
     * @param int $order_id
     * @param string $key
     *
     * @return string
     */
    protected function get_meta_value($order_id, $key)
    {
        return (string) get_post_meta($order_id, $key, true);
    }
}
PK     M\G    3  ecommerce2/includes/views/track-previous-orders.phpnu [        <?php defined('ABSPATH') or exit; ?>

<div class="wrap" id="mc4wp-admin">
	<h1 class="mc4wp-page-title">eCommerce360: <?php _e('Record past orders', 'mc4wp-ecommerce'); ?></h1>

	<?php if ($untracked_order_count > 0) {
    ?>
		<p><?php printf(__('You have %s orders which are not yet recorded in Mailchimp. Do you want to send those orders to Mailchimp now?', 'mc4wp-ecommerce'), '<strong>' . $untracked_order_count . '</strong>'); ?></p>

		<form method="post" action="" id="add-untracked-orders-form">
			<p>
				<input type="submit" value="<?php esc_attr_e('Record Orders', 'mc4wp-ecommerce'); ?>" class="button" />
			</p>

			<input type="hidden" name="_mc4wp_action" value="ecommerce_add_untracked_orders" />
            <?php wp_nonce_field( '_mc4wp_action', '_wpnonce' ); ?>
			<input type="hidden" name="offset" value="0">
			<input type="hidden" name="limit" value="100" />
		</form>

		<div id="add-untracked-orders-progress"></div>

		<p class="description">
			<?php printf(__('This can take a while. If you have command line access, consider <a href="%s">using WP CLI to record all orders</a> as this greatly speeds up the process.', 'mailchimp-for-wp'), 'https://www.mc4wp.com/kb/ecommerce360-wp-cli-commands/'); ?>
		</p>
	<?php
} else {
        echo '<p>' . __('You have no untracked orders. Hurray!', 'mc4wp-ecommerce') . '</p>';
    } ?>

	<p>
		<a href="<?php echo admin_url('admin.php?page=mailchimp-for-wp-other'); ?>"><?php _e('Go back'); ?></a>
	</p>
</div>
PK     M\:pL    &  ecommerce2/includes/views/settings.phpnu [        <?php

defined('ABSPATH') or exit;

/** @var array $opts */
?>
<div class="mc4wp-margin-m">
	<h3><?php _e('eCommerce360', 'mailchimp-for-wp'); ?></h3>
	<p>
		<label>
			<?php /* hidden input field to send `0` when checkbox is not checked */ ?>
			<input type="hidden" name="mc4wp[ecommerce]" value="0" />
			<input type="checkbox" name="mc4wp[ecommerce]" value="1" <?php checked($opts['ecommerce'], 1); ?>>
			<?php echo sprintf(__('Enable <a href="%s">eCommerce360 tracking</a>.', 'mailchimp-for-wp'), 'https://www.mc4wp.com/kb/what-is-ecommerce/'); ?>
			<?php if ($opts['ecommerce']) {
    echo sprintf(__('Looking to <a href="%s">add all past orders to Mailchimp</a>?', 'mailchimp-for-wp'), admin_url('admin.php?page=mailchimp-for-wp-ecommerce'));
} ?>
		</label>
	</p>


</div>
PK     M\q_'  _'  '  ecommerce2/includes/class-ecommerce.phpnu [        <?php

/**
 * Class MC4WP_Ecommerce
 */
class MC4WP_Ecommerce
{

    /**
     * @var MC4WP_Ecommerce_Tracker
     */
    public $tracker;

    /**
     * @const string
     */
    const META_KEY = '_mc4wp_ecommerce_tracked';

    /**
     * Constructor
     *
     * @param MC4WP_Ecommerce_Tracker $tracker
     */
    public function __construct(MC4WP_Ecommerce_Tracker $tracker)
    {
        $this->tracker = $tracker;
    }

    /**
     * @param int $order_id
     *
     * @return boolean
     */
    public function delete_order($order_id)
    {
        $api = $this->get_api();
        $success = $api->delete_ecommerce_order($this->get_store_id(), $order_id);

        // remove meta on success
        if ($success) {
            delete_post_meta($order_id, self::META_KEY);

            // log message
            $this->get_log()->info(sprintf('eCommerce360 > Order %d deleted', $order_id));
        }

        return $success;
    }

    /**
     * @param int $order_id
     *
     * @return boolean
     */
    public function add_order($order_id)
    {
        $order_type = $this->get_order_type($order_id);

        if (is_string($order_type)) {
            $method = sprintf('add_%s_order', $order_type);
            $success = call_user_func(array( $this, $method ), $order_id);

            if ($success) {
                add_post_meta($order_id, self::META_KEY, 1);
            }

            return $success;
        }

        // unknown order type
        return false;
    }

    /**
     * @param array $data
     *
     * @return boolean
     */
    protected function add_order_data(array $data)
    {

        // add general order data
        $data = array_merge($this->get_general_order_data(), $data);

        // add campaign id & email id
        $campaign_id = $this->tracker->get_campaign_id($data['id']);
        $email_id = $this->tracker->get_email_id($data['id']);
        if (! empty($campaign_id) && ! empty($email_id)) {
            $data['campaign_id'] = $campaign_id;
            $data['email_id'] = $email_id;
        }

        /**
         * Filters the order data for all orders before it is sent to Mailchimp.
         *
         * @param array $data
         * @param int $order_id
         */
        $data = apply_filters('mc4wp_ecommerce360_order_data', $data);


        $api = $this->get_api();
        $success = $api->add_ecommerce_order($data);

        if ($success) {
            $this->get_log()->info(sprintf('eCommerce360 > Successfully added order %d', $data['id']));
        } else {
            $this->get_log()->error(sprintf('eCommerce360 > Error adding order %d: %s ', $data['id'], $api->get_error_message()));
        }

        return $success;
    }

    /**
     * @param $order_id
     *
     * @return boolean
     */
    public function add_woocommerce_order($order_id)
    {

        // prepare order data
        $order = wc_get_order($order_id);
        $items = $order->get_items();
        $data_items = array();

        foreach ($items as $item_id => $item) {
            $category = $this->get_lowest_term($item['product_id'], 'product_cat');

            // calculate cost of a single item
            $item_cost = $item['line_total'] / $item['qty'];

            $item_data = array(
                'product_id' => $item['product_id'],
                'product_name' => $this->strip_special_characters($item['name']),
                'qty' => $item['qty'],
                'category_id' => $category->term_id,
                'category_name' => $category->name,
                'cost' => $item_cost,
            );

            // find product
            $product_id = empty($item['variation_id']) ? $item['product_id'] : $item['variation_id'];
            $product = wc_get_product($product_id);

            if ($product instanceof WC_Product) {

                // add SKU if set
                $sku = $product->get_sku();
                if (! empty($sku)) {
                    $item_data['sku'] = $sku;
                }

                // use item price
                $item_data['cost'] = $product->get_price();
                $item_data['product_name'] = $this->strip_special_characters($product->get_title());

                // check if parent is set to prevent fatal error.... WooCommerce, ugh.
                if ($product instanceof WC_Product_Variation && $product->parent instanceof WC_Product && method_exists($product, 'get_formatted_variation_attributes')) {
                    $variations = $product->get_formatted_variation_attributes(true);
                    if (! empty($variations)) {
                        $item_data['product_name'] .= ' (' . $variations . ')';
                    }
                }
            }

            $data_items[] = $item_data;
        }

        $data = array(
            'id' => $order_id,
            'order_date' => date('Y-m-d', strtotime($order->order_date)),
            'email' => $order->billing_email,
            'total' => $order->get_total(),
            'tax' => $order->get_total_tax(),
            'shipping' => $order->get_total_shipping(),
            'items' => $data_items
        );

        return $this->add_order_data($data);
    }

    /**
     * @param int $order_id
     *
     * @return boolean
     */
    public function add_easy_digital_downloads_order($order_id)
    {
        $data_items = array();
        $items = edd_get_payment_meta_cart_details($order_id);

        foreach ($items as $item) {
            $item_name = $item['name'];

            // add price option name if this product has variable prices
            if (edd_has_variable_prices($item['id']) && isset($item['item_number']['options']['price_id']) && strlen($item['item_number']['options']['price_id']) > 0) {
                $price_option_name = edd_get_price_option_name($item['id'], $item['item_number']['options']['price_id']);

                if (! empty($price_option_name)) {
                    $item_name .= ' - ' . $price_option_name;
                }
            }

            $category = $this->get_lowest_term($item['id'], 'download_category');
            $item_data = array(
                'product_id' => $item['id'],
                'product_name' => $this->strip_special_characters($item_name),
                'qty' => $item['quantity'],
                'category_id' => $category->term_id,
                'category_name' => $category->name,
                'cost' => $item['price'],
            );

            // add product SKU, if given
            $sku = edd_get_download_sku($item['id']);
            if (! empty($sku) && $sku !== '-') {
                $item_data['sku'] = $sku;
            }

            $data_items[] = $item_data;
        }

        $payment_date = (string) edd_get_payment_completed_date($order_id);

        $data = array(
            'id' => $order_id,
            'order_date' => date('Y-m-d', strtotime($payment_date)),
            'email' => edd_get_payment_user_email($order_id),
            'total' => edd_get_payment_amount($order_id),
            'tax' => edd_get_payment_tax($order_id),
            'items' => $data_items,
        );

        return $this->add_order_data($data);
    }

    /**
     * @param int $order_id
     *
     * @return bool|string
     */
    private function get_order_type($order_id)
    {

        // make sure we got a post
        if (! ($order = get_post($order_id))) {
            $this->get_log()->warning(sprintf('eCommerce360 > Unknown order %d', $order_id));
            return false;
        }

        // figure out type of order (WooCommerce, Easy Digital Downloads, etc..)
        if ($order->post_type === 'edd_payment') {
            return 'easy_digital_downloads';
        } elseif ($order->post_type === 'shop_order') {
            return 'woocommerce';
        }

        $this->get_log()->warning(sprintf('eCommerce360 > Unknown order type for order %d', $order_id));
        return false;
    }

    /**
     * Sets up the general data (which doesn't differ between store engines)
     *
     * @return array
     */
    private function get_general_order_data()
    {
        $data = array(
            'store_name' => $this->get_store_name(),
            'store_id' => $this->get_store_id(),
        );

        return $data;
    }

    /**
     * TODO: Generate string of subcategories here.
     *
     * @param $post_id
     * @param $taxonomy
     *
     * @return mixed|object
     */
    private function get_lowest_term($post_id, $taxonomy)
    {
        $terms = get_the_terms($post_id, $taxonomy);

        if (empty($terms) || ! empty($terms['errors'])) {
            return (object) array(
                'term_id' => 1,
                'name' => 'No Category'
            );
        }

        $term_ids = array();
        $parent_ids = array();
        foreach ($terms as $term) {
            $term_ids[] = $term->term_id;

            if ($term->parent) {
                $parent_ids[] = $term->parent;
            }
        }

        // strip all parent categories
        $term_ids = array_diff($term_ids, $parent_ids);

        // return last one
        $term_id = array_pop($term_ids);

        return get_term($term_id, $taxonomy);
    }

    /**
     * @return MC4WP_API
     */
    private function get_api()
    {
        return mc4wp_get_api();
    }

    /**
     * @return MC4WP_Debug_Log
     */
    private function get_log()
    {
        return mc4wp('log');
    }

    /**
     * @return string
     */
    private function get_store_id()
    {
        return (string) md5(parse_url(get_option('siteurl', ''), PHP_URL_HOST));
    }

    /**
     * @return string
     */
    private function get_store_name()
    {
        return (string) get_option('blogname', '');
    }

    /**
     * Remove all special characters from a string except for the ones listed below.
     *
     * @param string $string
     * @return string
     */
    private function strip_special_characters($string)
    {
        return preg_replace('/[^A-Za-z0-9\-\s\.,:;!()]/', '', $string);
    }
}
PK     M\nK
  
  $  ecommerce2/includes/class-helper.phpnu [        <?php


class MC4WP_Ecommerce_Helper
{

    /**
     * @var WPDB
     */
    private $db;

    /**
     * @var int
     */
    private $order_count;

    /**
     * MC4WP_Ecommerce_Helper constructor.
     */
    public function __construct()
    {
        $this->db = $GLOBALS['wpdb'];
    }

    /**
     * @param int $offset
     * @param int $limit
     *
     * @return array
     */
    public function get_untracked_order_ids($offset = 0, $limit = 1000)
    {
        $sql = $this->get_untracked_order_sql();
        $sql .= " ORDER BY p.ID DESC LIMIT %d, %d";
        $query = $this->db->prepare($sql, MC4WP_Ecommerce::META_KEY, $offset, $limit);
        $results = $this->db->get_col($query);
        return $results;
    }

    /**
     * @return int
     */
    public function get_untracked_order_count()
    {
        if (! is_null($this->order_count)) {
            return $this->order_count;
        }

        $sql = $this->get_untracked_order_sql('COUNT(DISTINCT p.ID)');
        $query = $this->db->prepare($sql, MC4WP_Ecommerce::META_KEY);
        return (int) $this->db->get_var($query);
    }

    /**
     * Fetches post ID's for both WooCommerce and Easy Digital Downloads orders
     *
     * @param string $columns The columns to select
     *
     * @return string
     */
    private function get_untracked_order_sql($columns = 'DISTINCT p.ID')
    {
        $post_types = array( 'edd_payment', 'shop_order' );
        $order_statuses = array( 'wc-completed', 'publish' );

        /**
         * Filters the order statuses to send to Mailchimp
         *
         * @param array $order_statuses
         */
        $order_statuses = apply_filters('mc4wp_ecommerce360_order_statuses', $order_statuses);

        // generate the SQL string (unprepared)
        $sql = "SELECT {$columns} FROM {$this->db->posts} p";
        $sql .= " LEFT JOIN {$this->db->postmeta} pm ON pm.post_id = p.ID";
        $sql .= sprintf(" WHERE p.post_type IN ( %s )", "'" . join("', '", $this->db->_escape($post_types)) . "'");
        $sql .= sprintf(" AND p.post_status IN ( %s )", "'" . join("', '", $this->db->_escape($order_statuses)) . "'");

        // Meta key to store whether order was tracked should not exist
        $sql .= " AND NOT EXISTS (";
        $sql .= " SELECT meta_key FROM {$this->db->postmeta} pm2";
        $sql .= " WHERE pm2.meta_key = %s";
        $sql .= " AND pm2.post_id = p.ID";
        $sql .= ")";

        // Email meta (or associated user account) should be set
        $sql .= " AND ( pm.meta_key = '_billing_email' OR pm.meta_key = '_edd_payment_user_email' OR pm.meta_key = '_customer_user' )";
        $sql .= " AND pm.meta_value != ''";

        return $sql;
    }
}
PK     M\B֐e!%  !%  #  ecommerce2/includes/class-admin.phpnu [        <?php

/**
 * Class MC4WP_Ecommerce_Admin
 *
 * @ignore
 */
class MC4WP_Ecommerce_Admin
{

    /**
     * @var MC4WP_Plugin
     */
    protected $plugin;

    /**
     * @var boolean
     */
    protected $enabled;

    /**
     * MC4WP_Ecommerce_Admin constructor.
     *
     * @param MC4WP_Plugin $plugin
     * @param boolean $enabled
     */
    public function __construct(MC4WP_Plugin $plugin, $enabled = false)
    {
        $this->plugin = $plugin;
        $this->enabled = $enabled;
    }

    /**
     * Add hooks
     */
    public function add_hooks()
    {
        # Pages
        add_action('mc4wp_admin_other_settings', array( $this, 'show_settings_page' ));
        add_action('admin_notices', array( $this, 'show_api_v3_notice' ));

        # Add notice when eCommerce is enabled
        add_action('mc4wp_save_settings', array( $this, 'maybe_show_notice' ), 10, 2);

        # Listen to form for enabling e-commerce v3
        add_action('mc4wp_admin_enable_ecommerce_v3', array( $this, 'enable_ecommerce_v3' ), 90);

        # AJAX hooks
        add_action('wp_ajax_mc4wp_ecommerce_add_untracked_orders', array( $this, 'add_untracked_orders' ));
        add_action('wp_ajax_mc4wp_ecommerce_get_untracked_orders_count', array( $this, 'get_untracked_orders_count' ));

        # Hook into regular form submit (non-AJAX)
        add_action('mc4wp_admin_ecommerce_add_untracked_orders', array( $this, 'add_untracked_orders' ));

        add_action('admin_menu', array( $this, 'register_hidden_pages' ));

        if ($this->enabled) {
            // add new WooCommerce order action to manually add / delete order from Mailchimp
            add_filter('woocommerce_order_actions', array( $this, 'add_woocommerce_order_action' ));
            add_action('woocommerce_order_action_mailchimp_ecommerce', array( $this, 'run_woocommerce_order_action' ));
        }
    }

    /**
     * @param array $actions
     * @return array
     */
    public function add_woocommerce_order_action($actions)
    {
        global $theorder;
        $tracked = !! get_post_meta($theorder->id, '_mc4wp_ecommerce_tracked', true);
        $actions['mailchimp_ecommerce'] = $tracked ? __('Delete from Mailchimp', 'mailchimp-for-wp') : __('Add to Mailchimp', 'mailchimp-for-wp');
        return $actions;
    }

    /**
     * @param WC_Order $order
     */
    public function run_woocommerce_order_action($order)
    {
        $tracked = !! get_post_meta($order->id, '_mc4wp_ecommerce_tracked', true);
        $ecommerce = $this->get_ecommerce();

        if ($tracked) {
            $ecommerce->delete_order($order->id);
        } else {
            $ecommerce->add_woocommerce_order($order->id);
        }
    }

    /**
     * Registers menu page without a parent item.
     */
    public function register_hidden_pages()
    {
        add_submenu_page(null, 'Record orders', '', 'manage_options', 'mailchimp-for-wp-ecommerce', array( $this, 'show_track_orders_page' ));
    }

    /**
     * Register menu pages
     *
     * @param array $items
     *
     * @return array
     */
    public function add_menu_item(array $items)
    {
        $item = array(
            'title' => __('Mailchimp E-Commerce', 'mc4wp-ecommerce'),
            'text' => __('E-Commerce', 'mc4wp-ecommerce'),
            'slug' => 'ecommerce',
            'callback' => array( $this, 'show_settings_page' )
        );


        $items[] = $item;

        return $items;
    }

    /**
     * @param array $opts
     */
    public function show_settings_page($opts)
    {
        require __DIR__ . '/views/settings.php';
    }

    /**
     * Shows the wizard
     */
    public function show_track_orders_page()
    {
        $helper = new MC4WP_Ecommerce_Helper();
        $untracked_order_count = $helper->get_untracked_order_count();

        wp_enqueue_script('mc4wp-ecommerce-admin', $this->plugin->url('/assets/js/admin.js'), array(), $this->plugin->version(), true);
        wp_localize_script('mc4wp-ecommerce-admin', 'mc4wp_ecommerce', array(
            'untracked_order_count' => $untracked_order_count
        ));

        require __DIR__ . '/views/track-previous-orders.php';
    }

    /**
     * Starts adding untracked orders to Mailchimp. This can take a while..
     */
    public function add_untracked_orders()
    {

        // don't lock session (because we poll for progress)
        @session_write_close();

        // no time limit
        @set_time_limit(0);

        $helper = new MC4WP_Ecommerce_Helper();
        $ecommerce = $this->get_ecommerce();

        $offset = isset($_REQUEST['offset']) ? (int) $_REQUEST['offset'] : 0;
        $limit = isset($_REQUEST['limit']) ? (int) $_REQUEST['limit'] : 100;

        // clear tracking cookies for now.
        unset($_COOKIE['mc_cid']);
        unset($_COOKIE['mc_eid']);

        // loop through order id's
        $order_ids = $helper->get_untracked_order_ids($offset, $limit);
        foreach ($order_ids as $order_id) {
            $success = $ecommerce->add_order($order_id);
        }

        // respond to request
        if (defined('DOING_AJAX') && DOING_AJAX) {
            $this->get_untracked_orders_count();
        }
    }

    /**
     * Gets the number of untracked orders and outputs it
     */
    public function get_untracked_orders_count()
    {
        @session_write_close();
        $helper = new MC4WP_Ecommerce_Helper();
        $count = $helper->get_untracked_order_count();
        echo (string) $count;
        exit;
    }

    /**
     * This asks the user to record previous orders after eCommerce360 tracking was enabled
     *
     * @param array $settings
     * @param array $old_settings
     */
    public function maybe_show_notice($settings, $old_settings)
    {
        if ($settings['ecommerce'] && ! $old_settings['ecommerce']) {
            $text = __('You just enabled eCommerce360 - do you want to <a href="%s">add all past orders to Mailchimp</a>?', 'mc4wp-ecommerce');
            $this->get_admin_messages()->flash(sprintf($text, admin_url('admin.php?page=mailchimp-for-wp-ecommerce')));
        }
    }

    /**
     * Disable old e-commerce v2, enable v3 & go to wizard.
     */
    public function enable_ecommerce_v3()
    {
        // disable old option
        $options = get_option('mc4wp', array());
        $options['ecommerce'] = 0;
        update_option('mc4wp', $options);

        // remove old meta key from all orders
        delete_post_meta_by_key('_mc4wp_ecommerce_tracked');

        // enable new option
        update_option('mc4wp_ecommerce', array( 'enable_object_tracking' => 1 ));

        // redirect to wizard
        wp_redirect(admin_url('admin.php?page=mailchimp-for-wp-ecommerce'));
        exit;
    }

    /**
     * Show notice asking user to switch e-commerce over to API v3
     */
    public function show_api_v3_notice()
    {
        global $pagenow;

        // only show on mailchimp for wordpress pages & plugins overview page
        if ((! isset($_GET['page']) || stripos($_GET['page'], 'mailchimp-for-wp') === false) && $pagenow !== 'plugins.php') {
            return;
        }

        // only show if running core v4.0 (for API v3 classes)
        if (version_compare(MC4WP_VERSION, '4.0', '<')) {
            return;
        }

        $settings = mc4wp_get_options();

        // this means switch was made already or not using ecommerce
        if (empty($settings['ecommerce'])) {
            return;
        }

        if (class_exists('WooCommerce')) {
            echo '<div class="notice notice-warning">';
            echo '<p><strong>Mailchimp for WordPress: Upgrade your e-commerce integration</strong></p>';
            echo '<p>You are on Mailchimp\'s older API for your e-commerce integration. Would you like to switch to the new API now?</p>';
            echo '<p>' . sprintf('Please <a href="%s">read this for more information about the new & improved e-commerce integration</a>.', 'https://www.mc4wp.com/kb/upgrading-ecommerce-api-v3/') . '</p>';
            echo '<form method="POST">';
            echo '<input type="hidden" name="_mc4wp_action" value="enable_ecommerce_v3" />';
            wp_nonce_field( '_mc4wp_action' );
            echo '<p><input type="submit" class="button" value="Switch to e-commerce API v3" /></p>';
            echo '</form>';
            echo '</div>';
        } else {
            echo '<div class="notice notice-warning">';
            echo '<p><strong>Mailchimp for WordPress: Important news about your e-commerce integration</strong></p>';
            echo '<p>You are currently still using Mailchimp\'s older API for your e-commerce integration. This API will close down at the end of 2016.</p>';
            echo '<p>';
            echo 'Because we are focusing our efforts on WooCommerce, we are not developing an Easy Digital Downloads integration for Mailchimp\'s newer API. ';
            echo sprintf('You can keep using the current integration for now, but please <a href="%s">switch to EDD\'s own Mailchimp integration</a> before January 1, 2017.', 'https://easydigitaldownloads.com/downloads/mail-chimp/?ref=4676&campaign=mc4wp-api-v3');
            echo '</p>';
            echo '</div>';
        }
    }

    /**
     * @return MC4WP_Ecommerce
     */
    private function get_ecommerce()
    {
        return mc4wp('ecommerce');
    }

    /**
     * @return MC4WP_Admin_Messages
     */
    private function get_admin_messages()
    {
        return mc4wp('admin.messages');
    }
}
PK     M\d    %  ecommerce2/includes/class-command.phpnu [        <?php
defined('ABSPATH') or exit;

class MC4WP_Ecommerce_Command extends WP_CLI_Command
{

    /**
     * Tracks the order with the given ID in Mailchimp
     *
     * @param $args
     * @param $assoc_args
     *
     * ## OPTIONS
     *
     * <order_id>
     * : Order to add to Mailchimp
     *
     * ## EXAMPLES
     *
     *     wp mc4wp-ecommerce add-order
     *
     * @synopsis <order_id>
     *
     * @subcommand add-order
     */
    public function add_order($args, $assoc_args = array())
    {
        $order_id = (int) $args[0];
        $success = $this->ecommerce()->add_order($order_id);

        if ($success) {
            WP_CLI::success('Success!');
        } else {
            WP_CLI::error('Error!');
        }
    }

    /**
     * Deletes the order with the given ID in Mailchimp
     *
     * @param $args
     * @param $assoc_args
     *
     * ## OPTIONS
     *
     * <order_id>
     * : Order to delete in Mailchimp
     *
     * ## EXAMPLES
     *
     *     wp mc4wp-ecommerce delete-order
     *
     * @synopsis <order_id>
     *
     * @subcommand delete-order
     */
    public function delete_order($args, $assoc_args = array())
    {
        $order_id = (int) $args[0];
        $success = $this->ecommerce()->delete_order($order_id);

        if ($success) {
            WP_CLI::success('Success!');
        } else {
            WP_CLI::error('Error!');
        }
    }

    /**
     * Adds multiple untracked orders, starting with the most recent orders.
     *
     * @param $args
     * @param $assoc_args
     *
     * ## OPTIONS
     *
     * [--<limit>=<limit>]
     * : Limit # of orders to this number. Default: 1000
     *
     * [--offset=<offset>]
     * : Skip the first # orders. Default: 0
     *
     * ## EXAMPLES
     *
     *     wp mc4wp-ecommerce add-orders --limit=5000 --offset=1000
     *
     * @synopsis [--limit=<limit>] [--offset=<offset>]
     *
     * @subcommand add-orders
     */
    public function add_orders($args, $assoc_args = array())
    {
        $offset = empty($assoc_args['offset']) ? 0 : (int) $assoc_args['offset'];
        $limit = empty($assoc_args['limit']) ? 1000 : (int) $assoc_args['limit'];

        $helper = new MC4WP_Ecommerce_Helper();
        $order_ids = $helper->get_untracked_order_ids($offset, $limit);
        $count = count($order_ids);

        WP_CLI::line(sprintf("%d untracked orders found.", $count));

        if ($count > 0) {
            $ecommerce = $this->ecommerce();

            // show progress bar
            $notify = \WP_CLI\Utils\make_progress_bar(__('Sending orders to Mailchimp', 'mc4wp-ecommerce'), $count);

            foreach ($order_ids as $order_id) {
                $success = $ecommerce->add_order($order_id);
                $notify->tick();
            }

            $notify->finish();
        }
    }

    /**
     * @return MC4WP_Ecommerce
     */
    private function ecommerce()
    {
        return mc4wp('ecommerce');
    }
}
PK     M\I"c
  c
    ecommerce2/assets/js/admin.jsnu [        !function n(o,s,i){function c(t,e){if(!s[t]){if(!o[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(u)return u(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}r=s[t]={exports:{}},o[t][0].call(r.exports,function(e){return c(o[t][1][e]||e)},r,r.exports,n,o,s,i)}return s[t].exports}for(var u="function"==typeof require&&require,e=0;e<i.length;e++)c(i[e]);return c}({1:[function(e,t,r){"use strict";t.exports=function(e,t){var r=document.createElement("div"),n=100/t,o=0;function s(){return 100<=o}return e.style.height="40px",e.style.width="100%",e.style.border="1px solid #ccc",e.style.lineHeight="40px",r.style.boxSizing="border-box",r.style.backgroundColor="#cc4444",r.style.textAlign="center",r.style.fontWeight="bold",r.style.height="100%",r.style.color="white",r.style.fontSize="16px",r.style.width=o+"%",e.appendChild(r),{tick:function(e){s()||(o+=n*(e=void 0===e?1:e),r.style.width=o+"%",r.innerText=parseInt(o)+"%",s()&&(r.innerText="Done!"))},done:s}}},{}],2:[function(e,t,r){"use strict";t.exports=function(e,t){var r=new XMLHttpRequest;return r.onreadystatechange=function(){4===this.readyState&&(200<=this.status&&this.status<400?t.onSuccess&&t.onSuccess(this.responseText):t.onError&&t.onError(this.status,this.responseText))},r.open(t.method||"GET",e,!0),t.method&&"POST"===t.method.toUpperCase()&&r.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),r.send(t.data||{}),r}},{}],3:[function(e,t,r){"use strict";var n,o=e("./_progress-bar.js"),s=e("./_request.js"),i=mc4wp_ecommerce.untracked_order_count,c=document.getElementById("add-untracked-orders-form"),u=document.getElementById("add-untracked-orders-progress");function a(e){n.tick(i-e),i=e}function d(){var e;n.done()?window.setTimeout(function(){window.location.reload()},2500):(e=ajaxurl+"?action=mc4wp_ecommerce_get_untracked_orders_count",s(e,{onSuccess:function(e){a(e),window.setTimeout(d,2e3)}}))}c&&c.addEventListener("submit",function(e){e.preventDefault(),c.querySelector('input[type="submit"]').setAttribute("disabled",!0),n=new o(u,i),window.setTimeout(d,500),function r(){var e=parseInt(c.elements.limit.value);var t=parseInt(c.elements.offset.value);t=ajaxurl+"?action=mc4wp_ecommerce_add_untracked_orders&offset="+t+"&limit="+e;var n=i;s(t,{onSuccess:function(e){var t;a(e),n<=e?((t=document.createElement("p")).style.color="red",t.innerHTML='We\'re stuck. Please <a href="admin.php?page=mailchimp-for-wp-other">check the debug log</a> for errors.',u.parentNode.appendChild(t)):0<e&&r()},onError:function(e,t){504==e&&r()}})}()})},{"./_progress-bar.js":1,"./_request.js":2}]},{},[3]);PK     M\ڊ!_  _  !  ecommerce2/assets/src/js/admin.jsnu [        'use strict';


var ProgressBar = require('./_progress-bar.js');
var request = require('./_request.js');
var count = mc4wp_ecommerce.untracked_order_count;
var form = document.getElementById('add-untracked-orders-form');
var progressBarMount = document.getElementById('add-untracked-orders-progress');
var progress_bar,
	progress_poll,
	worker;

// hook into form submit
if( form ) {
	form.addEventListener('submit', start );
}

function start(e) {

	// prevent default form submit
	e.preventDefault();

	var button = form.querySelector('input[type="submit"]');
	button.setAttribute('disabled', true);

	// init progress bar
	progress_bar = new ProgressBar(progressBarMount, count);
	progress_poll = window.setTimeout(fetchProgress, 500);
	work();
}

function work() {
	var limit = parseInt( form.elements["limit"].value );
	var offset = parseInt( form.elements["offset"].value );
	var url = ajaxurl + "?action=mc4wp_ecommerce_add_untracked_orders&offset=" + offset + "&limit=" + limit;
	var previousCount = count;

	worker = request( url, {
		onSuccess: function(data) {
			updateProgress(data);

			if( previousCount <= data ) {
				// We're not making progress..
				var textElement = document.createElement('p');
				textElement.style.color = 'red';
				textElement.innerHTML = "We're stuck. Please <a href=\"admin.php?page=mailchimp-for-wp-other\">check the debug log</a> for errors.";
				progressBarMount.parentNode.appendChild(textElement);
			} else if( data > 0 ) {
				// Keep going if there's more
				work();
			}
		},

		onError: function( code, response ) {
			// if we got a 504 Gateway Timeout, try again.
			if( code == 504 ) {
				work();
			}
		}
	});
}

function updateProgress(new_count) {
	progress_bar.tick( count - new_count );
	count = new_count;
}

function fetchProgress() {
	if( progress_bar.done() ) {

		// refresh page
		window.setTimeout( function() {
			window.location.reload()
		}, 2500 );

		return;
	}

	var url = ajaxurl + "?action=mc4wp_ecommerce_get_untracked_orders_count";
	request( url, {
		onSuccess: function(data) {
			updateProgress(data);
			window.setTimeout( fetchProgress, 2000 );
		}
	});
}PK     M\H    )  ecommerce2/assets/src/js/_progress-bar.jsnu [        function ProgressBar( element, count ) {
	var wrapper = element,
		bar = document.createElement('div'),
		step_size = 100 / count,
		progress = 0;

	wrapper.style.height = "40px";
	wrapper.style.width = "100%";
	wrapper.style.border = "1px solid #ccc";
	wrapper.style.lineHeight = "40px";

	bar.style.boxSizing = 'border-box';
	bar.style.backgroundColor = '#cc4444';
	bar.style.textAlign = 'center';
	bar.style.fontWeight = 'bold';
	bar.style.height = "100%";
	bar.style.color = 'white';
	bar.style.fontSize = '16px';
	bar.style.width = progress + "%";
	wrapper.appendChild( bar );

	function tick( ticks ) {
		if( done() ) { return; }

		ticks = ticks === undefined ? 1 : ticks;
		progress += ( step_size * ticks );
		bar.style.width = progress + "%";

		bar.innerText = parseInt( progress ) + "%";

		if( done() ) {
			bar.innerText = 'Done!';
		}
	}

	function done() {
		return progress >= 100;
	}

	return {
		'tick': tick,
		'done': done
	}
}

module.exports = ProgressBar;PK     M\G    $  ecommerce2/assets/src/js/_request.jsnu [        function request( url, options ) {

	var request = new XMLHttpRequest();
	request.onreadystatechange = function() {
		if (this.readyState === 4) {
			if (this.status >= 200 && this.status < 400) {
				options.onSuccess && options.onSuccess(this.responseText);
			} else {
				options.onError && options.onError( this.status, this.responseText);
			}
		}
	};
	request.open(options.method || 'GET', url, true);

	if( options.method && options.method.toUpperCase() === 'POST' ) {
		request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
	}

	request.send( options.data || {} );
	return request;
}

module.exports = request;PK     M\	  	  *  includes/class-required-plugins-notice.phpnu [        <?php

class MC4WP_Required_Plugins_Notice
{

    /**
     * @var array
     */
    protected $required_plugins = array();

    /**
     * @var string
     */
    protected $plugin_name = '';

    /**
     * The required capability
     */
    const CAPABILITY = 'install_plugins';

    /**
     * $dependencies is an array of required plugins, in the following format:
     *
     * 'plugin-slug' => array(
     *    'name' => "Hello Dolly",   // name of plugin
     *    'version' => "1.0"         // required version
     * )
     *
     * @param string $plugin_name
     * @param array $required_plugins
     */
    public function __construct($plugin_name, array $required_plugins)
    {
        $this->plugin_name = $plugin_name;
        $this->required_plugins = $required_plugins;
    }

    /**
     * Add hooks
     */
    public function add_hooks()
    {
        add_action('admin_notices', array( $this, 'notice' ));
    }

    /**
     * Show notice
     */
    public function notice()
    {

        // only show to users who have the required capability
        if (! current_user_can(self::CAPABILITY)) {
            return;
        }

        add_thickbox();

        echo '<div class="notice is-dismissible notice-info">';

        # List of required plugins
        echo '<p>';
        echo sprintf(__("%s requires the following plugin(s):", 'mailchimp-for-wp'), '<strong>' . $this->plugin_name . '</strong>');
        echo '<ul class="ul-square">';
        foreach ($this->required_plugins as $plugin) {
            $link_class = '';
            $in_wordpress_repo = preg_match('/wordpress\.org\/plugins\/([\w+-]+)/i', $plugin['url'], $matches);

            if ($in_wordpress_repo && isset($matches[1])) {
                $slug = $matches[1];
                $plugin['url'] = network_admin_url('plugin-install.php?tab=plugin-information&plugin=' . $slug . '&TB_iframe=true&width=600&height=550');
                $link_class = 'thickbox';
            }

            echo sprintf('<li><a href="%s" class="%s">%s</a> (' . __('version %s or higher', 'mailchimp-for-wp') . ')</li>', $plugin['url'], $link_class, $plugin['name'], $plugin['version']);
        }
        echo '</ul>';

        echo __('Either install or update the required plugins. If you already have the required version(s) installed, please do not forget to activate the plugins.', 'mailchimp-for-wp');
        echo '</p>';

        echo '</div>';
    }
}
PK     M\g    /  logging/includes/class-dashboard-log-widget.phpnu [        <?php

class MC4WP_Dashboard_Log_Widget
{

    /**
     * Factory method
     */
    public static function make()
    {
        $widget = new self;
        $widget->output();
    }

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->logger = new MC4WP_Logger();
    }

    /**
     * Output the widget code
     */
    public function output()
    {
        $items = $this->logger->find(
            array(
                'limit' => 5,
                'include_errors' => false
            )
        );

        if (empty($items)) {
            echo '<p>' . __("No log entries found.", 'mailchimp-for-wp') . '</p>';
        } else {
            ?>
			<style type="text/css">
				.mc4wp-dashboard-table {
					table-layout: fixed;
					width: 100%;
				}

				.mc4wp-dashboard-table th {
					text-align: left;
				}

				.mc4wp-dashboard-table td {
					overflow: hidden;
				}
			</style>

			<table class="mc4wp-dashboard-table">
			<thead>
				<tr>
					<th><?php _e('Email address', 'mailchimp-for-wp'); ?></th>
					<th><?php _e('Date', 'mailchimp-for-wp'); ?></th>
				</tr>
			</thead>
			<?php foreach ($items as $item) {
                ?>
				<tr>
					<td><a href="<?php echo admin_url('admin.php?page=mailchimp-for-wp-reports&tab=log#item-' . $item->ID) ?>"><?php echo esc_html($item->email_address); ?></a></td>
					<td><?php echo mc4wp_logging_gmt_date_format($item->datetime, 'M, j H:i'); ?></td>
				</tr>
			<?php
            } ?>
			</table>
			<?php
        }

        echo '<p><a href="' . admin_url('admin.php?page=mailchimp-for-wp-reports&tab=log') . '">' . __('View entire log', 'mailchimp-for-wp') . '</a></p>';
    }
}
PK     M\<t@{  {  #  logging/includes/class-log-item.phpnu [        <?php

/**
 * Class MC4WP_Log_Item
 *
 * @ignore
 *
 * TODO: Merge this with MC4WP_MailChimp_Subscriber class?
 */
class MC4WP_Log_Item
{
    public $ID;
    public $email_address;
    public $merge_fields;
    public $interests;
    public $vip;
    public $status;
    public $ip_signup;
    public $list_id;
    public $email_type;
    public $language;
    public $type;
    public $url;
    public $datetime;
    public $related_object_ID;

    /**
     * @param string $name
     * @return mixed
     */
    public function __get($name)
    {
        switch ($name) {
            case'id':
                return $this->ID;

            case 'email':
                return $this->email_address;

            case 'merge_vars':
            case 'data':
                return $this->merge_fields;

            case 'groupings':
                return $this->interests;

            case 'list_ids':
                return $this->list_id;
        }
    }

    public function to_json()
    {
        return (object) array(
            'email_address' => $this->email_address,
            'status' => $this->status,
            'merge_fields' => $this->merge_fields,
            'interests' => $this->interests,
            'language' => $this->language,
            'ip_signup' => $this->ip_signup,
            'email_type' => $this->email_type,
            'vip' => $this->vip,
        );
    }
}
PK     M\*/'  '     logging/includes/class-graph.phpnu [        <?php

class MC4WP_Graph
{

    /**
    * @var string
    */
    private $table_name;

    /**
     * @var array
     */
    private $initial_data = array();

    /**
     * @var array
     */
    private $config;

    /**
     * @var string
     */
    public $range = 'this_week';

    /**
     * @var
     */
    public $start_date;

    /**
     * @var
     */
    public $end_date;

    /**
     * @var string
     */
    public $step_size = 'day';

    /**
     * @var array
     */
    public $datasets = array();

    /**
     * @var
     */
    private $day;

	/**
	 * @var string
	 */
    private $date_format_graph = 'Y, m j';


    /**
	* @param array $config
    */
    public function __construct(array $config = array())
    {
        // store config
        if (isset($config['range'])) {
            $this->range = $config['range'];
        }

        $this->config = $config;

        // set table prefix
        global $wpdb;
        $this->table_name = $wpdb->prefix . 'mc4wp_log';
    }

    /**
    * Initialize various settings to use
    */
    public function init()
    {
        $start_of_week = (int) get_option('start_of_week', 1);
        $timezone = wp_timezone();
	    $utc_offset = (int) get_option('gmt_offset', 0);
	    $now = new DateTime('now', $timezone);
	    $this->day = $now->format('d');

	    switch ($this->range) {
            case 'today':
                $start_date = new DateTime('today midnight', $timezone);
	            $end_date = (clone $start_date)->modify('+1 day');
                $this->step_size = 'hour';
                $this->date_format_graph = 'g a';
            break;

            case 'yesterday':
	            $start_date = new DateTime('yesterday midnight', $timezone);
	            $end_date = (clone $start_date)->modify('+1 day');
                $this->step_size = 'hour';
	            $this->date_format_graph = 'g a';
            break;

			case 'this_week':
			default:
	            $start_date = new DateTime('last sunday midnight', $timezone);
				$start_date->modify(sprintf('+%d days', $start_of_week));
	            $end_date = (clone $start_date)->modify('+7 days');
				$this->step_size = 'day';
	            $this->date_format_graph = 'M j';
				break;

			case 'last_week':
				$start_date = new DateTime('last sunday midnight', $timezone);
				$start_date->modify(sprintf('-%d days', 7 - $start_of_week));
				$end_date = (clone $start_date)->modify('+7 days');
				$this->step_size = 'day';
				$this->date_format_graph = 'M j';
				break;

			case 'this_month':
				$start_date = new DateTime("first day of this month midnight", $timezone);
				$end_date = (clone $start_date)->modify('+1 month');
				$this->step_size = 'day';
				$this->date_format_graph = 'M j';
				break;

            case 'last_month':
	            $start_date = new DateTime("first day of last month midnight", $timezone);
	            $end_date = (clone $start_date)->modify('+1 month');
                $this->step_size = 'day';
	            $this->date_format_graph = 'M j';
           	 break;

            case 'this_quarter':
	            $month = floor($now->format('m') / 3) * 3 + 1;
                $start_date = new DateTime(gmdate(sprintf('Y-%d-01 00:00:00', $month)), $timezone);
	            $end_date = (clone $start_date)->modify('+3 months');
                $this->step_size = 'day';
	            $this->date_format_graph = 'M j';
            break;

			case 'last_quarter':
				$month = floor($now->format('m') / 3) * 3 + 1 - 3;
				$start_date = new DateTime(gmdate(sprintf('Y-%d-01 00:00:00', $month)), $timezone);
				$end_date = (clone $start_date)->modify('+3 months');
				$this->step_size = 'day';
				$this->date_format_graph = 'M j';
				break;

			case 'this_year':
				$start_date = new DateTime('1 january this year midnight', $timezone);
				$end_date = (clone $start_date)->modify('+1 year');
				$this->step_size = 'month';
				$this->date_format_graph = 'M';
				break;

            case 'last_year':
	            $start_date = new DateTime('1 january last year midnight', $timezone);
	            $end_date = (clone $start_date)->modify('+1 year');
                $this->step_size = 'month';
	            $this->date_format_graph = 'M';
            break;

            case 'custom':
                $start_date = new DateTime(implode('-', array( $this->config['start_year'], $this->config['start_month'], $this->config['start_day'] )) . ' 00:00:00', $timezone);
                $end_date = new DateTime(implode('-', array( $this->config['end_year'], $this->config['end_month'], $this->config['end_day'] )) . ' 23:59:59', $timezone);
                $this->step_size = $this->calculate_step_size($start_date, $end_date);
                $this->date_format_graph = $this->get_graph_date_format();
                $this->day = $this->config['start_day'];
                break;
        }

        // If start is before end, revert back to "week" range and re-init.
        if ($start_date >= $end_date) {
            add_settings_error('mc4wp', 'mc4wp-stats', __('End date can\'t be before the start date', 'mailchimp-for-wp'));
            $this->config['range'] = 'this_week';
            $this->init();
            return;
        }

        // modify start and end date to account for UTC offset
	    // we invert the offset here so that MySQL includes the proper results
        $this->start_date = (clone $start_date)->modify(sprintf('+%d hours', $utc_offset * -1))->format('Y-m-d H:i:s');
        $this->end_date = (clone $end_date)->modify(sprintf('+%d hours', $utc_offset * -1))->format('Y-m-d H:i:s');

        // setup array of dates with 0's
        $current = $start_date;
        $this->initial_data = array();
        while ($current < $end_date) {
            $key = $current->format('Y-m-d H:i:s');
            $this->initial_data[$key] = 0;
            $current->modify("+1 {$this->step_size}");
        }

        $this->query();
    }

    /**
     * Calculates an appropriate step size
     *
    * @param DateTime $start
    * @param DateTime $end
    *
    * @return string
    */
    public function calculate_step_size(DateTime $start, DateTime $end)
    {
        $difference = $end->format('U') - $start->format('U');
        $day_in_seconds = 86400;
        $month_in_seconds = 2592000;

        if ($difference > ($month_in_seconds * 6)) {
            $step = 'month';
        } elseif ($difference > $day_in_seconds) {
            $step = 'day';
        } else {
            $step = 'hour';
        }

        return $step;
    }

    /**
     * @return string
     */
    protected function get_date_format()
    {
    	switch ($this->step_size) {
		    case 'hour': return '%Y-%m-%d %H:00:00'; break;
		    default:
		    case 'day': return '%Y-%m-%d 00:00:00'; break;
		    case 'month': return "%Y-%m-{$this->day} 00:00:00"; break;
	    }
    }

	/**
	 * @return string
	 */
	protected function get_graph_date_format()
	{
		switch ($this->step_size) {
			case 'hour': return 'g a'; break;
			default:
			case 'day': return 'M j'; break;
			case 'month': return "M Y"; break;
		}
	}

    /**
     * @return array
     */
    public function query()
    {
        $datasets = array();

        // forms
        $forms = mc4wp_get_forms();

        foreach ($forms as $form) {
            $data = $this->get_data_for_form($form->ID);
            if (!is_array($data)) {
            	continue;
			}

            $dataset = array(
                'label' => sprintf('%s', esc_html($form->name)),
                'normalized' => true,
                'data' => $data,
            );
            $datasets[] = $dataset;
        }

        // integrations
        $integrations = mc4wp_get_integrations();
        foreach ($integrations as $integration) {
            $data = $this->get_data_for_type($integration->slug);
			if (!is_array($data)) {
				continue;
			}

            $dataset = array(
                'label' => $integration->name,
                'normalized' => true,
                'data' => $data,
            );
            $datasets[] = $dataset;
        }

        // Top Bar
        $data = $this->get_data_for_type('mc4wp-top-bar');
	    if (is_array($data)) {
			$dataset = array(
				'label' => 'Top Bar',
				'normalized' => true,
				'data' => $data,
			);
			$datasets[] = $dataset;
		}

        $this->datasets = $datasets;
    }

    private function format_data(array $results)
    {
    	$counts = $this->initial_data;
    	$total = 0;

    	// add database results to counts array
    	foreach ($results as $row) {
			$counts[$row->date_group] = (int) $row->count;
			$total += (int) $row->count;
	    }

    	if ($total === 0) {
    		return false;
	    }

    	// format data for use in Chart.js graph
	    $data = array();
    	foreach ($counts as $date => $count) {
    		$data[] = array(
			    'x' => gmdate($this->date_format_graph, strtotime($date)),
			    'y' => $count
		    );
	    }

		return $data;
    }

    public function get_data_for_type($type)
    {
		global $wpdb;
        $sql = "SELECT COUNT(*) AS count, DATE_FORMAT(DATE_ADD(datetime, INTERVAL %d HOUR), %s) AS date_group FROM `{$this->table_name}` WHERE `type` = %s AND datetime >= %s AND datetime <= %s GROUP BY date_group ORDER BY date_group ASC";
        $query = $wpdb->prepare($sql, (int) get_option('gmt_offset', 0), $this->get_date_format(), $type, $this->start_date, $this->end_date);
        $totals = $wpdb->get_results($query);
        return $this->format_data($totals);
    }

    public function get_data_for_form($form_id)
    {
        global $wpdb;
        $sql = "SELECT COUNT(*) AS count, DATE_FORMAT(DATE_ADD(datetime, INTERVAL %d HOUR), %s) AS date_group FROM `{$this->table_name}` WHERE `related_object_ID` = %d AND `type` = %s AND datetime >= %s AND datetime <= %s GROUP BY date_group ORDER BY date_group ASC";
        $query = $wpdb->prepare($sql,  (int) get_option('gmt_offset', 0), $this->get_date_format(), $form_id, 'mc4wp-form', $this->start_date, $this->end_date);
        $totals = $wpdb->get_results($query);
        return $this->format_data($totals);
    }
}
PK     M\=*=  =  !  logging/includes/class-logger.phpnu [        <?php

/**
 * Class MC4WP_Logger
 *
 * @ignore
 */
class MC4WP_Logger
{

    /**
     * @var string
     */
    private $table_name = '';

    /**
     * @var WPDB
     */
    private $db;

    /**
     * Constructor
     *
     * @param WPDB $wpdb
     */
    public function __construct($wpdb = null)
    {
        if (null === $wpdb) {
            global $wpdb;
        }

        $this->db = $wpdb;
        $this->table_name = $wpdb->prefix . 'mc4wp_log';
    }

    /**
     *
     */
    public function add_hooks()
    {
        // add listeners for core logging
        add_action('mctb_subscribed', array( $this, 'log_top_bar_request' ), 10, 4);
        add_action('mc4wp_integration_subscribed', array( $this, 'log_integration_request' ), 10, 5);
        add_action('mc4wp_form_subscribed', array( $this, 'log_form_request' ), 10, 4);
        add_action('mc4wp_logging_purge_old_items', array( $this, 'purge_old_items' ));

        add_filter('wp_privacy_personal_data_exporters', array( $this, 'register_exporter' ), 90);
        add_filter('wp_privacy_personal_data_erasers', array( $this, 'register_eraser' ), 90);
    }

    /**
     * @param string $list_id
     * @param string $email_address
     * @param string $merge_vars
     * @param MC4WP_MailChimp_Subscriber $subscriber_data
     *
     * @return int
     */
    public function log_top_bar_request($list_id, $email_address, $merge_vars, MC4WP_MailChimp_Subscriber $subscriber_data = null)
    {
        $data = array(
            'list_id' => $list_id,
            'type' => 'mc4wp-top-bar',
        );

        if ($subscriber_data instanceof MC4WP_MailChimp_Subscriber) {
            $data['email_address'] = $subscriber_data->email_address;
            $data['merge_fields'] = $subscriber_data->merge_fields;
            $data['vip'] = $subscriber_data->vip;
            $data['ip_signup'] = $subscriber_data->ip_signup;
            $data['interests'] = $subscriber_data->interests;
            $data['status'] = $subscriber_data->status;
            $data['language'] = $subscriber_data->language;
        } else {
            // for backwards compatibility with older versions of Top Bar.
            $data['email_address'] = $email_address;
            $data['merge_fields'] = $merge_vars;
        }

        return $this->log_request($data);
    }

    /**
     *
     * @param MC4WP_Integration $integration
     * @param string $email
     * @param array $merge_vars
     * @param array $data_map
     * @param int $related_object_id
     *
     * @return false|int
     */
    public function log_integration_request(MC4WP_Integration $integration, $email, $merge_vars, $data_map = array(), $related_object_id = 0)
    {

        // backwards compatibility for hook parameter order with Mailchimp for WordPress v3.x
        if ($related_object_id === 0 && is_numeric($data_map)) {
            $related_object_id = $data_map;
            $data_map = null;
        }

        $data = array(
            'type' => $integration->slug,
            'related_object_ID' => $related_object_id
        );

        // for BC with v3.x of Mailchimp for Wordpress
        if (! is_array($data_map)) {
            $lists = $integration->get_lists();
            $list_id = array_shift($lists);

            $data += array(
                'list_id' => $list_id,
                'email_address' => $email,
                'merge_fields' => $merge_vars,
            );

            return $this->log_request($data);
        }

        // add each data map individually
        foreach ($data_map as $list_id => $subscriber_data) {
            $data = array_merge($data, array(
                'list_id' => $list_id,
                'email_address' => $subscriber_data->email_address,
                'merge_fields' => $subscriber_data->merge_fields,
                'interests' => $subscriber_data->interests,
                'vip' => $subscriber_data->vip,
                'ip_signup' => $subscriber_data->ip_signup,
                'status' => $subscriber_data->status,
                'language' => $subscriber_data->language,
            ));

            $this->log_request($data);
        }

        return true;
    }

    /**
     * @param MC4WP_Form $form
     * @param string $email_address
     * @param array $merge_vars
     * @param MC4WP_MailChimp_Subscriber[] $data_map
     *
     * @return false|int
     */
    public function log_form_request(MC4WP_Form $form, $email_address, array $merge_vars, array $data_map = array())
    {
        $data = array(
            'type' => 'mc4wp-form',
            'related_object_ID' => $form->ID,
        );

        // for BC with v3.x of Mailchimp for WordPress
        $plain_data_map = array_values($data_map);
        if (empty($plain_data_map) || ! $plain_data_map[0] instanceof MC4WP_MailChimp_Subscriber) {
            $lists = $form->get_lists();
            $list_id = array_shift($lists);

            $data += array(
                'list_id' => $list_id,
                'email_address' => $email_address,
                'merge_fields' => $merge_vars,
            );

            return $this->log_request($data);
        }

        // add each data map individually
        foreach ($data_map as $list_id => $subscriber_data) {
            $data = array_merge($data, array(
                'list_id' => $list_id,
                'email_address' => $subscriber_data->email_address,
                'merge_fields' => $subscriber_data->merge_fields,
                'interests' => $subscriber_data->interests,
                'vip' => $subscriber_data->vip,
                'ip_signup' => $subscriber_data->ip_signup,
                'status' => $subscriber_data->status,
                'language' => $subscriber_data->language,
            ));

            $this->log_request($data);
        }

        return true;
    }




    /**
     * @param array $data
     *
     * @return false|int
     */
    public function add(array $data)
    {
        $defaults = array(
            'datetime' => current_time('mysql', true),
        );

        // because json_encode turns empty object into array, use NULL
        $data['merge_fields'] = empty($data['merge_fields']) ? null : json_encode($data['merge_fields']);
        $data['interests'] = empty($data['interests']) ? null : json_encode($data['interests']);

        $data = array_merge($defaults, $data);

        return $this->db->insert($this->table_name, $data);
    }

    /**
     * @param array $args
     * @return int
     */
    public function count(array $args = array())
    {
        $args['select'] = 'COUNT(*)';
        return $this->find($args);
    }

    /**
     * @param array $args
     *
     * @return int|array
     */
    public function find($args)
    {
        $args = wp_parse_args($args, array(
            'select' => '*',
            'offset' => 0,
            'limit' => 1,
            'orderby' => 'id',
            'order' => 'DESC',

            // where params
            'type' => '',
            'email' => '',
            'datetime_after' => '',
            'datetime_before' => '',
            'include_errors' => true
        ));

        $where = array();
        $params = array();

        // build general select from query
        $query = sprintf("SELECT %s FROM %s", $args['select'], $this->table_name);

        // add email to WHERE clause
        if ('' !== $args['email']) {
            $where[] = 'email_address = %s';
            $params[] = $args['email'];
        }

        // add type to WHERE clause
        if ('' !== $args['type']) {
            $where[] = 'type = %s';
            $params[] = $args['type'];
        }

        // add datetime to WHERE clause
        if ('' !== $args['datetime_after']) {
            $where[] = 'UNIX_TIMESTAMP(datetime) >= %d';
            $datetime_after = is_numeric($args['datetime_after']) ? $args['datetime_after'] : strtotime($args['datetime_after']);
            $params[] = $datetime_after;
        }

        if ('' !== $args['datetime_before']) {
            $where[] = 'UNIX_TIMESTAMP(datetime) <= %d';
            $datetime_before = is_numeric($args['datetime_before']) ? $args['datetime_before'] : strtotime($args['datetime_before']);
            $params[] = $datetime_before;
        }

        // add where parameters
        if (count($where) > 0) {
            $query .= ' WHERE '. implode(' AND ', $where);
        }

        // prepare parameters
        if (! empty($params)) {
            $query = $this->db->prepare($query, $params);
        }

        // return result count
        if ($args['select'] === 'COUNT(*)') {
            return (int) $this->db->get_var($query);
        }

        // return single row
        if ($args['limit'] === 1) {
            $query .= ' LIMIT 1';
            return $this->db->get_row($query);
        }

        // perform rest of query
        $args['limit']  = absint($args['limit']);
        $args['offset'] = absint($args['offset']);
        $args['orderby'] = preg_replace("/[^a-zA-Z_]/", "", $args['orderby']);
        $args['order'] = preg_replace("/[^a-zA-Z]/", "", $args['order']);

        // add ORDER BY, OFFSET and LIMIT to SQL
        $query .= sprintf(' ORDER BY %s %s LIMIT %d, %d', $args['orderby'], $args['order'], $args['offset'], $args['limit']);

        $results = $this->db->get_results($query);
        return $this->hydrate($results);
    }

    /**
     * @param $ids string|array
     *
     * @return mixed
     */
    public function find_by_id($ids)
    {
        if (is_array($ids)) {
            // create comma-separated string
            $ids = implode(',', $ids);
        }

        // escape string for usage in IN clause
        $ids = esc_sql($ids);
        $sql = sprintf("SELECT * FROM `%s` WHERE ID IN (%s)", $this->table_name, $ids);

        $results = $this->db->get_results($sql);
        $objects = $this->hydrate($results);

        // return single row if only one id is given
        if (substr_count($ids, ',') === 0) {
            return array_shift($objects);
        }

        return $objects;
    }

    /**
     * @param $ids Array or string of log ID's to delete
     *
     * @return false|int
     */
    public function delete_by_id($ids)
    {
        if (is_array($ids)) {
            // create comma-separated string
            $ids = implode(',', $ids);
        }

        // escape string for usage in IN clause
        $ids = esc_sql($ids);

        $sql = sprintf("DELETE FROM `%s` WHERE ID IN (%s)", $this->table_name, $ids);
        return $this->db->query($sql);
    }

    /**
     * Deletes ALL log items. Use with caution.
     */
    public function truncate()
    {
        $query = sprintf("DELETE FROM `%s`", $this->table_name);
        $this->db->query($query);
    }

    /**
     * @param $results
     *
     * @return MC4WP_Log_Item[]
     */
    protected function hydrate($results)
    {
        if (! is_array($results)) {
            return array();
        }

        $objects = array();
        foreach ($results as $raw_result) {
            // create object and set properties
            $object = new MC4WP_Log_Item;
            foreach ($raw_result as $property => $value) {
                if (in_array($property, array( 'success' ))) {
                    continue;
                }

                if (in_array($property, array( 'merge_fields', 'interests')) && is_string($value)) {
                    $value = json_decode($value);
                }

                $object->$property = $value;
            }

            $objects[] = $object;
        }

        return $objects;
    }

    /**
     * @param $data
     * @return false|int
     */
    private function log_request($data)
    {
        if (empty($data['merge_fields'])) {
            $data['merge_fields'] = array();
        }

        // copy over OPTIN_IP from merge_fields
        if (! empty($data['merge_fields']['OPTIN_IP'])) {
            $data['ip_signup'] = $data['merge_fields']['OPTIN_IP'];
            unset($data['merge_fields']['OPTIN_IP']);
        }

        // make sure merge_fields has an EMAIL key
        if (empty($data['merge_fields']['EMAIL'])) {
            $data['merge_fields']['EMAIL'] = $data['email_address'];
        }

        if (empty($data['url']) && ! empty($_SERVER['HTTP_REFERER'])) {
            $data['url'] = $_SERVER['HTTP_REFERER'];
        }

        return $this->add($data);
    }

    public function purge_old_items()
    {
        $options = get_option('mc4wp');
        if (empty($options['log_purge_days'])) {
            return;
        }

        $days = (int) $options['log_purge_days'];
        $date_treshold = strtotime("-{$days} days");
        $query = "DELETE FROM {$this->table_name} WHERE UNIX_TIMESTAMP(datetime) < %d";
        $params = array( $date_treshold );
        $query = $this->db->prepare($query, $params);
        $this->db->query($query);
    }

    public function register_exporter($exporters)
    {
        $exporters['mc4wp-log'] = array(
         'exporter_friendly_name' => 'Mailchimp for WordPress',
         'callback'               => array( $this, 'gdpr_export' ),
      );
        return $exporters;
    }

    public function gdpr_export($email_address, $page = 1)
    {
        $log_items = $this->find(array( 'email' => $email_address, 'limit' => 10000 ));
        $data_to_export = array();

        if (! empty($log_items)) {
            foreach ($log_items as $item) {
                $data_to_export[] = array(
               'group_id'    => 'mc4wp_log_items',
               'group_label' => __('Mailchimp sign-up requests', 'mailchimp-for-wp'),
               'item_id'     => sprintf('mc4wp-log-item-%d', $item->ID),
               'data'        => $this->gdpr_export_log_item($item),
            );
            }
        }
        return array(
         'data' => $data_to_export,
         'done' => true,
      );
    }

    public function gdpr_export_log_item(MC4WP_Log_Item $item)
    {
        $data = array();

        $data[] = array(
            'name' => 'Date',
            'value' => $item->datetime,
      );

        $data[] = array(
         'name' => 'Email address',
         'value' => $item->email_address,
      );

        $data[] = array(
         'name' => 'IP address',
         'value' => $item->ip_signup,
      );

        if (! empty($item->language)) {
            $data[] = array(
            'name' => 'Language',
            'value' => $item->language,
         );
        }

        foreach ($item->merge_fields as $field => $value) {
            if ($field === 'EMAIL') {
                continue;
            }

            $data[] = array(
            'name' => $field,
            'value' => is_array($value) ? join(', ', $value) : $value,
         );
        }

        return $data;
    }

    public function register_eraser($erasers)
    {
        $erasers['mc4wp-log'] = array(
         'eraser_friendly_name' => 'Mailchimp for WordPress',
         'callback'             => array( $this, 'gdpr_erase' ),
      );
        return $erasers;
    }

    public function gdpr_erase($email_address, $page = 1)
    {
        $log_items = $this->find(array( 'email' => $email_address, 'limit' => 10000 ));
        $items_removed = false;
      
        foreach ($log_items as $item) {
            $this->delete_by_id($item->ID);
            $items_removed = true;
        }

        return array(
            'items_removed'  => $items_removed,
            'items_retained' => false,
            'messages'       => array(),
            'done'           => true,
         );
    }
}
PK     M\xR  R    logging/includes/functions.phpnu [        <?php

/**
 * @param string $datetime
 * @param string $format
 * @return false|string
 */
function mc4wp_logging_gmt_date_format($datetime, $format = '')
{
    if ($format === '') {
        $format = get_option('date_format') . ' ' . get_option('time_format');
    }

    // add or subtract GMT offset to given mysql time
    $local_datetime = strtotime($datetime) + (get_option('gmt_offset') * HOUR_IN_SECONDS);

    return date($format, $local_datetime);
}

/**
 * Schedule the purge logging events with WP Cron.
 */
function _mc4wp_logging_schedule_purge_event()
{
    $expected_next = time() + (60 * 60 * 24);
    $event_name = 'mc4wp_logging_purge_old_items';
    $actual_next = wp_next_scheduled($event_name);

    if (! $actual_next || $actual_next > $expected_next) {
        wp_schedule_event($expected_next, 'daily', $event_name);
    }
}
PK     M\lRf$  $  $  logging/includes/class-installer.phpnu [        <?php

/**
 * Class MC4WP_Logging_Installer
 *
 * @ignore
 */
class MC4WP_Logging_Installer
{
    public static function run()
    {
        /** @var WPDB $wpdb */
        global $wpdb;

        $table_name = $wpdb->prefix . 'mc4wp_log';
        $charset_collate = $wpdb->get_charset_collate();

        // create TABLE
        $sql = "CREATE TABLE IF NOT EXISTS {$table_name} (
        `ID` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
        `email_address` VARCHAR(100) NOT NULL,
        `list_id` VARCHAR(50) NOT NULL,
        `type` VARCHAR(50) NOT NULL,
        `merge_fields` TEXT NULL,
        `interests` TEXT NULL,
        `status` VARCHAR(60) NULL,
        `email_type` VARCHAR(4) NULL,
        `ip_signup` VARCHAR(255) NULL,
        `language` VARCHAR(50) NULL,
        `vip` TINYINT(1) NULL,
        `related_object_ID` INT UNSIGNED NULL,
        `url` TEXT NULL,
        `datetime` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
        `success` TINYINT(1) DEFAULT 1
		) ENGINE=INNODB $charset_collate";

        $wpdb->query($sql);
    }
}
PK     M\,Apx  x  '  logging/includes/class-log-exporter.phpnu [        <?php

/**
 * Class MC4WP_Log_Exporter
 *
 * @ignore
 */
class MC4WP_Log_Exporter
{

    /**
     * @var MC4WP_Logger
     */
    protected $logger;

    /**
     * @var string The entire CSV string
     */
    protected $csv_string = '';

    /**
     * @var bool
     */
    protected $built = false;

    /**
     * @var string
     */
    protected $filename = "mailchimp-for-wp-log.csv";

    /**
     * @var array
     */
    protected $filter_arguments = array();

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->logger = new MC4WP_Logger();
    }

    /**
     * @param array $filter_arguments
     */
    public function filter($filter_arguments = array())
    {
        $this->filter_arguments = $filter_arguments;
    }

    /**
     * @param array $arguments
     * @return array
     */
    public function get_logs($arguments = array())
    {
        $arguments = array_merge($this->filter_arguments, $arguments);
        return $this->logger->find($arguments);
    }

    /**
     * Build the CSV string
     */
    public function output()
    {
        header("Pragma: public");
        header("Expires: 0");
        header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
        header("Cache-Control: private", false);
        header("Content-Type: application/octet-stream");
        header("Content-Disposition: attachment; filename=\"{$this->filename}\";");
        header("Content-Transfer-Encoding: binary");

        // Open output stream
        $handle = fopen('php://output', 'w');

        // create csv header
        $headers = array(
            "list_id",
            "email_address",
            "merge_fields",
            "interests",
            "status",
            "vip",
            "ip_signup",
            "language",
            "type",
            "source",
            "datetime",
        );
        fputcsv($handle, $headers, "\t");

        $offset = 0;
        $batch_size = 500;

        while (true) {
            $log_items = $this->get_logs(array( 'limit' => $batch_size, 'offset' => $offset ));

            // stop when we processed all
            if (empty($log_items)) {
                break;
            }

            // loop through log items
            foreach ($log_items as $item) {
                fputcsv(
                    $handle,
                    array(
                        $item->list_id,
                        $item->email_address,
                        empty($item->merge_fields) ? '' : json_encode($item->merge_fields),
                        empty($item->interests) ? '' : json_encode($item->interests),
                        $item->status,
                        $item->vip,
                        (string) $item->ip_signup,
                        (string) $item->language,
                        $item->type,
                        $item->url,
                        $item->datetime
                    ),
                    "\t"
                );
            }

            // increase offset for next batch
            $offset = $offset + $batch_size;
        }


        // ... close the "file"...
        fclose($handle);
    }
}
PK     M\Uq&  &  $  logging/includes/class-log-table.phpnu [        <?php
defined('ABSPATH') or exit;

if (! class_exists('WP_List_Table')) {
    require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
}

/**
 * Class MC4WP_Log_Table
 *
 * @ignore
 *
 * TODO: Add "export" option to bulk actions
 */
class MC4WP_Log_Table extends WP_List_Table
{

    /**
     * @var int
     */
    private $per_page = 20;

    /**
     * @var MC4WP_MailChimp
     */
    private $mailchimp;

    /**
     * @var MC4WP_Logger
     */
    private $log;

    /**
     * @var MC4WP_Integration[]
     */
    private $integrations;

    /**
     * @var array
     */
    private $views;

    /**
     * Constructor
     *
     * @param MC4WP_MailChimp $mailchimp
     */
    public function __construct(MC4WP_MailChimp $mailchimp)
    {
        $this->log          = new MC4WP_Logger();
        $this->mailchimp    = $mailchimp;
        $this->integrations = mc4wp_get_integrations();
        $this->per_page = $this->get_items_per_page('mc4wp_log_per_page');

        //Set parent defaults
        parent::__construct(
            array(
                'singular' => __('Log', 'mailchimp-for-wp'),
                'plural'   => __('Log Items', 'mailchimp-for-wp'),
                'ajax'     => false
            )
        );

        $this->process_bulk_action();
        $this->prepare_items();
    }

    /**
     * @return array
     */
    public function get_bulk_actions()
    {
        $actions = array(
            'delete' => 'Delete'
        );

        return $actions;
    }

    /**
     * @return array
     */
    public function get_columns()
    {
        $columns = array(
            'cb'       => '<input type="checkbox" />',
            'email_address'    => __('Email Address', 'mailchimp-for-wp'),
            'list'     => __('List', 'mailchimp-for-wp'),
            'type'     => __('Type', 'mailchimp-for-wp'),
            'source'   => __('Source', 'mailchimp-for-wp'),
            'datetime' => __('Subscribed', 'mailchimp-for-wp')
        );

        return $columns;
    }

    /**
     * @return array
     */
    public function get_sortable_columns()
    {
        return array(
            'email_address'    => array( 'email_address', false ),
            'datetime' => array( 'datetime', false ),
            'type'     => array( 'type', false ),
            'list'     => array( 'list_id', false ),
            'source'     => array( 'url', false ),
        );
    }

    /**
     * Prepare table items
     */
    public function prepare_items()
    {
        $columns  = $this->get_columns();
        $sortable = $this->get_sortable_columns();
        $hidden   = array();

        $this->_column_headers = array( $columns, $hidden, $sortable );
        $this->items           = $this->get_log_items();
        $this->views           = $this->prepare_views();

        $view = (isset($_GET['view'])) ? $_GET['view'] : 'all';
        $total_items = $this->views[ $view ]['count'];

        $this->set_pagination_args(
            array(
                'total_items' => $total_items,
                'per_page'    => $this->per_page
            )
        );
    }

    /**
     * @return false|int|void
     */
    public function process_bulk_action()
    {
        if (! isset($_GET['log'])) {
            return false;
        }

        check_admin_referer('bulk-' . $this->_args['plural']);

        $ids = $_GET['log'];

        if (! is_array($ids)) {
            $ids = array( absint($ids) );
        }

        if ($this->current_action() === 'delete') {
            add_settings_error('mc4wp', 'mc4wp-logs-deleted', __('Log items deleted.', 'mailchimp-for-wp'), 'updated');

            return $this->log->delete_by_id($ids);
        }
    }

    /**
     * @param $item
     * @param $column_name
     *
     * @return string
     */
    public function column_default($item, $column_name)
    {
        if (property_exists($item, $column_name)) {
            return $item->$column_name;
        }

        return '';
    }

    public function column_datetime($item)
    {
        $date = mc4wp_logging_gmt_date_format($item->datetime);
        return esc_html($date);
    }

    /**
     * @param $item
     *
     * @return string
     */
    public function column_source($item)
    {
        $parsed_url = parse_url($item->url);

        if (is_array($parsed_url)) {
            $url = $parsed_url['path'];

            if (! empty($parsed_url['query'])) {
                $url .= '?' . $parsed_url['query'];
            }
        } else {
            $url = $item->url;
        }

        return '<a href="' . esc_url($item->url) . '">' . esc_html($this->shorten_text($url)) . '</a>';
    }

    /**
     * @param $item
     *
     * @return string
     */
    public function column_list($item)
    {
        $list_names = array();

        // "list_id" used to be an array in v3.x, so explode by comma.
        $list_ids   = array_map('trim', explode(',', $item->list_id));
        foreach ($list_ids as $list_id) {
            $list         = $this->mailchimp->get_list($list_id);
            $list_names[] = $list ? sprintf('<a href="https://admin.mailchimp.com/lists/members/?id=%s" target="_blank">%s</a>', $list->web_id, $this->shorten_text($list->name)) : 'Unknown list';
        }

        return join(', ', $list_names);
    }

    /**
     * @param $item
     *
     * @return string
     */
    public function column_email_address($item)
    {
        return sprintf('<span id="item-%d"></span> <a class="row-title" href="%s">%s</a>', $item->ID, admin_url('admin.php?page=mailchimp-for-wp-reports&tab=log_item&id=' . $item->ID), esc_html($item->email_address));
    }

    /**
     * @param $item
     *
     * @return string
     */
    public function column_cb($item)
    {
        return sprintf('<input type="checkbox" name="log[]" value="%s" />', $item->ID);
    }

    /**
     * Outputs the text for the "type" column
     *
     * @param $item
     *
     * @return string|void
     */
    public function column_type($item)
    {
        if (isset($this->integrations[ $item->type ])) {
            $object_link = $this->integrations[ $item->type ]->get_object_link($item->related_object_ID);
            if (! empty($object_link)) {
                return $object_link;
            }

            return $this->integrations[ $item->type ]->name;
        }

        if ($item->type === 'mc4wp-form') {
            $form_id = $item->related_object_ID;

            try {
                $form = mc4wp_get_form($form_id);

                return '<a href="' . mc4wp_get_edit_form_url($form->ID) . '">' . esc_html($form->name) . '</a>';
            } catch (Exception $e) {
                return __('Form', 'mailchimp-for-wp') . ' ' . $form_id . ' <em>(' . __('deleted', 'mailchimp-for-wp') . ')</em>';
            }
        } elseif ($item->type === 'mc4wp-top-bar') {
            return 'Mailchimp Top Bar';
        }

        return $item->type;
    }

    /**
     * @return array
     */
    private function get_log_items()
    {
        $args           = array();
        $args['offset'] = ($this->get_pagenum() - 1) * $this->per_page;
        $args['limit']  = $this->per_page;

        // order by datetime by default
	    $args['orderby'] = isset($_GET['orderby']) ? sanitize_text_field($_GET['orderby']) : 'datetime';

        if (isset($_GET['s'])) {
            $args['email'] = sanitize_text_field($_GET['s']);
        }

        if (isset($_GET['view']) && $_GET['view'] !== 'all') {
            $args['type'] = sanitize_text_field($_GET['view']);
        }

        if (isset($_GET['order'])) {
            $args['order'] = sanitize_text_field($_GET['order']);
        }

        return $this->log->find($args);
    }


    /**
     * The text to show when there are no log items to show.
     */
    public function no_items()
    {
        _e('No log items.', 'mailchimp-for-wp');
    }

    public function get_view_link($key, $view)
    {
        $current = empty($_GET['view']) ? 'all' : $_GET['view'];
        $url = admin_url('admin.php?page=mailchimp-for-wp-reports&tab=log&view=' . $key);
        $class = $current === $key ? 'current' : '';
        return sprintf('<a href="%s" class="%s">%s</a> (%d)', $url, $class, $view['name'], $view['count']);
    }

    /**
     * Prepares the various views
     */
    public function prepare_views()
    {
        $this->views = array(
            'all'           => array(
                'name'  => esc_html__('All', 'mailchimp-for-wp'),
                'count' => $this->log->count()
            ),
            'mc4wp-form'    => array(
                'name'  => esc_html__('Form', 'mailchimp-for-wp'),
                'count' => $this->log->count(array( 'type' => 'mc4wp-form' ))
            ),
            'mc4wp-top-bar' => array(
                'name'  => 'Mailchimp Top Bar',
                'count' => $this->log->count(array( 'type' => 'mc4wp-top-bar' ))
            )
        );

        foreach ($this->integrations as $integration) {
            $this->views[ $integration->slug ] = array(
                'name'  => $integration->name,
                'count' => $this->log->count(
                    array( 'type' => $integration->slug )
                )
            );
        }

        return $this->views;
    }

    /**
     * Get available views
     *
     * @access      private
     * @since       1.0
     * @return      array
     */
    public function get_views()
    {
        $links = array();
        foreach ($this->views as $key => $view) {
            $links[ $key ] = $this->get_view_link($key, $view);
        }

        return $links;
    }

    /**
     * @param     $text
     * @param int $limit
     *
     * @return string
     */
    private function shorten_text($text, $limit = 30)
    {
        if (strlen($text) <= $limit) {
            return $text;
        }

        return substr($text, 0, $limit - 2) . '..';
    }
}
PK     M\1)Hn&  &     logging/includes/class-admin.phpnu [        <?php

class MC4WP_Logging_Admin
{

    /**
     * @var MC4WP_Plugin
     */
    protected $plugin;

    /**
     * @param MC4WP_Plugin $plugin
     */
    public function __construct(MC4WP_Plugin $plugin)
    {
        $this->plugin = $plugin;
    }

    /**
     * Add hooks
     */
    public function add_hooks()
    {
        add_action('admin_init', array( $this, 'init' ));

        add_filter('mc4wp_admin_menu_items', array( $this, 'menu_items' ));
        add_action('mc4wp_dashboard_setup', array( $this, 'register_dashboard_widget' ));
        add_action('mc4wp_admin_log_export', array( $this, 'run_log_exporter' ));
        add_action('mc4wp_admin_log_empty', array( $this, 'run_log_empty' ));
        add_action('mc4wp_admin_log_set_purge_schedule', array( $this, 'set_purge_schedule' ));
        add_action('mc4wp_admin_enqueue_assets', array( $this, 'enqueue_assets' ));
        add_action('mc4wp_admin_after_integration_settings', array( $this, 'show_link_to_integration_log' ), 60);
        add_filter('set-screen-option', array( $this, 'set_screen_option' ), 10, 3);
    }

    /**
     * TODO: Make this more pretty (UX)
     *
     * Add a link to log overview to each integration
     *
     * @param MC4WP_Integration $integration
     */
    public function show_link_to_integration_log(MC4WP_Integration $integration)
    {
        echo sprintf('<p><a href="%s">' . __('Show sign-ups that used this integration.', 'mailchimp-for-wp') .'</a></p>', admin_url('admin.php?page=mailchimp-for-wp-reports&tab=log&view=' . $integration->slug));
    }

    /**
     * Init
     *
     * @hooked `init`
     */
    public function init()
    {
        $this->run_upgrade_routines();
    }

    /**
     * Maybe run upgrade routines
     *
     * @return bool
     */
    protected function run_upgrade_routines()
    {
        $from_version = get_option('mc4wp_log_version', 0);
        $to_version = $this->plugin->version();

        // run from URL variable so it's easy to re-run previous migrations
        if (isset($_GET['mc4wp_run_log_migration'])) {
            $from_version = $_GET['mc4wp_run_log_migration'];
        }

        // do we have a known version?
        if (empty($from_version)) {
            update_option('mc4wp_log_version', $to_version);
            return false;
        }

        // are we at or above specified version?
        if (version_compare($from_version, $to_version, '>=')) {
            return false;
        }

        $upgrade_routines = new MC4WP_Upgrade_Routines($from_version, $to_version, $this->plugin->dir('/migrations'));
        $upgrade_routines->run();
        update_option('mc4wp_log_version', $to_version);
        return true;
    }

    /**
     * Enqueue assets for log pages.
     *
     * @param string $suffix
     */
    public function enqueue_assets($suffix = '')
    {
        $page = isset($_GET['page']) ? $_GET['page'] : '';
        $tab = isset($_GET['tab']) ? $_GET['tab'] : 'statistics';

        /* Reports page */
        if ($page === 'mailchimp-for-wp-reports' && $tab === 'statistics') {
            $assets_url = $this->plugin->url('/assets');

            wp_register_script('mc4wp-admin-statistics', $assets_url . '/js/admin-statistics.js', array(), $this->plugin->version(), true);
            wp_enqueue_script('mc4wp-admin-statistics');

            wp_enqueue_style('mc4wp-admin-reports', $assets_url . '/css/admin.css', array( 'mc4wp-admin' ), $this->plugin->version());

        } elseif ($tab === 'log') {
            wp_enqueue_style('mc4wp-admin-reports', $this->plugin->url('assets/css/admin.css'), array( 'mc4wp-admin' ), $this->plugin->version());
        }
    }

    /**
     * @param array $items
     *
     * @return array
     */
    public function menu_items($items)
    {
        $items[] = array(
            'title' => __('Reports', 'mailchimp-for-wp'),
            'text' => __('Reports', 'mailchimp-for-wp'),
            'slug' => 'reports',
            'callback' => array( $this, 'show_reports' ),
            'load_callback' => array( $this, 'add_screen_options' )
        );

        return $items;
    }

    /**
     * Register dashboard widgets
     */
    public function register_dashboard_widget()
    {

        // only show widget to people with required capability
        // @todo use real cap
        if (! current_user_can('manage_options')) {
            return false;
        }

        wp_add_dashboard_widget(
            'mc4wp_log_widget',         // Widget slug.
            'Mailchimp Sign-Ups',         // Title.
            array( 'MC4WP_Dashboard_Log_Widget', 'make' ) // Display function.
        );
    }

    /**
     * Hooks into the `log_empty` action
     */
    public function run_log_empty()
    {
        $log = new MC4WP_Logger();
        $log->truncate();
    }

    /**
     * Run the log exporter
     */
    public function run_log_exporter()
    {
        $args = array();
        $request = array_merge($_POST, $_GET);

        if (! empty($request['start_year'])) {
            $start_year = absint($request['start_year']);
            $start_month = (isset($request['start_month'])) ? absint($request['start_month']) : 1;
            $timestring = sprintf('%s-%s', $start_year, $start_month);
            $args['datetime_after'] = date('Y-m-d 00:00:00', strtotime($timestring));
        }

        if (! empty($request['end_year'])) {
            $end_year = absint($request['end_year']);
            $end_month = (isset($request['end_month'])) ? absint($request['end_month']) : 12;
            $timestring = sprintf('%s-%s', $end_year, $end_month);
            $args['datetime_before'] = date('Y-m-t 23:59:59', strtotime($timestring));
        }

        $exporter = new MC4WP_Log_Exporter();
        $exporter->filter($args);
        $exporter->output();
        exit;
    }

    /**
     * Show reports page
     */
    public function show_reports()
    {
        $current_tab = ! empty($_GET['tab']) ? $_GET['tab'] : 'statistics';
        $tab_method = 'show_' . $current_tab . '_page';

        if (method_exists($this, $tab_method)) {
            call_user_func(array( $this, $tab_method ));
        }
    }

    /**
     * Show log page
     */
    public function show_advanced_page()
    {
        $options = get_option('mc4wp');
        if (empty($options['log_purge_days'])) {
            $options['log_purge_days'] = 365;
        }

        $current_tab = 'advanced';
        include $this->plugin->dir('/views/admin-reports.php');
    }

    /**
     * Show log page
     */
    public function show_export_page()
    {
        $current_tab = 'export';
        include $this->plugin->dir('/views/admin-reports.php');
    }

    /**
     * Show log page
     */
    public function show_log_page()
    {
        $mailchimp = new MC4WP_MailChimp();
        $table = new MC4WP_Log_Table($mailchimp);
        $current_tab = 'log';

        include $this->plugin->dir('/views/admin-reports.php');
    }

    public function show_log_item_page()
    {
        $current_tab = 'log_item';

        $id = (int) $_GET['id'];
        $logger = new MC4WP_Logger();
        $item = $logger->find_by_id($id);

        if ($item) {
            $mailchimp = new MC4WP_MailChimp();
            $list = $mailchimp->get_list($item->list_id);
        } else {
            $current_tab = 'log_item_not_found';
        }

        include $this->plugin->dir('/views/admin-reports.php');
    }

    private function get_interest_category_by_interest_id($list_id, $interest_id) {
        $mailchimp = new MC4WP_MailChimp();

        $interest_categories = $mailchimp->get_list_interest_categories($list_id);
        foreach($interest_categories as $category) {
            if (isset($category->interests[$interest_id])) {
                return $category;
            }
        }

        return null;
    }

    /**
     * Show reports (stats) page
     */
    public function show_statistics_page()
    {
        $current_tab = 'statistics';

	    if (!function_exists('wp_timezone')) {
	    	echo "You need WordPress version 5.3 or higher to view the reports page.";
	    	return;
	    }

		$graph = new MC4WP_Graph($_GET);
        $graph->init();

        // add scripts
        wp_localize_script('mc4wp-admin-statistics', 'mc4wp_statistics_data', $graph->datasets);

        $start_day = (isset($_GET['start_day'])) ? $_GET['start_day'] : 0;
        $start_month = (isset($_GET['start_month'])) ? $_GET['start_month'] : 0;
        $start_year = (isset($_GET['start_year'])) ? $_GET['start_year'] : 0;
        $end_day = (isset($_GET['end_day'])) ? $_GET['end_day'] : date('j');
        $end_month = (isset($_GET['end_month'])) ? $_GET['end_month'] : date('n');
        $end_year = (isset($_GET['end_year'])) ? $_GET['end_year'] : date('Y');

        include $this->plugin->dir('/views/admin-reports.php');
    }

    /**
     * Add screen options
     */
    public function add_screen_options()
    {
        // do nothing if not on log page
        if (empty($_GET['tab']) || $_GET['tab'] !== 'log') {
            return;
        }

        add_screen_option('per_page', array( 'default' => 20, 'option' => 'mc4wp_log_per_page' ));
    }

    /**
     * @param $status
     * @param $option
     * @param $value
     *
     * @return int
     */
    public function set_screen_option($status, $option, $value)
    {
        if ('mc4wp_log_per_page' === $option) {
            return $value;
        }

        return $status;
    }

    /**
    * Set-up the schedule to periodically delete all log items older than X days
    */
    public function set_purge_schedule()
    {
        $options = get_option('mc4wp', array());
        $options['log_purge_days'] = max(1, (int) $_POST['log_purge_days'] );
        update_option('mc4wp', $options);
        _mc4wp_logging_schedule_purge_event();
    }
}
PK     M\-l!+ + %  logging/assets/js/admin-statistics.jsnu [        !function s(a,r,n){function o(e,t){if(!r[e]){if(!a[e]){var i="function"==typeof require&&require;if(!t&&i)return i(e,!0);if(l)return l(e,!0);throw(t=new Error("Cannot find module '"+e+"'")).code="MODULE_NOT_FOUND",t}i=r[e]={exports:{}},a[e][0].call(i.exports,function(t){return o(a[e][1][t]||t)},i,i.exports,s,a,r,n)}return r[e].exports}for(var l="function"==typeof require&&require,t=0;t<n.length;t++)o(n[t]);return o}({1:[function(t,e,i){"use strict";var s=(t=t("chart.js"))&&t.__esModule?t:{default:t};var a=["#cc3333","#993333","#ffcccc","#ff9999","#33cc33","#339933","#ccffcc","#99ff99"],r=window.mc4wp_statistics_data.map(function(t,e){return t.fill=!1,t.borderColor=a[e]||o(),t.backgroundColor=a[e]||o(),t}),t=document.getElementById("mc4wp-graph-range"),n=document.getElementById("mc4wp-graph-custom-range-options");function o(){for(var t="0123456789ABCDEF".split(""),e="#",i=0;i<6;i++)e+=t[Math.floor(16*Math.random())];return e}t.addEventListener("change",function(t){n.style.display="custom"===t.target.value?"":"none"}),document.addEventListener("DOMContentLoaded",function(){var t;0!==r.length&&(t=document.getElementById("mc4wp-graph").getContext("2d"),new s.default(t,{type:"bar",data:{datasets:r},options:{animation:{duration:0},layout:{padding:{left:20,right:20,top:20,bottom:20}},scales:{x:{stacked:!0},y:{beginAtZero:!0,stacked:!0,suggestedMax:10,ticks:{stepSize:1}}}}}))})},{"chart.js":2}],2:[function(t,e,i){var s,a;s=this,a=function(){"use strict";const C="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function O(e,i,t){const s=t||(t=>Array.prototype.slice.call(t));let a=!1,r;return function(...t){r=s(t),a||(a=!0,C.call(window,()=>{a=!1,e.apply(i,r)}))}}function A(e,i){let s;return function(...t){return i?(clearTimeout(s),s=setTimeout(e,i,t)):e.apply(this,t),i}}const T=t=>"start"===t?"left":"end"===t?"right":"center",L=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,W=(t,e,i,s)=>{return t===(s?"left":"right")?i:"center"===t?(e+i)/2:e};var n=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,i,s,t){const a=i.listeners[t],r=i.duration;a.forEach(t=>t({chart:e,initial:i.initial,numSteps:r,currentStep:Math.min(s-i.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=C.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(n=Date.now()){let o=0;this._charts.forEach((s,a)=>{if(s.running&&s.items.length){const r=s.items;let t=r.length-1,e=!1,i;for(;0<=t;--t)(i=r[t])._active?(i._total>s.duration&&(s.duration=i._total),i.tick(n),e=!0):(r[t]=r[r.length-1],r.pop());e&&(a.draw(),this._notify(a,s,n,"progress")),r.length||(s.running=!1,this._notify(a,s,n,"complete"),s.initial=!1),o+=r.length}}),this._lastDate=n,0===o&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return 0<this._getAnims(t).items.length}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;t=this._charts.get(t);return!!(t&&t.running&&t.items.length)}stop(e){const i=this._charts.get(e);if(i&&i.items.length){const s=i.items;let t=s.length-1;for(;0<=t;--t)s[t].cancel();i.items=[],this._notify(e,i,Date.now(),"complete")}}remove(t){return this._charts.delete(t)}};const r={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},N="0123456789ABCDEF",H=t=>N[15&t],j=t=>N[(240&t)>>4]+N[15&t],Y=t=>(240&t)>>4==(15&t);function U(t){e=t;var e=Y(e.r)&&Y(e.g)&&Y(e.b)&&Y(e.a)?H:j;return t&&"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):"")}function $(t){return t+.5|0}const X=(t,e,i)=>Math.max(Math.min(t,i),e);function q(t){return X($(2.55*t),0,255)}function K(t){return X($(255*t),0,255)}function G(t){return X($(t/2.55)/100,0,1)}function Z(t){return X($(100*t),0,100)}const J=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const Q=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function tt(i,t,s){const a=t*Math.min(s,1-s);t=(t,e=(t+i/30)%12)=>s-a*Math.max(Math.min(e-3,9-e,1),-1);return[t(0),t(8),t(4)]}function et(i,s,a){i=(t,e=(t+i/60)%6)=>a-a*s*Math.max(Math.min(e,4-e,1),0);return[i(5),i(3),i(1)]}function it(t,e,i){const s=tt(t,1,.5);let a;for(1<e+i&&(e*=a=1/(e+i),i*=a),a=0;a<3;a++)s[a]*=1-e-i,s[a]+=e;return s}function st(t){var e=t.r/255,i=t.g/255,t=t.b/255,s=Math.max(e,i,t),a=Math.min(e,i,t),r=(s+a)/2;let n,o,l;return s!==a&&(l=s-a,o=.5<r?l/(2-s-a):l/(s+a),n=60*(n=s===e?(i-t)/l+(i<t?6:0):s===i?(t-e)/l+2:(e-i)/l+4)+.5),[0|n,o||0,r]}function at(t,e,i,s){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,s)).map(K)}function rt(t,e,i){return at(tt,t,e,i)}function nt(t){return(t%360+360)%360}function ot(t){var e,i,s,t=Q.exec(t);let a=255,r;if(t)return t[5]!==r&&(a=(t[6]?q:K)(+t[5])),e=nt(+t[2]),i=+t[3]/100,s=+t[4]/100,{r:(r="hwb"===t[1]?at(it,e,i,s):"hsv"===t[1]?at(et,e,i,s):rt(e,i,s))[0],g:r[1],b:r[2],a:a}}const lt={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},ht={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let ct;function dt(t){ct||((ct=function(){const t={};var e=Object.keys(ht),i=Object.keys(lt);let s,a,r,n,o;for(s=0;s<e.length;s++){for(n=o=e[s],a=0;a<i.length;a++)r=i[a],o=o.replace(r,lt[r]);r=parseInt(ht[n],16),t[o]=[r>>16&255,r>>8&255,255&r]}return t}()).transparent=[0,0,0,0]);t=ct[t.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:4===t.length?t[3]:255}}function ut(e,i,s){if(e){let t=st(e);t[i]=Math.max(0,Math.min(t[i]+t[i]*s,0===i?360:1)),t=rt(t),e.r=t[0],e.g=t[1],e.b=t[2]}}function gt(t,e){return t&&Object.assign(e||{},t)}function ft(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?3<=t.length&&(e={r:t[0],g:t[1],b:t[2],a:255},3<t.length&&(e.a=K(t[3]))):(e=gt(t,{r:0,g:0,b:0,a:1})).a=K(e.a),e}function pt(a){if("r"!==a.charAt(0))return ot(a);{var r,a=J.exec(a);let t=255,e,i,s;if(a)return a[7]!==e&&(r=+a[7],t=255&(a[8]?q(r):255*r)),e=+a[1],i=+a[3],s=+a[5],e=255&(a[2]?q(e):e),i=255&(a[4]?q(i):i),s=255&(a[6]?q(s):s),{r:e,g:i,b:s,a:t}}}class mt{constructor(t){if(t instanceof mt)return t;var e,i,s=typeof t;let a;"object"==s?a=ft(t):"string"==s&&(a=(i=(s=t).length,"#"===s[0]&&(4===i||5===i?e={r:255&17*r[s[1]],g:255&17*r[s[2]],b:255&17*r[s[3]],a:5===i?17*r[s[4]]:255}:7!==i&&9!==i||(e={r:r[s[1]]<<4|r[s[2]],g:r[s[3]]<<4|r[s[4]],b:r[s[5]]<<4|r[s[6]],a:9===i?r[s[7]]<<4|r[s[8]]:255})),e||dt(t)||pt(t))),this._rgb=a,this._valid=!!a}get valid(){return this._valid}get rgb(){var t=gt(this._rgb);return t&&(t.a=G(t.a)),t}set rgb(t){this._rgb=ft(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${G(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):this._rgb;var t}hexString(){return this._valid?U(this._rgb):this._rgb}hslString(){if(!this._valid)return this._rgb;var t,e,i,s=this._rgb;return s?(i=st(s),t=i[0],e=Z(i[1]),i=Z(i[2]),s.a<255?`hsla(${t}, ${e}%, ${i}%, ${G(s.a)})`:`hsl(${t}, ${e}%, ${i}%)`):void 0}mix(t,e){if(t){const a=this.rgb;var t=t.rgb,e=void 0===e?.5:e,i=2*e-1,s=a.a-t.a,i=(1+(i*s==-1?i:(i+s)/(1+i*s)))/2,s=1-i;a.r=255&i*a.r+s*t.r+.5,a.g=255&i*a.g+s*t.g+.5,a.b=255&i*a.b+s*t.b+.5,a.a=e*a.a+(1-e)*t.a,this.rgb=a}return this}clone(){return new mt(this.rgb)}alpha(t){return this._rgb.a=K(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb;var e=$(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ut(this._rgb,2,t),this}darken(t){return ut(this._rgb,2,-t),this}saturate(t){return ut(this._rgb,1,t),this}desaturate(t){return ut(this._rgb,1,-t),this}rotate(t){var e,i;return e=this._rgb,t=t,(i=st(e))[0]=nt(i[0]+t),i=rt(i),e.r=i[0],e.g=i[1],e.b=i[2],this}}function vt(t){return new mt(t)}const xt=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function bt(t){return xt(t)?t:vt(t)}function _t(t){return xt(t)?t:vt(t).saturate(.5).darken(.1).hexString()}function t(){}const yt=function(){let t=0;return function(){return t++}}();function P(t){return null==t}function I(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function F(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const p=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function h(t,e){return p(t)?t:e}function B(t,e){return void 0===t?e:t}const wt=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:t/e,Mt=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function c(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function M(t,e,i,s){let a,r,n;if(I(t))if(r=t.length,s)for(a=r-1;0<=a;a--)e.call(i,t[a],a);else for(a=0;a<r;a++)e.call(i,t[a],a);else if(F(t))for(n=Object.keys(t),r=n.length,a=0;a<r;a++)e.call(i,t[n[a]],n[a])}function kt(t,e){let i,s,a,r;if(!t||!e||t.length!==e.length)return!1;for(i=0,s=t.length;i<s;++i)if(a=t[i],r=e[i],a.datasetIndex!==r.datasetIndex||a.index!==r.index)return!1;return!0}function St(e){if(I(e))return e.map(St);if(F(e)){const a=Object.create(null);var i=Object.keys(e),s=i.length;let t=0;for(;t<s;++t)a[i[t]]=St(e[i[t]]);return a}return e}function Pt(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function Dt(t,e,i,s){var a;Pt(t)&&(a=e[t],i=i[t],F(a)&&F(i)?Ct(a,i,s):e[t]=St(i))}function Ct(i,s,a){var e=I(s)?s:[s],r=e.length;if(!F(i))return i;const n=(a=a||{}).merger||Dt;for(let t=0;t<r;++t)if(F(s=e[t])){var o=Object.keys(s);for(let t=0,e=o.length;t<e;++t)n(o[t],i,s,a)}return i}function Ot(t,e){return Ct(t,e,{merger:At})}function At(t,e,i){var s;Pt(t)&&(s=e[t],i=i[t],F(s)&&F(i)?Ot(s,i):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=St(i)))}const Tt="",Lt=".";function Rt(t,e){e=t.indexOf(Lt,e);return-1===e?t.length:e}function Et(t,e){if(e===Tt)return t;let i=0,s=Rt(e,i);for(;t&&s>i;)t=t[e.substr(i,s-i)],i=s+1,s=Rt(e,i);return t}function It(t){return t.charAt(0).toUpperCase()+t.slice(1)}const g=t=>void 0!==t,d=t=>"function"==typeof t,zt=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};function Ft(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}const Bt=Object.create(null),Vt=Object.create(null);function Wt(i,t){if(!t)return i;var s=t.split(".");for(let t=0,e=s.length;t<e;++t){var a=s[t];i=i[a]||(i[a]=Object.create(null))}return i}function Nt(t,e,i){return"string"==typeof e?Ct(Wt(t,e),i):Ct(Wt(t,""),e)}var R=new class{constructor(t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>_t(e.backgroundColor),this.hoverBorderColor=(t,e)=>_t(e.borderColor),this.hoverColor=(t,e)=>_t(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return Nt(this,t,e)}get(t){return Wt(this,t)}describe(t,e){return Nt(Vt,t,e)}override(t,e){return Nt(Bt,t,e)}route(t,e,i,s){t=Wt(this,t);const a=Wt(this,i),r="_"+e;Object.defineProperties(t,{[r]:{value:t[e],writable:!0},[e]:{enumerable:!0,get(){var t=this[r],e=a[s];return F(t)?Object.assign({},e,t):B(t,e)},set(t){this[r]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});const _=Math.PI,m=2*_,Ht=m+_,jt=Number.POSITIVE_INFINITY,Yt=_/180,y=_/2,Ut=_/4,$t=2*_/3,u=Math.log10,S=Math.sign;function Xt(t){var e=Math.round(t),e=(t=Gt(t,e,t/1e3)?e:t,Math.pow(10,Math.floor(u(t)))),t=t/e;return(t<=1?1:t<=2?2:t<=5?5:10)*e}function qt(t){const e=[];var i=Math.sqrt(t);let s;for(s=1;s<i;s++)t%s==0&&(e.push(s),e.push(t/s));return i===(0|i)&&e.push(i),e.sort((t,e)=>t-e).pop(),e}function Kt(t){return!isNaN(parseFloat(t))&&isFinite(t)}function Gt(t,e,i){return Math.abs(t-e)<i}function Zt(t,e){var i=Math.round(t);return i-e<=t&&t<=i+e}function Jt(t,e,i){let s,a,r;for(s=0,a=t.length;s<a;s++)r=t[s][i],isNaN(r)||(e.min=Math.min(e.min,r),e.max=Math.max(e.max,r))}function z(t){return t*(_/180)}function Qt(t){return t*(180/_)}function te(i){if(p(i)){let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}}function ee(t,e){var i=e.x-t.x,e=e.y-t.y,t=Math.sqrt(i*i+e*e);let s=Math.atan2(e,i);return s<-.5*_&&(s+=m),{angle:s,distance:t}}function ie(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function se(t,e){return(t-e+Ht)%m-_}function x(t){return(t%m+m)%m}function ae(t,e,i,s){var t=x(t),e=x(e),i=x(i),a=x(e-t),r=x(i-t),n=x(t-e),o=x(t-i);return t===e||t===i||s&&e===i||r<a&&n<o}function f(t,e,i){return Math.max(e,Math.min(i,t))}function re(t){return f(t,-32768,32767)}function v(t,e,i,s=1e-6){return t>=Math.min(e,i)-s&&t<=Math.max(e,i)+s}function ne(t){return!t||P(t.size)||P(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function oe(t,e,i,s,a){let r=e[a];return r||(r=e[a]=t.measureText(a).width,i.push(a)),s=r>s?r:s}function le(t,e,i,s){let a=(s=s||{}).data=s.data||{},r=s.garbageCollect=s.garbageCollect||[],n=(s.font!==e&&(a=s.data={},r=s.garbageCollect=[],s.font=e),t.save(),t.font=e,0);var o=i.length;let l,h,c,d,u;for(l=0;l<o;l++)if(null!=(d=i[l])&&!0!==I(d))n=oe(t,a,r,n,d);else if(I(d))for(h=0,c=d.length;h<c;h++)null==(u=d[h])||I(u)||(n=oe(t,a,r,n,u));t.restore();var g=r.length/2;if(g>i.length){for(l=0;l<g;l++)delete a[r[l]];r.splice(0,g)}return n}function he(t,e,i){t=t.currentDevicePixelRatio,i=0!==i?Math.max(i/2,.5):0;return Math.round((e-i)*t)/t+i}function ce(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function de(t,e,i,s){let a,r,n,o,l;const h=e.pointStyle;var c=e.rotation,d=e.radius;let u=(c||0)*Yt;if(h&&"object"==typeof h&&("[object HTMLImageElement]"===(a=h.toString())||"[object HTMLCanvasElement]"===a))return t.save(),t.translate(i,s),t.rotate(u),t.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),void t.restore();if(!(isNaN(d)||d<=0)){switch(t.beginPath(),h){default:t.arc(i,s,d,0,m),t.closePath();break;case"triangle":t.moveTo(i+Math.sin(u)*d,s-Math.cos(u)*d),u+=$t,t.lineTo(i+Math.sin(u)*d,s-Math.cos(u)*d),u+=$t,t.lineTo(i+Math.sin(u)*d,s-Math.cos(u)*d),t.closePath();break;case"rectRounded":l=.516*d,o=d-l,r=Math.cos(u+Ut)*o,n=Math.sin(u+Ut)*o,t.arc(i-r,s-n,l,u-_,u-y),t.arc(i+n,s-r,l,u-y,u),t.arc(i+r,s+n,l,u,u+y),t.arc(i-n,s+r,l,u+y,u+_),t.closePath();break;case"rect":if(!c){o=Math.SQRT1_2*d,t.rect(i-o,s-o,2*o,2*o);break}u+=Ut;case"rectRot":r=Math.cos(u)*d,n=Math.sin(u)*d,t.moveTo(i-r,s-n),t.lineTo(i+n,s-r),t.lineTo(i+r,s+n),t.lineTo(i-n,s+r),t.closePath();break;case"crossRot":u+=Ut;case"cross":r=Math.cos(u)*d,n=Math.sin(u)*d,t.moveTo(i-r,s-n),t.lineTo(i+r,s+n),t.moveTo(i+n,s-r),t.lineTo(i-n,s+r);break;case"star":r=Math.cos(u)*d,n=Math.sin(u)*d,t.moveTo(i-r,s-n),t.lineTo(i+r,s+n),t.moveTo(i+n,s-r),t.lineTo(i-n,s+r),u+=Ut,r=Math.cos(u)*d,n=Math.sin(u)*d,t.moveTo(i-r,s-n),t.lineTo(i+r,s+n),t.moveTo(i+n,s-r),t.lineTo(i-n,s+r);break;case"line":r=Math.cos(u)*d,n=Math.sin(u)*d,t.moveTo(i-r,s-n),t.lineTo(i+r,s+n);break;case"dash":t.moveTo(i,s),t.lineTo(i+Math.cos(u)*d,s+Math.sin(u)*d)}t.fill(),0<e.borderWidth&&t.stroke()}}function ue(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function ge(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function fe(t){t.restore()}function pe(t,e,i,s,a){if(!e)return t.lineTo(i.x,i.y);var r;"middle"===a?(r=(e.x+i.x)/2,t.lineTo(r,e.y),t.lineTo(r,i.y)):"after"===a!=!!s?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y),t.lineTo(i.x,i.y)}function me(t,e,i,s){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(s?e.cp1x:e.cp2x,s?e.cp1y:e.cp2y,s?i.cp2x:i.cp1x,s?i.cp2y:i.cp1y,i.x,i.y)}function ve(t,e,i,s,a,r={}){var n=I(e)?e:[e],o=0<r.strokeWidth&&""!==r.strokeColor;let l,h;t.save(),t.font=a.string;var e=t,c=r;for(c.translation&&e.translate(c.translation[0],c.translation[1]),P(c.rotation)||e.rotate(c.rotation),c.color&&(e.fillStyle=c.color),c.textAlign&&(e.textAlign=c.textAlign),c.textBaseline&&(e.textBaseline=c.textBaseline),l=0;l<n.length;++l){h=n[l],o&&(r.strokeColor&&(t.strokeStyle=r.strokeColor),P(r.strokeWidth)||(t.lineWidth=r.strokeWidth),t.strokeText(h,i,s,r.maxWidth)),t.fillText(h,i,s,r.maxWidth),m=p=u=f=d=m=v=m=p=f=g=void 0;var d,u,g=t,f=i,p=s,m=h,v=r;(v.strikethrough||v.underline)&&(m=g.measureText(m),d=f-m.actualBoundingBoxLeft,f=f+m.actualBoundingBoxRight,u=p-m.actualBoundingBoxAscent,p=p+m.actualBoundingBoxDescent,m=v.strikethrough?(u+p)/2:p,g.strokeStyle=g.fillStyle,g.beginPath(),g.lineWidth=v.decorationWidth||2,g.moveTo(d,m),g.lineTo(f,m),g.stroke()),s+=a.lineHeight}t.restore()}function xe(t,e){var{x:e,y:i,w:s,h:a,radius:r}=e;t.arc(e+r.topLeft,i+r.topLeft,r.topLeft,-y,_,!0),t.lineTo(e,i+a-r.bottomLeft),t.arc(e+r.bottomLeft,i+a-r.bottomLeft,r.bottomLeft,_,y,!0),t.lineTo(e+s-r.bottomRight,i+a),t.arc(e+s-r.bottomRight,i+a-r.bottomRight,r.bottomRight,y,0,!0),t.lineTo(e+s,i+r.topRight),t.arc(e+s-r.topRight,i+r.topRight,r.topRight,0,-y,!0),t.lineTo(e+r.topLeft,i)}function be(e,i,t){t=t||(t=>e[t]<i);let s=e.length-1,a=0;for(var r;1<s-a;)t(r=a+s>>1)?a=r:s=r;return{lo:a,hi:s}}const b=(e,i,s)=>be(e,s,t=>e[t][i]<s),_e=(e,i,s)=>be(e,s,t=>e[t][i]>=s);function ye(t,e,i){let s=0,a=t.length;for(;s<a&&t[s]<e;)s++;for(;a>s&&t[a-1]>i;)a--;return 0<s||a<t.length?t.slice(s,a):t}const we=["push","pop","shift","splice","unshift"];function Me(a,t){a._chartjs?a._chartjs.listeners.push(t):(Object.defineProperty(a,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),we.forEach(t=>{const i="_onData"+It(t),s=a[t];Object.defineProperty(a,t,{configurable:!0,enumerable:!1,value(...e){var t=s.apply(this,e);return a._chartjs.listeners.forEach(t=>{"function"==typeof t[i]&&t[i](...e)}),t}})}))}function ke(e,t){var i=e._chartjs;if(i){const s=i.listeners;i=s.indexOf(t);-1!==i&&s.splice(i,1),0<s.length||(we.forEach(t=>{delete e[t]}),delete e._chartjs)}}function Se(t){const e=new Set;let i,s;for(i=0,s=t.length;i<s;++i)e.add(t[i]);return e.size===s?t:Array.from(e)}function Pe(){return"undefined"!=typeof window&&"undefined"!=typeof document}function De(t){let e=t.parentNode;return e=e&&"[object ShadowRoot]"===e.toString()?e.host:e}function Ce(t,e,i){let s;return"string"==typeof t?(s=parseInt(t,10),-1!==t.indexOf("%")&&(s=s/100*e.parentNode[i])):s=t,s}const Oe=t=>window.getComputedStyle(t,null);function Ae(t,e){return Oe(t).getPropertyValue(e)}const Te=["top","right","bottom","left"];function Le(e,i,s){const a={};s=s?"-"+s:"";for(let t=0;t<4;t++){var r=Te[t];a[r]=parseFloat(e[i+"-"+r+s])||0}return a.width=a.left+a.right,a.height=a.top+a.bottom,a}const Re=(t,e,i)=>(0<t||0<e)&&(!i||!i.shadowRoot);function Ee(t,e){var{canvas:i,currentDevicePixelRatio:s}=e,a=Oe(i),r="border-box"===a.boxSizing,n=Le(a,"padding"),a=Le(a,"border","width"),{x:t,y:o,box:l}=function(t,e){var i=(t=t.native||t).touches,{offsetX:s,offsetY:a}=i=i&&i.length?i[0]:t;let r=!1,n,o;return Re(s,a,t.target)?(n=s,o=a):(t=e.getBoundingClientRect(),n=i.clientX-t.left,o=i.clientY-t.top,r=!0),{x:n,y:o,box:r}}(t,i),h=n.left+(l&&a.left),l=n.top+(l&&a.top);let{width:c,height:d}=e;return r&&(c-=n.width+a.width,d-=n.height+a.height),{x:Math.round((t-h)/c*i.width/s),y:Math.round((o-l)/d*i.height/s)}}const Ie=t=>Math.round(10*t)/10;function ze(t,e,i,s){var a=Oe(t),r=Le(a,"margin"),n=Ce(a.maxWidth,t,"clientWidth")||jt,o=Ce(a.maxHeight,t,"clientHeight")||jt,t=function(t,e,i){let s,a;if(void 0===e||void 0===i){const h=De(t);var r,n,o,l;h?(r=h.getBoundingClientRect(),o=Le(n=Oe(h),"border","width"),l=Le(n,"padding"),e=r.width-l.width-o.width,i=r.height-l.height-o.height,s=Ce(n.maxWidth,h,"clientWidth"),a=Ce(n.maxHeight,h,"clientHeight")):(e=t.clientWidth,i=t.clientHeight)}return{width:e,height:i,maxWidth:s||jt,maxHeight:a||jt}}(t,e,i);let{width:l,height:h}=t;return"content-box"===a.boxSizing&&(e=Le(a,"border","width"),i=Le(a,"padding"),l-=i.width+e.width,h-=i.height+e.height),l=Math.max(0,l-r.width),h=Math.max(0,s?Math.floor(l/s):h-r.height),l=Ie(Math.min(l,n,t.maxWidth)),h=Ie(Math.min(h,o,t.maxHeight)),l&&!h&&(h=Ie(l/2)),{width:l,height:h}}function Fe(t,e,i){var e=e||1,s=Math.floor(t.height*e),a=Math.floor(t.width*e);t.height=s/e,t.width=a/e;const r=t.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=t.height+"px",r.style.width=t.width+"px"),(t.currentDevicePixelRatio!==e||r.height!==s||r.width!==a)&&(t.currentDevicePixelRatio=e,r.height=s,r.width=a,t.ctx.setTransform(e,0,0,e,0,0),!0)}var Be=function(){let t=!1;try{var e={get passive(){return!(t=!0)}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function Ve(t,e){const i=Ae(t,e);t=i&&i.match(/^(\d+)(\.\d+)?px$/);return t?+t[1]:void 0}function We(t,e){return"native"in t?{x:t.x,y:t.y}:Ee(t,e)}function Ne(t,i,e,s,a){var r=t.getSortedVisibleDatasetMetas(),n=e[i];for(let t=0,e=r.length;t<e;++t){var{index:o,data:l}=r[t],{lo:h,hi:c}=function(t,e,i,s){var{controller:t,data:a,_sorted:r}=t,n=t._cachedMeta.iScale;if(n&&e===n.axis&&"r"!==e&&r&&a.length){const o=n._reversePixels?_e:b;if(!s)return o(a,e,i);if(t._sharedOptions){const l=a[0];r="function"==typeof l.getRange&&l.getRange(e);if(r)return n=o(a,e,i-r),s=o(a,e,i+r),{lo:n.lo,hi:s.hi}}}return{lo:0,hi:a.length-1}}(r[t],i,n,a);for(let t=h;t<=c;++t){var d=l[t];d.skip||s(d,o,t)}}}function He(t,s,e,a){const r=[];if(!ue(s,t.chartArea,t._minPadding))return r;return Ne(t,e,s,function(t,e,i){t.inRange(s.x,s.y,a)&&r.push({element:t,datasetIndex:e,index:i})},!0),r}function je(t,n,e,o){let l=[];return Ne(t,e,n,function(t,e,i){var{startAngle:s,endAngle:a}=t.getProps(["startAngle","endAngle"],o),r=ee(t,{x:n.x,y:n.y})["angle"];ae(r,s,a)&&l.push({element:t,datasetIndex:e,index:i})}),l}function Ye(r,n,t,o,l){let h=[];const c=function(t){const s=-1!==t.indexOf("x"),a=-1!==t.indexOf("y");return function(t,e){var i=s?Math.abs(t.x-e.x):0,t=a?Math.abs(t.y-e.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(t,2))}}(t);let d=Number.POSITIVE_INFINITY;return Ne(r,t,n,function(t,e,i){var s,a=t.inRange(n.x,n.y,l);o&&!a||(ue(s=t.getCenterPoint(l),r.chartArea,r._minPadding)||a)&&((a=c(n,s))<d?(h=[{element:t,datasetIndex:e,index:i}],d=a):a===d&&h.push({element:t,datasetIndex:e,index:i}))}),h}function Ue(t,e,i,s,a){return ue(e,t.chartArea,t._minPadding)?"r"!==i||s?Ye(t,e,i,s,a):je(t,e,i,a):[]}function $e(t,e,i,s){const a=We(e,t),r=[],n=i.axis,o="x"===n?"inXRange":"inYRange";let l=!1;var h,c,d,u=(t,e,i)=>{t[o](a[n],s)&&r.push({element:t,datasetIndex:e,index:i}),t.inRange(a.x,a.y,s)&&(l=!0)},g=t.getSortedVisibleDatasetMetas();for(let t=0,e=g.length;t<e;++t){({index:h,data:c}=g[t]);for(let t=0,e=c.length;t<e;++t)(d=c[t]).skip||u(d,h,t)}return i.intersect&&!l?[]:r}var Xe={modes:{index(t,e,i,s){var e=We(e,t),a=i.axis||"x";const r=i.intersect?He(t,e,a,s):Ue(t,e,a,!1,s),n=[];return r.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{var e=r[0].index,i=t.data[e];i&&!i.skip&&n.push({element:i,datasetIndex:t.index,index:e})}),n):[]},dataset(t,e,i,s){var e=We(e,t),a=i.axis||"xy";let r=i.intersect?He(t,e,a,s):Ue(t,e,a,!1,s);if(0<r.length){var n=r[0].datasetIndex,o=t.getDatasetMeta(n).data;r=[];for(let t=0;t<o.length;++t)r.push({element:o[t],datasetIndex:n,index:t})}return r},point(t,e,i,s){return He(t,We(e,t),i.axis||"xy",s)},nearest(t,e,i,s){return Ue(t,We(e,t),i.axis||"xy",i.intersect,s)},x(t,e,i,s){return $e(t,e,{axis:"x",intersect:i.intersect},s)},y(t,e,i,s){return $e(t,e,{axis:"y",intersect:i.intersect},s)}}};const qe=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),Ke=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function Ge(t,e){var i=(""+t).match(qe);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}const Ze=t=>+t||0;function Je(e,i){const t={};var s=F(i),a=s?Object.keys(i):i;const r=F(e)?s?t=>B(e[t],e[i[t]]):t=>e[t]:()=>e;for(const n of a)t[n]=Ze(r(n));return t}function Qe(t){return Je(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ti(t){return Je(t,["topLeft","topRight","bottomLeft","bottomRight"])}function V(t){const e=Qe(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function E(t,e){e=e||R.font;let i=B((t=t||{}).size,e.size),s=("string"==typeof i&&(i=parseInt(i,10)),B(t.style,e.style));s&&!(""+s).match(Ke)&&(console.warn('Invalid font style specified: "'+s+'"'),s="");const a={family:B(t.family,e.family),lineHeight:Ge(B(t.lineHeight,e.lineHeight),i),size:i,style:s,weight:B(t.weight,e.weight),string:""};return a.string=ne(a),a}function ei(t,e,i,s){let a=!0,r,n,o;for(r=0,n=t.length;r<n;++r)if(void 0!==(o=t[r])&&(void 0!==e&&"function"==typeof o&&(o=o(e),a=!1),void 0!==i&&I(o)&&(o=o[i%o.length],a=!1),void 0!==o))return s&&!a&&(s.cacheable=!1),o}function ii(t,e,i){var{min:t,max:s}=t,e=Mt(e,(s-t)/2),a=(t,e)=>i&&0===t?0:t+e;return{min:a(t,-Math.abs(e)),max:a(s,e)}}function w(t,e){return Object.assign(Object.create(t),e)}const si=["left","top","right","bottom"];function ai(t,e){return t.filter(t=>t.pos===e)}function ri(t,e){return t.filter(t=>-1===si.indexOf(t.pos)&&t.box.axis===e)}function ni(t,s){return t.sort((t,e)=>{var i=s?e:t,t=s?t:e;return i.weight===t.weight?i.index-t.index:i.weight-t.weight})}function oi(t,e){var i=function(t){const e={};for(const r of t){var{stack:i,pos:s,stackWeight:a}=r;if(i&&si.includes(s)){const n=e[i]||(e[i]={count:0,placed:0,weight:0,size:0});n.count++,n.weight+=a}}return e}(t),{vBoxMaxWidth:s,hBoxMaxHeight:a}=e;let r,n,o;for(r=0,n=t.length;r<n;++r){var l=(o=t[r]).box["fullSize"],h=i[o.stack],h=h&&o.stackWeight/h.weight;o.horizontal?(o.width=h?h*s:l&&e.availableWidth,o.height=a):(o.width=s,o.height=h?h*a:l&&e.availableHeight)}return i}function li(t){const e=function(t){const e=[];let i,s,a,r,n,o;for(i=0,s=(t||[]).length;i<s;++i)({position:r,options:{stack:n,stackWeight:o=1}}=a=t[i]),e.push({index:i,box:a,pos:r,horizontal:a.isHorizontal(),weight:a.weight,stack:n&&r+n,stackWeight:o});return e}(t);t=ni(e.filter(t=>t.box.fullSize),!0);const i=ni(ai(e,"left"),!0),s=ni(ai(e,"right")),a=ni(ai(e,"top"),!0);var r=ni(ai(e,"bottom")),n=ri(e,"x"),o=ri(e,"y");return{fullSize:t,leftAndTop:i.concat(a),rightAndBottom:s.concat(o).concat(r).concat(n),chartArea:ai(e,"chartArea"),vertical:i.concat(s).concat(o),horizontal:a.concat(r).concat(n)}}function hi(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function ci(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function di(t,e,i,s){const a=[];let r,n,o,l,h,c;for(r=0,n=t.length,h=0;r<n;++r){o=t[r],(l=o.box).update(o.width||e.w,o.height||e.h,function(t,i){const s=i.maxPadding;function e(t){const e={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{e[t]=Math.max(i[t],s[t])}),e}return e(t?["left","right"]:["top","bottom"])}(o.horizontal,e));var{same:d,other:u}=function(t,e,i,s){const{pos:a,box:r}=i;var n=t.maxPadding;if(!F(a)){i.size&&(t[a]-=i.size);const l=s[i.stack]||{size:0,count:1};l.size=Math.max(l.size,i.horizontal?r.height:r.width),i.size=l.size/l.count,t[a]+=i.size}r.getPadding&&ci(n,r.getPadding());var s=Math.max(0,e.outerWidth-hi(n,t,"left","right")),e=Math.max(0,e.outerHeight-hi(n,t,"top","bottom")),n=s!==t.w,o=e!==t.h;return t.w=s,t.h=e,i.horizontal?{same:n,other:o}:{same:o,other:n}}(e,i,o,s);h|=d&&a.length,c=c||u,l.fullSize||a.push(o)}return h&&di(a,e,i,s)||c}function ui(t,e,i,s,a){t.top=i,t.left=e,t.right=e+s,t.bottom=i+a,t.width=s,t.height=a}function gi(t,e,i,s){var a=i.padding;let{x:r,y:n}=e;for(const d of t){var o=d.box;const u=s[d.stack]||{count:1,placed:0,weight:1};var l,h,c=d.stackWeight/u.weight||1;d.horizontal?(h=e.w*c,l=u.size||o.height,g(u.start)&&(n=u.start),o.fullSize?ui(o,a.left,n,i.outerWidth-a.right-a.left,l):ui(o,e.left+u.placed,n,h,l),u.start=n,u.placed+=h,n=o.bottom):(l=e.h*c,h=u.size||o.width,g(u.start)&&(r=u.start),o.fullSize?ui(o,r,a.top,h,i.outerHeight-a.bottom-a.top):ui(o,r,e.top+u.placed,h,l),u.start=r,u.placed+=l,r=o.right)}e.x=r,e.y=n}R.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var a={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){e=t.boxes?t.boxes.indexOf(e):-1;-1!==e&&t.boxes.splice(e,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(i,t,e,s){if(i){var a=V(i.options.layout.padding),r=Math.max(t-a.width,0),n=Math.max(e-a.height,0),o=li(i.boxes);const u=o.vertical;var l=o.horizontal,h=(M(i.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}),u.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1),t=Object.freeze({outerWidth:t,outerHeight:e,padding:a,availableWidth:r,availableHeight:n,vBoxMaxWidth:r/2/h,hBoxMaxHeight:n/2}),e=Object.assign({},a);ci(e,V(s));const g=Object.assign({maxPadding:e,w:r,h:n,x:a.left,y:a.top},a);h=oi(u.concat(l),t);di(o.fullSize,g,t,h),di(u,g,t,h),di(l,g,t,h)&&di(u,g,t,h);{var c=g;const f=c.maxPadding;function d(t){var e=Math.max(f[t]-c[t],0);return c[t]+=e,e}c.y+=d("top"),c.x+=d("left"),d("right"),d("bottom")}gi(o.leftAndTop,g,t,h),g.x+=g.w,g.y+=g.h,gi(o.rightAndBottom,g,t,h),i.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},M(o.chartArea,t=>{const e=t.box;Object.assign(e,i.chartArea),e.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}}};function fi(o,l=[""],e=o,i,a=()=>o[0]){g(i)||(i=ki("_fallback",o));var t={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:o,_rootScopes:e,_fallback:i,_getTarget:a,override:t=>fi([t,...o],l,e,i)};return new Proxy(t,{deleteProperty(t,e){return delete t[e],delete t._keys,delete o[0][e],!0},get(r,n){return bi(r,n,()=>{var t,e=n,i=o,s=r;for(const a of l)if(t=ki(vi(a,e),i),g(t))return xi(e,t)?wi(i,s,e,t):t})},getOwnPropertyDescriptor(t,e){return Reflect.getOwnPropertyDescriptor(t._scopes[0],e)},getPrototypeOf(){return Reflect.getPrototypeOf(o[0])},has(t,e){return Si(t).includes(e)},ownKeys(t){return Si(t)},set(t,e,i){const s=t._storage||(t._storage=a());return t[e]=s[e]=i,delete t._keys,!0}})}function pi(s,e,i,a){var t={_cacheable:!1,_proxy:s,_context:e,_subProxy:i,_stack:new Set,_descriptors:mi(s,a),setContext:t=>pi(s,t,i,a),override:t=>pi(s.override(t),e,i,a)};return new Proxy(t,{deleteProperty(t,e){return delete t[e],delete s[e],!0},get(l,h,c){return bi(l,h,()=>{{var e=l,i=h,s=c;const{_proxy:a,_context:r,_subProxy:n,_descriptors:o}=e;let t=a[i];return I(t=d(t)&&o.isScriptable(i)?function(t,e,i,s){const{_proxy:a,_context:r,_subProxy:n,_stack:o}=i;if(o.has(t))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+t);o.add(t),e=e(r,n||s),o.delete(t),xi(t,e)&&(e=wi(a._scopes,a,t,e));return e}(i,t,e,s):t)&&t.length&&(t=function(t,e,i,s){const{_proxy:a,_context:r,_subProxy:n,_descriptors:o}=i;if(g(r.index)&&s(t))e=e[r.index%e.length];else if(F(e[0])){const c=e;var l=a._scopes.filter(t=>t!==c);e=[];for(const d of c){var h=wi(l,a,t,d);e.push(pi(h,r,n&&n[t],o))}}return e}(i,t,e,o.isIndexable)),t=xi(i,t)?pi(t,r,n&&n[i],o):t}})},getOwnPropertyDescriptor(t,e){return t._descriptors.allKeys?Reflect.has(s,e)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(s,e)},getPrototypeOf(){return Reflect.getPrototypeOf(s)},has(t,e){return Reflect.has(s,e)},ownKeys(){return Reflect.ownKeys(s)},set(t,e,i){return s[e]=i,delete t[e],!0}})}function mi(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:s=e.indexable,_allKeys:a=e.allKeys}=t;return{allKeys:a,scriptable:i,indexable:s,isScriptable:d(i)?i:()=>i,isIndexable:d(s)?s:()=>s}}const vi=(t,e)=>t?t+It(e):e,xi=(t,e)=>F(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function bi(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];i=i();return t[e]=i}function _i(t,e,i){return d(t)?t(e,i):t}function yi(t,e,i,s,a){for(const o of e){r=i,n=o;n=!0===r?n:"string"==typeof r?Et(n,r):void 0;if(n){t.add(n);r=_i(n._fallback,i,a);if(g(r)&&r!==i&&r!==s)return r}else if(!1===n&&g(s)&&i!==s)return null}var r,n;return!1}function wi(t,a,r,n){var e=a._rootScopes,i=_i(a._fallback,r,n),t=[...t,...e];const s=new Set;s.add(n);var o=Mi(s,t,r,i||r,n);return null!==o&&((!g(i)||i===r||null!==Mi(s,t,i,o,n))&&fi(Array.from(s),[""],e,i,()=>{{var t=a,e=r,i=n;const s=t._getTarget();return e in s||(s[e]={}),I(t=s[e])&&F(i)?i:t}}))}function Mi(t,e,i,s,a){for(;i;)i=yi(t,e,i,s,a);return i}function ki(t,e){for(const s of e)if(s){var i=s[t];if(g(i))return i}}function Si(t){let e=t._keys;return e=e||(t._keys=function(t){const e=new Set;for(const i of t)for(const s of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(s);return Array.from(e)}(t._scopes))}const Pi=Number.EPSILON||1e-14,Di=(t,e)=>e<t.length&&!t[e].skip&&t[e],Ci=t=>"x"===t?"y":"x";function Oi(t,e,i,s){var t=t.skip?e:t,a=e,e=i.skip?e:i,i=ie(a,t),r=ie(e,a);let n=i/(i+r),o=r/(i+r);n=isNaN(n)?0:n,o=isNaN(o)?0:o;i=s*n,r=s*o;return{previous:{x:a.x-i*(e.x-t.x),y:a.y-i*(e.y-t.y)},next:{x:a.x+r*(e.x-t.x),y:a.y+r*(e.y-t.y)}}}function Ai(t,r="x"){var e,i=Ci(r),s=t.length;const a=Array(s).fill(0),n=Array(s);let o,l,h,c=Di(t,0);for(o=0;o<s;++o)l=h,h=c,c=Di(t,o+1),h&&(c&&(e=c[r]-h[r],a[o]=0!=e?(c[i]-h[i])/e:0),n[o]=l?c?S(a[o-1])!==S(a[o])?0:(a[o-1]+a[o])/2:a[o-1]:a[o]);{var d=t,u=a,g=n,f,p,m,v=d.length;let e=Di(d,0);for(let t=0;t<v-1;++t)m=e,e=Di(d,t+1),m&&e&&(Gt(u[t],0,Pi)?g[t]=g[t+1]=0:(m=g[t]/u[t],f=g[t+1]/u[t],(p=Math.pow(m,2)+Math.pow(f,2))<=9||(p=3/Math.sqrt(p),g[t]=m*p*u[t],g[t+1]=f*p*u[t])))}{var[x,b,_="x"]=[t,n,r],y,w,M=Ci(_),k=x.length;let e,i,s,a=Di(x,0);for(let t=0;t<k;++t)i=s,s=a,a=Di(x,t+1),s&&(y=s[_],w=s[M],i&&(e=(y-i[_])/3,s["cp1"+_]=y-e,s["cp1"+M]=w-e*b[t]),a&&(e=(a[_]-y)/3,s["cp2"+_]=y+e,s["cp2"+M]=w+e*b[t]));return}}function Ti(t,e,i){return Math.max(Math.min(t,i),e)}function Li(n,e,o,i,t){let s,a,r,l;if(e.spanGaps&&(n=n.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)Ai(n,t);else{let t=i?n[n.length-1]:n[0];for(s=0,a=n.length;s<a;++s)r=n[s],l=Oi(t,r,n[Math.min(s+1,a-(i?0:1))%a],e.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,t=r}if(e.capBezierPoints){var h=n;var c=o;let t,e,i,s,a,r=ue(h[0],c);for(t=0,e=h.length;t<e;++t)a=s,s=r,r=t<e-1&&ue(h[t+1],c),s&&(i=h[t],a&&(i.cp1x=Ti(i.cp1x,c.left,c.right),i.cp1y=Ti(i.cp1y,c.top,c.bottom)),r&&(i.cp2x=Ti(i.cp2x,c.left,c.right),i.cp2y=Ti(i.cp2y,c.top,c.bottom)))}}const Ri=t=>0===t||1===t,Ei=(t,e,i)=>-(Math.pow(2,10*--t)*Math.sin((t-e)*m/i)),Ii=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*m/i)+1,zi={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>--t*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-(--t*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>--t*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*y),easeOutSine:t=>Math.sin(t*y),easeInOutSine:t=>-.5*(Math.cos(_*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>Ri(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>1<=t?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1- --t*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Ri(t)?t:Ei(t,.075,.3),easeOutElastic:t=>Ri(t)?t:Ii(t,.075,.3),easeInOutElastic(t){return Ri(t)?t:t<.5?.5*Ei(2*t,.1125,.45):.5+.5*Ii(2*t-1,.1125,.45)},easeInBack(t){return t*t*(2.70158*t-1.70158)},easeOutBack(t){return--t*t*(2.70158*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-zi.easeOutBounce(1-t),easeOutBounce(t){var e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*zi.easeInBounce(2*t):.5*zi.easeOutBounce(2*t-1)+.5};function Fi(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function Bi(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:("middle"===s?i<.5?t:e:"after"===s?i<1?t:e:0<i?e:t).y}}function Vi(t,e,i,s){var a={x:t.cp2x,y:t.cp2y},r={x:e.cp1x,y:e.cp1y},t=Fi(t,a,i),a=Fi(a,r,i),r=Fi(r,e,i),e=Fi(t,a,i),t=Fi(a,r,i);return Fi(e,t,i)}const Wi=new Map;function Ni(t,e,i){return function(t,e){e=e||{};var i=t+JSON.stringify(e);let s=Wi.get(i);return s||(s=new Intl.NumberFormat(t,e),Wi.set(i,s)),s}(e,i).format(t)}function Hi(t,e,i){return t?(s=e,a=i,{x(t){return s+s+a-t},setWidth(t){a=t},textAlign(t){return"center"===t?t:"right"===t?"left":"right"},xPlus(t,e){return t-e},leftForLtr(t,e){return t-e}}):{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}};var s,a}function ji(t,e){let i,s;"ltr"!==e&&"rtl"!==e||(s=[(i=t.canvas.style).getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=s)}function Yi(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Ui(t){return"angle"===t?{between:ae,compare:se,normalize:x}:{between:v,compare:(t,e)=>t-e,normalize:t=>t}}function $i({start:t,end:e,count:i,loop:s,style:a}){return{start:t%i,end:e%i,loop:s&&(e-t+1)%i==0,style:a}}function Xi(i,s,t){if(!t)return[i];const{property:a,start:r,end:n}=t;var o=s.length;const{compare:l,between:h,normalize:c}=Ui(a);var{start:i,end:d,loop:u,style:g}=function(t,e,i){var{property:s,start:a,end:r}=i;const{between:n,normalize:o}=Ui(s);var l=e.length;let{start:h,end:c,loop:d}=t,u,g;if(d){for(h+=l,c+=l,u=0,g=l;u<g&&n(o(e[h%l][s]),a,r);++u)h--,c--;h%=l,c%=l}return c<h&&(c+=l),{start:h,end:c,loop:d,style:t.style}}(i,s,t);const f=[];let p,m=null,v,x,b;var _=()=>p||h(r,b,v)&&0!==l(r,b),y=()=>!p||0===l(n,v)||h(n,b,v);for(let t=i,e=i;t<=d;++t)(x=s[t%o]).skip||(v=c(x[a]))!==b&&(p=h(v,r,n),null!==(m=null===m&&_()?0===l(v,r)?t:e:m)&&y()&&(f.push($i({start:m,end:t,loop:u,count:o,style:g})),m=null),e=t,b=v);return null!==m&&f.push($i({start:m,end:d,loop:u,count:o,style:g})),f}function qi(e,i){const s=[];var a=e.segments;for(let t=0;t<a.length;t++){var r=Xi(a[t],e.points,i);r.length&&s.push(...r)}return s}function Ki(t,e){var i=t.points,s=t.options.spanGaps,a=i.length;if(!a)return[];var r=!!t._loop,{start:n,end:o}=function(t,e,i,s){let a=0,r=e-1;if(i&&!s)for(;a<e&&!t[a].skip;)a++;for(;a<e&&t[a].skip;)a++;for(a%=e,i&&(r+=a);r>a&&t[r%e].skip;)r--;return r%=e,{start:a,end:r}}(i,a,r,s);return Gi(t,!0===s?[{start:n,end:o,loop:r}]:function(t,e,i,s){var a=t.length;const r=[];let n=e,o=t[e],l;for(l=e+1;l<=i;++l){var h=t[l%a];h.skip||h.stop?o.skip||(s=!1,r.push({start:e%a,end:(l-1)%a,loop:s}),e=n=h.stop?l:null):(n=l,o.skip&&(e=l)),o=h}return null!==n&&r.push({start:e%a,end:n%a,loop:s}),r}(i,n,o<n?o+a:o,!!t._fullLoop&&0===n&&o===a-1),i,e)}function Gi(t,i,s,a){if(a&&a.setContext&&s){var o,l=i,h=s,c=a;const g=t._chart.getContext(),f=Zi(t.options),{_datasetIndex:p,options:{spanGaps:m}}=t,v=h.length,x=[];let r=f,n=l[0].start,e=n;function d(t,e,i,s){var a=m?-1:1;if(t!==e){for(t+=v;h[t%v].skip;)t-=a;for(;h[e%v].skip;)e+=a;t%v!=e%v&&(x.push({start:t%v,end:e%v,loop:i,style:s}),r=s,n=e%v)}}for(const b of l){n=m?n:b.start;let t=h[n%v];for(e=n+1;e<=b.end;e++){var u=h[e%v];!function(t,e){return e&&JSON.stringify(t)!==JSON.stringify(e)}(o=Zi(c.setContext(w(g,{type:"segment",p0:t,p1:u,p0DataIndex:(e-1)%v,p1DataIndex:e%v,datasetIndex:p}))),r)||d(n,e-1,b.loop,r),t=u,r=o}n<e-1&&d(n,e-1,b.loop,r)}return x}return i}function Zi(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}var Ji=Object.freeze({__proto__:null,easingEffects:zi,color:bt,getHoverColor:_t,noop:t,uid:yt,isNullOrUndef:P,isArray:I,isObject:F,isFinite:p,finiteOrDefault:h,valueOrDefault:B,toPercentage:wt,toDimension:Mt,callback:c,each:M,_elementsEqual:kt,clone:St,_merger:Dt,merge:Ct,mergeIf:Ot,_mergerIf:At,_deprecated:function(t,e,i,s){void 0!==e&&console.warn(t+': "'+i+'" is deprecated. Please use "'+s+'" instead')},resolveObjectKey:Et,_capitalize:It,defined:g,isFunction:d,setsEqual:zt,_isClickEvent:Ft,toFontString:ne,_measureText:oe,_longestText:le,_alignPixel:he,clearCanvas:ce,drawPoint:de,_isPointInArea:ue,clipArea:ge,unclipArea:fe,_steppedLineTo:pe,_bezierCurveTo:me,renderText:ve,addRoundedRectPath:xe,_lookup:be,_lookupByKey:b,_rlookupByKey:_e,_filterBetween:ye,listenArrayEvents:Me,unlistenArrayEvents:ke,_arrayUnique:Se,_createResolver:fi,_attachContext:pi,_descriptors:mi,splineCurve:Oi,splineCurveMonotone:Ai,_updateBezierControlPoints:Li,_isDomSupported:Pe,_getParentNode:De,getStyle:Ae,getRelativePosition:Ee,getMaximumSize:ze,retinaScale:Fe,supportsEventListenerOptions:Be,readUsedSize:Ve,fontString:function(t,e,i){return e+" "+t+"px "+i},requestAnimFrame:C,throttled:O,debounce:A,_toLeftRightCenter:T,_alignStartEnd:L,_textX:W,_pointInLine:Fi,_steppedInterpolation:Bi,_bezierInterpolation:Vi,formatNumber:Ni,toLineHeight:Ge,_readValueToProps:Je,toTRBL:Qe,toTRBLCorners:ti,toPadding:V,toFont:E,resolve:ei,_addGrace:ii,createContext:w,PI:_,TAU:m,PITAU:Ht,INFINITY:jt,RAD_PER_DEG:Yt,HALF_PI:y,QUARTER_PI:Ut,TWO_THIRDS_PI:$t,log10:u,sign:S,niceNum:Xt,_factorize:qt,isNumber:Kt,almostEquals:Gt,almostWhole:Zt,_setMinAndMaxByKey:Jt,toRadians:z,toDegrees:Qt,_decimalPlaces:te,getAngleFromPoint:ee,distanceBetweenPoints:ie,_angleDiff:se,_normalizeAngle:x,_angleBetween:ae,_limitValue:f,_int16Range:re,_isBetween:v,getRtlAdapter:Hi,overrideTextDirection:ji,restoreTextDirection:Yi,_boundSegment:Xi,_boundSegments:qi,_computeSegments:Ki});class Qi{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class ts extends Qi{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const es="$chartjs",is={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ss=t=>null===t||""===t;const as=!!Be&&{passive:!0};function rs(t,e,i){t.canvas.removeEventListener(e,i,as)}function ns(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function os(t,e,s){const a=t.canvas,i=new MutationObserver(t=>{let e=!1;for(const i of t)e=(e=e||ns(i.addedNodes,a))&&!ns(i.removedNodes,a);e&&s()});return i.observe(document,{childList:!0,subtree:!0}),i}function ls(t,e,s){const a=t.canvas,i=new MutationObserver(t=>{let e=!1;for(const i of t)e=(e=e||ns(i.removedNodes,a))&&!ns(i.addedNodes,a);e&&s()});return i.observe(document,{childList:!0,subtree:!0}),i}const hs=new Map;let cs=0;function ds(){const i=window.devicePixelRatio;i!==cs&&(cs=i,hs.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function us(t,e,s){var i=t.canvas;const a=i&&De(i);if(a){const r=O((t,e)=>{var i=a.clientWidth;s(t,e),i<a.clientWidth&&s()},window),n=new ResizeObserver(t=>{var t=t[0],e=t.contentRect.width,t=t.contentRect.height;0===e&&0===t||r(e,t)});return n.observe(a),i=t,t=r,hs.size||window.addEventListener("resize",ds),hs.set(i,t),n}}function gs(t,e,i){i&&i.disconnect(),"resize"===e&&(i=t,hs.delete(i),hs.size||window.removeEventListener("resize",ds))}function fs(e,t,i){var s=e.canvas,a=O(t=>{null!==e.ctx&&i(function(t,e){var i=is[t.type]||t.type,{x:s,y:a}=Ee(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==a?a:null}}(t,e))},e,t=>{t=t[0];return[t,t.offsetX,t.offsetY]});return s.addEventListener(t,a,as),a}class ps extends Qi{acquireContext(t,e){var i=t&&t.getContext&&t.getContext("2d");if(i&&i.canvas===t){{const r=t.style;var s=t.getAttribute("height"),a=t.getAttribute("width");t[es]={initial:{height:s,width:a,style:{display:r.display,height:r.height,width:r.width}}},r.display=r.display||"block",r.boxSizing=r.boxSizing||"border-box",ss(a)&&void 0!==(a=Ve(t,"width"))&&(t.width=a),ss(s)&&(""===t.style.height?t.height=t.width/(e||2):void 0!==(a=Ve(t,"height"))&&(t.height=a))}return i}return null}releaseContext(t){const i=t.canvas;if(!i[es])return!1;const s=i[es].initial,e=(["height","width"].forEach(t=>{var e=s[t];P(e)?i.removeAttribute(t):i.setAttribute(t,e)}),s.style||{});return Object.keys(e).forEach(t=>{i.style[t]=e[t]}),i.width=i.width,delete i[es],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={});const a={attach:os,detach:ls,resize:us}[e]||fs;s[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={});var s=i[e];if(s){const a={attach:gs,detach:gs,resize:gs}[e]||rs;a(t,e,s),i[e]=void 0}}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return ze(t,e,i,s)}isAttached(t){t=De(t);return!(!t||!t.isConnected)}}function ms(t){return!Pe()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?ts:ps}Be=Object.freeze({__proto__:null,_detectPlatform:ms,BasePlatform:Qi,BasicPlatform:ts,DomPlatform:ps});const vs="transparent",xs={boolean(t,e,i){return.5<i?e:t},color(t,e,i){t=bt(t||vs);const s=t.valid&&bt(e||vs);return s&&s.valid?s.mix(t,i).hexString():e},number(t,e,i){return t+(e-t)*i}};class bs{constructor(t,e,i,s){var a=e[i],a=(s=ei([t.to,s,a,t.from]),ei([t.from,a,s]));this._active=!0,this._fn=t.fn||xs[t.type||typeof a],this._easing=zi[t.easing]||zi.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){var s,a,r;this._active&&(this._notify(!1),s=this._target[this._prop],a=i-this._start,r=this._duration-a,this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=ei([t.to,e,s,t.from]),this._from=ei([t.from,s,e]))}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){var t=t-this._start,e=this._duration,i=this._prop,s=this._from,a=this._loop,r=this._to;let n;if(this._active=s!==r&&(a||t<e),!this._active)return this._target[i]=r,void this._notify(!0);t<0?this._target[i]=s:(n=t/e%2,n=a&&1<n?2-n:n,n=this._easing(Math.min(1,Math.max(0,n))),this._target[i]=this._fn(s,r,n))}wait(){const i=this._promises||(this._promises=[]);return new Promise((t,e)=>{i.push({res:t,rej:e})})}_notify(t){var e=t?"res":"rej";const i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}R.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const _s=Object.keys(R.animation);R.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),R.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),R.describe("animations",{_fallback:"animation"}),R.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class ys{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(a){if(F(a)){const r=this._properties;Object.getOwnPropertyNames(a).forEach(e=>{const t=a[e];if(F(t)){const i={};for(const s of _s)i[s]=t[s];(I(t.properties)&&t.properties||[e]).forEach(t=>{t!==e&&r.has(t)||r.set(t,i)})}})}}_animateOptions(t,e){const i=e.options;e=function(e,i){if(i){let t=e.options;if(t)return t.$shared&&(e.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t;e.options=i}}(t,i);if(!e)return[];e=this._createAnimations(e,i);return i.$shared&&function(e,t){const i=[],s=Object.keys(t);for(let t=0;t<s.length;t++){const a=e[s[t]];a&&a.active()&&i.push(a.wait())}return Promise.all(i)}(t.options.$animations,i).then(()=>{t.options=i},()=>{}),e}_createAnimations(e,i){const s=this._properties,a=[],r=e.$animations||(e.$animations={});var t=Object.keys(i),n=Date.now();let o;for(o=t.length-1;0<=o;--o){const c=t[o];if("$"!==c.charAt(0))if("options"===c)a.push(...this._animateOptions(e,i));else{var l=i[c];let t=r[c];var h=s.get(c);if(t){if(h&&t.active()){t.update(h,l,n);continue}t.cancel()}h&&h.duration?(r[c]=t=new bs(h,e,c,l),a.push(t)):e[c]=l}}return a}update(t,e){{if(0!==this._properties.size)return(t=this._createAnimations(t,e)).length?(n.add(this._chart,t),!0):void 0;Object.assign(t,e)}}}function ws(t,e){var t=t&&t.options||{},i=t.reverse,s=void 0===t.min?e:0,t=void 0===t.max?e:0;return{start:i?t:s,end:i?s:t}}function Ms(t,e){const i=[];var s=t._getSortedDatasetMetas(e);let a,r;for(a=0,r=s.length;a<r;++a)i.push(s[a].index);return i}function ks(t,e,i,s={}){var a=t.keys,r="single"===s.mode;let n,o,l,h;if(null!==e){for(n=0,o=a.length;n<o;++n){if((l=+a[n])===i){if(s.all)continue;break}h=t.values[l],p(h)&&(r||0===e||S(e)===S(h))&&(e+=h)}return e}}function Ss(t,e){t=t&&t.options.stacked;return t||void 0===t&&void 0!==e.stack}function Ps(t,e,i,s){for(const r of e.getMatchingVisibleMetas(s).reverse()){var a=t[r.index];if(i&&0<a||!i&&a<0)return r.index}return null}function Ds(t,e){const{chart:i,_cachedMeta:s}=t;var a,r=i._stacks||(i._stacks={}),{iScale:t,vScale:n,index:o}=s,l=t.axis,h=n.axis,c=(a=s,`${t.id}.${n.id}.`+(a.stack||a.type)),d=e.length;let u;for(let t=0;t<d;++t){const p=e[t];var{[l]:g,[h]:f}=p;const m=p._stacks||(p._stacks={});(u=m[h]=function(t,e,i){const s=t[e]||(t[e]={});return s[i]||(s[i]={})}(r,c,g))[o]=f,u._top=Ps(u,n,!0,s.type),u._bottom=Ps(u,n,!1,s.type)}}function Cs(t,e){const i=t.scales;return Object.keys(i).filter(t=>i[t].axis===e).shift()}function Os(t,e){var i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s)for(const a of e=e||t._parsed){const r=a._stacks;if(!r||void 0===r[s]||void 0===r[s][i])return;delete r[s][i]}}const As=t=>"reset"===t||"none"===t,Ts=(t,e)=>e?t:Object.assign({},t);class e{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Ss(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Os(this._cachedMeta),this.index=t}linkScales(){var t=this.chart;const e=this._cachedMeta;var i=this.getDataset(),s=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,a=e.xAxisID=B(i.xAxisID,Cs(t,"x")),r=e.yAxisID=B(i.yAxisID,Cs(t,"y")),i=e.rAxisID=B(i.rAxisID,Cs(t,"r")),t=e.indexAxis,n=e.iAxisID=s(t,a,r,i),s=e.vAxisID=s(t,r,a,i);e.xScale=this.getScaleForId(a),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(i),e.iScale=this.getScaleForId(n),e.vScale=this.getScaleForId(s)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){var e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){var t=this._cachedMeta;this._data&&ke(this._data,this),t._stacked&&Os(t)}_dataCheck(){const t=this.getDataset();var e=t.data||(t.data=[]),i=this._data;if(F(e))this._data=function(t){var e=Object.keys(t);const i=new Array(e.length);let s,a,r;for(s=0,a=e.length;s<a;++s)r=e[s],i[s]={x:r,y:t[r]};return i}(e);else if(i!==e){if(i){ke(i,this);const s=this._cachedMeta;Os(s),s._parsed=[]}e&&Object.isExtensible(e)&&Me(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta;var i=this.getDataset();let s=!1;this._dataCheck();var a=e._stacked;e._stacked=Ss(e.vScale,e),e.stack!==i.stack&&(s=!0,Os(e),e.stack=i.stack),this._resyncElements(t),!s&&a===e._stacked||Ds(this,e._parsed)}configure(){const t=this.chart.config;var e=t.datasetScopeKeys(this._type),e=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(e,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this;var{iScale:a,_stacked:r}=i;const n=a.axis;let o=0===t&&e===s.length||i._sorted,l=0<t&&i._parsed[t-1],h,c,d;if(!1===this._parsing)i._parsed=s,i._sorted=!0,d=s;else{d=I(s[t])?this.parseArrayData(i,s,t,e):F(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);for(h=0;h<e;++h)i._parsed[h+t]=c=d[h],o&&((null===c[n]||l&&c[n]<l[n])&&(o=!1),l=c);i._sorted=o}r&&Ds(this,d)}parsePrimitiveData(t,e,i,s){const{iScale:a,vScale:r}=t;var n=a.axis,o=r.axis,l=a.getLabels(),h=a===r;const c=new Array(s);let d,u,g;for(d=0,u=s;d<u;++d)g=d+i,c[d]={[n]:h||a.parse(l[g],g),[o]:r.parse(e[g],g)};return c}parseArrayData(t,e,i,s){const{xScale:a,yScale:r}=t,n=new Array(s);let o,l,h,c;for(o=0,l=s;o<l;++o)c=e[h=o+i],n[o]={x:a.parse(c[0],h),y:r.parse(c[1],h)};return n}parseObjectData(t,e,i,s){const{xScale:a,yScale:r}=t;var{xAxisKey:n="x",yAxisKey:o="y"}=this._parsing;const l=new Array(s);let h,c,d,u;for(h=0,c=s;h<c;++h)u=e[d=h+i],l[h]={x:a.parse(Et(u,n),d),y:r.parse(Et(u,o),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){var s=this.chart,a=this._cachedMeta,r=e[t.axis];return ks({keys:Ms(s,!0),values:e._stacks[t.axis]},r,a.index,{mode:i})}updateRangeFromParsed(t,e,i,s){var a=i[e.axis];let r=null===a?NaN:a;i=s&&i._stacks[e.axis];s&&i&&(s.values=i,r=ks(s,a,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(e,t){var i=this._cachedMeta;const s=i._parsed;var a=i._sorted&&e===i.iScale,r=s.length;const n=this._getOtherScale(e);i=i,o=this.chart;var o,l=t&&!i.hidden&&i._stacked&&{keys:Ms(o,!0),values:null},h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};const{min:c,max:d}=function(t){var{min:t,max:e,minDefined:i,maxDefined:s}=t.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}(n);let u,g;function f(){var t=(g=s[u])[n.axis];return!p(g[e.axis])||c>t||d<t}for(u=0;u<r&&(f()||(this.updateRangeFromParsed(h,e,g,l),!a));++u);if(a)for(u=r-1;0<=u;--u)if(!f()){this.updateRangeFromParsed(h,e,g,l);break}return h}getAllParsedValues(t){var e=this._cachedMeta._parsed;const i=[];let s,a,r;for(s=0,a=e.length;s<a;++s)r=e[s][t.axis],p(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){var e=this._cachedMeta;const i=e.iScale,s=e.vScale;e=this.getParsed(t);return{label:i?""+i.getLabelForValue(e[i.axis]):"",value:s?""+s.getLabelForValue(e[s.axis]):""}}_update(t){const e=this._cachedMeta;var i,s;this.update(t||"default"),e._clip=function(t){let e,i,s,a;return F(t)?(e=t.top,i=t.right,s=t.bottom,a=t.left):e=i=s=a=t,{top:e,right:i,bottom:s,left:a,disabled:!1===t}}(B(this.options.clip,(t=e.xScale,i=e.yScale,!1!==(s=this.getMaxOverflow())&&(t=ws(t,s),{top:(i=ws(i,s)).end,right:t.end,bottom:i.start,left:t.start}))))}update(t){}draw(){var t=this._ctx,e=this.chart;const i=this._cachedMeta;var s=i.data||[],a=e.chartArea;const r=[];var n=this._drawStart||0,o=this._drawCount||s.length-n,l=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,a,n,o),h=n;h<n+o;++h){const c=s[h];c.hidden||(c.active&&l?r.push(c):c.draw(t,a))}for(h=0;h<r.length;++h)r[h].draw(t,a)}getStyle(t,e){e=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(e):this.resolveDataElementOptions(t||0,e)}getContext(t,e,i){var s,a,r=this.getDataset();let n;if(0<=t&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];(n=o.$context||(o.$context=(s=this.getContext(),a=o,w(s,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:a,index:t,mode:"default",type:"data"})))).parsed=this.getParsed(t),n.raw=r.data[t],n.index=n.dataIndex=t}else(n=this.$context||(this.$context=(s=this.chart.getContext(),a=this.index,w(s,{active:!1,dataset:void 0,datasetIndex:a,index:a,mode:"default",type:"dataset"})))).dataset=r,n.index=n.datasetIndex=this.index;return n.active=!!e,n.mode=i,n}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s="active"===e,a=this._cachedDataOpts;var e=t+"-"+e,r=a[e],n=this.enableOptionSharing&&g(i);if(r)return Ts(r,n);const o=this.chart.config;var r=o.datasetElementScopeKeys(this._type,t),l=s?[t+"Hover","hover",t,""]:[t,""],r=o.getOptionScopes(this.getDataset(),r),t=Object.keys(R.elements[t]);const h=o.resolveNamedOptions(r,t,()=>this.getContext(i,s),l);return h.$shared&&(h.$shared=n,a[e]=Object.freeze(Ts(h,n))),h}_resolveAnimations(t,e,i){var s=this.chart;const a=this._cachedDataOpts;var r="animation-"+e,n=a[r];if(n)return n;let o;if(!1!==s.options.animation){const l=this.chart.config;n=l.datasetAnimationScopeKeys(this._type,e),n=l.getOptionScopes(this.getDataset(),n);o=l.createResolver(n,this.getContext(t,i,e))}n=new ys(s,o&&o.animations);return o&&o._cacheable&&(a[r]=Object.freeze(n)),n}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||As(t)||this.chart._animationsDisabled}updateElement(t,e,i,s){As(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!As(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;var a=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(a)||a})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){var t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){var t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){var e,i,s,a=this._data,r=this._cachedMeta.data;for([e,i,s]of this._syncList)this[e](i,s);this._syncList=[];var r=r.length,a=a.length,n=Math.min(a,r);n&&this.parse(0,n),r<a?this._insertElements(r,a-r,t):a<r&&this._removeElements(a,r-a)}_insertElements(t,e,i=!0){var s=this._cachedMeta;const a=s.data,r=t+e;let n;var o=t=>{for(t.length+=e,n=t.length-1;n>=r;n--)t[n]=t[n-e]};for(o(a),n=t;n<r;++n)a[n]=new this.dataElementType;this._parsing&&o(s._parsed),this.parse(t,e),i&&this.updateElements(a,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;var s;this._parsing&&(s=i._parsed.splice(t,e),i._stacked&&Os(i,s)),i.data.splice(t,e)}_sync(t){var e,i,s;this._parsing?this._syncList.push(t):([e,i,s]=t,this[e](i,s)),this.chart._dataChanges.push([this.index,...t])}_onDataPush(){var t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);e=arguments.length-2;e&&this._sync(["_insertElements",t,e])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}e.defaults={},e.prototype.datasetElementType=null,e.prototype.dataElementType=null;class i{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){var{x:t,y:e}=this.getProps(["x","y"],t);return{x:t,y:e}}hasValue(){return Kt(this.x)&&Kt(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),s}}i.defaults={},i.defaultRoutes=void 0;const Ls={values(t){return I(t)?t:""+t},numeric(t,e,i){if(0===t)return"0";var s=this.chart.options.locale;let a,r=t;1<i.length&&(((n=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value)))<1e-4||1e15<n)&&(a="scientific"),r=function(t,e){let i=3<e.length?e[2].value-e[1].value:e[1].value-e[0].value;1<=Math.abs(i)&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i));var n=u(Math.abs(r)),i=Math.max(Math.min(-1*Math.floor(n),20),0),n={notation:a,minimumFractionDigits:i,maximumFractionDigits:i};return Object.assign(n,this.options.ticks.format),Ni(t,s,n)},logarithmic(t,e,i){if(0===t)return"0";var s=t/Math.pow(10,Math.floor(u(t)));return 1==s||2==s||5==s?Ls.numeric.call(this,t,e,i):""}};var Rs={formatters:Ls};function Es(i,s){var a=i.options.ticks,r=a.maxTicksLimit||(o=(i=i).options.offset,r=i._tickSize(),o=i._length/r+(o?0:1),i=i._maxLength/r,Math.floor(Math.min(o,i))),n=a.major.enabled?function(t){const e=[];let i,s;for(i=0,s=t.length;i<s;i++)t[i].major&&e.push(i);return e}(s):[],o=n.length,i=n[0],a=n[o-1],l=[];if(r<o){{var h=s;var c=l;var d=n;var u=o/r;let t=0,e=d[0],i;for(u=Math.ceil(u),i=0;i<h.length;i++)i===e&&(c.push(h[i]),t++,e=d[t*u])}return l}var g=function(t,e,i){var t=function(t){var e=t.length;let i,s;if(e<2)return!1;for(s=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==s)return!1;return s}(t),s=e.length/i;if(!t)return Math.max(s,1);var a=qt(t);for(let t=0,e=a.length-1;t<e;t++){var r=a[t];if(s<r)return r}return Math.max(s,1)}(n,s,r);if(0<o){let t,e;var f=1<o?Math.round((a-i)/(o-1)):null;for(Is(s,l,g,P(f)?0:i-f,i),t=0,e=o-1;t<e;t++)Is(s,l,g,n[t],n[t+1]);return Is(s,l,g,a,P(f)?s.length:a+f),l}return Is(s,l,g),l}function Is(t,e,i,s,a){var r=B(s,0),n=Math.min(B(a,t.length),t.length);let o=0,l,h,c;for(i=Math.ceil(i),a&&(i=(l=a-s)/Math.floor(l/i)),c=r;c<0;)o++,c=Math.round(r+o*i);for(h=Math.max(r,0);h<n;h++)h===c&&(e.push(t[h]),o++,c=Math.round(r+o*i))}R.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Rs.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),R.route("scale.ticks","color","","color"),R.route("scale.grid","color","","borderColor"),R.route("scale.grid","borderColor","","borderColor"),R.route("scale.title","color","","color"),R.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),R.describe("scales",{_fallback:"scale"}),R.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const zs=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function Fs(t,e){const i=[];var s=t.length/e,a=t.length;let r=0;for(;r<a;r+=s)i.push(t[Math.floor(r)]);return i}function Bs(t){return t.drawTicks?t.tickLength:0}function Vs(t,e){if(!t.display)return 0;var e=E(t.font,e),i=V(t.padding);return(I(t.text)?t.text.length:1)*e.lineHeight+i.height}class Ws extends i{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){var{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this,t=h(t,Number.POSITIVE_INFINITY),e=h(e,Number.NEGATIVE_INFINITY),i=h(i,Number.POSITIVE_INFINITY),s=h(s,Number.NEGATIVE_INFINITY);return{min:h(t,i),max:h(e,s),minDefined:p(t),maxDefined:p(e)}}getMinMax(i){let{min:s,max:a,minDefined:r,maxDefined:n}=this.getUserBounds();var o;if(r&&n)return{min:s,max:a};const l=this.getMatchingVisibleMetas();for(let t=0,e=l.length;t<e;++t)o=l[t].controller.getMinMax(this,i),r||(s=Math.min(s,o.min)),n||(a=Math.max(a,o.max));return s=n&&s>a?a:s,a=r&&s>a?s:a,{min:h(s,h(a,s)),max:h(a,h(s,a))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){c(this.options.beforeUpdate,[this])}update(t,e,i){var{beginAtZero:s,grace:a,ticks:r}=this.options,n=r.sampleSize,t=(this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ii(this,a,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks(),n<this.ticks.length);this._convertTicksToLabels(t?Fs(this.ticks,n):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||"auto"===r.source)&&(this.ticks=Es(this,this.ticks),this._labelSizes=null),t&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){c(this.options.afterUpdate,[this])}beforeSetDimensions(){c(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){c(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),c(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){c(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){var e=this.options.ticks;let i,s,a;for(i=0,s=t.length;i<s;i++)(a=t[i]).label=c(e.callback,[a.value,i,t],this)}afterTickToLabelConversion(){c(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){c(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){var t,e,i,s,a=this.options,r=a.ticks,n=this.ticks.length,o=r.minRotation||0,l=r.maxRotation;let h=o;!this._isVisible()||!r.display||l<=o||n<=1||!this.isHorizontal()?this.labelRotation=o:(e=(t=this._getLabelSizes()).widest.width,i=t.highest.height,s=f(this.chart.width-e,0,this.maxWidth),(a.offset?this.maxWidth/n:s/(n-1))<e+6&&(s=s/(n-(a.offset?.5:1)),n=this.maxHeight-Bs(a.grid)-r.padding-Vs(a.title,this.chart.options.font),r=Math.sqrt(e*e+i*i),h=Qt(Math.min(Math.asin(f((t.highest.height+6)/s,-1,1)),Math.asin(f(n/r,-1,1))-Math.asin(f(i/r,-1,1)))),h=Math.max(o,Math.min(l,h))),this.labelRotation=h)}afterCalculateLabelRotation(){c(this.options.afterCalculateLabelRotation,[this])}beforeFit(){c(this.options.beforeFit,[this])}fit(){const t={width:0,height:0};var e,i,s,a,r,{chart:n,options:{ticks:o,title:l,grid:h}}=this,c=this._isVisible(),d=this.isHorizontal();c&&(c=Vs(l,n.options.font),d?(t.width=this.maxWidth,t.height=Bs(h)+c):(t.height=this.maxHeight,t.width=Bs(h)+c),o.display&&this.ticks.length&&({first:l,last:h,widest:c,highest:e}=this._getLabelSizes(),i=2*o.padding,a=z(this.labelRotation),s=Math.cos(a),a=Math.sin(a),d?(r=o.mirror?0:a*c.width+s*e.height,t.height=Math.min(this.maxHeight,t.height+r+i)):(r=o.mirror?0:s*c.width+a*e.height,t.width=Math.min(this.maxWidth,t.width+r+i)),this._calculatePadding(l,h,a,s))),this._handleMargins(),d?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(i,s,a,r){var{ticks:{align:n,padding:o},position:l}=this.options,h=0!==this.labelRotation,l="top"!==l&&"x"===this.axis;if(this.isHorizontal()){var c=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let t=0,e=0;h?e=l?(t=r*i.width,a*s.height):(t=a*i.height,r*s.width):"start"===n?e=s.width:"end"===n?t=i.width:(t=i.width/2,e=s.width/2),this.paddingLeft=Math.max((t-c+o)*this.width/(this.width-c),0),this.paddingRight=Math.max((e-d+o)*this.width/(this.width-d),0)}else{let t=s.height/2,e=i.height/2;"start"===n?(t=0,e=i.height):"end"===n&&(t=s.height,e=0),this.paddingTop=t+o,this.paddingBottom=e+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){c(this.options.afterFit,[this])}isHorizontal(){var{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)P(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){var i=this.options.ticks.sampleSize;let t=this.ticks;i<t.length&&(t=Fs(t,i)),this._labelSizes=e=this._computeLabelSizes(t,t.length)}return e}_computeLabelSizes(t,e){const{ctx:i,_longestTextCache:s}=this,a=[],r=[];let n=0,o=0,l,h,c,d,u,g,f,p,m,v,x;for(l=0;l<e;++l){if(d=t[l].label,u=this._resolveTickFontOptions(l),i.font=g=u.string,f=s[g]=s[g]||{data:{},gc:[]},p=u.lineHeight,m=v=0,P(d)||I(d)){if(I(d))for(h=0,c=d.length;h<c;++h)P(x=d[h])||I(x)||(m=oe(i,f.data,f.gc,m,x),v+=p)}else m=oe(i,f.data,f.gc,m,d),v=p;a.push(m),r.push(v),n=Math.max(m,n),o=Math.max(v,o)}_=s,b=e,M(_,t=>{const e=t.gc;var i=e.length/2;let s;if(b<i){for(s=0;s<i;++s)delete t.data[e[s]];e.splice(0,i)}});var b,_=a.indexOf(n),y=r.indexOf(o),w=t=>({width:a[t]||0,height:r[t]||0});return{first:w(0),last:w(e-1),widest:w(_),highest:w(y),widths:a,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);t=this._startPixel+t*this._length;return re(this._alignToPixels?he(this.chart,t,0):t)}getDecimalForPixel(t){t=(t-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){var{min:t,max:e}=this;return t<0&&e<0?e:0<t&&0<e?t:0}getContext(t){var e,i=this.ticks||[];if(0<=t&&t<i.length){const s=i[t];return s.$context||(s.$context=(i=this.getContext(),e=s,w(i,{tick:e,index:t,type:"tick"})))}return this.$context||(this.$context=w(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){var t=this.options.ticks,e=z(this.labelRotation),i=Math.abs(Math.cos(e)),e=Math.abs(Math.sin(e)),s=this._getLabelSizes(),t=t.autoSkipPadding||0,a=s?s.widest.width+t:0,s=s?s.highest.height+t:0;return this.isHorizontal()?a*e<s*i?a/i:s/e:s*e<a*i?s/i:a/e}_isVisible(){var t=this.options.display;return"auto"!==t?!!t:0<this.getMatchingVisibleMetas().length}_computeGridLineItems(t){var e=this.axis;const i=this.chart;var s=this.options;const{grid:a,position:r}=s;var n=a.offset,o=this.isHorizontal(),l=this.ticks.length+(n?1:0),h=Bs(a);const c=[];var d=a.setContext(this.getContext());const u=d.drawBorder?d.borderWidth:0;function g(t){return he(i,t,u)}var f,p,d=u/2;let m,v,x,b,_,y,w,M,k,S,P,D;"top"===r?(m=g(this.bottom),y=this.bottom-h,M=m-d,S=g(t.top)+d,D=t.bottom):"bottom"===r?(m=g(this.top),S=t.top,D=g(t.bottom)-d,y=m+d,M=this.top+h):"left"===r?(m=g(this.right),_=this.right-h,w=m-d,k=g(t.left)+d,P=t.right):"right"===r?(m=g(this.left),k=t.left,P=g(t.right)-d,_=m+d,w=this.left+h):"x"===e?("center"===r?m=g((t.top+t.bottom)/2+.5):F(r)&&(p=r[f=Object.keys(r)[0]],m=g(this.chart.scales[f].getPixelForValue(p))),S=t.top,D=t.bottom,y=m+d,M=y+h):"y"===e&&("center"===r?m=g((t.left+t.right)/2):F(r)&&(p=r[f=Object.keys(r)[0]],m=g(this.chart.scales[f].getPixelForValue(p))),_=m-d,w=_-h,k=t.left,P=t.right);var e=B(s.ticks.maxTicksLimit,l),C=Math.max(1,Math.ceil(l/e));for(v=0;v<l;v+=C){var O=a.setContext(this.getContext(v)),A=O.lineWidth,T=O.color,L=a.borderDash||[],R=O.borderDashOffset,E=O.tickWidth,I=O.tickColor,z=O.tickBorderDash||[],O=O.tickBorderDashOffset;void 0!==(x=function(t,e,i){var s=t.ticks.length,a=Math.min(e,s-1),r=t._startPixel,n=t._endPixel;let o=t.getPixelForTick(a),l;if(!(i&&(l=1===s?Math.max(o-r,n-o):0===e?(t.getPixelForTick(1)-o)/2:(o-t.getPixelForTick(a-1))/2,(o+=a<e?l:-l)<r-1e-6||o>n+1e-6)))return o}(this,v,n))&&(b=he(i,x,A),o?_=w=k=P=b:y=M=S=D=b,c.push({tx1:_,ty1:y,tx2:w,ty2:M,x1:k,y1:S,x2:P,y2:D,width:A,color:T,borderDash:L,borderDashOffset:R,tickWidth:E,tickColor:I,tickBorderDash:z,tickBorderDashOffset:O}))}return this._ticksLength=l,this._borderValue=m,c}_computeLabelItems(t){var e=this.axis,i=this.options;const{position:s,ticks:a}=i;var r,n=this.isHorizontal(),o=this.ticks,{align:l,crossAlign:h,padding:c,mirror:d}=a,i=Bs(i.grid),u=i+c,c=d?-c:u,g=-z(this.labelRotation);const f=[];let p,m,v,x,b,_,y,w,M,k,S,P="middle";"top"===s?(b=this.bottom-c,_=this._getXAxisLabelAlignment()):"bottom"===s?(b=this.top+c,_=this._getXAxisLabelAlignment()):"left"===s?(c=this._getYAxisLabelAlignment(i),_=c.textAlign,x=c.x):"right"===s?(c=this._getYAxisLabelAlignment(i),_=c.textAlign,x=c.x):"x"===e?("center"===s?b=(t.top+t.bottom)/2+u:F(s)&&(r=s[c=Object.keys(s)[0]],b=this.chart.scales[c].getPixelForValue(r)+u),_=this._getXAxisLabelAlignment()):"y"===e&&("center"===s?x=(t.left+t.right)/2-u:F(s)&&(r=s[c=Object.keys(s)[0]],x=this.chart.scales[c].getPixelForValue(r)),_=this._getYAxisLabelAlignment(i).textAlign),"y"===e&&("start"===l?P="top":"end"===l&&(P="bottom"));var D=this._getLabelSizes();for(p=0,m=o.length;p<m;++p){v=o[p].label;var C=a.setContext(this.getContext(p)),O=(y=this.getPixelForTick(p)+a.labelOffset,M=(w=this._resolveTickFontOptions(p)).lineHeight,(k=I(v)?v.length:1)/2),A=C.color,T=C.textStrokeColor,L=C.textStrokeWidth;n?(x=y,S="top"===s?"near"===h||0!=g?-k*M+M/2:"center"===h?-D.highest.height/2-O*M+M:-D.highest.height+M/2:"near"===h||0!=g?M/2:"center"===h?D.highest.height/2-O*M:D.highest.height-k*M,d&&(S*=-1)):(b=y,S=(1-k)*M/2);let i;if(C.showLabelBackdrop){var O=V(C.backdropPadding),R=D.heights[p],E=D.widths[p];let t=b+S-O.top,e=x-O.left;switch(P){case"middle":t-=R/2;break;case"bottom":t-=R}switch(_){case"center":e-=E/2;break;case"right":e-=E}i={left:e,top:t,width:E+O.width,height:R+O.height,color:C.backdropColor}}f.push({rotation:g,label:v,font:w,color:A,strokeColor:T,strokeWidth:L,textOffset:S,textAlign:_,textBaseline:P,translation:[x,b],backdrop:i})}return f}_getXAxisLabelAlignment(){var{position:t,ticks:e}=this.options;if(-z(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align&&(i="right"),i}_getYAxisLabelAlignment(t){var{position:e,ticks:{crossAlign:i,mirror:s,padding:a}}=this.options,t=t+a,r=this._getLabelSizes().widest.width;let n,o;return"left"===e?s?(o=this.right+a,"near"===i?n="left":"center"===i?(n="center",o+=r/2):(n="right",o+=r)):(o=this.right-t,"near"===i?n="right":"center"===i?(n="center",o-=r/2):(n="left",o=this.left)):"right"===e?s?(o=this.left+a,"near"===i?n="right":"center"===i?(n="center",o-=r/2):(n="left",o-=r)):(o=this.left+t,"near"===i?n="left":"center"===i?(n="center",o+=r/2):(n="right",o=this.right)):n="right",{textAlign:n,x:o}}_computeLabelArea(){var t,e;if(!this.options.ticks.mirror)return t=this.chart,e=this.options.position,"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:a,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,a,r),t.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const i=this.ticks;var s=i.findIndex(t=>t.value===e);return 0<=s?t.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){var e=this.options.grid;const s=this.ctx;var i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let a,r;var n=(t,e,i)=>{i.width&&i.color&&(s.save(),s.lineWidth=i.width,s.strokeStyle=i.color,s.setLineDash(i.borderDash||[]),s.lineDashOffset=i.borderDashOffset,s.beginPath(),s.moveTo(t.x,t.y),s.lineTo(e.x,e.y),s.stroke(),s.restore())};if(e.display)for(a=0,r=i.length;a<r;++a){var o=i[a];e.drawOnChartArea&&n({x:o.x1,y:o.y1},{x:o.x2,y:o.y2},o),e.drawTicks&&n({x:o.tx1,y:o.ty1},{x:o.tx2,y:o.ty2},{color:o.tickColor,width:o.tickWidth,borderDash:o.tickBorderDash,borderDashOffset:o.tickBorderDashOffset})}}drawBorder(){const{chart:a,ctx:r,options:{grid:n}}=this;var o=n.setContext(this.getContext()),l=n.drawBorder?o.borderWidth:0;if(l){var h=n.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let t,e,i,s;this.isHorizontal()?(t=he(a,this.left,l)-l/2,e=he(a,this.right,h)+h/2,i=s=c):(i=he(a,this.top,l)-l/2,s=he(a,this.bottom,h)+h/2,t=e=c),r.save(),r.lineWidth=o.borderWidth,r.strokeStyle=o.borderColor,r.beginPath(),r.moveTo(t,i),r.lineTo(e,s),r.stroke(),r.restore()}}drawLabels(i){if(this.options.ticks.display){const h=this.ctx;var s=this._computeLabelArea(),a=(s&&ge(h,s),this._labelItems||(this._labelItems=this._computeLabelItems(i)));let t,e;for(t=0,e=a.length;t<e;++t){var r=a[t],n=r.font,o=r.label,l=(r.backdrop&&(h.fillStyle=r.backdrop.color,h.fillRect(r.backdrop.left,r.backdrop.top,r.backdrop.width,r.backdrop.height)),r.textOffset);ve(h,o,0,l,n,r)}s&&fe(h)}}drawTitle(){var{ctx:e,options:{position:i,title:s,reverse:a}}=this;if(s.display){var r=E(s.font),n=V(s.padding),o=s.align;let t=r.lineHeight/2;"bottom"===i||"center"===i||F(i)?(t+=n.bottom,I(s.text)&&(t+=r.lineHeight*(s.text.length-1))):t+=n.top;var{titleX:n,titleY:l,maxWidth:h,rotation:c}=function(t,e,i,s){var{top:a,left:r,bottom:n,right:o,chart:l}=t;const{chartArea:h,scales:c}=l;let d=0,u,g,f;var p,m,l=n-a,v=o-r;return t.isHorizontal()?(g=L(s,r,o),f=F(i)?(m=i[p=Object.keys(i)[0]],c[p].getPixelForValue(m)+l-e):"center"===i?(h.bottom+h.top)/2+l-e:zs(t,i,e),u=o-r):(g=F(i)?(m=i[p=Object.keys(i)[0]],c[p].getPixelForValue(m)-v+e):"center"===i?(h.left+h.right)/2-v+e:zs(t,i,e),f=L(s,n,a),d="left"===i?-y:y),{titleX:g,titleY:f,maxWidth:u,rotation:d}}(this,t,i,o);ve(e,s.text,0,0,r,{color:s.color,maxWidth:h,rotation:c,textAlign:function(t,e,i){let s=T(t);return s=i&&"right"!==e||!i&&"right"===e?"left"===(t=s)?"right":"right"===t?"left":t:s}(o,i,a),textBaseline:"middle",translation:[n,l]})}}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){var t=this.options,e=t.ticks&&t.ticks.z||0,t=B(t.grid&&t.grid.z,-1);return this._isVisible()&&this.draw===Ws.prototype.draw?[{z:t,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:t+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){var e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID";const s=[];let a,r;for(a=0,r=e.length;a<r;++a){var n=e[a];n[i]!==this.id||t&&n.type!==t||s.push(n)}return s}_resolveTickFontOptions(t){return E(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){var t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ns{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){var e=Object.getPrototypeOf(t);let i;"id"in(a=e)&&"defaults"in a&&(i=this.register(e));const s=this.items;var a=t.id,e=this.scope+"."+a;if(!a)throw new Error("class does not have id: "+t);if(a in s)return e;var a=s[a]=t,r=e,n=i;{var o,l;n=Ct(Object.create(null),[n?R.get(n):{},R.get(r),a.defaults]),R.set(r,n),a.defaultRoutes&&(o=r,l=a.defaultRoutes,Object.keys(l).forEach(t=>{const e=t.split(".");var i=e.pop(),s=[o].concat(e).join(".");const a=l[t].split(".");var t=a.pop(),r=a.join(".");R.route(s,i,r,t)}))}return a.descriptors&&R.describe(r,a.descriptors),this.override&&R.override(t.id,t.overrides),e}get(t){return this.items[t]}unregister(t){const e=this.items;var t=t.id,i=this.scope;t in e&&delete e[t],i&&t in R[i]&&(delete R[i][t],this.override&&delete Bt[t])}}var k=new class{constructor(){this.controllers=new Ns(e,"datasets",!0),this.elements=new Ns(i,"elements"),this.plugins=new Ns(Object,"plugins"),this.scales=new Ns(Ws,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(i,t,s){[...t].forEach(t=>{const e=s||this._getRegistryForType(t);s||e.isForType(t)||e===this.plugins&&t.id?this._exec(i,e,t):M(t,t=>{var e=s||this._getRegistryForType(t);this._exec(i,e,t)})})}_exec(t,e,i){var s=It(t);c(i["before"+s],[],i),e[t](i),c(i["after"+s],[],i)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){const i=this._typedRegistries[t];if(i.isForType(e))return i}return this.plugins}_get(t,e,i){e=e.get(t);if(void 0===e)throw new Error('"'+t+'" is not a registered '+i+".");return e}};class Hs{constructor(){this._init=[]}notify(t,e,i,s){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));s=s?this._descriptors(t).filter(s):this._descriptors(t),i=this._notify(s,t,e,i);return"afterDestroy"===e&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall")),i}_notify(t,e,i,s){s=s||{};for(const r of t){var a=r.plugin;if(!1===c(a[i],[e,s,r.options],a)&&s.cancelable)return!1}return!0}invalidate(){P(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;var e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){var i=t&&t.config,s=B(i.options&&i.options.plugins,{}),i=function(t){const e=[],i=Object.keys(k.plugins.items);for(let t=0;t<i.length;t++)e.push(k.getPlugin(i[t]));var s=t.plugins||[];for(let t=0;t<s.length;t++){var a=s[t];-1===e.indexOf(a)&&e.push(a)}return e}(i);if(!1!==s||e){var a=t,r=i,n=s,o=e;const c=[],d=a.getContext();for(let t=0;t<r.length;t++){var l=r[t],h=l.id,h=function(t,e){return e||!1!==t?!0!==t?t:{}:null}(n[h],o);null!==h&&c.push({plugin:l,options:function(t,e,i,s){e=t.pluginScopeKeys(e),i=t.getOptionScopes(i,e);return t.createResolver(i,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}(a.config,l,h,d)})}return c}return[]}_notifyStateChanges(t){var e=this._oldCache||[],i=this._cache,s=(t,i)=>t.filter(e=>!i.some(t=>e.plugin.id===t.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function js(t,e){var i=R.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Ys(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(e=e.position)||"bottom"===e?"x":"left"===e||"right"===e?"y":void 0)||t.charAt(0).toLowerCase()}function Us(e,i){const r=Bt[e.type]||{scales:{}},n=i.scales||{},o=js(e.type,i),l=Object.create(null),h=Object.create(null);return Object.keys(n).forEach(t=>{var e=n[t];if(!F(e))return console.error("Invalid scale configuration for scale: "+t);if(e._proxy)return console.warn("Ignoring resolver passed as options for scale: "+t);var i=Ys(t,e),s=(s=i,a=o,s===a?"_index_":"_value_"),a=r.scales||{};l[i]=l[i]||t,h[t]=Ot(Object.create(null),[{axis:i},e,a[i],a[s]])}),e.data.datasets.forEach(s=>{var t=s.type||e.type;const a=s.indexAxis||js(t,i),r=(Bt[t]||{}).scales||{};Object.keys(r).forEach(t=>{var e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,a),i=s[e+"AxisID"]||l[e]||e;h[i]=h[i]||Object.create(null),Ot(h[i],[{axis:e},n[i],r[t]])})}),Object.keys(h).forEach(t=>{t=h[t];Ot(t,[R.scales[t.type],R.scale])}),h}function $s(t){const e=t.options||(t.options={});e.plugins=B(e.plugins,{}),e.scales=Us(t,e)}function Xs(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const qs=new Map,Ks=new Set;function Gs(t,e){let i=qs.get(t);return i||(i=e(),qs.set(t,i),Ks.add(i)),i}const Zs=(t,e,i)=>{e=Et(e,i);void 0!==e&&t.add(e)};class Js{constructor(t){this._config=((t=(t=t)||{}).data=Xs(t.data),$s(t),t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Xs(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){var t=this._config;this.clearCache(),$s(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Gs(t,()=>[["datasets."+t,""]])}datasetAnimationScopeKeys(t,e){return Gs(t+".transition."+e,()=>[[`datasets.${t}.transitions.`+e,"transitions."+e],["datasets."+t,""]])}datasetElementScopeKeys(t,e){return Gs(t+"-"+e,()=>[[`datasets.${t}.elements.`+e,"datasets."+t,"elements."+e,""]])}pluginScopeKeys(t){const e=t.id;return Gs(this.type+"-plugin-"+e,()=>[["plugins."+e,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(e,t,i){const{options:s,type:a}=this,r=this._cachedScopes(e,i);i=r.get(t);if(i)return i;const n=new Set,o=(t.forEach(t=>{e&&(n.add(e),t.forEach(t=>Zs(n,e,t))),t.forEach(t=>Zs(n,s,t)),t.forEach(t=>Zs(n,Bt[a]||{},t)),t.forEach(t=>Zs(n,R,t)),t.forEach(t=>Zs(n,Vt,t))}),Array.from(n));return 0===o.length&&o.push(Object.create(null)),Ks.has(t)&&r.set(t,o),o}chartOptionScopes(){var{options:t,type:e}=this;return[t,Bt[e]||{},R.datasets[e]||{},{type:e},R,Vt]}resolveNamedOptions(t,e,i,s=[""]){const a={$shared:!0};var{resolver:s,subPrefixes:r}=Qs(this._resolverCache,t,s);let n=s;!function(t,e){const{isScriptable:i,isIndexable:s}=mi(t);for(const o of e){var a=i(o),r=s(o),n=(r||a)&&t[o];if(a&&(d(n)||ta(n))||r&&I(n))return 1}return}(s,e)||(a.$shared=!1,i=d(i)?i():i,t=this.createResolver(t,i,r),n=pi(s,i,t));for(const o of e)a[o]=n[o];return a}createResolver(t,e,i=[""],s){t=Qs(this._resolverCache,t,i).resolver;return F(e)?pi(t,e,void 0,s):t}}function Qs(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));t=i.join();let a=s.get(t);return a||(e=fi(e,i),a={resolver:e,subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},s.set(t,a)),a}const ta=i=>F(i)&&Object.getOwnPropertyNames(i).reduce((t,e)=>t||d(i[e]),!1);const ea=["top","bottom","left","right","chartArea"];function ia(t,e){return"top"===t||"bottom"===t||-1===ea.indexOf(t)&&"x"===e}function sa(i,s){return function(t,e){return t[i]===e[i]?t[s]-e[s]:t[i]-e[i]}}function aa(t){const e=t.chart;var i=e.options.animation;e.notifyPlugins("afterRender"),c(i&&i.onComplete,[t],e)}function ra(t){var e=t.chart,i=e.options.animation;c(i&&i.onProgress,[t],e)}function na(t){return Pe()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t=t&&t.canvas?t.canvas:t}const oa={},la=t=>{const e=na(t);return Object.values(oa).filter(t=>t.canvas===e).pop()};class s{constructor(t,e){const i=this.config=new Js(e);e=na(t),t=la(e);if(t)throw new Error("Canvas is already in use. Chart with ID '"+t.id+"' must be destroyed before the canvas can be reused.");var t=i.createResolver(i.chartOptionScopes(),this.getContext()),e=(this.platform=new(i.platform||ms(e)),this.platform.updateConfig(i),this.platform.acquireContext(e,t.aspectRatio)),s=e&&e.canvas,a=s&&s.height,r=s&&s.width;this.id=yt(),this.ctx=e,this.canvas=s,this.width=r,this.height=a,this._options=t,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Hs,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=A(t=>this.update(t),t.resizeDelay||0),this._dataChanges=[],oa[this.id]=this,e&&s?(n.listen(this,"complete",aa),n.listen(this,"progress",ra),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){var{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:a}=this;return P(t)?e&&a?a:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Fe(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ce(this.canvas,this.ctx),this}stop(){return n.stop(this),this}resize(t,e){n.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){var i=this.options,s=this.canvas,a=i.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(s,t,e,a),t=i.devicePixelRatio||this.platform.getDevicePixelRatio(),e=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,Fe(this,t,!0)&&(this.notifyPlugins("resize",{size:s}),c(i.onResize,[this,s],this),this.attached&&this._doResize(e)&&this.render())}ensureScalesHaveIDs(){M(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const o=this.options,s=o.scales,l=this.scales,h=Object.keys(l).reduce((t,e)=>(t[e]=!1,t),{});let t=[];M(t=s?t.concat(Object.keys(s).map(t=>{var e=s[t],t=Ys(t,e),i="r"===t,t="x"===t;return{options:e,dposition:i?"chartArea":t?"bottom":"left",dtype:i?"radialLinear":t?"category":"linear"}})):t,t=>{const e=t.options;var i=e.id,s=Ys(i,e),a=B(e.type,t.dtype);void 0!==e.position&&ia(e.position,s)===ia(t.dposition)||(e.position=t.dposition),h[i]=!0;let r=null;if(i in l&&l[i].type===a)r=l[i];else{const n=k.getScale(a);r=new n({id:i,type:a,ctx:this.ctx,chart:this}),l[r.id]=r}r.init(e,o)}),M(h,(t,e)=>{t||delete l[e]}),M(l,t=>{a.configure(this,t,t.options),a.addBox(this,t)})}_updateMetasets(){const t=this._metasets;var e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),e<i){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(sa("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:i}}=this;t.length>i.length&&delete this._stacks,t.forEach((e,t)=>{0===i.filter(t=>t===e._dataset).length&&this._destroyDatasetMeta(t)})}buildOrUpdateControllers(){const e=[];var i=this.data.datasets;let s,t;for(this._removeUnreferencedMetasets(),s=0,t=i.length;s<t;s++){var a=i[s];let t=this.getDatasetMeta(s);var r=a.type||this.config.type;if(t.type&&t.type!==r&&(this._destroyDatasetMeta(s),t=this.getDatasetMeta(s)),t.type=r,t.indexAxis=a.indexAxis||js(r,this.options),t.order=a.order||0,t.index=s,t.label=""+a.label,t.visible=this.isDatasetVisible(s),t.controller)t.controller.updateIndex(s),t.controller.linkScales();else{const n=k.getController(r);var{datasetElementType:a,dataElementType:r}=R.datasets[r];Object.assign(n.prototype,{dataElementType:k.getElement(r),datasetElementType:a&&k.getElement(a)}),t.controller=new n(this,s),e.push(t.controller)}}return this._updateMetasets(),e}_resetElements(){M(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();var s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),a=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1!==this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})){const n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let i=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const o=this.getDatasetMeta(t)["controller"];var r=!a&&-1===n.indexOf(o);o.buildOrUpdateElements(r),i=Math.max(+o.getMaxOverflow(),i)}i=this._minPadding=s.layout.autoPadding?i:0,this._updateLayout(i),a||M(n,t=>{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(sa("z","_idx"));var{_active:s,_lastEvent:t}=this;t?this._eventHandler(t,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}}_updateScales(){M(this.scales,t=>{a.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){var t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);zt(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){var t,e,i,s=this["_hiddenIndices"];for({method:t,start:e,count:i}of this._getUniformDataChanges()||[]){var a="_removeElements"===t?-i:i,r=(l=h=o=n=r=void 0,s),n=e,o=a;for(const c of Object.keys(r)){var l,h=+c;n<=h&&(l=r[c],delete r[c],(0<o||n<h)&&(r[h+o]=l))}}}_getUniformDataChanges(){const t=this._dataChanges;if(t&&t.length){this._dataChanges=[];var e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),s=i(0);for(let t=1;t<e;t++)if(!zt(s,i(t)))return;return Array.from(s).map(t=>t.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}}_updateLayout(t){if(!1!==this.notifyPlugins("beforeLayout",{cancelable:!0})){a.update(this,this.width,this.height,t);t=this.chartArea;const e=t.width<=0||t.height<=0;this._layers=[],M(this.boxes,t=>{e&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}}_updateDatasets(i){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:i,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let t=0,e=this.data.datasets.length;t<e;++t)this._updateDataset(t,d(i)?i({datasetIndex:t}):i);this.notifyPlugins("afterDatasetsUpdate",{mode:i})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(n.has(this)?this.attached&&!n.running(this)&&n.start(this):(this.draw(),aa({chart:this})))}draw(){let t;var e,i;if(this._resizeBeforeDraw&&({width:e,height:i}=this._resizeBeforeDraw,this._resize(e,i),this._resizeBeforeDraw=null),this.clear(),!(this.width<=0||this.height<=0)&&!1!==this.notifyPlugins("beforeDraw",{cancelable:!0})){const s=this._layers;for(t=0;t<s.length&&s[t].z<=0;++t)s[t].draw(this.chartArea);for(this._drawDatasets();t<s.length;++t)s[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}}_getSortedDatasetMetas(t){var e=this._sortedMetasets;const i=[];let s,a;for(s=0,a=e.length;s<a;++s){var r=e[s];t&&!r.visible||i.push(r)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1!==this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})){var e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;0<=t;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}}_drawDataset(t){var e=this.ctx,i=t._clip,s=!i.disabled,a=this.chartArea;const r={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",r)&&(s&&ge(e,{left:!1===i.left?0:a.left-i.left,right:!1===i.right?this.width:a.right+i.right,top:!1===i.top?0:a.top-i.top,bottom:!1===i.bottom?this.height:a.bottom+i.bottom}),t.controller.draw(),s&&fe(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}getElementsAtEventForMode(t,e,i,s){const a=Xe.modes[e];return"function"==typeof a?a(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(t=>t&&t._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=w(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){var e=this.data.datasets[t];if(!e)return!1;t=this.getDatasetMeta(t);return"boolean"==typeof t.hidden?!t.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(e,t,i){const s=i?"show":"hide",a=this.getDatasetMeta(e),r=a.controller._resolveAnimations(void 0,s);g(t)?(a.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),r.update(a,{visible:i}),this.update(t=>t.datasetIndex===e?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),n.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");var{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),ce(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete oa[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const i=this._listeners,s=this.platform,e=(t,e)=>{s.addEventListener(this,t,e),i[t]=e},a=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};M(this.options.events,t=>e(t,a))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const i=this._responsiveListeners,s=this.platform,t=(t,e)=>{s.addEventListener(this,t,e),i[t]=e},e=(t,e)=>{i[t]&&(s.removeEventListener(this,t,e),delete i[t])},a=(t,e)=>{this.canvas&&this.resize(t,e)};let r;const n=()=>{e("attach",n),this.attached=!0,this.resize(),t("resize",a),t("detach",r)};r=()=>{this.attached=!1,e("resize",a),this._stop(),this._resize(0,0),t("attach",n)},(s.isAttached(this.canvas)?n:r)()}unbindEvents(){M(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},M(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){var s=i?"set":"remove";let a,r,n,o;for("dataset"===e&&(a=this.getDatasetMeta(t[0].datasetIndex)).controller["_"+s+"DatasetHoverStyle"](),n=0,o=t.length;n<o;++n){const l=(r=t[n])&&this.getDatasetMeta(r.datasetIndex).controller;l&&l[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){var e=this._active||[],t=t.map(({datasetIndex:t,index:e})=>{var i=this.getDatasetMeta(t);if(i)return{datasetIndex:t,element:i.data[e],index:e};throw new Error("No dataset found at index "+t)});kt(t,e)||(this._active=t,this._lastEvent=null,this._updateHoverStyles(t,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){var s=this.options.hover,a=(t,i)=>t.filter(e=>!i.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),r=a(e,t),i=i?t:a(t,e);r.length&&this.updateHoverStyle(r,s.mode,!1),i.length&&s.mode&&this.updateHoverStyle(i,s.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:ue(e,this.chartArea,this._minPadding)};var s=t=>(t.options.events||this.options.events).includes(e.native.type);if(!1!==this.notifyPlugins("beforeEvent",i,s))return t=this._handleEvent(e,t,i.inChartArea),i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(t||i.changed)&&this.render(),this}_handleEvent(t,e,i){var s,{_active:a=[],options:r}=this,n=this._getActiveElements(t,a,i,e),o=Ft(t),l=(s=t,h=this._lastEvent,l=o,i&&"mouseout"!==s.type?l?h:s:null),h=(i&&(this._lastEvent=null,c(r.onHover,[t,n,this],this),o&&c(r.onClick,[t,n,this],this)),!kt(n,a));return(h||e)&&(this._active=n,this._updateHoverStyles(n,a,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;i=this.options.hover;return this.getElementsAtEventForMode(t,i.mode,i,s)}}const ha=()=>M(s.instances,t=>t._plugins.invalidate());function ca(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}Object.defineProperties(s,{defaults:{enumerable:!0,value:R},instances:{enumerable:!0,value:oa},overrides:{enumerable:!0,value:Bt},registry:{enumerable:!0,value:k},version:{enumerable:!0,value:"3.7.1"},getChart:{enumerable:!0,value:la},register:{enumerable:!0,value:(...t)=>{k.add(...t),ha()}},unregister:{enumerable:!0,value:(...t)=>{k.remove(...t),ha()}}});class da{constructor(t){this.options=t||{}}formats(){return ca()}parse(t,e){return ca()}format(t,e){return ca()}add(t,e,i){return ca()}diff(t,e,i){return ca()}startOf(t,e,i){return ca()}endOf(t,e){return ca()}}da.override=function(t){Object.assign(da.prototype,t)};var ua={_date:da};function ga(t){const e=t.iScale;var i=function(s,t){if(!s._cache.$bar){const a=s.getMatchingVisibleMetas(t);let i=[];for(let t=0,e=a.length;t<e;t++)i=i.concat(a[t].controller.getAllParsedValues(s));s._cache.$bar=Se(i.sort((t,e)=>t-e))}return s._cache.$bar}(e,t.type);let s=e._length,a,r,n,o;var l=()=>{32767!==n&&-32768!==n&&(g(o)&&(s=Math.min(s,Math.abs(n-o)||s)),o=n)};for(a=0,r=i.length;a<r;++a)n=e.getPixelForValue(i[a]),l();for(o=void 0,a=0,r=e.ticks.length;a<r;++a)n=e.getPixelForTick(a),l();return s}function fa(i,s,a,r){if(I(i)){var n=i;var o=s;var l=a;var h=r;var c=l.parse(n[0],h),n=l.parse(n[1],h),h=Math.min(c,n),d=Math.max(c,n);let t=h,e=d;Math.abs(h)>Math.abs(d)&&(t=d,e=h),o[l.axis]=e,o._custom={barStart:t,barEnd:e,start:c,end:n,min:h,max:d}}else s[a.axis]=a.parse(i,r);return s}function pa(t,e,i,s){const a=t.iScale;var r=t.vScale,n=a.getLabels(),o=a===r;const l=[];let h,c,d,u;for(c=(h=i)+s;h<c;++h)u=e[h],(d={})[a.axis]=o||a.parse(n[h],h),l.push(fa(u,d,r,h));return l}function ma(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function va(t,e,i,s){let a=e.borderSkipped;const r={};var n,o,l,h;a&&({start:e,end:n,reverse:o,top:l,bottom:h}=function(t){let e,i,s,a,r;return s=t.horizontal?(e=t.base>t.x,i="left","right"):(e=t.base<t.y,i="bottom","top"),r=e?(a="end","start"):(a="start","end"),{start:i,end:s,reverse:e,top:a,bottom:r}}(t),"middle"===a&&i&&(t.enableBorderRadius=!0,a=(i._top||0)===s?l:(i._bottom||0)===s?h:(r[xa(h,e,n,o)]=!0,l)),r[xa(a,e,n,o)]=!0),t.borderSkipped=r}function xa(t,e,i,s){var a,r;return t=s?(s=i,ba(t=(a=t)===(r=e)?s:a===s?r:a,i,e)):ba(t,e,i)}function ba(t,e,i){return"start"===t?e:"end"===t?i:t}class _a extends e{parsePrimitiveData(t,e,i,s){return pa(t,e,i,s)}parseArrayData(t,e,i,s){return pa(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:a,vScale:r}=t;var{xAxisKey:t="x",yAxisKey:n="y"}=this._parsing,o="x"===a.axis?t:n,l="x"===r.axis?t:n;const h=[];let c,d,u,g;for(d=(c=i)+s;c<d;++c)g=e[c],(u={})[a.axis]=a.parse(Et(g,o),c),h.push(fa(Et(g,l),u,r,c));return h}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);s=i._custom;s&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const{iScale:e,vScale:i}=this._cachedMeta;var t=this.getParsed(t),s=t._custom,s=ma(s)?"["+s.start+", "+s.end+"]":""+i.getLabelForValue(t[i.axis]);return{label:""+e.getLabelForValue(t[e.axis]),value:s}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){var e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(e,i,s,a){var r="reset"===a;const{index:n,_cachedMeta:{vScale:o}}=this;var l=o.getBasePixel(),h=o.isHorizontal(),c=this._getRuler(),t=this.resolveDataElementOptions(i,a),d=this.getSharedOptions(t),u=this.includeOptions(a,d);this.updateSharedOptions(d,a,t);for(let t=i;t<i+s;t++){var g=this.getParsed(t),f=r||P(g[o.axis])?{base:l,head:l}:this._calculateBarValuePixels(t),p=this._calculateBarIndexPixels(t,c),m=(g._stacks||{})[o.axis];const v={horizontal:h,base:f.base,enableBorderRadius:!m||ma(g._custom)||n===m._top||n===m._bottom,x:h?f.head:p.center,y:h?p.center:f.head,height:h?p.size:Math.abs(f.size),width:h?Math.abs(f.size):p.size};u&&(v.options=d||this.resolveDataElementOptions(t,e[t].active?"active":a));g=v.options||e[t].options;va(v,g,m,n),[f,p,m]=[v,g["inflateAmount"],c.ratio],f.inflateAmount="auto"===p?1===m?.33:0:p,this.updateElement(e[t],t,v,a)}}_getStacks(t,e){const i=this._cachedMeta.iScale;var s=i.getMatchingVisibleMetas(this._type),a=i.options.stacked,r=s.length;const n=[];let o,l;for(o=0;o<r;++o)if((l=s[o]).controller.options.grouped){if(void 0!==e){var h=l.controller.getParsed(e)[l.controller._cachedMeta.vScale.axis];if(P(h)||isNaN(h))continue}if((!1===a||-1===n.indexOf(l.stack)||void 0===a&&void 0===l.stack)&&n.push(l.stack),l.index===t)break}return n.length||n.push(void 0),n}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i);t=void 0!==e?s.indexOf(e):-1;return-1===t?s.length-1:t}_getRuler(){var t=this.options,e=this._cachedMeta;const i=e.iScale,s=[];let a,r;for(a=0,r=e.data.length;a<r;++a)s.push(i.getPixelForValue(this.getParsed(a)[i.axis],a));var n=t.barThickness;return{min:n||ga(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:n?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i},options:{base:s,minBarLength:a}}=this;var r=s||0,n=this.getParsed(t),o=n._custom,l=ma(o);let h=n[e.axis],c=0,d=i?this.applyStack(e,n,i):h,u,g;d!==h&&(c=d-h,d=h),l&&(h=o.barStart,d=o.barEnd-o.barStart,0!==h&&S(h)!==S(o.barEnd)&&(c=0),c+=h);var n=P(s)||l?c:s;let f=e.getPixelForValue(n);return u=this.chart.getDataVisibility(t)?e.getPixelForValue(c+d):f,g=u-f,Math.abs(g)<a&&(g=(o=g,l=e,n=r,(0!==o?S(o):(l.isHorizontal()?1:-1)*(l.min>=n?1:-1))*a),h===r&&(f-=g/2),u=f+g),f===e.getPixelForValue(r)&&(t=S(g)*e.getLineWidthForValue(r)/2,f+=t,g-=t),{size:g,base:f,head:u,center:u+g/2}}_calculateBarIndexPixels(t,e){const i=e.scale;var s,a=this.options,r=a.skipNull,n=B(a.maxBarThickness,1/0);let o,l;return l=e.grouped?(s=r?this._getStackCount(t):e.stackCount,a=("flex"===a.barThickness?function(t,e,i,s){var a=e.pixels,r=a[t];let n=0<t?a[t-1]:null,o=t<a.length-1?a[t+1]:null;return a=i.categoryPercentage,null===n&&(n=r-(null===o?e.end-e.start:o-r)),null===o&&(o=r+r-n),t=r-(r-Math.min(n,o))/2*a,{chunk:Math.abs(o-n)/2*a/s,ratio:i.barPercentage,start:t}}:function(t,e,i,s){var a=i.barThickness;let r,n;return n=P(a)?(r=e.min*i.categoryPercentage,i.barPercentage):(r=a*s,1),{chunk:r/s,ratio:n,start:e.pixels[t]-r/2}})(t,e,a,s),s=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0),o=a.start+a.chunk*s+a.chunk/2,Math.min(n,a.chunk*a.ratio)):(o=i.getPixelForValue(this.getParsed(t)[i.axis],t),Math.min(n,e.min*e.ratio)),{base:o-l/2,head:o+l/2,center:o,size:l}}draw(){var t=this._cachedMeta,e=t.vScale;const i=t.data;var s=i.length;let a=0;for(;a<s;++a)null!==this.getParsed(a)[e.axis]&&i[a].draw(this._ctx)}}_a.id="bar",_a.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},_a.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class ya extends e{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const a=super.parsePrimitiveData(t,e,i,s);for(let t=0;t<a.length;t++)a[t]._custom=this.resolveDataElementOptions(t+i).radius;return a}parseArrayData(t,e,i,s){const a=super.parseArrayData(t,e,i,s);for(let t=0;t<a.length;t++){var r=e[i+t];a[t]._custom=B(r[2],this.resolveDataElementOptions(t+i).radius)}return a}parseObjectData(t,e,i,s){const a=super.parseObjectData(t,e,i,s);for(let t=0;t<a.length;t++){var r=e[i+t];a[t]._custom=B(r&&r.r&&+r.r,this.resolveDataElementOptions(t+i).radius)}return a}getMaxOverflow(){const e=this._cachedMeta.data;let i=0;for(let t=e.length-1;0<=t;--t)i=Math.max(i,e[t].size(this.resolveDataElementOptions(t))/2);return 0<i&&i}getLabelAndValue(t){var e=this._cachedMeta;const{xScale:i,yScale:s}=e;var t=this.getParsed(t),a=i.getLabelForValue(t.x),r=s.getLabelForValue(t.y),t=t._custom;return{label:e.label,value:"("+a+", "+r+(t?", "+t:"")+")"}}update(t){var e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(e,i,s,a){var r="reset"===a;const{iScale:n,vScale:o}=this._cachedMeta;var t=this.resolveDataElementOptions(i,a),l=this.getSharedOptions(t),h=this.includeOptions(a,l),c=n.axis,d=o.axis;for(let t=i;t<i+s;t++){var u=e[t],g=!r&&this.getParsed(t);const p={};var f=p[c]=r?n.getPixelForDecimal(.5):n.getPixelForValue(g[c]),g=p[d]=r?o.getBasePixel():o.getPixelForValue(g[d]);p.skip=isNaN(f)||isNaN(g),h&&(p.options=this.resolveDataElementOptions(t,u.active?"active":a),r&&(p.options.radius=0)),this.updateElement(u,t,p,a)}this.updateSharedOptions(l,a,t)}resolveDataElementOptions(t,e){var i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);t=(s=s.$shared?Object.assign({},s,{$shared:!1}):s).radius;return"active"!==e&&(s.radius=0),s.radius+=B(i&&i._custom,t),s}}ya.id="bubble",ya.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},ya.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};class wa extends e{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(s,a){const r=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=r;else{let t=t=>+r[t];if(F(r[s])){const{key:o="value"}=this._parsing;t=t=>+Et(r[t],o)}let e,i;for(i=(e=s)+a;e<i;++e)n._parsed[e]=t(e)}}_getRotation(){return z(this.options.rotation-90)}_getCircumference(){return z(this.options.circumference)}_getRotationExtents(){let e=m,i=-m;for(let t=0;t<this.chart.data.datasets.length;++t)if(this.chart.isDatasetVisible(t)){const r=this.chart.getDatasetMeta(t).controller;var s=r._getRotation(),a=r._getCircumference();e=Math.min(e,s),i=Math.max(i,s+a)}return{rotation:e,circumference:i-e}}update(t){var e=this.chart["chartArea"];const i=this._cachedMeta;var s=i.data,a=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,r=Math.max((Math.min(e.width,e.height)-a)/2,0),r=Math.min(wt(this.options.cutout,r),1),n=this._getRingWeight(this.index),{circumference:o,rotation:l}=this._getRotationExtents(),{ratioX:l,ratioY:o,offsetX:h,offsetY:c}=function(t,e,s){let i=1,a=1,r=0,n=0;if(e<m){const u=t,g=u+e;var t=Math.cos(u),e=Math.sin(u),o=Math.cos(g),l=Math.sin(g),h=(t,e,i)=>ae(t,u,g,!0)?1:Math.max(e,e*s,i,i*s),c=(t,e,i)=>ae(t,u,g,!0)?-1:Math.min(e,e*s,i,i*s),d=h(0,t,o),h=h(y,e,l),t=c(_,t,o),o=c(_+y,e,l);i=(d-t)/2,a=(h-o)/2,r=-(d+t)/2,n=-(h+o)/2}return{ratioX:i,ratioY:a,offsetX:r,offsetY:n}}(l,o,r),l=(e.width-a)/l,e=(e.height-a)/o,a=Math.max(Math.min(l,e)/2,0),o=Mt(this.options.radius,a),l=(o-Math.max(o*r,0))/this._getVisibleDatasetWeightTotal();this.offsetX=h*o,this.offsetY=c*o,i.total=this.calculateTotal(),this.outerRadius=o-l*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-l*n,0),this.updateElements(s,0,s.length,t)}_circumference(t,e){var i=this.options,s=this._cachedMeta,a=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===s._parsed[t]||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*a/m)}updateElements(t,e,i,s){var a="reset"===s,r=this.chart,n=r.chartArea,r=r.options.animation,o=(n.left+n.right)/2,l=(n.top+n.bottom)/2,n=a&&r.animateScale,h=n?0:this.innerRadius,c=n?0:this.outerRadius,r=this.resolveDataElementOptions(e,s),d=this.getSharedOptions(r),u=this.includeOptions(s,d);let g=this._getRotation(),f;for(f=0;f<e;++f)g+=this._circumference(f,a);for(f=e;f<e+i;++f){var p=this._circumference(f,a),m=t[f];const v={x:o+this.offsetX,y:l+this.offsetY,startAngle:g,endAngle:g+p,circumference:p,outerRadius:c,innerRadius:h};u&&(v.options=d||this.resolveDataElementOptions(f,m.active?"active":s)),g+=p,this.updateElement(m,f,v,s)}this.updateSharedOptions(d,s,r)}calculateTotal(){var t=this._cachedMeta,e=t.data;let i=0,s;for(s=0;s<e.length;s++){var a=t._parsed[s];null===a||isNaN(a)||!this.chart.getDataVisibility(s)||e[s].hidden||(i+=Math.abs(a))}return i}calculateCircumference(t){var e=this._cachedMeta.total;return 0<e&&!isNaN(t)?m*(Math.abs(t)/e):0}getLabelAndValue(t){var e=this._cachedMeta,i=this.chart,s=i.data.labels||[],e=Ni(e._parsed[t],i.options.locale);return{label:s[t]||"",value:e}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,a,r,n,o;if(!t)for(s=0,a=i.data.datasets.length;s<a;++s)if(i.isDatasetVisible(s)){t=(r=i.getDatasetMeta(s)).data,n=r.controller;break}if(!t)return 0;for(s=0,a=t.length;s<a;++s)"inner"!==(o=n.resolveDataElementOptions(s)).borderAlign&&(e=Math.max(e,o.borderWidth||0,o.hoverBorderWidth||0));return e}getMaxOffset(i){let s=0;for(let t=0,e=i.length;t<e;++t){var a=this.resolveDataElementOptions(t);s=Math.max(s,a.offset||0,a.hoverOffset||0)}return s}_getRingWeightOffset(e){let i=0;for(let t=0;t<e;++t)this.chart.isDatasetVisible(t)&&(i+=this._getRingWeight(t));return i}_getRingWeight(t){return Math.max(B(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}wa.id="doughnut",wa.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"},wa.descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t},wa.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(a){const t=a.data;if(t.labels.length&&t.datasets.length){const{pointStyle:r}=a.legend.options["labels"];return t.labels.map((t,e)=>{const i=a.getDatasetMeta(0);var s=i.controller.getStyle(e);return{text:t,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,lineWidth:s.borderWidth,pointStyle:r,hidden:!a.getDataVisibility(e),index:e}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title(){return""},label(t){let e=t.label;t=": "+t.formattedValue;return I(e)?(e=e.slice())[0]+=t:e+=t,e}}}}};class Ma extends e{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){var e=this._cachedMeta;const{dataset:i,data:s=[],_dataset:a}=e;var r=this.chart._animationsDisabled;let{start:n,count:o}=function(t,e,i){var s=e.length;let a=0,r=s;if(t._sorted){const{iScale:c,_parsed:d}=t;var t=c.axis,{min:n,max:o,minDefined:l,maxDefined:h}=c.getUserBounds();l&&(a=f(Math.min(b(d,c.axis,n).lo,i?s:b(e,t,c.getPixelForValue(n)).lo),0,s-1)),r=h?f(Math.max(b(d,c.axis,o).hi+1,i?0:b(e,t,c.getPixelForValue(o)).hi+1),a,s)-a:s-a}return{start:a,count:r}}(e,s,r);this._drawStart=n,this._drawCount=o,function(t){var{xScale:e,yScale:i,_scaleRanges:s}=t,a={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!s)return t._scaleRanges=a,1;t=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==i.min||s.ymax!==i.max;return Object.assign(s,a),t}(e)&&(n=0,o=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=s;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:l},t),this.updateElements(s,n,o,t)}updateElements(e,i,s,a){var r="reset"===a;const{iScale:n,vScale:o,_stacked:l,_dataset:h}=this._cachedMeta;var t=this.resolveDataElementOptions(i,a),c=this.getSharedOptions(t),d=this.includeOptions(a,c),u=n.axis,g=o.axis,{spanGaps:f,segment:p}=this.options,m=Kt(f)?f:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||r||"none"===a;let x=0<i&&this.getParsed(i-1);for(let t=i;t<i+s;++t){var b=e[t],_=this.getParsed(t);const k=v?b:{};var y=P(_[g]),w=k[u]=n.getPixelForValue(_[u],t),M=k[g]=r||y?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,_,l):_[g],t);k.skip=isNaN(w)||isNaN(M)||y,k.stop=0<t&&_[u]-x[u]>m,p&&(k.parsed=_,k.raw=h.data[t]),d&&(k.options=c||this.resolveDataElementOptions(t,b.active?"active":a)),v||this.updateElement(b,t,k,a),x=_}this.updateSharedOptions(c,a,t)}getMaxOverflow(){var t=this._cachedMeta,e=t.dataset,e=e.options&&e.options.borderWidth||0;const i=t.data||[];if(!i.length)return e;var t=i[0].size(this.resolveDataElementOptions(0)),s=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(e,t,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Ma.id="line",Ma.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},Ma.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class ka extends e{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){var e=this._cachedMeta,i=this.chart,s=i.data.labels||[],e=Ni(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:e}}update(t){var e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this.chart;var e=t.chartArea,i=t.options,e=Math.min(e.right-e.left,e.bottom-e.top),e=Math.max(e/2,0),i=(e-Math.max(i.cutoutPercentage?e/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=e-i*this.index,this.innerRadius=this.outerRadius-i}updateElements(s,t,e,a){var r="reset"===a;const n=this.chart;var o=this.getDataset(),l=n.options.animation;const h=this._cachedMeta.rScale;var c=h.xCenter,d=h.yCenter,u=h.getIndexAngle(0)-.5*_;let g=u,f;var p=360/this.countVisibleElements();for(f=0;f<t;++f)g+=this._computeAngle(f,a,p);for(f=t;f<t+e;f++){var m=s[f];let t=g,e=g+this._computeAngle(f,a,p),i=n.getDataVisibility(f)?h.getDistanceFromCenterForValue(o.data[f]):0;g=e,r&&(l.animateScale&&(i=0),l.animateRotate&&(t=e=u));var v={x:c,y:d,innerRadius:0,outerRadius:i,startAngle:t,endAngle:e,options:this.resolveDataElementOptions(f,m.active?"active":a)};this.updateElement(m,f,v,a)}}countVisibleElements(){const i=this.getDataset(),t=this._cachedMeta;let s=0;return t.data.forEach((t,e)=>{!isNaN(i.data[e])&&this.chart.getDataVisibility(e)&&s++}),s}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?z(this.resolveDataElementOptions(t,e).angle||i):0}}ka.id="polarArea",ka.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},ka.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(a){const t=a.data;if(t.labels.length&&t.datasets.length){const{pointStyle:r}=a.legend.options["labels"];return t.labels.map((t,e)=>{const i=a.getDatasetMeta(0);var s=i.controller.getStyle(e);return{text:t,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,lineWidth:s.borderWidth,pointStyle:r,hidden:!a.getDataVisibility(e),index:e}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title(){return""},label(t){return t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Sa extends wa{}Sa.id="pie",Sa.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Pa extends e{getLabelAndValue(t){const e=this._cachedMeta.vScale;var i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}update(t){const e=this._cachedMeta,i=e.dataset;var s=e.data||[],a=e.iScale.getLabels();if(i.points=s,"resize"!==t){const r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);a={_loop:!0,_fullLoop:a.length===s.length,options:r};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(e,i,s,a){var r=this.getDataset();const n=this._cachedMeta.rScale;var o="reset"===a;for(let t=i;t<i+s;t++){var l=e[t],h=this.resolveDataElementOptions(t,l.active?"active":a),c=n.getPointPositionForValue(t,r.data[t]),d=o?n.xCenter:c.x,u=o?n.yCenter:c.y,c={x:d,y:u,angle:c.angle,skip:isNaN(d)||isNaN(u),options:h};this.updateElement(l,t,c,a)}}}Pa.id="radar",Pa.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},Pa.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class Da extends Ma{}Da.id="scatter",Da.defaults={showLine:!1,fill:!1},Da.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(t){return"("+t.label+", "+t.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var Ca=Object.freeze({__proto__:null,BarController:_a,BubbleController:ya,DoughnutController:wa,LineController:Ma,PolarAreaController:ka,PieController:Sa,RadarController:Pa,ScatterController:Da});function Oa(t,e,i){var{startAngle:e,pixelMargin:s,x:a,y:r,outerRadius:n,innerRadius:o}=e,l=s/n;t.beginPath(),t.arc(a,r,n,e-l,i+l),s<o?t.arc(a,r,o,i+(l=s/o),e-l,!0):t.arc(a,r,s,i+y,e-y),t.closePath(),t.clip()}function Aa(t,e,i,s){t=Je(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const a=(i-e)/2;var e=Math.min(a,s*e/2),r=t=>{var e=(i-Math.min(a,t))*s/2;return f(t,0,Math.min(a,e))};return{outerStart:r(t.outerStart),outerEnd:r(t.outerEnd),innerStart:f(t.innerStart,0,e),innerEnd:f(t.innerEnd,0,e)}}function Ta(t,e,i,s){return{x:i+t*Math.cos(e),y:s+t*Math.sin(e)}}function La(t,e,i,s,a){var{x:r,y:n,startAngle:o,pixelMargin:l,innerRadius:h}=e,c=Math.max(e.outerRadius+s+i-l,0),l=0<h?h+s+i+l:0;let d=0;var u=a-o,h=(s&&(h=((0<h?h-s:0)+(0<c?c-s:0))/2,d=(u-(0!=h?u*h/(h+s):u))/2),Math.max(.001,u*c-i/_)/c),s=(u-h)/2,i=o+s+d,u=a-s-d,{outerStart:h,outerEnd:o,innerStart:a,innerEnd:s}=Aa(e,l,c,u-i),e=c-h,g=c-o,f=i+h/e,p=u-o/g,m=l+a,v=l+s,x=i+a/m,b=u-s/v,g=(t.beginPath(),t.arc(r,n,c,f,p),0<o&&(c=Ta(g,p,r,n),t.arc(c.x,c.y,o,p,u+y)),Ta(v,u,r,n)),p=(t.lineTo(g.x,g.y),0<s&&(c=Ta(v,b,r,n),t.arc(c.x,c.y,s,u+y,b+Math.PI)),t.arc(r,n,l,u-s/l,i+a/l,!0),0<a&&(o=Ta(m,x,r,n),t.arc(o.x,o.y,a,x+Math.PI,i-y)),Ta(e,i,r,n));t.lineTo(p.x,p.y),0<h&&(g=Ta(e,f,r,n),t.arc(g.x,g.y,h,i-y,f)),t.closePath()}function Ra(e,i,t,s,a){var r=i["options"],{borderWidth:n,borderJoinStyle:o}=r,r="inner"===r.borderAlign;if(n){if(r?(e.lineWidth=2*n,e.lineJoin=o||"round"):(e.lineWidth=n,e.lineJoin=o||"bevel"),i.fullCircles){var l=e;n=i;o=r;var{x:h,y:c,startAngle:d,pixelMargin:u,fullCircles:g}=n,f=Math.max(n.outerRadius-u,0),u=n.innerRadius+u;let t;for(o&&Oa(l,n,d+m),l.beginPath(),l.arc(h,c,u,d+m,d,!0),t=0;t<g;++t)l.stroke();for(l.beginPath(),l.arc(h,c,f,d,d+m),t=0;t<g;++t)l.stroke()}r&&Oa(e,i,a),La(e,i,t,s,a),e.stroke()}}class Ea extends i{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){var{angle:t,distance:e}=ee(this.getProps(["x","y"],i),{x:t,y:e}),{startAngle:i,endAngle:s,innerRadius:a,outerRadius:r,circumference:n}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),o=this.options.spacing/2,n=B(n,s-i)>=m||ae(t,i,s),t=v(e,a+o,r+o);return n&&t}getCenterPoint(t){var{x:t,y:e,startAngle:i,endAngle:s,innerRadius:a,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:n,spacing:o}=this.options,i=(i+s)/2,s=(a+r+o+n)/2;return{x:t+Math.cos(i)*s,y:e+Math.sin(i)*s}}tooltipPosition(t){return this.getCenterPoint(t)}draw(e){var{options:i,circumference:s}=this,a=(i.offset||0)/2,r=(i.spacing||0)/2;if(this.pixelMargin="inner"===i.borderAlign?.33:0,this.fullCircles=s>m?Math.floor(s/m):0,!(0===s||this.innerRadius<0||this.outerRadius<0)){e.save();let t=0;a&&(t=a/2,s=(this.startAngle+this.endAngle)/2,e.translate(Math.cos(s)*t,Math.sin(s)*t),this.circumference>=_&&(t=a)),e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor;s=function(e,t,i,s){var{fullCircles:a,startAngle:r,circumference:n}=t;let o=t.endAngle;if(a){La(e,t,i,s,r+m);for(let t=0;t<a;++t)e.fill();isNaN(n)||(o=r+n%m,n%m==0&&(o+=m))}return La(e,t,i,s,o),e.fill(),o}(e,this,t,r);Ra(e,this,t,r,s),e.restore()}}}function Ia(t,e,i=e){t.lineCap=B(i.borderCapStyle,e.borderCapStyle),t.setLineDash(B(i.borderDash,e.borderDash)),t.lineDashOffset=B(i.borderDashOffset,e.borderDashOffset),t.lineJoin=B(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=B(i.borderWidth,e.borderWidth),t.strokeStyle=B(i.borderColor,e.borderColor)}function za(t,e,i){t.lineTo(i.x,i.y)}function Fa(t,e,i={}){var t=t.length,{start:i=0,end:s=t-1}=i,{start:a,end:r}=e,n=Math.max(i,a),o=Math.min(s,r);return{count:t,start:n,loop:e.loop,ilen:o<n&&!(i<a&&s<a||r<i&&r<s)?t+o-n:o-n}}function Ba(t,e,i,s){var{points:a,options:r}=e,{count:n,start:o,loop:e,ilen:l}=Fa(a,i,s);const h=(i=r).stepped?pe:i.tension||"monotone"===i.cubicInterpolationMode?me:za;let{move:c=!0,reverse:d}=s||{},u,g,f;for(u=0;u<=l;++u)(g=a[(o+(d?l-u:u))%n]).skip||(c?(t.moveTo(g.x,g.y),c=!1):h(t,f,g,d,r.stepped),f=g);return e&&(g=a[(o+(d?l:0))%n],h(t,f,g,d,r.stepped)),!!e}function Va(t,e,i,s){var a=e.points;const{count:r,start:n,ilen:o}=Fa(a,i,s),{move:l=!0,reverse:h}=s||{};let c=0,d=0,u,g,f,p,m,v;var x,b,_,y=t=>(n+(h?o-t:t))%r,w=()=>{p!==m&&(t.lineTo(c,m),t.lineTo(c,p),t.lineTo(c,v))};for(l&&(g=a[y(0)],t.moveTo(g.x,g.y)),u=0;u<=o;++u)(g=a[y(u)]).skip||(x=g.x,b=g.y,(_=0|x)===f?(b<p?p=b:b>m&&(m=b),c=(d*c+x)/++d):(w(),t.lineTo(x,b),f=_,d=0,p=m=b),v=b);w()}function Wa(t){var e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?Va:Ba}Ea.id="arc",Ea.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},Ea.defaultRoutes={backgroundColor:"backgroundColor"};const Na="function"==typeof Path2D;function Ha(e,i,s,a){if(!Na||i.options.segment){var t=e;var r=i;var n=s;var o=a;var{segments:l,options:h}=r;const c=Wa(r);for(const d of l)Ia(t,h,d.style),t.beginPath(),c(t,r,d,{start:n,end:n+o-1})&&t.closePath(),t.stroke()}else{l=e;e=i;i=s;s=a;let t=e._path;t||(t=e._path=new Path2D,e.path(t,i,s)&&t.closePath()),Ia(l,e.options),l.stroke(t)}}class ja extends i{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){var i,s=this.options;!s.tension&&"monotone"!==s.cubicInterpolationMode||s.stepped||this._pointsUpdated||(i=s.spanGaps?this._loop:this._fullLoop,Li(this._points,s,t,i,e),this._pointsUpdated=!0)}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Ki(this,this.options.segment))}first(){var t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){var t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(i,s){var a,r=this.options,n=i[s],o=this.points,l=qi(this,{property:s,start:n,end:n});if(l.length){const u=[],g=(a=r).stepped?Bi:a.tension||"monotone"===a.cubicInterpolationMode?Vi:Fi;let t,e;for(t=0,e=l.length;t<e;++t){var{start:h,end:c}=l[t],h=o[h],c=o[c];if(h===c)u.push(h);else{var d=Math.abs((n-h[s])/(c[s]-h[s]));const f=g(h,c,d,r.stepped);f[s]=i[s],u.push(f)}}return 1===u.length?u[0]:u}}pathSegment(t,e,i){const s=Wa(this);return s(t,this,e,i)}path(t,e,i){var s=this.segments;const a=Wa(this);let r=this._loop;e=e||0,i=i||this.points.length-e;for(const n of s)r&=a(t,this,n,{start:e,end:e+i-1});return!!r}draw(t,e,i,s){var a=this.options||{};(this.points||[]).length&&a.borderWidth&&(t.save(),Ha(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Ya(t,e,i,s){var a=t.options,{[i]:t}=t.getProps([i],s);return Math.abs(e-t)<a.radius+a.hitRadius}ja.id="line",ja.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},ja.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},ja.descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};class Ua extends i{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){var s=this.options,{x:i,y:a}=this.getProps(["x","y"],i);return Math.pow(t-i,2)+Math.pow(e-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return Ya(this,t,"x",e)}inYRange(t,e){return Ya(this,t,"y",e)}getCenterPoint(t){var{x:t,y:e}=this.getProps(["x","y"],t);return{x:t,y:e}}size(t){var e=(t=t||this.options||{}).radius||0;return 2*((e=Math.max(e,e&&t.hoverRadius||0))+(e&&t.borderWidth||0))}draw(t,e){var i=this.options;this.skip||i.radius<.1||!ue(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,de(t,i,this.x,this.y))}getRange(){var t=this.options||{};return t.radius+t.hitRadius}}function $a(t,e){var{x:e,y:i,base:s,width:a,height:r}=t.getProps(["x","y","base","width","height"],e);let n,o,l,h,c;return h=t.horizontal?(c=r/2,n=Math.min(e,s),o=Math.max(e,s),l=i-c,i+c):(c=a/2,n=e-c,o=e+c,l=Math.min(i,s),Math.max(i,s)),{left:n,top:l,right:o,bottom:h}}function Xa(t,e,i,s){return t?0:f(e,i,s)}function qa(t){var e,i,s,a,r,n=$a(t),o=n.right-n.left,l=n.bottom-n.top,h=(e=o/2,h=l/2,s=(i=t).options.borderWidth,i=i.borderSkipped,s=Qe(s),{t:Xa(i.top,s.top,0,h),r:Xa(i.right,s.right,0,e),b:Xa(i.bottom,s.bottom,0,h),l:Xa(i.left,s.left,0,e)}),t=(i=o/2,s=l/2,t=(e=t).getProps(["enableBorderRadius"]).enableBorderRadius,a=e.options.borderRadius,r=ti(a),i=Math.min(i,s),s=e.borderSkipped,{topLeft:Xa(!(e=t||F(a))||s.top||s.left,r.topLeft,0,i),topRight:Xa(!e||s.top||s.right,r.topRight,0,i),bottomLeft:Xa(!e||s.bottom||s.left,r.bottomLeft,0,i),bottomRight:Xa(!e||s.bottom||s.right,r.bottomRight,0,i)});return{outer:{x:n.left,y:n.top,w:o,h:l,radius:t},inner:{x:n.left+h.l,y:n.top+h.t,w:o-h.l-h.r,h:l-h.t-h.b,radius:{topLeft:Math.max(0,t.topLeft-Math.max(h.t,h.l)),topRight:Math.max(0,t.topRight-Math.max(h.t,h.r)),bottomLeft:Math.max(0,t.bottomLeft-Math.max(h.b,h.l)),bottomRight:Math.max(0,t.bottomRight-Math.max(h.b,h.r))}}}}function Ka(t,e,i,s){var a=null===e,r=null===i,t=t&&!(a&&r)&&$a(t,s);return t&&(a||v(e,t.left,t.right))&&(r||v(i,t.top,t.bottom))}function Ga(t,e){t.rect(e.x,e.y,e.w,e.h)}function Za(t,e,i={}){var s=t.x!==i.x?-e:0,a=t.y!==i.y?-e:0,r=(t.x+t.w!==i.x+i.w?e:0)-s,i=(t.y+t.h!==i.y+i.h?e:0)-a;return{x:t.x+s,y:t.y+a,w:t.w+r,h:t.h+i,radius:t.radius}}Ua.id="point",Ua.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},Ua.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class Ja extends i{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){var e,{inflateAmount:i,options:{borderColor:s,backgroundColor:a}}=this,{inner:r,outer:n}=qa(this);const o=(e=n.radius).topLeft||e.topRight||e.bottomLeft||e.bottomRight?xe:Ga;t.save(),n.w===r.w&&n.h===r.h||(t.beginPath(),o(t,Za(n,i,r)),t.clip(),o(t,Za(r,-i,n)),t.fillStyle=s,t.fill("evenodd")),t.beginPath(),o(t,Za(r,i)),t.fillStyle=a,t.fill(),t.restore()}inRange(t,e,i){return Ka(this,t,e,i)}inXRange(t,e){return Ka(this,t,null,e)}inYRange(t,e){return Ka(this,null,t,e)}getCenterPoint(t){var{x:t,y:e,base:i,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(t+i)/2:t,y:s?e:(e+i)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}Ja.id="bar",Ja.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},Ja.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var Qa=Object.freeze({__proto__:null,ArcElement:Ea,LineElement:ja,PointElement:Ua,BarElement:Ja});function tr(t){var e;t._decimated&&(e=t._data,delete t._decimated,delete t._data,Object.defineProperty(t,"data",{value:e}))}function er(t){t.data.datasets.forEach(t=>{tr(t)})}var ir={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(o,t,l)=>{if(l.enabled){const h=o.width;o.data.datasets.forEach((e,t)=>{var{_data:i,indexAxis:s}=e,t=o.getDatasetMeta(t),a=i||e.data;if("y"!==ei([s,o.options.indexAxis])&&"line"===t.type){s=o.scales[t.xAxisID];if(("linear"===s.type||"time"===s.type)&&!o.options.parsing){var{start:r,count:n}=function(t,e){var i=e.length;let s=0,a;const r=t["iScale"];var{min:t,max:n,minDefined:o,maxDefined:l}=r.getUserBounds();return o&&(s=f(b(e,r.axis,t).lo,0,i-1)),a=l?f(b(e,r.axis,n).hi+1,s,i)-s:i-s,{start:s,count:a}}(t,a);if(n<=(l.threshold||4*h))tr(e);else{P(i)&&(e._data=a,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}}));let t;switch(l.algorithm){case"lttb":t=function(s,a,r,t,e){var i=e.samples||t;if(r<=i)return s.slice(a,a+r);const n=[];var o=(r-2)/(i-2);let l=0,h=(e=a+r-1,a),c,d,u,g,f;for(n[l++]=s[h],c=0;c<i-2;c++){let t=0,e=0,i;var p=Math.floor((c+1)*o)+1+a,m=Math.min(Math.floor((c+2)*o)+1,r)+a,v=m-p;for(i=p;i<m;i++)t+=s[i].x,e+=s[i].y;t/=v,e/=v;var p=Math.floor(c*o)+1+a,x=Math.min(Math.floor((c+1)*o)+1,r)+a,{x:b,y:_}=s[h];for(u=-1,i=p;i<x;i++)(g=.5*Math.abs((b-t)*(s[i].y-_)-(b-s[i].x)*(e-_)))>u&&(u=g,d=s[i],f=i);n[l++]=d,h=f}return n[l++]=s[e],n}(a,r,n,h,l);break;case"min-max":t=function(t,e,i,s){let a=0,r=0,n,o,l,h,c,d,u,g,f,p;const m=[];var v=t[e].x,x=t[e+i-1].x-v;for(n=e;n<e+i;++n){l=((o=t[n]).x-v)/x*s,h=o.y;var b,_,y,w=0|l;w===c?(h<f?(f=h,d=n):h>p&&(p=h,u=n),a=(r*a+o.x)/++r):(b=n-1,P(d)||P(u)||(_=Math.min(d,u),y=Math.max(d,u),_!==g&&_!==b&&m.push({...t[_],x:a}),y!==g&&y!==b&&m.push({...t[y],x:a})),0<n&&b!==g&&m.push(t[b]),m.push(o),c=w,r=0,f=p=h,d=u=g=n)}return m}(a,r,n,h);break;default:throw new Error(`Unsupported decimation algorithm '${l.algorithm}'`)}e._decimated=t}}}})}else er(o)},destroy(t){er(t)}};function sr(t,e,i){t=function(t){var e=(t=t.options).fill;let i=B(e&&e.target,e);return!1!==(i=void 0===i?!!t.backgroundColor:i)&&null!==i&&(!0===i?"origin":i)}(t);if(F(t))return!isNaN(t.value)&&t;let s=parseFloat(t);return p(s)&&Math.floor(s)===s?!((s="-"!==t[0]&&"+"!==t[0]?s:e+s)===e||s<0||s>=i)&&s:0<=["origin","start","end","stack","shape"].indexOf(t)&&t}class ar{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){var{x:s,y:a,radius:r}=this;return e=e||{start:0,end:m},t.arc(s,a,r,e.end,e.start,!0),!i.bounds}interpolate(t){var{x:e,y:i,radius:s}=this,t=t.angle;return{x:e+Math.cos(t)*s,y:i+Math.sin(t)*s,angle:t}}}function rr(s){if((s.scale||{}).getPointPositionForValue){var a=s;const{scale:l,fill:h}=a;var a=l.options,r=l.getLabels().length;const c=[];var n=a.reverse?l.max:l.min,o=a.reverse?l.min:l.max;let t,e,i;if(i="start"===h?n:"end"===h?o:F(h)?h.value:l.getBaseValue(),a.grid.circular)return e=l.getPointPositionForValue(0,n),new ar({x:e.x,y:e.y,radius:l.getDistanceFromCenterForValue(i)});for(t=0;t<r;++t)c.push(l.getPointPositionForValue(t,i));return c}{o=s;const{scale:e={},fill:i}=o;let t=null;return"start"===i?t=e.bottom:"end"===i?t=e.top:F(i)?t=e.getPixelForValue(i.value):e.getBasePixel&&(t=e.getBasePixel()),p(t)?{x:(o=e.isHorizontal())?t:null,y:o?null:t}:null;return}}function nr(t,e,i){for(;t<e;e--){var s=i[e];if(!isNaN(s.x)&&!isNaN(s.y))break}return e}function or(t){var{scale:t,index:e,line:i}=t,s=[],a=i.segments,r=i.points;const n=function(t,e){const i=[],s=t.getMatchingVisibleMetas("line");for(let t=0;t<s.length;t++){var a=s[t];if(a.index===e)break;a.hidden||i.unshift(a.dataset)}return i}(t,e);n.push(lr({x:null,y:t.bottom},i));for(let t=0;t<a.length;t++){var o=a[t];for(let t=o.start;t<=o.end;t++){l=void 0;h=void 0;c=void 0;d=void 0;u=void 0;g=void 0;var l=s;var h=r[t];var c=n;const f=[];for(let t=0;t<c.length;t++){var{first:d,last:u,point:g}=function(t,e,i){e=t.interpolate(e,i);if(!e)return{};var s=e[i],a=t.segments,r=t.points;let n=!1,o=!1;for(let t=0;t<a.length;t++){var l=a[t],h=r[l.start][i],l=r[l.end][i];if(v(s,h,l)){n=s===h,o=s===l;break}}return{first:n,last:o,point:e}}(c[t],h,"x");if(!(!g||d&&u))if(d)f.unshift(g);else if(l.push(g),!u)break}l.push(...f)}}return new ja({points:s,options:{}})}function lr(t,e){let i=[],s=!1;return(i=I(t)?(s=!0,t):function(t,e){const{x:i=null,y:s=null}=t||{},a=e.points,r=[];return e.segments.forEach(({start:t,end:e})=>{e=nr(t,e,a);t=a[t],e=a[e];null!==s?(r.push({x:t.x,y:s}),r.push({x:e.x,y:s})):null!==i&&(r.push({x:i,y:t.y}),r.push({x:i,y:e.y}))}),r}(t,e)).length?new ja({points:i,options:{tension:0},_loop:s,_fullLoop:s}):null}function hr(t,e,i){var{segments:s,points:a}=e;let r=!0,n=!1;t.beginPath();for(const c of s){var{start:o,end:l}=c,h=a[o],o=a[nr(o,l,a)];r?(t.moveTo(h.x,h.y),r=!1):(t.lineTo(h.x,i),t.lineTo(h.x,h.y)),(n=!!e.pathSegment(t,c,{move:n}))?t.closePath():t.lineTo(o.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function cr(i,s,a,t){if(!t){let t=s[i],e=a[i];return"angle"===i&&(t=x(t),e=x(e)),{property:i,start:t,end:e}}}function dr(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}function ur(t,e,i,s){e=e.interpolate(i,s);e&&t.lineTo(e.x,e.y)}function gr(e,t){const{line:i,target:s,property:a,color:r,scale:n}=t;var o,l,h,c;for({source:o,target:l,start:h,end:c}of function(t,e,i){var s=t.segments,a=t.points,r=e.points;const n=[];for(const d of s){var{start:o,end:l}=d,l=nr(o,l,a),h=cr(i,a[o],a[l],d.loop);if(e.segments)for(const u of qi(e,h)){var c=cr(i,r[u.start],r[u.end],u.loop);for(const g of Xi(d,a,c))n.push({source:g,target:u,start:{[i]:dr(h,c,"start",Math.max)},end:{[i]:dr(h,c,"end",Math.min)}})}else n.push({source:d,target:h,start:a[o],end:a[l]})}return n}(i,s,a)){var{style:{backgroundColor:d=r}={}}=o,u=!0!==s,d=(e.save(),e.fillStyle=d,v=m=f=p=g=f=g=d=void 0,e),g=n,f=u&&cr(a,h,c),{top:g,bottom:p}=g.chart.chartArea,{property:f,start:m,end:v}=f||{},f=("x"===f&&(d.beginPath(),d.rect(m,g,v-m,p-g),d.clip()),e.beginPath(),!!i.pathSegment(e,o));let t;u&&(f?e.closePath():ur(e,s,c,a),v=!!s.pathSegment(e,l,{move:f,reverse:!0}),(t=f&&v)||ur(e,s,h,a)),e.closePath(),e.fill(t?"evenodd":"nonzero"),e.restore()}}function fr(t,e,i){var s,a=function(t){var e,i,{chart:s,fill:a,line:r}=t;return p(a)?(e=a,(i=(s=s).getDatasetMeta(e))&&s.isDatasetVisible(e)?i.dataset:null):"stack"===a?or(t):"shape"===a||((s=rr(t))instanceof ar?s:lr(s,r))}(e),{line:e,scale:r,axis:n}=e,o=e.options,l=o.fill,o=o.backgroundColor,{above:l=o,below:o=o}=l||{};a&&e.points.length&&(ge(t,i),s=t,{line:a,target:l,above:o,below:i,area:r,scale:n}=e={line:e,target:a,above:l,below:o,area:i,scale:r,axis:n},e=a._loop?"angle":e.axis,s.save(),"x"===e&&i!==o&&(hr(s,l,r.top),gr(s,{line:a,target:l,color:o,scale:n,property:e}),s.restore(),s.save(),hr(s,l,r.bottom)),gr(s,{line:a,target:l,color:i,scale:n,property:e}),s.restore(),fe(t))}var pr={id:"filler",afterDatasetsUpdate(t,e,i){var s=(t.data.datasets||[]).length;const a=[];let r,n,o,l;for(n=0;n<s;++n)o=(r=t.getDatasetMeta(n)).dataset,l=null,o&&o.options&&o instanceof ja&&(l={visible:t.isDatasetVisible(n),index:n,fill:sr(o,n,s),chart:t,axis:r.controller.options.indexAxis,scale:r.vScale,line:o}),r.$filler=l,a.push(l);for(n=0;n<s;++n)(l=a[n])&&!1!==l.fill&&(l.fill=function(t,e,i){var s;let a=t[e].fill;const r=[e];if(!i)return a;for(;!1!==a&&-1===r.indexOf(a);){if(!p(a))return a;if(!(s=t[a]))return!1;if(s.visible)return a;r.push(a),a=s.fill}return!1}(a,n,i.propagate))},beforeDraw(e,t,i){var s="beforeDraw"===i.drawTime,a=e.getSortedVisibleDatasetMetas(),r=e.chartArea;for(let t=a.length-1;0<=t;--t){const n=a[t].$filler;n&&(n.line.updateControlPoints(r,n.axis),s&&fr(e.ctx,n,r))}},beforeDatasetsDraw(e,t,i){if("beforeDatasetsDraw"===i.drawTime){var s=e.getSortedVisibleDatasetMetas();for(let t=s.length-1;0<=t;--t){var a=s[t].$filler;a&&fr(e.ctx,a,e.chartArea)}}},beforeDatasetDraw(t,e,i){e=e.meta.$filler;e&&!1!==e.fill&&"beforeDatasetDraw"===i.drawTime&&fr(t.ctx,e,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const mr=(t,e)=>{let{boxHeight:i=e,boxWidth:s=e}=t;return t.usePointStyle&&(i=Math.min(i,e),s=Math.min(s,e)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(e,i)}};class vr extends i{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const i=this.options.labels||{};let t=c(i.generateLabels,[this.chart],this)||[];i.filter&&(t=t.filter(t=>i.filter(t,this.chart.data))),i.sort&&(t=t.sort((t,e)=>i.sort(t,e,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){const{options:i,ctx:s}=this;if(i.display){var a=i.labels,r=E(a.font),n=r.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=mr(a,n);let t,e;s.font=r.string,this.isHorizontal()?(t=this.maxWidth,e=this._fitRows(o,n,a,l)+10):(e=this.maxHeight,t=this._fitCols(o,n,a,l)+10),this.width=Math.min(t,i.maxWidth||this.maxWidth),this.height=Math.min(e,i.maxHeight||this.maxHeight)}else this.width=this.height=0}_fitRows(t,i,s,a){const{ctx:r,maxWidth:n,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],h=this.lineWidths=[0],c=a+o;let d=t,u=(r.textAlign="left",r.textBaseline="middle",-1),g=-c;return this.legendItems.forEach((t,e)=>{t=s+i/2+r.measureText(t.text).width;(0===e||h[h.length-1]+t+2*o>n)&&(d+=c,h[h.length-(0<e?0:1)]=0,g+=c,u++),l[e]={left:0,top:g,row:u,width:t,height:a},h[h.length-1]+=t+o}),d}_fitCols(t,i,s,a){const{ctx:r,maxHeight:e,options:{labels:{padding:n}}}=this,o=this.legendHitBoxes=[],l=this.columnSizes=[],h=e-t;let c=n,d=0,u=0,g=0,f=0;return this.legendItems.forEach((t,e)=>{t=s+i/2+r.measureText(t.text).width;0<e&&u+a+2*n>h&&(c+=d+n,l.push({width:d,height:u}),g+=d+n,f++,d=u=0),o[e]={left:g,top:u,col:f,width:t,height:a},d=Math.max(d,t),u+=a+n}),c+=d,l.push({width:d,height:u}),c}adjustHitBoxes(){if(this.options.display){var i=this._computeTitleHeight(),{legendHitBoxes:s,options:{align:a,labels:{padding:r},rtl:t}}=this;const n=Hi(t,this.left,this.width);if(this.isHorizontal()){let t=0,e=L(a,this.left+r,this.right-this.lineWidths[t]);for(const o of s)t!==o.row&&(t=o.row,e=L(a,this.left+r,this.right-this.lineWidths[t])),o.top+=this.top+i+r,o.left=n.leftForLtr(n.x(e),o.width),e+=o.width+r}else{let t=0,e=L(a,this.top+i+r,this.bottom-this.columnSizes[t].height);for(const l of s)l.col!==t&&(t=l.col,e=L(a,this.top+i+r,this.bottom-this.columnSizes[t].height)),l.top=e,l.left+=this.left+r,l.left=n.leftForLtr(n.x(l.left),l.width),e+=l.height+r}}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){var t;this.options.display&&(ge(t=this.ctx,this),this._draw(),fe(t))}_draw(){const{options:u,columnSizes:g,lineWidths:f,ctx:p}=this,{align:m,labels:v}=u,x=R.color,b=Hi(u.rtl,this.left,this.width),_=E(v.font),{color:y,padding:w}=v,M=_.size,k=M/2;let S;this.drawTitle(),p.textAlign=b.textAlign("left"),p.textBaseline="middle",p.lineWidth=.5,p.font=_.string;const{boxWidth:P,boxHeight:D,itemHeight:C}=mr(v,M),O=this.isHorizontal(),A=this._computeTitleHeight(),T=(S=O?{x:L(m,this.left+w,this.right-f[0]),y:this.top+w+A,line:0}:{x:this.left+w,y:L(m,this.top+A+w,this.bottom-g[0].height),line:0},ji(this.ctx,u.textDirection),C+w);this.legendItems.forEach((t,e)=>{p.strokeStyle=t.fontColor||y,p.fillStyle=t.fontColor||y;var i=p.measureText(t.text).width,s=b.textAlign(t.textAlign||(t.textAlign=v.textAlign)),i=P+k+i;let a=S.x,r=S.y;b.setWidth(this.width),O?0<e&&a+i+w>this.right&&(r=S.y+=T,S.line++,a=S.x=L(m,this.left+w,this.right-f[S.line])):0<e&&r+T>this.bottom&&(a=S.x=a+g[S.line].width+w,S.line++,r=S.y=L(m,this.top+A+w,this.bottom-g[S.line].height));var n,o,l,h,c,d,e=b.x(a);e=e,c=r,d=t,isNaN(P)||P<=0||isNaN(D)||D<0||(p.save(),n=B(d.lineWidth,1),p.fillStyle=B(d.fillStyle,x),p.lineCap=B(d.lineCap,"butt"),p.lineDashOffset=B(d.lineDashOffset,0),p.lineJoin=B(d.lineJoin,"miter"),p.lineWidth=n,p.strokeStyle=B(d.strokeStyle,x),p.setLineDash(B(d.lineDash,[])),v.usePointStyle?(o={radius:P*Math.SQRT2/2,pointStyle:d.pointStyle,rotation:d.rotation,borderWidth:n},l=b.xPlus(e,P/2),h=c+k,de(p,o,l,h)):(o=c+Math.max((M-D)/2,0),l=b.leftForLtr(e,P),h=ti(d.borderRadius),p.beginPath(),Object.values(h).some(t=>0!==t)?xe(p,{x:l,y:o,w:P,h:D,radius:h}):p.rect(l,o,P,D),p.fill(),0!==n&&p.stroke()),p.restore()),a=W(s,a+P+k,O?a+i:this.right,u.rtl),c=b.x(a),e=r,d=t,ve(p,d.text,c,e+C/2,_,{strikethrough:d.hidden,textAlign:b.textAlign(d.textAlign)}),O?S.x+=i+w:S.y+=T}),Yi(this.ctx,u.textDirection)}drawTitle(){var s=this.options,a=s.title,r=E(a.font),n=V(a.padding);if(a.display){const h=Hi(s.rtl,this.left,this.width),c=this.ctx;var o=a.position,l=r.size/2,n=n.top+l;let t,e=this.left,i=this.width;this.isHorizontal()?(i=Math.max(...this.lineWidths),t=this.top+n,e=L(s.align,e,this.right-i)):(l=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0),t=n+L(s.align,this.top,this.bottom-l-s.labels.padding-this._computeTitleHeight()));n=L(o,e,e+i);c.textAlign=h.textAlign(T(o)),c.textBaseline="middle",c.strokeStyle=a.color,c.fillStyle=a.color,c.font=r.string,ve(c,a.text,n,t,r)}}_computeTitleHeight(){var t=this.options.title,e=E(t.font),i=V(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,a;if(v(t,this.left,this.right)&&v(e,this.top,this.bottom))for(a=this.legendHitBoxes,i=0;i<a.length;++i)if(v(t,(s=a[i]).left,s.left+s.width)&&v(e,s.top,s.top+s.height))return this.legendItems[i];return null}handleEvent(t){var e,i,s,a,r=this.options;i=t.type,e=r,("mousemove"===i&&(e.onHover||e.onLeave)||e.onClick&&("click"===i||"mouseup"===i))&&(e=this._getLegendItemAt(t.x,t.y),"mousemove"===t.type?(i=this._hoveredItem,a=e,s=null!==(s=i)&&null!==a&&s.datasetIndex===a.datasetIndex&&s.index===a.index,i&&!s&&c(r.onLeave,[t,i,this],this),(this._hoveredItem=e)&&!s&&c(r.onHover,[t,e,this],this)):e&&c(r.onClick,[t,e,this],this))}}var xr={id:"legend",_element:vr,start(t,e,i){var s=t.legend=new vr({ctx:t.ctx,options:i,chart:t});a.configure(t,s,i),a.addBox(t,s)},stop(t){a.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const s=t.legend;a.configure(t,s,i),s.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){var s=e.datasetIndex;const a=i.chart;a.isDatasetVisible(s)?(a.hide(s),e.hidden=!0):(a.show(s),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const s=t.data.datasets,{usePointStyle:a,pointStyle:r,textAlign:n,color:o}=t.legend.options["labels"];return t._getSortedDatasetMetas().map(t=>{var e=t.controller.getStyle(a?0:void 0),i=V(e.borderWidth);return{text:s[t.index].label,fillStyle:e.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:e.borderCapStyle,lineDash:e.borderDash,lineDashOffset:e.borderDashOffset,lineJoin:e.borderJoinStyle,lineWidth:(i.width+i.height)/4,strokeStyle:e.borderColor,pointStyle:r||e.pointStyle,rotation:e.rotation,textAlign:n||e.textAlign,borderRadius:0,datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class br extends i{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){var i=this.options;this.left=0,this.top=0,i.display?(this.width=this.right=t,this.height=this.bottom=e,t=I(i.text)?i.text.length:1,this._padding=V(i.padding),e=t*E(i.font).lineHeight+this._padding.height,this.isHorizontal()?this.height=e:this.width=e):this.width=this.height=this.right=this.bottom=0}isHorizontal(){var t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){var{top:e,left:i,bottom:s,right:a,options:r}=this,n=r.align;let o=0,l,h,c;return l=this.isHorizontal()?(h=L(n,i,a),c=e+t,a-i):(o="left"===r.position?(h=i+t,c=L(n,s,e),-.5*_):(h=a-t,c=L(n,e,s),.5*_),s-e),{titleX:h,titleY:c,maxWidth:l,rotation:o}}draw(){var t,e,i,s,a,r=this.ctx,n=this.options;n.display&&(e=(t=E(n.font)).lineHeight/2+this._padding.top,{titleX:e,titleY:i,maxWidth:s,rotation:a}=this._drawArgs(e),ve(r,n.text,0,0,t,{color:n.color,maxWidth:s,rotation:a,textAlign:T(n.align),textBaseline:"middle",translation:[e,i]}))}}var _r={id:"title",_element:br,start(t,e,i){var s;t=t,i=i,s=new br({ctx:t.ctx,options:i,chart:t}),a.configure(t,s,i),a.addBox(t,s),t.titleBlock=s},stop(t){var e=t.titleBlock;a.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const s=t.titleBlock;a.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const yr=new WeakMap;var wr={id:"subtitle",start(t,e,i){var s=new br({ctx:t.ctx,options:i,chart:t});a.configure(t,s,i),a.addBox(t,s),yr.set(t,s)},stop(t){a.removeBox(t,yr.get(t)),yr.delete(t)},beforeUpdate(t,e,i){const s=yr.get(t);a.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Mr={average(t){if(!t.length)return!1;let e,i,s=0,a=0,r=0;for(e=0,i=t.length;e<i;++e){const o=t[e].element;var n;o&&o.hasValue()&&(n=o.tooltipPosition(),s+=n.x,a+=n.y,++r)}return{x:s/r,y:a/r}},nearest(t,e){if(!t.length)return!1;let i=e.x,s=e.y,a=Number.POSITIVE_INFINITY,r,n,o;for(r=0,n=t.length;r<n;++r){const c=t[r].element;var l;c&&c.hasValue()&&((l=ie(e,c.getCenterPoint()))<a&&(a=l,o=c))}var h;return o&&(h=o.tooltipPosition(),i=h.x,s=h.y),{x:i,y:s}}};function o(t,e){return e&&(I(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function l(t){return("string"==typeof t||t instanceof String)&&-1<t.indexOf("\n")?t.split("\n"):t}function kr(t,e){const i=t.chart.ctx,{body:s,footer:a,title:r}=t;var{boxWidth:n,boxHeight:o}=e,l=E(e.bodyFont),h=E(e.titleFont),c=E(e.footerFont),d=r.length,u=a.length,g=s.length,f=V(e.padding);let p=f.height,m=0;var v=s.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);v+=t.beforeBody.length+t.afterBody.length,d&&(p+=d*h.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),v&&(d=e.displayColors?Math.max(o,l.lineHeight):l.lineHeight,p+=g*d+(v-g)*l.lineHeight+(v-1)*e.bodySpacing),u&&(p+=e.footerMarginTop+u*c.lineHeight+(u-1)*e.footerSpacing);let x=0;function b(t){m=Math.max(m,i.measureText(t).width+x)}return i.save(),i.font=h.string,M(t.title,b),i.font=l.string,M(t.beforeBody.concat(t.afterBody),b),x=e.displayColors?n+2+e.boxPadding:0,M(s,t=>{M(t.before,b),M(t.lines,b),M(t.after,b)}),x=0,i.font=c.string,M(t.footer,b),i.restore(),{width:m+=f.width,height:p}}function Sr(t,e,i,s){var{x:a,width:r}=i,{width:n,chartArea:{left:o,right:l}}=t;let h="center";return"center"===s?h=a<=(o+l)/2?"left":"right":a<=r/2?h="left":n-r/2<=a&&(h="right"),h=function(t,e,i,s){var{x:s,width:a}=s,i=i.caretSize+i.caretPadding;return"left"===t&&s+a+i>e.width||"right"===t&&s-a-i<0}(h,t,e,i)?"center":h}function Pr(t,e,i){var s=i.yAlign||e.yAlign||function(t,e){var{y:e,height:i}=e;return e<i/2?"top":e>t.height-i/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Sr(t,e,i,s),yAlign:s}}function Dr(t,e,i,s){var{caretSize:t,caretPadding:a,cornerRadius:r}=t,{xAlign:i,yAlign:n}=i,a=t+a,{topLeft:r,topRight:o,bottomLeft:l,bottomRight:h}=ti(r);let c=function(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}(e,i);var d=function(t,e,i){let{y:s,height:a}=t;return"top"===e?s+=i:s-="bottom"===e?a+i:a/2,s}(e,n,a);return"center"===n?"left"===i?c+=a:"right"===i&&(c-=a):"left"===i?c-=Math.max(r,l)+t:"right"===i&&(c+=Math.max(o,h)+t),{x:f(c,0,s.width-e.width),y:f(d,0,s.height-e.height)}}function Cr(t,e,i){i=V(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-i.right:t.x+i.left}function Or(t){return o([],l(t))}function Ar(t,e){e=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return e?t.override(e):t}class Tr extends i{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){var t=this._cachedAnimations;if(t)return t;var t=this.chart,e=this.options.setContext(this.getContext()),t=e.enabled&&t.options.animation&&e.animations,e=new ys(this.chart,t);return t._cacheable&&(this._cachedAnimations=Object.freeze(e)),e}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),i=(e=this)._tooltipItems,w(t,{tooltip:e,tooltipItems:i,type:"tooltip"})));var t,e,i}getTitle(t,e){const i=e["callbacks"];var e=i.beforeTitle.apply(this,[t]),s=i.title.apply(this,[t]),t=i.afterTitle.apply(this,[t]),e=o([],l(e));return e=o(e,l(s)),o(e,l(t))}getBeforeBody(t,e){return Or(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const s=e["callbacks"],a=[];return M(t,t=>{var e={before:[],lines:[],after:[]};const i=Ar(s,t);o(e.before,l(i.beforeLabel.call(this,t))),o(e.lines,i.label.call(this,t)),o(e.after,l(i.afterLabel.call(this,t))),a.push(e)}),a}getAfterBody(t,e){return Or(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const i=e["callbacks"];var e=i.beforeFooter.apply(this,[t]),s=i.footer.apply(this,[t]),t=i.afterFooter.apply(this,[t]),e=o([],l(e));return e=o(e,l(s)),o(e,l(t))}_createItems(s){var t=this._active;const a=this.chart.data,i=[],r=[],n=[];let e=[],o,l;for(o=0,l=t.length;o<l;++o)e.push(function(t,e){var{element:e,datasetIndex:i,index:s}=e;const a=t.getDatasetMeta(i).controller;var{label:r,value:n}=a.getLabelAndValue(s);return{chart:t,label:r,parsed:a.getParsed(s),raw:t.data.datasets[i].data[s],formattedValue:n,dataset:a.getDataset(),dataIndex:s,datasetIndex:i,element:e}}(this.chart,t[o]));return s.filter&&(e=e.filter((t,e,i)=>s.filter(t,e,i,a))),M(e=s.itemSort?e.sort((t,e)=>s.itemSort(t,e,a)):e,t=>{const e=Ar(s.callbacks,t);i.push(e.labelColor.call(this,t)),r.push(e.labelPointStyle.call(this,t)),n.push(e.labelTextColor.call(this,t))}),this.labelColors=i,this.labelPointStyles=r,this.labelTextColors=n,this.dataPoints=e}update(t,e){const i=this.options.setContext(this.getContext());var s,a,r,n=this._active;let o,l=[];n.length?(n=Mr[i.position].call(this,n,this._eventPosition),l=this._createItems(i),this.title=this.getTitle(l,i),this.beforeBody=this.getBeforeBody(l,i),this.body=this.getBody(l,i),this.afterBody=this.getAfterBody(l,i),this.footer=this.getFooter(l,i),s=this._size=kr(this,i),r=Object.assign({},n,s),a=Pr(this.chart,i,r),r=Dr(i,r,a,this.chart),this.xAlign=a.xAlign,this.yAlign=a.yAlign,o={opacity:1,x:r.x,y:r.y,width:s.width,height:s.height,caretX:n.x,caretY:n.y}):0!==this.opacity&&(o={opacity:0}),this._tooltipItems=l,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){t=this.getCaretPosition(t,i,s);e.lineTo(t.x1,t.y1),e.lineTo(t.x2,t.y2),e.lineTo(t.x3,t.y3)}getCaretPosition(t,e,i){var{xAlign:s,yAlign:a}=this,{caretSize:i,cornerRadius:r}=i,{topLeft:r,topRight:n,bottomLeft:o,bottomRight:l}=ti(r),{x:t,y:h}=t,{width:e,height:c}=e;let d,u,g,f,p,m;return"center"===a?(p=h+c/2,m="left"===s?(d=t,u=d-i,f=p+i,p-i):(d=t+e,u=d+i,f=p-i,p+i),g=d):(u="left"===s?t+Math.max(r,o)+i:"right"===s?t+e-Math.max(n,l)-i:this.caretX,g="top"===a?(f=h,p=f-i,d=u-i,u+i):(f=h+c,p=f+i,d=u+i,u-i),m=f),{x1:d,x2:u,x3:g,y1:f,y2:p,y3:m}}drawTitle(t,e,i){var s=this.title,a=s.length;let r,n,o;if(a){const l=Hi(i.rtl,this.x,this.width);for(t.x=Cr(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",r=E(i.titleFont),n=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,o=0;o<a;++o)e.fillText(s[o],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+n,o+1===a&&(t.y+=i.titleMarginBottom-n)}}_drawColorBox(t,e,i,s,a){var r,n=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:l,boxWidth:h,boxPadding:c}=a,d=E(a.bodyFont),u=Cr(this,"left",a),u=s.x(u),d=l<d.lineHeight?(d.lineHeight-l)/2:0,e=e.y+d;a.usePointStyle?(d={radius:Math.min(h,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},o=s.leftForLtr(u,h)+h/2,r=e+l/2,t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,de(t,d,o,r),t.strokeStyle=n.borderColor,t.fillStyle=n.backgroundColor,de(t,d,o,r)):(t.lineWidth=n.borderWidth||1,t.strokeStyle=n.borderColor,t.setLineDash(n.borderDash||[]),t.lineDashOffset=n.borderDashOffset||0,d=s.leftForLtr(u,h-c),o=s.leftForLtr(s.xPlus(u,1),h-c-2),r=ti(n.borderRadius),Object.values(r).some(t=>0!==t)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,xe(t,{x:d,y:e,w:h,h:l,radius:r}),t.fill(),t.stroke(),t.fillStyle=n.backgroundColor,t.beginPath(),xe(t,{x:o,y:e+1,w:h-2,h:l-2,radius:r}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(d,e,h,l),t.strokeRect(d,e,h,l),t.fillStyle=n.backgroundColor,t.fillRect(o,e+1,h-2,l-2))),t.fillStyle=this.labelTextColors[i]}drawBody(e,i,t){var s=this["body"];const{bodySpacing:a,bodyAlign:r,displayColors:n,boxHeight:o,boxWidth:l,boxPadding:h}=t;var c=E(t.bodyFont);let d=c.lineHeight,u=0;const g=Hi(t.rtl,this.x,this.width);function f(t){i.fillText(t,g.x(e.x+u),e.y+d/2),e.y+=d+a}var p=g.textAlign(r);let m,v,x,b,_,y,w;for(i.textAlign=r,i.textBaseline="middle",i.font=c.string,e.x=Cr(this,p,t),i.fillStyle=t.bodyColor,M(this.beforeBody,f),u=n&&"right"!==p?"center"===r?l/2+h:l+2+h:0,b=0,y=s.length;b<y;++b){for(m=s[b],v=this.labelTextColors[b],i.fillStyle=v,M(m.before,f),x=m.lines,n&&x.length&&(this._drawColorBox(i,e,b,g,t),d=Math.max(c.lineHeight,o)),_=0,w=x.length;_<w;++_)f(x[_]),d=c.lineHeight;M(m.after,f)}u=0,d=c.lineHeight,M(this.afterBody,f),e.y-=a}drawFooter(t,e,i){var s=this.footer,a=s.length;let r,n;if(a){const o=Hi(i.rtl,this.x,this.width);for(t.x=Cr(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=o.textAlign(i.footerAlign),e.textBaseline="middle",r=E(i.footerFont),e.fillStyle=i.footerColor,e.font=r.string,n=0;n<a;++n)e.fillText(s[n],o.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){var{xAlign:a,yAlign:r}=this,{x:n,y:o}=t,{width:l,height:h}=i,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:g}=ti(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(n+c,o),"top"===r&&this.drawCaret(t,e,i,s),e.lineTo(n+l-d,o),e.quadraticCurveTo(n+l,o,n+l,o+d),"center"===r&&"right"===a&&this.drawCaret(t,e,i,s),e.lineTo(n+l,o+h-g),e.quadraticCurveTo(n+l,o+h,n+l-g,o+h),"bottom"===r&&this.drawCaret(t,e,i,s),e.lineTo(n+u,o+h),e.quadraticCurveTo(n,o+h,n,o+h-u),"center"===r&&"left"===a&&this.drawCaret(t,e,i,s),e.lineTo(n,o+c),e.quadraticCurveTo(n,o,n+c,o),e.closePath(),e.fill(),0<s.borderWidth&&e.stroke()}_updateAnimationTarget(t){var e,i,s,a=this.chart,r=this.$animations,n=r&&r.x,r=r&&r.y;(n||r)&&(e=Mr[t.position].call(this,this._active,this._eventPosition))&&(i=this._size=kr(this,t),s=Dr(t,s=Object.assign({},e,this._size),t=Pr(a,t,s),a),n._to===s.x&&r._to===s.y||(this.xAlign=t.xAlign,this.yAlign=t.yAlign,this.width=i.width,this.height=i.height,this.caretX=e.x,this.caretY=e.y,this._resolveAnimations().update(this,s)))}draw(t){var e=this.options.setContext(this.getContext());let i=this.opacity;if(i){this._updateAnimationTarget(e);var s={width:this.width,height:this.height};const n={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;var a=V(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(n,t,s,e),ji(t,e.textDirection),n.y+=a.top,this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),Yi(t,e.textDirection),t.restore())}}getActiveElements(){return this._active||[]}setActiveElements(t,e){var i=this._active,t=t.map(({datasetIndex:t,index:e})=>{var i=this.chart.getDatasetMeta(t);if(i)return{datasetIndex:t,element:i.data[e],index:e};throw new Error("Cannot find a dataset at index "+t)}),i=!kt(i,t),s=this._positionChanged(t,e);(i||s)&&(this._active=t,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;var s=this.options,a=this._active||[],i=this._getActiveElements(t,a,e,i),r=this._positionChanged(i,t),a=e||!kt(i,a)||r;return a&&(this._active=i,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,i,s){var a=this.options;if("mouseout"===t.type)return[];if(!s)return e;const r=this.chart.getElementsAtEventForMode(t,a.mode,a,i);return a.reverse&&r.reverse(),r}_positionChanged(t,e){var{caretX:i,caretY:s,options:a}=this,a=Mr[a.position].call(this,t,e);return!1!==a&&(i!==a.x||s!==a.y)}}Tr.positioners=Mr;var Lr={id:"tooltip",_element:Tr,positioners:Mr,afterInit(t,e,i){i&&(t.tooltip=new Tr({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;var i={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",i)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i))},afterEvent(t,e){var i;t.tooltip&&(i=e.replay,t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0))},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:t,title(t){if(0<t.length){var t=t[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&"dataset"===this.options.mode)return t.dataset.label||"";if(t.label)return t.label;if(0<i&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:t,beforeBody:t,beforeLabel:t,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");t=t.formattedValue;return P(t)||(e+=t),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex);t=e.controller.getStyle(t.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex);t=e.controller.getStyle(t.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:t,afterBody:t,beforeFooter:t,footer:t,afterFooter:t}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},ir=Object.freeze({__proto__:null,Decimation:ir,Filler:pr,Legend:xr,SubTitle:wr,Title:_r,Tooltip:Lr});function Rr(t,e,i,s){var a,r,n,o=t.indexOf(e);return-1===o?(a=t,n=i,s=s,"string"==typeof(r=e)?(n=a.push(r)-1,s.unshift({index:n,label:r})):isNaN(r)&&(n=null),n):o!==t.lastIndexOf(e)?i:o}class Er extends Ws{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){var e=this._addedLabels;if(e.length){const a=this.getLabels();for(var{index:i,label:s}of e)a[i]===s&&a.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(P(t))return null;var i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:Rr(i,t,B(e,t),this._addedLabels),t=e,e=i.length-1,null===t?null:f(Math.round(t),0,e)}determineDataLimits(){var{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){var e=this.min,i=this.max,t=this.options.offset;const s=[];let a=this.getLabels();a=0===e&&i===a.length-1?a:a.slice(e,i+1),this._valueRange=Math.max(a.length-(t?0:1),1),this._startValue=this.min-(t?.5:0);for(let t=e;t<=i;t++)s.push({value:t});return s}getLabelForValue(t){var e=this.getLabels();return 0<=t&&t<e.length?e[t]:t}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return null===(t="number"!=typeof t?this.parse(t):t)?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Ir(t,e,{horizontal:i,minRotation:s}){s=z(s),i=(i?Math.sin(s):Math.cos(s))||.001;return Math.min(e/i,.75*e*(""+t).length)}Er.id="category",Er.defaults={ticks:{callback:Er.prototype.getLabelForValue}};class zr extends Ws{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return P(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){var e=this.options["beginAtZero"];const{minDefined:i,maxDefined:s}=this.getUserBounds();let{min:a,max:r}=this;var t,n,o=t=>a=i?a:t,l=t=>r=s?r:t;if(e&&(t=S(a),n=S(r),t<0&&n<0?l(0):0<t&&0<n&&o(0)),a===r){let t=1;(r>=Number.MAX_SAFE_INTEGER||a<=Number.MIN_SAFE_INTEGER)&&(t=Math.abs(.05*r)),l(r+t),e||o(a-t)}this.min=a,this.max=r}getTickLimit(){let{maxTicksLimit:t,stepSize:e}=this.options.ticks,i;return e?1e3<(i=Math.ceil(this.max/e)-Math.floor(this.min/e)+1)&&(console.warn(`scales.${this.id}.ticks.stepSize: ${e} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3):(i=this.computeTickLimit(),t=t||11),i=t?Math.min(t,i):i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){var t=this.options,e=t.ticks,i=this.getTickLimit();const s=function(t,e){const i=[];var{bounds:s,step:a,min:r,max:n,precision:o,count:l,maxTicks:h,maxDigits:c,includeBounds:d}=t,u=a||1,g=h-1,{min:e,max:f}=e,p=!P(r),m=!P(n),v=!P(l),c=(f-e)/(c+1);let x=Xt((f-e)/g/u)*u,b,_,y,w;if(x<1e-14&&!p&&!m)return[{value:e},{value:f}];(w=Math.ceil(f/x)-Math.floor(e/x))>g&&(x=Xt(w*x/g/u)*u),P(o)||(b=Math.pow(10,o),x=Math.ceil(x*b)/b),y="ticks"===s?(_=Math.floor(e/x)*x,Math.ceil(f/x)*x):(_=e,f),p&&m&&a&&Zt((n-r)/a,x/1e3)?(w=Math.round(Math.min((n-r)/x,h)),x=(n-r)/w,_=r,y=n):v?(_=p?r:_,y=m?n:y,w=l-1,x=(y-_)/w):w=Gt(w=(y-_)/x,Math.round(w),x/1e3)?Math.round(w):Math.ceil(w),g=Math.max(te(x),te(_)),b=Math.pow(10,P(o)?g:o),_=Math.round(_*b)/b,y=Math.round(y*b)/b;let M=0;for(p&&(d&&_!==r?(i.push({value:r}),_<r&&M++,Gt(Math.round((_+M*x)*b)/b,r,Ir(r,c,t))&&M++):_<r&&M++);M<w;++M)i.push({value:Math.round((_+M*x)*b)/b});return m&&d&&y!==n?i.length&&Gt(i[i.length-1].value,n,Ir(n,c,t))?i[i.length-1].value=n:i.push({value:n}):m&&y!==n||i.push({value:y}),i}({maxTicks:Math.max(2,i),bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&Jt(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){var t=this.ticks;let e=this.min,i=this.max;super.configure(),this.options.offset&&t.length&&(t=(i-e)/Math.max(t.length-1,1)/2,e-=t,i+=t),this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Ni(t,this.chart.options.locale,this.options.ticks.format)}}class Fr extends zr{determineDataLimits(){var{min:t,max:e}=this.getMinMax(!0);this.min=p(t)?t:0,this.max=p(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){var t=this.isHorizontal(),e=t?this.width:this.height,i=z(this.options.ticks.minRotation),t=(t?Math.sin(i):Math.cos(i))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,i.lineHeight/t))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function Br(t){return 1==t/Math.pow(10,Math.floor(u(t)))}Fr.id="linear",Fr.defaults={ticks:{callback:Rs.formatters.numeric}};class Vr extends Ws{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){t=zr.prototype.parse.apply(this,[t,e]);if(0!==t)return p(t)&&0<t?t:null;this._zero=!0}determineDataLimits(){var{min:t,max:e}=this.getMinMax(!0);this.min=p(t)?Math.max(0,t):null,this.max=p(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:i}=this.getUserBounds();let s=this.min,a=this.max;var t=t=>s=e?s:t,r=t=>a=i?a:t,n=(t,e)=>Math.pow(10,Math.floor(u(t))+e);s===a&&(s<=0?(t(1),r(10)):(t(n(s,-1)),r(n(a,1)))),s<=0&&t(n(a,-1)),a<=0&&r(n(s,1)),this._zero&&this.min!==this._suggestedMin&&s===n(this.min,0)&&t(n(s,-1)),this.min=s,this.max=a}buildTicks(){var t=this.options;const e=function(t,e){var i=Math.floor(u(e.max)),s=Math.ceil(e.max/Math.pow(10,i));const a=[];let r=h(t.min,Math.pow(10,Math.floor(u(e.min)))),n=Math.floor(u(r)),o=Math.floor(r/Math.pow(10,n)),l=n<0?Math.pow(10,Math.abs(n)):1;for(;a.push({value:r,major:Br(r)}),10===++o&&(o=1,++n,l=0<=n?1:l),r=Math.round(o*Math.pow(10,n)*l)/l,n<i||n===i&&o<s;);return e=h(t.max,r),a.push({value:e,major:Br(r)}),a}({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&Jt(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":Ni(t,this.chart.options.locale,this.options.ticks.format)}configure(){var t=this.min;super.configure(),this._startValue=u(t),this._valueRange=u(this.max)-u(t)}getPixelForValue(t){return null===(t=void 0!==t&&0!==t?t:this.min)||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(u(t)-this._startValue)/this._valueRange)}getValueForPixel(t){t=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+t*this._valueRange)}}function Wr(t){var e=t.ticks;return e.display&&t.display?(t=V(e.backdropPadding),B(e.font&&e.font.size,R.font.size)+t.height):0}function Nr(t,e,i,s,a){return t===s||t===a?{start:e-i/2,end:e+i/2}:t<s||a<t?{start:e-i,end:e}:{start:e,end:e+i}}function Hr(e){var i={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},s=Object.assign({},i);const a=[],r=[];var n=e._pointLabels.length;const o=e.options.pointLabels;var l=o.centerPointLabels?_/n:0;for(let t=0;t<n;t++){var h=o.setContext(e.getPointLabelContext(t)),c=(r[t]=h.padding,e.getPointPosition(t,e.drawingArea+r[t],l)),h=E(h.font),d=(d=e.ctx,h=h,u=I(u=e._pointLabels[t])?u:[u],{w:le(d,h.string,u),h:u.length*h.lineHeight}),u=(a[t]=d,x(e.getIndexAngle(t)+l)),h=Math.round(Qt(u)),g=Nr(h,c.x,d.w,0,180),h=Nr(h,c.y,d.h,90,270);{c=void 0;d=void 0;f=void 0;p=void 0;m=void 0;v=void 0;f=void 0;c=s;d=i;var f=u;var p=g;var m=h;var v=Math.abs(Math.sin(f)),f=Math.abs(Math.cos(f));let t=0,e=0;p.start<d.l?(t=(d.l-p.start)/v,c.l=Math.min(c.l,d.l-t)):p.end>d.r&&(t=(p.end-d.r)/v,c.r=Math.max(c.r,d.r+t));m.start<d.t?(e=(d.t-m.start)/f,c.t=Math.min(c.t,d.t-e)):m.end>d.b&&(e=(m.end-d.b)/f,c.b=Math.max(c.b,d.b+e))}}e.setCenterPoint(i.l-s.l,s.r-i.r,i.t-s.t,s.b-i.b),e._pointLabelItems=function(e,i,s){const a=[],r=e._pointLabels.length,t=e.options,n=Wr(t)/2,o=e.drawingArea,l=t.pointLabels.centerPointLabels?_/r:0;for(let t=0;t<r;t++){var h=e.getPointPosition(t,o+n+s[t],l),c=Math.round(Qt(x(h.angle+y))),d=i[t],u=function(t,e,i){90===i||270===i?t-=e/2:(270<i||i<90)&&(t-=e);return t}(h.y,d.h,c),c=function(t){{if(0===t||180===t)return"center";if(t<180)return"left"}return"right"}(c),g=function(t,e,i){"right"===i?t-=e:"center"===i&&(t-=e/2);return t}(h.x,d.w,c);a.push({x:h.x,y:u,textAlign:c,left:g,top:u,right:g+d.w,bottom:u+d.h})}return a}(e,a,r)}function jr(e,i,t,s){const a=e["ctx"];if(t)a.arc(e.xCenter,e.yCenter,i,0,m);else{var r=e.getPointPosition(0,i);a.moveTo(r.x,r.y);for(let t=1;t<s;t++)r=e.getPointPosition(t,i),a.lineTo(r.x,r.y)}}Vr.id="logarithmic",Vr.defaults={ticks:{callback:Rs.formatters.logarithmic,major:{enabled:!0}}};class Yr extends zr{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){var t=this._padding=V(Wr(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){var{min:t,max:e}=this.getMinMax(!1);this.min=p(t)&&!isNaN(t)?t:0,this.max=p(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Wr(this.options))}generateTickLabels(t){zr.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((t,e)=>{t=c(this.options.pointLabels.callback,[t,e],this);return t||0===t?t:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){var t=this.options;t.display&&t.pointLabels.display?Hr(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){return x(t*(m/(this._pointLabels.length||1))+z(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(P(t))return NaN;var e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(P(t))return NaN;t/=this.drawingArea/(this.max-this.min);return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(t){var e=this._pointLabels||[];if(0<=t&&t<e.length)return e=e[t],w(this.getContext(),{label:e,index:t,type:"pointLabel"})}getPointPosition(t,e,i=0){t=this.getIndexAngle(t)-y+i;return{x:Math.cos(t)*e+this.xCenter,y:Math.sin(t)*e+this.yCenter,angle:t}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){var{left:t,top:e,right:i,bottom:s}=this._pointLabelItems[t];return{left:t,top:e,right:i,bottom:s}}drawBackground(){var{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),jr(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx;var e=this.options;const{angleLines:i,grid:l}=e,h=this._pointLabels.length;let s,c,a;if(e.pointLabels.display){var r=this;var n=h;const{ctx:k,options:{pointLabels:S}}=r;for(let t=n-1;0<=t;t--){var o,d=S.setContext(r.getPointLabelContext(t)),u=E(d.font),{x:g,y:f,textAlign:p,left:m,top:v,right:x,bottom:b}=r._pointLabelItems[t],_=d["backdropColor"];P(_)||(o=V(d.backdropPadding),k.fillStyle=_,k.fillRect(m-o.left,v-o.top,x-m+o.width,b-v+o.height)),ve(k,r._pointLabels[t],g,f+u.lineHeight/2,u,{color:d.color,textAlign:p,textBaseline:"middle"})}}if(l.display&&this.ticks.forEach((t,e)=>{if(0!==e){c=this.getDistanceFromCenterForValue(t.value);t=l.setContext(this.getContext(e-1));{var e=this,i=c,s=h;const o=e.ctx;var a=t.circular,{color:r,lineWidth:n}=t;!a&&!s||!r||!n||i<0||(o.save(),o.strokeStyle=r,o.lineWidth=n,o.setLineDash(t.borderDash),o.lineDashOffset=t.borderDashOffset,o.beginPath(),jr(e,i,a,s),o.closePath(),o.stroke(),o.restore())}}}),i.display){for(t.save(),s=h-1;0<=s;s--){var y=i.setContext(this.getPointLabelContext(s)),{color:w,lineWidth:M}=y;M&&w&&(t.lineWidth=M,t.strokeStyle=w,t.setLineDash(y.borderDash),t.lineDashOffset=y.borderDashOffset,c=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),a=this.getPointPosition(s,c),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(a.x,a.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const n=this.ctx,o=this.options,l=o.ticks;if(l.display){var t=this.getIndexAngle(0);let a,r;n.save(),n.translate(this.xCenter,this.yCenter),n.rotate(t),n.textAlign="center",n.textBaseline="middle",this.ticks.forEach((t,e)=>{var i,s;0===e&&!o.reverse||(s=E((i=l.setContext(this.getContext(e))).font),a=this.getDistanceFromCenterForValue(this.ticks[e].value),i.showLabelBackdrop&&(n.font=s.string,r=n.measureText(t.label).width,n.fillStyle=i.backdropColor,e=V(i.backdropPadding),n.fillRect(-r/2-e.left,-a-s.size/2-e.top,r+e.width,s.size+e.height)),ve(n,t.label,0,-a,s,{color:i.color}))}),n.restore()}}drawTitle(){}}Yr.id="radialLinear",Yr.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Rs.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}},Yr.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};const Ur={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!(Yr.descriptors={angleLines:{_fallback:"grid"}}),size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},D=Object.keys(Ur);function $r(t,e){return t-e}function Xr(t,e){if(P(e))return null;const i=t._adapter,{parser:s,round:a,isoWeekday:r}=t._parseOpts;let n=e;return"function"==typeof s&&(n=s(n)),null===(n=p(n)?n:"string"==typeof s?i.parse(n,s):i.parse(n))?null:+(n=a?"week"!==a||!Kt(r)&&!0!==r?i.startOf(n,a):i.startOf(n,"isoWeek",r):n)}function qr(e,i,s,a){var r=D.length;for(let t=D.indexOf(e);t<r-1;++t){var n=Ur[D[t]],o=n.steps||Number.MAX_SAFE_INTEGER;if(n.common&&Math.ceil((s-i)/(o*n.size))<=a)return D[t]}return D[r-1]}function Kr(t,e,i){var s,a;i?i.length&&({lo:s,hi:a}=be(i,e),t[i[s]>=e?i[s]:i[a]]=!0):t[e]=!0}function Gr(i,t,s){const a=[],r={};var e=t.length;let n,o;for(n=0;n<e;++n)o=t[n],r[o]=n,a.push({value:o,major:!1});if(0!==e&&s){var l=a,h=r,c=s;const u=i._adapter;var i=+u.startOf(l[0].value,c),d=l[l.length-1].value;let t,e;for(t=i;t<=d;t=+u.add(t,1,c))0<=(e=h[t])&&(l[e].major=!0);return l}return a}class Zr extends Ws{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){var i=t.time||(t.time={});const s=this._adapter=new ua._date(t.adapters.date);Ot(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:Xr(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){var t=this.options;const e=this._adapter;var i=t.time.unit||"day";let{min:s,max:a,minDefined:r,maxDefined:n}=this.getUserBounds();function o(t){r||isNaN(t.min)||(s=Math.min(s,t.min)),n||isNaN(t.max)||(a=Math.max(a,t.max))}r&&n||(o(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||o(this.getMinMax(!1))),s=p(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),a=p(a)&&!isNaN(a)?a:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,a-1),this.max=Math.max(s+1,a)}_getLabelBounds(){var t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){var t=this.options,e=t.time,i=t.ticks,s="labels"===i.source?this.getLabelTimestamps():this._generate(),a=("ticks"===t.bounds&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]),this.min);const r=ye(s,a,this.max);return this._unit=e.unit||(i.autoSkip?qr(e.minUnit,this.min,this.max,this._getLabelCapacity(a)):function(e,i,s,a,r){for(let t=D.length-1;t>=D.indexOf(s);t--){var n=D[t];if(Ur[n].common&&e._adapter.diff(r,a,n)>=i-1)return n}return D[s?D.indexOf(s):0]}(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(i){for(let t=D.indexOf(i)+1,e=D.length;t<e;++t)if(Ur[D[t]].common)return D[t]}(this._unit):void 0,this.initOffsets(s),t.reverse&&r.reverse(),Gr(this,r,this._majorUnit)}initOffsets(t){let e=0,i=0;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),e=1===t.length?1-s:(this.getDecimalForValue(t[1])-s)/2,s=this.getDecimalForValue(t[t.length-1]),i=1===t.length?s:(s-this.getDecimalForValue(t[t.length-2]))/2);var s=t.length<3?.5:.25;e=f(e,0,s),i=f(i,0,s),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter;var e=this.min,i=this.max,s=this.options,a=s.time,r=a.unit||qr(a.minUnit,e,i,this._getLabelCapacity(e)),n=B(a.stepSize,1),a="week"===r&&a.isoWeekday,o=Kt(a)||!0===a,l={};let h=e,c,d;if(o&&(h=+t.startOf(h,"isoWeek",a)),h=+t.startOf(h,o?"day":r),t.diff(i,e,r)>1e5*n)throw new Error(e+" and "+i+" are too far apart with stepSize of "+n+" "+r);var u="data"===s.ticks.source&&this.getDataTimestamps();for(c=h,d=0;c<i;c=+t.add(c,n,r),d++)Kr(l,c,u);return c!==i&&"ticks"!==s.bounds&&1!==d||Kr(l,c,u),Object.keys(l).sort((t,e)=>t-e).map(t=>+t)}getLabelForValue(t){const e=this._adapter;var i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,s){var a=this.options,r=a.time.displayFormats,n=this._unit,o=this._majorUnit,n=n&&r[n],r=o&&r[o],l=i[e],o=o&&r&&l&&l.major,l=this._adapter.format(t,s||(o?r:n)),t=a.ticks.callback;return t?c(t,[l,e,i],this):l}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)(s=t[e]).label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){var e=this._offsets,t=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+t)*e.factor)}getValueForPixel(t){var e=this._offsets,t=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+t*(this.max-this.min)}_getLabelSize(t){var e=this.options.ticks,t=this.ctx.measureText(t).width,e=z(this.isHorizontal()?e.maxRotation:e.minRotation),i=Math.cos(e),e=Math.sin(e),s=this._resolveTickFontOptions(0).size;return{w:t*i+s*e,h:t*e+s*i}}_getLabelCapacity(t){var e=this.options.time,i=e.displayFormats,e=i[e.unit]||i.millisecond,i=this._tickFormatFunction(t,0,Gr(this,[t],this._majorUnit),e),t=this._getLabelSize(i),e=Math.floor(this.isHorizontal()?this.width/t.w:this.height/t.h)-1;return 0<e?e:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;var s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(Xr(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Se(t.sort($r))}}function Jr(t,e,i){let s=0,a=t.length-1,r,n,o,l;i?(e>=t[s].pos&&e<=t[a].pos&&({lo:s,hi:a}=b(t,"pos",e)),{pos:r,time:o}=t[s],{pos:n,time:l}=t[a]):(e>=t[s].time&&e<=t[a].time&&({lo:s,hi:a}=b(t,"time",e)),{time:r,pos:o}=t[s],{time:n,pos:l}=t[a]);i=n-r;return i?o+(l-o)*(e-r)/i:o}Zr.id="time",Zr.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class Qr extends Zr{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){var t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Jr(e,this.min),this._tableRange=Jr(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){var{min:e,max:i}=this;const s=[],a=[];let r,n,o,l,h;for(r=0,n=t.length;r<n;++r)(l=t[r])>=e&&l<=i&&s.push(l);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(r=0,n=s.length;r<n;++r)h=s[r+1],o=s[r-1],l=s[r],Math.round((h+o)/2)!==l&&a.push({time:l,pos:r/(n-1)});return a}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps();var i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t}getDecimalForValue(t){return(Jr(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){var e=this._offsets,t=this.getDecimalForPixel(t)/e.factor-e.end;return Jr(this._table,t*this._tableRange+this._minPos,!0)}}Qr.id="timeseries",Qr.defaults=Zr.defaults;pr=Object.freeze({__proto__:null,CategoryScale:Er,LinearScale:Fr,LogarithmicScale:Vr,RadialLinearScale:Yr,TimeScale:Zr,TimeSeriesScale:Qr});return s.register(Ca,pr,Qa,ir),s.helpers={...Ji},s._adapters=ua,s.Animation=bs,s.Animations=ys,s.animator=n,s.controllers=k.controllers.items,s.DatasetController=e,s.Element=i,s.elements=Qa,s.Interaction=Xe,s.layouts=a,s.platforms=Be,s.Scale=Ws,s.Ticks=Rs,Object.assign(s,Ca,pr,Qa,ir,Be),s.Chart=s,"undefined"!=typeof window&&(window.Chart=s),s},"object"==typeof i&&void 0!==e?e.exports=a():"function"==typeof define&&define.amd?define(a):(s="undefined"!=typeof globalThis?globalThis:s||self).Chart=a()},{}]},{},[1]);PK     M\is)    )  logging/assets/src/js/admin-statistics.jsnu [        import Chart from 'chart.js';

const colors = [ "#cc3333", "#993333", "#ffcccc", "#ff9999", "#33cc33", "#339933", "#ccffcc", "#99ff99" ]
const datasets = window.mc4wp_statistics_data.map((s, i) => {
	s.fill = false;
	s.borderColor = colors[i] || getRandomColor();
	s.backgroundColor = colors[i] || getRandomColor();
	return s;
})
const dateRangeSelectorElement = document.getElementById('mc4wp-graph-range')
const customRangeOptionsElement = document.getElementById('mc4wp-graph-custom-range-options')

function getRandomColor() {
	const letters = '0123456789ABCDEF'.split('');
	let color = '#';
	for (let i = 0; i < 6; i++ ) {
		color += letters[Math.floor(Math.random() * 16)];
	}
	return color;
}

function plotGraph() {
	if (datasets.length === 0) {
		return;
	}

	const chartWrapperEl = document.getElementById('mc4wp-graph');
	const ctx = chartWrapperEl.getContext('2d')
	new Chart(ctx, {
		type: 'bar',
		data: {
			datasets: datasets,
		},
		options: {
			animation: {
				duration: 0 // disable animations
			},
			layout: {
				padding: {
					left: 20,
					right: 20,
					top: 20,
					bottom: 20
				}
			},
			scales: {
				x: {
					stacked: true,
				},
				y: {
					beginAtZero: true,
					stacked: true,
					suggestedMax: 10,
					ticks: {
						stepSize: 1
					}
				}
			}
		}
	});
}

dateRangeSelectorElement.addEventListener('change', (evt) => {
	customRangeOptionsElement.style.display = evt.target.value === 'custom' ? '' : 'none';
});

document.addEventListener('DOMContentLoaded', plotGraph);
PK     M\D\9  9     logging/assets/src/css/admin.cssnu [        
#mc4wp-graph{
	width:100%;
	min-height: 300px;
	background: white;
	margin-top: 40px;
}

#mc4wp-graph-range-options,
#mc4wp-graph-custom-range-options{
	float:left;
}

#mc4wp-graph-custom-range-options span{
	float: left;
	margin-right: 6px;
	height: 24px;
	line-height: 24px;
}

.column-email {
	width: 300px;
}PK     M\^mլ      logging/assets/css/admin.cssnu [        #mc4wp-graph{width:100%;min-height:300px;background:#fff;margin-top:40px}#mc4wp-graph-custom-range-options,#mc4wp-graph-range-options{float:left}#mc4wp-graph-custom-range-options span{float:left;margin-right:6px;height:24px;line-height:24px}.column-email{width:300px}PK     M\z      8  logging/migrations/4.6.2-change-datetime-column-type.phpnu [        <?php

global $wpdb;

$table_name = $wpdb->prefix . 'mc4wp_log';
$wpdb->query("ALTER TABLE {$table_name} CHANGE COLUMN `datetime` `datetime` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP");PK     M\{    3  logging/migrations/3.0-update-integration-types.phpnu [        <?php

defined('ABSPATH') or exit;

global $wpdb;
$table_name = $wpdb->prefix . 'mc4wp_log';

$changes = array(
    'comment_form'          => 'wp-comment-form',
    'comment'               => 'wp-comment-form',
    'registration'          => 'wp-registration-form',
    'registration_form'     => 'wp-registration-form',
    'contact_form_7'        => 'contact-form-7',
    'cf7'                   => 'cf7',
    'edd_checkout'          => 'easy-digital-downloads',
    'woocommerce_checkout'  => 'woocommerce',
    'events_manager'        => 'events-manager',
    'buddypress_form'       => 'buddypress',
    'general'               => 'custom',
    'other_form'            => 'custom',
    'other'                 => 'custom',
    'form'                  => 'mc4wp-form',
    'sign-up-form'          => 'mc4wp-form',
    'mailchimp-top-bar'     => 'mc4wp-top-bar'
);

foreach ($changes as $old => $new) {
    $wpdb->query("UPDATE `{$table_name}` SET `type` = '{$new}' WHERE `type` = '{$old}'");
}
PK     M\c  c  )  logging/migrations/3.0-update-columns.phpnu [        <?php

defined('ABSPATH') or exit;

global $wpdb;

$table_name = $wpdb->prefix . 'mc4wp_log';

$wpdb->suppress_errors(true);
$wpdb->hide_errors();

// merge columns `form_ID` and `comment_ID` into `related_object_ID`
$wpdb->query("ALTER TABLE `{$table_name}` CHANGE COLUMN `form_ID` `related_object_ID` BIGINT(20)");
$wpdb->query("UPDATE `{$table_name}` SET `related_object_ID` = `comment_ID` WHERE `related_object_ID` = 0 AND `comment_ID` > 0 ");
$wpdb->query("ALTER TABLE `{$table_name}` DROP COLUMN `comment_ID`");

// add 'success' column
$wpdb->query("ALTER TABLE `{$table_name}` ADD COLUMN `success` TINYINT(1) DEFAULT 1");

// rename columns
$wpdb->query("ALTER TABLE `{$table_name}` CHANGE COLUMN `signup_method` `method` VARCHAR(255)");
$wpdb->query("ALTER TABLE `{$table_name}` CHANGE COLUMN `signup_type` `type` VARCHAR(255)");
$wpdb->query("ALTER TABLE `{$table_name}` CHANGE COLUMN `merge_vars` `data` TEXT");

// alter datatype of `datetime`
$wpdb->query("ALTER TABLE `{$table_name}` CHANGE COLUMN `datetime` `datetime` timestamp DEFAULT CURRENT_TIMESTAMP");

// change `sign-up-form` to just `form`
$wpdb->query("UPDATE `{$table_name}` SET `type` = 'form' WHERE `type` = 'sign-up-form'");
$wpdb->query("UPDATE `{$table_name}` SET `type` = 'form' WHERE `method` = 'form'");

// drop `method` column
$wpdb->query("ALTER TABLE `{$table_name}` DROP COLUMN `method`");
PK     M\ч      /  logging/migrations/4.5.10-url-column-length.phpnu [        <?php

global $wpdb;

$table_name = $wpdb->prefix . 'mc4wp_log';

$wpdb->suppress_errors(true);
$wpdb->hide_errors();

$wpdb->query("ALTER TABLE `{$table_name}` CHANGE COLUMN `url` `url` TEXT DEFAULT ''");
PK     M\[    1  logging/migrations/3.2-change-table-structure.phpnu [        <?php

defined('ABSPATH') or exit;

/**
 * @var WPDB $wpdb
 */
global $wpdb, $charset_collate;
$table_name = $wpdb->prefix . 'mc4wp_log';

$wpdb->suppress_errors(true);
$wpdb->hide_errors();

$wpdb->query("ALTER TABLE `{$table_name}` CHANGE COLUMN `email` `email_address` VARCHAR(255)");
$wpdb->query("ALTER TABLE `{$table_name}` CHANGE COLUMN `list_ids` `list_id` VARCHAR(255)");
$wpdb->query("ALTER TABLE `{$table_name}` CHANGE COLUMN `data` `merge_fields` TEXT NULL");
$wpdb->query("ALTER TABLE `{$table_name}` ADD COLUMN `interests` TEXT NULL");
$wpdb->query("ALTER TABLE `{$table_name}` ADD COLUMN `status` VARCHAR(60) NULL");
$wpdb->query("ALTER TABLE `{$table_name}` ADD COLUMN `email_type` VARCHAR(4) NULL");
$wpdb->query("ALTER TABLE `{$table_name}` ADD COLUMN `ip_signup` VARCHAR(255) NULL");
$wpdb->query("ALTER TABLE `{$table_name}` ADD COLUMN `language` VARCHAR(127) NULL");
$wpdb->query("ALTER TABLE `{$table_name}` ADD COLUMN `vip` TINYINT(1) NULL");
PK     M\    &  logging/migrations/3.2-update-data.phpnu [        <?php

defined('ABSPATH') or exit;

global $wpdb;
$table = $wpdb->prefix . 'mc4wp_log';

$items = $wpdb->get_results(sprintf('SELECT ID, merge_fields FROM %s WHERE merge_fields IS NOT NULL AND ip_signup IS NULL', $table));
$values = array();

// create string of "1, '127.0.0.1'" format.
foreach ($items as $item) {
    $data = json_decode($item->merge_fields, ARRAY_A);
    if (! empty($data['OPTIN_IP'])) {
        $values[] = "$item->ID, '{$data['OPTIN_IP']}'";
    }
}

if (! empty($values)) {
    // generate SQL
    $sql = 'INSERT INTO %s (ID, ip_signup) VALUES %s ON DUPLICATE KEY UPDATE ip_signup=VALUES(ip_signup)';
    $values = '(' . join('),(', $values) . ')';
    $sql = sprintf($sql, $table, $values);

    $wpdb->query($sql);
}
PK     M\4x\  \  0  logging/migrations/4.7.3-change-column-types.phpnu [        <?php

defined( 'ABSPATH' ) or exit;
global $wpdb;

$table_name = $wpdb->prefix . 'mc4wp_log';

$wpdb->query("ALTER TABLE `{$table_name}` MODIFY `ID` INT UNSIGNED AUTO_INCREMENT");
$wpdb->query("ALTER TABLE `{$table_name}` MODIFY `list_id` VARCHAR(50) NOT NULL");
$wpdb->query("ALTER TABLE `{$table_name}` MODIFY `email_address` VARCHAR(100) NOT NULL");
$wpdb->query("ALTER TABLE `{$table_name}` MODIFY `type` VARCHAR(50) NOT NULL");
$wpdb->query("ALTER TABLE `{$table_name}` MODIFY `language` VARCHAR(50) NULL");
$wpdb->query("ALTER TABLE `{$table_name}` MODIFY `related_object_ID` INT UNSIGNED NULL");
PK     M\Sy    )  logging/migrations/3.0-remove-success.phpnu [        <?php

defined('ABSPATH') or exit;

global $wpdb;

$table_name = $wpdb->prefix . 'mc4wp_log';

// remove all failed log items
$wpdb->query("DELETE FROM `{$table_name}` WHERE `success` = 0");

// drop `success` column
$wpdb->query("ALTER TABLE `{$table_name}` DROP COLUMN `success`");
PK     M\-7    '  logging/migrations/3.0-create-table.phpnu [        <?php
defined('ABSPATH') or exit;

/** @var WPDB $wpdb */
global $wpdb;

$table_name = $wpdb->prefix . 'mc4wp_log';
$charset_collate = $wpdb->get_charset_collate();

// Create table if it does not exist
$sql = "CREATE TABLE IF NOT EXISTS {$table_name} (
	        ID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
	        email VARCHAR(100) NOT NULL,
	        list_ids VARCHAR(100) NOT NULL,
	        type VARCHAR(40) NOT NULL,
	        success TINYINT(1) DEFAULT 1,
			data TEXT NULL,
	        related_object_ID INT UNSIGNED NULL,
	        url TEXT NULL,
	        datetime timestamp DEFAULT CURRENT_TIMESTAMP
		) $charset_collate";

$wpdb->query($sql);
PK     M\r|	  |	  &  logging/views/admin-reports-export.phpnu [        <?php
defined('ABSPATH') or exit;

$begin_year = 2012;
$current_year = date('Y');
$current_month = date('n');
?>
<div class="metabox-holder">
<div class="postbox">
	<h3 style="margin-top: 0;"><span><?php _e('Export sign-up attempts', 'mailchimp-for-wp'); ?></span></h3>
	<div class="inside">
		<form method="POST">
			<input type="hidden" name="_mc4wp_action" value="log_export" />
			<?php wp_nonce_field( '_mc4wp_action', '_wpnonce' ); ?>
			<p>
				<?php _e('Use the following button to export your entire log to a CSV file.', 'mailchimp-for-wp'); ?>
			</p>
			<p>
				<label for="start_year" class="screen-reader-text"><?php _e('Start year', 'mailchimp-for-wp'); ?></label>
				<select name="start_year" id="start_year">
					<option disabled><?php _e('Year'); ?></option>
					<?php for ($i = $begin_year; $i <= $current_year; $i++) {
    ?>
						<option><?php echo $i; ?></option>
					<?php
} ?>
				</select>

				<label for="start_month" class="screen-reader-text"><?php _e('Start month', 'mailchimp-for-wp'); ?></label>
				<select name="start_month" id="start_month">
					<option disabled><?php _e('Month'); ?></option>
					<?php foreach (range(1, 12) as $month_number) {
        ?>
						<option value="<?php echo $month_number; ?>"><?php echo $month_number; ?></option>
					<?php
    }?>
				</select>
				<?php _e('to', 'mailchimp-for-wp'); ?>

				<label for="end_year" class="screen-reader-text"><?php _e('End year', 'mailchimp-for-wp'); ?></label>
				<select name="end_year" id="end_year">
					<option disabled><?php _e('Year'); ?></option>
					<?php for ($i = $begin_year; $i <= $current_year; $i++) {
        ?>
						<option <?php selected($i, $current_year); ?>><?php echo $i; ?></option>
					<?php
    }
                    ?>
				</select>

				<label for="end_month" class="screen-reader-text"><?php _e('End month', 'mailchimp-for-wp'); ?></label>
				<select name="end_month" id="end_month">
					<option disabled><?php _e('Month'); ?></option>
					<?php foreach (range(1, 12) as $month_number) {
                        ?>
						<option value="<?php echo $month_number; ?>" <?php selected($month_number, $current_month); ?>><?php echo $month_number; ?></option>
					<?php
                    }?>
				</select>
			</p>

			<p>
				<input type="submit" class="button" value="<?php esc_attr_e('Export to CSV', 'mailchimp-for-wp'); ?>" />
			</p>
		</form>
	</div><!-- .inside -->
</div>
</div>
PK     M\8    (  logging/views/admin-reports-advanced.phpnu [        <?php
defined('ABSPATH') or exit;


?>
<div class="metabox-holder">
	<div class="postbox">
		<h3 style="margin-top: 0;"><span><?php _e('Delete all log items', 'mailchimp-for-wp'); ?></span></h3>
		<div class="inside">
			<form method="POST" onsubmit="return confirm('Are you sure?');">
				<input type="hidden" name="_mc4wp_action" value="log_empty" />
				<?php wp_nonce_field( '_mc4wp_action', '_wpnonce' ); ?>
				<p>
					<?php _e('Use the following button to <strong>clear all of your log items at once</strong>.', 'mailchimp-for-wp'); ?>
				</p>
				<p style="margin-bottom: 0">
					<input type="submit" class="button" value="<?php esc_attr_e('Empty Log', 'mailchimp-for-wp'); ?>" />
				</p>
			</form>
		</div><!-- .inside -->
	</div>

	<div class="postbox">
		<h3 style="margin-top: 0;"><span><?php _e('Automatically delete log items', 'mailchimp-for-wp'); ?></span></h3>
		<div class="inside">
			<form method="POST">
				<input type="hidden" name="_mc4wp_action" value="log_set_purge_schedule" />
				<?php wp_nonce_field( '_mc4wp_action', '_wpnonce' ); ?>
				<p>
					<?php _e('Log items which are older than the specified number of days below will be automatically deleted.', 'mailchimp-for-wp'); ?>
				</p>

				<p>
					<label><strong><?php _e('Days', 'mailchimp-for-wp'); ?></strong></label><br />
					<input name="log_purge_days" type="number" step="1" min="1" max="36500" value="<?php echo esc_attr($options['log_purge_days']); ?>" required />
				</p>

				<p style="margin-bottom: 0">
					<input type="submit" class="button button-primary" value="<?php esc_attr_e('Save Changes', 'mailchimp-for-wp'); ?>" />
				</p>
			</form>
		</div><!-- .inside -->
	</div>
</div>
PK     M\y      logging/views/admin-reports.phpnu [        <?php defined('ABSPATH') or exit;

$tabs = array(
    'statistics' => __('Statistics', 'mailchimp-for-wp'),
    'log' => __('Log', 'mailchimp-for-wp'),
    'export' => __("Export", 'mailchimp-for-wp'),
    'advanced' => __('Advanced', 'mailchimp-for-wp'),
);
?>
<div id="mc4wp-admin" class="wrap reports">

	<h1 class="mc4wp-page-title">
		<?php _e('Mailchimp for WordPress', 'mailchimp-for-wp'); ?>: <?php _e('Reports', 'mailchimp-for-wp'); ?>
	</h1>

	<?php settings_errors(); ?>

	<h2 class="nav-tab-wrapper">
		<?php foreach ($tabs as $tab => $name) {
    echo sprintf('<a href="%s" class="nav-tab %s">%s</a>', admin_url('admin.php?page=mailchimp-for-wp-reports&tab=' . $tab), $current_tab === $tab ? 'nav-tab-active' : '', $name);
} ?>
	</h2>

	<br class="clear" />

	<?php

    $tab_file = __DIR__ . "/admin-reports-{$current_tab}.php";

    if (file_exists($tab_file)) {
        include $tab_file;
    }

    ?>

</div>
PK     M\Dv+    (  logging/views/admin-reports-log_item.phpnu [        <?php
defined('ABSPATH') or exit;

/** @var object $item */
/** @var object $list */

?>

<style type="text/css" scoped>

	table {
		font-size: 13px;
		border-collapse: collapse;
		border-spacing: 0;
		background: white;
		width: 100%;
		table-layout: fixed;
	}

	th, td {
		border: 1px solid #ddd;
		padding: 12px;
	}

	th {
		width: 160px;
		font-size: 14px;
		text-align: left;
	}

	pre{
		background: white;
		padding: 20px;
		border: 1px solid #ddd;
	}
</style>
<h2 style="margin-top: 0;"><span><?php esc_html_e('View log item', 'mailchimp-for-wp'); ?></span></h2>

<table>
	<tr>
		<th><?php esc_html_e('Email Address', 'mailchimp-for-wp'); ?></th>
		<td><?php echo esc_html($item->email_address); ?></td>
	</tr>
	<tr>
		<th><?php esc_html_e('List', 'mailchimp-for-wp'); ?></th>
		<td><?php
            echo $list ? sprintf('<a href="https://admin.mailchimp.com/lists/members/?id=%s">%s</a>', $list->web_id, esc_html($list->name)) : 'Unknown list';
            ?>
        </td>
	</tr>
	<tr>
		<th><?php esc_html_e('Merge Fields', 'mailchimp-for-wp'); ?></th>
		<td><?php
            foreach ((array) $item->merge_fields as $tag => $value) {
                if (in_array($tag, array( 'INTERESTS', 'GROUPINGS', 'OPTIN_IP' ))) {
                    continue;
                }

                // address fields and other array style fields
                $value = is_array($value) ? join(', ', $value) : $value;
                printf('<strong>%s</strong>: %s <br />', esc_html($tag), esc_html($value));
            }
            
            if (empty($item->merge_fields)) {
                echo '&mdash;';
            }
            ?>
		</td>
	</tr>
	<tr>
		<th><?php _e('Interests', 'mailchimp-for-wp'); ?></th>
		<td><?php
            $categories = array();

            foreach ((array) $item->interests as $interest_id => $interested) {
                // only show interests which were marked as "true"
                if (! $interested) {
                    continue;
                }

                $category = $this->get_interest_category_by_interest_id($list->id, $interest_id);
                if (!isset($categories[$category->title])) {
                    $categories[$category->title] = array();
                }
                $categories[$category->title][] = $category->interests[$interest_id];
            }

            foreach($categories as $category_name => $interests) {
                echo sprintf('<strong>%s</strong>: %s', $category_name, join(', ', $interests)) . '<br />';
            }

            if (empty($item->interests)) {
                echo '&mdash;';
            }
            ?>
		</td>
	</tr>
	<?php if (strlen($item->status) > 0) { ?>
	<tr>
		<th><?php esc_html_e('Status', 'mailchimp-for-wp'); ?></th>
		<td><?php echo esc_html($item->status); ?></td>
	</tr>
	<?php } // end if status?>
	<?php if (strlen($item->ip_signup) > 0) { ?>
	<tr>
		<th><?php esc_html_e('IP Address', 'mailchimp-for-wp'); ?></th>
		<td><?php echo esc_html($item->ip_signup); ?></td>
	</tr>
	<?php } // end if ip_signup ?>
	<?php if (strlen($item->language) > 0) { ?>
	<tr>
		<th><?php esc_html_e('Language', 'mailchimp-for-wp'); ?></th>
		<td><?php echo esc_html($item->language); ?></td>
	</tr>
	<?php } // end if language ?>
	<?php if (strlen($item->vip) > 0) { ?>
	<tr>
		<th><?php esc_html_e('VIP', 'mailchimp-for-wp'); ?></th>
		<td><?php echo esc_html($item->vip); ?></td>
	</tr>
	<?php } // end if vip?>
	<tr>
		<th><?php esc_html_e('Source', 'mailchimp-for-wp'); ?></th>
		<td><?php echo make_clickable(strip_tags($item->url)); ?></td>
	</tr>
	<tr>
		<th><?php esc_html_e('Method', 'mailchimp-for-wp'); ?></th>
		<td><?php echo $item->type; // TODO: Use pretty name here.?></td>
	</tr>
	<tr>
		<th><?php esc_html_e('Datetime', 'mailchimp-for-wp'); ?></th>
		<td><?php echo mc4wp_logging_gmt_date_format($item->datetime); ?></td>
	</tr>
</table>

<p>
	<a href="<?php echo admin_url('admin.php?page=mailchimp-for-wp-reports&tab=log'); ?>">&leftarrow; <?php esc_html_e('Back to log overview', 'mailchimp-for-wp'); ?></a>
</p>

<?php

if (WP_DEBUG) {
    echo '<h4>' . __('Raw', 'mailchimp-for-wp') . '</h4>';
    echo '<pre>';
    echo version_compare(PHP_VERSION, '5.4', '>=') ? json_encode($item->to_json(), JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT) : json_encode($item->to_json());
    echo '</pre>';
}
PK     M\|^    #  logging/views/admin-reports-log.phpnu [        <?php defined('ABSPATH') or exit;

/**
 * @var MC4WP_Log_Table $table
 */
?>

<?php $table->views(); ?>
<form method="get" action="<?php echo admin_url('admin.php'); ?>">
    <input type="hidden" name="page" value="mailchimp-for-wp-reports" />
    <input type="hidden" name="tab" value="log" />
	<?php $table->search_box('search', 'mc4wp-log-search'); ?>
	<?php $table->display(); ?>
</form>PK     M\M  M  *  logging/views/admin-reports-statistics.phpnu [        <?php defined('ABSPATH') or exit;


/**
 * @var MC4WP_Graph $graph
 */
?>

    <form method="get">
        <div class="tablenav top">
            <div class="alignleft actions">
                <input type="hidden" name="page" value="mailchimp-for-wp-reports" />

                <select id="mc4wp-graph-range" name="range">
					<option value="today" <?php selected($graph->range, 'today'); ?>><?php _e('Today', 'mailchimp-for-wp'); ?></option>
					<option value="yesterday" <?php selected($graph->range, 'yesterday'); ?>><?php _e('Yesterday', 'mailchimp-for-wp'); ?></option>
					<option value="this_week" <?php selected($graph->range, 'this_week'); ?>><?php _e('This Week', 'mailchimp-for-wp'); ?></option>
					<option value="last_week" <?php selected($graph->range, 'last_week'); ?>><?php _e('Last Week', 'mailchimp-for-wp'); ?></option>
					<option value="this_month" <?php selected($graph->range, 'this_month'); ?>><?php _e('This Month', 'mailchimp-for-wp'); ?></option>
					<option value="last_month" <?php selected($graph->range, 'last_month'); ?>><?php _e('Last Month', 'mailchimp-for-wp'); ?></option>
					<option value="this_quarter" <?php selected($graph->range, 'this_quarter'); ?>><?php _e('This Quarter', 'mailchimp-for-wp'); ?></option>
					<option value="last_quarter" <?php selected($graph->range, 'last_quarter'); ?>><?php _e('Last Quarter', 'mailchimp-for-wp'); ?></option>
					<option value="this_year" <?php selected($graph->range, 'this_year'); ?>><?php _e('This Year', 'mailchimp-for-wp'); ?></option>
					<option value="last_year" <?php selected($graph->range, 'last_year'); ?>><?php _e('Last Year', 'mailchimp-for-wp'); ?></option>
					<option value="custom" <?php selected($graph->range, 'custom'); ?>><?php _e('Custom', 'mailchimp-for-wp'); ?></option>
                </select>

				<div id="mc4wp-graph-custom-range-options" <?php if ($graph->range !== 'custom') {
    ?>style="display:none;"<?php
} ?>>
                    <span><?php _e('From', 'mailchimp-for-wp'); ?> </span>

					<label for="start_day" class="screen-reader-text"><?php _e('Start day', 'mailchimp-for-wp'); ?></label>
                    <select name="start_day" id="start_day">
	                    <option disabled><?php _e('Day'); ?></option>
						<?php for ($day = 1; $day <= 31; $day++) {
        ?>
							<option <?php selected($start_day, $day); ?>><?php echo $day++; ?></option>
						<?php
    } ?>
                    </select>
					<label for="start_month" class="screen-reader-text"><?php _e('Start month', 'mailchimp-for-wp'); ?></label>
					<select name="start_month" id="start_month">
						<option disabled><?php _e('Month'); ?></option>
						<?php foreach (range(1, 12) as $month_number) {
        ?>
							<option value="<?php echo $month_number; ?>" <?php selected($start_month, $month_number); ?>><?php echo $month_number; ?></option>
						<?php
    }?>
                    </select>

					<label for="start_year" class="screen-reader-text"><?php _e('Start year', 'mailchimp-for-wp'); ?></label>
					<select name="start_year" id="start_year">
						<option disabled><?php _e('Year'); ?></option>
	                    <?php foreach (range(2013, date('Y')) as $year) {
        ?>
		                    <option value="<?php echo $year; ?>" <?php selected($start_year, $year); ?>><?php echo $year; ?></option>
	                    <?php
    } ?>
                    </select>
                    <span><?php _e('To', 'mailchimp-for-wp'); ?> </span>

					<label for="end_day" class="screen-reader-text"><?php _e('End day', 'mailchimp-for-wp'); ?></label>
					<select name="end_day" id="end_day">
						<option disabled><?php _e('Day'); ?></option>
						<?php for ($day = 1; $day <= 31; $day++) {
        ?>
							<option <?php selected($end_day, $day); ?>><?php echo $day; ?></option>
						<?php
    } ?>
                    </select>

					<label for="end_month" class="screen-reader-text"><?php _e('End month', 'mailchimp-for-wp'); ?></label>
					<select name="end_month" id="end_month">
						<option disabled><?php _e('Month'); ?></option>
						<?php foreach (range(1, 12) as $month_number) {
        ?>
							<option value="<?php echo $month_number; ?>" <?php selected($end_month, $month_number); ?>><?php echo $month_number; ?></option>
						<?php
    }?>
                    </select>

					<label for="end_year" class="screen-reader-text"><?php _e('End year', 'mailchimp-for-wp'); ?></label>
					<select name="end_year" id="end_year">
						<option disabled><?php _e('Year'); ?></option>
	                    <?php foreach (range(2013, date('Y')) as $year) {
        ?>
		                    <option value="<?php echo $year; ?>" <?php selected($end_year, $year); ?>><?php echo $year; ?></option>
	                    <?php
    } ?>
                    </select>
                </div>
                <input type="submit" class="button-secondary" value="<?php esc_attr_e('Filter', 'mailchimp-for-wp'); ?>">
            </div>
        </div>
    </form>

    <?php if (empty($graph->datasets)) { ?>
        <p>No data to show for the selection time period.</p>
    <?php } else { ?>
    <canvas id="mc4wp-graph" style=""></canvas>
    <?php } ?>

PK     M\(3  3  2  logging/views/admin-reports-log_item_not_found.phpnu [        <?php
defined('ABSPATH') or exit;
?>

<h2 style="margin-top: 0;"><span><?php esc_html_e('Item not found', 'mailchimp-for-wp'); ?></span></h2>

<p><?php printf(__('Sorry, no item with ID %d exists.', 'mailchimp-for-wp'), intval($_GET['id'])); ?></p>

<p><a href="javascript:history.go(-1);">Go back</a>.</p>
PK     M\X)  )    logging/logging.phpnu [        <?php

defined('ABSPATH') or exit;

function _mc4wp_premium_bootstrap_logging()
{
    /*
    * Do not run if logging is disabled.
    * This allows people to disable all logging by adding the following to their wp-config.php or functions.php file.
    *
    * 	define('MC4WP_LOGGING', false);
    *
    */
    if (defined('MC4WP_LOGGING') && ! MC4WP_LOGGING) {
        return false;
    }

    require __DIR__ . '/includes/functions.php';

    if (is_admin() && (!defined('DOING_AJAX') || !DOING_AJAX)) {
        $plugin = new MC4WP_Plugin(__FILE__, MC4WP_PREMIUM_VERSION);
        $logging_admin = new MC4WP_Logging_Admin($plugin);
        $logging_admin->add_hooks();
    }

    $logger = new MC4WP_Logger();
    $logger->add_hooks();
}

add_action('after_setup_theme', '_mc4wp_premium_bootstrap_logging');
PK     M\QF        logging/README.mdnu [        ### Mailchimp for WordPress - Logging

This add-on plugin for [Mailchimp for WordPress](https://www.mc4wp.com/) will keep track of (log) all sign-up requests.PK     M\j?~    .  email-notifications/includes/class-factory.phpnu [        <?php

/**
 * Class MC4WP_Form_Notification_Factory
 *
 * @ignore
 */
class MC4WP_Form_Notification_Factory
{
    public function add_hooks()
    {
        add_filter('mc4wp_form_settings', array( $this, 'settings' ));
        add_action('mc4wp_form_subscribed', array( $this, 'send_form_notification' ), 10, 4);
        add_action('mc4wp_form_unsubscribed', array( $this, 'send_form_notification' ), 10, 2);
    }

    /**
     * @param array $settings
     *
     * @return array
     */
    public function settings($settings)
    {
        $defaults = array(
            'enabled' => 0,
            'subject' => 'New form submission - Mailchimp for WordPress',
            'recipients' => get_bloginfo('admin_email'),
            'message_body' => 'Form was submitted with the following data.' . "\r\n\r\n" . '[_ALL_]',
            'content_type' => 'text/html',
        );

        // make sure container is an array
        if (empty($settings['email_notification'])) {
            $settings['email_notification'] = array();
        }

        // merge with default settings
        $settings['email_notification'] = array_merge($defaults, $settings['email_notification']);

        return $settings;
    }

    /**
     * @param MC4WP_Form $form
     * @param string $email_address
     * @param array $data
     * @param MC4WP_MailChimp_Subscriber[] $map
     * @return bool
     */
    public function send_form_notification(MC4WP_Form $form, $email_address = '', $data = array(), $map = array())
    {
        $email_settings = $form->settings['email_notification'];
        if (! $email_settings['enabled']) {
            return false;
        }

        $email = new MC4WP_Email_Notification(
            $email_settings['recipients'],
            $email_settings['subject'],
            $email_settings['message_body'],
            $email_settings['content_type'],
            $form,
            $map
        );

        $email->send();

        // write info to log
        $this->get_log()->info(sprintf('Form %d > Sent email notification to %s', $form->ID, $email->get_recipients()));
    }

    /**
     * @return MC4WP_Debug_Log
     */
    private function get_log()
    {
        return mc4wp('log');
    }
}
PK     M\
  
  ,  email-notifications/includes/class-admin.phpnu [        <?php

/**
 * Class MC4WP_Form_Notifications_Admin
 *
 * @ignore
 * @access private
 */
class MC4WP_Form_Notifications_Admin
{

    /**
     * @var string
     */
    protected $plugin_file;

    /**
     * MC4WP_Form_Notifications_Admin constructor.
     *
     * @param string $plugin_file
     */
    public function __construct($plugin_file)
    {
        $this->plugin_file = $plugin_file;
    }

    /**
     * Add hooks
     */
    public function add_hooks()
    {
        add_action('admin_init', array( $this, 'maybe_run_upgrade_routines' ));
        add_action('mc4wp_admin_enqueue_assets', array( $this, 'enqueue_assets' ));
        add_filter('mc4wp_admin_edit_form_tabs', array( $this, 'add_tab' ));
        add_action('mc4wp_admin_edit_form_output_emails_tab', array( $this, 'output_settings' ), 10, 2);
        add_filter('mc4wp_form_sanitized_data', array( $this, 'sanitize_data' ), 10, 2);
    }

    /**
     * @param        $suffix
     * @param string $page
     */
    public function enqueue_assets($suffix = '', $page = '')
    {
        if (empty($_GET['view']) || $_GET['view'] !== 'edit-form') {
            return;
        }

        wp_enqueue_script('mc4wp-email-notifications', plugins_url("/assets/js/admin.js", $this->plugin_file), array( 'mc4wp-forms-admin' ), MC4WP_PREMIUM_VERSION, true);
    }

    /**
     * Maybe run upgrade routines
     */
    public function maybe_run_upgrade_routines()
    {
        $from_version = get_option('mc4wp_email_notifications_version', 0);
        $to_version = MC4WP_PREMIUM_VERSION;

        // we're at the specified version already
        if (version_compare($from_version, $to_version, '>=')) {
            return;
        }

        $upgrade_routines = new MC4WP_Upgrade_Routines($from_version, $to_version, dirname($this->plugin_file) . '/migrations');
        $upgrade_routines->run();
        update_option('mc4wp_email_notifications_version', $to_version);
    }

    /**
     * @param array $tabs
     *
     * @return array
     */
    public function add_tab($tabs)
    {
        $tabs['emails'] = __('Emails', 'mailchimp-for-wp');
        return $tabs;
    }

    /**
     * @param array $opts
     * @param MC4WP_Form $form
     */
    public function output_settings($opts, $form)
    {
        $opts = $opts['email_notification'];
        include dirname($this->plugin_file) . '/views/settings.php' ;
    }

    /**
     * @param array $data
     * @param array $raw_data
     *
     * @return array
     */
    public function sanitize_data($data, $raw_data)
    {
        if (isset($data['settings']['email_copy_receiver'])) {
            $data['settings']['email_copy_receiver'] = sanitize_text_field($data['settings']['email_copy_receiver']);
        }

        return $data;
    }
}
PK     M\c%yv32  32  9  email-notifications/includes/class-email-notification.phpnu [        <?php

/**
 * Class MC4WP_Email_Notification
 *
 * @access private
 */
class MC4WP_Email_Notification
{

    /**
     * @var mixed Recipients of the email notification
     */
    protected $recipients;

    /**
     * @var string Message of the email
     */
    protected $message_body = '';

    /**
     * @var string Email subject
     */
    protected $subject = '';

    /**
     * @var MC4WP_Form Form this notification is set-up for
     */
    protected $form;

    /**
     * @var string Content type of the email
     */
    protected $content_type = 'text/html';

    /**
     * @var MC4WP_MailChimp_Subscriber[]
     */
    protected $map;

    /**
     * @var array
     */
    protected $data;

	/**
	 * @var array
	 */
    protected $raw_data;

    /**
     * @param string $recipients
     * @param string $subject
     * @param string $message_body
     * @param string $content_type
     * @param MC4WP_Form $form
     * @param MC4WP_MailChimp_Subscriber[] $map
     */
    public function __construct($recipients, $subject, $message_body, $content_type, MC4WP_Form $form, array $map = array())
    {
        $this->recipients = $recipients;
        $this->subject = $subject;
        $this->content_type = $content_type;
        $this->message_body = $message_body;
        $this->form = $form;
        $this->data = method_exists($form, 'get_data') ? $form->get_data() : $form->data;
        $this->raw_data = method_exists($form, 'get_raw_data') ? array_change_key_case($form->get_raw_data(), CASE_UPPER) : $this->data;
        $this->map = $map;
    }

    /**
     * @return string
     */
    public function get_recipients()
    {
        $form = $this->form;

        // parse tags in receivers
        $recipients = $this->parse_tags($this->recipients);

        /**
         * Filters the recipients of the email notification for forms just before it is sent.
         *
         * @param string $recipients
         * @param MC4WP_Form $form
         */
        $recipients = (string) apply_filters('mc4wp_form_email_notification_recipients', $recipients, $form);

        return $recipients;
    }

    /**
     * @return string
     */
    public function get_subject()
    {
        $form = $this->form;

        // parse tags in subject
        $subject = $this->parse_tags($this->subject);

        /**
         * Filters the subject line of the email notification just before it is sent.
         *
         * @param string $subject
         * @param MC4WP_Form $form
         */
        $subject = (string) apply_filters('mc4wp_form_email_notification_subject', $subject, $form);

        return $subject;
    }

    /**
     * @return string
     */
    public function get_message()
    {
        $form = $this->form;

        // parse tags in message body
        $message = $this->parse_tags($this->message_body);

        // add <br> tags when content type is set to HTML
        if ($this->content_type === 'text/html') {
            $message = nl2br($message);
        }

        /**
         * Filters the message body of the email notification for forms just before it is sent.
         *
         * @param string $message
         * @param MC4WP_Form $form
         */
        $message = (string) apply_filters('mc4wp_form_email_notification_message', $message, $form);

        return $message;
    }

    /**
     * Get email headers
     *
     * @return array
     */
    public function get_headers()
    {
        $form = $this->form;

        $headers = array(
            'Content-Type' => $this->content_type,
        );


        /**
         * Filters the email headers for the email notification for forms.
         *
         * @param array $headers
         * @param MC4WP_Form $form
         */
        $headers = (array) apply_filters('mc4wp_form_email_notification_headers', $headers, $form);

        $headers_i = array();
        foreach ($headers as $key => $value) {
            // if key is a string, use that as header prefix
            if (is_string($key)) {
                $headers_i[] = sprintf("%s: %s", $key, $value);
            } else {
                $headers_i[] = $value;
            }
        }

        return $headers_i;
    }

    /**
     * Get email attachments
     *
     * @return array
     */
    public function get_attachments()
    {
        $form = $this->form;
        $attachments = array();

        /**
         * Filters the attachments to add to the email notification for forms.
         *
         * @param array $attachments
         * @param MC4WP_Form $form
         */
        return (array) apply_filters('mc4wp_form_email_notification_attachments', $attachments, $form);
    }

    /**
     * Send the email
     *
     * @return bool
     */
    public function send()
    {
        return wp_mail(
            $this->get_recipients(),
            $this->get_subject(),
            $this->get_message(),
            $this->get_headers(),
            $this->get_attachments()
        );
    }

    /**
     * Returns a readable & sanitized presentation of the value
     *
     * @param mixed $value
     *
     * @return string
     */
    private function readable_value($value)
    {
        if (is_array($value)) {

            // test if we can turn this array into a string..
            $plain = array_values($value);
            if (empty($plain) || is_array($plain[0])) {
                return '';
            }

            $value = join(', ', (array) $value);
        }

        // Format as date if value looks like a date
        if (is_string($value) && strlen($value) >= 8 && strlen($value) <= 10 && preg_match('/\d{4}[-\/]\d{1,2}[-\/]\d{1,2}|\d{1,2}[-\/]\d{1,2}[-\/]\d{4}/', $value) > 0 && ($timestamp = strtotime($value)) && $timestamp != false) {
            $value = date(get_option('date_format'), $timestamp);
        }

        return esc_html($value);
    }

    /**
     * @param string $key
     * @param null $subkey
     *
     * @return string
     */
    private function replace_field_tag($key, $subkey = null)
    {
        // return empty string if value not known
        if (isset($this->data[ $key ])) {
			$value = $this->data[ $key ];
        } else if (isset($this->raw_data[$key])) {
			$value = $this->raw_data[ $key ];
		} else {
        	return '';
		}

        // do we need subkey?
        if ($subkey && is_array($value)) {

            // uppercase array keys as mc4wp only uppercases top-level array keys
            $value = array_change_key_case($value, CASE_UPPER);
            $value = isset($value[ $subkey ]) ? $this->readable_value($value[ $subkey ]) : '';

            return $value;
        }

        return $this->readable_value($value);
    }

    /**
     * @param string $key
     * @param string $subkey
     * @return string
     */
    private function replace_interests_tag($key, $subkey)
    {
        // return empty string if value not known
        if (! isset($this->data[ $key ]) || empty($this->map)) {
            return '';
        }

        $mailchimp = new MC4WP_MailChimp();
        $interest_names = array();
        $interest_category_id = strtolower($subkey);

        // version 4.x gives us a map of list ids => subscriber objects
        foreach ($this->map as $list_id => $subscriber_data) {
            $list = $mailchimp->get_list($list_id);
            if (!$list) {
                continue;
            }

            $interest_category = $this->get_interest_category_by_interest_or_category_id($list_id, $interest_category_id);

            // interests
            foreach ($subscriber_data->interests as $interest_id => $interested) {
                if (!$interested) {
                    continue;
                }

                // skip if this is interest from other category
                if (!isset($interest_category->interests[$interest_id])) {
                    continue;
                }

                $interest_name = $interest_category->interests[$interest_id];
                $interest_names[] = $interest_name;
            }
        }

        return $this->readable_value($interest_names);
    }

    /**
     * @param array $matches
     * @return string
     */
    private function replace_tag($matches)
    {
        $key = strtoupper($matches[1]);
        $subkey = isset($matches[2]) ? strtoupper($matches[2]) : null;

        // catch-all tag
        if ($key === '_ALL_') {
            return $this->replace_summary_tag();
        }

        // [INTERESTS:1234]
        if ($key === 'INTERESTS') {
            return $this->replace_interests_tag($key, $subkey);
        }

        // [_MC4WP_LISTS]
        if ($key === '_MC4WP_LISTS') {
            return $this->replace_lists_tag();
        }

        // field tag
        return $this->replace_field_tag($key, $subkey);
    }

    /**
    * @return string
    */
    private function replace_lists_tag()
    {
        $list_names = array();
        $mailchimp = new MC4WP_MailChimp();

        foreach ($this->map as $list_id => $subscriber_data) {
            $list = $mailchimp->get_list($list_id);
            $list_names[] = $list ? $list->name : 'Unknown list';
        }

        return join(', ', $list_names);
    }

    /**
     * @param $string
     *
     * @return mixed
     */
    private function parse_tags($string)
    {
        $string = preg_replace_callback('/\[(\w+)(?:\:(\w+)){0,1}\]/', array( $this, 'replace_tag' ), $string);
        return $string;
    }

    private function get_field_by_tag($list_id, $field_tag) {
        $mailchimp = new MC4WP_MailChimp();

        // method requires Mailchimp for WordPress version 4.6.0
        if (! method_exists($mailchimp, 'get_list_merge_fields')) {
            return null;
        }

        $merge_fields = $mailchimp->get_list_merge_fields($list_id);
        foreach($merge_fields as $field) {
            if ($field->tag === $field_tag) {
                return $field;
            }
        }

        return null;
    }

    private function get_interest_category_by_interest_or_category_id($list_id, $interest_or_category_id) {
        $mailchimp = new MC4WP_MailChimp();

        // method requires Mailchimp for WordPress version 4.6.0
        if (! method_exists($mailchimp, 'get_list_interest_categories')) {
            return null;
        }
        $interest_categories = $mailchimp->get_list_interest_categories($list_id);
        foreach($interest_categories as $category) {
            if ($category->id === $interest_or_category_id || isset($category->interests[$interest_or_category_id])) {
                return $category;
            }
        }

        return null;
    }

    /**
     * @return string
     */
    private function replace_summary_tag()
    {
        if (empty($this->map)) {
            return '';
        }

        $string = '';
        $mailchimp = new MC4WP_MailChimp();

        // for BC with Mailchimp for WP 3.x
        $plain_map = array_values($this->map);
        if (! empty($plain_map) && ! $plain_map[0] instanceof MC4WP_MailChimp_Subscriber) {
            foreach ($this->map as $key => $value) {
                $string .= sprintf('<strong>%s</strong>: %s', $key, $this->readable_value($value)) . PHP_EOL;
            }

            return $string;
        }

        // version 4.x gives us a map of list ids => subscriber objects
        foreach ($this->map as $list_id => $subscriber_data) {
            $list = $mailchimp->get_list($list_id);

            $string .= sprintf('<h4>%s</h4>', $list ? $list->name : 'Unknown list') . PHP_EOL . PHP_EOL;
            $string .= sprintf('<strong>%s</strong>: %s <br />', __('Email Address', 'mailchimp-for-wp'), $subscriber_data->email_address) . PHP_EOL;

            // merge fields
            foreach ($subscriber_data->merge_fields as $tag => $value) {
                $field = $this->get_field_by_tag($list_id, $tag);
                $string .= sprintf('<strong>%s</strong>: %s <br />', $field ? $field->name : $tag, $this->readable_value($value)) . PHP_EOL;
            }

            // interests
            foreach ($subscriber_data->interests as $interest_id => $interested) {
                if (!$interested) {
                    continue;
                }

                $interest_category = $this->get_interest_category_by_interest_or_category_id($list_id, $interest_id);
                if ($interest_category && isset($interest_category->interests[$interest_id])) {
                    $string .= sprintf('<strong>%s</strong>: %s <br />', $interest_category->title, $interest_category->interests[$interest_id]) . PHP_EOL;
                }
            }

            $string .= '<br />' . PHP_EOL . PHP_EOL;
        }

        if ($this->content_type === 'text/plain') {
            $string = strip_tags($string);
        }

        return $string;
    }
}
PK     M\-I`    &  email-notifications/assets/js/admin.jsnu [        !function t(o,i,u){function c(r,e){if(!i[r]){if(!o[r]){var n="function"==typeof require&&require;if(!e&&n)return n(r,!0);if(a)return a(r,!0);throw(e=new Error("Cannot find module '"+r+"'")).code="MODULE_NOT_FOUND",e}n=i[r]={exports:{}},o[r][0].call(n.exports,function(e){return c(o[r][1][e]||e)},n,n.exports,t,o,i,u)}return i[r].exports}for(var a="function"==typeof require&&require,e=0;e<u.length;e++)c(u[e]);return c}({1:[function(e,r,n){"use strict";var t=document.getElementById("email-message-template-tags"),o=[];function i(){var e=mc4wp.forms.editor.query("[name]");o=["_ALL_"];for(var r=0;r<e.length;r++){var n=(n=e[r].getAttribute("name").toUpperCase()).replace("[]","").replace(/\[(\w+)\]/,":$1");o.indexOf(n)<0&&o.push(n)}t.innerHTML=o.map(function(e){return'<input readonly style="background: transparent; border: 0;" color: #222; onclick="this.select();" onfocus="this.select()" value="['+e+']" />'}).join(" ")}window.addEventListener("load",function(){mc4wp.forms.editor.on("change",mc4wp.helpers.debounce(i,1e3)),i()})},{}]},{},[1]);PK     M\3    *  email-notifications/assets/src/js/admin.jsnu [        'use strict';

var mount = document.getElementById( 'email-message-template-tags' );
var tags = [];
var tagOpen = '[';
var tagClose = ']';

function updateAvailableEmailTags() {
	var fields = mc4wp.forms.editor.query('[name]');
	tags = [ '_ALL_' ];

	for( var i=0; i<fields.length; i++) {

		var tagName = fields[i].getAttribute('name').toUpperCase();

		// strip empty arrays []
		// add in semicolon for named array keys
		tagName = tagName
			.replace('[]','')
			.replace(/\[(\w+)\]/, ':$1');


		if( tags.indexOf( tagName ) < 0 ) {
			tags.push( tagName );
		}

	}

	mount.innerHTML = tags.map(function(tagName) {
		return '<input readonly style="background: transparent; border: 0;" color: #222; onclick="this.select();" onfocus="this.select()" value="' + tagOpen + tagName + tagClose + '" />';
	}).join(' ');
}

window.addEventListener('load', function() {
	mc4wp.forms.editor.on('change', mc4wp.helpers.debounce(updateAvailableEmailTags, 1000 ) );
	updateAvailableEmailTags();
});PK     M\O    <  email-notifications/migrations/3.0.5-more-email-settings.phpnu [        <?php

defined('ABSPATH') or exit;

// find forms
$posts = get_posts(
    array(
        'post_type' => 'mc4wp-form',
        'post_status' => 'publish',
        'numberposts' => -1
    )
);

// loop through forms
foreach ($posts as $post) {

    // get form options from post meta directly
    $options = (array) get_post_meta($post->ID, '_mc4wp_settings', true);

    $email_notification_options = array();

    // transfer email settings to new format
    if (isset($options['send_email_copy'])) {
        $email_notification_options['enabled'] = $options['send_email_copy'];
        unset($options['send_email_copy']);
    }

    if (! empty($options['email_copy_receiver'])) {
        $email_notification_options['recipients'] = $options['email_copy_receiver'];
        unset($options['email_copy_receiver']);
    }

    // push into options array
    $options['email_notification'] = $email_notification_options;

    // update post meta
    update_post_meta($post->ID, '_mc4wp_settings', $options);
}
PK     M\5+a    &  email-notifications/views/settings.phpnu [        <?php defined('ABSPATH') or exit; ?>
<h2><?php echo __('Email Notifications', 'mailchimp-for-wp'); ?></h2>

<table class="form-table">
	<tr valign="top">
		<th scope="row">
			<?php _e('Enable?', 'mailchimp-for-wp'); ?>
		</th>
		<td>
			<label><input type="radio" name="mc4wp_form[settings][email_notification][enabled]" value="1" <?php checked($opts['enabled'], 1); ?> /> <?php _e('Yes'); ?></label> &nbsp;
			<label><input type="radio" name="mc4wp_form[settings][email_notification][enabled]" value="0" <?php checked($opts['enabled'], 0); ?>  /> <?php _e('No'); ?></label>
			<p class="description"><?php _e('Tick "yes" to send an email whenever this form is successfully used.', 'mailchimp-for-wp'); ?></p>
		</td>
	</tr>

	<?php $config = array( 'element' => 'mc4wp_form[settings][email_notification][enabled]', 'value' => 1, 'hide' => false ); ?>
	<tbody data-showif="<?php echo esc_attr(json_encode($config)); ?>">

		<!-- To -->
		<tr valign="top">
			<th scope="row">
				<label for="mc4wp_form_email_notification_recipients">
					<?php _e('To', 'mailchimp-for-wp'); ?>
				</label>
			</th>
			<td>
				<input type="text" class="widefat" name="mc4wp_form[settings][email_notification][recipients]" value="<?php echo esc_attr($opts['recipients']); ?>" id="mc4wp_form_email_notification_recipients" />
				<p class="description"><?php _e('Separate multiple email addresses with a comma.', 'mailchimp-for-wp'); ?></p>
			</td>
		</tr>

		<!-- Subject -->
		<tr valign="top">
			<th scope="row">
				<label for="mc4wp_form_email_notification_subject">
					<?php _e('Subject', 'mailchimp-for-wp'); ?>
				</label>
			</th>
			<td>
				<input type="text" class="widefat" name="mc4wp_form[settings][email_notification][subject]" value="<?php echo esc_attr($opts['subject']); ?>" id="mc4wp_form_email_notification_subject" />
			</td>
		</tr>

		<!-- Message Body -->
		<tr valign="top">
			<th scope="row">
				<label for="mc4wp_form_email_notification_message_body">
					<?php _e('Message Body', 'mailchimp-for-wp'); ?>
				</label>

				<p style="font-weight: normal;"><?php _e('Available tags:', 'mailchimp-for-wp'); ?></p>
				<p id="email-message-template-tags" style="margin-top: 20px; font-weight: normal;"></p>
			</th>
			<td>
				<p>
					<textarea class="widefat" rows="<?php echo(substr_count($opts['message_body'], PHP_EOL) + 8); ?>" name="mc4wp_form[settings][email_notification][message_body]" id="mc4wp_form_email_notification_message_body"><?php echo esc_textarea($opts['message_body']); ?></textarea>
				</p>

				<p>
					<label>
						<input type="hidden" name="mc4wp_form[settings][email_notification][content_type]" value="text/plain" />
						<input type="checkbox" name="mc4wp_form[settings][email_notification][content_type]" value="text/html" <?php checked($opts['content_type'], 'text/html'); ?> >
						<?php _e('Use HTML content type?', 'mailchimp-for-wp'); ?>
					</label>
				</p>

			</td>
		</tr>



	</tbody>
</table>

<?php submit_button(); ?>
PK     M\tݕ        email-notifications/README.mdnu [        ### Mailchimp for WordPress - Email Notifications

This add-on plugin adds an email notification option to Mailchimp for WordPress its sign-up forms.PK     M\3Pb[    +  email-notifications/email-notifications.phpnu [        <?php

defined('ABSPATH') or exit;

$factory = new MC4WP_Form_Notification_Factory();
$factory->add_hooks();

if (is_admin() && (! defined('DOING_AJAX') || ! DOING_AJAX)) {
    $admin = new MC4WP_Form_Notifications_Admin(__FILE__);
    $admin->add_hooks();
}
PK     M\\:  :  (  ajax-forms/includes/class-ajax-forms.phpnu [        <?php

/**
 * Class MC4WP_Form_Ajaxifier
 *
 * @ignore
 */
class MC4WP_AJAX_Forms
{

    /**
     * @var string
     */
    protected $plugin_file;

    /**
     * @var bool Is the script enqueued already?
     */
    protected $is_script_enqueued = false;

    /**
     * @param string $plugin_file
     */
    public function __construct($plugin_file)
    {
        $this->plugin_file = $plugin_file;
    }

    public function add_hooks()
    {
        add_filter('mc4wp_form_css_classes', array( $this, 'form_css_classes' ), 10, 2);
        add_filter('mc4wp_form_settings', array( $this, 'form_settings' ));
        add_action('mc4wp_output_form', array( $this, 'maybe_enqueue_script' ));
        add_action('mc4wp_form_respond', array( $this, 'respond_to_request' ));
    }

    /**
     * @param array $settings
     *
     * @return array
     */
    public function form_settings($settings)
    {
        $defaults = array(
            'ajax' => 1
        );
        $settings = array_merge($defaults, $settings);
        return $settings;
    }

    /**
     * @param            $classes
     * @param MC4WP_Form $form
     *
     * @return array
     */
    public function form_css_classes($classes, MC4WP_Form $form)
    {
        if ($form->settings['ajax']) {
            $classes[] = 'mc4wp-ajax';
        }

        return $classes;
    }

    /**
     * Enqueues the AJAX script whenever a form is outputted with AJAX enabled.
     *
     * This also fetches the "general error" text of the first form it encounters with AJAX enabled. Not optimal, but does the trick.
     *
     * @param MC4WP_Form $form
     */
    public function maybe_enqueue_script(MC4WP_Form $form)
    {
        if (! $form->settings['ajax'] || $this->is_script_enqueued) {
            return;
        }

        wp_enqueue_script('mc4wp-ajax-forms', plugins_url('/assets/js/ajax-forms.js', $this->plugin_file), array( 'mc4wp-forms-api' ), MC4WP_PREMIUM_VERSION, true);

        // default loading character
        $character = "&bull;";

        /**
         * Filters the loading character used for AJAX requests
         *
         * @param string $character
         */
        $loading_character = (string) apply_filters('mc4wp_forms_ajax_loading_character', $character);

        // generate AJAX url
        $ajax_url = add_query_arg(array( 'action' => 'mc4wp-form' ), admin_url('admin-ajax.php'));

        // get error text in BC way
        $error_text = class_exists('MC4WP_API_v3') ? $form->get_message('error') : $form->messages['error'];

        // Print vars required by AJAX script
        $vars = array(
            'loading_character'     => $loading_character,
            'ajax_url'              => $ajax_url,
            'error_text'            => (string) $error_text,
        );
        wp_localize_script('mc4wp-ajax-forms', 'mc4wp_ajax_vars', $vars);

        $this->is_script_enqueued = true;
    }

    /**
     * @param MC4WP_Form $form
     */
    public function respond_to_request(MC4WP_Form $form)
    {

        // do nothing if we're not doing AJAX
        if (! defined('DOING_AJAX') || ! DOING_AJAX) {
            return;
        }

        // clear output, some plugins might have thrown errors by now.
        if (ob_get_level() > 0) {
            ob_end_clean();
        }

        send_origin_headers();
        @header('X-Content-Type-Options: nosniff');
        @header('Content-Type: text/html; charset=' . get_option('blog_charset'));
        send_nosniff_header();
        nocache_headers();

        // Format response using Google JSON Style Guide: https://google.github.io/styleguide/jsoncstyleguide.xml
        $response = array();

        // error
        if ($form->has_errors()) {
            $response['error'] = array(
                'type' => $form->errors[0],
                'message' => $form->get_response_html(),
                'errors' => $form->errors
            );

            wp_send_json($response);
            exit;
        }

        // success
        $data = array(
            'event' => '',
            'message' => $form->get_response_html(),
            'hide_fields' => (bool) $form->settings['hide_after_success']
        );

        // set event: "subscribed", "unsubscribed" or "subscriber_updated"
        if (! empty($form->last_event)) {
            $data['event'] = $form->last_event;
        }

        // set redirect url (if not empty or 0)
        $redirect_url = $form->get_redirect_url();
        if (! empty($redirect_url)) {
            $data['redirect_to'] = $redirect_url;
        }

        $response['data'] = $data;
        wp_send_json($response);
        exit;
    }
}
PK     M\pb    #  ajax-forms/includes/class-admin.phpnu [        <?php

class MC4WP_AJAX_Forms_Admin
{

    /**
     * Add hooks
     */
    public function add_hooks()
    {
        add_action('mc4wp_admin_form_after_behaviour_settings_rows', array( $this, 'show_setting' ), 10, 2);
    }

    /**
     * @param            $opts
     * @param MC4WP_Form $form
     */
    public function show_setting($opts, $form)
    {
        ?>
		<tr valign="top">
			<th scope="row"><?php _e('Enable AJAX form submission?', 'mailchimp-for-wp'); ?></th>
			<td>
				<label>
					<input type="radio" name="mc4wp_form[settings][ajax]" value="1" <?php checked($opts['ajax'], 1); ?> />&rlm;
					<?php _e('Yes'); ?>
				</label> &nbsp;
				<label>
					<input type="radio" name="mc4wp_form[settings][ajax]" value="0" <?php checked($opts['ajax'], 0); ?> />&rlm;
					<?php _e('No'); ?>
				</label> &nbsp;
				<p class="description"><?php _e('Select "yes" if you want to use AJAX (JavaScript) to submit forms.', 'mailchimp-for-wp'); ?></p>
			</td>
		</tr>
		<?php
    }
}
PK     M\sl  l  "  ajax-forms/assets/js/ajax-forms.jsnu [        !function n(o,i,s){function a(t,e){if(!i[t]){if(!o[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(c)return c(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}r=i[t]={exports:{}},o[t][0].call(r.exports,function(e){return a(o[t][1][e]||e)},r,r.exports,n,o,i,s)}return i[t].exports}for(var c="function"==typeof require&&require,e=0;e<s.length;e++)a(s[e]);return a}({1:[function(e,t,r){"use strict";function a(e){return e.innerHTML||e.value}function c(e,t){e.innerHTML?e.innerHTML=t:e.value=t}t.exports=function(t,r){var e,n,o,i=t.querySelector('input[type="submit"], button[type="submit"]');function s(){var e=a(i);c(i,5<=e.length?r:e+" "+r)}return r=null!=(e=r)?e:"·",i&&(n=i.cloneNode(!0)),{start:function(){var e;i?(e=i.getAttribute("data-loading-text"))?c(i,e):(i.style.width=window.getComputedStyle(i).width,c(i,r),o=window.setInterval(s,500)):t.style.opacity="0.5",t.classList&&t.classList.add("mc4wp-loading")},stop:function(){var e;i?(i.style.width=n.style.width,e=a(n),c(i,e),window.clearInterval(o)):t.style.opacity="",t.className=t.className.replace("mc4wp-loading","")}}}},{}],2:[function(n,e,t){!function(e){!function(){"use strict";var t=n("./_form-loader.js"),s=window.mc4wp_ajax_vars,a=!1;function r(n){var o=new t(n.element,s.loading_character);function e(){var r;n.setResponse(""),o.start(),a=!0,(r=new XMLHttpRequest).onreadystatechange=function(){if(r.readyState>=XMLHttpRequest.DONE)if(o.stop(),a=!1,200<=r.status&&r.status<400)try{var e,t=JSON.parse(r.responseText);i("submitted",[n,null]),t.error?(n.setResponse(t.error.message),i("error",[n,t.error.errors])):(e=n.getData(),i("success",[n,e]),i(t.data.event,[n,e]),"updated_subscriber"===t.data.event&&i("subscribed",[n,e,!0]),t.data.hide_fields&&(n.element.querySelector(".mc4wp-form-fields").style.display="none"),n.setResponse(t.data.message),n.element.reset(),t.data.redirect_to&&(window.location.href=t.data.redirect_to))}catch(e){console.error('Mailchimp for WordPress: failed to parse response: "'+e+'"'),n.setResponse('<div class="mc4wp-alert mc4wp-error"><p>'+s.error_text+"</p></div>")}else console.error('MailChimp for WordPress: request error: "'+r.responseText+'"')},r.open("POST",s.ajax_url,!0),r.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),r.setRequestHeader("Accept","application/json"),r.send(n.getSerializedData())}function i(e,t){window.mc4wp.forms.trigger(e,t),window.mc4wp.forms.trigger(t[0].id+"."+e,t)}a||e()}void 0===window.mc4wp?console.warn("Mailchimp for WordPress Premium: Unable to initialize AJAX forms feature because Mailchimp for WordPress core script is not propery loaded."):s.inited||(window.mc4wp.forms.on("submit",function(e,t){if(!(e.element.getAttribute("class").indexOf("mc4wp-ajax")<0)){document.activeElement&&"INPUT"===document.activeElement.tagName&&document.activeElement.blur();try{r(e)}catch(e){return console.error(e),!0}return t.returnValue=!1,t.preventDefault(),!1}}),s.inited=!0)}.call(this)}.call(this,n("_process"))},{"./_form-loader.js":1,_process:3}],3:[function(e,t,r){var n,o,t=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{o="function"==typeof clearTimeout?clearTimeout:s}catch(e){o=s}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return(n=setTimeout)(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}var c,u=[],l=!1,f=-1;function d(){l&&c&&(l=!1,c.length?u=c.concat(u):f=-1,u.length&&p())}function p(){if(!l){for(var e=a(d),t=(l=!0,u.length);t;){for(c=u,u=[];++f<t;)c&&c[f].run();f=-1,t=u.length}c=null,l=!1,!function(t){if(o===clearTimeout)return clearTimeout(t);if((o===s||!o)&&clearTimeout)return(o=clearTimeout)(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function w(){}t.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new m(e,t)),1!==u.length||l||a(p)},m.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=w,t.addListener=w,t.once=w,t.off=w,t.removeListener=w,t.removeAllListeners=w,t.emit=w,t.prependListener=w,t.prependOnceListener=w,t.listeners=function(e){return[]},t.binding=function(e){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(e){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},{}]},{},[2]);PK     M\ˋF  F  (  ajax-forms/assets/src/js/_form-loader.jsnu [        function getButtonText(button) {
    return button.innerHTML ? button.innerHTML : button.value;
}

function setButtonText(button, text) {
    button.innerHTML ? button.innerHTML = text : button.value = text;
}

function Loader(formEl, char) {
    const button = formEl.querySelector('input[type="submit"], button[type="submit"]');
    char = char ?? '\u00B7';
    let originalButton, loadingInterval;

    if ( button ) {
        originalButton = button.cloneNode(true);
    }

    function start() {
        if( button ) {
            const loadingText = button.getAttribute('data-loading-text');
            if (loadingText) {
                // Use text from "data-loading-text" attribute
                setButtonText(button, loadingText);
            } else {
                // Use default loading character (. .. ...)
                button.style.width = window.getComputedStyle(button).width;
                setButtonText(button, char);
                loadingInterval = window.setInterval(tick, 500);
            }
        } else {
            // If form had no button element, change opacity
            formEl.style.opacity = '0.5';
        }

        if (formEl.classList) {
            formEl.classList.add('mc4wp-loading');
        }
    }

    function stop() {
        if (button) {
            button.style.width = originalButton.style.width;
            const text = getButtonText(originalButton);
            setButtonText(button, text);
            window.clearInterval(loadingInterval);
        } else {
            formEl.style.opacity = '';
        }

        formEl.className = formEl.className.replace('mc4wp-loading', '');
    }

    function tick() {
        const text = getButtonText(button);
        setButtonText(button, text.length >= 5 ? char : text + " " + char);
    }

    return { start, stop };
}

module.exports = Loader;
PK     M\]],    &  ajax-forms/assets/src/js/ajax-forms.jsnu [        const Loader = require('./_form-loader.js');
let config = window.mc4wp_ajax_vars;
let busy = false;

function submit( form ) {
	const loader = new Loader(form.element, config['loading_character']);

	function start() {
		// Clear possible errors from previous submit
		form.setResponse('');
		loader.start();
		fire();
	}

	function fire() {
		busy = true;
		const request = new XMLHttpRequest();
		request.onreadystatechange = function() {
			if (request.readyState >= XMLHttpRequest.DONE) {
				clean();

				if (request.status >= 200 && request.status < 400) {
					try {
						let data = JSON.parse(request.responseText);
						process(data);
					} catch(error) {
						console.error( 'Mailchimp for WordPress: failed to parse response: "' + error + '"' );
						form.setResponse('<div class="mc4wp-alert mc4wp-error"><p>'+ config['error_text'] + '</p></div>');
					}
				} else {
					console.error('MailChimp for WordPress: request error: "' + request.responseText + '"');
				}
			}
		};
		request.open('POST', config['ajax_url'], true);
		request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		request.setRequestHeader('Accept', 'application/json');
		request.send(form.getSerializedData());
	}

	function process( response ) {
		trigger('submitted', [form, null]);

		if (response.error) {
			form.setResponse(response.error.message);
			trigger('error', [form, response.error.errors]);
		} else {
			const data  = form.getData();

			// trigger events
			trigger('success', [form, data]);
			trigger( response.data.event, [form, data]);

			// for BC: always trigger "subscribed" event when firing "updated_subscriber" event
			// third boolean parameter indicates this was a BC event
			if( response.data.event === 'updated_subscriber' ) {
                trigger('subscribed', [form, data, true]);
			}

			if( response.data.hide_fields ) {
				form.element.querySelector('.mc4wp-form-fields').style.display = 'none';
			}

			// show success message
			form.setResponse(response.data.message);

			// reset form element
			form.element.reset();

			// maybe redirect to url
			if( response.data.redirect_to ) {
				window.location.href = response.data.redirect_to;
			}
		}
	}

	function trigger(event, args) {
		window.mc4wp.forms.trigger(event, args);
		window.mc4wp.forms.trigger(args[0].id + "." + event, args);
	}

	function clean() {
		loader.stop();
		busy = false;
	}

	// let's do this!
	if( ! busy ) {
		start();
	}
}

// failsafe against including script twice
if ( typeof(window.mc4wp) === "undefined" ) {
	console.warn("Mailchimp for WordPress Premium: Unable to initialize AJAX forms feature because Mailchimp for WordPress core script is not propery loaded.");
} else if (! config['inited'] ) {
	window.mc4wp.forms.on('submit', function (form, event) {
		// does this form have AJAX enabled?
		if (form.element.getAttribute('class').indexOf('mc4wp-ajax') < 0) {
			return;
		}

		// blur active input field
		if (document.activeElement && document.activeElement.tagName === 'INPUT') {
			document.activeElement.blur();
		}

		try {
			submit(form);
		} catch (e) {
			console.error(e);
			return true;
		}

		event.returnValue = false;
		event.preventDefault();
		return false;
	});

	config['inited'] = true;
}
PK     M\\FO  O  )  ajax-forms/assets/src/img/ajax-loader.gifnu [        GIF89a    wwwzzzЂ                                             !NETSCAPE2.0   !Created with ajaxload.info !	
   ,       P  di0l!*`Ƒ5و[<iP),IZ$bH85&x5k <yB !	
   ,       h  GҌh*ਨ@$E}eh @
LcQGBP5 <5UdQ+"g0Ak#A <P70<	0Y8*	#! !	
   ,       `  #(H*
P	-13
:C1KHH.$ٱy j.WD@Y 0H	,0B
kJU?5w|$k\)! !	
   ,       R  di 1@Ck!B`? #E8zBQXcmv" £``UFrp)f! !	
   ,       `  di@E1m]ǹHІ(4 (,F!aH XSm5bDH ab,
%p3c#'"467P&*X/($! !	
   ,       _  diH@@4 ²A"I`>nI0$K7H,-t*E-``1@C7h/1f\)&! ;         PK     M\\FO  O  %  ajax-forms/assets/img/ajax-loader.gifnu [        GIF89a    wwwzzzЂ                                             !NETSCAPE2.0   !Created with ajaxload.info !	
   ,       P  di0l!*`Ƒ5و[<iP),IZ$bH85&x5k <yB !	
   ,       h  GҌh*ਨ@$E}eh @
LcQGBP5 <5UdQ+"g0Ak#A <P70<	0Y8*	#! !	
   ,       `  #(H*
P	-13
:C1KHH.$ٱy j.WD@Y 0H	,0B
kJU?5w|$k\)! !	
   ,       R  di 1@Ck!B`? #E8zBQXcmv" £``UFrp)f! !	
   ,       `  di@E1m]ǹHІ(4 (,F!aH XSm5bDH ab,
%p3c#'"467P&*X/($! !	
   ,       _  diH@@4 ²A"I`>nI0$K7H,-t*E-``1@C7h/1f\)&! ;         PK     M\%u/w  w    ajax-forms/ajax-forms.phpnu [        <?php

defined('ABSPATH') or exit;

// main functionality
require_once __DIR__ . '/includes/class-ajax-forms.php';
$ajax_forms = new MC4WP_AJAX_Forms(__FILE__);
$ajax_forms->add_hooks();

if (is_admin() && (!defined('DOING_AJAX') || !DOING_AJAX)) {
    require_once __DIR__ . '/includes/class-admin.php';
    $admin = new MC4WP_AJAX_Forms_Admin();
    $admin->add_hooks();
}
PK     M\ *7R        ajax-forms/README.mdnu [        ### Mailchimp for WordPress - AJAX Forms

This add-on plugin adds AJAX functionality to Mailchimp for WordPress its sign-up forms.PK     M\;ǋ      licensing/licensing.phpnu [        <?php

if (is_admin() || (defined('DOING_CRON') && DOING_CRON) || (defined('WP_CLI') && WP_CLI)) {
    $api_url = 'https://my.mc4wp.com/api/v2';
    $plugin_slug = 'mc4wp-premium';
    $plugin_file = MC4WP_PREMIUM_PLUGIN_FILE;
    $plugin_version = MC4WP_PREMIUM_VERSION;

    $admin = new MC4WP\Licensing\Admin($plugin_slug, $plugin_file, $plugin_version, $api_url);
    $admin->add_hooks();
}
PK     M\UJ    !  licensing/class-api-exception.phpnu [        <?php

namespace MC4WP\Licensing;

use Exception;

class ApiException extends Exception
{

    /**
     * @var object
     */
    protected $data;

    /**
     * API_Exception constructor.
     *
     * @param string $message
     * @param int $code
     * @param object $data
     */
    public function __construct($message, $code, $data)
    {
        parent::__construct($message, $code);

        $this->data = $data;
    }

    /**
     * @return string
     */
    public function getData()
    {
        return $this->data;
    }

    /**
    * @return string
     */
    public function getApiMessage()
    {
        return $this->data->message;
    }

    /**
     * @return string
     */
    public function getApiCode()
    {
        return $this->data->code;
    }
}
PK     M\w       licensing/views/license-form.phpnu [        
<h3><?php _e('Plugin license', 'mailchimp-for-wp'); ?></h3>

<form method="post">
	<table class="form-table">
		<tr valign="top">
			<th><?php _e('License key', 'mailchimp-for-wp'); ?></th>
			<td>
				<input type="text" class="regular-text" name="mc4wp_license_key" placeholder="<?php esc_attr_e('Enter your license key..', 'mailchimp-for-wp'); ?>" value="<?php echo esc_attr($license->key); ?>" <?php if ($license->activated) {
    echo 'readonly';
} ?> />
				<input class="button" type="submit" name="action" value="<?php echo($license->activated ? 'deactivate' : 'activate'); ?>" />
				<p class="description">
					<?php echo sprintf(__('The license key received when purchasing Mailchimp for WordPress Premium. <a href="%s">You can find it here</a>.', 'mailchimp-for-wp'), 'https://my.mc4wp.com/licenses'); ?>
				</p>
			</td>
		</tr>
		<tr valign="top">
			<th><?php _e('License status', 'mailchimp-for-wp'); ?></th>
			<td>
				<?php
                if ($license->activated) {
                    echo sprintf('<p><span class="mc4wp-status positive">%s</span> - %s</p>', __('ACTIVE', 'mailchimp-for-wp'), __('you are receiving plugin updates', 'mailchimp-for-wp'));
                } else {
                	echo sprintf('<p><span class="mc4wp-status negative">%s</span> - %s</p>', __('INACTIVE', 'mailchimp-for-wp'), __('you are <strong>not</strong> receiving plugin updates right now', 'mailchimp-for-wp'));
                } ?>
			</td>
		</tr>
	</table>

	<p>
		<input type="submit" class="button button-primary" name="action" value="<?php _e('Save Changes'); ?>" />
	</p>

	<input type="hidden" name="_mc4wp_action" value="save_license" />
	<?php wp_nonce_field( '_mc4wp_action', '_wpnonce' ); ?>
</form>
PK     M\[T7  7    licensing/class-api-client.phpnu [        <?php

namespace MC4WP\Licensing;

use Exception;

class Client
{
    /** @var string */
    protected $base_url;

    /** @var string */
    protected $license_key;

    /**
     * @param string $base_url
     * @param string $license_key
     * @throws Exception
     */
    public function __construct($base_url, $license_key = '')
    {
        $this->base_url = $base_url;
        $this->license_key = $license_key;
    }

    public function request($method, $path, $data = array())
    {
        $url = $this->base_url . $path;
        $method = strtoupper($method);
        $args = array(
            'method' => $method,
            'headers' => array(
                'Accepts' => 'application/json',
            ),
        );

        // add license key if we have
        if (! empty($this->license_key)) {
            $args['headers']['Authorization'] = 'Bearer ' . urlencode($this->license_key);
        }

        // add request data
        if (! empty($data)) {
            if (in_array($method, array( 'GET', 'DELETE' ))) {
                $url = add_query_arg($data, $url);
            } else {
                $args['headers']['Content-Type'] = 'application/json';
                $args['body'] = json_encode($data);
            }
        }

        $response = wp_remote_request($url, $args);

        // check for errors
        if (is_wp_error($response)) {
            throw new Exception($response->get_error_code() . ': ' . $response->get_error_message());
        }
        
        $body = wp_remote_retrieve_body($response);
        if (empty($body)) {
            return '';
        }

        $data = json_decode($body);
        if ($data === null) {
            throw new Exception('Error parsing API response: ' . $body);
        }

        // parse HTTP response
        $response_code = wp_remote_retrieve_response_code($response);
        $response_message = wp_remote_retrieve_response_message($response);
        if ($response_code >= 400) {
            throw new ApiException($response_message, $response_code, $data);
        }
    
        return $data;
    }
}
PK     M\zxA-  A-    licensing/class-admin.phpnu [        <?php

namespace MC4WP\Licensing;

use Exception;

class Admin
{
    protected $option_name;
    protected $plugin_slug;
    protected $plugin_file;
    protected $plugin_version;
    protected $plugin_basename;
    protected $api_url;
    protected $network_activated = false;

    /**
     * @param string $plugin_slug
     * @param string $plugin_file
     * @param string $plugin_version
     * @param string $api_url
     */
    public function __construct($plugin_slug, $plugin_file, $plugin_version, $api_url)
    {
        $this->plugin_slug = $plugin_slug;
        $this->plugin_file = $plugin_file;
        $this->plugin_version = $plugin_version;
        $this->plugin_basename = plugin_basename($plugin_file);

        $this->api_url = $api_url;
        $this->option_name = $plugin_slug . '_license';

        if (is_multisite()) {
            if (! function_exists('is_plugin_active_for_network')) {
                require_once(ABSPATH . '/wp-admin/includes/plugin.php');
            }

            $this->network_activated = is_plugin_active_for_network($this->plugin_basename);
        }
    }

    public function add_hooks()
    {
        add_action('mc4wp_admin_save_license', array($this, 'process_form'));
        add_action('mc4wp_admin_before_other_settings', array($this, 'show_form'));
        add_action('mc4wp_license_check', array($this, 'check_license_status'));
        add_filter('pre_set_site_transient_update_plugins', array($this, 'add_plugin_update_data'));
        add_filter('plugins_api', array($this, 'get_plugin_info'), 20, 3);
        add_action('admin_notices', array($this, 'admin_notice'));
        add_action('after_plugin_row_' . $this->plugin_basename, array($this, 'after_plugin_row'), 10, 2);
        add_action('admin_init', array($this, 'run_upgrade_routine'));
    }

    private function get_api_client()
    {
        $license = $this->load_license();
        return new Client($this->api_url, $license->key);
    }

    private function flash_message($message, $type = 'success')
    {
        // @NOTE this should probably be dynamic (dependency inject?)
        mc4wp('admin.messages')->flash($message, $type);
    }

    /**
     * @return object
     */
    private function load_license()
    {
        $defaults = array( 'activated' => false, 'key' => '', 'token' => '' );
        $values = $this->network_activated ? get_site_option($this->option_name, array()) : get_option($this->option_name, array());
        $license = array_merge($defaults, (array) $values);
        return (object) $license;
    }

    /**
     * @param object $license
     */
    private function update_license($license)
    {
    	// cast object back to array
    	$license = (array) $license;
        $this->network_activated ? update_site_option($this->option_name, $license) : update_option($this->option_name, $license, false);
    }

    public function check_license_status()
    {
        $client = $this->get_api_client();
        $license = $this->load_license();

        // don't poll if license not currently activated
        if (!$license->activated) {
            return;
        }

        try {
            $remote_license = $client->request('GET', '/license');
            $license->activated = $remote_license->valid;
        } catch (ApiException $e) {
            if (in_array($e->getApiCode(), array('license_invalid', 'license_expired'), true)) {
                $license->activated = false;
                $license->token = '';
            }
        } catch (Exception $e) {
            // connection or parsing problem... uh oh
            // TODO: Write to debug log?
            return;
        }

        $this->update_license($license);
    }

    private function activate_license()
    {
        $client = $this->get_api_client();
        $license = $this->load_license();

        try {
            $data = $client->request('POST', '/license/activations', array( 'site_url' => get_option('home') ));
        } catch (ApiException $e) {
            $message = 'Error activating license: ' . $e->getApiMessage();
            $code = $e->getApiCode();
            if ($code === 'license_expired') {
                $message .= sprintf(' You can <a href="%s">renew your license</a> here.', 'https://my.mc4wp.com/licenses?key=' . $license->key);
            } else if ($code === 'license_at_limit') {
                $message .= sprintf(' <a href="%s">Manage your site activations or upgrade your license here</a>.', 'https://my.mc4wp.com/licenses?key=' . $license->key);
            }
            $this->flash_message($message, 'warning');
            return;
        } catch (Exception $e) {
            $this->flash_message('Error activating license: ' . $e->getMessage(), 'warning');
            return;
        }

        $license->token = $data->token;
        $license->activated = true;
        $this->update_license($license);

        $this->flash_message('Your license was successfully activated.');
    }

    private function deactivate_license()
    {
        $client = $this->get_api_client();
        $license = $this->load_license();

        try {
            $client->request('DELETE', '/license/activations/' . $license->token);
        } catch (ApiException $e) {
            $this->flash_message(sprintf('Error deactivating license: %s', $e->getApiMessage()), 'warning');
            return;
        } catch (Exception $e) {
            $this->flash_message('Error deactivating license: ' . $e->getMessage(), 'warning');
            return;
        }

        $license->token = '';
        $license->activated = false;
        $this->update_license($license);

        $this->flash_message('Your license was successfully deactivated.');
    }

    public function process_form()
    {
        $license_key = trim((string) $_POST['mc4wp_license_key']);
        $action = trim((string) $_POST['action']);
        $license = $this->load_license();

        if ($license->key !== $license_key) {
            // auto-activate license if license key was empty
            if ($license->key === '') {
                $action = 'activate';
            }

            $license->key = $license_key;
            $this->update_license($license);
        }

        switch ($action) {
        case 'deactivate':
            $this->deactivate_license();
            break;

        case 'activate':
            $this->activate_license();
            break;
        }

        // schedule daily license check, first run 12h from now
        if (! wp_next_scheduled('mc4wp_license_check')) {
        	$timestamp = time() + (3600 * 12);
            wp_schedule_event($timestamp, 'daily', 'mc4wp_license_check');
        };
    }

    /**
     * @return object
     */
    private function fetch_plugin()
    {
        static $data;

        // only run this function once
        if ($data !== null) {
			return $data;
		}

		$client = $this->get_api_client();
		try {
			$data = $client->request('GET', '/plugins/premium?format=wp');
		} catch (Exception $e) {
			$data = (object) array();
			return $data;
		}

		// NOTE: because json_decode turns associative arrays into objects, cast them back as arrays
		$data->sections = (array) $data->sections;
		$data->banners = (array) $data->banners;
		$data->contributors = (array) $data->contributors;
		foreach ($data->contributors as $key => $value) {
			$data->contributors[$key] = (array) $value;
		}

		$license = $this->load_license();
		if ($license->activated) {
			// add activation token to download URL's so that updates can be installed
			$data->package = add_query_arg(array( 'token' => $license->token ), $data->package);
			$data->download_link = $data->package;
		} else {
			// show warning that update can not be installed unless license is activated
			$data->sections['changelog'] = '<div class="notice notice-warning"><p>' . sprintf('You will need to <a href="%s">activate your plugin license</a> to install this update.', admin_url('admin.php?page=mailchimp-for-wp-other')) . '</p></div>' . $data->sections['changelog'];
			$data->upgrade_notice = 'You will need to activate your plugin license to install this update.';
			$data->package = '';
			$data->download_link = '';
		}

        return $data;
    }

    public function show_form()
    {
        $license = $this->load_license();
        require __DIR__ . '/views/license-form.php';
    }

    public function add_plugin_update_data($update_data)
    {
        // WP is funky sometimes, so make sure we're dealing with the right thing.
        if (empty($update_data) || ! isset($update_data->response)) {
            return $update_data;
        }

        $plugin_data = $this->fetch_plugin();
        if (! empty($plugin_data->new_version)) {
            if (version_compare($this->plugin_version, $plugin_data->new_version, '<')) {
                $plugin = plugin_basename($this->plugin_file);
                $plugin_data->plugin = $plugin;
                $update_data->response[ $plugin ] = $plugin_data;
            }
        }

        return $update_data;
    }

    public function get_plugin_info($data, $action = '', $args = null)
    {
        if ($action !== 'plugin_information') {
            return $data;
        }

        if ($args === null || $args->slug !== $this->plugin_slug) {
            return $data;
        }

        return $this->fetch_plugin();
    }

	public function admin_notice()
	{
		// only show admin notice on our own settings pages
		if (!isset($_GET['page']) || strpos($_GET['page'], 'mailchimp-for-wp') !== 0) {
			return;
		}

		// don't show on localhost
		if (stripos(get_home_url(), 'localhost') !== false || (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] === '127.0.0.1')) {
			return;
		}

		$license = $this->load_license();
		if ($license->activated) {
			return;
		}

		echo '<div class="notice notice-warning"><p>';
		echo sprintf('Please <a href="%s">activate your Mailchimp for WordPress Premium license</a>.', admin_url('admin.php?page=mailchimp-for-wp-other'));
		echo ' ' . sprintf('Need a license key? <a href="%s" target="_blank">Purchase one here</a>.', 'https://my.mc4wp.com/register');
		echo '</p></div>';
	}

    public function after_plugin_row()
    {
        $license = $this->load_license();
        if ($license->activated) {
            return;
        }

        echo '<style>.plugins .mc4wp-after-plugin-row th, .plugins .mc4wp-after-plugin-row td {  background-color: lightYellow; box-shadow: inset 0 -1px 0 rgba(0,0,0,0.1); }</style>';
        echo '<tr class="active mc4wp-after-plugin-row"><th scope="row" class="check-column"></th><td colspan="2">';
        echo sprintf('Please <a href="%s">activate your Mailchimp for WordPress Premium license</a>.', admin_url('admin.php?page=mailchimp-for-wp-other'));
        echo ' ' . sprintf('Need a license key? <a href="%s" target="_blank">Purchase one here</a>.', 'https://my.mc4wp.com/register');
        echo '</td>';
        echo '</tr>';
    }

    public function run_upgrade_routine()
    {
        $opts = $this->network_activated ? get_site_option('mc4wp_license') : get_option('mc4wp_license');
        if (empty($opts) || empty($opts['key'])) {
            return;
        }

        // transfer key to new option
        $license = $this->load_license();
        $license->key = $opts['key'];
        $this->update_license($license);

        // delete old option
        delete_option('mc4wp_license');
        delete_site_option('mc4wp_license');

        // try to obtain activation token
        $this->activate_license();
    }
}
PK     M\6.oC    %  ecommerce-loader/ecommerce-loader.phpnu [        <?php

defined('ABSPATH') or exit;

// Require at least version 3.1 of Mailchimp for WordPress (for Queue classes)
if (! version_compare(MC4WP_VERSION, '3.1', '>=')) {
    return;
}

// Always load v2 if we're on core 3.x
if (version_compare(MC4WP_VERSION, '4.0.5', '<')) {
    require __DIR__ . '/../ecommerce2/ecommerce2.php';
    return;
}

$opts = mc4wp_get_options();

// if this option is set, it means someone was using v2 and didn't migrate away yet.
if (! empty($opts['ecommerce'])) {
    require __DIR__ . '/../ecommerce2/ecommerce2.php';
    return;
}


// On core 4.x with no v2 data: good to go!
require __DIR__ . '/../ecommerce3/ecommerce3.php';
PK     M\      mc4wp-premium.phpnu [        <?php
/*
Plugin Name: MC4WP: Mailchimp for WordPress Premium
Plugin URI: https://www.mc4wp.com/
Description: Add-on for the MC4WP: Mailchimp for WordPress plugin. Adds Premium functionality when activated.
Version: 4.9
Author: ibericode
Author URI: https://ibericode.com/
License: GPL v3
Text Domain: mailchimp-for-wp

Mailchimp for WordPress Premium alias MC4WP Premium
Copyright (C) 2012-2022, Danny van Kooten, danny@ibericode.com

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/


// Prevent direct file access
defined('ABSPATH') or exit;

// Define some useful constants
define('MC4WP_PREMIUM_VERSION', '4.9');
define('MC4WP_PREMIUM_PLUGIN_FILE', __FILE__);

/**
 * Loads the various premium add-on plugins
 *
 * @access private
 * @ignore
 */
function _mc4wp_premium_load()
{
	// bail if not on at least PHP 5.3
	if (version_compare(PHP_VERSION, '5.3', '<')) {
		return;
	}

    // load autoloader
    require_once __DIR__ . '/vendor/autoload.php';

    // make sure core plugin is installed and at version 3.0.8
    if (! defined('MC4WP_VERSION') || version_compare(MC4WP_VERSION, '3.0.8', '<')) {

        // if not, show a notice
        $required_plugins = array(
            'mailchimp-for-wp' => array(
                'url' => 'https://wordpress.org/plugins/mailchimp-for-wp/',
                'name' => 'Mailchimp for WordPress core',
                'version' => '3.0.8'
            )
        );
        $notice = new MC4WP_Required_Plugins_Notice('Mailchimp for WordPress - Premium', $required_plugins);
        $notice->add_hooks();
        return;
    }

    // PHP 5.3 compatible plugins
    $plugins = array(
        'ajax-forms',
        'autocomplete',
        'custom-color-theme',
        'email-notifications',
        'styles-builder',
        'multiple-forms',
        'lucy',
        'logging',
	    'ecommerce-loader',
	    'licensing',
	    'append-form-to-post'
    );

	// PHP 7.0+ plugins
    if (PHP_MAJOR_VERSION >= 7) {
    	$plugins[] = 'user-sync';
	    $plugins[] = 'post-campaign';
	}

    /**
     * Filters which add-on plugins should be loaded
     *
     * Takes an array of plugin slugs, defaults to all plugins.
     *
     * @param array $plugins
     */
    $plugins = apply_filters('mc4wp_premium_enabled_plugins', $plugins);

    // include each plugin
    foreach ($plugins as $plugin) {
        require __DIR__ . "/{$plugin}/{$plugin}.php";
    }
}

add_action('plugins_loaded', '_mc4wp_premium_load', 30);

/**
 * @access private
 * @ignore
 * */
function _mc4wp_premium_activate()
{
    // run logging installer
    require_once __DIR__ . '/logging/includes/class-installer.php';
    MC4WP_Logging_Installer::run();
}

register_activation_hook(__FILE__, '_mc4wp_premium_activate');
PK     M\q728  8    CHANGELOG.mdnu [        Changelog
==========

#### 4.9 - Jul 26, 2022

- Forms: add autocomplete feature for common email domains.


#### 4.8.21 - May 10, 2022

- E-commerce: Add filter `mc4wp_ecommerce_enable_coupon_tracking` (default: `true`) which if set to `false` disables coupon tracking entirely.
- User Sync: Show a friendlier error message when user changes their email address to one that is already in Mailchimp. 
- Updated all third-party JS dependencies to their latest versions.


#### 4.8.20 - Dec 19, 2021

- AJAX Forms: add human-friendly console warning if core script is not properly loaded.
- Post Campaign: handle unexisting post meta explicitly, fixes an issue with Full Site editing.


#### 4.8.19 - Sep 6, 2021

- User Sync: in webhook listener, match by current email address if old_email or id do not result in a matching user 
- Post Campaign: Ensure script is only loaded when on the "edit post" screen


#### 4.8.18 - Jun 17, 2021

- E-commerce: add SKU to product title
- User Sync: fix button URL for manually processing background jobs.
- Reports: fix UTC offset on reports page


#### 4.8.17 - May 14, 2021

- Reports: Fix timezone in chart on Reports page.
- Reports: Do not accept negative values for log purge schedule.
- Always load minified assets (no longer checking `SCRIPT_DEBUG`).
- Add nonce to all URL's using `_mc4wp_action` parameter.


#### 4.8.16 - May 10, 2021

- Reports: Fix JS issue when viewing chart.


#### 4.8.15 - May 7, 2021

- Update classnames to work with Mailchimp for WordPress version 4.8.4 and up.
- Rewrite CSS selectors for optimized performance.
- Fix order of arguments for function call to `join` because of PHP 7.4 deprecation.
- E-commerce: Optimize tracker.js for file size by getting rid of third-party dependency.
- E-commerce: Add `defer` attribute to cart.js and tracker.js `<script>` elements.


#### 4.8.14 - Feb 2, 2021

- Minor performance improvements throughout plugin.
- Forms: Wrap call to `wpColorPicker` in callback listener on `DOMContentReady` event.
- E-commerce: Allow short-circuiting `mc4wp_ecommerce_customer_data` and `mc4wp_ecommerce_order_data` filter hooks by returning `null` or `false`.


#### 4.8.13 - Dec 11, 2020

- E-commerce: Revamped initial sync wizard for products and orders with improved performance.
- User sync: Log detailed error messages for API requests that return "400 Bad Request".
- User sync: Include user ID in log messages when API request fails.


#### 4.8.12 - Nov 24, 2020

- Fixes issue with missing autoloader, generating a fatal error. :( Please see this KB article on how to [manually update to the latest plugin version](https://www.mc4wp.com/kb/manually-updating-latest-version/).


#### 4.8.11 - Nov 24, 2020

- Forms: Fix broken KB links on styles builder page.
- E-commerce: Send discount total for orders.
- E-commerce: Send JSON error when cart listener (for getting guest email address) could not retrieve cart from session.


#### 4.8.10 - Oct 27, 2020

- E-commerce: Get rid of expensive SQL queries when gathering customer information because Mailchimp now calculates these values directly. This is a huge performance gain because Mailchimp uses proper database table design whereas WooCommerce doesn't.
- E-commerce: Improved progressive enhancement for initial sync form. It is now easier to stop & start an ongoing sync process without reloading the page.


#### 4.8.9 - Oct 14, 2020

- E-commerce: Improve reliability for initial product & order sync and add some log messages related to sync status.


#### 4.8.8 - Sep 29, 2020

- E-commerce: Prevent multiple instances of process that handles queued background jobs from running at the same time.
- E-commerce: Do not fire new HTTP request for fetching background sync status while previous request is still pending.


#### 4.8.7 - Sep 15, 2020

- E-commerce: Add some progressive enhancement to new order and product sync.


#### 4.8.6 - Aug 12, 2020

**Fixes**

- Argument count error introduced by version 4.8.5.


#### 4.8.5 - Aug 12, 2020

**Fixes**

- E-commerce: Abandoned cart not updated if visitor logs in from checkout page.

**Improvements**

- User Sync: Add setting to ignore empty user fields to prevent overwriting data in Mailchimp.
- E-commerce: Store user ID in queue instead of customer ID, since customer ID may be custom.


#### 4.8.4 - Jul 23, 2020

**Fixes**

- Issue with User Sync throwing a fatal error if the currently selected list was deleted from Mailchimp.

**Additions**

- Added filter hook: `mc4wp_ecommerce_disable_guest_cart_tracking` ([example](https://github.com/ibericode/mc4wp-snippets/blob/master/premium/ecommerce/disable-cart-tracking-for-guests-using-filter.php))
- Added constant: `MC4WP_ECOMMERCE_DISABLE_GUEST_CART_TRACKING` ([example](https://github.com/ibericode/mc4wp-snippets/blob/master/premium/ecommerce/disable-cart-tracking-for-guests-using-constant.php))


#### 4.8.3 - Jul 1, 2020

**Fixes**

- User Sync: Add line button not working after changing Mailchimp list.

**Improvements**

- Licensing: improved styling of license key input field.


#### 4.8.2 - Jun 18, 2020

**Fixes**

- Post to Campaign: Only bootstrap plugin if `register_post_meta` function exists.

**Improvements**

- User Sync: Force existing `meta_key` fields in field map setting.
- User Sync: Add simple tool for debugging user data.
- User Sync: Minor JavaScript performance optimizations.


#### 4.8.1 - Jun 15, 2020

**Additions**

- New feature: add section to Gutenberg sidebar to create a campaign in Mailchimp with contents of that post.
- New filter hook: `mc4wp_ecommerce_send_cart_to_mailchimp`
- New filter hook: `mc4wp_ecommerce_send_customer_to_mailchimp`

**Improvements**

- License: Minor code hardening.
- User sync: Only update user if dependent property actually changed.

**Fixes**

- E-commerce: Broken "more information" link on settings page.


#### 4.8 - Jan 14, 2020

**Additions**

- [User Sync](https://www.mc4wp.com/kb/what-does-mailchimp-sync-do/) feature, which allows you to synchronize WordPress user fields with subscriber fields in Mailchimp and vice versa.

**Improvements**

- E-commerce: Capture `billing_postcode` field for guest customers abandonding the checkout form.
- E-commerce: Reduce JavaScript file size for abandoned cart tracking by 25%.
- Licensing: Show notice when plugin is running on a live website without an active license.
- Forms: Reduce JavaScript file size for enhancing forms with AJAX functionality.



#### 4.7.3 - Dec 5, 2019

**Improvements**

- Allow the use of `[_MC4WP_ACTION]` in the message body of email notifications.
- Improved column types for logging table.


#### 4.7.2 - Nov 19, 2019

**Improvements**

- Send order date including timezone information.


#### 4.7.1 - Nov 14, 2019

**Improvements**

- Use synchronous XHR request for recording cart data for guests in beforeunload event.
- Improved email detection for abandoned carts when user is not logged-in.

**Fixes**

- Issue with carts not being deleted from Mailchimp when checking out as a guest customer.



#### 4.7 - Oct 24, 2019

**Improvements**

- Reports: New graph on the reports page which visualises the data using a stacked bar chart, which should improve readability.
- E-commerce: For abandoned carts, only keep the cart in Mailchimp when the order status is either failed or pending.


#### 4.6.1 - Oct 9, 2019

**Fixes**

- JS error when doing initial product sync.


#### 4.6.0 - Oct 7, 2019

Compatibility with [Mailchimp for WordPress](https://wordpress.org/plugins/mailchimp-for-wp/) version 4.6.


#### 4.5.14 - Sep 11, 2019

**Improvements**

- Change MailChimp to Mailchimp in all texts.
- E-commerce: Add query arg to easily debug queue content.
- E-commerce: Send home URL to Mailchimp instead of site URL.
- E-commerce: listen to `woocommerce_new_product` hook too.


#### 4.5.13 - Aug 26, 2019

**Improvements**

- E-commerce: Allow synchronising only product data with Mailchimp.
- E-commerce: Check for existence of `line_` keys in cart array.


#### 4.5.12 - Aug 12, 2019

**Fixes**

- Plugin update showing despite being on latest version


#### 4.5.11 - Aug 9, 2019

**Improvements**

- E-commerce: Write exceptions from queue worker to debug log.


#### 4.5.10 - July 22, 2019

**Fixes**

- Reports: Sign-ups from URL's longer than 255 characters not logged because of column character limit.

**Improvements**

- Styles Builder: Show permanent notice when creating custom styles for a form that is not configured to use the Styles Builder.


#### 4.5.9 - July 18, 2019

**Fixes**

- Incorrect address 2 line for e-commerce customer addresses.

**Improvements**

- Delete abandoned cart only when order status changes to on hold, processing or completed.
- Show time in seconds to next e-commerce job run.
- Delete carts from Mailchimp at an earlier hook to prevent issues with payment gateway redirections.
- Get parent product ID from object instead of (possibly stale) cart data.


#### 4.5.8 - June 4, 2019

**Fixes**

- Issue synchronising products with invalid product variations.
- Broken screen pagination "items per page"

**Improvements**

- Log correct email address when sending out dynamic email notifications.
- Send tax total to Mailchimp for abandoned carts
- Allow up to a 10-minute delay in e-commerce's job queue worker interval.
- In abandoned cart data, use product price with taxes included.
- Get cart item ID from method, if method exists.
- Minor code readability improvements.


#### 4.5.7 - February 8, 2019

**Fixes**

- Slow overall WP Admin performance caused by previous update.


#### 4.5.6 - February 4, 2019

**Fixes**

- E-commerce: Product variants not being added on first sync

**Improvements**

- E-commerce: add URL listener to quickly queue all products or orders
- E-commerce: hook into order status changes explicitly
- Licensing: update URL's to point to new API endpoint


#### 4.5.5 - January 8, 2019

**Improvements**

- E-commerce: don't send product variants in bulk to prevent HTTP timeouts.
- E-commerce: only send address property on customer objects if it looks like a complete address.
- E-commerce: properly exclude orders without an email address from being attempted using the order sync wizard.
- E-commerce: trim special characters from order number.
- E-commerce: update pending background jobs number after queue is processed over AJAX.
- Forms: add `.mc4wp-loading` class attribute to form elements while request is loading.


#### 4.5.4 - November 26, 2018

**Improvements**

- E-commerce: Rewrite SQL queries on e-commerce settings page for improved performance.
- E-commerce: Add visiblity property to product data sent to Mailchimp.
- E-commerce: For guest checkouts, create cart in Mailchimp right away instead of waiting 5 seconds.

**Additions**

- E-commerce: Add setting to disconnect store from Mailchimp without deleting it.


#### 4.5.3 - October 22, 2018

**Fixes**

- E-commerce: WooCommerce 2.3 compatibility.
- E-commerce: Don't create new transactional subscriber when customer changes their email in WooCommerce.
- E-commerce: Timezone not taken into account for displaying time on e-commerce settings page.

**Improvements**

- E-commerce: Automatically update email addresses of subscribers for the connected list in Mailchimp when they change it in WooCommerce.


#### 4.5.2 - September 11, 2018

**Improvements**

- E-commerce: process background jobs every minute.
- E-commerce: update fulfilment_status to trigger shipping notifications.
- E-commerce: improved compatibility with older WooCommerce versions.


#### 4.5.1 - Jul 25, 2018

**Fixes**

- AJAX Forms: fixed issue with caching an unset variable.


#### 4.5 - July 11, 2018

**Improvements**

- E-commerce: Database query performance improvements on settings page.
- E-commerce: Show when next run is scheduled to run for processing pending background jobs.
- E-commerce: Send billing company field to Mailchimp when updating customer.

**Additions**

- E-commerce: Add bulk action to (re-)synchronise orders, products or coupons with Mailchimp.
- E-commerce: Added support for promo codes (coupons).
- E-commerce: New WP-CLI command wp mc4wp-ecommerce sync-coupons
- E-commerce: New filter hook mc4wp_ecommerce_promo_rule_data
- E-commerce: New filter hook mc4wp_ecommerce_promo_code_data


#### 4.4.4 - June 27, 2018

**Fixes**

- Method parameter error when using WooCommerce 2.x.
- Abandoned cart data error when using WooCommerce 2.x.

**Improvements**

- Sanity check on orders for lines that have a quantity of 0.



#### 4.4.3 - June 25, 2018

**Improvements**

- Email notifications: Accept a broader range of date inputs (year first, leading zeroes for day's and month's)


#### 4.4.2 - June 11, 2018

**Fixes**

- E-commerce: WP CLI command error because user object can not be represented as string.
- Append form: Catch exceptions in append form to posts feature.

**Improvements**

- E-commerce: Reset transient cache when resetting store.
- E-commerce: Reset transient cache after adding/updating/deleting products and orders.
- E-commerce: Failsafe against invalid session data for abandoned carts.
- Email notifications: Format date in local format


#### 4.4.1 - May 21, 2018

**Fixes**

- E-commerce: Error when running abandoned cart recovery with older WooCommerce versions (before 3.2).
- AJAX forms: Notice for unexisting variable.

**Improvements**

- E-commerce: Failsafe return value of `wc_get_product`


#### 4.4 - May 11, 2018

**Improvements**

- E-commerce: move slower operations (like calculating the customer's order total) when generating abandoned cart data to a background job, to speed up website for the visitor.
- E-commerce: store results of slow queries in a 1-hour cache to speed up e-commerce settings page.

**Additions**

- E-commerce: added filter `mc4wp_ecommerce_schedule_process_queue_event` which can be used to disable the WP Cron event that is scheduled.
- Logging: add setting to automatically delete log items older than a number of days.
- Logging: include log data in GDPR export request.
- Logging: erase log data in GDPR erase request.


#### 3.3.34 - April 23, 2018

**Fixes**

- E-commerce: issue with updating orders when using custom order numbering.

**Improvements**

- E-commerce: add button to clear all pending background jobs.
- E-commerce: soften error message when an order without items is skipped through the order synchronisation wizard.
- Logging: all logging can now be disabled by setting `define( 'MC4WP_LOGGING', false );`


#### 3.3.33 - April 17, 2018

**Fixes**

- Links in "Need help?" box search results not pointing to the correct domain.

**Improvements**

- E-commerce: Process queue every 3 minutes instead of every 5 minutes.
- E-commerce: Use less important log level when order or cart contains no items.


#### 3.3.32 - April 10, 2018

**Fixes**

- E-commerce: Send correct product variation ID to Mailchimp again.
- E-commerce: Redirect after re-populating cart from Mailchimp to clear URL parameters.

**Improvements**

- Forms: Blur active input element after submitting form with RETURN key, so that keyboard disappears on mobile.


#### 3.3.31 - March 28, 2018

**Fixes**

- Reports: Log items were sometimes counted on multiple days in the reports graph.
- E-commerce: On certain servers, background jobs were not queued up for updated carts or orders.

**Improvements**

- E-commerce: Stop unnecessary info logging for guest checkouts.
- E-commerce: Mailchimp does not allow connecting more than one site sharing the same domain, so attempting to load MC.js on WordPress Multisite with a subdirectory set-up would not work. We are now generating a unique subdomain and sending that to Mailchimp (instead of the subdirectory) so that everything works as expected.
- E-commerce: When order update fails because of an invalid `campaign_id`, retry without that parameter.


#### 3.3.30 - March 20, 2018

**Improvements**

- E-commerce: campaign tracking cookies are now set via JavaScript so that it works with pages served from cache.

**Additions**

- Form setting to automatically append that form to all posts (in a certain category).


#### 3.3.29 - March 12, 2018

**Fixes**

- "Order already exists" errors when using custom order numbers.

**Improvements**

- Improved handling of deleted product variations for historical orders.


#### 3.3.28 - February 26, 2018

**Fixes**

- Catch exception when periodic license check fails.

**Improvements**

- Forms: show success message even when redirecting to another page.
- E-commerce: validate product existence before sending to Mailchimp.
- E-commerce: only send product variants if variable product has existing children.
- E-commerce: throw exception when order has no order lines.
- Reports: Print submission data as JSON instead of PHP object.


### 3.3.27 - February 2, 2018

**Fixes**

- Reports: "Last year" view not showing the correct graph.
- E-Commerce: Send products in "trash" to Mailchimp too, but with stock inventory of 0.

**Improvements**

- Minor memory usage improvements.
- Updated all JavaScript dependencies.
- E-Commerce: Fallback on `user_email` for abandoned cart tracking, when `billing_email` is unknown.

**Additions**

- E-Commerce: Add `--delay` option to [all bulk WP CLI commands](https://www.mc4wp.com/kb/ecommerce-wp-cli-commands/).
- E-Commerce: Add `wp mc4wp-ecommerce reset-queue` command to clear all queued jobs.


### 3.3.25 - January 8, 2018

**Fixes**

- Fire correct event `updated_subscriber` when using AJAX forms.
- Fire individual form events when using AJAX forms.


### 3.3.24 - December 22, 2017

**Additions**

- E-commerce: added support for loading MC.js file from Mailchimp, allowing for product retargeting and pop-ups.
- E-commerce: added `mc4wp_ecommerce_store_data` filter hook for modifying store data before it is sent to Mailchimp.

**Improvements**

- E-commerce: use order getter methods to generate order data for Mailchimp.
- E-commerce: send site URL instead of just the domain part to allow for two sites to connect their store from the same domain.


### 3.3.23 - December 11, 2017

**Improvements**

Styles-Builder: Add option to set `background-size: cover` so that image stretches entire element.
Styles-Builder: Check form validity after every input change.


#### 3.3.22 - November 17, 2017

**Improvements**

- E-commerce: Look for billing_email for customer & order objects in more places.
- Email notifications: Replace `[_MC4WP_LISTS]` tag properly.
- Email notifications: Send email for "unsubscribed" event too.


#### 3.3.21 - October 31, 2017

**Fixes**

- In-plugin [knowledge base](https://www.mc4wp.com/kb/) returned no results regardless of search query (since a few days).

**Improvements**

- No longer flashing success message when form has a redirect URL.
- Minor performance optimisations for generating asset URL's.


#### 3.3.20 - October 19, 2017

**Fixes**

- Issue with abandoned cart links showing an empty cart for guest visitors on some specific site configurations.


#### 3.3.19 - October 6, 2017

- e-commerce: fix campaign tracking when using Sequential Order Numbers plugin for WooCommerce.
- e-commerce: refactor tracking class so that request values are always excluded on forced sync.
- email notifications: catch exceptions when generating email message.
- email notifications: replace `INTERESTS` tag in email message with readable interest group names.
- added `mc4wp_ecommerce_options` filter hook.


#### 3.3.17 - July 25, 2017

**Improvements**

- e-commerce: Improve unique cart ID for abandoned carts so that automations can be re-triggered.


#### 3.3.16 - July 24, 2017

**Improvements**

- e-commerce: Clear local store ID too when resetting e-commerce data.
- e-commerce: Only set landing page cookie when mc_cid URL parameter is set.


#### 3.3.15 - July 13, 2017

**Improvements**

- e-commerce: allow other plugins to filter the order number by using `get_order_number()`
- e-commerce: save store ID in options so that site URL can change without affecting automations.
- e-commerce: Send shipping & billing address with every order, so they show in Order Notifications.


#### 3.3.14 - June 16, 2017

**Fixes**

- e-commerce: timeout when synchronising products if running an outdated version of WooCommerce.

#### 3.3.13 - June 14, 2017

**Improvements**

- e-commerce: enforce Mailchimp API JSON schema for abandoned cart data.
- e-commerce: protect against endless loops when synchronising products with corrupt data.
- e-commerce: include more (optional) store parameters in API calls to Mailchimp: email address, primary locale, platform & store domain.

#### 3.3.12 - June 1, 2017

**Improvements**

- e-commerce: Added a setting to send all order statuses to Mailchimp (incl. failed, refunded and cancelled orders)
- e-commerce: No longer triggering a database query on every checkout page load.
- Use new mc4wp.com API for license & update checks.


#### 3.3.11 - May 16, 2017

**Fixes**

- E-commerce: order notifications never triggering.

**Improvements**

- E-commerce: improved backwards compatibility with with WordPress versions before 4.5
- Styles Builder: improved permission check for writing stylesheet file(s).
- Email Notifications: accept flexible array format in `mc4wp_form_email_notification_headers` filter hook.

**Additions**

- E-commerce: track landing page URL and send to Mailchimp when synchronising orders.


#### 3.3.10 - April 28, 2017

**Fixes**

- E-commerce: fixes notice when synchronising products using WooCommerce 2.x
- E-commerce: error when repopulating abandoned cart with product variations.
- Styles Builder: image upload button not setting URL as input field value.


#### 3.3.9 - April 13, 2017

**Fixes**

- E-commerce: unexisting method calls when using WooCommerce 3.0 or later.


#### 3.3.8 - April 13, 2017

**Fixes**:

- Headers already sent error when trying to redirect to e-commerce setup wizard.

**Improvements**

- Reports: Update JavaScript dependencies for graph.
- Reports: Fix jumpy graphs when MySQL has an incorrect timezone setting.
- E-Commerce: WooCommerce 3.0 compatibility.
- E-Commerce: Send correct stock status when manually managing stock.
- Reduced memory footprint.

**Additions**

- E-Commerce: `order_url` is now sent to Mailchimp.
- E-Commerce: support for Order Notifications.
- New filter hook: `mc4wp_ecommerce_cart_data` for filtering abandoned cart data.
- New filter hook: `mc4wp_ecommerce_order_data` for filtering order data.
- New action hook: `mc4wp_ecommerce_restore_abandoned_cart` for restoring an abandoned cart.


#### 3.3.7 - February 14, 2017

**Fixes**

- E-commerce: Fixes "Schema describes ..." errors by enforcing Mailchimp's JSON scheme.
- Use correct email address when updating an abandoned cart if user has two email addresses.

**Improvements**

- E-commerce: Strip HTML from product titles.
- E-commerce: Update customer data in Mailchimp separately from updating a cart.

**Additions**

- E-commerce: Added `mc4wp_ecommerce_product_data` filter to modify product data before sending to Mailchimp.


#### 3.3.6 - January 16, 2017

**Improvements**

- E-commerce: Handle deleted products in (old) orders by sending a "generic deleted product" to Mailchimp.
- E-commerce: Update parent product instead of individual product variants.
- Email notifications: Write info line to debug log whenever an email is sent.

**Additions**

- E-commerce: Add `mc4wp_ecommerce_send_order_to_mailchimp` filter hook.

**Fixes**

- E-commerce: Products missing top level `url` attribute would break product block in Mailchimp campaigns.


#### 3.3.5 - December 20, 2016

**Fixes**

- Fatal error on sites still running on PHP 5.2.


#### 3.3.4 - December 12, 2016

**Improvements**

- E-commerce: Force-save queue when processing items, because save action may never be called on very long-lived processes.
- AJAX Forms: Replace configuration with lazy loaded config store to work better with WP Rocket.
- E-commerce: Add help text about connecting your store to a different Mailchimp list.


#### 3.3.3 - November 30, 2016

**Fixes**

- E-commerce: `ajaxurl` not set on WooCommerce checkout when capturing guest email for cart tracking.

**Improvements**

- E-commerce: Various SQL performance optimisations
- E-commerce: Don't exit WP CLI command on errors.
- E-commerce: Use `shop_single` image size for products in Mailchimp (instead of the smaller thumbnail)


#### 3.3.2 - November 23, 2016

**Improvements**

- E-commerce: Background queue won't stall on PHP errors now.
- E-commerce: Show "last updated" time on settings page.
- E-commerce: Show status text while processing background jobs.
- E-commerce: Don't try to send abandoned carts without an email address.
- E-commerce: Write PHP errors in background queue to debug log.


#### 3.3.1  - November 2, 2016

**Fixes**

- E-commerce: "Schema describes string, integer found instead" error when adding orders.

**Improvements**

- Don't show e-commerce settings when store is not connected to a list yet.
- E-commerce: When campaign data for an order becomes corrupted, we'll now auto-retry without that campaign data.
- E-commerce: Check if user has `billing_email` before updating remote customer.
- E-commerce: Send "draft" products to Mailchimp too. These will not be included in Product Recommendations.
- E-commerce wizard now always starts with most recent orders.
- Failsafe against including AJAX script for forms twice.

**Additions**

- Add `mc4wp_ecommerce_customer_data` to filter customer data that is sent to Mailchimp.


#### 3.3 - October 18, 2016

This release allows you to [integrate your WooCommerce store with Mailchimp's newest API](https://www.mc4wp.com/kb/upgrading-ecommerce-api-v3/), enabling cool things like [product recommendations](https://mailchimp.com/features/product-recommendations/) & [abandoned cart recovery](https://mailchimp.com/features/abandoned-cart/).


#### 3.2.2 - September 8, 2016

**Fixes**

- Remove usage of PHP 5.3 constant in activation hook.
- Don't send admin cookies when manually adding past e-commerce orders.

**Improvements**

- Strip special characters from e-commerce product names.
- Show Top Bar sing-ups in Reports > Statistics graph.
- Make all columns in log table sortable.
- Memory usage improvements for AJAX forms & in-plugin knowledge base search.
- Improved compatibility with older versions of WooCommerce.


#### 3.2.1 - August 11, 2016

**Fixes**

- HTML tags showing in plain text email notifications when using `[_ALL_]` tag.
- Order of radio inputs on RTL sites.

**Improvements**

- Better margin in Styles Builder when running Mailchimp for WordPress 4.0.
- Default to `px` widths in Styles Builder so they don't have to be explicitly given.
- Minor performance improvements.

**Additions**

- Added text color option to Styles Builder for notices.


#### 3.2 - August 4, 2016

**Fixes**

- Never use `[UNIQID]` as a campaign identifier in e-commerce tracking.
- Fatal error when adding old orders that reference deleted WooCommerce products.

**Improvements**

- Better data structure for sign-up logging, so importing into Mailchimp is easier.
- New detailed item view for all successful sign-up attempts.
- Log export now uses TAB as a delimiter.
- Logging compatibility with upcoming [Mailchimp for WordPress 4.0 release](https://www.mc4wp.com/kb/upgrading-to-4-0/).


#### 3.1.10 - July 13, 2016

**Fixes**

- Issue with Manual CSS in Styles Builder being escaped.


##### 3.1.9 - June 21, 2016

**Fixes**

- eCommerce360: campaign cookie wasn't taken into account for orders that require manual action before they are "completed"

**Improvements**

- Styles Builder: Improved file creation.
- Styles Builder: Better error messages
- Styles Builder: Don't show "copy from other form" dropdown if there is just 1 form.


##### 3.1.8 - June 7, 2016

**Fixes**

- eCommerce360 campaign cookie was stored for just 7 hours, instead of 7 days.
- Custom colored theme not printing CSS styles.
- Log export not working on Windows servers.

**Improvements**

- eCommerce360 order sync now stops on errors.
- Show "draft" forms on Forms overview page.


##### 3.1.7 - May 23, 2016

**Fixes**

- AJAX loading animation now works with `<button>` elements too.

**Additions**

- Filter: `mc4wp_ecommerce360_order_data`, to modify order data before it is sent to Mailchimp.
- Filter: `mc4wp_ecommerce360_order_statuses`, specifies which order statuses are sent to MailChip.

##### 3.1.6 - May 10, 2016

**Fixes**

- `GROUPINGS:123` tag not working in email notifications.

**Improvements**

- Set `action` GET parameter for AJAX requests for compatibility with WP-SpamShield.
- Set proper `Allow-Control-Allow-Origin` headers for AJAX requests.
- eCommerce360: Add WooCommerce variations to product name.

**Additions**

- New "Advanced" tab under Reports with form to delete all Log items at once.


##### 3.1.5 - April 18, 2016

**Fixes**

- WooCommerce orders with an associated user account (instead of guest email address) were not being recorded by the "add past orders" screen.
- Running the log export on PHP 5.2 would return an empty CSV file


##### 3.1.4 - March 30, 2016

**Fixes**

- eCommerce360 would try to add orders without an email address to Mailchimp.

 **Improvements**

 - Ensure all WooCommerce filters run when sending order data to Mailchimp.
 - When AJAX form script errors, the form now falls back to a default form submission.
 - Grouping data is now shown in log table again.

**Additions**

- New "Order Action" for WooCommerce to manually add or delete an eCommerce360 order to/from Mailchimp.


##### 3.1.3 - March 22, 2016

**Fixes**

- Script for plotting Reports graph wasn't loaded on some servers.

**Improvements**

- Use later hook priority for rendering form preview in Styles Builder for compatibility with Pagelines DMS.
- Update script dependencies to their latest versions.
- Escape form name throughout settings pages.


##### 3.1.2 - February 29, 2016

**Fixes**

- Email notification didn't get correct `Content-Type` header for HTML.

**Improvements**

- Get form preview to work with unsaved Styles Builder stylesheet.
- Minor improvements for setting button colors in Styles Builder stylesheet.

##### 3.1.1 - February 16, 2016

**Fixes**

- Log would throw error when list had percentage-sign in their name.

**Improvements**

- All `mc4wp_form_email_notification_*` filters now have access to the submitted form (as the second parameter).
- Add JavaScript sourcemaps to minified JS scripts.
- Remove sourcemaps from unminified JS scripts
- Log now takes `mc4wp_lists` filter into account.
- Use earlier hook for Styles Builder preview to prevent incompatibility with some themes.
- Load Styles Builder stylesheet in TinyMCE editor for improved [Shortcake](https://wordpress.org/plugins/shortcode-ui/) support.

**Additions**

- Added `mc4wp_form_email_notification_headers` filter.
- Added `mc4wp_form_email_notification_attachments` filter.


##### 3.1 - January 26, 2016

**Additions**

- [eCommerce360 integration](https://www.mc4wp.com/kb/what-is-ecommerce360/) for WooCommerce and Easy Digital Downloads.
- [WP-CLI commands for eCommerce360](https://www.mc4wp.com/kb/ecommerce360-wp-cli-commands/).

**Improvements**

- Log: modify items per page in screen options when viewing log.
- Miscellaneous code improvements


##### 3.0.6 - January 18, 2016

**Fixes**

- Pagination not showing on Log overview page.

**Improvements**

- Memory usage improvements to Log export for huge datasets.
- Make sure Styles Builder stylesheet is loaded over HTTPS when needed.


##### 3.0.5 - December 15, 2015

**Fixes**

- Button to export log was no longer working after version 3.0

**Improvements**

- Reintroduced support for `data-loading-text` on submit buttons.
- Improved logic for loading animation in submit buttons.
- Styles Builder: Success & error color is now applied to paragraph element, to make sure theme doesn't override the given style.

**Additions**

- Improved email notifications. You can now easily modify the subject line & message body of the email that is sent.


##### 3.0.4 - December 10, 2015

**Fixes**

- Not being able to access Forms page when using strict error reporting.

**Additions**

- Use `mc4wp_use_sslverify` filter to detect whether SSL verification should be used in remote requests.


##### 3.0.3 - December 1, 2015

**Fixes**

- Fatal error when visiting Forms overview page on older PHP versions.

##### 3.0.2 - November 26, 2015

**Fixes**

- Stylesheet file not loaded because of 403 error (due to incorrect file permissions).

= 3.0.1 - November 25, 2015 =

**Improvements**

- AJAX Forms: Perform core logic before triggering events, to prevent erorrs in event callbacks from messing up form flow.
- Styles Builder: Changes are now applied instantly.
- Styles Builder: Clearing a color no longer resets all styles.
- Styles Builder: Try to set correct permissions before writing stylesheet to file.
- KB Search: Make sure all links point to [mc4wp.com](https://www.mc4wp.com).

**Additions**

- Add link to "Appearance" tab on Forms overview page.


##### 3.0.0 - November 23, 2015

Initial release.

This plugin requires [Mailchimp for WordPress](https://wordpress.org/plugins/mailchimp-for-wp/) v3.0 or higher to work.
PK     M\SJ~      	  info.jsonnu [        {
   "name": "Mailchimp for WordPress Premium",
   "version": "4.9",
   "author": "ibericode",
   "requires": "4.5",
   "tested": "6.0"
}
PK     M\y      user-sync/src/class-worker.phpnu [        <?php

namespace MC4WP\User_Sync;

use Error;
use MC4WP_Queue as Queue;
use MC4WP_Debug_Log;
use Mockery\Exception;

class Worker {

    /**
     * @var Queue
     */
    private $queue;

    /**
     * @var User_Handler
     */
    private $user_handler;

    /**
     * Worker constructor.
     *
     * @param Queue      $queue
     * @param User_Handler $user_handler
     */
    public function __construct( Queue $queue, User_Handler $user_handler ) {
        $this->queue = $queue;
        $this->user_handler = $user_handler;
    }

    /**
     * Add hooks
     */
    public function add_hooks() {
        add_action( 'mc4wp_user_sync_process_queue', array( $this, 'work' ) );
    }

    /**
     * Put in work!
     */
    public function work() {

        // We'll use this to keep track of what we've done
        $done = array();

        while( ( $job = $this->queue->get() ) ) {

           $user_id = $job->data;

            // don't perform the same job more than once
            if( ! in_array( $job->data, $done ) ) {

                // do the actual work
                try {
					$success = $this->user_handler->handle_user( $user_id );
				}catch( \Error $e ) {
                    $message = sprintf( 'User Sync: Failed to process background job. %s in %s:%d', $e->getMessage(), $e->getFile(), $e->getLine() );
                    $this->get_log()->error( $message );
                } catch(\Exception $e) {
					$message = sprintf( 'User Sync: Error handling user #%d: %s', $user_id, (string) $e);
					$this->get_log()->error( $message );
				}

                // keep track of what we've done
                $done[] = $job->data;
            }

            // remove job from queue & force save for long-lived processes
            $this->queue->delete( $job );
            $this->queue->save();
        }
    }

	/**
	 * @return MC4WP_Debug_Log
	 * @throws \Exception
	 */
    private function get_log() {
        return mc4wp('log');
    }

}
PK     M\S 
   
     user-sync/src/class-observer.phpnu [        <?php


namespace MC4WP\User_Sync;

use Error;
use MC4WP_Queue as Queue;

class Observer {

    /**
     * @var Queue
     */
    private $queue;

    /**
     * @var Users
     */
    private $users;

    /**
     * Worker constructor.
     *
     * @param Queue      $queue
     * @param Users 	$users
     */
    public function __construct( Queue $queue, Users $users ) {
        $this->queue = $queue;
        $this->users = $users;
    }

    /**
     * Add hooks
     */
    public function add_hooks() {
        add_action( 'profile_update', array( $this, 'on_profile_update' ), 10, 2);
        add_action( 'updated_user_meta', array( $this, 'on_updated_user_meta' ), 10, 4 );
    }

    public function on_profile_update($user_id) {
        $this->maybe_schedule( $user_id );
    }

    public function on_updated_user_meta( $meta_id, $user_id, $meta_key, $meta_value  ) {
        //  Don't act on our own keys or hidden meta keys.
        if( strpos( $meta_key, 'mailchimp' ) === 0
            || strpos( $meta_key, 'mc4wp_' ) === 0
            || strpos( $meta_key, '_' ) === 0 ) {
            return;
        }

		/*
		 * Don't act on list of ignored meta keys
		 */
        $ignored_meta_keys = array(
			'rich_editing',
			'syntax_highlighting',
			'comment_shortcuts',
			'admin_color',
			'use_ssl',
			'show_admin_bar_front',
			'wp-last-login',
			'wp_yoast_notifications'
		);
        $ignored_meta_keys = apply_filters( 'mc4wp_user_sync_ignored_user_meta_keys', $ignored_meta_keys );
        if( in_array( $meta_key, $ignored_meta_keys, true ) ) {
            return;
        }

        $this->maybe_schedule( $user_id );
    }

    private function maybe_schedule( $user_id ) {
        $user = $this->users->user( $user_id );

        // only schedule user to be updated if a critical field really changed
        $hash = $this->users->user_to_hash( $user );
        $old_hash = $this->users->get_hash( $user_id );
        if ($hash === $old_hash) {
            return;
        }

        $this->schedule( $user->ID );
    }

    /**
     * Adds a task to the queue
     *
     * @param int $user_id
     * @throws \Exception
     */
    private function schedule( $user_id ) {
        // Don't schedule anything when doing webhook
        if( defined( 'MC4WP_SYNC_DOING_WEBHOOK' ) && MC4WP_SYNC_DOING_WEBHOOK ) {
            return;
        }

		// schedule only if needed
		$user = $this->users->user( $user_id );
		$handle = $this->users->should( $user );
		if (!$handle) {
			return;
		}

        $this->queue->put($user_id);
    }

}
PK     M\([cj  j  #  user-sync/src/class-cli-command.phpnu [        <?php

namespace MC4WP\User_Sync;

use WP_CLI;
use WP_CLI_Command;

class CLI_Command extends WP_CLI_Command {

	/**
	 * Synchronize all users (using the specified role from settings)
	 *
	 * @param $args
	 * @param $assoc_args
	 *
	 * ## EXAMPLES
	 *
	 *     wp mc4wp-user-sync all
	 *
	 * @subcommand all
	 */
	public function all( $args, $assoc_args ) {
		/** @var User_Handler $handler */
		$handler = mc4wp('user_sync.handler');

		/** @var Users $user_query */
		$user_query = mc4wp('user_sync.users');

		// get users matching role from settings
		$users = $user_query->get();
		$count = count( $users );
		WP_CLI::line( "$count users found." );
		if( $count <= 0 ) {
			return;
		}

		// show progress bar
		$notify = \WP_CLI\Utils\make_progress_bar( 'Working', $count );
		$user_ids = wp_list_pluck( $users, 'ID' );
		$errors = array();

		foreach( $user_ids as $user_id ) {

			try {
				$result = $handler->handle_user( $user_id );
			} catch( \Exception $e ) {
				$errors[$user_id] = $e->getMessage();
			}

			$notify->tick();
		}

		$notify->finish();

		if( ! empty( $errors ) ) {
			$errors_msg =  'The following errors occurred: ';
			foreach( $errors as $user_id => $e ) {
				$errors_msg .= PHP_EOL . sprintf( " - User #%d: %s", $user_id, $e );
			}
			WP_CLI::warning( $errors_msg );
		}

		WP_CLI::success( sprintf( "Synchronized %d users.", $count ) );
	}

	/**
	 * Synchronize a single user
	 *
	 * @param $args
	 * @param $assoc_args
	 *
	 * ## OPTIONS
	 *
	 * <user_id>
	 * : ID of the user to synchronize
	 *
	 * ## EXAMPLES
	 *
	 *     wp mc4wp-user-sync user 5
	 *
	 * @synopsis <user_id>
	 *
	 * @subcommand user
	 */
	public function user( $args, $assoc_args ) {

		$user_id = absint( $args[0] );

		/** @var User_Handler $handler */
		$handler = mc4wp('user_sync.handler');

		try {
			$handler->handle_user( $user_id );
		} catch( \Exception $e ) {
			WP_CLI::error( $e->getMessage() );
			return;
		}

		WP_CLI::success( sprintf( "User %d synchronized.", $user_id ) );
	}

	/**
	* @subcommand process-queue
	*/
	public function process_queue( $args, $assoc_args ) {
		do_action( 'mc4wp_user_sync_process_queue' );
	}	
}
PK     M\Mߒ      user-sync/src/functions.phpnu [        <?php

namespace MC4WP\User_Sync;

function get_settings() {
	$settings = (array) get_option( 'mc4wp_user_sync', array() );
	$defaults = array(
		'list' => '',
		'role' => '',
		'enabled' => 1,
		'field_map' => array(),
		'skip_empty_user_fields' => 0,
		'webhook_enabled' => 0,
		'webhook_secret' => '',
	);

	$settings = array_merge( $defaults, $settings );
	$settings['enabled'] = (int) $settings['enabled'];
	$settings['webhook_enabled'] = (int) $settings['webhook_enabled'];

	/**
	 * Filters Mailchimp Sync settings
	 *
	 * @param array $settings
	 */
	return (array) apply_filters( 'mc4wp_user_sync_settings', $settings );
}


/**
 * Sets up the schedule to run Mailchimp User Sync hourly
 *
 * @hooked plugin activation
 */
function setup_schedule() {
	$next_run = wp_next_scheduled( 'mc4wp_user_sync_process_queue' );
	if ( $next_run && ( $next_run - time() ) < 600 ) {
		return;
	}

	wp_schedule_event( time() + 600, 'every-10-minutes', 'mc4wp_user_sync_process_queue' );
}

/**
 * Clears the schedule to run Mailchimp User Sync every hour
 *
 * @hooked plugin deactivation
 */
function clear_schedule() {
	wp_clear_scheduled_hook( 'mc4wp_user_sync_process_queue' );
}
PK     M\H:    !  user-sync/src/default-filters.phpnu [        <?php

defined( 'ABSPATH' ) or exit;

add_filter( 'cron_schedules', function( $schedules ) {
	$schedules['every-10-minutes'] = array(
		'interval' => 60 * 10,
		'display' => __( 'Every 10 minutes', 'mc4wp-user-sync' ),
	);
	return $schedules;
} );

/**
 * For compatibility with User Extra Fields fields of the type "radio" and "checkboxes"
 *
 * @link https://codecanyon.net/item/user-extra-fields/12949844
 */
add_filter('mc4wp_user_sync_get_user_field', function($value, $meta_key, $user) {
    global $wpuef_option_model, $wpuef_user_model;

    if (substr($meta_key, 0, 10) !== 'wpuef_cid_'
        || false === $wpuef_option_model instanceof WPUEF_Option
        || false === $wpuef_user_model instanceof WPUEF_User) {
        return $value;
    }

    $cid = substr($meta_key,10);
    $extra_fields = $wpuef_option_model->get_option('json_fields_string');
    if (empty($extra_fields)) {
        return $value;
    }

    $extra_field = null;
    foreach ($extra_fields->fields as $field) {
        if($field->cid === $cid) {
            $extra_field = $field;
            break;
        }
    }

    if ($extra_field === null) {
        return $value;
    }

    if (false === in_array($extra_field->field_type, array('dropdown', 'radio', 'checkboxes'), true)) {
        return $value;
    }

    $value = $wpuef_user_model->get_field($cid, $user->ID);
    $value_labels = array();
    foreach ($extra_field->field_options->options as $index => $extra_option) {
        if ($extra_field->field_type === 'checkboxes' && isset($value[$index])) {
            $value_labels[] = $extra_option->label;
        }

        if ($extra_field->field_type === 'radio' && $value == $index) {
            $value_labels[] = $extra_option->label;
            break;
        }

        if ($extra_field->field_type === 'dropdown' && $value !== '' && $value == $index) {
            $value_labels[] = $extra_option->label;
            break;
        }

    }

    return join(', ', $value_labels );
}, 10, 3);
PK     M\ d!  d!    user-sync/src/class-users.phpnu [        <?php

namespace MC4WP\User_Sync;

use MC4WP_MailChimp_Subscriber;
use WP_User;
use WP_User_Query;
use Exception;

/**
 * Class UserRepository
 *
 * @package MC4WP\Sync
 */
class Users {

	private $list_id = '';

	/**
	 * @var string
	 */
	private $role = '';

	/**
	 * @var array
	 */
	private $field_map = array();

	/**
	 * @var Tools
	 */
	private $tools;

	/**
	 * @param string $list_id
	 * @param string $role
	 * @param array $field_map
	 */
	public function __construct( $list_id, $role = '', $field_map = array() ) {
		$this->list_id = $list_id;
		$this->role = $role;
		$this->field_map = $field_map;

		$this->tools = new Tools();
	}

	/**
	 * @param array $args
	 *
	 * @return array
	 */
	public function get( array $args = array() ) {
		$args['role'] = $this->role;
		$user_query = new WP_User_Query( $args );
		return $user_query->get_results();
	}

	/**
    * Counts all users matching the given role
    *
	 * @return int
	 */
	public function count() {
		global $wpdb;

		$sql = "SELECT COUNT(u.ID) FROM $wpdb->users u";
		$params = array();
		$prefix = is_multisite() ? $wpdb->get_blog_prefix( get_current_blog_id() ) : $wpdb->prefix;

		if( '' !== $this->role ) {
			$sql .= " INNER JOIN $wpdb->usermeta um2 ON um2.user_id = u.ID AND um2.meta_key = %s AND um2.meta_value LIKE %s";
			$params[] = $prefix . 'capabilities';
			$params[] = '%%' . $this->role . '%%';
		}

		if( is_multisite() ) {
			$sql .= " RIGHT JOIN {$wpdb->usermeta} um4 ON um4.user_id = u.ID AND um4.meta_key = %s";
			$params[] = $prefix . 'capabilities';
		}

		// now get number of users with meta key
		$query = empty( $params ) ? $sql : $wpdb->prepare( $sql, $params );
		$count = $wpdb->get_var( $query );
		return (int) $count;
	}

	/**
	 * @param string $mailchimp_id
	 * @return WP_User|null;
	 */
	public function get_user_by_mailchimp_id( $mailchimp_id ) {
		$args = array(
			'meta_key'     => '_mc4wp_sync_mailchimp_id',
			'meta_value'   => $mailchimp_id,
		);

		return $this->get_first_user( $args );
	}

    /**
     * @param string $email_address
     *
     * @return WP_User|null;
     */
    public function get_user_by_email_address( $email_address ) {
        $args = array(
            'user_email' => $email_address,
        );

        return $this->get_first_user( $args );
    }

	/**
	 * @return WP_User
	 */
	public function get_current_user() {
		return wp_get_current_user();
	}

	/**
	 * @param array $args
	 *
	 * @return null|WP_User
	 */
	public function get_first_user( array $args = array() ) {
		$args['number'] = 1;
		$users = $this->get( $args );

		if( empty( $users ) ) {
			return null;
		}

		return $users[0];
	}

    /**
     * @param int|WP_User $user_id
     * @return int
     */
	public function id( $user_id ) {
        if( $user_id instanceof WP_User ) {
            $user_id = $user_id->ID;
        }

        return $user_id;
    }

	/**
	 * @param int|WP_User $user
	 * @return WP_User
	 *
	 * @throws Exception
	 */
	public function user( $user ) {

		if( ! is_object( $user ) ) {
			$user = get_user_by( 'id', $user );
		}

		if( ! $user instanceof WP_User ) {
			throw new Exception( sprintf( 'Invalid user ID: %d', $user ) );
		}

		return $user;
	}



	/**
	 * @param WP_User $user
	 *
	 * @return bool
	 */
	public function should( WP_User $user ) {
		// Only handle user if it has a valid email address
		if( '' === $user->user_email || ! is_email( $user->user_email ) ) {
			return false;
		}

		$sync = true;

		// if role is set, make sure user has that role or don't sync
		if( ! empty( $this->role ) && ! in_array( $this->role, $user->roles ) ) {
			$sync = false;
		}

		/**
		 * Filters whether a user should be synchronized with Mailchimp or not.
		 *
		 * @param boolean $sync
		 * @param WP_User $user
		 */
		return (bool) apply_filters( 'mc4wp_user_sync_should_sync_user', $sync, $user );
	}

    /**
     * @param int $user_id
     * @param string $email_address
     */
    public function set_mailchimp_email_address( $user_id, $email_address ) {
        $user_id = $this->id( $user_id );
        update_user_meta( $user_id, '_mc4wp_sync_mailchimp_email_address', $email_address );
    }

    /**
     * @param int $user_id
     */
    public function delete_mailchimp_email_address( $user_id ) {
        $user_id = $this->id( $user_id );
        delete_user_meta( $user_id, '_mc4wp_sync_mailchimp_email_address' );
    }

    /**
     * @param int $user_id
     * @return string
     */
    public function get_mailchimp_email_address( $user_id ) {
        $user_id = $this->id( $user_id );
        $email_address = get_user_meta( $user_id, '_mc4wp_sync_mailchimp_email_address', true );
        return is_string( $email_address ) ? $email_address : '';
    }

    /**
     * @param int $user_id
     * @return string
     */
    public function get_mailchimp_id( $user_id ) {
        $user_id = $this->id( $user_id );
		$mailchimp_id = get_user_meta( $user_id, '_mc4wp_sync_mailchimp_id', true );
        return is_string( $mailchimp_id ) ? $mailchimp_id : '';
    }

	/**
	 * @param int $user_id
	 * @param string $mailchimp_id
	 */
	public function set_mailchimp_id( $user_id, $mailchimp_id ) {
        $user_id = $this->id( $user_id );
		update_user_meta( $user_id, '_mc4wp_sync_mailchimp_id', $mailchimp_id );
	}

	/**
	 * @param int $user_id
	 */
	public function delete_mailchimp_id( $user_id ) {
        $user_id = $this->id( $user_id );
		delete_user_meta( $user_id, '_mc4wp_sync_mailchimp_id' );
	}

	/**
	 * @param WP_User $user
	 * @return array
	 */
	public function get_user_merge_fields( WP_User $user ) {
		$settings = get_settings();
		$merge_fields = array();

		if( ! empty( $user->first_name ) ) {
            $merge_fields['FNAME'] = $user->first_name;
		}

		if( ! empty( $user->last_name ) ) {
            $merge_fields['LNAME'] = $user->last_name;
		}

		if( ! empty( $user->first_name ) && ! empty( $user->last_name ) ) {
            $merge_fields['NAME'] = sprintf( '%s %s', $user->first_name, $user->last_name );
		}

		// Do we have mapping rules for user fields to mailchimp fields?
		if( ! empty( $this->field_map ) ) {

			// loop through mapping rules
			foreach( $this->field_map as $rule ) {
				// skip broken settings
				if ( empty( $rule['mailchimp_field'] ) || empty( $rule['user_field'] ) ) {
					continue;
				}

				// get field value
				$value = $this->tools->get_user_field( $user, $rule['user_field'] );

				if ( is_string( $value ) ) {

					// skip field is value is empty & setting to skip empty user fields is enabled
					if ( $value === '' && $settings['skip_empty_user_fields'] ) {
						continue;
					}

                    $merge_fields[ $rule['mailchimp_field'] ] = $value;
				}
			}
		}

		return $merge_fields;
	}

	/**
	 * @param WP_User $user
	 *
	 * @return MC4WP_MailChimp_Subscriber
	 */
    public function user_to_subscriber( WP_User $user ) {
        $subscriber = new MC4WP_MailChimp_Subscriber();
        $subscriber->email_address = $user->user_email;
        $subscriber->merge_fields = $this->get_user_merge_fields( $user );

        // set all fields we don't want to modify to null so they are omitted from the PATCH request
        $subscriber->status = null;
        $subscriber->tags = null;
        $subscriber->interests = null;
        $subscriber->email_type = null;

        /**
         * Filter data that is sent to Mailchimp
         *
         * @param MC4WP_MailChimp_Subscriber $subscriber
         * @param WP_User $user
         */
        $subscriber = apply_filters( 'mc4wp_user_sync_subscriber_data', $subscriber, $user );

        /**
         * @deprecated
         * @see mc4wp_user_sync_subscriber_data
         */
        $subscriber = apply_filters( 'mailchimp_sync_subscriber_data', $subscriber, $user );

        return $subscriber;
    }

    /**
     * @param WP_User $user
     * @return string
     */
    public function user_to_hash( WP_User $user ) {
        $subscriber = $this->user_to_subscriber( $user );
        return $this->subscriber_to_hash( $subscriber );
    }

    /**
     * @param MC4WP_MailChimp_Subscriber $subscriber
     * @return string
     */
    public function subscriber_to_hash( MC4WP_MailChimp_Subscriber $subscriber ) {
        return md5( json_encode( $subscriber->to_array() ) );
    }

    public function get_hash( $user_id ) {
        return (string) get_user_meta( $user_id, '_mc4wp_sync_hash', true );
    }

    public function set_hash( $user_id, $hash ) {
        update_user_meta( $user_id, '_mc4wp_sync_hash', $hash );
    }

}
PK     M\ˁ    $  user-sync/src/class-user-handler.phpnu [        <?php

namespace MC4WP\User_Sync;

use Exception;
use MC4WP_MailChimp_Subscriber;
use MC4WP_API_v3;
use MC4WP_Debug_Log;
use WP_User;

class User_Handler {

	/**
	 * @var string The List ID to sync with
	 */
	private $list_id;

    /**
     * @var Users
     */
	private $users;

	const SKIPPED = -1;
	const NOT_ON_LIST = 0;
	const UPDATED = 1;
	const EMAIL_ALREADY_EXISTS_IN_LIST = 20;

	/**
	 * Constructor
	 *
	 * @param string $list_id
	 * @param Users $users
	 */
	public function __construct( $list_id, Users $users )
	{
		$this->list_id = $list_id;
		$this->users = $users;
	}

	/**
	 * Add hooks to call the subscribe, update & unsubscribe methods automatically
	 */
	public function add_hooks() {
		// custom actions for people to use if they want to call the class actions
		add_action( 'mc4wp_user_sync_handle_user', array( $this, 'handle_user' ) );
	}

	/**
	 * Updates the given user, based on the User Sync settings.
	 * This does not change a subscriber's status (ie does not subscribe or unsubscribe), just updates their fields in Mailchimp.
	 *
	 * @param int $user_id
	 * @return int
	 * @throws Exception
	 */
	public function handle_user( $user_id ) {
		$user = $this->users->user( $user_id );

		// update only if user matches given criteria (role, filter)
		$handle = $this->users->should( $user );
		if (!$handle) {
			// Indicates user should be skipped, eg because user role didn't match settings or user has no email address
		    return self::SKIPPED;
        }

        $api = $this->get_api();
        try {
            $subscriber = $this->users->user_to_subscriber( $user );

            // send request to old email address if we have it
            $mailchimp_email_address = $this->users->get_mailchimp_email_address( $user_id );
            if ( empty( $mailchimp_email_address ) ) {
                $mailchimp_email_address = $subscriber->email_address;
            }

            $member = $api->update_list_member($this->list_id, $mailchimp_email_address, $subscriber->to_array());
        } catch(\MC4WP_API_Resource_Not_Found_Exception $e) {
           return self::NOT_ON_LIST; // Indicates user is not on list
        } catch(\MC4WP_API_Exception $e) {
			if ($e->title === 'Invalid Resource'
			    && is_array($e->errors)
			    && count($e->errors) > 0
			    && isset($e->errors[0]->field)
			    && $e->errors[0]->field === 'email address'
			    && stripos($e->errors[0]->message, 'already in this list') !== false) {
				return self::EMAIL_ALREADY_EXISTS_IN_LIST;
			}

			throw $e;

        }

        // Success!
        $this->get_log()->info( sprintf( 'User Sync > Updated user %d (%s)', $user->ID, $user->user_email ) );

        // Store remote email address
        $this->users->set_mailchimp_id( $user_id, $member->unique_email_id );
        $this->users->set_mailchimp_email_address( $user_id, $member->email_address );
        $this->users->set_hash( $user_id, $this->users->subscriber_to_hash( $subscriber ) );
        return self::UPDATED;
	}



    /**
     * @return MC4WP_API_v3
     */
    private function get_api() {
        return mc4wp('api');
    }

	/**
	 * Returns an instance of the Debug Log
	 *
	 * @return MC4WP_Debug_Log
	 */
	private function get_log() {
		return mc4wp( 'log' );
	}


}


PK     M\|l  l  (  user-sync/src/class-webhook-listener.phpnu [        <?php

namespace MC4WP\User_Sync;

use WP_User;
use MC4WP_Debug_Log;

/**
 * Class Webhook_Listener
 *
 * This class listens on your-site.com/mc4wp-sync-api/webhook-listener for Mailchimp webhook events.
 *
 * Once triggered, it will look for the corresponding WP user and update it using the field map defined in the settings of the Sync plugin.
 */
class Webhook_Listener {

	/**
	 * @var array
	 */
	private $settings;

	/**
	 * @var string
	 */
	const URL = '/mc4wp-sync-api/webhook-listener';

	/**
	 * @param array $settings
	 */
	public function __construct( array $settings ) {
		$this->settings = $settings;
	}

	/**
	 * Add hooks
	 */
	public function add_hooks() {
		add_action( 'init', array( $this, 'listen' ) );
	}

	/**
	 * Listen for webhook requests
	 */
	public function listen() {
		if( $this->is_triggered() ) {
			$this->handle();
			exit;
		}
	}

	/**
	 * Yes?
	 *
	 * @return bool
	 */
	public function is_triggered() {
		return strpos( $_SERVER['REQUEST_URI'], self::URL ) !== false;
	}

	/**
	 * Handle the request
	 */
	public function handle() {
		// no parameters = Mailchimp webhook validator
		// we skip webhook secret validation here
		if( empty( $_POST['data'] ) || empty( $_POST['type'] ) ) {
			status_header( 200 );
			echo "Listening..";
			return;
		}

		if (! $this->settings['webhook_enabled']) {
			return;
		}

		// check for secret key
		if( $this->settings['webhook_secret'] === '' || ! isset( $_GET[ $this->settings['webhook_secret'] ] ) ) {
			status_header( 403 );
			return;
		}

		$log = $this->get_log();
		define( 'MC4WP_SYNC_DOING_WEBHOOK', true );

		$user = null;
		$data = stripslashes_deep( $_REQUEST['data'] );
		$type = (string) $_REQUEST['type'];

        /**
         * Filter webhook data that is received by Mailchimp.
         *
         * @param array $data
         * @param string $type
         */
        $data = apply_filters( 'mc4wp_user_sync_webhook_data', $data, $type );

		/**
		 * @deprecated
		 * @see mc4wp_user_sync_webhook_data
		 */
		$data = apply_filters( 'mailchimp_sync_webhook_data', $data, $type );

		// parameters but incorrect: throw error status
		if (empty($data['web_id']) && empty($data['id']) && empty($data['old_email']) && empty($data['email'])) {
			status_header( 400 );
			return;
		}

		/** @var Users $users */
		$users = mc4wp('user_sync.users');

		// find WP user by Mailchimp unique email ID
        if (isset($data['id'])) {
            $user = $users->get_user_by_mailchimp_id($data['id']);
        }

		// Still no user found? Try "old_email" property used in "upemail" requests
		if (! $user instanceof WP_User && isset($data['old_email'])) {
            $user = $users->get_user_by_email_address( $data['old_email'] );
        }

		// Still no user found? Try "email" property 
		if (! $user instanceof WP_User && isset($data['email'])) {
            $user = $users->get_user_by_email_address( $data['email'] );
        }
		/**
		 * Filters the WordPress user that is found by the webhook request
		 *
		 * @param WP_User|null $user
		 * @param array $data
		 */
		$user = apply_filters( 'mc4wp_user_sync_webhook_user', $user, $data );

		/**
		 * @deprecated
		 * @see mc4wp_user_sync_webhook_user
		 */
		$user = apply_filters( 'mailchimp_sync_webhook_user', $user, $data );

		if( ! $user instanceof WP_User ) {
			// log a warning
			$log->info( sprintf( "Webhook: No user found for Mailchimp ID: %s", $data['id'] ) );

			// fire event when no user is found
			do_action( 'mc4wp_user_sync_webhook_no_user', $data );
			echo 'No corresponding user found for this subscriber.';

			// exit early
			status_header( 200 );
			return;
		}

		// we have a user at this point
        $log->info( sprintf( "Webhook: Request of type %s received for user #%d", $type, $user->ID ) );

		$updated = false;

		// User might not have correct sync key (if supplied by filter)
		$mailchimp_id = $users->get_mailchimp_id( $user->ID );
		if (isset($data['id']) && $mailchimp_id !== $data['id']) {
		    $users->set_mailchimp_id( $user->ID, $data['id']);
			$updated = true;
		}

		// update user email if it's given, valid and different
		if( $type === 'upemail' && isset( $data['new_email'] ) && is_email( $data['new_email'] ) && $data['new_email'] !== $user->user_email ) {
			add_filter( 'send_email_change_email', '__return_false', 99 );
			wp_update_user(
				array(
					'ID'         => $user->ID,
					'user_email' => $data['new_email']
				)
			);
            $users->set_mailchimp_id( $user->ID, $data['new_id']);
			$users->set_mailchimp_email_address( $user->ID, $data['new_email']);
			$updated = true;
		}

		if ($type === 'profile') {
            // update WP user with data (use reversed field map)
            // loop through mapping rules
            foreach ($this->settings['field_map'] as $rule) {

                // is this field present in the request data? do not use empty here
                if (isset($data['merges'][$rule['mailchimp_field']])) {

                    // is scalar value?
                    $value = $data['merges'][$rule['mailchimp_field']];
                    if (!is_scalar($value)) {
                        continue;
                    }

                    // update user property if it changed
                    if ($user->{$rule['user_field']} !== $value) {
                        update_user_meta($user->ID, $rule['user_field'], $value);
                        $updated = true;
                    }
                }

            }
        }

		if( $updated ) {
			$log->info( sprintf( "Webhook: Updated user #%d", $user->ID ) );
		}

		/**
		 * Fire an event to allow custom actions, like deleting the user if this is an unsubscribe ping.
		 *
		 * @param array $data
		 * @param WP_User $user
		 */
		do_action( 'mc4wp_user_sync_webhook', $data, $user );

		/**
		 * Fire type specific event.
		 *
		 * The dynamic portion of the hook, $type, regers to the webhook event type.
		 *
		 * Example: mc4wp_user_sync_webhook_unsubscribe
		 *
		 * @param array $data
		 * @param WP_User $user
		 */
		do_action( 'mc4wp_user_sync_webhook_' . $type, $data, $user );

		status_header(200);
		return;
	}

	/**
	 * @return MC4WP_Debug_Log
	 */
	private function get_log() {
		return mc4wp('log');
	}

}PK     M\mLS    %  user-sync/src/class-ajax-listener.phpnu [        <?php

namespace MC4WP\User_Sync;

class Ajax_Listener {

	/**
	 * @var User_Handler
	 */
	protected $user_handler;

	/**
	 * @var Users
	 */
	protected $users;

	/**
	 * Constructor
	 *
	 * @param User_Handler $user_handler
	 * @param Users $users
	 */
	public function __construct( User_Handler $user_handler, Users $users  ) {
		$this->user_handler = $user_handler;
		$this->users = $users;
	}

	/**
	 * Add hooks
	 */
	public function add_hooks() {
		add_action( 'wp_ajax_mc4wp_user_sync_get_user_count', array( $this, 'get_user_count' ) );
		add_action( 'wp_ajax_mc4wp_user_sync_get_users', array( $this, 'get_users' ) );
		add_action( 'wp_ajax_mc4wp_user_sync_handle_user', array( $this, 'handle_user' ) );
	}

	/**
	 * Get user count
	 */
	public function get_user_count() {
		$this->authorize();
		$count = $this->users->count();
		$this->respond( $count );
	}

	/**
	 * Responds with an array of all user ID's
	 */
	public function get_users() {
		$this->authorize();
		$offset = ( isset( $_REQUEST['offset'] ) ? intval( $_REQUEST['offset'] ) : 0 );
		$limit = ( isset( $_REQUEST['limit'] ) ? intval( $_REQUEST['limit'] ) : 0 );

		// get users
		$users = $this->users->get( array( 'fields' => array( 'ID', 'user_login', 'user_email' ), 'offset' => $offset, 'number' => $limit ));

		// send response
		$this->respond( $users );
	}

	/**
	 * Subscribes the provided user ID
	 */
	public function handle_user() {
		$this->authorize();

		$user_id = (int) $_REQUEST['user_id'];

		try {
			$status = $this->user_handler->handle_user( $user_id );
		} catch( \Exception $e ) {
			$this->respond(
				array(
					'success' => 0,
					'message' =>  $e->getMessage(),
				)
			);
			return;
		}

		switch ($status) {
			case User_Handler::UPDATED:
				$message = sprintf( __( 'Updated user %d', 'mailchimp-sync' ), $user_id );
				break;

			case User_Handler::SKIPPED:
				$message = sprintf( __( 'Skipped user %d', 'mailchimp-sync' ), $user_id );
				break;

			case User_Handler::NOT_ON_LIST:
				$message = sprintf( __( 'User %d was not found on Mailchimp list', 'mailchimp-sync' ), $user_id );
				break;

			case User_Handler::EMAIL_ALREADY_EXISTS_IN_LIST:
				$message = sprintf( __( 'New email address of user already exists in Mailchimp', 'mailchimp-sync' ), $user_id );
				break;

			default:
				throw new \LogicException();
		}

		$data = array(
			'success' => 1,
			'message' => $message,
		);
		$this->respond( $data );
	}

	private function authorize() {
		if ( ! current_user_can( 'manage_options' ) ) {
			exit;
		}
	}

	/**
	 * Send a JSON response
	 *
	 * @param mixed $data
	 */
	private function respond( $data ) {
		send_origin_headers();
		@header( 'X-Content-Type-Options: nosniff' );
		@header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
		send_nosniff_header();
		nocache_headers();

		// clear output, some plugins might have thrown errors by now.
		if( ob_get_level() > 0 ) {
			ob_end_clean();
		}

		wp_send_json( $data );
		exit;
	}

}
PK     M\_Xj(  j(    user-sync/src/class-admin.phpnu [        <?php

namespace MC4WP\User_Sync;

use MC4WP_MailChimp;
use MC4WP_Queue;
use Mockery\Exception;

class Admin {

	/**
	 * @const string
	 */
	const SETTINGS_CAP = 'manage_options';

	/**
	 * @var array $options
	 */
	private $options;

	/**
	 * @var string
	 */
	private $plugin_slug;

	/**
	 * Constructor
	 *
	 * @param array $options
	 */
	public function __construct( array $options ) {
		$this->options = $options;
		$this->plugin_slug = plugin_basename( MC4WP_USER_SYNC_PLUGIN_FILE );
	}

	/**
	 * Add hooks
	 */
	public function add_hooks() {
		add_action( 'admin_init', array( $this, 'init' ) );
		add_filter( 'mc4wp_admin_menu_items', array( $this, 'add_menu_items' ) );
		add_action( 'mc4wp_admin_process_user_sync_queue', array( $this, 'process_queue' ) );
		add_action( 'mc4wp_admin_save_user_sync_settings', array( $this, 'save_settings' ) );
	}

	/**
	 * Runs on `admin_init`
	 */
	public function init() {
		// only run for administrators
		if( ! current_user_can( self::SETTINGS_CAP ) ) {
			return false;
		}

		// add link to settings page from plugins page
		add_filter( 'plugin_action_links_' . $this->plugin_slug, array( $this, 'add_plugin_settings_link' ) );
		add_filter( 'plugin_row_meta', array( $this, 'add_plugin_meta_links'), 10, 2 );

		add_action( 'admin_enqueue_scripts', array( $this, 'load_assets' ) );
	}

	/**
	 * Register menu pages
	 *
	 * @param array $items
	 *
	 * @return array
	 */
	public function add_menu_items( $items ) {
		$item = array(
			'title' => esc_html__( 'MailChimp User Sync', 'mailchimp-sync' ),
			'text' => esc_html__( 'User Sync', 'mailchimp-sync' ),
			'slug' => 'user-sync',
			'callback' => array( $this, 'show_settings_page' )
		);

		$items[] = $item;
		return $items;
	}

	/**
	 * Add the settings link to the Plugins overview
	 *
	 * @param array $links
	 * @return array
	 */
	public function add_plugin_settings_link( $links ) {
		$settings_link = sprintf( '<a href="%s">%s</a>', esc_url( admin_url( 'admin.php?page=mailchimp-for-wp-user-sync' ) ), esc_html__( 'Settings', 'mailchimp-for-wp' ) );
		array_unshift( $links, $settings_link );
		return $links;
	}

	/**
	 * Adds meta links to the plugin in the WP Admin > Plugins screen
	 *
	 * @param array $links
	 * @param string $file
	 * @return array
	 */
	public function add_plugin_meta_links( $links, $file ) {
		if( $file !== $this->plugin_slug ) {
			return $links;
		}

		$links[] = sprintf( esc_html__( 'An add-on for %s', 'mailchimp-sync' ), '<a href="https://www.mc4wp.com/#utm_source=wp-plugin&utm_medium=mailchimp-user-sync&utm_campaign=plugins-page">Mailchimp for WordPress</a>' );
		return $links;
	}

	/**
	 * Load assets if we're on the settings page of this plugin
	 */
	public function load_assets() {
		if( ! isset( $_GET['page'] ) || $_GET['page'] !== 'mailchimp-for-wp-user-sync' ) {
			return;
		}

		wp_enqueue_style( 'mailchimp-user-sync-admin', $this->asset_url( "/css/admin.css" ) );
		wp_enqueue_script( 'mailchimp-user-sync-wizard', $this->asset_url( "/js/admin.js" ), array(), MC4WP_USER_SYNC_PLUGIN_VERSION, true );
	}

	/**
	 * Outputs the settings page
	 */
	public function show_settings_page() {
		if (isset($_GET['debug-field-map'])) {
			$this->show_debug_field_map_page();
			return;
		}

	    $mailchimp = new MC4WP_MailChimp();
		$lists = $mailchimp->get_lists();

		/** @var MC4WP_Queue $queue */
		$queue = mc4wp('user_sync.queue');

		if ($this->options['list'] !== '') {
			$selected_list = $mailchimp->get_list($this->options['list']);
			$available_mailchimp_fields = $mailchimp->get_list_merge_fields($this->options['list']);
		}

		// query meta keys for use in a <select> element in the field map
		$meta_keys = $this->get_available_user_meta_keys();

		// reset index on field map
		$this->options['field_map'] = array_values( $this->options['field_map'] );

		// make sure field map always has at least 1 element
		if (count($this->options['field_map']) === 0) {
			$this->options['field_map'] = array(
				array( 'user_field' => '', 'mailchimp_field' => ''),
			);
		}

		require MC4WP_USER_SYNC_PLUGIN_DIR  . '/views/settings-page.php';
	}

	/** @return array */
	private function get_available_user_meta_keys() {
		global $wpdb;

		$meta_keys = get_transient('mc4wp_user_sync_available_meta_keys');
		if (empty($meta_keys)) {
			$meta_keys = $wpdb->get_col("SELECT DISTINCT(meta_key) FROM {$wpdb->usermeta};");
			set_transient('mc4wp_user_sync_available_meta_keys', $meta_keys, HOUR_IN_SECONDS);
		}

		return $meta_keys;
	}

	// GET /wp-admin/admin.php?page=mailchimp-for-wp-user-sync&debug-field-map&user_id=123
	private function show_debug_field_map_page() {
		/** @var Users $users */
		$users = mc4wp('user_sync.users');

		echo '<h2>Mailchimp User Sync: Debug user data</h2>';
		try {
			$user_id = (int) $_GET['user_id'];
			$user = $users->user($user_id);
			$subscriber = $users->user_to_subscriber($user);
			echo '<pre>';
			print_r( $subscriber );
			echo '</pre>';
		} catch (\Exception $e) {
			echo '<p>' , sprintf( __( 'No user found with ID %d.', 'mailchimp-sync'), $user_id ), '</p>';
		}

		echo '<p><a href="', admin_url('admin.php?page=mailchimp-for-wp-user-sync') ,'">', __( 'Go back', 'mailchimp-sync'), '</a></p>';
		exit;
	}

	/**
	 * @param $url
	 *
	 * @return string
	 */
	protected function asset_url( $url ) {
		return plugins_url( '/assets' . $url, MC4WP_USER_SYNC_PLUGIN_FILE );
	}

	/**
	 * @param $option_name
	 *
	 * @return string
	 */
	protected function name_attr( $option_name ) {

		if( substr( $option_name, -1 ) !== ']' ) {
			return 'mc4wp_user_sync[' . $option_name . ']';
		}

		return 'mc4wp_user_sync' . $option_name;
	}

	public function save_settings() {
		$redirect_url = admin_url('admin.php?page=mailchimp-for-wp-user-sync');
		$old_settings = $this->options;
		$new_settings = $_POST['mc4wp_user_sync'];
		$settings = array_merge( $old_settings, $new_settings );

		$settings['enabled'] = (int) $settings['enabled'];
		$list_changed = $old_settings['list'] !== $settings['list'];

		// empty field mappers if list changed
		if ( $list_changed  ) {
			$settings['field_map'] = array();
		}

		if( isset( $settings['field_map'] ) ) {
			foreach( $settings['field_map'] as $key => $mapper ) {
				if( empty( $mapper['user_field'] ) || empty( $mapper['mailchimp_field'] ) ) {
					unset( $settings['field_map'][ $key ] );
					continue;
				}

				// trim values
				$settings['field_map'][ $key ] = array(
					'user_field' => trim( $mapper['user_field'] ),
					'mailchimp_field' => trim( $mapper['mailchimp_field'] )
				);
			}
		} else {
			$settings['field_map'] = array();
		}

		$settings['webhook_enabled'] = (int) $settings['webhook_enabled'];
		if ($settings['webhook_enabled'] === 1 && ( $old_settings['webhook_enabled'] === 0 || $list_changed ) ) {
			$webhook_secret = $this->create_webhook( $settings['list'] );

			// if webhook creation failed, don't update setting
			if ( $webhook_secret !== '' ) {
				$settings['webhook_secret'] = $webhook_secret;
			} else {
				$settings['webhook_enabled'] = false;
				$settings['webhook_secret'] = '';
				$redirect_url = add_query_arg( array( 'webhook-created' => 0 ), $redirect_url );
			}
		}

		if ($old_settings['webhook_enabled'] === 1 && ( $settings['webhook_enabled'] === 0 || $list_changed ) ) {
			$this->delete_webhook( $old_settings['list'] );
		}

		// reschedule action if needed
        setup_schedule();

		update_option( 'mc4wp_user_sync', $settings, true );
		wp_redirect( $redirect_url );
		exit;
	}

	private function create_webhook( $list_id ) {
		/** @var \MC4WP_API_V3 $api */
		$api = mc4wp('api');
		$client = $api->get_client();
		$secret_key = wp_generate_password( 20, false, false );
		$webhook_url = get_home_url( null, Webhook_Listener::URL . '?' . urlencode( $secret_key ) );

		// create webhook in Mailchimp
		try {
			$resource = sprintf( 'lists/%s/webhooks', $list_id );
			$client->post( $resource, array(
				'url' => $webhook_url,
				'events' => (object)array(
					'profile' => true,
					'upemail' => true,
					'subscribe' => true,
					'unsubscribe' => true,
					'campaign' => false,
					'cleaned' => false,
				),
				'sources' => (object)array(
					'user' => true,
					'admin' => true,
					'api' => false,
				),
			) );
		} catch(\MC4WP_API_Exception $e) {
			mc4wp('log')->error(sprintf("User Sync: Error creating webhook. Mailchimp returned the following response: \n%s", $e));
			// Most likely the URL was rejected because Mailchimp could not resolve it (eg when on localhost)
			return '';
		}

		return $secret_key;
	}

	private function delete_webhook( $list_id ) {
		/** @var \MC4WP_API_V3 $api */
		$api = mc4wp('api');
		$client = $api->get_client();

		try {
			$resource = sprintf( '/lists/%s/webhooks', $list_id );
			$data     = $client->get( $resource );
		} catch (\MC4WP_API_Resource_Not_Found_Exception $e) {
			// list already deleted, incl. all of its webhooks
			return;
		}

		foreach ( $data->webhooks as $webhook ) {
			if ( strpos( $webhook->url, Webhook_Listener::URL ) !== false ) {
				$resource = sprintf( '/lists/%s/webhooks/%s', $list_id, $webhook->id );

				try {
					$client->delete( $resource );
				} catch (\MC4WP_API_Resource_Not_Found_Exception $e) {
					// webhook already deleted
				}
			}
		}

	}

	/**
	 * Returns a HEX color from a percentage (red to green)
	 *
	 * @param        $value
	 * @param int    $brightness
	 * @param int    $max
	 * @param int    $min
	 * @param string $thirdColorHex
	 *
	 * @return string
	 */
	protected function percentage_to_color( $value, $brightness = 255, $max = 100, $min = 0, $thirdColorHex = '00') {
		// Calculate first and second color (Inverse relationship)
		$first = (1-($value/$max))*$brightness;
		$second = ($value/$max)*$brightness;
		// Find the influence of the middle color (yellow if 1st and 2nd are red and green)
		$diff = abs($first-$second);
		$influence = ($brightness-$diff)/2;
		$first = intval($first + $influence);
		$second = intval($second + $influence);
		// Convert to HEX, format and return
		$firstHex = str_pad(dechex($first),2,0,STR_PAD_LEFT);
		$secondHex = str_pad(dechex($second),2,0,STR_PAD_LEFT);
		return $firstHex . $secondHex . $thirdColorHex ;
	}

	/**
	* Processes all queued background jobs
	*/
	public function process_queue() {
		do_action( 'mc4wp_user_sync_process_queue' );
	}


}
PK     M\N      user-sync/src/class-tools.phpnu [        <?php

namespace MC4WP\User_Sync;

use WP_User;

class Tools {

	/**
	 * Returns the translated role of the current user. If that user has
	 * no role for the current blog, it returns false.
	 *
	 * @param WP_User $user
	 * @return string The name of the current role
	 **/
	public function get_user_role( WP_User $user ) {
		global $wp_roles;
		$roles = $user->roles;
		$role = $roles[0];
		return isset( $wp_roles->role_names[$role] ) ? translate_user_role( $wp_roles->role_names[$role] ) : '';
	}

	/**
	 * @param WP_User $user
	 * @param string $field_name
	 *
	 * @return string
	 */
	public function get_user_field( WP_User $user, $field_name) {

		$magic_fields = array( 'role' );

		if( in_array( $field_name, $magic_fields, true ) ) {
			return $this->get_user_magic_field( $user, $field_name );
		}

		// default to empty string
		$value = '';

		// does user have this property?
		if( $user->has_prop( $field_name ) ) {

			// get value
			$value = $user->get( $field_name );

			// convert array to comma-separated string
			if( is_array( $value ) ) {
				$value = join( ', ', $value );
			}
		}

		// revert back to string if value is not a scalar type by now
		$value = is_scalar($value) ? (string) $value : '';

		/**
		 * Filters the field value that is returned for unknown fields
		 *
		 * @param string $value
		 * @param string $field_name
		 * @param WP_User $user
		 */
		$value = apply_filters( 'mc4wp_user_sync_get_user_field', $value, $field_name, $user );

		/**
		 * @deprecated
		 * @see mc4wp_user_sync_get_user_field
		 */
		$value = apply_filters( 'mailchimp_sync_get_user_field', $value, $field_name, $user );

		return $value;
	}

	/**
	 * @param WP_User $user
	 * @param string $field_name
	 *
	 * @return string|bool
	 */
	public function get_user_magic_field( WP_User $user, $field_name ) {
		switch( $field_name ) {
			case 'role':
				return $this->get_user_role( $user );
				break;
		}

		return false;
	}


}
PK     M\P+  +    user-sync/assets/js/admin.jsnu [        !function r(o,i,l){function a(t,e){if(!i[t]){if(!o[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(u)return u(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}n=i[t]={exports:{}},o[t][0].call(n.exports,function(e){return a(o[t][1][e]||e)},n,n.exports,r,o,i,l)}return i[t].exports}for(var u="function"==typeof require&&require,e=0;e<l.length;e++)a(l[e]);return a}({1:[function(e,t,n){"use strict";var u=e("../render/vnode");t.exports=function(r,e,t){var o=[],n=!1,i=!1;function l(){if(n)throw new Error("Nested m.redraw.sync() call");n=!0;for(var e=0;e<o.length;e+=2)try{r(o[e],u(o[e+1]),a)}catch(e){t.error(e)}n=!1}function a(){i||(i=!0,e(function(){i=!1,l()}))}return a.sync=l,{mount:function(e,t){if(null!=t&&null==t.view&&"function"!=typeof t)throw new TypeError("m.mount(element, component) expects a component, not a vnode");var n=o.indexOf(e);0<=n&&(o.splice(n,2),r(e,[],a)),null!=t&&(o.push(e,t),r(e,u(t),a))},redraw:a}}},{"../render/vnode":20}],2:[function(e,t,n){!function(A){!function(){"use strict";var E=e("../render/vnode"),i=e("../render/hyperscript"),k=e("../promise/promise"),o=e("../pathname/build"),T=e("../pathname/parse"),S=e("../pathname/compileTemplate"),j=e("../pathname/assign"),_={};t.exports=function(d,p){var u;function h(e,t,n){var r;e=o(e,t),null!=u?(u(),t=n?n.state:null,r=n?n.title:null,n&&n.replace?d.history.replaceState(t,r,x.prefix+e):d.history.pushState(t,r,x.prefix+e)):d.location.href=x.prefix+e}var m,v,y,g,w=_,b=x.SKIP={};function x(e,t,n){if(null==e)throw new Error("Ensure the DOM element that was passed to `m.route` is not undefined");var r,s=0,c=Object.keys(n).map(function(e){if("/"!==e[0])throw new SyntaxError("Routes must start with a `/`");if(/:([^\/\.-]+)(\.{3})?:/.test(e))throw new SyntaxError("Route parameter names must be separated with either `/`, `.`, or `-`");return{route:e,component:n[e],check:S(e)}}),o="function"==typeof A?A:setTimeout,f=k.resolve(),i=!1;if((u=null)!=t){var l=T(t);if(!c.some(function(e){return e.check(l)}))throw new ReferenceError("Default route doesn't match any known routes")}function a(){i=!1;var e=d.location.hash,l=("#"!==x.prefix[0]&&(e=d.location.search+e,"?"!==x.prefix[0]&&"/"!==(e=d.location.pathname+e)[0]&&(e="/"+e)),e.concat().replace(/(?:%[a-f89][a-f0-9])+/gim,decodeURIComponent).slice(x.prefix.length)),a=T(l);function u(){if(l===t)throw new Error("Could not resolve default route "+t);h(t,null,{replace:!0})}j(a.params,d.history.state),function t(n){for(;n<c.length;n++){var r,e,o,i;if(c[n].check(a))return r=c[n].component,e=c[n].route,i=g=function(e){if(i===g){if(e===b)return t(n+1);m=null==e||"function"!=typeof e.view&&"function"!=typeof e?"div":e,v=a.params,y=l,g=null,w=r.render?r:null,2===s?p.redraw():(s=2,p.redraw.sync())}},void((o=r).view||"function"==typeof r?(r={},i(o)):r.onmatch?f.then(function(){return r.onmatch(a.params,l,e)}).then(i,u):i("div"))}u()}(0)}return u=function(){i||(i=!0,o(a))},"function"==typeof d.history.pushState?d.addEventListener("popstate",u,!(r=function(){d.removeEventListener("popstate",u,!1)})):"#"===x.prefix[0]&&(u=null,d.addEventListener("hashchange",a,!(r=function(){d.removeEventListener("hashchange",a,!1)}))),p.mount(e,{onbeforeupdate:function(){return!(!(s=s?2:1)||_===w)},oncreate:a,onremove:r,view:function(){var e;if(s&&_!==w)return e=[E(m,v.key,v)],w?w.render(e[0]):e}})}return x.set=function(e,t,n){null!=g&&((n=n||{}).replace=!0),g=null,h(e,t,n)},x.get=function(){return y},x.prefix="#!",x.Link={view:function(e){var n,r,o=e.attrs.options,t={},t=(j(t,e.attrs),t.selector=t.options=t.key=t.oninit=t.oncreate=t.onbeforeupdate=t.onupdate=t.onbeforeremove=t.onremove=null,i(e.attrs.selector||"a",t,e.children));return(t.attrs.disabled=Boolean(t.attrs.disabled))?(t.attrs.href=null,t.attrs["aria-disabled"]="true",t.attrs.onclick=null):(n=t.attrs.onclick,r=t.attrs.href,t.attrs.href=x.prefix+r,t.attrs.onclick=function(e){var t;"function"==typeof n?t=n.call(e.currentTarget,e):null!=n&&"object"==typeof n&&"function"==typeof n.handleEvent&&n.handleEvent(e),!1===t||e.defaultPrevented||0!==e.button&&0!==e.which&&1!==e.which||e.currentTarget.target&&"_self"!==e.currentTarget.target||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||(e.preventDefault(),e.redraw=!1,x.set(r,null,o))}),t}},x.param=function(e){return v&&null!=e?v[e]:v},x}}.call(this)}.call(this,e("timers").setImmediate)},{"../pathname/assign":6,"../pathname/build":7,"../pathname/compileTemplate":8,"../pathname/parse":9,"../promise/promise":11,"../render/hyperscript":16,"../render/vnode":20,timers:25}],3:[function(e,t,n){"use strict";var r=e("./render/hyperscript");r.trust=e("./render/trust"),r.fragment=e("./render/fragment"),t.exports=r},{"./render/fragment":15,"./render/hyperscript":16,"./render/trust":19}],4:[function(e,t,n){"use strict";function r(){return o.apply(this,arguments)}var o=e("./hyperscript"),i=e("./request"),l=e("./mount-redraw");r.m=o,r.trust=o.trust,r.fragment=o.fragment,r.mount=l.mount,r.route=e("./route"),r.render=e("./render"),r.redraw=l.redraw,r.request=i.request,r.jsonp=i.jsonp,r.parseQueryString=e("./querystring/parse"),r.buildQueryString=e("./querystring/build"),r.parsePathname=e("./pathname/parse"),r.buildPathname=e("./pathname/build"),r.vnode=e("./render/vnode"),r.PromisePolyfill=e("./promise/polyfill"),t.exports=r},{"./hyperscript":3,"./mount-redraw":5,"./pathname/build":7,"./pathname/parse":9,"./promise/polyfill":10,"./querystring/build":12,"./querystring/parse":13,"./render":14,"./render/vnode":20,"./request":21,"./route":23}],5:[function(e,t,n){"use strict";var r=e("./render");t.exports=e("./api/mount-redraw")(r,requestAnimationFrame,console)},{"./api/mount-redraw":1,"./render":14}],6:[function(e,t,n){"use strict";t.exports=Object.assign||function(t,n){n&&Object.keys(n).forEach(function(e){t[e]=n[e]})}},{}],7:[function(e,t,n){"use strict";var f=e("../querystring/build"),d=e("./assign");t.exports=function(e,r){if(/:([^\/\.-]+)(\.{3})?:/.test(e))throw new SyntaxError("Template parameter names *must* be separated");if(null==r)return e;var t=e.indexOf("?"),n=e.indexOf("#"),o=n<0?e.length:n,i=e.slice(0,t<0?o:t),l={},i=(d(l,r),i.replace(/:([^\/\.-]+)(\.{3})?/g,function(e,t,n){return delete l[t],null==r[t]?e:n?r[t]:encodeURIComponent(String(r[t]))})),a=i.indexOf("?"),u=i.indexOf("#"),s=u<0?i.length:u,c=i.slice(0,a<0?s:a),o=(0<=t&&(c+=e.slice(t,o)),0<=a&&(c+=(t<0?"?":"&")+i.slice(a,s)),f(l));return o&&(c+=(t<0&&a<0?"?":"&")+o),0<=n&&(c+=e.slice(n)),0<=u&&(c+=(n<0?"":"&")+i.slice(u)),c}},{"../querystring/build":12,"./assign":6}],8:[function(e,t,n){"use strict";var a=e("./parse");t.exports=function(e){var r=a(e),o=Object.keys(r.params),i=[],l=new RegExp("^"+r.path.replace(/:([^\/.-]+)(\.{3}|\.(?!\.)|-)?|[\\^$*+.()|\[\]{}]/g,function(e,t,n){return null==t?"\\"+e:(i.push({k:t,r:"..."===n}),"..."===n?"(.*)":"."===n?"([^/]+)\\.":"([^/]+)"+(n||""))})+"$");return function(e){for(var t=0;t<o.length;t++)if(r.params[o[t]]!==e.params[o[t]])return!1;if(!i.length)return l.test(e.path);var n=l.exec(e.path);if(null==n)return!1;for(t=0;t<i.length;t++)e.params[i[t].k]=i[t].r?n[t+1]:decodeURIComponent(n[t+1]);return!0}}},{"./parse":9}],9:[function(e,t,n){"use strict";var o=e("../querystring/parse");t.exports=function(e){var t=e.indexOf("?"),n=e.indexOf("#"),n=n<0?e.length:n,r=e.slice(0,t<0?n:t).replace(/\/{2,}/g,"/");return r?1<(r="/"!==r[0]?"/"+r:r).length&&"/"===r[r.length-1]&&(r=r.slice(0,-1)):r="/",{path:r,params:t<0?{}:o(e.slice(t+1,n))}}},{"../querystring/parse":13}],10:[function(e,t,n){!function(n){!function(){"use strict";function d(e){if(!(this instanceof d))throw new Error("Promise must be called with `new`");if("function"!=typeof e)throw new TypeError("executor must be a function");var i=this,l=[],a=[],o=t(l,!0),u=t(a,!1),s=i._instance={resolvers:l,rejectors:a},c="function"==typeof n?n:setTimeout;function t(r,o){return function t(n){var e;try{if(!o||null==n||"object"!=typeof n&&"function"!=typeof n||"function"!=typeof(e=n.then))c(function(){o||0!==r.length||console.error("Possible unhandled promise rejection:",n);for(var e=0;e<r.length;e++)r[e](n);l.length=0,a.length=0,s.state=o,s.retry=function(){t(n)}});else{if(n===i)throw new TypeError("Promise can't be resolved w/ itself");f(e.bind(n))}}catch(e){u(e)}}}function f(e){var n=0;function t(t){return function(e){0<n++||t(e)}}var r=t(u);try{e(t(o),r)}catch(e){r(e)}}f(e)}d.prototype.then=function(e,t){var o,i,l=this._instance;function n(t,e,n,r){e.push(function(e){if("function"!=typeof t)n(e);else try{o(t(e))}catch(e){i&&i(e)}}),"function"==typeof l.retry&&r===l.state&&l.retry()}var r=new d(function(e,t){o=e,i=t});return n(e,l.resolvers,o,!0),n(t,l.rejectors,i,!1),r},d.prototype.catch=function(e){return this.then(null,e)},d.prototype.finally=function(t){return this.then(function(e){return d.resolve(t()).then(function(){return e})},function(e){return d.resolve(t()).then(function(){return d.reject(e)})})},d.resolve=function(t){return t instanceof d?t:new d(function(e){e(t)})},d.reject=function(n){return new d(function(e,t){t(n)})},d.all=function(a){return new d(function(n,r){var o=a.length,i=0,l=[];if(0===a.length)n([]);else for(var e=0;e<a.length;e++)!function(t){function e(e){i++,l[t]=e,i===o&&n(l)}null==a[t]||"object"!=typeof a[t]&&"function"!=typeof a[t]||"function"!=typeof a[t].then?e(a[t]):a[t].then(e,r)}(e)})},d.race=function(r){return new d(function(e,t){for(var n=0;n<r.length;n++)r[n].then(e,t)})},t.exports=d}.call(this)}.call(this,e("timers").setImmediate)},{timers:25}],11:[function(n,r,e){!function(t){!function(){"use strict";var e=n("./polyfill");"undefined"!=typeof window?(void 0===window.Promise?window.Promise=e:window.Promise.prototype.finally||(window.Promise.prototype.finally=e.prototype.finally),r.exports=window.Promise):void 0!==t?(void 0===t.Promise?t.Promise=e:t.Promise.prototype.finally||(t.Promise.prototype.finally=e.prototype.finally),r.exports=t.Promise):r.exports=e}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./polyfill":10}],12:[function(e,t,n){"use strict";t.exports=function(e){if("[object Object]"!==Object.prototype.toString.call(e))return"";var t,o=[];for(t in e)!function e(t,n){if(Array.isArray(n))for(var r=0;r<n.length;r++)e(t+"["+r+"]",n[r]);else if("[object Object]"===Object.prototype.toString.call(n))for(var r in n)e(t+"["+r+"]",n[r]);else o.push(encodeURIComponent(t)+(null!=n&&""!==n?"="+encodeURIComponent(n):""))}(t,e[t]);return o.join("&")}},{}],13:[function(e,t,n){"use strict";t.exports=function(e){if(""===e||null==e)return{};for(var t=(e="?"===e.charAt(0)?e.slice(1):e).split("&"),n={},r={},o=0;o<t.length;o++){var i=t[o].split("="),l=decodeURIComponent(i[0]),a=2===i.length?decodeURIComponent(i[1]):"",u=("true"===a?a=!0:"false"===a&&(a=!1),l.split(/\]\[?|\[/)),s=r;-1<l.indexOf("[")&&u.pop();for(var c=0;c<u.length;c++){var f,d=u[c],p=u[c+1],p=""==p||!isNaN(parseInt(p,10));if(""===d)null==n[l=u.slice(0,c).join()]&&(n[l]=Array.isArray(s)?s.length:0),d=n[l]++;else if("__proto__"===d)break;c===u.length-1?s[d]=a:(null==(f=null!=(f=Object.getOwnPropertyDescriptor(s,d))?f.value:f)&&(s[d]=f=p?[]:{}),s=f)}}return r}},{}],14:[function(e,t,n){"use strict";t.exports=e("./render/render")(window)},{"./render/render":18}],15:[function(e,t,n){"use strict";var r=e("../render/vnode"),o=e("./hyperscriptVnode");t.exports=function(){var e=o.apply(0,arguments);return e.tag="[",e.children=r.normalizeChildren(e.children),e}},{"../render/vnode":20,"./hyperscriptVnode":17}],16:[function(e,t,n){"use strict";var u=e("../render/vnode"),s=e("./hyperscriptVnode"),c=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,f={},d={}.hasOwnProperty;function p(e){for(var t in e)if(d.call(e,t))return;return 1}t.exports=function(e){if(null==e||"string"!=typeof e&&"function"!=typeof e&&"function"!=typeof e.view)throw Error("The selector must be either a string or a component.");var t=s.apply(1,arguments);if("string"!=typeof e||(t.children=u.normalizeChildren(t.children),"["===e))return t.tag=e,t;var n=f[e]||function(e){for(var t,n="div",r=[],o={};t=c.exec(e);){var i=t[1],l=t[2];""===i&&""!==l?n=l:"#"===i?o.id=l:"."===i?r.push(l):"["===t[3][0]&&(i=(i=t[6])&&i.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\"),"class"===t[4]?r.push(i):o[t[4]]=""===i?i:i||!0)}return 0<r.length&&(o.className=r.join(" ")),f[e]={tag:n,attrs:o}}(e),r=t,o=r.attrs,e=u.normalizeChildren(r.children),i=(t=d.call(o,"class"))?o.class:o.className;if(r.tag=n.tag,r.attrs=null,r.children=void 0,!p(n.attrs)&&!p(o)){var l,a={};for(l in o)d.call(o,l)&&(a[l]=o[l]);o=a}for(l in n.attrs)d.call(n.attrs,l)&&"className"!==l&&!d.call(o,l)&&(o[l]=n.attrs[l]);for(l in null==i&&null==n.attrs.className||(o.className=null!=i?null!=n.attrs.className?String(n.attrs.className)+" "+String(i):i:null!=n.attrs.className?n.attrs.className:null),t&&(o.class=null),o)if(d.call(o,l)&&"key"!==l){r.attrs=o;break}return Array.isArray(e)&&1===e.length&&null!=e[0]&&"#"===e[0].tag?r.text=e[0].children:r.children=e,r}},{"../render/vnode":20,"./hyperscriptVnode":17}],17:[function(e,t,n){"use strict";var r=e("../render/vnode");t.exports=function(){var e,t=arguments[this],n=this+1;if(null==t?t={}:"object"==typeof t&&null==t.tag&&!Array.isArray(t)||(t={},n=this),arguments.length===n+1)e=arguments[n],Array.isArray(e)||(e=[e]);else for(e=[];n<arguments.length;)e.push(arguments[n++]);return r("",t.key,t,e)}},{"../render/vnode":20}],18:[function(e,t,n){"use strict";var Y=e("../render/vnode");t.exports=function(e){var u,S=e&&e.document,t={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"};function $(e){return e.attrs&&e.attrs.xmlns||t[e.tag]}function s(e,t){if(e.state!==t)throw new Error("`vnode.state` must not be modified")}function R(e){var t=e.state;try{return this.apply(t,arguments)}finally{s(e,t)}}function D(){try{return S.activeElement}catch(e){return null}}function _(e,t,n,r,o,i,l){for(var a=n;a<r;a++){var u=t[a];null!=u&&M(e,u,o,l,i)}}function M(e,t,n,r,o){var i,l,a,u,s=t.tag;if("string"==typeof s)switch(t.state={},null!=t.attrs&&q(t.attrs,t,n),s){case"#":c=e,d=o,(f=t).dom=S.createTextNode(f.children),j(c,f.dom,d);break;case"<":U(e,t,r,o);break;case"[":var c=e,f=t,d=n,p=r,h=o,m=S.createDocumentFragment();null!=f.children&&(v=f.children,_(m,v,0,v.length,d,null,p)),f.dom=m.firstChild,f.domSize=m.childNodes.length,j(c,m,h);break;default:var v=e,p=t,m=n,h=r,y=o,g=p.tag,w=p.attrs,b=w&&w.is,b=(h=$(p)||h)?b?S.createElementNS(h,g,{is:b}):S.createElementNS(h,g):b?S.createElement(g,{is:b}):S.createElement(g);if(p.dom=b,null!=w){var x=p;var E=w;var k=h;for(var T in E)G(x,T,null,E[T],k)}if(j(v,b,y),!V(p)){null!=p.text&&(""!==p.text?b.textContent=p.text:p.children=[Y("#",void 0,void 0,p.text,void 0,void 0)]);if(null!=p.children){g=p.children,_(b,g,0,g.length,m,null,h);if("select"===p.tag&&null!=w){y=p;b=w;"value"in b&&(null===b.value?-1!==y.dom.selectedIndex&&(y.dom.value=null):(g=""+b.value,y.dom.value===g&&-1!==y.dom.selectedIndex||(y.dom.value=g)));"selectedIndex"in b&&G(y,"selectedIndex",null,b.selectedIndex,void 0)}}}}else s=e,a=r,u=o,function(e,t){var n;if("function"==typeof e.tag.view){if(e.state=Object.create(e.tag),null!=(n=e.state.view).$$reentrantLock$$)return;n.$$reentrantLock$$=!0}else{if(e.state=void 0,null!=(n=e.tag).$$reentrantLock$$)return;n.$$reentrantLock$$=!0,e.state=null!=e.tag.prototype&&"function"==typeof e.tag.prototype.view?new e.tag(e):e.tag(e)}q(e.state,e,t),null!=e.attrs&&q(e.attrs,e,t);if(e.instance=Y.normalize(R.call(e.state.view,e)),e.instance===e)throw Error("A view cannot return the vnode it received as argument");n.$$reentrantLock$$=null}(i=t,l=n),null!=i.instance?(M(s,i.instance,l,a,u),i.dom=i.instance.dom,i.domSize=null!=i.dom?i.instance.domSize:0):i.domSize=0}var c={caption:"table",thead:"table",tbody:"table",tfoot:"table",tr:"tbody",th:"tr",td:"tr",colgroup:"table",col:"colgroup"};function U(e,t,n,r){for(var o,i=t.children.match(/^\s*?<(\w+)/im)||[],l=S.createElement(c[i[1]]||"div"),a=("http://www.w3.org/2000/svg"===n?(l.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+t.children+"</svg>",l=l.firstChild):l.innerHTML=t.children,t.dom=l.firstChild,t.domSize=l.childNodes.length,t.instance=[],S.createDocumentFragment());o=l.firstChild;)t.instance.push(o),a.appendChild(o);j(e,a,r)}function F(e,t,n,r,o,i){if(t!==n&&(null!=t||null!=n))if(null==t||0===t.length)_(e,n,0,n.length,r,o,i);else if(null==n||0===n.length)O(e,t,0,t.length);else{var l=null!=t[0]&&null!=t[0].key,a=null!=n[0]&&null!=n[0].key,u=0,s=0;if(!l)for(;s<t.length&&null==t[s];)s++;if(!a)for(;u<n.length&&null==n[u];)u++;if(null!==a||null!=l)if(l!=a)O(e,t,s,t.length),_(e,n,u,n.length,r,o,i);else if(a){for(var c,f,d,p,h=t.length-1,m=n.length-1;s<=h&&u<=m&&(d=t[h],T=n[m],d.key===T.key);)d!==T&&H(e,d,T,r,o,i),null!=T.dom&&(o=T.dom),h--,m--;for(;s<=h&&u<=m&&(c=t[s],f=n[u],c.key===f.key);)s++,u++,c!==f&&H(e,c,f,r,C(t,s,o),i);for(;s<=h&&u<=m&&u!==m&&c.key===T.key&&d.key===f.key;)N(e,d,p=C(t,s,o)),d!==f&&H(e,d,f,r,p,i),++u<=--m&&N(e,c,o),c!==T&&H(e,c,T,r,o,i),null!=T.dom&&(o=T.dom),d=t[--h],T=n[m],c=t[++s],f=n[u];for(;s<=h&&u<=m&&d.key===T.key;)d!==T&&H(e,d,T,r,o,i),null!=T.dom&&(o=T.dom),d=t[--h],T=n[--m];if(m<u)O(e,t,s,h+1);else if(h<s)_(e,n,u,m+1,r,o,i);else{for(var v,y,l=o,g=m-u+1,w=new Array(g),b=0,x=0,E=2147483647,k=0,x=0;x<g;x++)w[x]=-1;for(x=m;u<=x;x--){var T,S=(v=null==v?function(e,t,n){for(var r=Object.create(null);t<n;t++){var o=e[t];null==o||null!=(o=o.key)&&(r[o]=t)}return r}(t,s,h+1):v)[(T=n[x]).key];null!=S&&(E=S<E?S:-1,d=t[w[x-u]=S],t[S]=null,d!==T&&H(e,d,T,r,o,i),null!=T.dom&&(o=T.dom),k++)}if(o=l,k!==h-s+1&&O(e,t,s,h+1),0===k)_(e,n,u,m+1,r,o,i);else if(-1===E)for(b=(y=function(e){for(var t=[0],n=0,r=0,o=0,i=A.length=e.length,o=0;o<i;o++)A[o]=e[o];for(o=0;o<i;++o)if(-1!==e[o]){var l=t[t.length-1];if(e[l]<e[o])A[o]=l,t.push(o);else{for(n=0,r=t.length-1;n<r;){var a=(n>>>1)+(r>>>1)+(n&r&1);e[t[a]]<e[o]?n=1+a:r=a}e[o]<e[t[n]]&&(0<n&&(A[o]=t[n-1]),t[n]=o)}}n=t.length,r=t[n-1];for(;0<n--;)t[n]=r,r=A[r];return A.length=0,t}(w)).length-1,x=m;u<=x;x--)f=n[x],-1===w[x-u]?M(e,f,r,i,o):y[b]===x-u?b--:N(e,f,o),null!=f.dom&&(o=n[x].dom);else for(x=m;u<=x;x--)f=n[x],-1===w[x-u]&&M(e,f,r,i,o),null!=f.dom&&(o=n[x].dom)}}else{for(var j=(t.length<n.length?t:n).length,u=u<s?u:s;u<j;u++)(c=t[u])===(f=n[u])||null==c&&null==f||(null==c?M(e,f,r,i,C(t,u+1,o)):null==f?K(e,c):H(e,c,f,r,C(t,u+1,o),i));t.length>j&&O(e,t,u,t.length),n.length>j&&_(e,n,u,n.length,r,o,i)}}}function H(e,t,n,r,o,i){var l=t.tag;if(l===n.tag){if(n.state=t.state,n.events=t.events,!function(e,t){do{var n;if(null!=e.attrs&&"function"==typeof e.attrs.onbeforeupdate)if(void 0!==(n=R.call(e.attrs.onbeforeupdate,e,t))&&!n)break;if("string"!=typeof e.tag&&"function"==typeof e.state.onbeforeupdate)if(void 0!==(n=R.call(e.state.onbeforeupdate,e,t))&&!n)break;return}while(0);return e.dom=t.dom,e.domSize=t.domSize,e.instance=t.instance,e.attrs=t.attrs,e.children=t.children,e.text=t.text,1}(n,t))if("string"==typeof l)switch(null!=n.attrs&&Z(n.attrs,n,r),l){case"#":var a=t,u=n;a.children.toString()!==u.children.toString()&&(a.dom.nodeValue=u.children),u.dom=a.dom;break;case"<":u=e,a=n,c=i,f=o,(d=t).children!==a.children?(B(u,d),U(u,a,c,f)):(a.dom=d.dom,a.domSize=d.domSize,a.instance=d.instance);break;case"[":var s=n,c=r,f=o,d=i,p=(F(e,t.children,s.children,c,f,d),0),h=s.children;if((s.dom=null)!=h){for(var m=0;m<h.length;m++){var v=h[m];null!=v&&null!=v.dom&&(null==s.dom&&(s.dom=v.dom),p+=v.domSize||1)}1!==p&&(s.domSize=p)}break;default:var y,g=t,w=n,b=r,x=i,P=w.dom=g.dom,E=(x=$(w)||x,"textarea"===w.tag&&(null==w.attrs&&(w.attrs={}),null!=w.text&&(w.attrs.value=w.text,w.text=void 0)),w),k=g.attrs,T=w.attrs,S=x;if(null!=T)for(var j in T)G(E,j,k&&k[j],T[j],S);if(null!=k)for(var j in k)if(null!=(y=k[j])&&(null==T||null==T[j])){_=void 0;A=void 0;C=void 0;N=void 0;N=void 0;var _=E;var A=j;var C=y;var N=S;"key"===A||"is"===A||null==C||J(A)||("o"!==A[0]||"n"!==A[1]||J(A)?"style"===A?W(_.dom,C,null):!Q(_,A,N)||"className"===A||"value"===A&&("option"===_.tag||"select"===_.tag&&-1===_.dom.selectedIndex&&_.dom===D())||"input"===_.tag&&"type"===A?(-1!==(N=A.indexOf(":"))&&(A=A.slice(N+1)),!1!==C&&_.dom.removeAttribute("className"===A?"class":A)):_.dom[A]=null:X(_,A,void 0))}V(w)||(null!=g.text&&null!=w.text&&""!==w.text?g.text.toString()!==w.text.toString()&&(g.dom.firstChild.nodeValue=w.text):(null!=g.text&&(g.children=[Y("#",void 0,void 0,g.text,void 0,g.dom.firstChild)]),null!=w.text&&(w.children=[Y("#",void 0,void 0,w.text,void 0,void 0)]),F(P,g.children,w.children,b,null,x)))}else{var l=e,O=t,q=n,z=r,I=o,L=i;if(q.instance=Y.normalize(R.call(q.state.view,q)),q.instance===q)throw Error("A view cannot return the vnode it received as argument");Z(q.state,q,z),null!=q.attrs&&Z(q.attrs,q,z),null!=q.instance?(null==O.instance?M(l,q.instance,z,L,I):H(l,O.instance,q.instance,z,I,L),q.dom=q.instance.dom,q.domSize=q.instance.domSize):null!=O.instance?(K(l,O.instance),q.dom=void 0,q.domSize=0):(q.dom=O.dom,q.domSize=O.domSize)}}else K(e,t),M(e,n,r,i,o)}var A=[];function C(e,t,n){for(;t<e.length;t++)if(null!=e[t]&&null!=e[t].dom)return e[t].dom;return n}function N(e,t,n){var r=S.createDocumentFragment();!function e(t,n,r){for(;null!=r.dom&&r.dom.parentNode===t;){if("string"!=typeof r.tag){if(null!=(r=r.instance))continue}else if("<"===r.tag)for(var o=0;o<r.instance.length;o++)n.appendChild(r.instance[o]);else if("["!==r.tag)n.appendChild(r.dom);else if(1===r.children.length){if(null!=(r=r.children[0]))continue}else for(o=0;o<r.children.length;o++){var i=r.children[o];null!=i&&e(t,n,i)}break}}(e,r,t),j(e,r,n)}function j(e,t,n){null!=n?e.insertBefore(t,n):e.appendChild(t)}function V(e){if(null!=e.attrs&&(null!=e.attrs.contenteditable||null!=e.attrs.contentEditable)){var t=e.children;if(null!=t&&1===t.length&&"<"===t[0].tag){var n=t[0].children;e.dom.innerHTML!==n&&(e.dom.innerHTML=n)}else if(null!=e.text||null!=t&&0!==t.length)throw new Error("Child node of a contenteditable must be trusted");return 1}}function O(e,t,n,r){for(var o=n;o<r;o++){var i=t[o];null!=i&&K(e,i)}}function K(e,t){var n,r,o,i,l=0,a=t.state;function u(){s(t,a),d(t),f(e,t)}"string"!=typeof t.tag&&"function"==typeof t.state.onbeforeremove&&null!=(o=R.call(t.state.onbeforeremove,t))&&"function"==typeof o.then&&(l=1,n=o),t.attrs&&"function"==typeof t.attrs.onbeforeremove&&null!=(o=R.call(t.attrs.onbeforeremove,t))&&"function"==typeof o.then&&(l|=2,r=o),s(t,a),l?(null!=n&&n.then(i=function(){1&l&&((l&=2)||u())},i),null!=r&&r.then(i=function(){2&l&&((l&=1)||u())},i)):(d(t),f(e,t))}function B(e,t){for(var n=0;n<t.instance.length;n++)e.removeChild(t.instance[n])}function f(e,t){for(;null!=t.dom&&t.dom.parentNode===e;){if("string"!=typeof t.tag){if(null!=(t=t.instance))continue}else if("<"===t.tag)B(e,t);else{if("["!==t.tag&&(e.removeChild(t.dom),!Array.isArray(t.children)))break;if(1===t.children.length){if(null!=(t=t.children[0]))continue}else for(var n=0;n<t.children.length;n++){var r=t.children[n];null!=r&&f(e,r)}}break}}function d(e){if("string"!=typeof e.tag&&"function"==typeof e.state.onremove&&R.call(e.state.onremove,e),e.attrs&&"function"==typeof e.attrs.onremove&&R.call(e.attrs.onremove,e),"string"!=typeof e.tag)null!=e.instance&&d(e.instance);else{var t=e.children;if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];null!=r&&d(r)}}}function G(e,t,n,r,o){if("key"!==t&&"is"!==t&&null!=r&&!J(t)&&(n!==r||(i=e,"value"===(l=t)||"checked"===l||"selectedIndex"===l||"selected"===l&&i.dom===D()||"option"===i.tag&&i.dom.parentNode===S.activeElement)||"object"==typeof r)){var i,l;if("o"===t[0]&&"n"===t[1])return X(e,t,r);if("xlink:"===t.slice(0,6))e.dom.setAttributeNS("http://www.w3.org/1999/xlink",t.slice(6),r);else if("style"===t)W(e.dom,n,r);else if(Q(e,t,o)){if("value"===t){if(("input"===e.tag||"textarea"===e.tag)&&e.dom.value===""+r&&e.dom===D())return;if("select"===e.tag&&null!==n&&e.dom.value===""+r)return;if("option"===e.tag&&null!==n&&e.dom.value===""+r)return}"input"===e.tag&&"type"===t?e.dom.setAttribute(t,r):e.dom[t]=r}else"boolean"==typeof r?r?e.dom.setAttribute(t,""):e.dom.removeAttribute(t):e.dom.setAttribute("className"===t?"class":t,r)}}function J(e){return"oninit"===e||"oncreate"===e||"onupdate"===e||"onremove"===e||"onbeforeremove"===e||"onbeforeupdate"===e}function Q(e,t,n){return void 0===n&&(-1<e.tag.indexOf("-")||null!=e.attrs&&e.attrs.is||"href"!==t&&"list"!==t&&"form"!==t&&"width"!==t&&"height"!==t)&&t in e.dom}var n=/[A-Z]/g;function r(e){return"-"+e.toLowerCase()}function i(e){return"-"===e[0]&&"-"===e[1]?e:"cssFloat"===e?"float":e.replace(n,r)}function W(e,t,n){if(t!==n)if(null==n)e.style.cssText="";else if("object"!=typeof n)e.style.cssText=n;else if(null==t||"object"!=typeof t)for(var r in e.style.cssText="",n)null!=(o=n[r])&&e.style.setProperty(i(r),String(o));else{for(var r in n){var o;null!=(o=n[r])&&(o=String(o))!==String(t[r])&&e.style.setProperty(i(r),o)}for(var r in t)null!=t[r]&&null==n[r]&&e.style.removeProperty(i(r))}}function o(){this._=u}function X(e,t,n){null!=e.events?e.events[t]!==n&&(null==n||"function"!=typeof n&&"object"!=typeof n?(null!=e.events[t]&&e.dom.removeEventListener(t.slice(2),e.events,!1),e.events[t]=void 0):(null==e.events[t]&&e.dom.addEventListener(t.slice(2),e.events,!1),e.events[t]=n)):null==n||"function"!=typeof n&&"object"!=typeof n||(e.events=new o,e.dom.addEventListener(t.slice(2),e.events,!1),e.events[t]=n)}function q(e,t,n){"function"==typeof e.oninit&&R.call(e.oninit,t),"function"==typeof e.oncreate&&n.push(R.bind(e.oncreate,t))}function Z(e,t,n){"function"==typeof e.onupdate&&n.push(R.bind(e.onupdate,t))}return(o.prototype=Object.create(null)).handleEvent=function(e){var t,n=this["on"+e.type];"function"==typeof n?t=n.call(e.currentTarget,e):"function"==typeof n.handleEvent&&n.handleEvent(e),this._&&!1!==e.redraw&&(0,this._)(),!1===t&&(e.preventDefault(),e.stopPropagation())},function(e,t,n){if(!e)throw new TypeError("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var r=[],o=D(),i=e.namespaceURI,l=(null==e.vnodes&&(e.textContent=""),t=Y.normalizeChildren(Array.isArray(t)?t:[t]),u);try{u="function"==typeof n?n:void 0,F(e,e.vnodes,t,r,null,"http://www.w3.org/1999/xhtml"===i?void 0:i)}finally{u=l}e.vnodes=t,null!=o&&D()!==o&&"function"==typeof o.focus&&o.focus();for(var a=0;a<r.length;a++)r[a]()}}},{"../render/vnode":20}],19:[function(e,t,n){"use strict";var r=e("../render/vnode");t.exports=function(e){return r("<",void 0,void 0,e=null==e?"":e,void 0,void 0)}},{"../render/vnode":20}],20:[function(e,t,n){"use strict";function o(e,t,n,r,o,i){return{tag:e,key:t,attrs:n,children:r,text:o,dom:i,domSize:void 0,state:void 0,events:void 0,instance:void 0}}o.normalize=function(e){return Array.isArray(e)?o("[",void 0,void 0,o.normalizeChildren(e),void 0,void 0):null==e||"boolean"==typeof e?null:"object"==typeof e?e:o("#",void 0,void 0,String(e),void 0,void 0)},o.normalizeChildren=function(e){var t=[];if(e.length){for(var n=null!=e[0]&&null!=e[0].key,r=1;r<e.length;r++)if((null!=e[r]&&null!=e[r].key)!=n)throw new TypeError("Vnodes must either always have keys or never have keys!");for(r=0;r<e.length;r++)t[r]=o.normalize(e[r])}return t},t.exports=o},{}],21:[function(e,t,n){"use strict";var r=e("./promise/promise"),o=e("./mount-redraw");t.exports=e("./request/request")(window,r,o.redraw)},{"./mount-redraw":5,"./promise/promise":11,"./request/request":22}],22:[function(e,t,n){"use strict";var s=e("../pathname/build");t.exports=function(h,n,a){var l=0;function u(e){return new n(e)}function e(l){return function(t,r){"string"!=typeof t?t=(r=t).url:null==r&&(r={});var e=new n(function(n,e){l(s(t,r.params),r,function(e){if("function"==typeof r.type)if(Array.isArray(e))for(var t=0;t<e.length;t++)e[t]=new r.type(e[t]);else e=new r.type(e);n(e)},e)});if(!0===r.background)return e;var o=0;function i(){0==--o&&"function"==typeof a&&a()}return function t(n){var r=n.then;n.constructor=u;n.then=function(){o++;var e=r.apply(n,arguments);return e.then(i,function(e){if(i(),0===o)throw e}),t(e)};return n}(e)}}function m(e,t){for(var n in e.headers)if({}.hasOwnProperty.call(e.headers,n)&&t.test(n))return 1}return u.prototype=n.prototype,u.__proto__=n,{request:e(function(i,l,a,u){var e,t,n=null!=l.method?l.method.toUpperCase():"GET",r=l.body,o=!(null!=l.serialize&&l.serialize!==JSON.serialize||r instanceof h.FormData),s=l.responseType||("function"==typeof l.extract?"":"json"),c=new h.XMLHttpRequest,f=!1,d=c,p=c.abort;for(t in c.abort=function(){f=!0,p.call(this)},c.open(n,i,!1!==l.async,"string"==typeof l.user?l.user:void 0,"string"==typeof l.password?l.password:void 0),o&&null!=r&&!m(l,/^content-type$/i)&&c.setRequestHeader("Content-Type","application/json; charset=utf-8"),"function"==typeof l.deserialize||m(l,/^accept$/i)||c.setRequestHeader("Accept","application/json, text/*"),l.withCredentials&&(c.withCredentials=l.withCredentials),l.timeout&&(c.timeout=l.timeout),c.responseType=s,l.headers)!{}.hasOwnProperty.call(l.headers,t)||c.setRequestHeader(t,l.headers[t]);c.onreadystatechange=function(e){if(!f&&4===e.target.readyState)try{var t,n=200<=e.target.status&&e.target.status<300||304===e.target.status||/^file:\/\//i.test(i),r=e.target.response;if("json"===s?e.target.responseType||"function"==typeof l.extract||(r=JSON.parse(e.target.responseText)):s&&"text"!==s||null==r&&(r=e.target.responseText),"function"==typeof l.extract?(r=l.extract(e.target,l),n=!0):"function"==typeof l.deserialize&&(r=l.deserialize(r)),n)a(r);else{try{t=e.target.responseText}catch(e){t=r}var o=new Error(t);o.code=e.target.status,o.response=r,u(o)}}catch(e){u(e)}},"function"==typeof l.config&&(c=l.config(c,l,i)||c)!==d&&(e=c.abort,c.abort=function(){f=!0,e.call(this)}),null==r?c.send():"function"==typeof l.serialize?c.send(l.serialize(r)):r instanceof h.FormData?c.send(r):c.send(JSON.stringify(r))}),jsonp:e(function(e,t,n,r){var o=t.callbackName||"_mithril_"+Math.round(1e16*Math.random())+"_"+l++,i=h.document.createElement("script");h[o]=function(e){delete h[o],i.parentNode.removeChild(i),n(e)},i.onerror=function(){delete h[o],i.parentNode.removeChild(i),r(new Error("JSONP request failed"))},i.src=e+(e.indexOf("?")<0?"?":"&")+encodeURIComponent(t.callbackKey||"callback")+"="+encodeURIComponent(o),h.document.documentElement.appendChild(i)})}}},{"../pathname/build":7}],23:[function(e,t,n){"use strict";var r=e("./mount-redraw");t.exports=e("./api/router")(window,r)},{"./api/router":2,"./mount-redraw":5}],24:[function(e,t,n){var r,o,t=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{o="function"==typeof clearTimeout?clearTimeout:l}catch(e){o=l}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return(r=setTimeout)(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}var u,s=[],c=!1,f=-1;function d(){c&&u&&(c=!1,u.length?s=u.concat(s):f=-1,s.length&&p())}function p(){if(!c){for(var e=a(d),t=(c=!0,s.length);t;){for(u=s,s=[];++f<t;)u&&u[f].run();f=-1,t=s.length}u=null,c=!1,!function(t){if(o===clearTimeout)return clearTimeout(t);if((o===l||!o)&&clearTimeout)return(o=clearTimeout)(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function m(){}t.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new h(e,t)),1!==s.length||c||a(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=m,t.addListener=m,t.once=m,t.off=m,t.removeListener=m,t.removeAllListeners=m,t.emit=m,t.prependListener=m,t.prependOnceListener=m,t.listeners=function(e){return[]},t.binding=function(e){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(e){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},{}],25:[function(u,e,s){!function(n,a){!function(){var r=u("process/browser.js").nextTick,e=Function.prototype.apply,o=Array.prototype.slice,i={},l=0;function t(e,t){this._id=e,this._clearFn=t}s.setTimeout=function(){return new t(e.call(setTimeout,window,arguments),clearTimeout)},s.setInterval=function(){return new t(e.call(setInterval,window,arguments),clearInterval)},s.clearTimeout=s.clearInterval=function(e){e.close()},t.prototype.unref=t.prototype.ref=function(){},t.prototype.close=function(){this._clearFn.call(window,this._id)},s.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},s.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},s._unrefActive=s.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0<=t&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},s.setImmediate="function"==typeof n?n:function(e){var t=l++,n=!(arguments.length<2)&&o.call(arguments,1);return i[t]=!0,r(function(){i[t]&&(n?e.apply(null,n):e.call(null),s.clearImmediate(t))}),t},s.clearImmediate="function"==typeof a?a:function(e){delete i[e]}}.call(this)}.call(this,u("timers").setImmediate,u("timers").clearImmediate)},{"process/browser.js":24,timers:25}],26:[function(e,t,n){"use strict";var r=e("mithril"),o=e("./admin/wizard.js"),e=e("./admin/field-mapper.js"),i=document.getElementById("wizard");i&&r.mount(i,o),new e(document.querySelector(".mc4wp-sync-field-map"))},{"./admin/field-mapper.js":27,"./admin/wizard.js":30,mithril:4}],27:[function(e,t,n){"use strict";var a=/\[(\d+)\]/;t.exports=function(i){function l(){var n=[].map.call(i.querySelectorAll(".mailchimp-field"),function(e){return e.value});[].forEach.call(i.querySelectorAll(".mailchimp-field"),function(e){var t=e.value;[].forEach.call(e.querySelectorAll("option"),function(e){e.disabled=""===e.value||-1<n.indexOf(e.value)&&t!==e.value})})}i.querySelector(".add-row").addEventListener("click",function(){var e=i.querySelector(".field-map-row"),t=e.cloneNode(!0),n=t.querySelector(".user-field"),r=t.querySelector(".mailchimp-field"),o=Math.round(1e4*Math.random());return n.value="",n.setAttribute("name",n.name.replace(a,"["+o+"]")),r.value="",r.setAttribute("name",r.name.replace(a,"["+o+"]")),e.parentElement.appendChild(t),l(),!1}),i.addEventListener("click",function(e){"INPUT"===e.target.tagName&&e.target.className&&-1<e.target.className.indexOf("remove-row")&&(e.target.parentElement.parentNode.removeChild(e.target.parentElement),l())},!0),i.addEventListener("change",function(e){"SELECT"===e.target.tagName&&-1<e.target.className.indexOf("mailchimp-field")&&l()},!0),l()}},{}],28:[function(e,t,n){"use strict";var r=e("mithril"),o=[];function i(e,t,n){e.scrollTop=e.scrollHeight}t.exports={log:function(e){e={time:new Date,text:e},o.push(e),r.redraw()},render:function(){return r("div.log",{config:i},[o.map(function(e){var t=("0"+e.time.getHours()).slice(-2)+":"+("0"+e.time.getMinutes()).slice(-2)+":"+("0"+e.time.getSeconds()).slice(-2);return r("div",[r("span.time",t),r.trust(e.text)])})])}}},{mithril:4}],29:[function(e,t,n){"use strict";t.exports=function(e){this.id=e.ID,this.username=e.user_login,this.email=e.user_email}},{}],30:[function(e,t,n){"use strict";var r=e("./logger.js"),o=e("./user.js"),i=!1,l=!1,a=!1,u=0,s=0,c=0,f=[],d=!1,p=e("mithril");function h(){confirm("Are you sure you want to start synchronising all of your users? This can take a while if you have many users, please don't close your browser window.")&&(l=i=!0,p.request({method:"GET",url:ajaxurl,params:{action:"mc4wp_user_sync_get_user_count"}}).then(function(e){r.log("Found "+e+" users."),u=e}).catch(function(e){r.log("Error fetching user count. Error: "+e)}).then(g).then(w))}function m(){l=!0,w()}function v(){l=!1}function y(){a=!0,r.log("Done")}function g(){return p.request({method:"GET",url:ajaxurl,params:{action:"mc4wp_user_sync_get_users",offset:s,limit:100},type:o}).then(function(e){f=e,r.log("Fetched "+f.length+" users."),0===f.length&&y()}).catch(function(e){r.log("Error fetching users. Error: "+e)})}function w(){if(l&&!a){if(0===f.length)return g().then(w);var e=f.shift();r.log("Handling <strong> #"+e.id+" "+e.username+" &lt;"+e.email+"&gt;</strong>"),p.request({method:"GET",params:{action:"mc4wp_user_sync_handle_user",user_id:e.id},url:ajaxurl}).then(function(e){s++,r.log(e.message)}).catch(function(e){s++,r.log(e)}).then(b).then(w)}}function b(){c=Math.round(s/u*100),u<=s&&y()}t.exports={controller:function(){document.getElementById("settings-form").addEventListener("change",function(){d=!0})},view:function(){return i?[a?"":p("p",p("input",{type:"button",class:"button",value:l?"Pause":"Resume",onclick:l?v:m})),p("div.progress-bar",[p("div.value",{style:"width: "+c+"%"}),p("div.text",a?"Done!":"Working: "+c+"%")]),r.render()]:p("p",[p("input",{type:"button",class:"button",value:"Synchronise All",onclick:h,disabled:d}),d?p("span.help"," — Please save your changes first."):""])}}},{"./logger.js":28,"./user.js":29,mithril:4}]},{},[26]);PK     M\&~5  5  '  user-sync/assets/src/js/admin/wizard.jsnu [        'use strict';

const logger = require('./logger.js');
const User = require('./user.js');
let started = false,
	running = false,
	done = false,
	userCount = 0,
	usersProcessed = 0,
	progress = 0,
	userBatch = [],
	settingsForm,
	hasUnsavedChanges = false;
const m = require('mithril');

function controller() {
	settingsForm = document.getElementById('settings-form');

	settingsForm.addEventListener('change', function() {
		hasUnsavedChanges = true;
	});
}

function askToStart() {
	const sure = confirm( "Are you sure you want to start synchronising all of your users? This can take a while if you have many users, please don't close your browser window." );
	if( sure ) {
		start();
	}
}

function start() {
	started = true;
	running = true;

	fetchTotalUserCount()
		.then(prepareBatch)
		.then(subscribeFromBatch);
}

function resume() {
	running = true;
	subscribeFromBatch();
}

function pause() {
	running = false;
}

function finish() {
	done = true;
	logger.log("Done");
}

function fetchTotalUserCount() {
	return m.request({
		method: "GET",
		url: ajaxurl,
		params: {
			action : 'mc4wp_user_sync_get_user_count',
		}
	}).then(function(data) {
		logger.log("Found " + data + " users.");
		userCount = data;
	}).catch(function(error) {
		logger.log( "Error fetching user count. Error: " + error );
	});
}

function prepareBatch() {
	return m.request({
		method: "GET",
		url: ajaxurl,
		params: {
			action: 'mc4wp_user_sync_get_users',
			offset: usersProcessed,
			limit: 100
		},
		type: User
	}).then(function(data) {
		userBatch = data;
		logger.log("Fetched " + userBatch.length + " users.");

		// finish if we didn't get any users
		if( userBatch.length === 0 ) {
			finish();
		}
	}).catch(function( error ) {
		logger.log( "Error fetching users. Error: " + error );
	});
}

function subscribeFromBatch() {
	if( ! running || done ) {
		return;
	}

	// do we have users left in this batch
	if( userBatch.length === 0 ) {
		return prepareBatch().then(subscribeFromBatch);
	}

	// Get next user
	let user = userBatch.shift();

	// Add line to log
	logger.log("Handling <strong> #" + user.id + " " + user.username + " &lt;" + user.email + "&gt;</strong>" );

	// Perform subscribe request
	m.request({
		method: "GET",
		params: {
			action: "mc4wp_user_sync_handle_user",
			user_id: user.id
		},
		url: ajaxurl
	}).then(function( response ) {
		usersProcessed++;
		logger.log(response.message);
	}).catch(function(e) {
		usersProcessed++;
		logger.log(e);
	}).then(updateProgress)
		.then(subscribeFromBatch);
}

// calculate new progress & update progress bar.
function updateProgress() {
	// calculate % progress
	progress = Math.round( usersProcessed / userCount * 100 );

	// finish after processing all users
	if( usersProcessed >= userCount ) {
		finish();
	}
}

/**
 * View
 *
 * @returns {*}
 */
function view() {
	// Wizard isn't running, show button to start it
	if( ! started ) {
		return m('p', [
			m('input', {
				type: 'button',
				class: 'button',
				value: 'Synchronise All',
				onclick: askToStart,
				disabled: hasUnsavedChanges
			}),
			hasUnsavedChanges ? m('span.help', ' — Please save your changes first.') : ''
		]);
	}

	// Show progress
	return [
		done ? '' : m("p",
				m("input", {
					type: 'button',
					class: 'button',
					value: ( running ? "Pause" : "Resume" ),
					onclick: ( running  ? pause : resume )
				})
		),
		m('div.progress-bar', [
			m( "div.value", {
				style: "width: "+ progress +"%"
			}),
			m( "div.text", ( done ? "Done!" : "Working: " + progress + "%" ))
		]),
		logger.render()
	];
}

module.exports = {
	'controller': controller,
	'view': view
};
PK     M\,n`ު    '  user-sync/assets/src/js/admin/logger.jsnu [        'use strict';

const m = require('mithril');
let items = [];

function log(msg) {
	let line = {
		time: new Date(),
		text: msg
	};

	items.push(line);
	m.redraw();
}

function scroll(element, initialized, context) {
	element.scrollTop = element.scrollHeight;
}

function render() {
	return m("div.log", { config: scroll }, [
		items.map( function( item ) {

			let timeString =
				("0" + item.time.getHours()).slice(-2)   + ":" +
				("0" + item.time.getMinutes()).slice(-2) + ":" +
				("0" + item.time.getSeconds()).slice(-2);

			return m("div", [
				m('span.time', timeString),
				m.trust(item.text )
			] )
		})
	]);
}

module.exports = {
	'log': log,
	'render': render
};
PK     M\0    -  user-sync/assets/src/js/admin/field-mapper.jsnu [        const NAME_INDEX_REGEX = /\[(\d+)\]/;

function FieldMapper(context) {
	function addRow() {
		let row = context.querySelector('.field-map-row');
		let newRow = row.cloneNode(true);
		let userField = newRow.querySelector('.user-field');
		let mailchimpField = newRow.querySelector('.mailchimp-field');
		let idx = Math.round(Math.random() * 10000);
		userField.value = '';
		userField.setAttribute('name', userField.name.replace(NAME_INDEX_REGEX, '[' + idx + ']'));
		mailchimpField.value = '';
		mailchimpField.setAttribute('name', mailchimpField.name.replace(NAME_INDEX_REGEX, '[' + idx + ']'));
		row.parentElement.appendChild(newRow);
		setAvailableFields();
		return false;
	}

	function setAvailableFields() {
		let values = [].map.call(context.querySelectorAll('.mailchimp-field'), el => el.value);
		[].forEach.call(context.querySelectorAll('.mailchimp-field'), (el) => {
			let selected = el.value;
			[].forEach.call(el.querySelectorAll('option'), (opt) => {
				opt.disabled = opt.value === '' || (values.indexOf(opt.value) > -1 && selected !== opt.value);
			});
		});
	}

	context.querySelector('.add-row').addEventListener('click', addRow);
	context.addEventListener('click', (evt) => {
		if (evt.target.tagName === 'INPUT' && evt.target.className && evt.target.className.indexOf('remove-row') > -1) {
			evt.target.parentElement.parentNode.removeChild(evt.target.parentElement);
			setAvailableFields();
		}
	}, true);
	context.addEventListener('change', (evt) => {
		if (evt.target.tagName === 'SELECT' && evt.target.className.indexOf('mailchimp-field') > -1) {
			setAvailableFields();
		}
		}, true);

	setAvailableFields();
}

module.exports = FieldMapper;
PK     M\s      %  user-sync/assets/src/js/admin/user.jsnu [        'use strict';

/**
 * User Model
 *
 * @param data
 * @constructor
 */
const User = function( data ) {
	this.id = data.ID;
	this.username = data.user_login;
	this.email = data.user_email;
};

module.exports = User;
PK     M\؎e  e     user-sync/assets/src/js/admin.jsnu [        const m = require('mithril');
const Wizard = require('./admin/wizard.js');
const FieldMapper = require('./admin/field-mapper.js');

// init wizard
const wizardContainer = document.getElementById('wizard');
if( wizardContainer ) {
	m.mount( wizardContainer , Wizard );
}

// init fieldmapper
new FieldMapper(document.querySelector('.mc4wp-sync-field-map'));
PK     M\f  f  "  user-sync/assets/src/css/admin.cssnu [        #mc4wp-admin {
    /* style the progress bar */
}

#mc4wp-admin .mc4wp-sync-field-map .field-map-row:first-of-type .remove-row {
    display: none;
}

#mc4wp-admin .progress-bar {
    width: 100%;
    height: 20px;
    background: #ccc;
    position: relative;
    margin: 20px 0;
}

#mc4wp-admin .progress-bar .value,
#mc4wp-admin .progress-bar .text {
    position: absolute;
    left: 0;
    top: 0;
    height: 20px;
    display: inline-block;
    font-weight: bold;
}

#mc4wp-admin .progress-bar .value {
    z-index: 1;
    background: #2ea2cc;
}

#mc4wp-admin .progress-bar .text {
    color: #ffffff;
    text-align: center;
    z-index: 2;
    width: 100%;
}

#mc4wp-admin .log {
    font-family: monaco, monospace, courier, 'courier new', 'Bitstream Vera Sans Mono';
    background: #262626;
    color: white;
    margin: 20px 0;
    height: 350px;
    overflow-y: scroll;
    border: 1px solid #ccc;
    padding: 5px 20px;
    font-size: 13px;
    line-height: 140%;
}

#mc4wp-admin .log .time {
    color: #999;
    display: inline-block;
    margin-right: 5px;
}

#mc4wp-admin .log strong {
    color: #2ea2cc;
}
PK     M\}P`B  B    user-sync/assets/css/admin.cssnu [        #mc4wp-admin .mc4wp-sync-field-map .field-map-row:first-of-type .remove-row{display:none}#mc4wp-admin .progress-bar{width:100%;height:20px;background:#ccc;position:relative;margin:20px 0}#mc4wp-admin .progress-bar .text,#mc4wp-admin .progress-bar .value{position:absolute;left:0;top:0;height:20px;display:inline-block;font-weight:700}#mc4wp-admin .progress-bar .value{z-index:1;background:#2ea2cc}#mc4wp-admin .progress-bar .text{color:#fff;text-align:center;z-index:2;width:100%}#mc4wp-admin .log{font-family:monaco,monospace,courier,'courier new','Bitstream Vera Sans Mono';background:#262626;color:#fff;margin:20px 0;height:350px;overflow-y:scroll;border:1px solid #ccc;padding:5px 20px;font-size:13px;line-height:140%}#mc4wp-admin .log .time{color:#999;display:inline-block;margin-right:5px}#mc4wp-admin .log strong{color:#2ea2cc}PK     M\oe      user-sync/user-sync.phpnu [        <?php
/*
Mailchimp User Sync
Copyright (C) 2015-2020, Danny van Kooten, hi@dannyvankooten.com

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

namespace MC4WP\User_Sync;

use MC4WP_Queue;
use WP_CLI;

defined( 'ABSPATH' ) or exit;

function _mc4wp_bootstrap_user_sync() {
	define('MC4WP_USER_SYNC_PLUGIN_FILE', __FILE__);
	define('MC4WP_USER_SYNC_PLUGIN_DIR', __DIR__);
	define('MC4WP_USER_SYNC_PLUGIN_VERSION', MC4WP_PREMIUM_VERSION);

	require __DIR__ . '/vendor/autoload.php';
	require __DIR__ . '/src/functions.php';

	$settings = get_settings();

	$container = mc4wp();
	$container['user_sync.users'] = function() use($settings) {
		return new Users( $settings['list'], $settings['role'], $settings['field_map'] );
	};
	$container['user_sync.queue'] = function() {
		return new MC4WP_Queue( 'mc4wp_sync_queue' );
	};
	$container['user_sync.handler'] = function() use ($settings, $container) {
		return new User_Handler( $settings['list'], $container['user_sync.users'] );
	};

	if( is_admin() ) {
		$admin = new Admin( $settings );
		$admin->add_hooks();
	}

	$webhook_listener = new Webhook_Listener( $settings );
	$webhook_listener->add_hooks();

	// If User Sync is not enabled or no Mailchimp list is selected, return here to prevent unnecessary work.
	if ( ! $settings['enabled'] || $settings['list'] === '' ) {
		return;
	}

	require_once __DIR__ . '/src/default-filters.php';

	/** @var User_Handler $user_handler */
	$user_handler = $container['user_sync.handler'];
	$user_handler->add_hooks();

	/** @var MC4WP_Queue $queue */
	$queue = $container['user_sync.queue'];

	/** @var Users $users */
	$users = $container['user_sync.users'];

	$observer = new Observer( $queue, $users );
	$observer->add_hooks();

	$worker = new Worker( $queue, $user_handler );
	$worker->add_hooks();

	// deactivate old Mailchimp Sync plugin if active
	if ( is_admin() && defined( 'MAILCHIMP_SYNC_VERSION' ) ) {
		require_once ABSPATH . 'wp-admin/includes/plugin.php';
		deactivate_plugins( 'mailchimp-sync/mailchimp-sync.php' );
	}

	if ( is_admin() && ( defined( 'DOING_AJAX') && DOING_AJAX ) ) {
		$ajax = new Ajax_Listener( $user_handler, $users );
		$ajax->add_hooks();
	}

	// WP CLI Commands
	if( defined( 'WP_CLI' ) && WP_CLI ) {
		WP_CLI::add_command( 'mc4wp-user-sync', 'MC4WP\\User_Sync\\CLI_Command' );
	}
}

_mc4wp_bootstrap_user_sync();
register_activation_hook( MC4WP_PREMIUM_PLUGIN_FILE, 'MC4WP\User_Sync\setup_schedule');
register_deactivation_hook( MC4WP_PREMIUM_PLUGIN_FILE, 'MC4WP\User_Sync\clear_schedule' );
PK     M\	a4  a4  !  user-sync/views/settings-page.phpnu [        <?php
namespace MC4WP\User_Sync\Admin;

defined( 'ABSPATH' ) or exit;

/** @var array $available_mailchimp_fields */
?>
<div class="wrap" id="mc4wp-admin">

	<p class="mc4wp-breadcrumbs">
		<span class="prefix"><?php echo esc_html__( 'You are here: ', 'mailchimp-for-wp' ); ?></span>
		<a href="<?php echo esc_url( admin_url( 'admin.php?page=mailchimp-for-wp' ) ); ?>">Mailchimp for WordPress</a> &rsaquo;
		<span class="current-crumb"><strong>User Sync</strong></span>
	</p>

	<div class="main-content mc4wp-row">

		<!-- Main Content -->
		<div class="main-content col mc4wp-col-4">
			<h1 class="mc4wp-page-title">Mailchimp User Sync</h1>

            <?php if (isset($_GET['webhook-created']) && (int) $_GET['webhook-created'] === 0 ) {
                echo '<div class="notice notice-warning"><p>';
                echo sprintf( __( 'Could not create webhook in your Mailchimp account. This usually happens when your website is not publicly accessible. Check the <a href="%s">debug log</a> for the error message.', 'mailchimp-for-wp' ), admin_url( 'admin.php?page=mailchimp-for-wp-other' ) );
                echo '</p></div>';
            } ?>

            <p>
                <?php echo esc_html__( 'User Sync allows you to synchronize WordPress user fields with Mailchimp subscriber fields.', 'mailchimp-for-wp' ); ?>
                <?php echo esc_html__( 'With this feature enabled, when a user updates their profile on this WordPress site the corresponding subscriber in Mailchimp will be updated as well.', 'mailchimp-for-wp' ); ?>
            </p>
            <p>
                <?php echo sprintf( __( 'Please note that this does not subscribe or unsubscribe your users. We recommend using one of our <a href="%s">sign-up integrations</a> for that.'), admin_url( 'admin.php?page=mailchimp-for-wp-integrations' ) ); ?>
            </p>


			<form method="post" id="settings-form">
                <input type="hidden" name="_mc4wp_action" value="save_user_sync_settings" />
				<?php wp_nonce_field( '_mc4wp_action', '_wpnonce' ); ?>
                <?php settings_errors(); ?>

				<table class="form-table">
                    <tbody>
					<tr>
						<th scope="row"><?php echo esc_html__( 'Enable User Sync?', 'mailchimp-sync' ); ?></th>
						<td class="nowrap">
							<label><input type="radio" name="<?php echo $this->name_attr( 'enabled' ); ?>" value="1" <?php checked( $this->options['enabled'], 1 ); ?> /> <?php echo esc_html__( 'Yes', 'mailchimp-sync' ); ?></label> &nbsp;&nbsp;&nbsp;
							<label><input type="radio" name="<?php echo $this->name_attr( 'enabled' ); ?>" value="0" <?php checked( $this->options['enabled'], 0 ); ?> /> <?php echo esc_html__( 'No', 'mailchimp-sync' ); ?></label>
							<p  class="description"><?php echo esc_html__( 'Select "yes" if you want to synchronize your WordPress user fields with Mailchimp.', 'mailchimp-sync' ); ?></p>
						</td>
					</tr>
                    </tbody>
                    <tbody data-showif='{"element":"mc4wp_user_sync[enabled]","value":1,"hide":false}'>
					<tr valign="top">
						<th scope="row"><?php echo esc_html__( 'Mailchimp Audience', 'mailchimp-sync' ); ?></th>
						<td>
							<?php if( empty( $lists ) ) {
								printf( wp_kses( __( 'No lists found, <a href="%s">are you connected to MailChimp</a>?', 'mailchimp-for-wp' ), array( 'a' => array( 'href' => '' ) ) ), admin_url( 'admin.php?page=mailchimp-for-wp' ) ); ?>
							<?php } else { ?>

							<select name="<?php echo $this->name_attr( 'list' ); ?>" class="widefat">
								<option disabled <?php selected( $this->options['list'], '' ); ?>><?php echo esc_html__( 'Select a list..', 'mailchimp-sync' ); ?></option>
								<?php foreach( $lists as $list ) { ?>
									<option value="<?php echo esc_attr( $list->id ); ?>" <?php selected( $this->options['list'], $list->id ); ?>><?php echo esc_html( $list->name ); ?></option>
								<?php } ?>
							</select>
							<?php } ?>

							<p class="description"><?php echo esc_html__( 'Select the Mailchimp audience to synchronize changes to.' ,'mailchimp-sync' ); ?></p>
						</td>
					</tr>

					<tr valign="top">
						<th scope="row">
                            <?php echo esc_html__( 'Role to sync', 'mailchimp-sync' ); ?>
                            <small style="display: block; font-weight: normal; margin: 6px 0;"><?php echo esc_html__( 'optional', 'mailchimp-sync' ); ?></small>
                        </th>
						<td>
							<select name="<?php echo $this->name_attr('role'); ?>" id="role-select">
								<option value="" <?php selected( $this->options['role'], '' ); ?>><?php echo esc_html__( 'All roles', 'mailchimp-sync' ); ?></option>
								<?php
								$roles = get_editable_roles();
								foreach( $roles as $key => $role ) {
								    echo sprintf( '<option value="%s" %s>%s</option>', esc_attr( $key ), selected( $this->options['role'], $key, false ), esc_html( $role['name'] ) );
								}
								?>
							</select>

							<p class="description"><?php echo esc_html__( 'Select a specific user role to synchronize. Users without this role will be ignored.', 'mailchimp-sync' ); ?></p>
						</td>
					</tr>

					<tr valign="top">
						<th scope="row">
							<label><?php echo esc_html__( 'Send Additional Fields', 'mailchimp-sync' ); ?></label>
							<small style="display: block; font-weight: normal; margin: 6px 0;"><?php echo esc_html__( 'optional', 'mailchimp-sync' ); ?></small>
						</th>
						<td class="mc4wp-sync-field-map">
							<?php
							if( ! isset( $selected_list ) ) {
								echo '<p class="description">' , esc_html__( 'Please select a MailChimp list first (and then save your settings).', 'mailchimp-sync' ) , '</p>';
							} else {
								echo '<div>';
								foreach( $this->options['field_map'] as $index => $rule ) {
								?>
								<div class="field-map-row" style="margin-bottom: 4px;">
									<select class="user-field" name="<?php echo $this->name_attr( '[field_map]['.$index.'][user_field]' ); ?>">
										<option value="" disabled <?php selected( $rule['user_field'], '' ); ?>><?php echo esc_html__( 'User field', 'mailchimp-sync' ); ?></option>

										<?php
										foreach($meta_keys as $k) {
											echo sprintf( '<option %s>%s</option>', selected($k, $rule['user_field'], false), esc_html($k));
										}
										?>
									</select>

									&nbsp; <?php echo esc_html__( 'to', 'mailchimp-sync' ); ?> &nbsp;

									<select name="<?php echo $this->name_attr( '[field_map]['.$index.'][mailchimp_field]' ); ?>" class="mailchimp-field">
										<option value="" disabled <?php selected( $rule['mailchimp_field'], '' ); ?>><?php echo esc_html__( 'MailChimp field', 'mailchimp-sync' ); ?></option>
										<?php foreach( $available_mailchimp_fields as $field ) { ?>
                                            <?php if ($field->tag === 'EMAIL') { continue; } ?>
											<option value="<?php echo esc_attr( $field->tag ); ?>" <?php selected( $field->tag, $rule['mailchimp_field'] ); ?>>
												<?php echo strip_tags( $field->name ); ?>
											</option>
										<?php } ?>
									</select>
									<input type="button" value="&times;" class="button remove-row" />
								</div>
								<?php
								} // end foreachß
								?>

								</div>
								<p><input type="button" class="button add-row" value="&plus; <?php echo esc_attr__( 'Add line', 'mailchimp-sync' ); ?>" style="margin-left:0; "/></p>

								<p class="description">
									<?php printf( wp_kses( __( 'Specify <a href="%s">what Mailchimp field each user fields maps to</a>. Email address is always synchronized.', 'mailchimp-sync' ),  array( 'strong' => array(), 'a' => array( 'href' => array() ) ) ), 'https://www.mc4wp.com/kb/syncing-custom-user-fields-mailchimp/#utm_source=wp-plugin&utm_medium=mailchimp-sync&utm_campaign=settings-page', '"user meta"' ); ?>
								</p>
								<p class="description">
									<?php _e( 'Please note that empty or missing user field values will overwrite the field value in Mailchimp unless you select "Yes" in the "Skip empty user fields" setting below.', 'mailchimp-sync\'' ); ?>
								</p>

							<?php } ?>
						</td>
					</tr>

					<tr id="skip-empty-user-fields">
						<th scope="row"><?php echo esc_html__( 'Skip empty user fields?', 'mailchimp-sync' ); ?></th>
						<td class="nowrap">
							<label><input type="radio" name="<?php echo $this->name_attr( 'skip_empty_user_fields' ); ?>" value="1" <?php checked( $this->options['skip_empty_user_fields'], 1 ); ?> /> <?php echo esc_html__( 'Yes', 'mailchimp-sync' ); ?></label> &nbsp;&nbsp;&nbsp;
							<label><input type="radio" name="<?php echo $this->name_attr( 'skip_empty_user_fields' ); ?>" value="0" <?php checked( $this->options['skip_empty_user_fields'], 0 ); ?> /> <?php echo esc_html__( 'No', 'mailchimp-sync' ); ?></label>
							<p class="description"><?php echo esc_html__( 'Select "Yes" to skip empty field values, ensuring data in Mailchimp is not cleared out.', 'mailchimp-sync' ); ?></p>
						</td>
					</tr>

                    <tr>
                        <th scope="row"><?php echo esc_html__( 'Enable webhook?', 'mailchimp-sync' ); ?></th>
                        <td class="nowrap">
                            <label><input type="radio" name="<?php echo $this->name_attr( 'webhook_enabled' ); ?>" value="1" <?php checked( $this->options['webhook_enabled'], 1 ); ?> /> <?php echo esc_html__( 'Yes', 'mailchimp-sync' ); ?></label> &nbsp;&nbsp;&nbsp;
                            <label><input type="radio" name="<?php echo $this->name_attr( 'webhook_enabled' ); ?>" value="0" <?php checked( $this->options['webhook_enabled'], 0 ); ?> /> <?php echo esc_html__( 'No', 'mailchimp-sync' ); ?></label>
                            <p class="description"><?php echo esc_html__( 'Select "yes" to synchronize changes from Mailchimp to WordPress too. This only works if your website is publicly accessible.', 'mailchimp-sync' ); ?></p>
                        </td>
                    </tr>

                    </tbody>
				</table>

				<?php submit_button(); ?>


			<?php if( $this->options['enabled'] && '' !== $this->options['list'] ) { ?>

                <hr style="margin: 50px 0;"/>

				<?php
				echo '<h2>', esc_html__( 'Background processing', 'mailchimp-sync' ), '</h2>';
				echo '<p>', sprintf( __( 'The plugin is currently monitoring changes in your user fields and will automatically synchronize these changes with the <strong>%s</strong> audience in Mailchimp.', 'mailchimp-sync' ), $selected_list->name ), '</p>';

				$number_of_pending_jobs = count( $queue->all() );
				echo '<p>';
				echo sprintf( wp_kses( __( 'There are <strong>%d</strong> background jobs waiting to be processed.', 'mailchimp-sync' ), array( 'strong' => array() ) ), $number_of_pending_jobs );

				if ( $number_of_pending_jobs > 0 ) {
				    echo ' ';
					echo sprintf( __( 'Next run is scheduled at %s', 'mailchimp-sync' ), gmdate( get_option('time_format'), wp_next_scheduled( 'mc4wp_user_sync_process_queue' ) + (get_option('gmt_offset', 0) * 3600) ) );
				}
                echo '</p>';

                if( $number_of_pending_jobs > 0 ) {
                    echo '<p><a class="button" href="', add_query_arg( array( '_mc4wp_action' => 'process_user_sync_queue', '_wpnonce' => wp_create_nonce( '_mc4wp_action' ) ) ), '">', esc_html__( 'Process', 'mailchimp-sync' ), '</a></p>';
                }

                echo '<p class="description">', sprintf( wp_kses( __( 'Keep an eye on the <a href="%s">debug log</a> for any errors in the background sync process.', 'mailchimp-sync' ), array( 'a' => array( 'href' => array() ) ) ), admin_url( 'admin.php?page=mailchimp-for-wp-other' ) ), '</p>';
                echo '<hr style="margin: 40px 0;" />';
				?>


				<h2><?php echo esc_html__( 'Manual Synchronization', 'mailchimp-sync' ); ?></h2>
				<p><?php echo esc_html__( 'Clicking the following button will perform a manual re-sync of all users matching the given role criteria.', 'mailchimp-sync' ); ?></p>
				<div id="wizard">
					<?php echo esc_html__( 'Please enable JavaScript to use the Synchronisation Wizard.', 'mailchimp-sync' ); ?>
				</div>

			<?php } ?>
            </form>

		<hr style="margin: 40px 0;" />

		<?php
			if (count($this->options['field_map']) > 1) {
				echo '<h3>', esc_html__( 'Debug user data', 'mailchimp-sync' ) , '</h3>';
				echo '<p>', esc_html__('Use the form below to view what data will be sent to Mailchimp based on your current field map settings.', 'mailchimp-sync'), '</p>';
				echo '<form method="get" action="', admin_url( 'admin.php'), '">';
				echo '<input type="hidden" name="page" value="mailchimp-for-wp-user-sync">';
				echo '<input type="hidden" name="debug-field-map" value=1>';
				echo '<input class="regular-text" type="text" placeholder="', esc_attr__('Enter ID of user to debug', 'mailchimp-sync' ), '" name="user_id">';
				echo '<input class="button button-secondary" type="submit" value="', esc_attr__('Debug user', 'mailchimp-sync'), '">';
				echo '</form>';
			}
			?>

		<br style="margin: 40px 0;" />

		<!-- / Main Content -->
		</div>

		<!-- Sidebar -->
		<div class="mc4wp-sidebar mc4wp-col mc4wp-col-2">
			<?php include MC4WP_PLUGIN_DIR . '/includes/views/parts/admin-sidebar.php'; ?>
		</div>

	<!-- / Row -->
	</div>

	<?php
	/**
	 * @ignore
	 */
	do_action( 'mc4wp_admin_footer' );
	?>

</div>
PK     M\3*        user-sync/vendor/autoload.phpnu [        <?php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit7eb926787eb553f0ee9c1738e48fcb8b::getLoader();
PK     M\t!ו      1  user-sync/vendor/composer/autoload_namespaces.phpnu [        <?php

// autoload_namespaces.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
);
PK     M\Ԩ*    -  user-sync/vendor/composer/autoload_static.phpnu [        <?php

// autoload_static.php @generated by Composer

namespace Composer\Autoload;

class ComposerStaticInit7eb926787eb553f0ee9c1738e48fcb8b
{
    public static $classMap = array (
        'MC4WP\\User_Sync\\Admin' => __DIR__ . '/../..' . '/src/class-admin.php',
        'MC4WP\\User_Sync\\Ajax_Listener' => __DIR__ . '/../..' . '/src/class-ajax-listener.php',
        'MC4WP\\User_Sync\\CLI_Command' => __DIR__ . '/../..' . '/src/class-cli-command.php',
        'MC4WP\\User_Sync\\Observer' => __DIR__ . '/../..' . '/src/class-observer.php',
        'MC4WP\\User_Sync\\Tools' => __DIR__ . '/../..' . '/src/class-tools.php',
        'MC4WP\\User_Sync\\User_Handler' => __DIR__ . '/../..' . '/src/class-user-handler.php',
        'MC4WP\\User_Sync\\Users' => __DIR__ . '/../..' . '/src/class-users.php',
        'MC4WP\\User_Sync\\Webhook_Listener' => __DIR__ . '/../..' . '/src/class-webhook-listener.php',
        'MC4WP\\User_Sync\\Worker' => __DIR__ . '/../..' . '/src/class-worker.php',
    );

    public static function getInitializer(ClassLoader $loader)
    {
        return \Closure::bind(function () use ($loader) {
            $loader->classMap = ComposerStaticInit7eb926787eb553f0ee9c1738e48fcb8b::$classMap;

        }, null, ClassLoader::class);
    }
}
PK     M\ .  .  !  user-sync/vendor/composer/LICENSEnu [        
Copyright (c) Nils Adermann, Jordi Boggiano

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

PK     M\GG    +  user-sync/vendor/composer/autoload_real.phpnu [        <?php

// autoload_real.php @generated by Composer

class ComposerAutoloaderInit7eb926787eb553f0ee9c1738e48fcb8b
{
    private static $loader;

    public static function loadClassLoader($class)
    {
        if ('Composer\Autoload\ClassLoader' === $class) {
            require __DIR__ . '/ClassLoader.php';
        }
    }

    public static function getLoader()
    {
        if (null !== self::$loader) {
            return self::$loader;
        }

        spl_autoload_register(array('ComposerAutoloaderInit7eb926787eb553f0ee9c1738e48fcb8b', 'loadClassLoader'), true, true);
        self::$loader = $loader = new \Composer\Autoload\ClassLoader();
        spl_autoload_unregister(array('ComposerAutoloaderInit7eb926787eb553f0ee9c1738e48fcb8b', 'loadClassLoader'));

        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
        if ($useStaticLoader) {
            require_once __DIR__ . '/autoload_static.php';

            call_user_func(\Composer\Autoload\ComposerStaticInit7eb926787eb553f0ee9c1738e48fcb8b::getInitializer($loader));
        } else {
            $map = require __DIR__ . '/autoload_namespaces.php';
            foreach ($map as $namespace => $path) {
                $loader->set($namespace, $path);
            }

            $map = require __DIR__ . '/autoload_psr4.php';
            foreach ($map as $namespace => $path) {
                $loader->setPsr4($namespace, $path);
            }

            $classMap = require __DIR__ . '/autoload_classmap.php';
            if ($classMap) {
                $loader->addClassMap($classMap);
            }
        }

        $loader->register(true);

        return $loader;
    }
}
PK     M\z4  4  )  user-sync/vendor/composer/ClassLoader.phpnu [        <?php

/*
 * This file is part of Composer.
 *
 * (c) Nils Adermann <naderman@naderman.de>
 *     Jordi Boggiano <j.boggiano@seld.be>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Composer\Autoload;

/**
 * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
 *
 *     $loader = new \Composer\Autoload\ClassLoader();
 *
 *     // register classes with namespaces
 *     $loader->add('Symfony\Component', __DIR__.'/component');
 *     $loader->add('Symfony',           __DIR__.'/framework');
 *
 *     // activate the autoloader
 *     $loader->register();
 *
 *     // to enable searching the include path (eg. for PEAR packages)
 *     $loader->setUseIncludePath(true);
 *
 * In this example, if you try to use a class in the Symfony\Component
 * namespace or one of its children (Symfony\Component\Console for instance),
 * the autoloader will first look for the class under the component/
 * directory, and it will then fallback to the framework/ directory if not
 * found before giving up.
 *
 * This class is loosely based on the Symfony UniversalClassLoader.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 * @author Jordi Boggiano <j.boggiano@seld.be>
 * @see    http://www.php-fig.org/psr/psr-0/
 * @see    http://www.php-fig.org/psr/psr-4/
 */
class ClassLoader
{
    // PSR-4
    private $prefixLengthsPsr4 = array();
    private $prefixDirsPsr4 = array();
    private $fallbackDirsPsr4 = array();

    // PSR-0
    private $prefixesPsr0 = array();
    private $fallbackDirsPsr0 = array();

    private $useIncludePath = false;
    private $classMap = array();
    private $classMapAuthoritative = false;
    private $missingClasses = array();
    private $apcuPrefix;

    public function getPrefixes()
    {
        if (!empty($this->prefixesPsr0)) {
            return call_user_func_array('array_merge', $this->prefixesPsr0);
        }

        return array();
    }

    public function getPrefixesPsr4()
    {
        return $this->prefixDirsPsr4;
    }

    public function getFallbackDirs()
    {
        return $this->fallbackDirsPsr0;
    }

    public function getFallbackDirsPsr4()
    {
        return $this->fallbackDirsPsr4;
    }

    public function getClassMap()
    {
        return $this->classMap;
    }

    /**
     * @param array $classMap Class to filename map
     */
    public function addClassMap(array $classMap)
    {
        if ($this->classMap) {
            $this->classMap = array_merge($this->classMap, $classMap);
        } else {
            $this->classMap = $classMap;
        }
    }

    /**
     * Registers a set of PSR-0 directories for a given prefix, either
     * appending or prepending to the ones previously set for this prefix.
     *
     * @param string       $prefix  The prefix
     * @param array|string $paths   The PSR-0 root directories
     * @param bool         $prepend Whether to prepend the directories
     */
    public function add($prefix, $paths, $prepend = false)
    {
        if (!$prefix) {
            if ($prepend) {
                $this->fallbackDirsPsr0 = array_merge(
                    (array) $paths,
                    $this->fallbackDirsPsr0
                );
            } else {
                $this->fallbackDirsPsr0 = array_merge(
                    $this->fallbackDirsPsr0,
                    (array) $paths
                );
            }

            return;
        }

        $first = $prefix[0];
        if (!isset($this->prefixesPsr0[$first][$prefix])) {
            $this->prefixesPsr0[$first][$prefix] = (array) $paths;

            return;
        }
        if ($prepend) {
            $this->prefixesPsr0[$first][$prefix] = array_merge(
                (array) $paths,
                $this->prefixesPsr0[$first][$prefix]
            );
        } else {
            $this->prefixesPsr0[$first][$prefix] = array_merge(
                $this->prefixesPsr0[$first][$prefix],
                (array) $paths
            );
        }
    }

    /**
     * Registers a set of PSR-4 directories for a given namespace, either
     * appending or prepending to the ones previously set for this namespace.
     *
     * @param string       $prefix  The prefix/namespace, with trailing '\\'
     * @param array|string $paths   The PSR-4 base directories
     * @param bool         $prepend Whether to prepend the directories
     *
     * @throws \InvalidArgumentException
     */
    public function addPsr4($prefix, $paths, $prepend = false)
    {
        if (!$prefix) {
            // Register directories for the root namespace.
            if ($prepend) {
                $this->fallbackDirsPsr4 = array_merge(
                    (array) $paths,
                    $this->fallbackDirsPsr4
                );
            } else {
                $this->fallbackDirsPsr4 = array_merge(
                    $this->fallbackDirsPsr4,
                    (array) $paths
                );
            }
        } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
            // Register directories for a new namespace.
            $length = strlen($prefix);
            if ('\\' !== $prefix[$length - 1]) {
                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
            }
            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
            $this->prefixDirsPsr4[$prefix] = (array) $paths;
        } elseif ($prepend) {
            // Prepend directories for an already registered namespace.
            $this->prefixDirsPsr4[$prefix] = array_merge(
                (array) $paths,
                $this->prefixDirsPsr4[$prefix]
            );
        } else {
            // Append directories for an already registered namespace.
            $this->prefixDirsPsr4[$prefix] = array_merge(
                $this->prefixDirsPsr4[$prefix],
                (array) $paths
            );
        }
    }

    /**
     * Registers a set of PSR-0 directories for a given prefix,
     * replacing any others previously set for this prefix.
     *
     * @param string       $prefix The prefix
     * @param array|string $paths  The PSR-0 base directories
     */
    public function set($prefix, $paths)
    {
        if (!$prefix) {
            $this->fallbackDirsPsr0 = (array) $paths;
        } else {
            $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
        }
    }

    /**
     * Registers a set of PSR-4 directories for a given namespace,
     * replacing any others previously set for this namespace.
     *
     * @param string       $prefix The prefix/namespace, with trailing '\\'
     * @param array|string $paths  The PSR-4 base directories
     *
     * @throws \InvalidArgumentException
     */
    public function setPsr4($prefix, $paths)
    {
        if (!$prefix) {
            $this->fallbackDirsPsr4 = (array) $paths;
        } else {
            $length = strlen($prefix);
            if ('\\' !== $prefix[$length - 1]) {
                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
            }
            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
            $this->prefixDirsPsr4[$prefix] = (array) $paths;
        }
    }

    /**
     * Turns on searching the include path for class files.
     *
     * @param bool $useIncludePath
     */
    public function setUseIncludePath($useIncludePath)
    {
        $this->useIncludePath = $useIncludePath;
    }

    /**
     * Can be used to check if the autoloader uses the include path to check
     * for classes.
     *
     * @return bool
     */
    public function getUseIncludePath()
    {
        return $this->useIncludePath;
    }

    /**
     * Turns off searching the prefix and fallback directories for classes
     * that have not been registered with the class map.
     *
     * @param bool $classMapAuthoritative
     */
    public function setClassMapAuthoritative($classMapAuthoritative)
    {
        $this->classMapAuthoritative = $classMapAuthoritative;
    }

    /**
     * Should class lookup fail if not found in the current class map?
     *
     * @return bool
     */
    public function isClassMapAuthoritative()
    {
        return $this->classMapAuthoritative;
    }

    /**
     * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
     *
     * @param string|null $apcuPrefix
     */
    public function setApcuPrefix($apcuPrefix)
    {
        $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
    }

    /**
     * The APCu prefix in use, or null if APCu caching is not enabled.
     *
     * @return string|null
     */
    public function getApcuPrefix()
    {
        return $this->apcuPrefix;
    }

    /**
     * Registers this instance as an autoloader.
     *
     * @param bool $prepend Whether to prepend the autoloader or not
     */
    public function register($prepend = false)
    {
        spl_autoload_register(array($this, 'loadClass'), true, $prepend);
    }

    /**
     * Unregisters this instance as an autoloader.
     */
    public function unregister()
    {
        spl_autoload_unregister(array($this, 'loadClass'));
    }

    /**
     * Loads the given class or interface.
     *
     * @param  string    $class The name of the class
     * @return bool|null True if loaded, null otherwise
     */
    public function loadClass($class)
    {
        if ($file = $this->findFile($class)) {
            includeFile($file);

            return true;
        }
    }

    /**
     * Finds the path to the file where the class is defined.
     *
     * @param string $class The name of the class
     *
     * @return string|false The path if found, false otherwise
     */
    public function findFile($class)
    {
        // class map lookup
        if (isset($this->classMap[$class])) {
            return $this->classMap[$class];
        }
        if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
            return false;
        }
        if (null !== $this->apcuPrefix) {
            $file = apcu_fetch($this->apcuPrefix.$class, $hit);
            if ($hit) {
                return $file;
            }
        }

        $file = $this->findFileWithExtension($class, '.php');

        // Search for Hack files if we are running on HHVM
        if (false === $file && defined('HHVM_VERSION')) {
            $file = $this->findFileWithExtension($class, '.hh');
        }

        if (null !== $this->apcuPrefix) {
            apcu_add($this->apcuPrefix.$class, $file);
        }

        if (false === $file) {
            // Remember that this class does not exist.
            $this->missingClasses[$class] = true;
        }

        return $file;
    }

    private function findFileWithExtension($class, $ext)
    {
        // PSR-4 lookup
        $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;

        $first = $class[0];
        if (isset($this->prefixLengthsPsr4[$first])) {
            $subPath = $class;
            while (false !== $lastPos = strrpos($subPath, '\\')) {
                $subPath = substr($subPath, 0, $lastPos);
                $search = $subPath . '\\';
                if (isset($this->prefixDirsPsr4[$search])) {
                    $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
                    foreach ($this->prefixDirsPsr4[$search] as $dir) {
                        if (file_exists($file = $dir . $pathEnd)) {
                            return $file;
                        }
                    }
                }
            }
        }

        // PSR-4 fallback dirs
        foreach ($this->fallbackDirsPsr4 as $dir) {
            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
                return $file;
            }
        }

        // PSR-0 lookup
        if (false !== $pos = strrpos($class, '\\')) {
            // namespaced class name
            $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
                . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
        } else {
            // PEAR-like class name
            $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
        }

        if (isset($this->prefixesPsr0[$first])) {
            foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
                if (0 === strpos($class, $prefix)) {
                    foreach ($dirs as $dir) {
                        if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
                            return $file;
                        }
                    }
                }
            }
        }

        // PSR-0 fallback dirs
        foreach ($this->fallbackDirsPsr0 as $dir) {
            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
                return $file;
            }
        }

        // PSR-0 include paths.
        if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
            return $file;
        }

        return false;
    }
}

/**
 * Scope isolated include.
 *
 * Prevents access to $this/self from included files.
 */
function includeFile($file)
{
    include $file;
}
PK     M\D      +  user-sync/vendor/composer/autoload_psr4.phpnu [        <?php

// autoload_psr4.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
);
PK     M\AeG?  ?  /  user-sync/vendor/composer/autoload_classmap.phpnu [        <?php

// autoload_classmap.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
    'MC4WP\\User_Sync\\Admin' => $baseDir . '/src/class-admin.php',
    'MC4WP\\User_Sync\\Ajax_Listener' => $baseDir . '/src/class-ajax-listener.php',
    'MC4WP\\User_Sync\\CLI_Command' => $baseDir . '/src/class-cli-command.php',
    'MC4WP\\User_Sync\\Observer' => $baseDir . '/src/class-observer.php',
    'MC4WP\\User_Sync\\Tools' => $baseDir . '/src/class-tools.php',
    'MC4WP\\User_Sync\\User_Handler' => $baseDir . '/src/class-user-handler.php',
    'MC4WP\\User_Sync\\Users' => $baseDir . '/src/class-users.php',
    'MC4WP\\User_Sync\\Webhook_Listener' => $baseDir . '/src/class-webhook-listener.php',
    'MC4WP\\User_Sync\\Worker' => $baseDir . '/src/class-worker.php',
);
PK     M\?        vendor/autoload.phpnu [        <?php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInitbb0bfb3c835c50a0d3ffe610950a1338::getLoader();
PK     M\t!ו      '  vendor/composer/autoload_namespaces.phpnu [        <?php

// autoload_namespaces.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
);
PK     M\S      vendor/composer/installed.phpnu [        <?php return array(
    'root' => array(
        'pretty_version' => 'dev-master',
        'version' => 'dev-master',
        'type' => 'library',
        'install_path' => __DIR__ . '/../../',
        'aliases' => array(),
        'reference' => 'cd1f7c19bf2d12bb86ea6d08bd07c91a2a304e0c',
        'name' => '__root__',
        'dev' => false,
    ),
    'versions' => array(
        '__root__' => array(
            'pretty_version' => 'dev-master',
            'version' => 'dev-master',
            'type' => 'library',
            'install_path' => __DIR__ . '/../../',
            'aliases' => array(),
            'reference' => 'cd1f7c19bf2d12bb86ea6d08bd07c91a2a304e0c',
            'dev_requirement' => false,
        ),
    ),
);
PK     M\!L    #  vendor/composer/autoload_static.phpnu [        <?php

// autoload_static.php @generated by Composer

namespace Composer\Autoload;

class ComposerStaticInitbb0bfb3c835c50a0d3ffe610950a1338
{
    public static $classMap = array (
        'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
        'MC4WP\\Licensing\\Admin' => __DIR__ . '/../..' . '/licensing/class-admin.php',
        'MC4WP\\Licensing\\ApiException' => __DIR__ . '/../..' . '/licensing/class-api-exception.php',
        'MC4WP\\Licensing\\Client' => __DIR__ . '/../..' . '/licensing/class-api-client.php',
        'MC4WP\\PostCampaign\\Gutenberg_Editor' => __DIR__ . '/../..' . '/post-campaign/includes/class-gutenberg-editor.php',
        'MC4WP\\PostCampaign\\Post_Mailchimp_Campaign' => __DIR__ . '/../..' . '/post-campaign/includes/class-post-mailchimp-campaign.php',
        'MC4WP_AJAX_Forms' => __DIR__ . '/../..' . '/ajax-forms/includes/class-ajax-forms.php',
        'MC4WP_AJAX_Forms_Admin' => __DIR__ . '/../..' . '/ajax-forms/includes/class-admin.php',
        'MC4WP_Custom_Color_Theme' => __DIR__ . '/../..' . '/custom-color-theme/includes/class-theme.php',
        'MC4WP_Custom_Color_Theme_Admin' => __DIR__ . '/../..' . '/custom-color-theme/includes/class-admin.php',
        'MC4WP_Dashboard_Log_Widget' => __DIR__ . '/../..' . '/logging/includes/class-dashboard-log-widget.php',
        'MC4WP_Email_Notification' => __DIR__ . '/../..' . '/email-notifications/includes/class-email-notification.php',
        'MC4WP_Form_Notification_Factory' => __DIR__ . '/../..' . '/email-notifications/includes/class-factory.php',
        'MC4WP_Form_Notifications_Admin' => __DIR__ . '/../..' . '/email-notifications/includes/class-admin.php',
        'MC4WP_Form_Widget_Enhancements' => __DIR__ . '/../..' . '/multiple-forms/includes/class-widget-enhancements.php',
        'MC4WP_Forms_Table' => __DIR__ . '/../..' . '/multiple-forms/includes/class-forms-table.php',
        'MC4WP_Graph' => __DIR__ . '/../..' . '/logging/includes/class-graph.php',
        'MC4WP_Log_Exporter' => __DIR__ . '/../..' . '/logging/includes/class-log-exporter.php',
        'MC4WP_Log_Item' => __DIR__ . '/../..' . '/logging/includes/class-log-item.php',
        'MC4WP_Log_Table' => __DIR__ . '/../..' . '/logging/includes/class-log-table.php',
        'MC4WP_Logger' => __DIR__ . '/../..' . '/logging/includes/class-logger.php',
        'MC4WP_Logging_Admin' => __DIR__ . '/../..' . '/logging/includes/class-admin.php',
        'MC4WP_Logging_Installer' => __DIR__ . '/../..' . '/logging/includes/class-installer.php',
        'MC4WP_Multiple_Forms_Admin' => __DIR__ . '/../..' . '/multiple-forms/includes/class-admin.php',
        'MC4WP_RGB_Color' => __DIR__ . '/../..' . '/custom-color-theme/includes/class-rgb-color.php',
        'MC4WP_Required_Plugins_Notice' => __DIR__ . '/../..' . '/includes/class-required-plugins-notice.php',
        'MC4WP_Styles_Builder' => __DIR__ . '/../..' . '/styles-builder/includes/class-styles-builder.php',
        'MC4WP_Styles_Builder_Admin' => __DIR__ . '/../..' . '/styles-builder/includes/class-admin.php',
        'MC4WP_Styles_Builder_Public' => __DIR__ . '/../..' . '/styles-builder/includes/class-public.php',
    );

    public static function getInitializer(ClassLoader $loader)
    {
        return \Closure::bind(function () use ($loader) {
            $loader->classMap = ComposerStaticInitbb0bfb3c835c50a0d3ffe610950a1338::$classMap;

        }, null, ClassLoader::class);
    }
}
PK     M\ .  .    vendor/composer/LICENSEnu [        
Copyright (c) Nils Adermann, Jordi Boggiano

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

PK     M\,"k{7  7  !  vendor/composer/autoload_real.phpnu [        <?php

// autoload_real.php @generated by Composer

class ComposerAutoloaderInitbb0bfb3c835c50a0d3ffe610950a1338
{
    private static $loader;

    public static function loadClassLoader($class)
    {
        if ('Composer\Autoload\ClassLoader' === $class) {
            require __DIR__ . '/ClassLoader.php';
        }
    }

    /**
     * @return \Composer\Autoload\ClassLoader
     */
    public static function getLoader()
    {
        if (null !== self::$loader) {
            return self::$loader;
        }

        spl_autoload_register(array('ComposerAutoloaderInitbb0bfb3c835c50a0d3ffe610950a1338', 'loadClassLoader'), true, true);
        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
        spl_autoload_unregister(array('ComposerAutoloaderInitbb0bfb3c835c50a0d3ffe610950a1338', 'loadClassLoader'));

        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
        if ($useStaticLoader) {
            require __DIR__ . '/autoload_static.php';

            call_user_func(\Composer\Autoload\ComposerStaticInitbb0bfb3c835c50a0d3ffe610950a1338::getInitializer($loader));
        } else {
            $map = require __DIR__ . '/autoload_namespaces.php';
            foreach ($map as $namespace => $path) {
                $loader->set($namespace, $path);
            }

            $map = require __DIR__ . '/autoload_psr4.php';
            foreach ($map as $namespace => $path) {
                $loader->setPsr4($namespace, $path);
            }

            $classMap = require __DIR__ . '/autoload_classmap.php';
            if ($classMap) {
                $loader->addClassMap($classMap);
            }
        }

        $loader->register(true);

        return $loader;
    }
}
PK     M\5Ky>  >    vendor/composer/ClassLoader.phpnu [        <?php

/*
 * This file is part of Composer.
 *
 * (c) Nils Adermann <naderman@naderman.de>
 *     Jordi Boggiano <j.boggiano@seld.be>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Composer\Autoload;

/**
 * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
 *
 *     $loader = new \Composer\Autoload\ClassLoader();
 *
 *     // register classes with namespaces
 *     $loader->add('Symfony\Component', __DIR__.'/component');
 *     $loader->add('Symfony',           __DIR__.'/framework');
 *
 *     // activate the autoloader
 *     $loader->register();
 *
 *     // to enable searching the include path (eg. for PEAR packages)
 *     $loader->setUseIncludePath(true);
 *
 * In this example, if you try to use a class in the Symfony\Component
 * namespace or one of its children (Symfony\Component\Console for instance),
 * the autoloader will first look for the class under the component/
 * directory, and it will then fallback to the framework/ directory if not
 * found before giving up.
 *
 * This class is loosely based on the Symfony UniversalClassLoader.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 * @author Jordi Boggiano <j.boggiano@seld.be>
 * @see    https://www.php-fig.org/psr/psr-0/
 * @see    https://www.php-fig.org/psr/psr-4/
 */
class ClassLoader
{
    /** @var ?string */
    private $vendorDir;

    // PSR-4
    /**
     * @var array[]
     * @psalm-var array<string, array<string, int>>
     */
    private $prefixLengthsPsr4 = array();
    /**
     * @var array[]
     * @psalm-var array<string, array<int, string>>
     */
    private $prefixDirsPsr4 = array();
    /**
     * @var array[]
     * @psalm-var array<string, string>
     */
    private $fallbackDirsPsr4 = array();

    // PSR-0
    /**
     * @var array[]
     * @psalm-var array<string, array<string, string[]>>
     */
    private $prefixesPsr0 = array();
    /**
     * @var array[]
     * @psalm-var array<string, string>
     */
    private $fallbackDirsPsr0 = array();

    /** @var bool */
    private $useIncludePath = false;

    /**
     * @var string[]
     * @psalm-var array<string, string>
     */
    private $classMap = array();

    /** @var bool */
    private $classMapAuthoritative = false;

    /**
     * @var bool[]
     * @psalm-var array<string, bool>
     */
    private $missingClasses = array();

    /** @var ?string */
    private $apcuPrefix;

    /**
     * @var self[]
     */
    private static $registeredLoaders = array();

    /**
     * @param ?string $vendorDir
     */
    public function __construct($vendorDir = null)
    {
        $this->vendorDir = $vendorDir;
    }

    /**
     * @return string[]
     */
    public function getPrefixes()
    {
        if (!empty($this->prefixesPsr0)) {
            return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
        }

        return array();
    }

    /**
     * @return array[]
     * @psalm-return array<string, array<int, string>>
     */
    public function getPrefixesPsr4()
    {
        return $this->prefixDirsPsr4;
    }

    /**
     * @return array[]
     * @psalm-return array<string, string>
     */
    public function getFallbackDirs()
    {
        return $this->fallbackDirsPsr0;
    }

    /**
     * @return array[]
     * @psalm-return array<string, string>
     */
    public function getFallbackDirsPsr4()
    {
        return $this->fallbackDirsPsr4;
    }

    /**
     * @return string[] Array of classname => path
     * @psalm-return array<string, string>
     */
    public function getClassMap()
    {
        return $this->classMap;
    }

    /**
     * @param string[] $classMap Class to filename map
     * @psalm-param array<string, string> $classMap
     *
     * @return void
     */
    public function addClassMap(array $classMap)
    {
        if ($this->classMap) {
            $this->classMap = array_merge($this->classMap, $classMap);
        } else {
            $this->classMap = $classMap;
        }
    }

    /**
     * Registers a set of PSR-0 directories for a given prefix, either
     * appending or prepending to the ones previously set for this prefix.
     *
     * @param string          $prefix  The prefix
     * @param string[]|string $paths   The PSR-0 root directories
     * @param bool            $prepend Whether to prepend the directories
     *
     * @return void
     */
    public function add($prefix, $paths, $prepend = false)
    {
        if (!$prefix) {
            if ($prepend) {
                $this->fallbackDirsPsr0 = array_merge(
                    (array) $paths,
                    $this->fallbackDirsPsr0
                );
            } else {
                $this->fallbackDirsPsr0 = array_merge(
                    $this->fallbackDirsPsr0,
                    (array) $paths
                );
            }

            return;
        }

        $first = $prefix[0];
        if (!isset($this->prefixesPsr0[$first][$prefix])) {
            $this->prefixesPsr0[$first][$prefix] = (array) $paths;

            return;
        }
        if ($prepend) {
            $this->prefixesPsr0[$first][$prefix] = array_merge(
                (array) $paths,
                $this->prefixesPsr0[$first][$prefix]
            );
        } else {
            $this->prefixesPsr0[$first][$prefix] = array_merge(
                $this->prefixesPsr0[$first][$prefix],
                (array) $paths
            );
        }
    }

    /**
     * Registers a set of PSR-4 directories for a given namespace, either
     * appending or prepending to the ones previously set for this namespace.
     *
     * @param string          $prefix  The prefix/namespace, with trailing '\\'
     * @param string[]|string $paths   The PSR-4 base directories
     * @param bool            $prepend Whether to prepend the directories
     *
     * @throws \InvalidArgumentException
     *
     * @return void
     */
    public function addPsr4($prefix, $paths, $prepend = false)
    {
        if (!$prefix) {
            // Register directories for the root namespace.
            if ($prepend) {
                $this->fallbackDirsPsr4 = array_merge(
                    (array) $paths,
                    $this->fallbackDirsPsr4
                );
            } else {
                $this->fallbackDirsPsr4 = array_merge(
                    $this->fallbackDirsPsr4,
                    (array) $paths
                );
            }
        } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
            // Register directories for a new namespace.
            $length = strlen($prefix);
            if ('\\' !== $prefix[$length - 1]) {
                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
            }
            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
            $this->prefixDirsPsr4[$prefix] = (array) $paths;
        } elseif ($prepend) {
            // Prepend directories for an already registered namespace.
            $this->prefixDirsPsr4[$prefix] = array_merge(
                (array) $paths,
                $this->prefixDirsPsr4[$prefix]
            );
        } else {
            // Append directories for an already registered namespace.
            $this->prefixDirsPsr4[$prefix] = array_merge(
                $this->prefixDirsPsr4[$prefix],
                (array) $paths
            );
        }
    }

    /**
     * Registers a set of PSR-0 directories for a given prefix,
     * replacing any others previously set for this prefix.
     *
     * @param string          $prefix The prefix
     * @param string[]|string $paths  The PSR-0 base directories
     *
     * @return void
     */
    public function set($prefix, $paths)
    {
        if (!$prefix) {
            $this->fallbackDirsPsr0 = (array) $paths;
        } else {
            $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
        }
    }

    /**
     * Registers a set of PSR-4 directories for a given namespace,
     * replacing any others previously set for this namespace.
     *
     * @param string          $prefix The prefix/namespace, with trailing '\\'
     * @param string[]|string $paths  The PSR-4 base directories
     *
     * @throws \InvalidArgumentException
     *
     * @return void
     */
    public function setPsr4($prefix, $paths)
    {
        if (!$prefix) {
            $this->fallbackDirsPsr4 = (array) $paths;
        } else {
            $length = strlen($prefix);
            if ('\\' !== $prefix[$length - 1]) {
                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
            }
            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
            $this->prefixDirsPsr4[$prefix] = (array) $paths;
        }
    }

    /**
     * Turns on searching the include path for class files.
     *
     * @param bool $useIncludePath
     *
     * @return void
     */
    public function setUseIncludePath($useIncludePath)
    {
        $this->useIncludePath = $useIncludePath;
    }

    /**
     * Can be used to check if the autoloader uses the include path to check
     * for classes.
     *
     * @return bool
     */
    public function getUseIncludePath()
    {
        return $this->useIncludePath;
    }

    /**
     * Turns off searching the prefix and fallback directories for classes
     * that have not been registered with the class map.
     *
     * @param bool $classMapAuthoritative
     *
     * @return void
     */
    public function setClassMapAuthoritative($classMapAuthoritative)
    {
        $this->classMapAuthoritative = $classMapAuthoritative;
    }

    /**
     * Should class lookup fail if not found in the current class map?
     *
     * @return bool
     */
    public function isClassMapAuthoritative()
    {
        return $this->classMapAuthoritative;
    }

    /**
     * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
     *
     * @param string|null $apcuPrefix
     *
     * @return void
     */
    public function setApcuPrefix($apcuPrefix)
    {
        $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
    }

    /**
     * The APCu prefix in use, or null if APCu caching is not enabled.
     *
     * @return string|null
     */
    public function getApcuPrefix()
    {
        return $this->apcuPrefix;
    }

    /**
     * Registers this instance as an autoloader.
     *
     * @param bool $prepend Whether to prepend the autoloader or not
     *
     * @return void
     */
    public function register($prepend = false)
    {
        spl_autoload_register(array($this, 'loadClass'), true, $prepend);

        if (null === $this->vendorDir) {
            return;
        }

        if ($prepend) {
            self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
        } else {
            unset(self::$registeredLoaders[$this->vendorDir]);
            self::$registeredLoaders[$this->vendorDir] = $this;
        }
    }

    /**
     * Unregisters this instance as an autoloader.
     *
     * @return void
     */
    public function unregister()
    {
        spl_autoload_unregister(array($this, 'loadClass'));

        if (null !== $this->vendorDir) {
            unset(self::$registeredLoaders[$this->vendorDir]);
        }
    }

    /**
     * Loads the given class or interface.
     *
     * @param  string    $class The name of the class
     * @return true|null True if loaded, null otherwise
     */
    public function loadClass($class)
    {
        if ($file = $this->findFile($class)) {
            includeFile($file);

            return true;
        }

        return null;
    }

    /**
     * Finds the path to the file where the class is defined.
     *
     * @param string $class The name of the class
     *
     * @return string|false The path if found, false otherwise
     */
    public function findFile($class)
    {
        // class map lookup
        if (isset($this->classMap[$class])) {
            return $this->classMap[$class];
        }
        if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
            return false;
        }
        if (null !== $this->apcuPrefix) {
            $file = apcu_fetch($this->apcuPrefix.$class, $hit);
            if ($hit) {
                return $file;
            }
        }

        $file = $this->findFileWithExtension($class, '.php');

        // Search for Hack files if we are running on HHVM
        if (false === $file && defined('HHVM_VERSION')) {
            $file = $this->findFileWithExtension($class, '.hh');
        }

        if (null !== $this->apcuPrefix) {
            apcu_add($this->apcuPrefix.$class, $file);
        }

        if (false === $file) {
            // Remember that this class does not exist.
            $this->missingClasses[$class] = true;
        }

        return $file;
    }

    /**
     * Returns the currently registered loaders indexed by their corresponding vendor directories.
     *
     * @return self[]
     */
    public static function getRegisteredLoaders()
    {
        return self::$registeredLoaders;
    }

    /**
     * @param  string       $class
     * @param  string       $ext
     * @return string|false
     */
    private function findFileWithExtension($class, $ext)
    {
        // PSR-4 lookup
        $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;

        $first = $class[0];
        if (isset($this->prefixLengthsPsr4[$first])) {
            $subPath = $class;
            while (false !== $lastPos = strrpos($subPath, '\\')) {
                $subPath = substr($subPath, 0, $lastPos);
                $search = $subPath . '\\';
                if (isset($this->prefixDirsPsr4[$search])) {
                    $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
                    foreach ($this->prefixDirsPsr4[$search] as $dir) {
                        if (file_exists($file = $dir . $pathEnd)) {
                            return $file;
                        }
                    }
                }
            }
        }

        // PSR-4 fallback dirs
        foreach ($this->fallbackDirsPsr4 as $dir) {
            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
                return $file;
            }
        }

        // PSR-0 lookup
        if (false !== $pos = strrpos($class, '\\')) {
            // namespaced class name
            $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
                . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
        } else {
            // PEAR-like class name
            $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
        }

        if (isset($this->prefixesPsr0[$first])) {
            foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
                if (0 === strpos($class, $prefix)) {
                    foreach ($dirs as $dir) {
                        if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
                            return $file;
                        }
                    }
                }
            }
        }

        // PSR-0 fallback dirs
        foreach ($this->fallbackDirsPsr0 as $dir) {
            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
                return $file;
            }
        }

        // PSR-0 include paths.
        if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
            return $file;
        }

        return false;
    }
}

/**
 * Scope isolated include.
 *
 * Prevents access to $this/self from included files.
 *
 * @param  string $file
 * @return void
 * @private
 */
function includeFile($file)
{
    include $file;
}
PK     M\T":  :  %  vendor/composer/InstalledVersions.phpnu [        <?php

/*
 * This file is part of Composer.
 *
 * (c) Nils Adermann <naderman@naderman.de>
 *     Jordi Boggiano <j.boggiano@seld.be>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Composer;

use Composer\Autoload\ClassLoader;
use Composer\Semver\VersionParser;

/**
 * This class is copied in every Composer installed project and available to all
 *
 * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
 *
 * To require its presence, you can require `composer-runtime-api ^2.0`
 */
class InstalledVersions
{
    /**
     * @var mixed[]|null
     * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
     */
    private static $installed;

    /**
     * @var bool|null
     */
    private static $canGetVendors;

    /**
     * @var array[]
     * @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     */
    private static $installedByVendor = array();

    /**
     * Returns a list of all package names which are present, either by being installed, replaced or provided
     *
     * @return string[]
     * @psalm-return list<string>
     */
    public static function getInstalledPackages()
    {
        $packages = array();
        foreach (self::getInstalled() as $installed) {
            $packages[] = array_keys($installed['versions']);
        }

        if (1 === \count($packages)) {
            return $packages[0];
        }

        return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
    }

    /**
     * Returns a list of all package names with a specific type e.g. 'library'
     *
     * @param  string   $type
     * @return string[]
     * @psalm-return list<string>
     */
    public static function getInstalledPackagesByType($type)
    {
        $packagesByType = array();

        foreach (self::getInstalled() as $installed) {
            foreach ($installed['versions'] as $name => $package) {
                if (isset($package['type']) && $package['type'] === $type) {
                    $packagesByType[] = $name;
                }
            }
        }

        return $packagesByType;
    }

    /**
     * Checks whether the given package is installed
     *
     * This also returns true if the package name is provided or replaced by another package
     *
     * @param  string $packageName
     * @param  bool   $includeDevRequirements
     * @return bool
     */
    public static function isInstalled($packageName, $includeDevRequirements = true)
    {
        foreach (self::getInstalled() as $installed) {
            if (isset($installed['versions'][$packageName])) {
                return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
            }
        }

        return false;
    }

    /**
     * Checks whether the given package satisfies a version constraint
     *
     * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
     *
     *   Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
     *
     * @param  VersionParser $parser      Install composer/semver to have access to this class and functionality
     * @param  string        $packageName
     * @param  string|null   $constraint  A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
     * @return bool
     */
    public static function satisfies(VersionParser $parser, $packageName, $constraint)
    {
        $constraint = $parser->parseConstraints($constraint);
        $provided = $parser->parseConstraints(self::getVersionRanges($packageName));

        return $provided->matches($constraint);
    }

    /**
     * Returns a version constraint representing all the range(s) which are installed for a given package
     *
     * It is easier to use this via isInstalled() with the $constraint argument if you need to check
     * whether a given version of a package is installed, and not just whether it exists
     *
     * @param  string $packageName
     * @return string Version constraint usable with composer/semver
     */
    public static function getVersionRanges($packageName)
    {
        foreach (self::getInstalled() as $installed) {
            if (!isset($installed['versions'][$packageName])) {
                continue;
            }

            $ranges = array();
            if (isset($installed['versions'][$packageName]['pretty_version'])) {
                $ranges[] = $installed['versions'][$packageName]['pretty_version'];
            }
            if (array_key_exists('aliases', $installed['versions'][$packageName])) {
                $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
            }
            if (array_key_exists('replaced', $installed['versions'][$packageName])) {
                $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
            }
            if (array_key_exists('provided', $installed['versions'][$packageName])) {
                $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
            }

            return implode(' || ', $ranges);
        }

        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    }

    /**
     * @param  string      $packageName
     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
     */
    public static function getVersion($packageName)
    {
        foreach (self::getInstalled() as $installed) {
            if (!isset($installed['versions'][$packageName])) {
                continue;
            }

            if (!isset($installed['versions'][$packageName]['version'])) {
                return null;
            }

            return $installed['versions'][$packageName]['version'];
        }

        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    }

    /**
     * @param  string      $packageName
     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
     */
    public static function getPrettyVersion($packageName)
    {
        foreach (self::getInstalled() as $installed) {
            if (!isset($installed['versions'][$packageName])) {
                continue;
            }

            if (!isset($installed['versions'][$packageName]['pretty_version'])) {
                return null;
            }

            return $installed['versions'][$packageName]['pretty_version'];
        }

        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    }

    /**
     * @param  string      $packageName
     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
     */
    public static function getReference($packageName)
    {
        foreach (self::getInstalled() as $installed) {
            if (!isset($installed['versions'][$packageName])) {
                continue;
            }

            if (!isset($installed['versions'][$packageName]['reference'])) {
                return null;
            }

            return $installed['versions'][$packageName]['reference'];
        }

        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    }

    /**
     * @param  string      $packageName
     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
     */
    public static function getInstallPath($packageName)
    {
        foreach (self::getInstalled() as $installed) {
            if (!isset($installed['versions'][$packageName])) {
                continue;
            }

            return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
        }

        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    }

    /**
     * @return array
     * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
     */
    public static function getRootPackage()
    {
        $installed = self::getInstalled();

        return $installed[0]['root'];
    }

    /**
     * Returns the raw installed.php data for custom implementations
     *
     * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
     * @return array[]
     * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
     */
    public static function getRawData()
    {
        @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);

        if (null === self::$installed) {
            // only require the installed.php file if this file is loaded from its dumped location,
            // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
            if (substr(__DIR__, -8, 1) !== 'C') {
                self::$installed = include __DIR__ . '/installed.php';
            } else {
                self::$installed = array();
            }
        }

        return self::$installed;
    }

    /**
     * Returns the raw data of all installed.php which are currently loaded for custom implementations
     *
     * @return array[]
     * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     */
    public static function getAllRawData()
    {
        return self::getInstalled();
    }

    /**
     * Lets you reload the static array from another file
     *
     * This is only useful for complex integrations in which a project needs to use
     * this class but then also needs to execute another project's autoloader in process,
     * and wants to ensure both projects have access to their version of installed.php.
     *
     * A typical case would be PHPUnit, where it would need to make sure it reads all
     * the data it needs from this class, then call reload() with
     * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
     * the project in which it runs can then also use this class safely, without
     * interference between PHPUnit's dependencies and the project's dependencies.
     *
     * @param  array[] $data A vendor/composer/installed.php data set
     * @return void
     *
     * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
     */
    public static function reload($data)
    {
        self::$installed = $data;
        self::$installedByVendor = array();
    }

    /**
     * @return array[]
     * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     */
    private static function getInstalled()
    {
        if (null === self::$canGetVendors) {
            self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
        }

        $installed = array();

        if (self::$canGetVendors) {
            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
                if (isset(self::$installedByVendor[$vendorDir])) {
                    $installed[] = self::$installedByVendor[$vendorDir];
                } elseif (is_file($vendorDir.'/composer/installed.php')) {
                    $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
                    if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
                        self::$installed = $installed[count($installed) - 1];
                    }
                }
            }
        }

        if (null === self::$installed) {
            // only require the installed.php file if this file is loaded from its dumped location,
            // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
            if (substr(__DIR__, -8, 1) !== 'C') {
                self::$installed = require __DIR__ . '/installed.php';
            } else {
                self::$installed = array();
            }
        }
        $installed[] = self::$installed;

        return $installed;
    }
}
PK     M\D      !  vendor/composer/autoload_psr4.phpnu [        <?php

// autoload_psr4.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
);
PK     M\s|
  
  %  vendor/composer/autoload_classmap.phpnu [        <?php

// autoload_classmap.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
    'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
    'MC4WP\\Licensing\\Admin' => $baseDir . '/licensing/class-admin.php',
    'MC4WP\\Licensing\\ApiException' => $baseDir . '/licensing/class-api-exception.php',
    'MC4WP\\Licensing\\Client' => $baseDir . '/licensing/class-api-client.php',
    'MC4WP\\PostCampaign\\Gutenberg_Editor' => $baseDir . '/post-campaign/includes/class-gutenberg-editor.php',
    'MC4WP\\PostCampaign\\Post_Mailchimp_Campaign' => $baseDir . '/post-campaign/includes/class-post-mailchimp-campaign.php',
    'MC4WP_AJAX_Forms' => $baseDir . '/ajax-forms/includes/class-ajax-forms.php',
    'MC4WP_AJAX_Forms_Admin' => $baseDir . '/ajax-forms/includes/class-admin.php',
    'MC4WP_Custom_Color_Theme' => $baseDir . '/custom-color-theme/includes/class-theme.php',
    'MC4WP_Custom_Color_Theme_Admin' => $baseDir . '/custom-color-theme/includes/class-admin.php',
    'MC4WP_Dashboard_Log_Widget' => $baseDir . '/logging/includes/class-dashboard-log-widget.php',
    'MC4WP_Email_Notification' => $baseDir . '/email-notifications/includes/class-email-notification.php',
    'MC4WP_Form_Notification_Factory' => $baseDir . '/email-notifications/includes/class-factory.php',
    'MC4WP_Form_Notifications_Admin' => $baseDir . '/email-notifications/includes/class-admin.php',
    'MC4WP_Form_Widget_Enhancements' => $baseDir . '/multiple-forms/includes/class-widget-enhancements.php',
    'MC4WP_Forms_Table' => $baseDir . '/multiple-forms/includes/class-forms-table.php',
    'MC4WP_Graph' => $baseDir . '/logging/includes/class-graph.php',
    'MC4WP_Log_Exporter' => $baseDir . '/logging/includes/class-log-exporter.php',
    'MC4WP_Log_Item' => $baseDir . '/logging/includes/class-log-item.php',
    'MC4WP_Log_Table' => $baseDir . '/logging/includes/class-log-table.php',
    'MC4WP_Logger' => $baseDir . '/logging/includes/class-logger.php',
    'MC4WP_Logging_Admin' => $baseDir . '/logging/includes/class-admin.php',
    'MC4WP_Logging_Installer' => $baseDir . '/logging/includes/class-installer.php',
    'MC4WP_Multiple_Forms_Admin' => $baseDir . '/multiple-forms/includes/class-admin.php',
    'MC4WP_RGB_Color' => $baseDir . '/custom-color-theme/includes/class-rgb-color.php',
    'MC4WP_Required_Plugins_Notice' => $baseDir . '/includes/class-required-plugins-notice.php',
    'MC4WP_Styles_Builder' => $baseDir . '/styles-builder/includes/class-styles-builder.php',
    'MC4WP_Styles_Builder_Admin' => $baseDir . '/styles-builder/includes/class-admin.php',
    'MC4WP_Styles_Builder_Public' => $baseDir . '/styles-builder/includes/class-public.php',
);
PK     M\GO    ,  append-form-to-post/includes/class-admin.phpnu [        <?php

namespace MC4WP\Premium\AFTP;

use Exception;

class Admin
{
    public function hook()
    {
        add_action('mc4wp_admin_form_after_behaviour_settings_rows', array( $this, 'show_setting' ), 10, 2);
        add_action('mc4wp_save_form', array( $this, 'on_form_save' ));
    }

    public function on_form_save($form_id)
    {
        try {
            $form = mc4wp_get_form($form_id);
        } catch (\Exception $e) {
            return;
        }

        $options = mc4wp_get_options();
        if (! isset($options['append_to_posts'])) {
            $options['append_to_posts'] = array();
        }
        
        // set global option
        if ($form->settings['append_to_posts']) {
            $options['append_to_posts'][$form_id] = $form->settings['append_to_posts_category'];
        } else {
            unset($options['append_to_posts'][$form_id]);
        }

        update_option('mc4wp', $options);
    }

    /**
     * @param            $opts
     * @param MC4WP_Form $form
     */
    public function show_setting($opts, $form)
    {
        ?>
		<tr valign="top">
			<th scope="row"><?php _e('Append to all posts?', 'mailchimp-for-wp'); ?></th>
			<td>
				<label>
					<input type="radio" name="mc4wp_form[settings][append_to_posts]" value="1" <?php checked(! empty($opts['append_to_posts']), true); ?> />&rlm;
					<?php _e('Yes, append this form to all posts in', 'mailchimp-for-wp');
        echo ' '; ?>
					<?php wp_dropdown_categories(array(
                        'hide_empty' => false,
                        'show_option_all' => __('All categories', 'mailchimp-for-wp'),
                        'name' => 'mc4wp_form[settings][append_to_posts_category]',
                        'selected' => $opts['append_to_posts_category'],
                    )); ?>
				</label> <br />
				<label">
					<input type="radio" name="mc4wp_form[settings][append_to_posts]" value="0" <?php checked($opts['append_to_posts'], 0); ?> />&rlm;
					<?php _e('No'); ?>
				</label> &nbsp;
				<p class="description"><?php _e('Select "yes" if you want to automatically append this form to all posts (in a certain category).', 'mailchimp-for-wp'); ?></p>
			</td>
		</tr>
		<?php
    }
}
PK     M\F%    -  append-form-to-post/includes/class-plugin.phpnu [        <?php

namespace MC4WP\Premium\AFTP;

use Exception;

class Plugin
{
    public function hook()
    {
        add_filter('mc4wp_settings', array( $this, 'global_settings' ));
        add_filter('mc4wp_form_settings', array( $this, 'form_settings' ));
        add_filter('the_content', array( $this, 'maybe_append_form' ));
    }

    /**
     * @param array $settings
     *
     * @return array
     */
    public function global_settings($settings)
    {
        $defaults = array(
            'append_to_posts' => array(),
        );
        $settings = array_merge($defaults, $settings);
        return $settings;
    }

    /**
     * @param array $settings
     *
     * @return array
     */
    public function form_settings($settings)
    {
        $defaults = array(
            'append_to_posts' => 0,
            'append_to_posts_category' => '',
        );
        $settings = array_merge($defaults, $settings);
        return $settings;
    }

    /**
    * @var string $content
    */
    public function maybe_append_form($content)
    {
    	static $settings = null;

	    if (! is_singular('post')) {
		    return $content;
	    }

	    if ($settings === null) {
		    $settings = mc4wp_get_options();
	    }

	    if (empty($settings['append_to_posts'])) {
            return $content;
        }

        foreach ($settings['append_to_posts'] as $form_id => $category) {
            // "0" corresponds to the "all categories" option
            if ($category === '0' || has_category($category)) {

                // get form to make sure it still exists
                try {
                    $form = mc4wp_get_form($form_id);
                } catch (Exception $e) {
                    continue; // form was deleted
                }

                // add form shortcode to this post
                $content .= "\n" . sprintf(' [mc4wp_form id="%d"]', $form_id);

                // stop looking for other forms if we have a match
                break;
            }
        }

        return $content;
    }
}
PK     M\?2"  "  +  append-form-to-post/append-form-to-post.phpnu [        <?php

namespace MC4WP\Premium\AFTP;

require __DIR__ . '/includes/class-plugin.php';
$plugin = new Plugin();
$plugin->hook();

if (is_admin() && (! defined('DOING_AJAX') || ! DOING_AJAX)) {
    require __DIR__ . '/includes/class-admin.php';
    $admin = new Admin();
    $admin->hook();
}
PK     M\v-`      lucy/lucy.phpnu [        <?php

defined('ABSPATH') or exit;

/**
 * Enqueue Lucy (in plugin KB search)
 *
 * @param string $suffix
 */
function mc4wp_lucy_enqueue($suffix = '')
{
    $assets_url = plugins_url('/assets', __FILE__);

    // build array of helpful data to include in support emails
    // TODO: Add license key?
    $data = array(
        'My website: ' . home_url(),
        'PHP v' . PHP_VERSION,
        'WordPress v' . $GLOBALS['wp_version'],
        'Mailchimp for WordPress v' . MC4WP_VERSION,
        'Premium Bundle v' .MC4WP_PREMIUM_VERSION
    );

    $data = array_map('urlencode', $data);
    $data_string = implode('%0A', $data) . '%0A%0A';

    // script
    wp_enqueue_script('mc4wp-lucy', $assets_url . '/js/script.js', array( 'mc4wp-admin' ), MC4WP_PREMIUM_VERSION, true);
    wp_localize_script(
        'mc4wp-lucy',
        'lucy_config',
        array(
            'email_link' => sprintf('mailto:%s?body=%s', 'support@mc4wp.com', $data_string)
        )
    );

    // styles
    wp_enqueue_style('mc4wp-lucy', $assets_url . '/css/styles.css', array(), MC4WP_PREMIUM_VERSION);
}

add_action('mc4wp_admin_enqueue_assets', 'mc4wp_lucy_enqueue');
PK     M\*,L      lucy/assets/js/script.jsnu [        !function r(o,i,a){function s(t,e){if(!i[t]){if(!o[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(l)return l(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}n=i[t]={exports:{}},o[t][0].call(n.exports,function(e){return s(o[t][1][e]||e)},n,n.exports,r,o,i,a)}return i[t].exports}for(var l="function"==typeof require&&require,e=0;e<a.length;e++)s(a[e]);return s}({1:[function(e,t,n){"use strict";var e=e("./third-party/lucy.js"),r={algoliaAppId:"CGLHJ0181U",algoliaAppKey:"8fa2f724a6314f9a0b840c85b05b943e",algoliaIndexName:"mc4wp_kb",links:[{text:'<span class="dashicons dashicons-book"></span> Knowledge Base',href:"https://www.mc4wp.com/kb/"},{text:'<span class="dashicons dashicons-editor-code"></span> Code Snippets',href:"https://github.com/ibericode/mc4wp-snippets"},{text:'<span class="dashicons dashicons-editor-break"></span> Changelog (free plugin)',href:"https://wordpress.org/plugins/mailchimp-for-wp/#developers"},{text:'<span class="dashicons dashicons-editor-break"></span> Changelog (Premium plugin)',href:"https://my.mc4wp.com/plugins/1/changelog"}],contactLink:"mailto:support@mc4wp.com"};window.lucy_config&&(r.contactLink=window.lucy_config.email_link),new e(r.algoliaAppId,r.algoliaAppKey,r.algoliaIndexName,r.links,r.contactLink)},{"./third-party/lucy.js":2}],2:[function(e,t,n){"use strict";var i=e("mithril"),a=e("algoliasearch/lite");function r(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function o(e,t,n){e.removeEventListener?e.removeEventListener(t,n):e.detachEvent("on"+t,n)}function s(e){var t;"keyup"===e.type&&27===e.keyCode?this.close():(t=e.target||e.srcElement,"click"===e.type&&this.element.contains&&!this.element.contains(t)&&this.close())}function l(e,t,n,r,o){this.algolia=a(e,t).initIndex(n),this.opened=!1,this.loader=null,this.searchResults=null,this.searchQuery="",this.element=document.createElement("div"),this.element.setAttribute("class","lucy closed"),this.hrefLinks=r,this.hrefContactLink=o,document.body.appendChild(this.element),i.mount(this.element,{view:this.getDOM.bind(this)})}l.prototype.getDOM=function(){var e="";return 0<this.searchQuery.length&&(e=null===this.searchResults?i("em.search-pending",'Hit [ENTER] to search for "'+this.searchQuery+'"..'):0<this.searchResults.length?this.searchResults.map(function(e){return i("a",{href:e.href},i.trust(e.text))}):i("em.search-pending",'Nothing found for "'+this.searchQuery+'"..')),[i("div",{style:{display:this.opened?"block":"none"}},[i("span.lucy-close-icon",{onclick:this.close.bind(this)},""),i("div.lucy-header",[i("h4","Looking for help?"),i("div.lucy-search-form",{onsubmit:this.search.bind(this)},[i("input",{type:"text",value:this.searchQuery,onkeyup:function(e){var t=(e.target||e.srcElement).value;""===t&&""!==this.searchQuery?this.reset():(this.searchQuery=t,13===e.keyCode&&this.search(t))}.bind(this),onupdate:function(e){this.opened&&e.dom.focus()}.bind(this),placeholder:"What are you looking for?"}),i("span.loader",{oncreate:function(e){this.loader=e.dom}.bind(this)}),i("input",{type:"submit"})])]),i("div.lucy-content",[i("div.lucy-links",{style:{display:0<this.searchQuery.length?"none":"block"}},this.hrefLinks.map(function(e){return i("a",{href:e.href},i.trust(e.text))})),i("div.lucy-search-results",e)]),i("div.lucy-footer",[i("span","Can't find the answer you're looking for?"),i("a",{class:"button button-primary",href:this.hrefContactLink,target:"_blank"},"Contact Support")])]),i("span.lucy-button",{onclick:this.open.bind(this),style:{display:this.opened?"none":"block"}},[i("span.lucy-button-text","Need help?")])]},l.prototype.open=function(){this.opened||(this.opened=!0,this.element.setAttribute("class","lucy open"),i.redraw(),r(document,"keyup",s.bind(this)),r(document,"click",s.bind(this)))},l.prototype.close=function(){this.opened&&(this.opened=!1,this.reset(),this.element.setAttribute("class","lucy closed"),o(document,"keyup",s.bind(this)),o(document,"click",s.bind(this)))},l.prototype.reset=function(){this.searchQuery="",this.searchResults=null,i.redraw()},l.prototype.search=function(e){var t=this,n=this.loader,r=(n.innerText=".",window.setInterval(function(){n.innerText+=".",3<n.innerText.length&&(n.innerText=".")},333));this.algolia.search(e,{hitsPerPage:5}).then(function(e){t.searchResults=[],n.innerText="",window.clearInterval(r),t.searchResults=e.hits.map(function(e){return{href:e.url,text:e._highlightResult.title.value}}),i.redraw()}).catch(function(e){console.log(e)})},t.exports=l},{"algoliasearch/lite":3,mithril:7}],3:[function(e,t,n){var r,o;r=this,o=function(){"use strict";function t(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function y(r){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?t(Object(o),!0).forEach(function(e){var t,n;t=r,n=o[e=e],e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))})}return r}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function g(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function u(e){var i=0<arguments.length&&void 0!==e?e:{serializable:!0},a={};return{get:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},e=JSON.stringify(e);if(e in a)return Promise.resolve(i.serializable?JSON.parse(a[e]):a[e]);var r=t(),o=n&&n.miss||function(){return Promise.resolve()};return r.then(function(e){return o(e)}).then(function(){return r})},set:function(e,t){return a[JSON.stringify(e)]=i.serializable?JSON.stringify(t):t,Promise.resolve(t)},delete:function(e){return delete a[JSON.stringify(e)],Promise.resolve()},clear:function(){return a={},Promise.resolve()}}}function w(t,n){return n&&Object.keys(n).forEach(function(e){t[e]=n[e](t)}),t}function o(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=0;return e.replace(/%s/g,function(){return encodeURIComponent(n[o++])})}var b={WithinQueryParameters:0,WithinHeaders:1};function x(e,t){var n=e||{},r=n.data||{};return Object.keys(n).forEach(function(e){-1===["timeout","headers","queryParameters","data","cacheable"].indexOf(e)&&(r[e]=n[e])}),{data:0<Object.entries(r).length?r:void 0,timeout:n.timeout||t,headers:n.headers||{},queryParameters:n.queryParameters||{},cacheable:n.cacheable}}var k={Read:1,Write:2,Any:3},O=2,T=3;function P(e,t){t=1<arguments.length&&void 0!==t?t:1;return y(y({},e),{},{status:t,lastUpdate:Date.now()})}function S(e){return"string"==typeof e?{protocol:"https",url:e,accept:k.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||k.Any}}var a="GET",i="POST";function j(s,e,l,u){function c(n,r){var o=n.pop();if(void 0===o)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:C(f)};function i(e){return e={request:t,response:e,host:o,triesLeft:n.length},f.push(e),e}var t={data:d,headers:h,method:p,url:function(e,t,n){n=E(n),e="".concat(e.protocol,"://").concat(e.url,"/").concat("/"===t.charAt(0)?t.substr(1):t);return n.length&&(e+="?".concat(n)),e}(o,l.path,m),connectTimeout:r(v,s.timeouts.connect),responseTimeout:r(v,u.timeout)},a={onSuccess:function(t){try{return JSON.parse(t.content)}catch(e){throw{name:"DeserializationError",message:e.message,response:t}}},onRetry:function(e){var t=i(e);return e.isTimedOut&&v++,Promise.all([s.logger.info("Retryable failure",q(t)),s.hostsCache.set(o,P(o,e.isTimedOut?T:O))]).then(function(){return c(n,r)})},onFail:function(e){throw i(e),function(e,t){var n=e.content,r=e.status,o=n;try{o=JSON.parse(n).message}catch(e){}return{name:"ApiError",message:o,status:r,transporterStackTrace:t}}(e,C(f))}};return s.requester.send(t).then(function(e){return t=a,o=(n=e=e).status,n.isTimedOut||(r=n.isTimedOut,n=n.status,!r&&0==~~n)||2!=~~(o/100)&&4!=~~(o/100)?t.onRetry(e):2==~~(e.status/100)?t.onSuccess(e):t.onFail(e);var t,n,r,o})}var n,r,t,o,f=[],d=function(e,t){if(e.method!==a&&(void 0!==e.data||void 0!==t.data))return e=Array.isArray(e.data)?e.data:y(y({},e.data),t.data),JSON.stringify(e)}(l,u),h=(i=u,n=y(y({},s.headers),i.headers),r={},Object.keys(n).forEach(function(e){var t=n[e];r[e.toLowerCase()]=t}),r),p=l.method,i=l.method!==a?{}:y(y({},l.data),u.data),m=y(y(y({"x-algolia-agent":s.userAgent.value},s.queryParameters),i),u.queryParameters),v=0;return t=s.hostsCache,o=e,Promise.all(o.map(function(e){return t.get(e,function(){return Promise.resolve(P(e))})})).then(function(e){var t=e.filter(function(e){return 1===(e=e).status||12e4<Date.now()-e.lastUpdate}),n=e.filter(function(e){return(e=e).status===T&&Date.now()-e.lastUpdate<=12e4}),e=[].concat(g(t),g(n));return{getTimeout:function(e,t){return(0===n.length&&0===e?1:n.length+3+e)*t},statelessHosts:0<e.length?e.map(S):o}}).then(function(e){return c(g(e.statelessHosts).reverse(),e.getTimeout)})}function E(n){return Object.keys(n).map(function(e){return o("%s=%s",e,(t=n[e],"[object Object]"===Object.prototype.toString.call(t)||"[object Array]"===Object.prototype.toString.call(t)?JSON.stringify(n[e]):n[e]));var t}).join("&")}function C(e){return e.map(q)}function q(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return y(y({},e),{},{request:y(y({},e.request),{},{headers:y(y({},e.request.headers),t)})})}function c(e){var t,n,r,o,i,a,s,l,u,c,f,d,h=e.appId,p=(f=void 0!==e.authMode?e.authMode:b.WithinHeaders,d={"x-algolia-api-key":e.apiKey,"x-algolia-application-id":h},{headers:function(){return f===b.WithinHeaders?d:{}},queryParameters:function(){return f===b.WithinQueryParameters?d:{}}}),m=(p=y(y({hosts:[{url:"".concat(h,"-dsn.algolia.net"),accept:k.Read},{url:"".concat(h,".algolia.net"),accept:k.Write}].concat(function(e){for(var t=e.length-1;0<t;t--){var n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e}([{url:"".concat(h,"-1.algolianet.com")},{url:"".concat(h,"-2.algolianet.com")},{url:"".concat(h,"-3.algolianet.com")}]))},e),{},{headers:y(y(y({},p.headers()),{"content-type":"application/x-www-form-urlencoded"}),e.headers),queryParameters:y(y({},p.queryParameters()),e.queryParameters)}),t=p.hostsCache,n=p.logger,r=p.requester,o=p.requestsCache,i=p.responsesCache,a=p.timeouts,s=p.userAgent,l=p.hosts,u=p.queryParameters,c={hostsCache:t,logger:n,requester:r,requestsCache:o,responsesCache:i,timeouts:a,userAgent:s,headers:p.headers,queryParameters:u,hosts:l.map(S),read:function(e,t){function n(){return j(c,c.hosts.filter(function(e){return 0!=(e.accept&k.Read)}),e,r)}var r=x(t,c.timeouts.read);if(!0!==(void 0!==r.cacheable?r:e).cacheable)return n();var o={request:e,mappedRequestOptions:r,transporter:{queryParameters:c.queryParameters,headers:c.headers}};return c.responsesCache.get(o,function(){return c.requestsCache.get(o,function(){return c.requestsCache.set(o,n()).then(function(e){return Promise.all([c.requestsCache.delete(o),e])},function(e){return Promise.all([c.requestsCache.delete(o),Promise.reject(e)])}).then(function(e){e=v(e,2);return e[0],e[1]})})},{miss:function(e){return c.responsesCache.set(o,e)}})},write:function(e,t){return j(c,c.hosts.filter(function(e){return 0!=(e.accept&k.Write)}),e,x(t,c.timeouts.write))}});return w({transporter:m,appId:h,addAlgoliaAgent:function(e,t){m.userAgent.add({segment:e,version:t})},clearCache:function(){return Promise.all([m.requestsCache.clear(),m.responsesCache.clear()]).then(function(){})}},e.methods)}function f(n){return function(e,t){return e.method===a?n.transporter.read(e,t):n.transporter.write(e,t)}}function d(n){return function(e,t){e=e.map(function(e){return y(y({},e),{},{params:E(e.params||{})})});return n.transporter.read({method:i,path:"1/indexes/*/queries",data:{requests:e},cacheable:!0},t)}}function h(i){return function(e,o){return Promise.all(e.map(function(e){var t=e.params,n=t.facetName,r=t.facetQuery,t=function(e,t){if(null==e)return{};var n,r=function(e,t){if(null==e)return{};for(var n,r={},o=Object.keys(e),i=0;i<o.length;i++)n=o[i],0<=t.indexOf(n)||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols)for(var o=Object.getOwnPropertySymbols(e),i=0;i<o.length;i++)n=o[i],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n]);return r}(t,["facetName","facetQuery"]);return A(i)(e.indexName,{methods:{searchForFacetValues:N}}).searchForFacetValues(n,r,y(y({},o),t))}))}}function p(r){return function(e,t,n){return r.transporter.read({method:i,path:o("1/answers/%s/prediction",r.indexName),data:{query:e,queryLanguages:t},cacheable:!0},n)}}function m(n){return function(e,t){return n.transporter.read({method:i,path:o("1/indexes/%s/query",n.indexName),data:{query:e},cacheable:!0},t)}}var A=function(t){return function(e){return w({transporter:t.transporter,appId:t.appId,indexName:e},(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}).methods)}},N=function(r){return function(e,t,n){return r.transporter.read({method:i,path:o("1/indexes/%s/facets/%s/query",r.indexName,e),data:{facetQuery:t},cacheable:!0},n)}};function e(e,t,n){var r,o,i,a,t={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:function(i){return new Promise(function(n){var r=new XMLHttpRequest;r.open(i.method,i.url,!0),Object.keys(i.headers).forEach(function(e){return r.setRequestHeader(e,i.headers[e])});function e(e,t){return setTimeout(function(){r.abort(),n({status:0,content:t,isTimedOut:!0})},1e3*e)}var t,o=e(i.connectTimeout,"Connection timeout");r.onreadystatechange=function(){r.readyState>r.OPENED&&void 0===t&&(clearTimeout(o),t=e(i.responseTimeout,"Socket timeout"))},r.onerror=function(){0===r.status&&(clearTimeout(o),clearTimeout(t),n({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=function(){clearTimeout(o),clearTimeout(t),n({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(i.data)})}},logger:{debug:function(e,t){return Promise.resolve()},info:function(e,t){return Promise.resolve()},error:function(e,t){return console.error(e,t),Promise.resolve()}},responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:function r(e){var o=g(e.caches),i=o.shift();return void 0===i?{get:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then(function(e){return Promise.all([e,n.miss(e)])}).then(function(e){return v(e,1)[0]})},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return i.get(e,t,n).catch(function(){return r({caches:o}).get(e,t,n)})},set:function(e,t){return i.set(e,t).catch(function(){return r({caches:o}).set(e,t)})},delete:function(e){return i.delete(e).catch(function(){return r({caches:o}).delete(e)})},clear:function(){return i.clear().catch(function(){return r({caches:o}).clear()})}}}({caches:[(o={key:"".concat("4.13.0","-").concat(e)},a="algoliasearch-client-js-".concat(o.key),{get:function(t,n){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){var e=JSON.stringify(t),e=l()[e];return Promise.all([e||n(),void 0!==e])}).then(function(e){var e=v(e,2),t=e[0],e=e[1];return Promise.all([t,e||r.miss(t)])}).then(function(e){return v(e,1)[0]})},set:function(t,n){return Promise.resolve().then(function(){var e=l();return e[JSON.stringify(t)]=n,s().setItem(a,JSON.stringify(e)),n})},delete:function(t){return Promise.resolve().then(function(){var e=l();delete e[JSON.stringify(t)],s().setItem(a,JSON.stringify(e))})},clear:function(){return Promise.resolve().then(function(){s().removeItem(a)})}}),u()]}),userAgent:(r={value:"Algolia for JavaScript (".concat("4.13.0",")"),add:function(e){e="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===r.value.indexOf(e)&&(r.value="".concat(r.value).concat(e)),r}}).add({segment:"Browser",version:"lite"}),authMode:b.WithinQueryParameters};function s(){return i=void 0===i?o.localStorage||window.localStorage:i}function l(){return JSON.parse(s().getItem(a)||"{}")}return c(y(y(y({},t),n),{},{methods:{search:d,searchForFacetValues:h,multipleQueries:d,multipleSearchForFacetValues:h,customRequest:f,initIndex:function(t){return function(e){return A(t)(e,{methods:{search:m,searchForFacetValues:N,findAnswers:p}})}}}}))}return e.version="4.13.0",e},"object"==typeof n&&void 0!==t?t.exports=o():"function"==typeof define&&define.amd?define(o):(r=r||self).algoliasearch=o()},{}],4:[function(e,t,n){"use strict";var l=e("../render/vnode");t.exports=function(r,e,t){var o=[],n=!1,i=!1;function a(){if(n)throw new Error("Nested m.redraw.sync() call");n=!0;for(var e=0;e<o.length;e+=2)try{r(o[e],l(o[e+1]),s)}catch(e){t.error(e)}n=!1}function s(){i||(i=!0,e(function(){i=!1,a()}))}return s.sync=a,{mount:function(e,t){if(null!=t&&null==t.view&&"function"!=typeof t)throw new TypeError("m.mount(element, component) expects a component, not a vnode");var n=o.indexOf(e);0<=n&&(o.splice(n,2),r(e,[],s)),null!=t&&(o.push(e,t),r(e,l(t),s))},redraw:s}}},{"../render/vnode":23}],5:[function(e,t,n){!function(E){!function(){"use strict";var k=e("../render/vnode"),i=e("../render/hyperscript"),O=e("../promise/promise"),o=e("../pathname/build"),T=e("../pathname/parse"),P=e("../pathname/compileTemplate"),S=e("../pathname/assign"),j={};t.exports=function(d,h){var l;function p(e,t,n){var r;e=o(e,t),null!=l?(l(),t=n?n.state:null,r=n?n.title:null,n&&n.replace?d.history.replaceState(t,r,x.prefix+e):d.history.pushState(t,r,x.prefix+e)):d.location.href=x.prefix+e}var m,v,y,g,w=j,b=x.SKIP={};function x(e,t,n){if(null==e)throw new Error("Ensure the DOM element that was passed to `m.route` is not undefined");var r,u=0,c=Object.keys(n).map(function(e){if("/"!==e[0])throw new SyntaxError("Routes must start with a `/`");if(/:([^\/\.-]+)(\.{3})?:/.test(e))throw new SyntaxError("Route parameter names must be separated with either `/`, `.`, or `-`");return{route:e,component:n[e],check:P(e)}}),o="function"==typeof E?E:setTimeout,f=O.resolve(),i=!1;if((l=null)!=t){var a=T(t);if(!c.some(function(e){return e.check(a)}))throw new ReferenceError("Default route doesn't match any known routes")}function s(){i=!1;var e=d.location.hash,a=("#"!==x.prefix[0]&&(e=d.location.search+e,"?"!==x.prefix[0]&&"/"!==(e=d.location.pathname+e)[0]&&(e="/"+e)),e.concat().replace(/(?:%[a-f89][a-f0-9])+/gim,decodeURIComponent).slice(x.prefix.length)),s=T(a);function l(){if(a===t)throw new Error("Could not resolve default route "+t);p(t,null,{replace:!0})}S(s.params,d.history.state),function t(n){for(;n<c.length;n++){var r,e,o,i;if(c[n].check(s))return r=c[n].component,e=c[n].route,i=g=function(e){if(i===g){if(e===b)return t(n+1);m=null==e||"function"!=typeof e.view&&"function"!=typeof e?"div":e,v=s.params,y=a,g=null,w=r.render?r:null,2===u?h.redraw():(u=2,h.redraw.sync())}},void((o=r).view||"function"==typeof r?(r={},i(o)):r.onmatch?f.then(function(){return r.onmatch(s.params,a,e)}).then(i,l):i("div"))}l()}(0)}return l=function(){i||(i=!0,o(s))},"function"==typeof d.history.pushState?d.addEventListener("popstate",l,!(r=function(){d.removeEventListener("popstate",l,!1)})):"#"===x.prefix[0]&&(l=null,d.addEventListener("hashchange",s,!(r=function(){d.removeEventListener("hashchange",s,!1)}))),h.mount(e,{onbeforeupdate:function(){return!(!(u=u?2:1)||j===w)},oncreate:s,onremove:r,view:function(){var e;if(u&&j!==w)return e=[k(m,v.key,v)],w?w.render(e[0]):e}})}return x.set=function(e,t,n){null!=g&&((n=n||{}).replace=!0),g=null,p(e,t,n)},x.get=function(){return y},x.prefix="#!",x.Link={view:function(e){var n,r,o=e.attrs.options,t={},t=(S(t,e.attrs),t.selector=t.options=t.key=t.oninit=t.oncreate=t.onbeforeupdate=t.onupdate=t.onbeforeremove=t.onremove=null,i(e.attrs.selector||"a",t,e.children));return(t.attrs.disabled=Boolean(t.attrs.disabled))?(t.attrs.href=null,t.attrs["aria-disabled"]="true",t.attrs.onclick=null):(n=t.attrs.onclick,r=t.attrs.href,t.attrs.href=x.prefix+r,t.attrs.onclick=function(e){var t;"function"==typeof n?t=n.call(e.currentTarget,e):null!=n&&"object"==typeof n&&"function"==typeof n.handleEvent&&n.handleEvent(e),!1===t||e.defaultPrevented||0!==e.button&&0!==e.which&&1!==e.which||e.currentTarget.target&&"_self"!==e.currentTarget.target||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||(e.preventDefault(),e.redraw=!1,x.set(r,null,o))}),t}},x.param=function(e){return v&&null!=e?v[e]:v},x}}.call(this)}.call(this,e("timers").setImmediate)},{"../pathname/assign":9,"../pathname/build":10,"../pathname/compileTemplate":11,"../pathname/parse":12,"../promise/promise":14,"../render/hyperscript":19,"../render/vnode":23,timers:28}],6:[function(e,t,n){"use strict";var r=e("./render/hyperscript");r.trust=e("./render/trust"),r.fragment=e("./render/fragment"),t.exports=r},{"./render/fragment":18,"./render/hyperscript":19,"./render/trust":22}],7:[function(e,t,n){"use strict";function r(){return o.apply(this,arguments)}var o=e("./hyperscript"),i=e("./request"),a=e("./mount-redraw");r.m=o,r.trust=o.trust,r.fragment=o.fragment,r.mount=a.mount,r.route=e("./route"),r.render=e("./render"),r.redraw=a.redraw,r.request=i.request,r.jsonp=i.jsonp,r.parseQueryString=e("./querystring/parse"),r.buildQueryString=e("./querystring/build"),r.parsePathname=e("./pathname/parse"),r.buildPathname=e("./pathname/build"),r.vnode=e("./render/vnode"),r.PromisePolyfill=e("./promise/polyfill"),t.exports=r},{"./hyperscript":6,"./mount-redraw":8,"./pathname/build":10,"./pathname/parse":12,"./promise/polyfill":13,"./querystring/build":15,"./querystring/parse":16,"./render":17,"./render/vnode":23,"./request":24,"./route":26}],8:[function(e,t,n){"use strict";var r=e("./render");t.exports=e("./api/mount-redraw")(r,requestAnimationFrame,console)},{"./api/mount-redraw":4,"./render":17}],9:[function(e,t,n){"use strict";t.exports=Object.assign||function(t,n){n&&Object.keys(n).forEach(function(e){t[e]=n[e]})}},{}],10:[function(e,t,n){"use strict";var f=e("../querystring/build"),d=e("./assign");t.exports=function(e,r){if(/:([^\/\.-]+)(\.{3})?:/.test(e))throw new SyntaxError("Template parameter names *must* be separated");if(null==r)return e;var t=e.indexOf("?"),n=e.indexOf("#"),o=n<0?e.length:n,i=e.slice(0,t<0?o:t),a={},i=(d(a,r),i.replace(/:([^\/\.-]+)(\.{3})?/g,function(e,t,n){return delete a[t],null==r[t]?e:n?r[t]:encodeURIComponent(String(r[t]))})),s=i.indexOf("?"),l=i.indexOf("#"),u=l<0?i.length:l,c=i.slice(0,s<0?u:s),o=(0<=t&&(c+=e.slice(t,o)),0<=s&&(c+=(t<0?"?":"&")+i.slice(s,u)),f(a));return o&&(c+=(t<0&&s<0?"?":"&")+o),0<=n&&(c+=e.slice(n)),0<=l&&(c+=(n<0?"":"&")+i.slice(l)),c}},{"../querystring/build":15,"./assign":9}],11:[function(e,t,n){"use strict";var s=e("./parse");t.exports=function(e){var r=s(e),o=Object.keys(r.params),i=[],a=new RegExp("^"+r.path.replace(/:([^\/.-]+)(\.{3}|\.(?!\.)|-)?|[\\^$*+.()|\[\]{}]/g,function(e,t,n){return null==t?"\\"+e:(i.push({k:t,r:"..."===n}),"..."===n?"(.*)":"."===n?"([^/]+)\\.":"([^/]+)"+(n||""))})+"$");return function(e){for(var t=0;t<o.length;t++)if(r.params[o[t]]!==e.params[o[t]])return!1;if(!i.length)return a.test(e.path);var n=a.exec(e.path);if(null==n)return!1;for(t=0;t<i.length;t++)e.params[i[t].k]=i[t].r?n[t+1]:decodeURIComponent(n[t+1]);return!0}}},{"./parse":12}],12:[function(e,t,n){"use strict";var o=e("../querystring/parse");t.exports=function(e){var t=e.indexOf("?"),n=e.indexOf("#"),n=n<0?e.length:n,r=e.slice(0,t<0?n:t).replace(/\/{2,}/g,"/");return r?1<(r="/"!==r[0]?"/"+r:r).length&&"/"===r[r.length-1]&&(r=r.slice(0,-1)):r="/",{path:r,params:t<0?{}:o(e.slice(t+1,n))}}},{"../querystring/parse":16}],13:[function(e,t,n){!function(n){!function(){"use strict";function d(e){if(!(this instanceof d))throw new Error("Promise must be called with `new`");if("function"!=typeof e)throw new TypeError("executor must be a function");var i=this,a=[],s=[],o=t(a,!0),l=t(s,!1),u=i._instance={resolvers:a,rejectors:s},c="function"==typeof n?n:setTimeout;function t(r,o){return function t(n){var e;try{if(!o||null==n||"object"!=typeof n&&"function"!=typeof n||"function"!=typeof(e=n.then))c(function(){o||0!==r.length||console.error("Possible unhandled promise rejection:",n);for(var e=0;e<r.length;e++)r[e](n);a.length=0,s.length=0,u.state=o,u.retry=function(){t(n)}});else{if(n===i)throw new TypeError("Promise can't be resolved w/ itself");f(e.bind(n))}}catch(e){l(e)}}}function f(e){var n=0;function t(t){return function(e){0<n++||t(e)}}var r=t(l);try{e(t(o),r)}catch(e){r(e)}}f(e)}d.prototype.then=function(e,t){var o,i,a=this._instance;function n(t,e,n,r){e.push(function(e){if("function"!=typeof t)n(e);else try{o(t(e))}catch(e){i&&i(e)}}),"function"==typeof a.retry&&r===a.state&&a.retry()}var r=new d(function(e,t){o=e,i=t});return n(e,a.resolvers,o,!0),n(t,a.rejectors,i,!1),r},d.prototype.catch=function(e){return this.then(null,e)},d.prototype.finally=function(t){return this.then(function(e){return d.resolve(t()).then(function(){return e})},function(e){return d.resolve(t()).then(function(){return d.reject(e)})})},d.resolve=function(t){return t instanceof d?t:new d(function(e){e(t)})},d.reject=function(n){return new d(function(e,t){t(n)})},d.all=function(s){return new d(function(n,r){var o=s.length,i=0,a=[];if(0===s.length)n([]);else for(var e=0;e<s.length;e++)!function(t){function e(e){i++,a[t]=e,i===o&&n(a)}null==s[t]||"object"!=typeof s[t]&&"function"!=typeof s[t]||"function"!=typeof s[t].then?e(s[t]):s[t].then(e,r)}(e)})},d.race=function(r){return new d(function(e,t){for(var n=0;n<r.length;n++)r[n].then(e,t)})},t.exports=d}.call(this)}.call(this,e("timers").setImmediate)},{timers:28}],14:[function(n,r,e){!function(t){!function(){"use strict";var e=n("./polyfill");"undefined"!=typeof window?(void 0===window.Promise?window.Promise=e:window.Promise.prototype.finally||(window.Promise.prototype.finally=e.prototype.finally),r.exports=window.Promise):void 0!==t?(void 0===t.Promise?t.Promise=e:t.Promise.prototype.finally||(t.Promise.prototype.finally=e.prototype.finally),r.exports=t.Promise):r.exports=e}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./polyfill":13}],15:[function(e,t,n){"use strict";t.exports=function(e){if("[object Object]"!==Object.prototype.toString.call(e))return"";var t,o=[];for(t in e)!function e(t,n){if(Array.isArray(n))for(var r=0;r<n.length;r++)e(t+"["+r+"]",n[r]);else if("[object Object]"===Object.prototype.toString.call(n))for(var r in n)e(t+"["+r+"]",n[r]);else o.push(encodeURIComponent(t)+(null!=n&&""!==n?"="+encodeURIComponent(n):""))}(t,e[t]);return o.join("&")}},{}],16:[function(e,t,n){"use strict";t.exports=function(e){if(""===e||null==e)return{};for(var t=(e="?"===e.charAt(0)?e.slice(1):e).split("&"),n={},r={},o=0;o<t.length;o++){var i=t[o].split("="),a=decodeURIComponent(i[0]),s=2===i.length?decodeURIComponent(i[1]):"",l=("true"===s?s=!0:"false"===s&&(s=!1),a.split(/\]\[?|\[/)),u=r;-1<a.indexOf("[")&&l.pop();for(var c=0;c<l.length;c++){var f,d=l[c],h=l[c+1],h=""==h||!isNaN(parseInt(h,10));if(""===d)null==n[a=l.slice(0,c).join()]&&(n[a]=Array.isArray(u)?u.length:0),d=n[a]++;else if("__proto__"===d)break;c===l.length-1?u[d]=s:(null==(f=null!=(f=Object.getOwnPropertyDescriptor(u,d))?f.value:f)&&(u[d]=f=h?[]:{}),u=f)}}return r}},{}],17:[function(e,t,n){"use strict";t.exports=e("./render/render")(window)},{"./render/render":21}],18:[function(e,t,n){"use strict";var r=e("../render/vnode"),o=e("./hyperscriptVnode");t.exports=function(){var e=o.apply(0,arguments);return e.tag="[",e.children=r.normalizeChildren(e.children),e}},{"../render/vnode":23,"./hyperscriptVnode":20}],19:[function(e,t,n){"use strict";var l=e("../render/vnode"),u=e("./hyperscriptVnode"),c=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,f={},d={}.hasOwnProperty;function h(e){for(var t in e)if(d.call(e,t))return;return 1}t.exports=function(e){if(null==e||"string"!=typeof e&&"function"!=typeof e&&"function"!=typeof e.view)throw Error("The selector must be either a string or a component.");var t=u.apply(1,arguments);if("string"!=typeof e||(t.children=l.normalizeChildren(t.children),"["===e))return t.tag=e,t;var n=f[e]||function(e){for(var t,n="div",r=[],o={};t=c.exec(e);){var i=t[1],a=t[2];""===i&&""!==a?n=a:"#"===i?o.id=a:"."===i?r.push(a):"["===t[3][0]&&(i=(i=t[6])&&i.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\"),"class"===t[4]?r.push(i):o[t[4]]=""===i?i:i||!0)}return 0<r.length&&(o.className=r.join(" ")),f[e]={tag:n,attrs:o}}(e),r=t,o=r.attrs,e=l.normalizeChildren(r.children),i=(t=d.call(o,"class"))?o.class:o.className;if(r.tag=n.tag,r.attrs=null,r.children=void 0,!h(n.attrs)&&!h(o)){var a,s={};for(a in o)d.call(o,a)&&(s[a]=o[a]);o=s}for(a in n.attrs)d.call(n.attrs,a)&&"className"!==a&&!d.call(o,a)&&(o[a]=n.attrs[a]);for(a in null==i&&null==n.attrs.className||(o.className=null!=i?null!=n.attrs.className?String(n.attrs.className)+" "+String(i):i:null!=n.attrs.className?n.attrs.className:null),t&&(o.class=null),o)if(d.call(o,a)&&"key"!==a){r.attrs=o;break}return Array.isArray(e)&&1===e.length&&null!=e[0]&&"#"===e[0].tag?r.text=e[0].children:r.children=e,r}},{"../render/vnode":23,"./hyperscriptVnode":20}],20:[function(e,t,n){"use strict";var r=e("../render/vnode");t.exports=function(){var e,t=arguments[this],n=this+1;if(null==t?t={}:"object"==typeof t&&null==t.tag&&!Array.isArray(t)||(t={},n=this),arguments.length===n+1)e=arguments[n],Array.isArray(e)||(e=[e]);else for(e=[];n<arguments.length;)e.push(arguments[n++]);return r("",t.key,t,e)}},{"../render/vnode":23}],21:[function(e,t,n){"use strict";var Y=e("../render/vnode");t.exports=function(e){var l,P=e&&e.document,t={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"};function _(e){return e.attrs&&e.attrs.xmlns||t[e.tag]}function u(e,t){if(e.state!==t)throw new Error("`vnode.state` must not be modified")}function $(e){var t=e.state;try{return this.apply(t,arguments)}finally{u(e,t)}}function D(){try{return P.activeElement}catch(e){return null}}function j(e,t,n,r,o,i,a){for(var s=n;s<r;s++){var l=t[s];null!=l&&F(e,l,o,a,i)}}function F(e,t,n,r,o){var i,a,s,l,u=t.tag;if("string"==typeof u)switch(t.state={},null!=t.attrs&&N(t.attrs,t,n),u){case"#":c=e,d=o,(f=t).dom=P.createTextNode(f.children),S(c,f.dom,d);break;case"<":J(e,t,r,o);break;case"[":var c=e,f=t,d=n,h=r,p=o,m=P.createDocumentFragment();null!=f.children&&(v=f.children,j(m,v,0,v.length,d,null,h)),f.dom=m.firstChild,f.domSize=m.childNodes.length,S(c,m,p);break;default:var v=e,h=t,m=n,p=r,y=o,g=h.tag,w=h.attrs,b=w&&w.is,b=(p=_(h)||p)?b?P.createElementNS(p,g,{is:b}):P.createElementNS(p,g):b?P.createElement(g,{is:b}):P.createElement(g);if(h.dom=b,null!=w){var x=h;var k=w;var O=p;for(var T in k)K(x,T,null,k[T],O)}if(S(v,b,y),!Q(h)){null!=h.text&&(""!==h.text?b.textContent=h.text:h.children=[Y("#",void 0,void 0,h.text,void 0,void 0)]);if(null!=h.children){g=h.children,j(b,g,0,g.length,m,null,p);if("select"===h.tag&&null!=w){y=h;b=w;"value"in b&&(null===b.value?-1!==y.dom.selectedIndex&&(y.dom.value=null):(g=""+b.value,y.dom.value===g&&-1!==y.dom.selectedIndex||(y.dom.value=g)));"selectedIndex"in b&&K(y,"selectedIndex",null,b.selectedIndex,void 0)}}}}else u=e,s=r,l=o,function(e,t){var n;if("function"==typeof e.tag.view){if(e.state=Object.create(e.tag),null!=(n=e.state.view).$$reentrantLock$$)return;n.$$reentrantLock$$=!0}else{if(e.state=void 0,null!=(n=e.tag).$$reentrantLock$$)return;n.$$reentrantLock$$=!0,e.state=null!=e.tag.prototype&&"function"==typeof e.tag.prototype.view?new e.tag(e):e.tag(e)}N(e.state,e,t),null!=e.attrs&&N(e.attrs,e,t);if(e.instance=Y.normalize($.call(e.state.view,e)),e.instance===e)throw Error("A view cannot return the vnode it received as argument");n.$$reentrantLock$$=null}(i=t,a=n),null!=i.instance?(F(u,i.instance,a,s,l),i.dom=i.instance.dom,i.domSize=null!=i.dom?i.instance.domSize:0):i.domSize=0}var c={caption:"table",thead:"table",tbody:"table",tfoot:"table",tr:"tbody",th:"tr",td:"tr",colgroup:"table",col:"colgroup"};function J(e,t,n,r){for(var o,i=t.children.match(/^\s*?<(\w+)/im)||[],a=P.createElement(c[i[1]]||"div"),s=("http://www.w3.org/2000/svg"===n?(a.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+t.children+"</svg>",a=a.firstChild):a.innerHTML=t.children,t.dom=a.firstChild,t.domSize=a.childNodes.length,t.instance=[],P.createDocumentFragment());o=a.firstChild;)t.instance.push(o),s.appendChild(o);S(e,s,r)}function M(e,t,n,r,o,i){if(t!==n&&(null!=t||null!=n))if(null==t||0===t.length)j(e,n,0,n.length,r,o,i);else if(null==n||0===n.length)A(e,t,0,t.length);else{var a=null!=t[0]&&null!=t[0].key,s=null!=n[0]&&null!=n[0].key,l=0,u=0;if(!a)for(;u<t.length&&null==t[u];)u++;if(!s)for(;l<n.length&&null==n[l];)l++;if(null!==s||null!=a)if(a!=s)A(e,t,u,t.length),j(e,n,l,n.length,r,o,i);else if(s){for(var c,f,d,h,p=t.length-1,m=n.length-1;u<=p&&l<=m&&(d=t[p],T=n[m],d.key===T.key);)d!==T&&U(e,d,T,r,o,i),null!=T.dom&&(o=T.dom),p--,m--;for(;u<=p&&l<=m&&(c=t[u],f=n[l],c.key===f.key);)u++,l++,c!==f&&U(e,c,f,r,C(t,u,o),i);for(;u<=p&&l<=m&&l!==m&&c.key===T.key&&d.key===f.key;)q(e,d,h=C(t,u,o)),d!==f&&U(e,d,f,r,h,i),++l<=--m&&q(e,c,o),c!==T&&U(e,c,T,r,o,i),null!=T.dom&&(o=T.dom),d=t[--p],T=n[m],c=t[++u],f=n[l];for(;u<=p&&l<=m&&d.key===T.key;)d!==T&&U(e,d,T,r,o,i),null!=T.dom&&(o=T.dom),d=t[--p],T=n[--m];if(m<l)A(e,t,u,p+1);else if(p<u)j(e,n,l,m+1,r,o,i);else{for(var v,y,a=o,g=m-l+1,w=new Array(g),b=0,x=0,k=2147483647,O=0,x=0;x<g;x++)w[x]=-1;for(x=m;l<=x;x--){var T,P=(v=null==v?function(e,t,n){for(var r=Object.create(null);t<n;t++){var o=e[t];null==o||null!=(o=o.key)&&(r[o]=t)}return r}(t,u,p+1):v)[(T=n[x]).key];null!=P&&(k=P<k?P:-1,d=t[w[x-l]=P],t[P]=null,d!==T&&U(e,d,T,r,o,i),null!=T.dom&&(o=T.dom),O++)}if(o=a,O!==p-u+1&&A(e,t,u,p+1),0===O)j(e,n,l,m+1,r,o,i);else if(-1===k)for(b=(y=function(e){for(var t=[0],n=0,r=0,o=0,i=E.length=e.length,o=0;o<i;o++)E[o]=e[o];for(o=0;o<i;++o)if(-1!==e[o]){var a=t[t.length-1];if(e[a]<e[o])E[o]=a,t.push(o);else{for(n=0,r=t.length-1;n<r;){var s=(n>>>1)+(r>>>1)+(n&r&1);e[t[s]]<e[o]?n=1+s:r=s}e[o]<e[t[n]]&&(0<n&&(E[o]=t[n-1]),t[n]=o)}}n=t.length,r=t[n-1];for(;0<n--;)t[n]=r,r=E[r];return E.length=0,t}(w)).length-1,x=m;l<=x;x--)f=n[x],-1===w[x-l]?F(e,f,r,i,o):y[b]===x-l?b--:q(e,f,o),null!=f.dom&&(o=n[x].dom);else for(x=m;l<=x;x--)f=n[x],-1===w[x-l]&&F(e,f,r,i,o),null!=f.dom&&(o=n[x].dom)}}else{for(var S=(t.length<n.length?t:n).length,l=l<u?l:u;l<S;l++)(c=t[l])===(f=n[l])||null==c&&null==f||(null==c?F(e,f,r,i,C(t,l+1,o)):null==f?H(e,c):U(e,c,f,r,C(t,l+1,o),i));t.length>S&&A(e,t,l,t.length),n.length>S&&j(e,n,l,n.length,r,o,i)}}}function U(e,t,n,r,o,i){var a=t.tag;if(a===n.tag){if(n.state=t.state,n.events=t.events,!function(e,t){do{var n;if(null!=e.attrs&&"function"==typeof e.attrs.onbeforeupdate)if(void 0!==(n=$.call(e.attrs.onbeforeupdate,e,t))&&!n)break;if("string"!=typeof e.tag&&"function"==typeof e.state.onbeforeupdate)if(void 0!==(n=$.call(e.state.onbeforeupdate,e,t))&&!n)break;return}while(0);return e.dom=t.dom,e.domSize=t.domSize,e.instance=t.instance,e.attrs=t.attrs,e.children=t.children,e.text=t.text,1}(n,t))if("string"==typeof a)switch(null!=n.attrs&&Z(n.attrs,n,r),a){case"#":var s=t,l=n;s.children.toString()!==l.children.toString()&&(s.dom.nodeValue=l.children),l.dom=s.dom;break;case"<":l=e,s=n,c=i,f=o,(d=t).children!==s.children?(V(l,d),J(l,s,c,f)):(s.dom=d.dom,s.domSize=d.domSize,s.instance=d.instance);break;case"[":var u=n,c=r,f=o,d=i,h=(M(e,t.children,u.children,c,f,d),0),p=u.children;if((u.dom=null)!=p){for(var m=0;m<p.length;m++){var v=p[m];null!=v&&null!=v.dom&&(null==u.dom&&(u.dom=v.dom),h+=v.domSize||1)}1!==h&&(u.domSize=h)}break;default:var y,g=t,w=n,b=r,x=i,R=w.dom=g.dom,k=(x=_(w)||x,"textarea"===w.tag&&(null==w.attrs&&(w.attrs={}),null!=w.text&&(w.attrs.value=w.text,w.text=void 0)),w),O=g.attrs,T=w.attrs,P=x;if(null!=T)for(var S in T)K(k,S,O&&O[S],T[S],P);if(null!=O)for(var S in O)if(null!=(y=O[S])&&(null==T||null==T[S])){j=void 0;E=void 0;C=void 0;q=void 0;q=void 0;var j=k;var E=S;var C=y;var q=P;"key"===E||"is"===E||null==C||W(E)||("o"!==E[0]||"n"!==E[1]||W(E)?"style"===E?G(j.dom,C,null):!B(j,E,q)||"className"===E||"value"===E&&("option"===j.tag||"select"===j.tag&&-1===j.dom.selectedIndex&&j.dom===D())||"input"===j.tag&&"type"===E?(-1!==(q=E.indexOf(":"))&&(E=E.slice(q+1)),!1!==C&&j.dom.removeAttribute("className"===E?"class":E)):j.dom[E]=null:X(j,E,void 0))}Q(w)||(null!=g.text&&null!=w.text&&""!==w.text?g.text.toString()!==w.text.toString()&&(g.dom.firstChild.nodeValue=w.text):(null!=g.text&&(g.children=[Y("#",void 0,void 0,g.text,void 0,g.dom.firstChild)]),null!=w.text&&(w.children=[Y("#",void 0,void 0,w.text,void 0,void 0)]),M(R,g.children,w.children,b,null,x)))}else{var a=e,A=t,N=n,I=r,L=o,z=i;if(N.instance=Y.normalize($.call(N.state.view,N)),N.instance===N)throw Error("A view cannot return the vnode it received as argument");Z(N.state,N,I),null!=N.attrs&&Z(N.attrs,N,I),null!=N.instance?(null==A.instance?F(a,N.instance,I,z,L):U(a,A.instance,N.instance,I,L,z),N.dom=N.instance.dom,N.domSize=N.instance.domSize):null!=A.instance?(H(a,A.instance),N.dom=void 0,N.domSize=0):(N.dom=A.dom,N.domSize=A.domSize)}}else H(e,t),F(e,n,r,i,o)}var E=[];function C(e,t,n){for(;t<e.length;t++)if(null!=e[t]&&null!=e[t].dom)return e[t].dom;return n}function q(e,t,n){var r=P.createDocumentFragment();!function e(t,n,r){for(;null!=r.dom&&r.dom.parentNode===t;){if("string"!=typeof r.tag){if(null!=(r=r.instance))continue}else if("<"===r.tag)for(var o=0;o<r.instance.length;o++)n.appendChild(r.instance[o]);else if("["!==r.tag)n.appendChild(r.dom);else if(1===r.children.length){if(null!=(r=r.children[0]))continue}else for(o=0;o<r.children.length;o++){var i=r.children[o];null!=i&&e(t,n,i)}break}}(e,r,t),S(e,r,n)}function S(e,t,n){null!=n?e.insertBefore(t,n):e.appendChild(t)}function Q(e){if(null!=e.attrs&&(null!=e.attrs.contenteditable||null!=e.attrs.contentEditable)){var t=e.children;if(null!=t&&1===t.length&&"<"===t[0].tag){var n=t[0].children;e.dom.innerHTML!==n&&(e.dom.innerHTML=n)}else if(null!=e.text||null!=t&&0!==t.length)throw new Error("Child node of a contenteditable must be trusted");return 1}}function A(e,t,n,r){for(var o=n;o<r;o++){var i=t[o];null!=i&&H(e,i)}}function H(e,t){var n,r,o,i,a=0,s=t.state;function l(){u(t,s),d(t),f(e,t)}"string"!=typeof t.tag&&"function"==typeof t.state.onbeforeremove&&null!=(o=$.call(t.state.onbeforeremove,t))&&"function"==typeof o.then&&(a=1,n=o),t.attrs&&"function"==typeof t.attrs.onbeforeremove&&null!=(o=$.call(t.attrs.onbeforeremove,t))&&"function"==typeof o.then&&(a|=2,r=o),u(t,s),a?(null!=n&&n.then(i=function(){1&a&&((a&=2)||l())},i),null!=r&&r.then(i=function(){2&a&&((a&=1)||l())},i)):(d(t),f(e,t))}function V(e,t){for(var n=0;n<t.instance.length;n++)e.removeChild(t.instance[n])}function f(e,t){for(;null!=t.dom&&t.dom.parentNode===e;){if("string"!=typeof t.tag){if(null!=(t=t.instance))continue}else if("<"===t.tag)V(e,t);else{if("["!==t.tag&&(e.removeChild(t.dom),!Array.isArray(t.children)))break;if(1===t.children.length){if(null!=(t=t.children[0]))continue}else for(var n=0;n<t.children.length;n++){var r=t.children[n];null!=r&&f(e,r)}}break}}function d(e){if("string"!=typeof e.tag&&"function"==typeof e.state.onremove&&$.call(e.state.onremove,e),e.attrs&&"function"==typeof e.attrs.onremove&&$.call(e.attrs.onremove,e),"string"!=typeof e.tag)null!=e.instance&&d(e.instance);else{var t=e.children;if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];null!=r&&d(r)}}}function K(e,t,n,r,o){if("key"!==t&&"is"!==t&&null!=r&&!W(t)&&(n!==r||(i=e,"value"===(a=t)||"checked"===a||"selectedIndex"===a||"selected"===a&&i.dom===D()||"option"===i.tag&&i.dom.parentNode===P.activeElement)||"object"==typeof r)){var i,a;if("o"===t[0]&&"n"===t[1])return X(e,t,r);if("xlink:"===t.slice(0,6))e.dom.setAttributeNS("http://www.w3.org/1999/xlink",t.slice(6),r);else if("style"===t)G(e.dom,n,r);else if(B(e,t,o)){if("value"===t){if(("input"===e.tag||"textarea"===e.tag)&&e.dom.value===""+r&&e.dom===D())return;if("select"===e.tag&&null!==n&&e.dom.value===""+r)return;if("option"===e.tag&&null!==n&&e.dom.value===""+r)return}"input"===e.tag&&"type"===t?e.dom.setAttribute(t,r):e.dom[t]=r}else"boolean"==typeof r?r?e.dom.setAttribute(t,""):e.dom.removeAttribute(t):e.dom.setAttribute("className"===t?"class":t,r)}}function W(e){return"oninit"===e||"oncreate"===e||"onupdate"===e||"onremove"===e||"onbeforeremove"===e||"onbeforeupdate"===e}function B(e,t,n){return void 0===n&&(-1<e.tag.indexOf("-")||null!=e.attrs&&e.attrs.is||"href"!==t&&"list"!==t&&"form"!==t&&"width"!==t&&"height"!==t)&&t in e.dom}var n=/[A-Z]/g;function r(e){return"-"+e.toLowerCase()}function i(e){return"-"===e[0]&&"-"===e[1]?e:"cssFloat"===e?"float":e.replace(n,r)}function G(e,t,n){if(t!==n)if(null==n)e.style.cssText="";else if("object"!=typeof n)e.style.cssText=n;else if(null==t||"object"!=typeof t)for(var r in e.style.cssText="",n)null!=(o=n[r])&&e.style.setProperty(i(r),String(o));else{for(var r in n){var o;null!=(o=n[r])&&(o=String(o))!==String(t[r])&&e.style.setProperty(i(r),o)}for(var r in t)null!=t[r]&&null==n[r]&&e.style.removeProperty(i(r))}}function o(){this._=l}function X(e,t,n){null!=e.events?e.events[t]!==n&&(null==n||"function"!=typeof n&&"object"!=typeof n?(null!=e.events[t]&&e.dom.removeEventListener(t.slice(2),e.events,!1),e.events[t]=void 0):(null==e.events[t]&&e.dom.addEventListener(t.slice(2),e.events,!1),e.events[t]=n)):null==n||"function"!=typeof n&&"object"!=typeof n||(e.events=new o,e.dom.addEventListener(t.slice(2),e.events,!1),e.events[t]=n)}function N(e,t,n){"function"==typeof e.oninit&&$.call(e.oninit,t),"function"==typeof e.oncreate&&n.push($.bind(e.oncreate,t))}function Z(e,t,n){"function"==typeof e.onupdate&&n.push($.bind(e.onupdate,t))}return(o.prototype=Object.create(null)).handleEvent=function(e){var t,n=this["on"+e.type];"function"==typeof n?t=n.call(e.currentTarget,e):"function"==typeof n.handleEvent&&n.handleEvent(e),this._&&!1!==e.redraw&&(0,this._)(),!1===t&&(e.preventDefault(),e.stopPropagation())},function(e,t,n){if(!e)throw new TypeError("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var r=[],o=D(),i=e.namespaceURI,a=(null==e.vnodes&&(e.textContent=""),t=Y.normalizeChildren(Array.isArray(t)?t:[t]),l);try{l="function"==typeof n?n:void 0,M(e,e.vnodes,t,r,null,"http://www.w3.org/1999/xhtml"===i?void 0:i)}finally{l=a}e.vnodes=t,null!=o&&D()!==o&&"function"==typeof o.focus&&o.focus();for(var s=0;s<r.length;s++)r[s]()}}},{"../render/vnode":23}],22:[function(e,t,n){"use strict";var r=e("../render/vnode");t.exports=function(e){return r("<",void 0,void 0,e=null==e?"":e,void 0,void 0)}},{"../render/vnode":23}],23:[function(e,t,n){"use strict";function o(e,t,n,r,o,i){return{tag:e,key:t,attrs:n,children:r,text:o,dom:i,domSize:void 0,state:void 0,events:void 0,instance:void 0}}o.normalize=function(e){return Array.isArray(e)?o("[",void 0,void 0,o.normalizeChildren(e),void 0,void 0):null==e||"boolean"==typeof e?null:"object"==typeof e?e:o("#",void 0,void 0,String(e),void 0,void 0)},o.normalizeChildren=function(e){var t=[];if(e.length){for(var n=null!=e[0]&&null!=e[0].key,r=1;r<e.length;r++)if((null!=e[r]&&null!=e[r].key)!=n)throw new TypeError("Vnodes must either always have keys or never have keys!");for(r=0;r<e.length;r++)t[r]=o.normalize(e[r])}return t},t.exports=o},{}],24:[function(e,t,n){"use strict";var r=e("./promise/promise"),o=e("./mount-redraw");t.exports=e("./request/request")(window,r,o.redraw)},{"./mount-redraw":8,"./promise/promise":14,"./request/request":25}],25:[function(e,t,n){"use strict";var u=e("../pathname/build");t.exports=function(p,n,s){var a=0;function l(e){return new n(e)}function e(a){return function(t,r){"string"!=typeof t?t=(r=t).url:null==r&&(r={});var e=new n(function(n,e){a(u(t,r.params),r,function(e){if("function"==typeof r.type)if(Array.isArray(e))for(var t=0;t<e.length;t++)e[t]=new r.type(e[t]);else e=new r.type(e);n(e)},e)});if(!0===r.background)return e;var o=0;function i(){0==--o&&"function"==typeof s&&s()}return function t(n){var r=n.then;n.constructor=l;n.then=function(){o++;var e=r.apply(n,arguments);return e.then(i,function(e){if(i(),0===o)throw e}),t(e)};return n}(e)}}function m(e,t){for(var n in e.headers)if({}.hasOwnProperty.call(e.headers,n)&&t.test(n))return 1}return l.prototype=n.prototype,l.__proto__=n,{request:e(function(i,a,s,l){var e,t,n=null!=a.method?a.method.toUpperCase():"GET",r=a.body,o=!(null!=a.serialize&&a.serialize!==JSON.serialize||r instanceof p.FormData),u=a.responseType||("function"==typeof a.extract?"":"json"),c=new p.XMLHttpRequest,f=!1,d=c,h=c.abort;for(t in c.abort=function(){f=!0,h.call(this)},c.open(n,i,!1!==a.async,"string"==typeof a.user?a.user:void 0,"string"==typeof a.password?a.password:void 0),o&&null!=r&&!m(a,/^content-type$/i)&&c.setRequestHeader("Content-Type","application/json; charset=utf-8"),"function"==typeof a.deserialize||m(a,/^accept$/i)||c.setRequestHeader("Accept","application/json, text/*"),a.withCredentials&&(c.withCredentials=a.withCredentials),a.timeout&&(c.timeout=a.timeout),c.responseType=u,a.headers)!{}.hasOwnProperty.call(a.headers,t)||c.setRequestHeader(t,a.headers[t]);c.onreadystatechange=function(e){if(!f&&4===e.target.readyState)try{var t,n=200<=e.target.status&&e.target.status<300||304===e.target.status||/^file:\/\//i.test(i),r=e.target.response;if("json"===u?e.target.responseType||"function"==typeof a.extract||(r=JSON.parse(e.target.responseText)):u&&"text"!==u||null==r&&(r=e.target.responseText),"function"==typeof a.extract?(r=a.extract(e.target,a),n=!0):"function"==typeof a.deserialize&&(r=a.deserialize(r)),n)s(r);else{try{t=e.target.responseText}catch(e){t=r}var o=new Error(t);o.code=e.target.status,o.response=r,l(o)}}catch(e){l(e)}},"function"==typeof a.config&&(c=a.config(c,a,i)||c)!==d&&(e=c.abort,c.abort=function(){f=!0,e.call(this)}),null==r?c.send():"function"==typeof a.serialize?c.send(a.serialize(r)):r instanceof p.FormData?c.send(r):c.send(JSON.stringify(r))}),jsonp:e(function(e,t,n,r){var o=t.callbackName||"_mithril_"+Math.round(1e16*Math.random())+"_"+a++,i=p.document.createElement("script");p[o]=function(e){delete p[o],i.parentNode.removeChild(i),n(e)},i.onerror=function(){delete p[o],i.parentNode.removeChild(i),r(new Error("JSONP request failed"))},i.src=e+(e.indexOf("?")<0?"?":"&")+encodeURIComponent(t.callbackKey||"callback")+"="+encodeURIComponent(o),p.document.documentElement.appendChild(i)})}}},{"../pathname/build":10}],26:[function(e,t,n){"use strict";var r=e("./mount-redraw");t.exports=e("./api/router")(window,r)},{"./api/router":5,"./mount-redraw":8}],27:[function(e,t,n){var r,o,t=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(e){o=a}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return(r=setTimeout)(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}var l,u=[],c=!1,f=-1;function d(){c&&l&&(c=!1,l.length?u=l.concat(u):f=-1,u.length&&h())}function h(){if(!c){for(var e=s(d),t=(c=!0,u.length);t;){for(l=u,u=[];++f<t;)l&&l[f].run();f=-1,t=u.length}l=null,c=!1,!function(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return(o=clearTimeout)(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function m(){}t.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new p(e,t)),1!==u.length||c||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=m,t.addListener=m,t.once=m,t.off=m,t.removeListener=m,t.removeAllListeners=m,t.emit=m,t.prependListener=m,t.prependOnceListener=m,t.listeners=function(e){return[]},t.binding=function(e){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(e){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},{}],28:[function(l,e,u){!function(n,s){!function(){var r=l("process/browser.js").nextTick,e=Function.prototype.apply,o=Array.prototype.slice,i={},a=0;function t(e,t){this._id=e,this._clearFn=t}u.setTimeout=function(){return new t(e.call(setTimeout,window,arguments),clearTimeout)},u.setInterval=function(){return new t(e.call(setInterval,window,arguments),clearInterval)},u.clearTimeout=u.clearInterval=function(e){e.close()},t.prototype.unref=t.prototype.ref=function(){},t.prototype.close=function(){this._clearFn.call(window,this._id)},u.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},u.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},u._unrefActive=u.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0<=t&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},u.setImmediate="function"==typeof n?n:function(e){var t=a++,n=!(arguments.length<2)&&o.call(arguments,1);return i[t]=!0,r(function(){i[t]&&(n?e.apply(null,n):e.call(null),u.clearImmediate(t))}),t},u.clearImmediate="function"==typeof s?s:function(e){delete i[e]}}.call(this)}.call(this,l("timers").setImmediate,l("timers").clearImmediate)},{"process/browser.js":27,timers:28}]},{},[1]);PK     M\3T  T  &  lucy/assets/src/js/third-party/lucy.jsnu [        const m = require('mithril');
const algoliasearch = require('algoliasearch/lite');

function addEvent(element, event, handler) {
	if(element.addEventListener){
		element.addEventListener(event,handler,false);
	} else {
		element.attachEvent('on' + event, handler);
	}
}

function removeEvent(element, event, handler){
	if(element.removeEventListener){
		element.removeEventListener(event, handler);
	} else {
		element.detachEvent('on' + event, handler);
	}
}

function maybeClose(event) {
	// close when pressing ESCAPE
	if(event.type === 'keyup' && event.keyCode === 27 ) {
		this.close();
		return;
	}

	// close when clicking ANY element outside of Lucy
	var clickedElement = event.target || event.srcElement;
	if(event.type === 'click' && this.element.contains && ! this.element.contains(clickedElement) )  {
		this.close();
	}
}

function listenForInput(event) {
	var element = event.target || event.srcElement;
	var value = element.value;

	// revert back to list of links when empty
	if( value === '' && this.searchQuery !== '' ) {
		this.reset();
		return;
	}

	this.searchQuery = value;

	// perform search on [ENTER]
	if(event.keyCode === 13 ) {
		this.search(value);
	}
}

var Lucy = function( algoliaAppId, algoliaAppKey, algoliaIndexName, links, contactLink ) {

	this.algolia = algoliasearch( algoliaAppId, algoliaAppKey ).initIndex( algoliaIndexName );
	this.opened = false;
	this.loader = null;
	this.searchResults = null;
	this.searchQuery = '';
	this.element = document.createElement('div');
	this.element.setAttribute('class','lucy closed');
	this.hrefLinks = links;
	this.hrefContactLink = contactLink;

	document.body.appendChild(this.element);
	m.mount(this.element, { view: this.getDOM.bind(this) });
};

Lucy.prototype.getDOM = function() {

	var results = "";

	if( this.searchQuery.length > 0 ) {
		if( this.searchResults === null ) {
			results = m("em.search-pending", "Hit [ENTER] to search for \""+ this.searchQuery + "\"..")
		} else if( this.searchResults.length > 0 ) {
			results = this.searchResults.map(function(l) {
				return m('a', { href: l.href }, m.trust(l.text) );
			})
		} else {
			results = m('em.search-pending',  "Nothing found for \""+ this.searchQuery + "\"..");
		}
	}

	return [
		m('div', { style: { display: this.opened ? 'block' : 'none' } }, [
			m('span.lucy-close-icon', { onclick: this.close.bind(this) }, ""),
			m('div.lucy-header', [
				m('h4', 'Looking for help?'),
				m('div.lucy-search-form', {
					onsubmit: this.search.bind(this)
				}, [
					m('input', {
						type: 'text',
						value: this.searchQuery,
						onkeyup: listenForInput.bind(this),
						onupdate: (function(vnode) { if(this.opened) { vnode.dom.focus(); } }).bind(this),
						placeholder: 'What are you looking for?'
					}),
					m('span.loader', {
						oncreate: (function(vnode) {
							this.loader = vnode.dom;
						}).bind(this)
					}),
					m('input', { type: 'submit' })
				])
			]),
			m('div.lucy-content', [

				m('div.lucy-links', { style: { display: this.searchQuery.length > 0 ? 'none' : 'block' } }, this.hrefLinks.map(function(l) {
					return m('a', { href: l.href }, m.trust(l.text) );
				})),

				m('div.lucy-search-results', results)

			]),
			m('div.lucy-footer', [
				m("span", "Can't find the answer you're looking for?"),
				m("a", { "class": 'button button-primary', href: this.hrefContactLink, target: "_blank" }, "Contact Support")
			])
		]),
		m('span.lucy-button', {
			onclick: this.open.bind(this),
			style: { display: this.opened ? 'none' : 'block' }
		}, [
			m('span.lucy-button-text',  "Need help?")
		])
	];
};

Lucy.prototype.open = function() {
	if( this.opened ) return;
	this.opened = true;

	this.element.setAttribute('class', 'lucy open' );

	m.redraw();

	addEvent(document, 'keyup', maybeClose.bind(this));
	addEvent(document, 'click', maybeClose.bind(this));
};

Lucy.prototype.close = function() {
	if( ! this.opened ) return;
	this.opened = false;

	this.reset();
	this.element.setAttribute('class', 'lucy closed' );

	removeEvent(document, 'keyup', maybeClose.bind(this));
	removeEvent(document, 'click', maybeClose.bind(this));
};

Lucy.prototype.reset = function() {
	this.searchQuery = '';
	this.searchResults = null;
	m.redraw();
};

Lucy.prototype.search = function(query) {
	var loader = this.loader;
	const tick = function() {
		loader.innerText += '.';

		if( loader.innerText.length > 3 ) {
			loader.innerText = '.';
		}
	};

	// start loader
	loader.innerText = '.';
	const loadingInterval = window.setInterval(tick, 333 );

	this.algolia.search( query, { hitsPerPage: 5 })
		.then(result => {
			this.searchResults = [];

			/* clear loader */
			loader.innerText = '';
			window.clearInterval(loadingInterval);

			this.searchResults = result.hits.map(function(r) {
				return { href: r.url, text: r._highlightResult.title.value};
			});

			m.redraw();
		}).catch(error => {
			console.log(error);
		});
};



module.exports = Lucy;
PK     M\4  4    lucy/assets/src/js/script.jsnu [        'use strict';

const Lucy = require('./third-party/lucy.js');
const config = {
	algoliaAppId: 'CGLHJ0181U',
	algoliaAppKey: '8fa2f724a6314f9a0b840c85b05b943e',
	algoliaIndexName: 'mc4wp_kb',
	links: [
		{
			text: "<span class=\"dashicons dashicons-book\"></span> Knowledge Base",
			href: "https://www.mc4wp.com/kb/"
		},
		{
			text: "<span class=\"dashicons dashicons-editor-code\"></span> Code Snippets",
			href: "https://github.com/ibericode/mc4wp-snippets"
		},
		{
			text: "<span class=\"dashicons dashicons-editor-break\"></span> Changelog (free plugin)",
			href: "https://wordpress.org/plugins/mailchimp-for-wp/#developers"
		},
		{
			text: "<span class=\"dashicons dashicons-editor-break\"></span> Changelog (Premium plugin)",
			href: "https://my.mc4wp.com/plugins/1/changelog"
		}
	],
	contactLink: 'mailto:support@mc4wp.com'
};

// grab from WP dumped var.
if( window.lucy_config ) {
	config.contactLink = window.lucy_config.email_link;
}

new Lucy(
	config.algoliaAppId,
	config.algoliaAppKey,
	config.algoliaIndexName,
	config.links,
	config.contactLink
);
PK     M\-a	  	    lucy/assets/src/css/styles.cssnu [        .lucy {
    position: fixed;
    bottom: 0;
    right: 20px;
    z-index: 999;
    box-shadow: 0 0 20px #333;
    background: #cc4444;
    width: auto;
    font-size: 14px;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.lucy.open {
    border: 1px solid #999;
    border-bottom: 0;
    width: 320px;
}

@media (max-width: 360px) {
    .lucy.open {
        width: 100%;
        right: 0;
        font-size: 13px;
    }

    .lucy.open .dashicons {
        display: none;
    }
}

.lucy-button {
    display: block;
    text-align: center;
    padding: 0 20px;
    color: white;
    cursor: pointer;
    line-height: 40px;
}

.lucy-button:after {
    content: "\f468";
    font-size: 24px;
    margin-left: 10px;
    font-family: "dashicons";
    vertical-align: middle;
}

@media (max-width: 360px) {
    .lucy-button .lucy-button-text {
        display: none;
    }

    .lucy-button:after {
        margin: 0;
    }
}

.lucy-close-icon {
    position: absolute;
    top: 0;
    right: 0;
    padding: 10px;
    cursor: pointer;
    opacity: 0.9;
}

.lucy-close-icon:after {
    background: white;
    color: #666;
    font-family: "dashicons";
    font-size: 20px;
    border-radius: 50%;
    content: "\f158";
}

.lucy-close-icon:focus,
.lucy-close-icon:hover {
    opacity: 1;
}

.lucy-search-form {
    position: relative;
}

.lucy-search-form [type="submit"] {
    display: none;
}

.lucy-search-form input {
    width: 100%;
    display: block;
    padding: 6px 20px 6px 6px;
}

.lucy-search-form .loader {
    position: absolute;
    right: 10px;
    top: 0;
    bottom: 0;
    color: #ccc;
    vertical-align: middle;
    line-height: 55%;
    font-size: 24px;
}

.lucy-header {
    color: white;
    padding: 10px;
}

.lucy-header h3,
.lucy-header h4 {
    color: white;
    margin-top: 0;
}

.lucy-content {
    background: white;
}

.lucy-search-results a {
    padding: 8px 10px;
}

.lucy-links a {
    padding: 12px 10px;
}

.lucy-links a .dashicons {
    color: #555;
    margin-right: 10px;
}

.lucy-content .search-pending,
.lucy-content a {
    display: block;
    padding: 8px 10px;
    border-bottom: 1px solid #efefef;
    text-decoration: none;
}

.lucy-content a:last-of-type {
    border-bottom: 0;
}

.lucy-footer {
    text-align: center;
    padding: 10px 10px 20px;
    background: #efefef;
}

.lucy-footer span {
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
}
PK     M\      lucy/assets/css/styles.cssnu [        .lucy{position:fixed;bottom:0;right:20px;z-index:999;box-shadow:0 0 20px #333;background:#c44;width:auto;font-size:14px;border-top-left-radius:4px;border-top-right-radius:4px}.lucy.open{border:1px solid #999;border-bottom:0;width:320px}@media (max-width:360px){.lucy.open{width:100%;right:0;font-size:13px}.lucy.open .dashicons{display:none}}.lucy-button{display:block;text-align:center;padding:0 20px;color:#fff;cursor:pointer;line-height:40px}.lucy-button:after{content:"\f468";font-size:24px;margin-left:10px;font-family:dashicons;vertical-align:middle}@media (max-width:360px){.lucy-button .lucy-button-text{display:none}.lucy-button:after{margin:0}}.lucy-close-icon{position:absolute;top:0;right:0;padding:10px;cursor:pointer;opacity:.9}.lucy-close-icon:after{background:#fff;color:#666;font-family:dashicons;font-size:20px;border-radius:50%;content:"\f158"}.lucy-close-icon:focus,.lucy-close-icon:hover{opacity:1}.lucy-search-form{position:relative}.lucy-search-form [type=submit]{display:none}.lucy-search-form input{width:100%;display:block;padding:6px 20px 6px 6px}.lucy-search-form .loader{position:absolute;right:10px;top:0;bottom:0;color:#ccc;vertical-align:middle;line-height:55%;font-size:24px}.lucy-header{color:#fff;padding:10px}.lucy-header h3,.lucy-header h4{color:#fff;margin-top:0}.lucy-content{background:#fff}.lucy-search-results a{padding:8px 10px}.lucy-links a{padding:12px 10px}.lucy-links a .dashicons{color:#555;margin-right:10px}.lucy-content .search-pending,.lucy-content a{display:block;padding:8px 10px;border-bottom:1px solid #efefef;text-decoration:none}.lucy-content a:last-of-type{border-bottom:0}.lucy-footer{text-align:center;padding:10px 10px 20px;background:#efefef}.lucy-footer span{display:block;font-weight:700;margin-bottom:10px}PK     M\뚊      <  styles-builder/includes/migrations/3.0.2-file-permission.phpnu [        <?php
// set correct file permission for bundle file
$upload = wp_upload_dir();
$filename = $upload['basedir'] . '/mc4wp-stylesheets/bundle.css';
@chmod($filename, 0755);
PK     M\I|ۋC	  C	  (  styles-builder/includes/class-public.phpnu [        <?php

/**
 * Class MC4WP_Styles_Builder_Public
 *
 * @ignore
 */
class MC4WP_Styles_Builder_Public
{
    /**
     * Add hooks
     */
    public function add_hooks()
    {
        // capture form preview requests
        add_action('wp', array( $this, 'maybe_load_preview' ), 99);
        add_action('mc4wp_load_form_stylesheets', array( $this, 'load_stylesheets' ));
    }

    /**
     * Load Styles Builder stylesheets
     *
     * @param array $stylesheets
     */
    public function load_stylesheets($stylesheets)
    {

        // only load bundle when stylesheets has `styles-builder` in it.
        if (! in_array('styles-builder', $stylesheets)) {
            return;
        }

        // get stylesheet file
        $uploads = wp_upload_dir(null, false);
        $bundle_filename = '/mc4wp-stylesheets/bundle.css';
        $version = get_option('mc4wp_forms_styles_builder_version', 1);

        // use protocol relative URL's
        $base_url = str_ireplace(array( 'http://', 'https://' ), '//', $uploads['baseurl']);

        // check if bundle file exists, file system check is cheap, 404 in WordPress is not.
        if (file_exists($uploads['basedir'] . $bundle_filename)) {

            // generate url of stylesheet
            $url = $base_url . $bundle_filename;
            wp_enqueue_style('mc4wp-form-styles-builder', $url, array(), $version);
            add_editor_style($url);
        }

        // if this a preview, load single stylesheet (because styles may not be in bundle yet)
        if (defined('MC4WP_FORM_IS_PREVIEW') && MC4WP_FORM_IS_PREVIEW) {
            $single_filename = '/mc4wp-stylesheets/form-' . intval($_GET['form_id']) .'.css';
            $url = $base_url . $single_filename;
            wp_enqueue_style('mc4wp-form-styles-builder', $url, array(), $version);
        }
    }

    /**
     * Maybe load form preview for Styles Builder
     */
    public function maybe_load_preview()
    {

        // make sure form_id is set and current user has required capabilities
        if (! isset($_GET['_mc4wp_styles_builder_preview']) || empty($_GET['form_id']) || ! current_user_can('edit_posts')) {
            return;
        }

        // disable all other stylesheets
        add_filter('mc4wp_form_stylesheets', '__return_empty_array');


        require __DIR__ . '/../views/form-preview.php';
        exit;
    }
}
PK     M\P<-  -  '  styles-builder/includes/class-admin.phpnu [        <?php

/**
 * Class MC4WP_Styles_Builder_Admin
 *
 * @ignore
 * @access private
 */
class MC4WP_Styles_Builder_Admin
{

    /**
     * @var string
     */
    protected $plugin_file;

    /**
     * @param string $plugin_file
     */
    public function __construct($plugin_file)
    {
        $this->plugin_file = $plugin_file;
    }

    /**
     * Add necessary hooks
     */
    public function add_hooks()
    {
        add_action('admin_init', array($this, 'run_upgrade_routines'));
        add_action('mc4wp_admin_enqueue_assets', array($this, 'enqueue_assets'));
        add_action('mc4wp_admin_form_after_appearance_settings_rows', array($this, 'add_settings_row'), 10, 2);
        add_filter('mc4wp_admin_form_css_options', array($this, 'add_css_option'));
        add_action('mc4wp_admin_show_forms_page-styles-builder', array($this, 'show_page'));

        // re-create stylesheet every time a form is saved
        add_action('mc4wp_save_form', array($this, 'create_stylesheet_bundle'));
        add_action('mc4wp_admin_styles_builder_save', array($this, 'save_settings'));
    }

    /**
     * Creates the bundled stylesheet file from current styles builder settings.
     */
    public function create_stylesheet_bundle()
    {
        $builder = new MC4WP_Styles_Builder();
        $builder->create_bundle();
    }

    /**
     * Run upgrade routines, if necessary.
     */
    public function run_upgrade_routines()
    {
        $from_version = get_option('mc4wp_styles_builder_version', 0);
        $to_version = MC4WP_PREMIUM_VERSION;

        // we're at the specified version already
        if (version_compare($from_version, $to_version, '>=')) {
            return;
        }

        $upgrade_routines = new MC4WP_Upgrade_Routines($from_version, $to_version, __DIR__ . '/migrations');
        $upgrade_routines->run();
        update_option('mc4wp_styles_builder_version', $to_version);
    }

    /**
     * Save Styles Builder settings
     */
    public function save_settings()
    {
        $builder = new MC4WP_Styles_Builder();
        $styles = stripslashes_deep($_POST['mc4wp_form_styles']);
        $all = $builder->build($styles);
        update_option('mc4wp_form_styles', $all, false);
    }

    /**
     * @param $suffix
     */
    public function enqueue_assets($suffix = '')
    {
        if (!isset($_GET['view']) || $_GET['view'] !== 'styles-builder') {
            return;
        }

        // our own scripts
        wp_enqueue_style('mc4wp-styles-builder', plugins_url('/assets/css/admin.css', $this->plugin_file), array('wp-color-picker', 'thickbox'), MC4WP_PREMIUM_VERSION);
        wp_enqueue_script('mc4wp-styles-builder', plugins_url('/assets/js/styles-builder.js', $this->plugin_file), array('jquery', 'wp-color-picker', 'thickbox'), MC4WP_PREMIUM_VERSION, true);
    }

    /**
     * Show Styles Builder page
     */
    public function show_page()
    {
        $forms = mc4wp_get_forms(array('post_status' => array('publish', 'draft', 'pending', 'future')));
        $form_id = $forms[0]->ID;

        // get form to which styles should apply
        if (isset($_GET['form_id'])) {
            $form_id = absint($_GET['form_id']);
        }

        $form = mc4wp_get_form($form_id);

        // get css settings for this form (or 0)
        $builder = new MC4WP_Styles_Builder();
        $styles = $builder->get_form_styles($form_id);

        // create preview url
        $preview_url = add_query_arg(array('form_id' => $form_id, '_mc4wp_styles_builder_preview' => 1), home_url());

        require __DIR__ . '/../views/styles-builder.php';
    }

    /**
     * @param $opts
     *
     * @return mixed
     */
    public function add_css_option($opts)
    {
        $opts['styles-builder'] = __('Use Styles Builder', 'mailchimp-for-wp');
        return $opts;
    }

    /**
     * @param array $opts
     * @param MC4WP_Form $form
     */
    public function add_settings_row($opts, MC4WP_Form $form)
    {
        ?>
		<tr valign="top">
			<td></td>
			<td>
				<p>
					<?php _e('Create custom appearance rules for this form using the Styles Builder.', 'mailchimp-for-wp'); ?>
				</p>

				<p>
					<a class="button" href="<?php echo add_query_arg(array('view' => 'styles-builder', 'form_id' => $form->ID)); ?>">
						<?php _e('Open Styles Builder', 'mailchimp-for-wp'); ?>
					</a>
				</p>
			</td>
		</tr>
	<?php
    }
}
PK     M\[L  L  0  styles-builder/includes/class-styles-builder.phpnu [        <?php

class MC4WP_Styles_Builder
{

    /**
     * Array with all available CSS fields, their default value and their type
     *
     * @var array
     */
    protected $fields = array(
        'form_width' => array(
            'default' => '',
            'type' => 'px'
        ),
        'form_background_color' => array(
            'default' => '',
            'type' => 'color'
        ),
        'form_background_image' => array(
            'default' => '',
            'type' => 'text'
        ),
        'form_background_repeat' => array(
            'default' => 'repeat',
            'type' => 'text'
        ),
        'form_font_color' => array(
            'default' => '',
            'type' => 'color'
        ),
        'form_border_color' => array(
            'default' => '',
            'type' => 'color'
        ),
        'form_border_width' => array(
            'default' => '',
            'type' => 'int'
        ),
        'form_padding' => array(
            'default' => '',
            'type' => 'int'
        ),
        'form_text_align' => array(
            'default' => '',
            'type' => 'text'
        ),
        'form_font_size' => array(
            'default' => '',
            'type' => 'int'
        ),
        'labels_font_color' => array(
            'default' => '',
            'type' => 'color'
        ),
        'labels_font_style' => array(
            'default' => '',
            'type' => 'text'
        ),
        'labels_font_size' => array(
            'default' => '',
            'type' => 'int'
        ),
        'labels_display' => array(
            'default' => '',
            'type' => 'text'
        ),
        'labels_vertical_margin' => array(
            'default' => '',
            'type' => 'int'
        ),
        'labels_horizontal_margin' => array(
            'default' => '',
            'type' => 'int'
        ),
        'labels_width' => array(
            'default' => '',
            'type' => 'px'
        ),
        'fields_border_radius' => array(
            'default' => '',
            'type' => 'int'
        ),
        'fields_border_color' => array(
            'default' => '',
            'type' => 'color'
        ),
        'fields_focus_outline_color' => array(
            'default' => '',
            'type' => 'color'
        ),
        'fields_border_width' => array(
            'default' => '',
            'type' => 'int'
        ),
        'fields_width' => array(
            'default' => '',
            'type' => 'px'
        ),
        'fields_height' => array(
            'default' => '',
            'type' => 'int'
        ),
        'fields_display' => array(
            'default' => '',
            'type' => 'text'
        ),
        'buttons_background_color' => array(
            'default' => '',
            'type' => 'color'
        ),
        'buttons_hover_background_color' => array(
            'default' => '',
            'type' => 'color'
        ),
        'buttons_font_color' => array(
            'default' => '',
            'type' => 'color'
        ),
        'buttons_font_size' => array(
            'default' => '',
            'type' => 'int'
        ),
        'buttons_border_color' => array(
            'default' => '',
            'type' => 'color'
        ),
        'buttons_hover_border_color' => array(
            'default' => '',
            'type' => 'color'
        ),
        'buttons_border_radius' => array(
            'default' => '',
            'type' => 'int'
        ),
        'buttons_border_width' => array(
            'default' => '',
            'type' => 'int'
        ),
        'buttons_width' => array(
            'default' => '',
            'type' => 'px'
        ),
        'buttons_height' => array(
            'default' => '',
            'type' => 'int'
        ),
        'messages_font_color_error' => array(
            'default' => '',
            'type' => 'color'
        ),
        'messages_font_color_notice' => array(
            'default' => '',
            'type' => 'color'
        ),
        'messages_font_color_success' => array(
            'default' => '',
            'type' => 'color'
        ),
        'selector_prefix' => array(
            'default' => '',
            'type' => 'selector'
        ),
        'manual' => array(
            'default' => '',
            'type' => 'text'
        ),
    );

    /**
     * @var array
     */
    protected $default_form_styles = array();

    /**
     * @var array
     */
    protected $styles = array();

    /**
     * @var MC4WP_Admin_Messages
     */
    protected $messages;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->default_form_styles = $this->load_default_form_styles();
        $this->styles = $this->load_styles();
        $this->messages = mc4wp('admin.messages');
    }

    /**
     * @param $styles
     *
     * @return MC4WP_Styles_Builder
     */
    public function build($styles)
    {
        // clean-up styles array
        $this->clean();

        // sanitize submitted styles
        $this->sanitize($styles);

        // listen for user-triggered actions (delete, copy, ..)
        $this->act();

        // re-bundle
        $this->create_bundle();

        // return all styles (for WP options API)
        return $this->styles;
    }

    /**
     * Act on user-triggered actions
     */
    protected function act()
    {
        $form_id = (int) $_POST['form_id'];
        if (empty($form_id)) {
            return;
        }

        // was delete button clicked?
        if (isset($_POST['_mc4wp_delete_form_styles'])) {
            $form_id_to_delete = absint($_POST['_mc4wp_delete_form_styles']);
            $this->delete_form_styles($form_id_to_delete);
        } elseif (isset($_POST['_mc4wp_copy_form_styles'])) {
            $this->copy_form_styles($_POST['copy_from_form_id'], $form_id);
        }

        // recreate stylesheet (with new values)
        if (! defined('MC4WP_DOING_UPGRADE')) {
            $this->delete_stylesheet($form_id);
            $this->build_stylesheet($form_id);
        }
    }

    /**
     * @param int $form_id
     *
     * @return bool
     */
    public function delete_form_styles($form_id)
    {
        if (isset($this->styles['form-' . $form_id ])) {
            unset($this->styles['form-' . $form_id ]);
            return true;
        }

        return false;
    }

    /**
     * @param int $from_id
     * @param int $to_id
     * @return bool
     */
    public function copy_form_styles($from_id, $to_id)
    {
        if (isset($this->styles['form-' . $from_id ])) {
            $this->styles['form-' . $to_id ] = $this->styles['form-' . $from_id ];
            return true;
        }

        return false;
    }

    /**
     * Get the default theme settings
     *
     * @return array
     */
    protected function load_default_form_styles()
    {
        $default_form_styles = array();

        foreach ($this->fields as $key => $field) {
            $default_form_styles[ $key ] = $field['default'];
        }

        return $default_form_styles;
    }

    /**
     * Get all form themes, merged with defaults
     *
     * @return array
     */
    protected function load_styles()
    {
        $all_styles = (array) get_option('mc4wp_form_styles', array());

        if (empty($all_styles)) {
            return array();
        }

        // merge all theme settings with the defaults array
        foreach ($all_styles as $form_id => $form_styles) {
            $all_styles[ $form_id ] = array_merge($this->default_form_styles, $form_styles);
        }

        // return merged array
        return $all_styles;
    }

    /**
     * Get saved CSS values from option
     *
     * @param int $form_id
     *
     * @return array
     */
    public function get_form_styles($form_id = 0)
    {
        $form_styles = (isset($this->styles[ 'form-' . $form_id ])) ? $this->styles[ 'form-' . $form_id ] : $this->default_form_styles;
        return $form_styles;
    }

    /**
     * Clean complete $styles array, remove deleted forms..
     *
     * @return array
     */
    protected function clean()
    {
        // clean-up existing form styles
        foreach ($this->styles as $form_id => $form_styles) {
            // skip these styles if form no longer exists
            $form = get_post(substr($form_id, 5));
            if (! $form instanceof WP_Post || $form->post_status !== 'publish') {
                unset($this->styles[ $form_id ]);
            }
        }

        return $this->styles;
    }

    /**
     * Validate the given CSS values according to their type
     *
     * @param $dirty_form_styles
     *
     * @return mixed
     */
    protected function sanitize($dirty_form_styles = array())
    {

        // start sanitizing new form styles
        foreach ($dirty_form_styles as $form_id => $new_form_styles) {

            // start with empty array of styles
            $sanitized_form_styles = array();

            foreach ($new_form_styles as $key => $value) {

                // skip field if it's not a valid field
                if (! isset($this->fields[ $key ])) {
                    continue;
                }

                // add field value to css array
                $sanitized_form_styles[ $key ] = $value;

                // skip if field is empty or has its default value
                if ('' === $value || $value === $this->fields[$key]['default']) {
                    continue;
                }

                // sanitize field since it's not default
                $type = $this->fields[ $key ]['type'];
                $value = call_user_func(array( $this, 'sanitize_' . $type ), $value);

                // save css value
                $sanitized_form_styles[ $key ] = $value;
            }

            // save sanitized styles in array with all styles
            $this->styles[ $form_id ] = $sanitized_form_styles;
        }

        return $this->styles;
    }

    /**
     * Sanitize color values
     *
     * @param $value
     *
     * @return string
     */
    public function sanitize_color($value)
    {
        // make sure colors start with #
        return '#' . ltrim(trim($value), '#');
    }

    /**
     * Sanitize pixel value
     *
     * @param $value
     *
     * @return mixed|string
     */
    public function sanitize_px($value)
    {
        // make sure px and % end with 'px' or '%'
        $value = str_replace(' ', '', strtolower($value));

        if (substr($value, -1) !== '%' && substr($value, -2) !== 'px') {
            $value = floatval($value) . 'px';
        }

        return $value;
    }

    /**
     * Sanitize integer value
     *
     * @param $value
     *
     * @return int
     */
    public function sanitize_int($value)
    {
        return intval($value);
    }

    /**
     * Sanitize CSS selector value
     *
     * @param $value
     *
     * @return string
     */
    public function sanitize_selector($value)
    {
        return trim($value) . ' ';
    }

    /**
     * Sanitize text value
     *
     * @param $value
     *
     * @return string
     */
    public function sanitize_text($value)
    {
        return trim($value);
    }

    /**
     * Delete all stylesheets from the WP uploads dir
     *
     * @param int $form_id
     * @return bool
     */
    protected function delete_stylesheet($form_id = 0)
    {
        $dir = $this->get_stylesheets_dir();

        // if form id not given, delete all .css files in directory
        if (! $form_id) {
            $stylesheets = glob($dir . '/*.css');

            if (is_array($stylesheets)) {
                // unlink all stylesheets
                array_map('unlink', $stylesheets);
            }

            return true;
        }

        // only unlink if file exists
        $filename = $dir . sprintf('/form-%d.css', $form_id);
        if (file_exists($filename)) {
            unlink($filename);
        }

        return true;
    }

    /**
     * Build file with given CSS values
     *
     * @param int $form_id
     * @return bool
     */
    protected function build_stylesheet($form_id)
    {
        $css_string = $this->get_css_string($form_id);
        $dir = $this->get_stylesheets_dir();
        $filename = sprintf('/form-%d.css', $form_id);
        $file = $dir . $filename;

        // try to create stylesheets dir with proper permissions
        if (! file_exists($dir)) {
            @mkdir($dir, 0755);
        }

        @chmod($dir, 0755);
        @chmod($file, 0755);

        // write css string to file
        $handle = fopen($file, 'w');
        $success = false;

        // show error when opening file for writing fails
        if (is_resource($handle)) {
            $success = fwrite($handle, $css_string);
            fclose($handle);
        }

        // success should be > 0 now
        if (! $success) {
            $this->messages->flash(sprintf('Error writing stylesheet. File <code>%s</code> is not writable, please check your file permissions.', $file), 'error');
            return false;
        }

        // create url
        $url = $this->get_stylesheets_url($filename);
        $message = '<strong>' . sprintf(__('<a href="%s">CSS stylesheet</a> created.', 'mailchimp-for-wp'), $url) . '</strong>';

        // check if stylesheet is being loaded for this form, otherwise show notice.
        $form = mc4wp_get_form($form_id);
        if ($form->settings['css'] !== 'styles-builder') {
            $message .= ' ' . sprintf(__('<a href="%s">Select "Use Styles Builder" in the form appearance settings</a> if you want to use these styles on your website.', 'mailchimp-for-wp'), mc4wp_get_edit_form_url($form_id, 'appearance'));
        }

        // add "back to form" link in notice
        $message .= '<br /><br />' . sprintf('<a href="%s"> &laquo; ' . __('Back to form', 'mailchimp-for-wp') .'</a>', mc4wp_get_edit_form_url($form_id));

        // show notice
        $this->messages->flash($message, 'success');
        return true;
    }

    /**
     * Turns array of CSS values into CSS stylesheet string
     *
     * @return string
     */
    protected function get_css_string($form_id)
    {

        // Build CSS String
        $css_string = '';
        ob_start();

        $form_styles = isset( $this->styles[ 'form-' . $form_id ] ) ? $this->styles[ 'form-' . $form_id ] : array();
        $form_selector = '.mc4wp-form-' . $form_id;

        // Build CSS styles for this form
        extract($form_styles);
        include __DIR__ . '/../views/css-styles.php';

        // get output buffer
        $css_string = ob_get_contents();
        ob_end_clean();

        return $css_string;
    }

    /**
     * Checks whether a custom CSS rule value was set for this element
     *
     * @param $form_id
     * @param $element_name
     *
     * @return bool
     */
    public function form_has_rules_for_element($form_id, $element_name)
    {
        if (! isset($this->styles[ 'form-' . $form_id ])) {
            return false;
        }

        // loop through all form styles
        foreach ($this->styles[ 'form-' . $form_id ] as $rule_name => $rule_value) {

            // is this a rule for the given element?
            if (strpos($rule_name, $element_name) === 0) {

                // is this rule filled with a value?
                if (! empty($rule_value)) {
                    return true;
                }
            }
        }

        // no filled rules for this element found
        return false;
    }

    /**
     * @param $rule
     * @param $value
     */
    public function maybe_echo($rule, $value)
    {
        if (! empty($value)) {
            printf($rule, $value);
        }
    }

    /**
     * @return array
     */
    public function get_enabled_form_ids()
    {
        // find all forms where "css" is set to "styles-builder"
        $forms = mc4wp_get_forms(array(
            'post_status' => array( 'publish', 'draft', 'pending', 'future' ),
        ));
        $enabled_forms = array();

        foreach ($forms as $form) {
            if ($form->settings['css'] === 'styles-builder') {
                $enabled_forms[] = $form->ID;
            }
        }

        return $enabled_forms;
    }

    /**
     * @param string $path
     * @return string
     */
    public function get_stylesheets_dir($path = '')
    {
        $upload = wp_upload_dir();
        $dir = $upload['basedir'] . '/mc4wp-stylesheets';

        if (! empty($path)) {
            $dir .= '/' . trim($path, '/');
        }

        return $dir;
    }

    /**
     * @param string $path
     * @return string
     */
    public function get_stylesheets_url($path = '')
    {
        $upload = wp_upload_dir(null, false);
        $url = $upload['baseurl'] . '/mc4wp-stylesheets';

        if (! empty($path)) {
            $url .= '/' . ltrim($path, '/');
        }

        return $url;
    }

    /**
     * Bundle all activated stylesheets into a single "bundle.css" file.
     */
    public function create_bundle()
    {

        // bail if none of the forms have Styles Builder styles enabled
        $enabled_form_ids = $this->get_enabled_form_ids();
        if (empty($enabled_form_ids)) {
            return;
        }

        // find all stylesheet files created by Styles Builder
        $stylesheet_files = $this->get_stylesheet_files($enabled_form_ids);
        if (empty($stylesheet_files)) {
            return;
        }

        $dir = $this->get_stylesheets_dir();
        $filename = $dir . '/bundle.css';
        @chmod($filename, 0755);
        $handle = fopen($filename, 'w');

        // show error when opening file for writing fails
        if (! is_resource($handle) || ! fwrite($handle, '/* bundled styles */' . PHP_EOL)) {
            $message = sprintf('File <code>%s</code> is not writable. Please set the correct file permissions or manually include the styles on your site using a plugin like %s.', $filename, '<a href="https://wordpress.org/plugins/simple-custom-css/">Simple Custom CSS');
            $message .= '<br /><br /><a href="#" onclick="this.nextSibling.style.display = \'\';">' . __('Show CSS', 'mailchimp-for-wp') . '</a>';

            $css_string = esc_html(join(PHP_EOL, array_map('file_get_contents', $stylesheet_files)));
            $message .= '<textarea readonly style="display:none; width: 100%; min-height: 200px; margin-top: 20px; font-size: 13px; font-weight: normal; font-family: Monospace, Courier, consola;">'. $css_string .'</textarea><strong>';

            $this->messages->flash($message, 'error');
            return;
        }

        // write stylesheet files to bundle file
        foreach ($stylesheet_files as $stylesheet_file) {
            $content = file_get_contents($stylesheet_file);
            fwrite($handle, $content);
            fwrite($handle, PHP_EOL . PHP_EOL);
        }

        fclose($handle);

        // store version as option (for cache busting)
        update_option('mc4wp_forms_styles_builder_version', time(), false);
    }


    /**
     * @param array $form_ids
     *
     * @return array
     */
    public function get_stylesheet_files(array $form_ids = array())
    {
        $dir = $this->get_stylesheets_dir();

        $stylesheet_files = array();
        foreach ($form_ids as $form_id) {
            $stylesheet_file = $dir . '/' . sprintf('form-%d.css', $form_id);
            if (file_exists($stylesheet_file)) {
                $stylesheet_files[] = $stylesheet_file;
            }
        }

        return $stylesheet_files;
    }
}
PK     M\M      *  styles-builder/assets/js/styles-builder.jsnu [        !function r(n,l,s){function i(t,e){if(!l[t]){if(!n[t]){var o="function"==typeof require&&require;if(!e&&o)return o(t,!0);if(c)return c(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}o=l[t]={exports:{}},n[t][0].call(o.exports,function(e){return i(n[t][1][e]||e)},o,o.exports,r,n,l,s)}return l[t].exports}for(var c="function"==typeof require&&require,e=0;e<s.length;e++)i(s[e]);return i}({1:[function(e,t,o){"use strict";function r(e){this.element=e,this.heading=e.querySelector("h2, h3, h4"),this.content=e.querySelector("div"),e.setAttribute("class","accordion"),this.heading.setAttribute("class","accordion-heading"),this.content.setAttribute("class","accordion-content"),this.content.style.display="none",this.heading.addEventListener("click",this.toggle.bind(this))}r.prototype.open=function(){this.toggle(!0)},r.prototype.close=function(){this.toggle(!1)},r.prototype.toggle=function(e){"boolean"!=typeof e&&(e=null===this.content.offsetParent),this.content.style.display=e?"block":"none",this.element.className="accordion "+(e?"expanded":"collapsed")},t.exports=r},{}],2:[function(e,t,o){"use strict";var l=e("./_accordion-element.js");t.exports=function(e){var t=[];e.className+=" accordion-container";for(var o,r=e.children,n=0;n<r.length;n++)"DIV"===r[n].tagName.toUpperCase()&&(o=new l(r[n]),t.push(o));t[0].open()}},{"./_accordion-element.js":1}],3:[function(e,t,o){"use strict";var a=e("./_option.js"),u=window.jQuery;function d(e,t){var o=!1,e=("#"==e[0]&&(e=e.slice(1),o=!0),parseInt(e,16)),r=(e>>16)+t,n=(255<r?r=255:r<0&&(r=0),(e>>8&255)+t),e=(255<n?n=255:n<0&&(n=0),(255&e)+t);return 255<e?e=255:e<0&&(e=0),(o?"#":"")+String("000000"+(e|n<<8|r<<16).toString(16)).slice(-6)}t.exports=function(e){var r,o=u(e),n=function(){for(var e=document.querySelectorAll(".mc4wp-option"),t={},o=0;o<e.length;o++)t[e[o].id]=new a(e[o]);return t}();function t(){r.choices.css({display:"inline-block","margin-right":"6px"}),r.buttons.css({"text-align":"center",cursor:"pointer",padding:"6px 12px","text-shadow":"none","box-sizing":"border-box","line-height":"normal","vertical-align":"top"}),r.form.css({"max-width":n["form-width"].getPxOrPercentageValue(),"text-align":n["form-text-align"].getValue(),"font-size":n["form-font-size"].getPxValue(),color:n["form-font-color"].getColorValue(),"background-color":n["form-background-color"].getColorValue(),"border-color":n["form-border-color"].getColorValue(),"border-width":n["form-border-width"].getPxValue(),padding:n["form-padding"].getPxValue()}),0<n["form-width"].getValue().length&&r.form.css("width","100%"),0<n["form-background-image"].getValue().length?(r.form.css("background-image",'url("'+n["form-background-image"].getValue()+'")'),e=n["form-background-repeat"].getValue(),o=-1<["cover"].indexOf(e)?"background-size":"background-repeat",r.form.css(o,e)):(r.form.css("background-image","initial"),r.form.css("background-repeat",""),r.form.css("background-size","")),0<n["form-border-width"].getValue()&&r.form.css("border-style","solid"),r.labels.css({"margin-bottom":"6px","box-sizing":"border-box","vertical-align":"top",color:n["labels-font-color"].getColorValue(),"font-size":n["labels-font-size"].getPxValue(),display:n["labels-display"].getValue(),"max-width":n["labels-width"].getPxOrPercentageValue()}),0<n["labels-width"].getValue().length&&r.labels.css("width","100%"),r.labels.find("span").css("font-weight","normal");var e,t,o=n["labels-font-style"].getValue();0<o.length&&r.labels.css({"font-weight":"bold"==o||"bolditalic"==o?"bold":"normal","font-style":"italic"==o||"bolditalic"==o?"italic":"normal"}),r.fields.css({padding:"6px 12px","margin-bottom":"6px","box-sizing":"border-box","vertical-align":"top","border-width":n["fields-border-width"].getPxValue(),"border-color":n["fields-border-color"].getColorValue(),"border-radius":n["fields-border-radius"].getPxValue(),display:n["fields-display"].getValue(),"max-width":n["fields-width"].getPxOrPercentageValue(),height:n["fields-height"].getPxValue()}),0<n["fields-width"].getValue().length&&r.fields.css("width","100%"),r.buttons.css({"border-width":n["buttons-border-width"].getPxValue(),"border-color":n["buttons-border-color"].getColorValue(),"border-radius":n["buttons-border-radius"].getPxValue(),"max-width":n["buttons-width"].getValue(),height:n["buttons-height"].getPxValue(),"background-color":n["buttons-background-color"].getColorValue(),color:n["buttons-font-color"].getColorValue(),"font-size":n["buttons-font-size"].getPxValue()}),n["buttons-width"].getValue().length&&r.buttons.css("width","100%"),0<n["buttons-border-width"].getValue()&&r.buttons.css("border-style","solid"),n["buttons-background-color"].getColorValue().length?(r.buttons.css({"background-image":"none",filter:"none"}),t=d(n["buttons-background-color"].getColorValue(),-20),n["buttons-hover-background-color"].setValue(t)):n["buttons-hover-background-color"].setValue(""),n["buttons-border-color"].getColorValue().length?(t=d(n["buttons-border-color"].getColorValue(),-20),n["buttons-hover-border-color"].setValue(t)):n["buttons-hover-border-color"].setValue(""),r.messages.filter(".mc4wp-success").css({color:n["messages-font-color-success"].getColorValue()}),r.messages.filter(".mc4wp-error").css({color:n["messages-font-color-error"].getColorValue()}),r.css.html(n["manual-css"].getValue())}function l(){r.buttons.css("background-color",n["buttons-hover-background-color"].getColorValue()),r.buttons.css("border-color",n["buttons-hover-border-color"].getColorValue())}function s(){r.buttons.css({"border-color":n["buttons-border-color"].getColorValue(),"background-color":n["buttons-background-color"].getColorValue()})}function i(){n["fields-focus-outline-color"].getColorValue().length?r.fields.css("outline","2px solid "+n["fields-focus-outline-color"].getColorValue()):c()}function c(){r.fields.css("outline","")}return u(".mc4wp-option").on("input change",t),u(".color-field").wpColorPicker({change:function(){window.setTimeout(t,10)},clear:t}),{init:function(){var e=o.contents().find(".mc4wp-form"),t=e.find(".mc4wp-form-fields");(r={form:e,labels:t.find("label"),fields:t.find('input[type="text"], input[type="email"], input[type="url"], input[type="number"], input[type="date"], select, textarea'),choices:t.find('input[type="radio"], input[type="checkbox"]'),buttons:t.find('input[type="submit"], input[type="button"], button'),messages:e.find(".mc4wp-alert"),css:o.contents().find("#custom-css")}).fields.focus(i),r.fields.focusout(c),r.buttons.hover(l,s)},applyStyles:t}}},{"./_option.js":4}],4:[function(e,t,o){"use strict";function r(e){this.element=e,this.$element=window.jQuery(e)}r.prototype.getColorValue=function(){return this.element.value=this.element.value.trim(),0<this.element.value.length?-1!==this.element.className.indexOf("wp-color-picker")?this.$element.wpColorPicker("color"):this.element.value:""},r.prototype.getPxOrPercentageValue=function(e){var t=this.element.value.trim();return 0<t.length?"px"!==t.substring(t.length-2,t.length)&&"%"!==t.substring(t.length-1,t.length)?parseInt(t)+"px":t:e||""},r.prototype.getPxValue=function(e){return this.element.value=this.element.value.trim(),0<this.element.value.length?parseInt(this.element.value)+"px":e||""},r.prototype.getValue=function(e){return this.element.value=this.element.value.trim(),0<this.element.value.length?this.element.value:e||""},r.prototype.clear=function(){this.element.value=""},r.prototype.setValue=function(e){this.element.value=e},t.exports=r},{}],5:[function(e,t,o){"use strict";var r,n=window.jQuery,l=e("./_accordion.js"),e=e("./_form-preview.js"),s=document.getElementById("mc4wp-css-preview"),i=window.send_to_editor,c=new e(s);n(s).load(function(){c.init(),c.applyStyles()}),new l(document.querySelector(".mc4wp-accordion")),n(".mc4wp-show-css").click(function(){var e=n("#mc4wp_generated_css"),e=(e.toggle(),(e.is(":visible")?"Hide":"Show")+" generated CSS");n(this).text(e)}),n(".mc4wp-form-select").change(function(){n(this).parents("form").submit()}),n(".upload-image").click(function(){r=n(this).siblings("input"),tb_show("","media-upload.php?type=image&TB_iframe=true")}),n("#form-css-settings").change(function(){this.checkValidity()}),window.send_to_editor=function(e){var t;r?(t=n(e).attr("src"),r.val(t),tb_remove()):i(e),c.applyStyles()}},{"./_accordion.js":2,"./_form-preview.js":3}]},{},[5]);PK     M\(  (  2  styles-builder/assets/src/js/_accordion-element.jsnu [        'use strict';

function AccordionElement(element) {
    this.element = element;
    this.heading = element.querySelector('h2, h3, h4');
    this.content = element.querySelector('div');

    element.setAttribute('class','accordion');
    this.heading.setAttribute('class','accordion-heading');
    this.content.setAttribute('class','accordion-content');
    this.content.style.display = 'none';
    this.heading.addEventListener('click', this.toggle.bind(this));
}

/**
 * Open this accordion
 */
AccordionElement.prototype.open = function() {
    this.toggle(true);
};

/**
 * Close this accordion
 */
AccordionElement.prototype.close = function() {
    this.toggle(false);
};

/**
 * Toggle this accordion
 *
 * @param show
 */
AccordionElement.prototype.toggle = function(show) {
    if( typeof(show) !== "boolean" ) {
        show = ( this.content.offsetParent === null );
    }

    this.content.style.display = show ? 'block' : 'none';
    this.element.className = 'accordion ' + ( ( show ) ? 'expanded' : 'collapsed' );
};

module.exports = AccordionElement;PK     M\vR  R  '  styles-builder/assets/src/js/_option.jsnu [        'use strict';

var Option = function( element ) {
	this.element = element;
	this.$element = window.jQuery(element);
};

Option.prototype.getColorValue = function() {
	this.element.value = this.element.value.trim();

	if( this.element.value.length > 0 ) {
		if( this.element.className.indexOf('wp-color-picker') !== -1) {
			return this.$element.wpColorPicker('color');
		} else {
			return this.element.value;
		}
	}

	return '';
};

Option.prototype.getPxOrPercentageValue = function(fallback) {
	var value = this.element.value.trim();

	if( value.length > 0 ) {
		if( value.substring(value.length-2, value.length) !== 'px' && value.substring(value.length-1, value.length) !== '%') {
			value = parseInt(value) + 'px';
		}
		return value;
	}

	return fallback || '';
};

Option.prototype.getPxValue = function(fallback) {
	this.element.value = this.element.value.trim();

	if( this.element.value.length > 0 ) {
		return parseInt( this.element.value ) + "px";
	}

	return fallback || '';
};

Option.prototype.getValue = function(fallback) {
	this.element.value = this.element.value.trim();

	if( this.element.value.length > 0 ) {
		return this.element.value;
	}

	return fallback || '';
};

Option.prototype.clear = function() {
	this.element.value = '';
};

Option.prototype.setValue = function(value) {
	this.element.value = value;
};

module.exports = Option;PK     M\C0"  0"  -  styles-builder/assets/src/js/_form-preview.jsnu [        'use strict';

var Option = require('./_option.js'),
	$ = window.jQuery;

function lightenColor(col, amt) {

	var usePound = false;

	if (col[0] == "#") {
		col = col.slice(1);
		usePound = true;
	}

	var num = parseInt(col,16);

	var r = (num >> 16) + amt;

	if (r > 255) r = 255;
	else if  (r < 0) r = 0;

	var b = ((num >> 8) & 0x00FF) + amt;

	if (b > 255) b = 255;
	else if  (b < 0) b = 0;

	var g = (num & 0x0000FF) + amt;

	if (g > 255) g = 255;
	else if (g < 0) g = 0;

	return (usePound?"#":"") + String("000000" + (g | (b << 8) | (r << 16)).toString(16)).slice(-6);
}


var FormPreview = function(context) {
	var $context = $(context),
		$elements;

	// create option elements
	var options = createOptions();

	// attach events
	$(".mc4wp-option").on('input change', applyStyles);
	$('.color-field').wpColorPicker({
		change: function() {
			window.setTimeout(applyStyles, 10);
		},
		clear: applyStyles
	});

	// initialize form preview
	function init() {
		var $form = $context.contents().find('.mc4wp-form');
		var $fields = $form.find('.mc4wp-form-fields');

		$elements = {
			form: $form,
			labels: $fields.find('label'),
			fields: $fields.find('input[type="text"], input[type="email"], input[type="url"], input[type="number"], input[type="date"], select, textarea'),
			choices: $fields.find('input[type="radio"], input[type="checkbox"]'),
			buttons: $fields.find('input[type="submit"], input[type="button"], button'),
			messages: $form.find('.mc4wp-alert'),
			css: $context.contents().find('#custom-css')
		};

		// apply custom styles to fields (focus)
		$elements.fields.focus(setFieldFocusStyles);
		$elements.fields.focusout(setDefaultFieldStyles);

		// apply custom styles to buttons (hover)
		$elements.buttons.hover(setButtonHoverStyles, setDefaultButtonStyles);
	}

	// create option elements from HTML elements
	function createOptions() {
		var optionElements = document.querySelectorAll('.mc4wp-option');
		var options = {};

		for( var i=0; i<optionElements.length; i++ ) {
			options[ optionElements[i].id ] = new Option( optionElements[i] );
		}

		return options;
	}

	function clearStyles() {
		$elements.form.removeAttr('style');
		$elements.labels.removeAttr('style');
		$elements.fields.removeAttr('style');
		$elements.buttons.removeAttr('style');
		$elements.choices.removeAttr('style');
		$elements.messages.removeAttr('style');
	}

	function applyStyles() {

		$elements.choices.css({
			'display': 'inline-block',
			'margin-right': '6px'
		});

		$elements.buttons.css({
			"text-align": "center",
			"cursor": "pointer",
			"padding": "6px 12px",
			"text-shadow": "none",
			"box-sizing": "border-box",
			"line-height": "normal",
			"vertical-align": "top"
		});

		// apply custom styles to form
		$elements.form.css({
			'max-width': options["form-width"].getPxOrPercentageValue(),
			'text-align': options["form-text-align"].getValue(),
			'font-size': options["form-font-size"].getPxValue(),
			"color": options["form-font-color"].getColorValue(),
			"background-color": options["form-background-color"].getColorValue(),
			"border-color": options["form-border-color"].getColorValue(),
			"border-width": options["form-border-width"].getPxValue(),
			"padding": options["form-padding"].getPxValue()
		});

		// responsive form width
		if( options["form-width"].getValue().length > 0 ) {
			$elements.form.css('width', '100%');
		}

		// set background image (if set, otherwise reset)
		if( options["form-background-image"].getValue().length > 0 ) {
			$elements.form.css('background-image', 'url("' + options["form-background-image"].getValue() + '")');

			
			var bgRepeat = options["form-background-repeat"].getValue();
			var property = (['cover'].indexOf(bgRepeat) > -1) ? 'background-size' : 'background-repeat';
			$elements.form.css(property, bgRepeat);
		} else {
			$elements.form.css('background-image', 'initial');
			$elements.form.css('background-repeat','');
			$elements.form.css('background-size','');
		}

		if( options["form-border-width"].getValue() > 0 ) {
			$elements.form.css( 'border-style', 'solid' );
		}

		// apply custom styles to labels
		$elements.labels.css({
			"margin-bottom": "6px",
			"box-sizing": "border-box",
			"vertical-align": "top",
			"color": options["labels-font-color"].getColorValue(),
			"font-size": options["labels-font-size"].getPxValue(),
			"display": options["labels-display"].getValue(),
			"max-width": options["labels-width"].getPxOrPercentageValue()
		});

		// responsive label width
		if( options["labels-width"].getValue().length > 0 ) {
			$elements.labels.css('width', '100%');
		}

		// reset font style of <span> elements inside <label> elements
		$elements.labels.find('span').css('font-weight', 'normal' );

		// only set label text style if it's set
		var labelsFontStyle = options["labels-font-style"].getValue();
		if( labelsFontStyle.length > 0 ) {
			$elements.labels.css({
				"font-weight": (labelsFontStyle == 'bold' || labelsFontStyle == 'bolditalic') ? 'bold' : 'normal',
				"font-style": (labelsFontStyle == 'italic' || labelsFontStyle == 'bolditalic') ? 'italic' : 'normal'
			});
		}

		// apply custom styles to inputs
		$elements.fields.css({
			"padding": '6px 12px',
			"margin-bottom": "6px",
			"box-sizing": "border-box",
			"vertical-align": "top",
			"border-width": options["fields-border-width"].getPxValue(),
			"border-color": options["fields-border-color"].getColorValue(),
			"border-radius": options["fields-border-radius"].getPxValue(),
			"display": options["fields-display"].getValue(),
			"max-width": options["fields-width"].getPxOrPercentageValue(),
			"height": options["fields-height"].getPxValue()
		});

		// responsive field width
		if( options["fields-width"].getValue().length > 0 ) {
			$elements.fields.css('width', '100%');
		}

		// apply custom styles to buttons
		$elements.buttons.css({
			'border-width': options["buttons-border-width"].getPxValue(),
			'border-color': options["buttons-border-color"].getColorValue(),
			"border-radius": options["buttons-border-radius"].getPxValue(),
			'max-width': options["buttons-width"].getValue(),
			'height': options["buttons-height"].getPxValue(),
			'background-color': options["buttons-background-color"].getColorValue(),
			'color': options["buttons-font-color"].getColorValue(),
			'font-size': options["buttons-font-size"].getPxValue()
		});

		// responsive buttons width
		if( options["buttons-width"].getValue().length ) {
			$elements.buttons.css('width', '100%');
		}

		// add border style if border-width is set and bigger than 0
		if( options["buttons-border-width"].getValue() > 0 ) {
			$elements.buttons.css( 'border-style', 'solid' );
		}

		// add background reset if custom button background was set
		if( options["buttons-background-color"].getColorValue().length ) {
			$elements.buttons.css({
				"background-image": "none",
				"filter": "none"
			});

			// calculate hover color
			var hoverColor = lightenColor( options["buttons-background-color"].getColorValue(), -20 );
			options["buttons-hover-background-color"].setValue(hoverColor);
		} else {
			options["buttons-hover-background-color"].setValue('');
		}

		if( options["buttons-border-color"].getColorValue().length ) {
			var hoverColor = lightenColor( options["buttons-border-color"].getColorValue(), -20 );
			options["buttons-hover-border-color"].setValue(hoverColor);
		} else {
			options["buttons-hover-border-color"].setValue('');
		}

		// apply custom styles to messages
		$elements.messages.filter('.mc4wp-success').css({
			'color': options["messages-font-color-success"].getColorValue()
		});

		$elements.messages.filter('.mc4wp-error').css({
			'color': options["messages-font-color-error"].getColorValue()
		});

		// print custom css in container element
		$elements.css.html(options["manual-css"].getValue());
	}

	function setButtonHoverStyles() {
		// calculate darker color
		$elements.buttons.css('background-color', options["buttons-hover-background-color"].getColorValue() );
		$elements.buttons.css('border-color', options["buttons-hover-border-color"].getColorValue() );
	}

	function setDefaultButtonStyles() {
		$elements.buttons.css({
			'border-color': options["buttons-border-color"].getColorValue(),
			'background-color': options["buttons-background-color"].getColorValue()
		});
	}

	function setFieldFocusStyles() {
		if( options["fields-focus-outline-color"].getColorValue().length ) {
			$elements.fields.css('outline', '2px solid ' + options["fields-focus-outline-color"].getColorValue() );
		} else {
			setDefaultFieldStyles();
		}
	}

	function setDefaultFieldStyles() {
		$elements.fields.css('outline', '' );
	}

	return {
		init: init,
		applyStyles: applyStyles
	}

};


module.exports = FormPreview;
PK     M\    .  styles-builder/assets/src/js/styles-builder.jsnu [        'use strict';

var $ = window.jQuery;
var Accordion = require('./_accordion.js');
var FormPreview = require('./_form-preview.js');

var iframeElement = document.getElementById('mc4wp-css-preview');
var preview;
var $imageUploadTarget;
var original_send_to_editor = window.send_to_editor;
var accordion;

// init
preview = new FormPreview( iframeElement );
$(iframeElement).load(function() {
	preview.init();
	preview.applyStyles();
});

// turn settings page into accordion
accordion = new Accordion(document.querySelector('.mc4wp-accordion'));

// show generated CSS button
$(".mc4wp-show-css").click(function() {
	var $generatedCss = $("#mc4wp_generated_css");
	$generatedCss.toggle();
	var text = ( $generatedCss.is(':visible') ? 'Hide' : 'Show' ) + " generated CSS";
	$(this).text(text);
});

$(".mc4wp-form-select").change( function() {
	$(this).parents('form').submit();
});

// show thickbox when clicking on "upload-image" buttons
$(".upload-image").click( function() {
	$imageUploadTarget = $(this).siblings('input');
	tb_show('', 'media-upload.php?type=image&TB_iframe=true');
});

$("#form-css-settings").change(function() {
	this.checkValidity();
})

// attach handler to "send to editor" button
window.send_to_editor = function(html){
	if( $imageUploadTarget ) {
		var imgurl = $(html).attr('src'); // $('img',html).attr('src');
		$imageUploadTarget.val(imgurl);
		tb_remove();
	} else {
		original_send_to_editor(html);
	}

	preview.applyStyles();
};
PK     M\0O    *  styles-builder/assets/src/js/_accordion.jsnu [        'use strict';

var AccordionElement = require('./_accordion-element.js');

function Accordion(element) {

	var accordions = [],
		accordionElements;

	// add class to container
	element.className+= " accordion-container";

	// find accordion blocks
	accordionElements = element.children;

	// hide all content blocks
	for( var i=0; i < accordionElements.length; i++) {

		// only act on direct <div> children
		if( accordionElements[i].tagName.toUpperCase() !== 'DIV' ) {
			continue;
		}

		// create new accordion
		var acEl = new AccordionElement(accordionElements[i]);

		// add to list of accordions
		accordions.push(acEl);
	}

	// open first accordion
	accordions[0].open();
}

module.exports = Accordion;PK     M\O$:    +  styles-builder/assets/src/css/admin.css.mapnu [        {
"version": 3,
"mappings": "AAEC,iCAAqB;EACpB,MAAM,EAAE,cAAc;EACtB,UAAU,EAAE,KAAK;AAGlB,+BAAmB;EAClB,KAAK,EAAE,OAAO;EACd,gBAAgB,EAAE,IAAI;EACtB,aAAa,EAAE,iBAAiB;EAChC,OAAO,EAAE,mBAAmB;EAC5B,WAAW,EAAE,IAAI;EACjB,MAAM,EAAE,OAAO;EACf,QAAQ,EAAE,QAAQ;EAClB,MAAM,EAAE,CAAC;EACT,SAAS,EAAE,IAAI;AAGhB;qCACyB;EACxB,KAAK,EAAE,OAAO;EACd,UAAU,EAAE,OAAO;AAGpB,qCAAyB;EACxB,OAAO,EAAE,OAAO;EAChB,IAAI,EAAE,yBAAyB;EAC/B,KAAK,EAAE,KAAK;EACZ,KAAK,EAAE,IAAI;AAGZ,yDAA6C;EAC5C,OAAO,EAAE,OAAO;AAGjB,+BAAmB;EAClB,OAAO,EAAE,WAAW;EACpB,aAAa,EAAE,iBAAiB;AAGjC;;kCAEsB;EACrB,UAAU,EAAC,KAAK;EAChB,OAAO,EAAE,cAAc;EACvB,QAAQ,EAAE,mBAAmB;AAG9B,0BAAc;EACb,KAAK,EAAE,IAAI;EACX,UAAU,EAAE,KAAK;EACjB,MAAM,EAAE,cAAc",
"sources": ["../sass/admin.scss"],
"names": [],
"file": "admin.css"
}
PK     M\y̒к    +  styles-builder/assets/src/css/admin.min.cssnu [        #mc4wp-admin .accordion-container{border:1px solid #ccc;background:#fff}#mc4wp-admin .accordion-heading{color:#555;background-color:#fff;border-bottom:1px solid #eee;padding:10px 10px 11px 14px;line-height:21px;cursor:pointer;position:relative;margin:0;font-size:14px}#mc4wp-admin .accordion-heading:hover,#mc4wp-admin .accordion.expanded .accordion-heading{color:#23282d;background:#f5f5f5}#mc4wp-admin .accordion-heading:after{content:'\f140';font:normal 20px/1 dashicons;float:right;right:20px}#mc4wp-admin .accordion.expanded .accordion-heading:after{content:"\f142"}#mc4wp-admin .accordion-content{padding:0 20px 20px;border-bottom:1px solid #eee}#mc4wp-admin .wp-picker-clear,#mc4wp-admin .wp-picker-holder,#mc4wp-admin .wp-picker-input-wrap{background:#fff;z-index:999!important;position:absolute!important}#mc4wp-admin .form-preview{width:100%;min-height:450px;border:1px solid #ccc}#mc4wp-admin #form-css-settings input:invalid{border-color:red}PK     M\$~    '  styles-builder/assets/src/css/admin.cssnu [        #mc4wp-admin .accordion-container {
    border: 1px solid #ccc;
    background: white;
}

#mc4wp-admin .accordion-heading {
    color: #555555;
    background-color: #fff;
    border-bottom: 1px solid #eeeeee;
    padding: 10px 10px 11px 14px;
    line-height: 21px;
    cursor: pointer;
    position: relative;
    margin: 0;
    font-size: 14px;
}

#mc4wp-admin .accordion.expanded .accordion-heading,
#mc4wp-admin .accordion-heading:hover {
    color: #23282d;
    background: #f5f5f5;
}

#mc4wp-admin .accordion-heading:after {
    content: '\f140';
    font: normal 20px/1 'dashicons';
    float: right;
    right: 20px;
}

#mc4wp-admin .accordion.expanded .accordion-heading:after {
    content: "\f142";
}

#mc4wp-admin .accordion-content {
    padding: 0 20px 20px;
    border-bottom: 1px solid #eeeeee;
}

#mc4wp-admin .wp-picker-clear,
#mc4wp-admin .wp-picker-holder,
#mc4wp-admin .wp-picker-input-wrap {
    background: white;
    z-index: 999 !important;
    position: absolute !important;
}

#mc4wp-admin .form-preview {
    width: 100%;
    min-height: 450px;
    border: 1px solid #ccc;
}

#mc4wp-admin #form-css-settings input:invalid {
    border-color: red;
}
PK     M\y̒к    '  styles-builder/assets/css/admin.min.cssnu [        #mc4wp-admin .accordion-container{border:1px solid #ccc;background:#fff}#mc4wp-admin .accordion-heading{color:#555;background-color:#fff;border-bottom:1px solid #eee;padding:10px 10px 11px 14px;line-height:21px;cursor:pointer;position:relative;margin:0;font-size:14px}#mc4wp-admin .accordion-heading:hover,#mc4wp-admin .accordion.expanded .accordion-heading{color:#23282d;background:#f5f5f5}#mc4wp-admin .accordion-heading:after{content:'\f140';font:normal 20px/1 dashicons;float:right;right:20px}#mc4wp-admin .accordion.expanded .accordion-heading:after{content:"\f142"}#mc4wp-admin .accordion-content{padding:0 20px 20px;border-bottom:1px solid #eee}#mc4wp-admin .wp-picker-clear,#mc4wp-admin .wp-picker-holder,#mc4wp-admin .wp-picker-input-wrap{background:#fff;z-index:999!important;position:absolute!important}#mc4wp-admin .form-preview{width:100%;min-height:450px;border:1px solid #ccc}#mc4wp-admin #form-css-settings input:invalid{border-color:red}PK     M\y̒к    #  styles-builder/assets/css/admin.cssnu [        #mc4wp-admin .accordion-container{border:1px solid #ccc;background:#fff}#mc4wp-admin .accordion-heading{color:#555;background-color:#fff;border-bottom:1px solid #eee;padding:10px 10px 11px 14px;line-height:21px;cursor:pointer;position:relative;margin:0;font-size:14px}#mc4wp-admin .accordion-heading:hover,#mc4wp-admin .accordion.expanded .accordion-heading{color:#23282d;background:#f5f5f5}#mc4wp-admin .accordion-heading:after{content:'\f140';font:normal 20px/1 dashicons;float:right;right:20px}#mc4wp-admin .accordion.expanded .accordion-heading:after{content:"\f142"}#mc4wp-admin .accordion-content{padding:0 20px 20px;border-bottom:1px solid #eee}#mc4wp-admin .wp-picker-clear,#mc4wp-admin .wp-picker-holder,#mc4wp-admin .wp-picker-input-wrap{background:#fff;z-index:999!important;position:absolute!important}#mc4wp-admin .form-preview{width:100%;min-height:450px;border:1px solid #ccc}#mc4wp-admin #form-css-settings input:invalid{border-color:red}PK     M\e5      !  styles-builder/styles-builder.phpnu [        <?php

defined('ABSPATH') or exit;

if (is_admin() && (!defined('DOING_AJAX') || !DOING_AJAX)) {
    $admin = new MC4WP_Styles_Builder_Admin(__FILE__);
    $admin->add_hooks();
}

$public = new MC4WP_Styles_Builder_Public();
$public->add_hooks();
PK     M\^"    #  styles-builder/views/css-styles.phpnu [        <?php
defined('ABSPATH') or exit;

/** @var MC4WP_Styles_Builder $builder */
$builder = $this;
$selector = $selector_prefix . $form_selector;

printf("/* form #%d */\n", $form_id);
echo "$selector label, \n";
echo "$selector input, \n";
echo "$selector textarea, \n";
echo "$selector select, \n";
echo "$selector button {\n";
    echo "\t-webkit-box-sizing: border-box;\n";
    echo "\t-moz-box-sizing: border-box;\n";
    echo "\tbox-sizing: border-box;\n";
echo "}\n\n";


/**
 * Form Elements
 */
if ($builder->form_has_rules_for_element($form_id, 'form')) {
    echo "$selector {\n";
    echo "\tdisplay: block;\n";
    $builder->maybe_echo("\tborder-color: %s; \n", $form_border_color);
    $builder->maybe_echo("\tborder-style: solid; border-width: %dpx;\n", $form_border_width);
    $builder->maybe_echo("\tpadding: %dpx;\n", $form_padding);
    $builder->maybe_echo("\tbackground-color: %s !important;\n", $form_background_color);
    $builder->maybe_echo("\tcolor: %s !important;\n", $form_font_color);
    $builder->maybe_echo("\ttext-align: %s;\n", $form_text_align);
    $builder->maybe_echo("\twidth: 100%%; max-width: %s !important;\n", $form_width);
    $builder->maybe_echo("\tbackground-image: url('%s');\n", $form_background_image);

    if (in_array($form_background_repeat, array( 'cover' ))) {
        echo sprintf("\tbackground-size: %s;\n", $form_background_repeat);
    } else {
        $builder->maybe_echo("\tbackground-repeat: %s;\n", $form_background_repeat);
    }
        
    echo "}\n\n";
}

/**
 * Label Elements
 */
if ($builder->form_has_rules_for_element($form_id, 'labels')) {
    echo "$selector label {\n";
    echo "\tvertical-align: top;\n";
    echo "\tmargin-bottom: 6px;\n";
    $builder->maybe_echo("\twidth: %s;\n", $labels_width);
    $builder->maybe_echo("\tcolor: %s;\n", $labels_font_color);
    $builder->maybe_echo("\tfont-size: %dpx;\n", $labels_font_size);
    $builder->maybe_echo("\tdisplay: %s;\n", $labels_display);

    if (! empty($labels_font_style)) {
        if ($labels_font_style === 'italic' || $labels_font_style === 'bolditalic') {
            echo "\tfont-style: italic;\n";
        } else {
            echo "\tfont-style: normal;\n";
        }

        if ($labels_font_style === 'bold' || $labels_font_style === 'bolditalic') {
            echo "\tfont-weight: bold;\n";
        } else {
            echo "\tfont-weight: normal;\n";
        }
    }
    echo "}\n\n";

    // reset <span> elements inside <label> tag (choice HTML)
    if ($labels_font_style === 'bold' || $labels_font_style === 'bolditalic') {
        echo "$selector label span { font-weight: initial; }\n\n";
    }

    if ($labels_font_style === 'italic' || $labels_font_style === 'bolditalic') {
        echo "$selector label span { font-style: initial; }\n\n";
    }
}


/**
 * Input, Select & Textarea Elements
 */
if ($builder->form_has_rules_for_element($form_id, 'fields')) :


    echo "$selector input[type='text'],\n";
    echo "$selector input[type='email'],\n";
    echo "$selector input[type='url'],\n";
    echo "$selector input[type='tel'],\n";
    echo "$selector input[type='number'],\n";
    echo "$selector input[type='date'],\n";
    echo "$selector select,\n";
    echo "$selector textarea {\n";

        // start field rules
        echo "\tvertical-align: top;\n";
        echo "\tmargin-bottom: 6px;\n";
        echo "\tpadding: 6px 12px;\n";
        $builder->maybe_echo("\twidth: 100%%; max-width: %s;\n", $fields_width);
        $builder->maybe_echo("\tborder-color: %s !important;\n", $fields_border_color);
        $builder->maybe_echo("\tborder-width: %dpx; border-style: solid;\n", $fields_border_width);
        $builder->maybe_echo("\tdisplay: %s;\n", $fields_display);
        if (! empty($fields_border_radius)) {
            echo "\t-webkit-border-radius: {$fields_border_radius}px;\n";
            echo "\t-moz-border-radius: {$fields_border_radius}px;\n";
            echo "\tborder-radius: {$fields_border_radius}px;\n";
        }
        if (! empty($fields_height)) {
            echo "\theight: {$fields_height}px;\n";
        }

    echo "}\n\n";

endif;

/**
 * Input, Select & Textarea Elements (focus)
 */
if ($builder->form_has_rules_for_element($form_id, 'fields_focus')) :
    echo "$selector input[type='text']:focus,\n";
    echo "$selector input[type='email']:focus,\n";
    echo "$selector input[type='url']:focus,\n";
    echo "$selector input[type='tel']:focus,\n";
    echo "$selector input[type='number']:focus,\n";
    echo "$selector input[type='date']:focus,\n";
    echo "$selector select:focus,\n";
    echo "$selector textarea:focus {\n";
        $builder->maybe_echo("\toutline: 2px solid %s;\n", $fields_focus_outline_color);
    echo "}\n\n";
endif;


/**
 * Choice Elements
 */
echo "$selector input[type='radio'],\n";
echo "$selector input[type='checkbox'] {\n";
    echo "\tmargin-right: 6px;\n";
    echo "\tdisplay: inline-block\n";
echo "}\n\n";


/**
 * Button Elements
 */
if ($builder->form_has_rules_for_element($form_id, 'buttons')) {
    echo "$selector input[type='submit'],\n";
    echo "$selector input[type='button'],\n";
    echo "$selector input[type='reset'],\n";
    echo "$selector button {\n";
    echo "\tvertical-align: top;\n";
    echo "\ttext-shadow: none;\n";
    echo "\tpadding: 6px 12px;\n";
    echo "\tcursor: pointer;\n";
    echo "\ttext-align: center;\n";
    echo "\tline-height: normal;\n";
    echo "\tdisplay: inline-block;\n";
    $builder->maybe_echo("\tbackground:none; filter: none; background-color: %s !important;\n", $buttons_background_color);
    $builder->maybe_echo("\tcolor: %s !important;\n", $buttons_font_color);
    $builder->maybe_echo("\tfont-size: %dpx !important;\n", $buttons_font_size);
    $builder->maybe_echo("\tborder-color: %s !important;\n", $buttons_border_color);
    $builder->maybe_echo("\twidth: 100%%; max-width: %s;\n", $buttons_width);
    $builder->maybe_echo("\theight: %dpx;\n", $buttons_height);

    if (! empty($buttons_border_width)) {
        echo "\tborder-style: solid;\n";
        echo "\tborder-width: {$buttons_border_width}px;\n";
    }
    if (! empty($buttons_border_radius)) {
        echo "\t-webkit-border-radius: {$buttons_border_radius}px;\n";
        echo "\t-moz-border-radius: {$buttons_border_radius}px;\n";
        echo "\tborder-radius: {$buttons_border_radius}px;\n";
    }

    // to fix IOS Mobile Safari adding rounded corners & gradient.
    echo "\t-webkit-appearance: none;\n";

    echo "}\n\n";
}

/**
 * Button Elements (hover & focus)
 */
if ($builder->form_has_rules_for_element($form_id, 'buttons_hover')) {
    echo "$selector input[type='submit']:focus,\n";
    echo "$selector input[type='button']:focus,\n";
    echo "$selector input[type='reset']:focus,\n";
    echo "$selector button:focus,\n";
    echo "$selector input[type='submit']:hover,\n";
    echo "$selector input[type='button']:hover,\n";
    echo "$selector input[type='reset']:hover,\n";
    echo "$selector button:hover {\n";
    $builder->maybe_echo("\tbackground:none; filter: none; background-color: %s !important;\n", $buttons_hover_background_color);
    $builder->maybe_echo("\tborder-color: %s !important;\n", $buttons_hover_border_color);
    echo "}";
}


/**
 * Form Messages
 */
if ($builder->form_has_rules_for_element($form_id, 'messages')) {
    $builder->maybe_echo("$selector .mc4wp-success p{\n\tcolor: %s;\n}", $messages_font_color_success);
    $builder->maybe_echo("$selector .mc4wp-notice p{\n\tcolor: %s;\n}", $messages_font_color_notice);
    $builder->maybe_echo("$selector .mc4wp-error p{\n\tcolor: %s;\n}", $messages_font_color_error);
}

/**
 * Manual CSS
 */
echo $manual;
PK     M\Ǿb1    %  styles-builder/views/form-preview.phpnu [        <?php
defined('ABSPATH') or exit;

// prevent caching, declare constants
if (! defined('DONOTCACHEPAGE')) {
    define('DONOTCACHEPAGE', true);
}

if (! defined('DONOTMINIFY')) {
    define('DONOTMINIFY', true);
}

if (! defined('DONOTCDN')) {
    define('DONOTCDN', true);
}

// render simple page with form in it.
?><!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
	<link type="text/css" rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" />
	<?php wp_head(); ?>
    
    <style type="text/css">
        html, 
        body{ 
            min-height: 100% !important; 
            height: auto !important; 
        }

        body{ 
            background:white;
            width: 100%;
	        max-width: 100%;
         }

        /* hide other elements */
        body > *:not(#form-preview),
        #blackbox-web-debug, 
        #wpadminbar{ 
            display:none !important; 
        }

        #form-preview {
	        display: block !important;
	        width: 100%;
	        height: 100%;
	        padding: 20px;
        }
    </style>

	<!-- Container for custom CSS created by the Styles Builder interface -->
    <style type="text/css" id="custom-css"></style>

    <!--[if IE]>
        <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
</head>
<body <?php body_class(); ?>>
	<div id="form-preview">
		<?php mc4wp_show_form(absint($_GET['form_id'])); ?>
	</div>
	<?php wp_footer(); ?>
</body>
</html>
PK     M\`  `  '  styles-builder/views/styles-builder.phpnu [        <?php defined('ABSPATH') or exit;

/** @var MC4WP_Styles_Builder $builder */
$form_id = esc_attr( $form_id );
?>
<style>#mc4wp-admin label{ font-weight: bold; display: block; }</style>

<div id="mc4wp-admin" class="wrap mc4wp-settings">

	<p class="mc4wp-breadcrumbs">
		<span class="prefix"><?php echo __('You are here: ', 'mailchimp-for-wp'); ?></span>
		<a href="<?php echo admin_url('admin.php?page=mailchimp-for-wp'); ?>">Mailchimp for WordPress</a> &rsaquo;
		<a href="<?php echo admin_url('admin.php?page=mailchimp-for-wp-forms'); ?>"><?php _e('Forms', 'mailchimp-for-wp'); ?></a> &rsaquo;
		<a href="<?php echo admin_url('admin.php?page=mailchimp-for-wp-forms&form_id=' . $form_id . '&view=edit-form'); ?>">Form <?php echo $form_id; ?> | <?php echo esc_html($form->name); ?></a> &rsaquo;
		<span class="current-crumb"><strong><?php _e('Styles Builder', 'mailchimp-for-wp'); ?></strong></span>
	</p>

	<h1 class="mc4wp-page-title">
		<?php _e('Styles Builder', 'mailchimp-for-wordpress'); ?>
	</h1>

    <?php

    if ($form->settings['css'] !== 'styles-builder') {
        echo '<div class="notice notice-warning"><p>';
        echo sprintf(__('Your form is not yet configured to load the styles showing here. Select <a href="%s">"Use Styles Builder" in the form appearance settings</a> if you want to use these styles on your website.', 'mailchimp-for-wp'), mc4wp_get_edit_form_url($form_id, 'appearance'));
        echo '</p></div>';
    }
    ?>

	<div class="mc4wp-row mc4wp-margin-s">
		<div class="main-content mc4wp-col mc4wp-col-3">
			<!-- Main Content -->

			<p>
				<?php _e('Use the fields below to create custom styling rules for your forms.', 'mailchimp-for-wp'); ?>
			</p>


			<form action="" method="get">
				<table class="form-table">
					<tr valign="top">
						<th style="width: 250px"><label><?php _e('Select form to build styles for:', 'mailchimp-for-wp'); ?></label></th>
						<td>
							<select name="form_id" class="widefat mc4wp-form-select">
								<?php foreach ($forms as $form) { ?>
									<option value="<?php echo $form->ID; ?>" <?php selected($form->ID, $form_id); ?>><?php printf('%d | %s', $form->ID, esc_html($form->name)); ?></option>
								<?php } ?>
							</select>
						</td>
					</tr>
				</table>

				<input type="hidden" name="page" value="<?php echo esc_attr($_GET['page']); ?>">
				<input type="hidden" name="view" value="<?php echo esc_attr($_GET['view']); ?>">
				<input type="submit" value="Apply" style="display: none;" />
			</form>

			<form action="" method="post" id="form-css-settings">
				<input type="hidden" name="_mc4wp_action" value="styles_builder_save" />
				<?php wp_nonce_field( '_mc4wp_action', '_wpnonce' ); ?>
				<input type="hidden" name="form_id" value="<?php echo $form_id; ?>" />
				<input type="submit" name="submit" class="button button-primary" value="Build CSS File" style="display: none;">

				<noscript><p><?php _e('You need to have JavaScript enabled to see a preview of your form.', 'mailchimp-for-wp'); ?></p></noscript>

				<div class="mc4wp-css-settings mc4wp-accordion" id="mc4wp-css-form">

					<div>
						<h4><?php _e('Form container style', 'mailchimp-for-wp'); ?></h4>
						<div>
							<div class="mc4wp-row mc4wp-margin-s">
								<div class="mc4wp-col mc4wp-col-3">
									<label for="form-width"><?php _e('Form width', 'mailchimp-for-wp'); ?></label>
									<input id="form-width" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][form_width]" type="text" value="<?php echo esc_attr($styles['form_width']); ?>" class="mc4wp-option" pattern="((\d+)(px|%)*)" />
									<span class="description block"><?php _e('px or %', 'mailchimp-for-wp'); ?></span>
								</div>
								<div class="mc4wp-col mc4wp-col-3">
									<label for="form-text-align"><?php _e('Text alignment', 'mailchimp-for-wp'); ?></label>
									<select name="mc4wp_form_styles[form-<?php echo $form_id; ?>][form_text_align]" id="form-text-align" class="mc4wp-option">
										<option value="" <?php selected($styles['form_text_align'], ''); ?>><?php _e('Choose alignment', 'mailchimp-for-wp'); ?></option>
										<option value="left" <?php selected($styles['form_text_align'], 'left'); ?>><?php _e('Left', 'mailchimp-for-wp'); ?></option>
										<option value="center" <?php selected($styles['form_text_align'], 'center'); ?>><?php _e('Center', 'mailchimp-for-wp'); ?></option>
										<option value="right" <?php selected($styles['form_text_align'], 'right'); ?>><?php _e('Right', 'mailchimp-for-wp'); ?></option>
									</select>
								</div>
							</div>
							<div class="mc4wp-row mc4wp-margin-s">
								<div class="mc4wp-col mc4wp-col-3">
									<label for="form-background-color"><?php _e('Background color', 'mailchimp-for-wp'); ?></label>
									<input id="form-background-color" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][form_background_color]" type="text" class="color-field mc4wp-option" value="<?php echo esc_attr($styles['form_background_color']); ?>" />
								</div>
								<div class="mc4wp-col mc4wp-col-3">
									<label for="form-padding"><?php _e('Padding', 'mailchimp-for-wp'); ?></label>
									<input id="form-padding" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][form_padding]" type="number" class="small-text mc4wp-option" max="99" min="0" value="<?php echo esc_attr($styles['form_padding']); ?>"  /> &nbsp;
								</div>
							</div>
							<div class="mc4wp-row mc4wp-margin-s">
								<div class="mc4wp-col mc4wp-col-3">
									<label for="form-border-color"><?php _e('Border color', 'mailchimp-for-wp'); ?></label>
									<input id="form-border-color" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][form_border_color]" type="text" class="color-field mc4wp-option" value="<?php echo esc_attr($styles['form_border_color']); ?>" />
								</div>
								<div class="mc4wp-col mc4wp-col-3">
									<label for="form-border-width"><?php _e('Border width', 'mailchimp-for-wp'); ?></label>
									<input id="form-border-width" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][form_border_width]" type="number" class="small-text mc4wp-option" max="99" min="0" value="<?php echo esc_attr($styles['form_border_width']); ?>" />
								</div>
							</div>
							<div class="mc4wp-row mc4wp-margin-s">
								<div class="mc4wp-col mc4wp-col-3">
									<label for="form-font-color"><?php _e('Text color', 'mailchimp-for-wp'); ?></label>
									<input id="form-font-color" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][form_font_color]" type="text" class="color-field mc4wp-option" value="<?php echo esc_attr($styles['form_font_color']); ?>" />
								</div>
								<div class="mc4wp-col mc4wp-col-3">
									<label for="form-font-size"><?php _e('Text size', 'mailchimp-for-wp'); ?></label>
									<input id="form-font-size" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][form_font_size]" type="number" class="small-text mc4wp-option" max="99" min="0" value="<?php echo esc_attr($styles['form_font_size']); ?>"  />
								</div>
							</div>
							<div class="mc4wp-row mc4wp-margin-s">
								<div class="mc4wp-col mc4wp-col-6">
									<label for="form-background-image"><?php _e('Background image', 'mailchimp-for-wp'); ?></label>
									<input type="text" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][form_background_image]" id="form-background-image" class="mc4wp-option" value="<?php echo esc_attr($styles['form_background_image']); ?>" placeholder="http://..." />
									<input type="button" class="button upload-image" value="<?php _e('Upload Image'); ?>" />
									<br />
									<label class="screen-reader-text" for="form-background-repeat"><?php _e("Repeat background image?", 'mailchimp-for-wp'); ?></label>
									<select class="mc4wp-option" id="form-background-repeat" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][form_background_repeat]">
										<option value="repeat" <?php selected($styles['form_background_repeat'], 'repeat'); ?>><?php _e('Repeat image', 'mailchimp-for-wp'); ?></option>
										<option value="repeat-x" <?php selected($styles['form_background_repeat'], 'repeat-x'); ?>><?php _e('Repeat horizontally', 'mailchimp-for-wp'); ?></option>
										<option value="repeat-y" <?php selected($styles['form_background_repeat'], 'repeat-y'); ?>><?php _e('Repeat vertically', 'mailchimp-for-wp'); ?></option>
										<option value="no-repeat" <?php selected($styles['form_background_repeat'], 'no-repeat'); ?>><?php _e('Do not repeat', 'mailchimp-for-wp'); ?></option>
										<option value="cover" <?php selected($styles['form_background_repeat'], 'cover'); ?>><?php _e('Cover entire area', 'mailchimp-for-wp'); ?></option>
									</select>
								</div>
							</div>
							<!-- end accordion block -->
						</div>
					</div>

					<div>
						<h4><?php _e('Label styles', 'mailchimp-for-wp'); ?></h4>
						<div>

							<div class="mc4wp-row mc4wp-margin-s">
								<div class="mc4wp-col mc4wp-col-3">
									<label for="labels-width"><?php _e('Label width', 'mailchimp-for-wp'); ?></label>
									<input id="labels-width" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][labels_width]" type="text" value="<?php echo esc_attr($styles['labels_width']); ?>" class="mc4wp-option" pattern="((\d+)(px|%)*)" />
									<span class="description block"><?php _e('px or %', 'mailchimp-for-wp'); ?></span>
								</div>
								<div class="mc4wp-col mc4wp-col-3">
									<label for="labels-font-color"><?php _e('Text color', 'mailchimp-for-wp'); ?></label>
									<input id="labels-font-color" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][labels_font_color]" value="<?php echo esc_attr($styles['labels_font_color']); ?>" type="text" class="color-field mc4wp-option" />
								</div>
							</div>
							<div class="mc4wp-row mc4wp-margin-s">
								<div class="mc4wp-col mc4wp-col-3">
									<label for="labels-font-size"><?php _e('Text size', 'mailchimp-for-wp'); ?></label>
									<input id="labels-font-size" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][labels_font_size]" type="number" class="small-text mc4wp-option" max="99" min="0" value="<?php echo esc_attr($styles['labels_font_size']); ?>"  />
								</div>
								<div class="mc4wp-col mc4wp-col-3">
									<label for="labels-font-style"><?php _e('Text style', 'mailchimp-for-wp'); ?></label>
									<select id="labels-font-style" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][labels_font_style]" class="mc4wp-option">
										<option value="" <?php selected($styles['labels_font_style'], ''); ?>><?php _e('Choose text style..', 'mailchimp-for-wp'); ?></option>
										<option value="normal" <?php selected($styles['labels_font_style'], 'normal'); ?>><?php _e('Normal', 'mailchimp-for-wp'); ?></option>
										<option value="bold" <?php selected($styles['labels_font_style'], 'bold'); ?>><?php _e('Bold', 'mailchimp-for-wp'); ?></option>
										<option value="italic" <?php selected($styles['labels_font_style'], 'italic'); ?>><?php _e('Italic', 'mailchimp-for-wp'); ?></option>
										<option value="bolditalic" <?php selected($styles['labels_font_style'], 'bolditalic'); ?>><?php _e('Bold & Italic', 'mailchimp-for-wp'); ?></option>
									</select>
								</div>
							</div>
							<div class="mc4wp-row mc4wp-margin-s">
								<div class="mc4wp-col mc4wp-col-3">
									<label for="labels-display"><?php _e('Display', 'mailchimp-for-wp'); ?></label>

									<select id="labels-display" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][labels_display]" class="mc4wp-option">
										<option value=""></option>
										<option value="inline-block" <?php selected($styles['labels_display'], 'inline-block'); ?>> <?php _e('Inline', 'mailchimp-for-wp'); ?></option>
										<option value="block" <?php selected($styles['labels_display'], 'block'); ?>> <?php _e('New line', 'mailchimp-for-wp'); ?></option>
									</select>
								</div>
								<div class="mc4wp-col mc4wp-col-3">

								</div>
							</div>

							<!-- end block -->
						</div>
					</div>

					<div>
						<h4><?php _e('Field styles', 'mailchimp-for-wp'); ?></h4>
						<div>

							<div class="mc4wp-row mc4wp-margin-s">
								<div class="mc4wp-col mc4wp-col-3">
									<label for="fields-width"><?php _e('Field width', 'mailchimp-for-wp'); ?></label>
									<input id="fields-width" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][fields_width]" type="text" value="<?php echo esc_attr($styles['fields_width']); ?>" class="mc4wp-option" pattern="((\d+)(px|%)*)" />
									<span class="description block"><?php _e('px or %', 'mailchimp-for-wp'); ?></span>
								</div>
								<div class="mc4wp-col mc4wp-col-3">
									<label for="fields-height"><?php _e('Field height', 'mailchimp-for-wp'); ?></label>
									<input id="fields-height" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][fields_height]" min="0" type="number" class="small-text mc4wp-option" value="<?php echo esc_attr($styles['fields_height']); ?>" />
								</div>
							</div>
							<div class="mc4wp-row mc4wp-margin-s">
								<div class="mc4wp-col mc4wp-col-3">
									<label for="fields-border-color"><?php _e('Border color', 'mailchimp-for-wp'); ?></label>
									<input id="fields-border-color" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][fields_border_color]" type="text" class="color-field mc4wp-option" value="<?php echo esc_attr($styles['fields_border_color']); ?>" />
								</div>
								<div class="mc4wp-col mc4wp-col-3">
									<label for="fields-border-width"><?php _e('Border width', 'mailchimp-for-wp'); ?></label>
									<input id="fields-border-width" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][fields_border_width]" type="number" class="small-text mc4wp-option" max="99" min="0" value="<?php echo esc_attr($styles['fields_border_width']); ?>" />
								</div>
							</div>
							<div class="mc4wp-row mc4wp-margin-s">
								<div class="mc4wp-col mc4wp-col-3">
									<label for="fields-display"><?php _e('Display', 'mailchimp-for-wp'); ?></label>
									<select id="fields-display" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][fields_display]" class="widefat mc4wp-option">
										<option value=""></option>
										<option value="inline-block" <?php selected($styles['fields_display'], 'inline-block'); ?>> <?php _e('Inline', 'mailchimp-for-wp'); ?></option>
										<option value="block" <?php selected($styles['fields_display'], 'block'); ?>> <?php _e('New line', 'mailchimp-for-wp'); ?></option>
									</select>
								</div>
								<div class="mc4wp-col mc4wp-col-3">
									<label for="fields-border-radius"><?php _e('Border radius', 'mailchimp-for-wp'); ?></label>
									<input id="fields-border-radius" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][fields_border_radius]" type="number" class="small-text mc4wp-option" max="99" min="0" value="<?php echo esc_attr($styles['fields_border_radius']); ?>" />
								</div>
							</div>
							<div class="mc4wp-row mc4wp-margin-s">
								<div class="mc4wp-col mc4wp-col-3">
									<label for="fields-focus-outline-color"><?php _e('Focus outline', 'mailchimp-for-wp'); ?></label>
									<input id="fields-focus-outline-color" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][fields_focus_outline_color]" type="text" class="color-field mc4wp-option" value="<?php echo esc_attr($styles['fields_focus_outline_color']); ?>" />
								</div>
								<div class="mc4wp-col mc4wp-col-3">

								</div>
							</div>

							<!-- End of block -->

						</div>
					</div>

					<div>
						<h4><?php _e('Button styles', 'mailchimp-for-wp'); ?></h4>
						<div>
							<div class="mc4wp-row mc4wp-margin-s">
								<div class="mc4wp-col mc4wp-col-3">
									<label for="buttons-width"><?php _e('Button width', 'mailchimp-for-wp'); ?></label>
									<input id="buttons-width" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][buttons_width]" type="text" value="<?php echo esc_attr($styles['buttons_width']); ?>" class="mc4wp-option" pattern="((\d+)(px|%)*)" />
									<span class="description block"><?php _e('px or %', 'mailchimp-for-wp'); ?></span>
								</div>
								<div class="mc4wp-col mc4wp-col-3">
									<label for="buttons-height"><?php _e('Button height', 'mailchimp-for-wp'); ?></label>
									<input id="buttons-height" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][buttons_height]" min="0" type="number" class="small-text mc4wp-option" value="<?php echo esc_attr($styles['buttons_height']); ?>" />
								</div>
							</div>
							<div class="mc4wp-row mc4wp-margin-s">
								<div class="mc4wp-col mc4wp-col-3">
									<label for="buttons-background-color"><?php _e('Background color', 'mailchimp-for-wp'); ?></label>
									<input id="buttons-background-color" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][buttons_background_color]" type="text" class="color-field mc4wp-option" value="<?php echo esc_attr($styles['buttons_background_color']); ?>" />
									<input id="buttons-hover-background-color" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][buttons_hover_background_color]" type="hidden" class="mc4wp-option" value="<?php echo esc_attr($styles['buttons_hover_background_color']); ?>" />
								</div>
								<div class="mc4wp-col mc4wp-col-3">
									<label for="buttons-border-width"><?php _e('Border width', 'mailchimp-for-wp'); ?></label>
									<input id="buttons-border-width" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][buttons_border_width]" type="number" class="small-text mc4wp-option" max="99" min="0" value="<?php echo esc_attr($styles['buttons_border_width']); ?>" />
								</div>
							</div>
							<div class="mc4wp-row mc4wp-margin-s">
								<div class="mc4wp-col mc4wp-col-3">
									<label for="buttons-border-color"><?php _e('Border color', 'mailchimp-for-wp'); ?></label>
									<input id="buttons-border-color" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][buttons_border_color]" type="text" class="color-field mc4wp-option" value="<?php echo esc_attr($styles['buttons_border_color']); ?>" />
									<input id="buttons-hover-border-color" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][buttons_hover_border_color]" type="hidden" class="mc4wp-option" value="<?php echo esc_attr($styles['buttons_hover_border_color']); ?>" />
								</div>
								<div class="mc4wp-col mc4wp-col-3">
									<label for="buttons-border-radius"><?php _e('Border radius', 'mailchimp-for-wp'); ?></label>
									<input id="buttons-border-radius" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][buttons_border_radius]" type="number" class="small-text mc4wp-option" max="99" min="0" value="<?php echo esc_attr($styles['buttons_border_radius']); ?>" />
								</div>
							</div>
							<div class="mc4wp-row mc4wp-margin-s">
								<div class="mc4wp-col mc4wp-col-3">
									<label for="buttons-font-color"><?php _e('Text color', 'mailchimp-for-wp'); ?></label>
									<input id="buttons-font-color" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][buttons_font_color]" type="text" class="color-field mc4wp-option" value="<?php echo esc_attr($styles['buttons_font_color']); ?>" />
								</div>
								<div class="mc4wp-col mc4wp-col-3">
									<label for="buttons-font-size"><?php _e('Text size', 'mailchimp-for-wp'); ?></label>
									<input id="buttons-font-size" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][buttons_font_size]" type="number" class="small-text mc4wp-option" max="99" min="0" value="<?php echo esc_attr($styles['buttons_font_size']); ?>"  />
								</div>
							</div>

							<!-- End of block -->
						</div>
					</div>

					<div>
						<h4><?php _e('Error and success messages', 'mailchimp-for-wp'); ?></h4>
						<div>

							<div class="mc4wp-row mc4wp-margin-s">
								<div class="mc4wp-col mc4wp-col-3">
									<label for="messages-font-color-success"><?php _e('Success text color', 'mailchimp-for-wp'); ?></label>
									<input id="messages-font-color-success" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][messages_font_color_success]" type="text" class="color-field mc4wp-option" value="<?php echo esc_attr($styles['messages_font_color_success']); ?>" />

								</div>
								<div class="mc4wp-col mc4wp-col-3">
									<label for="messages-font-color-error"><?php _e('Error text color', 'mailchimp-for-wp'); ?></label>
									<input id="messages-font-color-error" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][messages_font_color_error]" type="text" class="color-field mc4wp-option" value="<?php echo esc_attr($styles['messages_font_color_error']); ?>" />
								</div>
							</div>

							<div class="mc4wp-row mc4wp-margin-s">
								<div class="mc4wp-col mc4wp-col-3">
									<label for="messages-font-color-notice"><?php _e('Notice text color', 'mailchimp-for-wp'); ?></label>
									<input id="messages-font-color-notice" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][messages_font_color_notice]" type="text" class="color-field mc4wp-option" value="<?php echo esc_attr($styles['messages_font_color_notice']); ?>" />

								</div>
							</div>
							<!-- end of block -->
						</div>
					</div>

					<div>
						<h4><?php _e('Advanced', 'mailchimp-for-wp'); ?></h4>
						<div>

							<div class="mc4wp-margin-s"></div>

							<label for="css-selector-prefix"><?php _e('CSS Selector Prefix', 'mailchimp-for-wp'); ?></label>
							<input type="text" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][selector_prefix]" value="<?php echo esc_attr($styles['selector_prefix']); ?>" placeholder="Example: #content" class="mc4wp-option" id="css-selector-prefix"/>
							<span class="description block"><?php _e('Use this to create a more specific (and thus more "important") CSS selector.', 'mailchimp-for-wp'); ?></span>

							<div class="mc4wp-margin-s"></div>

							<label for="manual-css"><?php _e('Manual CSS', 'mailchimp-for-wp'); ?></label>
							<?php $rows = substr_count($styles['manual'], PHP_EOL) + 6; ?>
							<textarea class="widefat mc4wp-option" rows="<?php echo esc_attr($rows); ?>" cols="50" name="mc4wp_form_styles[form-<?php echo $form_id; ?>][manual]" id="manual-css" placeholder="Example: .mc4wp-form { background: url('http://...'); }"><?php echo esc_textarea($styles['manual']); ?></textarea>

							<div class="mc4wp-margin-s"></div>

							<?php if (count($forms) > 1) { // only show copy feature if multiple forms exist?>
							<label for="copy_from_form_id"><?php _e('Copy styles from other form', 'mailchimp-for-wp'); ?></label>
							<select name="copy_from_form_id" id="copy_from_form_id">
								<?php foreach ($forms as $form) {
        // skip current form
                                    if ($form->ID === $form_id) {
                                        continue;
                                    } ?>
									<option value="<?php echo $form->ID; ?>"><?php printf('%d | %s', $form->ID, esc_html($form->name)); ?></option>
								<?php
    } ?>
							</select>
							<input type="submit" name="_mc4wp_copy_form_styles" value="<?php _e('Copy Styles', 'mailchimp-for-wp'); ?>" class="button-secondary" onclick="return confirm('<?php esc_attr_e('Are you sure you want to copy form styles from another form? This will overwrite current styles for this form.', 'mailchimp-for-wp'); ?>');"/>
							<?php
    } ?>
							<!-- end of block -->

						</div>
					</div>

				</div><!-- End Accordion -->

				<p class="submit">
					<?php submit_button(null, 'primary', 'submit', false); ?>
					<button type="submit" tabindex="9999" name="_mc4wp_delete_form_styles" value="<?php echo $form_id; ?>" class="button-secondary" onclick="return confirm('<?php esc_attr_e('Are you sure you want to delete all custom styles for this form?', 'mailchimp-for-wp'); ?>');"><?php _e('Delete Form Styles', 'mailchimp-for-wp'); ?></button>
				</p>

			</form>
			<!-- / Main Content -->
		</div>

		<div class="mc4wp-col mc4wp-col-3">
			<!-- Preview -->
			<h3><?php _e('Form Preview', 'mailchimp-for-wp'); ?></h3>
			<iframe class="form-preview" id="mc4wp-css-preview" data-src-url="<?php echo esc_attr($preview_url); ?>" src="<?php echo esc_attr($preview_url) ?>"></iframe>
			<!-- / Preview -->
		</div>
	</div>


	<p class="mc4wp-notice">
		<span class="dashicons dashicons-info" style="color: #999;"></span>
		<?php printf(__('Tip: have a look at our <a href="%s">knowledge base</a> articles on <a href="%s">creating an inline form</a> or <a href="%s">forms</a> in general.', 'mailchimp-for-wp'), 'https://www.mc4wp.com/kb/', 'https://www.mc4wp.com/kb/single-line-forms/', 'https://www.mc4wp.com/kb/forms/'); ?>
	</p>



</div>
PK     M\A!      styles-builder/README.mdnu [        ### Mailchimp for WordPress - Form Styles Builder

This add-on plugin for [Mailchimp for WordPress](https://www.mc4wp.com/) adds a Styles Builder. Using this Styles Builder, 
you can create stylesheets for your sign-up forms without writing a single line of CSS.PK     M\Ɵ    +  custom-color-theme/includes/class-theme.phpnu [        <?php

/**
 * Class MC4WP_Custom_Color_Theme
 *
 * @ignore
 */
class MC4WP_Custom_Color_Theme
{
    /**
     * Add hooks
     */
    public function add_hooks()
    {
        add_filter('mc4wp_form_settings', array( $this, 'add_settings' ));
        add_action('mc4wp_output_form', array( $this, 'print_css' ));
    }

    /**
     * @param $settings
     *
     * @return array
     */
    public function add_settings($settings)
    {
        $defaults = array(
            'custom_theme_color' => '#1af'
        );

        $settings = array_merge($defaults, $settings);
        return $settings;
    }

    /**
     * Print CSS
     *
     * @param MC4WP_Form $form
     * @return bool|void
     */
    public function print_css($form)
    {
        if ($form->settings['css'] !== 'form-theme-custom-color' || empty($form->settings['custom_theme_color'])) {
            return false;
        }

        $color = $form->settings['custom_theme_color'];
        $rgb_color = new MC4WP_RGB_Color($color);

        $darker_color = $rgb_color->darken(10);
        $darkest_color =  $rgb_color->darken(20);
        $font_color =  $rgb_color->lightness() > 50 ? 'black' : 'white';
        $this->print_css_template($form->ID, $color, $darker_color, $darkest_color, $font_color);
    }

    /**
     * @param int $form_id
     * @param string $color
     * @param string $darker_color
     * @param string $darkest_color
     * @param string $font_color
     */
    public function print_css_template($form_id, $color, $darker_color, $darkest_color, $font_color = 'white')
    {
        echo '<style type="text/css">';
        include __DIR__ . '/../views/custom-css.php';
        echo '</style>';
    }
}
PK     M\Ϲ    /  custom-color-theme/includes/class-rgb-color.phpnu [        <?php

class MC4WP_RGB_Color
{

    /**
     * @var number
     */
    public $r;

    /**
     * @var number
     */
    public $g;

    /**
     * @var number
     */
    public $b;

    /**
     * @var string
     */
    public $hex;

    /**
     * @param string $color Hexadecimal color value
     */
    public function __construct($color)
    {

        // create hex string of 6 chars
        $hex = str_replace('#', '', $color);
        if (strlen($hex) == 3) {
            $hex = str_repeat(substr($hex, 0, 1), 2).str_repeat(substr($hex, 1, 1), 2).str_repeat(substr($hex, 2, 1), 2);
        }

        $this->hex = '#' . $hex;

        // Get decimal values
        $this->r = hexdec(substr($hex, 0, 2));
        $this->g = hexdec(substr($hex, 2, 2));
        $this->b = hexdec(substr($hex, 4, 2));
    }

    /**
     * @param $percentage
     *
     * @return string
     */
    public function darken($percentage)
    {
        $amount = ($percentage / 100 * 255);

        $r = max(0, min(255, $this->r - $amount));
        $g = max(0, min(255, $this->g - $amount));
        $b = max(0, min(255, $this->b - $amount));

        $r_hex = str_pad(dechex($r), 2, '0', STR_PAD_LEFT);
        $g_hex = str_pad(dechex($g), 2, '0', STR_PAD_LEFT);
        $b_hex = str_pad(dechex($b), 2, '0', STR_PAD_LEFT);

        return '#'.$r_hex.$g_hex.$b_hex;
    }

    /**
     * @param $percentage
     *
     * @return string
     */
    public function lighten($percentage)
    {
        $amount = ($percentage / 100 * 255);

        $r = max(0, min(255, $this->r + $amount));
        $g = max(0, min(255, $this->g + $amount));
        $b = max(0, min(255, $this->b + $amount));

        $r_hex = str_pad(dechex($r), 2, '0', STR_PAD_LEFT);
        $g_hex = str_pad(dechex($g), 2, '0', STR_PAD_LEFT);
        $b_hex = str_pad(dechex($b), 2, '0', STR_PAD_LEFT);
        return '#'.$r_hex.$g_hex.$b_hex;
    }

    /**
     * @return float
     */
    public function lightness()
    {
        $avg = (($this->r + $this->g + $this->b) / 3);
        return $avg / 255 * 100;
    }
}
PK     M\BEHW    +  custom-color-theme/includes/class-admin.phpnu [        <?php

class MC4WP_Custom_Color_Theme_Admin
{
    /**
     * Add hooks
     */
    public function add_hooks()
    {
        add_filter('mc4wp_admin_form_css_options', array( $this, 'add_theme_option' ));
        add_action('mc4wp_admin_form_after_appearance_settings_rows', array( $this, 'add_custom_color_option' ));
        add_action('admin_enqueue_scripts', array( $this, 'enqueue_scripts' ));
        add_action('admin_print_footer_scripts', array( $this, 'admin_footer' ), 99);
    }

    /**
     * Enqueue scripts
     */
    public function enqueue_scripts()
    {
        wp_enqueue_style('wp-color-picker');
        wp_enqueue_script('wp-color-picker');
    }

    /**
     * Adds an option to the CSS dropdown.
     *
     * @param array $opts
     * @return array
     */
    public function add_theme_option($opts)
    {
        $opts['form-theme-custom-color'] = __('Custom Colored Theme', 'mailchimp-for-wp');
        return $opts;
    }

    /**
     * Adds the color option row
     *
     * @param $opts
     */
    public function add_custom_color_option($opts)
    {
        include __DIR__ . '/../views/setting.php';
    }

    /**
     * Instantiate the WP Color Picker on our fields
     */
    public function admin_footer()
    {
        ?>
		<script type="text/javascript">
          window.jQuery(document).ready(function() {
            window.jQuery('.color-field').wpColorPicker();
          });
		</script>
	<?php
    }
}
PK     M\ˌ    '  custom-color-theme/views/custom-css.phpnu [        .mc4wp-form-<?php echo $form_id; ?> input[type="submit"],
.mc4wp-form-<?php echo $form_id; ?> button {
	color: <?php echo $font_color; ?>;
	background-color: <?php echo $color; ?>;
	border-color: <?php echo $darker_color; ?>;
}

.mc4wp-form-<?php echo $form_id; ?> input[type="submit"]:hover,
.mc4wp-form-<?php echo $form_id; ?> button:hover,
.mc4wp-form-<?php echo $form_id; ?> input[type="submit"]:active,
.mc4wp-form-<?php echo $form_id; ?> button:active,
.mc4wp-form-<?php echo $form_id; ?> input[type="submit"]:focus,
.mc4wp-form-<?php echo $form_id; ?> button:focus {
	color: <?php echo $font_color; ?>;
	background-color: <?php echo $darker_color; ?>;
	border-color: <?php echo $darkest_color; ?>;
}

.mc4wp-form-<?php echo $form_id; ?> input[type="text"]:focus,
.mc4wp-form-<?php echo $form_id; ?> input[type="email"]:focus,
.mc4wp-form-<?php echo $form_id; ?> input[type="tel"]:focus,
.mc4wp-form-<?php echo $form_id; ?> input[type="date"]:focus,
.mc4wp-form-<?php echo $form_id; ?> input[type="url"]:focus,
.mc4wp-form-<?php echo $form_id; ?> textarea:focus,
.mc4wp-form-<?php echo $form_id; ?> select:focus {
	border-color: <?php echo $color; ?>;
}PK     M\va    $  custom-color-theme/views/setting.phpnu [        <?php

defined('ABSPATH') or exit;

$config = array( 'element' => 'mc4wp_form[settings][css]', 'value' => 'form-theme-custom-color' );
?>
<tr data-showif="<?php echo esc_attr(json_encode($config)); ?>">
	<th><label for="mc4wp-custom-color-input"><?php _e('Select Color', 'mailchimp-for-wp'); ?></label></th>
	<td>
		<input id="mc4wp-custom-color-input" name="mc4wp_form[settings][custom_theme_color]" type="text" class="color-field" value="<?php echo esc_attr($opts['custom_theme_color']); ?>" />
	</td>
</tr>PK     M\J0  0  )  custom-color-theme/custom-color-theme.phpnu [        <?php

defined('ABSPATH') or exit;

$custom_color_theme = new MC4WP_Custom_Color_Theme();
$custom_color_theme->add_hooks();

if (is_admin() && (! defined('DOING_AJAX') || ! DOING_AJAX)) {
    $custom_color_theme_admin = new MC4WP_Custom_Color_Theme_Admin();
    $custom_color_theme_admin->add_hooks();
}
PK     M\<5        custom-color-theme/README.mdnu [        ### Mailchimp for WordPress - Custom Color Form Theme

This add-on plugin adds a custom colored form theme option to Mailchimp for WordPress.PK     M\ԐЬ    	  README.mdnu [        ### MC4WP: Premium Bundle

This plugin contains all [premium features](https://www.mc4wp.com/features/) for [Mailchimp for WordPress](https://www.mc4wp.com/).

- AJAX Forms
- Multiple Forms
- Custom Color Form Theme
- Logging
- Statistics
- Email Notifications
- E-Commerce

Not sure how to install this plugin? Please have a look at the [installation guide](https://www.mc4wp.com/kb/installation-instructions/).

More help articles can be found in [our knowledge base](https://www.mc4wp.com/kb/) or in our [code snippets repository](https://github.com/ibericode/mc4wp-snippets).

Enjoy!

Danny, Harish & Arne
[mc4wp.com](https://www.mc4wp.com/)

Mailchimp for WordPress is a product by [ibericode](https://ibericode.com/)PK     M\!*
      autocomplete/autocomplete.phpnu [        <?php

defined( 'ABSPATH' ) or exit;

// main functionality
require_once __DIR__ . '/includes/class-autocomplete.php';
$autocomplete = new MC4WP_Autocomplete( __FILE__ );
$autocomplete->add_hooks();


if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
	require_once __DIR__ . '/includes/class-admin.php';
	$admin = new MC4WP_Autocomplete_Admin();
	$admin->add_hooks();
}
PK     M\Pc    ,  autocomplete/includes/class-autocomplete.phpnu [        <?php

/**
 * Class MC4WP_Autocomplete
 *
 * @ignore
 */
class MC4WP_Autocomplete {

	/**
	 * @var string
	 */
	protected $plugin_file;

	/**
	 * @var bool Is the script enqueued already?
	 */
	protected $is_script_enqueued = false;

	/**
	 * @param string $plugin_file
	 */
	public function __construct( $plugin_file ) {
		$this->plugin_file = $plugin_file;
	}

	public function add_hooks() {
		add_filter( 'mc4wp_form_css_classes', array( $this, 'form_css_classes' ), 10, 2 );
		add_filter( 'mc4wp_form_settings', array( $this, 'form_settings' ) );
		add_action( 'mc4wp_output_form', array( $this, 'maybe_enqueue_script' ) );
	}

	/**
	 * @param array $settings
	 *
	 * @return array
	 */
	public function form_settings( $settings ) {
		$defaults = array(
			'autocomplete' => 0
		);
		return array_merge( $defaults, $settings );
	}

	/**
	 * @param array $classes
	 * @param MC4WP_Form $form
	 *
	 * @return array
	 */
	public function form_css_classes( $classes, MC4WP_Form $form ) {
		if ( $form->settings['autocomplete'] ) {
			$classes[] = 'autocomplete';
		}

		return $classes;
	}

	/**
	 * Enqueues the AJAX script whenever a form is outputted with AJAX enabled.
	 *
	 * This also fetches the "general error" text of the first form it encounters with AJAX enabled. Not optimal, but does the trick.
	 *
	 * @param MC4WP_Form $form
	 */
	public function maybe_enqueue_script( MC4WP_Form $form ) {
		if ( ! $form->settings['autocomplete'] || $this->is_script_enqueued ) {
			return;
		}

		wp_enqueue_style( 'mc4wp-autocomplete', plugins_url( '/assets/css/autocomplete.css', $this->plugin_file ), array(), MC4WP_PREMIUM_VERSION );
		wp_enqueue_script( 'mc4wp-autocomplete', plugins_url( '/assets/js/autocomplete.js', $this->plugin_file ), array(), MC4WP_PREMIUM_VERSION, true );

		//Order decides suggestion priority, most common names on top.
		$domains = array(
			"gmail.com",
			"yahoo.com",
			"hotmail.com",
			"aol.com",
			"hotmail.co.uk",
			"hotmail.fr",
			"msn.com",
			"yahoo.fr",
			"wanadoo.fr",
			"orange.fr",
			"comcast.net",
			"yahoo.co.uk",
			"yahoo.com.br",
			"yahoo.co.in",
			"live.com",
			"rediffmail.com",
			"free.fr",
			"gmx.de",
			"web.de",
			"yandex.ru",
			"ymail.com",
			"libero.it",
			"outlook.com",
			"uol.com.br",
			"bol.com.br",
			"mail.ru",
			"cox.net",
			"hotmail.it",
			"sbcglobal.net",
			"sfr.fr",
			"live.fr",
			"verizon.net",
			"live.co.uk",
			"googlemail.com",
			"yahoo.es",
			"ig.com.br",
			"live.nl",
			"bigpond.com",
			"terra.com.br",
			"yahoo.it",
			"neuf.fr",
			"yahoo.de",
			"alice.it",
			"rocketmail.com",
			"att.net",
			"laposte.net",
			"facebook.com",
			"bellsouth.net",
			"yahoo.in",
			"hotmail.es",
			"charter.net",
			"yahoo.ca",
			"yahoo.com.au",
			"rambler.ru",
			"hotmail.de",
			"tiscali.it",
			"shaw.ca",
			"yahoo.co.jp",
			"sky.com",
			"earthlink.net",
			"optonline.net",
			"freenet.de",
			"t-online.de",
			"aliceadsl.fr",
			"virgilio.it",
			"home.nl",
			"qq.com",
			"telenet.be",
			"me.com",
			"yahoo.com.ar",
			"tiscali.co.uk",
			"yahoo.com.mx",
			"voila.fr",
			"gmx.net",
			"mail.com",
			"planet.nl",
			"tin.it",
			"live.it",
			"ntlworld.com",
			"arcor.de",
			"yahoo.co.id",
			"frontiernet.net",
			"hetnet.nl",
			"live.com.au",
			"yahoo.com.sg",
			"zonnet.nl",
			"club-internet.fr",
			"juno.com",
			"optusnet.com.au",
			"blueyonder.co.uk",
			"bluewin.ch",
			"skynet.be",
			"sympatico.ca",
			"windstream.net",
			"mac.com",
			"centurytel.net",
			"chello.nl",
			"live.ca",
			"aim.com",
			"bigpond.net.au",
			"mc4wp.com"
		);

		$domains = (array) apply_filters( 'mc4wp_forms_email_domain_suggestions', $domains );

		$vars = array(
			'domains' => $domains,
		);
		wp_localize_script( 'mc4wp-autocomplete', 'mc4wp_autocomplete_vars', $vars );
		$this->is_script_enqueued = true;
	}
}
PK     M\a    %  autocomplete/includes/class-admin.phpnu [        <?php

class MC4WP_Autocomplete_Admin {

	/**
	 * Add hooks
	 */
	public function add_hooks() {
		add_action( 'mc4wp_admin_form_after_behaviour_settings_rows', array( $this, 'show_setting' ), 10, 2 );
	}

	/**
	 * @param            $opts
	 * @param MC4WP_Form $form
	 */
	public function show_setting( $opts, $form ) {
		?>
        <tr valign="top">
            <th scope="row"><?php esc_html_e( 'Enable autocomplete for email domains?', 'mailchimp-for-wp' ); ?></th>
            <td>
                <label>
                    <input type="radio" name="mc4wp_form[settings][autocomplete]"
                           value="1" <?php checked( $opts['autocomplete'], 1 ); ?> />&rlm;
					<?php _e( 'Yes' ); ?>
                </label> &nbsp;
                <label>
                    <input type="radio" name="mc4wp_form[settings][autocomplete]"
                           value="0" <?php checked( $opts['autocomplete'], 0 ); ?> />&rlm;
					<?php _e( 'No' ); ?>
                </label> &nbsp;
                <p class="description"><?php esc_html_e( 'Select "yes" if you want to enable autocomplete for common email domains.', 'mailchimp-for-wp' ); ?></p>
            </td>
        </tr>
		<?php
	}
}
PK     M\ط    &  autocomplete/assets/js/autocomplete.jsnu [        !function r(o,i,c){function a(t,e){if(!i[t]){if(!o[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(u)return u(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}n=i[t]={exports:{}},o[t][0].call(n.exports,function(e){return a(o[t][1][e]||e)},n,n.exports,r,o,i,c)}return i[t].exports}for(var u="function"==typeof require&&require,e=0;e<c.length;e++)a(c[e]);return a}({1:[function(e,t,n){"use strict";document.addEventListener("DOMContentLoaded",function(){[].forEach.call(document.querySelectorAll('.mc4wp-form.autocomplete input[type="email"]'),function(e){function n(e){if(e){for(var t=e,n=0;n<t.length;n++)t[n].classList.remove("mc4wp-autocomplete-active");e[u=(u=u>=e.length?0:u)<0?e.length-1:u].classList.add("mc4wp-autocomplete-active")}}function i(e){for(var t=document.getElementsByClassName("mc4wp-autocomplete-items"),n=0;n<t.length;n++)e!=t[n]&&t[n].parentNode.removeChild(t[n])}var c,a,u;c=e,a=mc4wp_autocomplete_vars.domains,c.addEventListener("input",function(e){var t=this.value.indexOf("@");if(!(t<=0)){var n=this.value.substring(0,t).replaceAll(/<.*>/g,""),r=this.value.substring(t+1);if(i(),!r)return!1;u=-1;var t=document.createElement("div"),o=(t.setAttribute("id",this.id+"mc4wp-autocomplete-list"),t.setAttribute("class","mc4wp-autocomplete-items"),t.style.width=c.offsetWidth+"px",t.style.left=c.offsetLeft+"px","");a.forEach(function(e){e.substr(0,r.length).toUpperCase()===r.toUpperCase()&&(o=(o=(o=(o+="<div>")+n+"@<strong>"+e.substr(0,r.length)+"</strong>")+e.substr(r.length))+"<input type='hidden' value='"+n+"@"+e+"'></div>")}),t.innerHTML=o,this.parentNode.appendChild(t),document.querySelectorAll(".mc4wp-form #mc4wp-autocomplete-list div").forEach(function(t,e){t.addEventListener("click",function(e){c.value=t.getElementsByTagName("input")[0].value,i()})})}}),c.addEventListener("keydown",function(e){var t=(t=document.getElementById(this.id+"mc4wp-autocomplete-list"))&&t.getElementsByTagName("div");switch(e.code){case"ArrowDown":u++,n(t);break;case"ArrowUp":u--,n(t);break;case"Enter":e.preventDefault(),-1<u&&t&&t[u].click()}}),document.addEventListener("click",function(e){return i(e.target)})})},!1)},{}]},{},[1]);PK     M\    *  autocomplete/assets/src/js/autocomplete.jsnu [        document.addEventListener('DOMContentLoaded', function () {
  [].forEach.call(document.querySelectorAll('.mc4wp-form.autocomplete input[type="email"]'), (e)=>{
    mc4wpAutocomplete(e, mc4wp_autocomplete_vars.domains);
  });
}, false);

function mc4wpAutocomplete(inputEl, suggestions) {
  var mc4wpCurrentFocus;
  inputEl.addEventListener("input", function(evt) {
    const atPos = this.value.indexOf('@')
    if(atPos <= 0) {
      return;
    }

    const emailPart = this.value.substring(0, atPos).replaceAll(/<.*>/g, '');
    const domainPrefix = this.value.substring(atPos + 1);
    mc4wpCloseAllLists();
    if (!domainPrefix) { return false;}
    mc4wpCurrentFocus = -1;
    let autocompleteList = document.createElement("div");
    autocompleteList.setAttribute("id", this.id + "mc4wp-autocomplete-list");
    autocompleteList.setAttribute("class", "mc4wp-autocomplete-items");
    autocompleteList.style.width = inputEl.offsetWidth + "px";
    autocompleteList.style.left = inputEl.offsetLeft + "px";
    let autocompleteListHtml = "";
    suggestions.forEach(suggestion => {
      // only add suggestion to list if prefix matches
      if (suggestion.substr(0, domainPrefix.length).toUpperCase() !== domainPrefix.toUpperCase()) {
        return;
      }

      autocompleteListHtml+= "<div>";
      autocompleteListHtml+=  emailPart + "@" + "<strong>" + suggestion.substr(0, domainPrefix.length) + "</strong>";
      autocompleteListHtml+=  suggestion.substr(domainPrefix.length);
      autocompleteListHtml+=  "<input type='hidden' value='" + emailPart + "@" + suggestion + "'>";
      autocompleteListHtml+= "</div>";
    })

    // set HTML for list of suggestions & add to DOM
    autocompleteList.innerHTML = autocompleteListHtml;
    this.parentNode.appendChild(autocompleteList);

    document.querySelectorAll('.mc4wp-form #mc4wp-autocomplete-list div').forEach((item, index) => {
      item.addEventListener("click", function(e) {
        inputEl.value = item.getElementsByTagName("input")[0].value;
        mc4wpCloseAllLists();
      })
    });
  });
  inputEl.addEventListener("keydown", function(evt) {
    var autocompleteList = document.getElementById(this.id + "mc4wp-autocomplete-list");
    if (autocompleteList) autocompleteList = autocompleteList.getElementsByTagName("div");
    switch (evt.code) {
      case 'ArrowDown': {
        mc4wpCurrentFocus++;
        mc4wpAddActive(autocompleteList);
        break;
      }
      case 'ArrowUp': {
        mc4wpCurrentFocus--;
        mc4wpAddActive(autocompleteList);
        break;
      }
      case 'Enter': {
        evt.preventDefault();
        if (mc4wpCurrentFocus > -1) {
          if (autocompleteList) autocompleteList[mc4wpCurrentFocus].click();
        }
        break;
      }
    }
  });

  function mc4wpAddActive(autocompleteList) {
    if (!autocompleteList) return false;
    mc4wpRemoveActive(autocompleteList);
    if (mc4wpCurrentFocus >= autocompleteList.length) mc4wpCurrentFocus = 0;
    if (mc4wpCurrentFocus < 0) mc4wpCurrentFocus = (autocompleteList.length - 1);
    autocompleteList[mc4wpCurrentFocus].classList.add("mc4wp-autocomplete-active");
  }
  function mc4wpRemoveActive(autocompleteList) {
    for (var i = 0; i < autocompleteList.length; i++) {
      autocompleteList[i].classList.remove("mc4wp-autocomplete-active");
    }
  }
  function mc4wpCloseAllLists(elmnt) {
    var autocompleteList = document.getElementsByClassName("mc4wp-autocomplete-items");
    for (var i = 0; i < autocompleteList.length; i++) {
      if (elmnt != autocompleteList[i]) {
        autocompleteList[i].parentNode.removeChild(autocompleteList[i]);
      }
    }
  }
  document.addEventListener("click", evt => mc4wpCloseAllLists(evt.target));
}
PK     M\}$    ,  autocomplete/assets/src/css/autocomplete.cssnu [        .mc4wp-form.autocomplete .autocomplete {
  /*the container must be positioned relative:*/
  position: relative;
  display: inline-block;
}

.mc4wp-form.autocomplete .mc4wp-autocomplete-items {
  position: absolute;
  border: 1px solid #d4d4d4;
  border-bottom: none;
  border-top: none;
  z-index: 99;
  font-size: 80%;
  left: 0;
  right: 0;
}
.mc4wp-form.autocomplete .mc4wp-autocomplete-items div {
  padding: 10px;
  cursor: pointer;
  background-color: #fff;
  border-bottom: 1px solid #d4d4d4;
}
.mc4wp-form.autocomplete .mc4wp-autocomplete-items div:hover {
  background-color: #e9e9e9;
}
.mc4wp-form.autocomplete .mc4wp-autocomplete-active {
  background-color: DodgerBlue !important;
  color: #ffffff;
}PK     M\AY8  8  (  autocomplete/assets/css/autocomplete.cssnu [        .mc4wp-form.autocomplete .autocomplete{position:relative;display:inline-block}.mc4wp-form.autocomplete .mc4wp-autocomplete-items{position:absolute;border:1px solid #d4d4d4;border-bottom:none;border-top:none;z-index:99;font-size:80%;left:0;right:0}.mc4wp-form.autocomplete .mc4wp-autocomplete-items div{padding:10px;cursor:pointer;background-color:#fff;border-bottom:1px solid #d4d4d4}.mc4wp-form.autocomplete .mc4wp-autocomplete-items div:hover{background-color:#e9e9e9}.mc4wp-form.autocomplete .mc4wp-autocomplete-active{background-color:#1e90ff!important;color:#fff}PK     M\j1        autocomplete/README.mdnu [        ### Mailchimp for WordPress - Autocomplete

This add-on plugin adds suggests common email provider domains to Mailchimp for WordPress email field in sign-up forms.PK     M\3ٕ&p
  p
  1  post-campaign/includes/class-gutenberg-editor.phpnu [        <?php
namespace MC4WP\PostCampaign;

use Exception;

class Gutenberg_Editor {

	/**
	 * @var string
	 */
	public $file;

	/**
	 * Inject the dependencies
	 *
	 * @param string                  $file
	 */
	public function __construct( string $file ) {
		$this->file = $file;
	}

	/**
	 * Hooks
	 */
	public function hook() {
		add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_scripts' ) );
		add_action( 'wp_ajax_mc4wp_create_campaign_of_post', array( $this, 'ajax_create_campaign' ) );
		add_action( 'init', array( $this, 'register_mc4wp_meta_data' ) );
	}

	/**
	 * Register all the scripts which belong to the gutenberg editor
	 *
	 * @return void
	 */
	public function enqueue_scripts() {
		// Only enqueue script on the "edit post" screen (because Block Editor is also used for Widgets now)
		global $pagenow;
		if ( in_array( $pagenow, array( 'post.php', 'post-new.php' ), true ) === false || get_post_type() !== 'post' ) {
			return;
		}

		wp_enqueue_script(
			'mc4wp-post-campaign',
			plugins_url( SCRIPT_DEBUG ? '/dist/js/admin/post-campaign.js' : '/dist/js/admin/post-campaign.min.js', $this->file ),
			array( 'wp-plugins', 'wp-edit-post', 'wp-components' ),
			MC4WP_PREMIUM_VERSION
		);
	}

	/**
	 * Create a campaign.
	 *
	 * @return void
	 * @throws Exception in really rare cases
	 */
	public function ajax_create_campaign() {

		if ( ! current_user_can( 'edit_posts' ) ) {

			wp_send_json_error();

			return;
		}

		$post_id = intval( $_GET['post_id'] );

		$post = get_post( $post_id );

		try {
			$template_file           = sprintf( '%s/template.html', dirname( $this->file ) );
			$post_mailchimp_campaign = new Post_Mailchimp_Campaign( mc4wp_get_api_v3(), $template_file );
			$campaign                = $post_mailchimp_campaign->post_campaign( $post );

			wp_send_json_success(
				array(
				    'web_id' => $campaign->web_id,
					'id' => $campaign->id,
				)
			);
		} catch ( Exception $e ) {

			wp_send_json_error( array( 'error' => $e ) );

			mc4wp( 'log' )->warning(
				sprintf( 'Post to campaign exception: %s in %s : %s', $e->getMessage(), $e->getFile(), $e->getLine() )
			);
		}

	}

	/**
	 * Add meta data to the api.
	 *
	 * @return void
	 */
	public function register_mc4wp_meta_data() {
		register_post_meta(
			'post',
			Post_Mailchimp_Campaign::META_KEY,
			array(
				'single'       => true,
				'type'         => 'object',
				'show_in_rest' => array(
					'schema' => array(
						'type'       => 'object',
						'properties' => array(
							'id'     => array(
								'type' => 'string',
							),
							'web_id' => array(
								'type' => 'string',
							),
						),
					),
				),
			)
		);
	}
}
PK     M\p    8  post-campaign/includes/class-post-mailchimp-campaign.phpnu [        <?php
namespace MC4WP\PostCampaign;

use Exception;
use InvalidArgumentException;
use MC4WP_API_Exception;
use MC4WP_API_Resource_Not_Found_Exception;
use MC4WP_API_V3;
use MC4WP_MailChimp;
use stdClass;
use WP_Post;

/**
 * Class Ajax_Mailchimp_Campaign
 *
 * @package MC4WP\PostCampaign
 */
class Post_Mailchimp_Campaign {

    const META_KEY = 'mc4wp_mailchimp_campaign';

    const OPTION_KEY = 'mc4wp_mailchimp_template_id';

    /**
     * @var string
     */
    private $template_file;
    /**
     * @var MC4WP_API_V3
     */
    private $api;

    /**
     * Inject the dependencies
     *
     * @param MC4WP_API_V3 $api
     * @param string       $template_file
     */
    public function __construct( MC4WP_API_V3 $api, string $template_file ) {

        if ( ! file_exists( $template_file ) ) {
            throw new InvalidArgumentException( sprintf( "File %s doesn't exist, expected a existing file", $template_file ) );
        }

        $this->template_file = $template_file;
        $this->api           = $api;
    }

    /**
     * @param WP_Post $post
     *
     * @return object
     * @throws MC4WP_API_Exception
     * @throws Exception
     */
    public function post_campaign( WP_Post $post ) {
        $campaign = get_post_meta( $post->ID, self::META_KEY, true );

        if ( empty( $campaign ) ) {
            $campaign = $this->create_new_campaign_of_post( $post );
        }

        $template_id = $this->get_template_id();

        // prepare post content for campaign
        $content = sprintf('<h1>%s</h1>', $post->post_title );
        $content .= has_blocks( $post->post_content ) ? do_blocks( $post->post_content ) : wpautop( $post->post_content );
        $content = strip_shortcodes( $content );

        /**
         * Filters the campaign content.
         *
         * @param string $content
         * @param \WP_Post $post
         */
        $content = apply_filters( 'mc4wp_post_campaign_content', $content, $post );

        try {
            $this->api->update_campaign_content(
                $campaign->id,
                array(
                    'template' => array(
                        'id'       => $template_id,
                        'sections' => array(
                            'std_content00' => $content,
                        ),
                    ),
                )
            );
        } catch ( MC4WP_API_Resource_Not_Found_Exception $e ) {
            $deleted = delete_post_meta( $post->ID, self::META_KEY );

            if ( ! $deleted ) {
                throw new Exception( sprintf( 'Could not delete post meta for post %s with key %s', $post->ID, self::META_KEY ) );
            }

            $campaign = $this->post_campaign( $post );
        }

        return $campaign;
    }

    /**
     * @return int
     * @throws MC4WP_API_Exception
     */
    private function get_template_id() {
        $template_id = get_option( self::OPTION_KEY, null );

        if ( null === $template_id ) {
            $template    = $this->create_template();
            $template_id = $template->id;
        }

        return (int) $template_id;
    }


    /**
     * Create a new campaign op the post
     *
     * @param WP_Post $post
     *
     * @throws MC4WP_API_Exception
     * @throws Exception
     *
     * @return object
     */
    private function create_new_campaign_of_post( WP_Post $post ) {
        $body_parameter = array(
            'type'     => 'regular',
            'settings' => array(
                'subject_line' => $post->post_title,
                'title'        => $post->post_title,
                'template_id'  => $this->get_template_id(),
            ),
        );

        $lists = ( new MC4WP_MailChimp() )->get_lists();

        if ( is_array( $lists ) && count( $lists ) === 1 ) {
            $list = reset( $lists );

            $body_parameter['recipients'] = array(
                'list_id' => $list->id,
            );
        }

        $campaign = $this->api->add_campaign( $body_parameter );

        // Cache the meta data
        $meta_value = (object) array(
            'id'     => (string) $campaign->id,
            'web_id' => (string) $campaign->web_id,
        );

        $meta_id = update_post_meta( $post->ID, self::META_KEY, $meta_value );

        if ( false === $meta_id ) {
            throw new Exception(
                sprintf( '%s meta key could not be saved.', self::META_KEY )
            );
        }

        return $meta_value;
    }

    /**
     * Create a template in mailchimp
     *
     * @throws MC4WP_API_Exception
     * @throws Exception
     *
     * @return stdClass
     */
    private function create_template() {
        $template = file_get_contents( $this->template_file );

        if ( false === $template ) {
            throw new Exception( error_get_last() );
        }

        $template = $this->api->add_template(
            array(
                'name' => get_bloginfo( 'name' ),
                'html' => $template,
            )
        );

        $option = add_option( self::OPTION_KEY, $template->id, '', false );

        if ( false === $option ) {
            throw new Exception( sprintf( 'The option could not be saved for template %s.', $template->id ) );
        }

        return $template;
    }
}
PK     M\>0?  ?    post-campaign/template.htmlnu [        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

    <!-- Facebook sharing information tags -->
    <meta property="og:title" content="*|MC:SUBJECT|*" />

    <title>*|MC:SUBJECT|*</title>
    <style type="text/css">
        /* Client-specific Styles */
        #outlook a{padding:0;} /* Force Outlook to provide a "view in browser" button. */
        body{width:100% !important;} .ReadMsgBody{width:100%;} .ExternalClass{width:100%;} /* Force Hotmail to display emails at full width */
        body{-webkit-text-size-adjust:none;} /* Prevent Webkit platforms from changing default text sizes. */

        /* Reset Styles */
        body{margin:0; padding:0;}
        img{border:0; height:auto; line-height:100%; outline:none; text-decoration:none;}
        table td{border-collapse:collapse;}
        #backgroundTable{height:100% !important; margin:0; padding:0; width:100% !important;}

        /* Template Styles */

        /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: COMMON PAGE ELEMENTS /\/\/\/\/\/\/\/\/\/\ */

        /**
        * @tab Page
        * @section background color
        * @tip Set the background color for your email. You may want to choose one that matches your company's branding.
        * @theme page
        */
        body, #backgroundTable{
            /*@editable*/ background-color:#FAFAFA;
        }

        /**
        * @tab Page
        * @section email border
        * @tip Set the border for your email.
        */
        #templateContainer{
            /*@editable*/ border: 1px solid #DDDDDD;
        }

        /**
        * @tab Page
        * @section heading 1
        * @tip Set the styling for all first-level headings in your emails. These should be the largest of your headings.
        * @style heading 1
        */
        h1, .h1{
            /*@editable*/ color:#202020;
            display:block;
            /*@editable*/ font-family:Arial;
            /*@editable*/ font-size:34px;
            /*@editable*/ font-weight:bold;
            /*@editable*/ line-height:100%;
            margin-top:0;
            margin-right:0;
            margin-bottom:10px;
            margin-left:0;
            /*@editable*/ text-align:left;
        }

        /**
        * @tab Page
        * @section heading 2
        * @tip Set the styling for all second-level headings in your emails.
        * @style heading 2
        */
        h2, .h2{
            /*@editable*/ color:#202020;
            display:block;
            /*@editable*/ font-family:Arial;
            /*@editable*/ font-size:30px;
            /*@editable*/ font-weight:bold;
            /*@editable*/ line-height:100%;
            margin-top:0;
            margin-right:0;
            margin-bottom:10px;
            margin-left:0;
            /*@editable*/ text-align:left;
        }

        /**
        * @tab Page
        * @section heading 3
        * @tip Set the styling for all third-level headings in your emails.
        * @style heading 3
        */
        h3, .h3{
            /*@editable*/ color:#202020;
            display:block;
            /*@editable*/ font-family:Arial;
            /*@editable*/ font-size:26px;
            /*@editable*/ font-weight:bold;
            /*@editable*/ line-height:100%;
            margin-top:0;
            margin-right:0;
            margin-bottom:10px;
            margin-left:0;
            /*@editable*/ text-align:left;
        }

        /**
        * @tab Page
        * @section heading 4
        * @tip Set the styling for all fourth-level headings in your emails. These should be the smallest of your headings.
        * @style heading 4
        */
        h4, .h4{
            /*@editable*/ color:#202020;
            display:block;
            /*@editable*/ font-family:Arial;
            /*@editable*/ font-size:22px;
            /*@editable*/ font-weight:bold;
            /*@editable*/ line-height:100%;
            margin-top:0;
            margin-right:0;
            margin-bottom:10px;
            margin-left:0;
            /*@editable*/ text-align:left;
        }

        /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: HEADER /\/\/\/\/\/\/\/\/\/\ */

        /**
        * @tab Header
        * @section header style
        * @tip Set the background color and border for your email's header area.
        * @theme header
        */
        #templateHeader{
            /*@editable*/ background-color:#FFFFFF;
            /*@editable*/ border-bottom:0;
        }

        /**
        * @tab Header
        * @section header text
        * @tip Set the styling for your email's header text. Choose a size and color that is easy to read.
        */
        .headerContent{
            /*@editable*/ color:#202020;
            /*@editable*/ font-family:Arial;
            /*@editable*/ font-size:34px;
            /*@editable*/ font-weight:bold;
            /*@editable*/ line-height:100%;
            /*@editable*/ padding:0;
            /*@editable*/ text-align:center;
            /*@editable*/ vertical-align:middle;
        }

        /**
        * @tab Header
        * @section header link
        * @tip Set the styling for your email's header links. Choose a color that helps them stand out from your text.
        */
        .headerContent a:link, .headerContent a:visited, /* Yahoo! Mail Override */ .headerContent a .yshortcuts /* Yahoo! Mail Override */{
            /*@editable*/ color:#336699;
            /*@editable*/ font-weight:normal;
            /*@editable*/ text-decoration:underline;
        }

        #headerImage{
            height:auto;
            max-width:600px !important;
        }

        /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: MAIN BODY /\/\/\/\/\/\/\/\/\/\ */

        /**
        * @tab Body
        * @section body style
        * @tip Set the background color for your email's body area.
        */
        #templateContainer, .bodyContent{
            /*@editable*/ background-color:#FFFFFF;
        }

        /**
        * @tab Body
        * @section body text
        * @tip Set the styling for your email's main content text. Choose a size and color that is easy to read.
        * @theme main
        */
        .bodyContent div{
            /*@editable*/ color:#505050;
            /*@editable*/ font-family:Arial;
            /*@editable*/ font-size:14px;
            /*@editable*/ line-height:150%;
            /*@editable*/ text-align:left;
        }

        /**
        * @tab Body
        * @section body link
        * @tip Set the styling for your email's main content links. Choose a color that helps them stand out from your text.
        */
        .bodyContent div a:link, .bodyContent div a:visited, /* Yahoo! Mail Override */ .bodyContent div a .yshortcuts /* Yahoo! Mail Override */{
            /*@editable*/ color:#336699;
            /*@editable*/ font-weight:normal;
            /*@editable*/ text-decoration:underline;
        }

        .bodyContent img{
            display:inline;
            height:auto;
        }

        /* /\/\/\/\/\/\/\/\/\/\ STANDARD STYLING: FOOTER /\/\/\/\/\/\/\/\/\/\ */

        /**
        * @tab Footer
        * @section footer style
        * @tip Set the background color and top border for your email's footer area.
        * @theme footer
        */
        #templateFooter{
            /*@editable*/ background-color:#FFFFFF;
            /*@editable*/ border-top:0;
        }

        /**
        * @tab Footer
        * @section footer text
        * @tip Set the styling for your email's footer text. Choose a size and color that is easy to read.
        * @theme footer
        */
        .footerContent div{
            /*@editable*/ color:#707070;
            /*@editable*/ font-family:Arial;
            /*@editable*/ font-size:12px;
            /*@editable*/ line-height:125%;
            /*@editable*/ text-align:left;
        }

        /**
        * @tab Footer
        * @section footer link
        * @tip Set the styling for your email's footer links. Choose a color that helps them stand out from your text.
        */
        .footerContent div a:link, .footerContent div a:visited, /* Yahoo! Mail Override */ .footerContent div a .yshortcuts /* Yahoo! Mail Override */{
            /*@editable*/ color:#336699;
            /*@editable*/ font-weight:normal;
            /*@editable*/ text-decoration:underline;
        }

        .footerContent img{
            display:inline;
        }

        /**
        * @tab Footer
        * @section social bar style
        * @tip Set the background color and border for your email's footer social bar.
        * @theme footer
        */
        #social{
            /*@editable*/ background-color:#FAFAFA;
            /*@editable*/ border:0;
        }

        /**
        * @tab Footer
        * @section social bar style
        * @tip Set the background color and border for your email's footer social bar.
        */
        #social div{
            /*@editable*/ text-align:center;
        }

        /**
        * @tab Footer
        * @section utility bar style
        * @tip Set the background color and border for your email's footer utility bar.
        * @theme footer
        */
        #utility{
            /*@editable*/ background-color:#FFFFFF;
            /*@editable*/ border:0;
        }

        /**
        * @tab Footer
        * @section utility bar style
        * @tip Set the background color and border for your email's footer utility bar.
        */
        #utility div{
            /*@editable*/ text-align:center;
        }

        #monkeyRewards img{
            max-width:190px;
        }
    </style>
</head>
<body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0">
<center>
    <table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="backgroundTable">
        <tr>
            <td align="center" valign="top">
                <!-- // End Template Preheader \\ -->
                <table border="0" cellpadding="0" cellspacing="0" width="600" id="templateContainer">
                    <tr>
                        <td align="center" valign="top">
                            <!-- // Begin Template Body \\ -->
                            <table border="0" cellpadding="0" cellspacing="0" width="600" id="templateBody">
                                <tr>
                                    <td valign="top" class="bodyContent">

                                        <!-- // Begin Module: Standard Content \\ -->
                                        <table border="0" cellpadding="20" cellspacing="0" width="100%">
                                            <tr>
                                                <td valign="top">
                                                    <div mc:edit="std_content00">
                                                        <h1 class="h1">Heading 1</h1>
                                                        <h2 class="h2">Heading 2</h2>
                                                        <h3 class="h3">Heading 3</h3>
                                                        <h4 class="h4">Heading 4</h4>
                                                        <strong>Getting started:</strong> Customize your template by clicking on the style editor tabs up above. Set your fonts, colors, and styles. After setting your styling is all done you can click here in this area, delete the text, and start adding your own awesome content!
                                                        <br />
                                                        <br />
                                                        After you enter your content, highlight the text you want to style and select the options you set in the style editor in the "styles" drop down box. Want to <a href="http://www.mailchimp.com/kb/article/im-using-the-style-designer-and-i-cant-get-my-formatting-to-change" target="_blank">get rid of styling on a bit of text</a>, but having trouble doing it? Just use the "remove formatting" button to strip the text of any formatting and reset your style.
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                        <!-- // End Module: Standard Content \\ -->

                                    </td>
                                </tr>
                            </table>
                            <!-- // End Template Body \\ -->
                        </td>
                    </tr>
                    <tr>
                        <td align="center" valign="top">
                            <!-- // Begin Template Footer \\ -->
                            <table border="0" cellpadding="10" cellspacing="0" width="600" id="templateFooter">
                                <tr>
                                    <td valign="top" class="footerContent">

                                        <!-- // Begin Module: Standard Footer \\ -->
                                        <table border="0" cellpadding="10" cellspacing="0" width="100%">
                                            <tr>
                                                <td colspan="2" valign="middle" id="social">
                                                    <div mc:edit="std_social">
                                                        &nbsp;<a href="*|TWITTER:PROFILEURL|*">follow on Twitter</a> | <a href="*|FACEBOOK:PROFILEURL|*">friend on Facebook</a> | <a href="*|FORWARD|*">forward to a friend</a>&nbsp;
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td valign="top" width="350">
                                                    <div mc:edit="std_footer">
                                                        <em>Copyright &copy; *|CURRENT_YEAR|* *|LIST:COMPANY|*, All rights reserved.</em>
                                                        <br />
                                                        *|IFNOT:ARCHIVE_PAGE|* *|LIST:DESCRIPTION|*
                                                        <br />
                                                        <strong>Our mailing address is:</strong>
                                                        <br />
                                                        *|HTML:LIST_ADDRESS_HTML|**|END:IF|*
                                                    </div>
                                                </td>
                                                <td valign="top" width="190" id="monkeyRewards">
                                                    <div mc:edit="monkeyrewards">
                                                        *|IF:REWARDS|* *|HTML:REWARDS|* *|END:IF|*
                                                    </div>
                                                </td>
                                                <!-- *|IFNOT:ARCHIVE_PAGE|* -->
                                                <td valign="top" width="190">
                                                    <div mc:edit="std_links">
                                                        Is this email not displaying correctly?<br /><a href="*|ARCHIVE|*" target="_blank">View it in your browser</a>.
                                                    </div>
                                                </td>
                                                <!-- *|END:IF|* -->
                                            </tr>
                                        </table>
                                        <!-- // End Module: Standard Footer \\ -->

                                    </td>
                                </tr>
                            </table>
                            <!-- // End Template Footer \\ -->
                        </td>
                    </tr>
                </table>
                <br />
            </td>
        </tr>
    </table>
</center>
</body>
</html>PK     M\><R^  ^    post-campaign/post-campaign.phpnu [        <?php

use MC4WP\PostCampaign\Gutenberg_Editor;

defined( 'ABSPATH' ) or exit;

if ( ! function_exists( 'mc4wp' ) ) {
	return;
}

if ( ! method_exists( MC4WP_API_V3::class, 'add_template' ) ) {
	return;
}

if ( ! function_exists( 'register_post_meta' ) ) {
	return;
}

$gutenberg_editor = new Gutenberg_Editor( __FILE__ );
$gutenberg_editor->hook();
PK     M\aTC;58  58  ,  post-campaign/dist/js/admin/post-campaign.jsnu [        /******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ 		}
/******/ 	};
/******/
/******/ 	// define __esModule on exports
/******/ 	__webpack_require__.r = function(exports) {
/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 		}
/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
/******/ 	};
/******/
/******/ 	// create a fake namespace object
/******/ 	// mode & 1: value is a module id, require it
/******/ 	// mode & 2: merge all properties of value into the ns
/******/ 	// mode & 4: return value when already ns object
/******/ 	// mode & 8|1: behave like require
/******/ 	__webpack_require__.t = function(value, mode) {
/******/ 		if(mode & 1) value = __webpack_require__(value);
/******/ 		if(mode & 8) return value;
/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ 		var ns = Object.create(null);
/******/ 		__webpack_require__.r(ns);
/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ 		return ns;
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";
/******/
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 6);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports) {

(function() { module.exports = this["wp"]["i18n"]; }());

/***/ }),
/* 1 */
/***/ (function(module, exports) {

(function() { module.exports = this["wp"]["components"]; }());

/***/ }),
/* 2 */
/***/ (function(module, exports) {

(function() { module.exports = this["wp"]["element"]; }());

/***/ }),
/* 3 */
/***/ (function(module, exports) {

(function() { module.exports = this["wp"]["data"]; }());

/***/ }),
/* 4 */
/***/ (function(module, exports) {

(function() { module.exports = this["wp"]["plugins"]; }());

/***/ }),
/* 5 */
/***/ (function(module, exports) {

(function() { module.exports = this["wp"]["editPost"]; }());

/***/ }),
/* 6 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
/* harmony import */ var _wordpress_plugins__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_plugins__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_edit_post__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5);
/* harmony import */ var _wordpress_edit_post__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_edit_post__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3);
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(0);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__);
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }

function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }

function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }

function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }

function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }

function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }








var _select = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["select"])('core/editor'),
    isEditedPostDirty = _select.isEditedPostDirty,
    getCurrentPost = _select.getCurrentPost,
    getCurrentPostId = _select.getCurrentPostId,
    isCleanNewPost = _select.isCleanNewPost;

var _dispatch = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__["dispatch"])('core/notices'),
    createSuccessNotice = _dispatch.createSuccessNotice,
    createErrorNotice = _dispatch.createErrorNotice;
/**
 * @return {*} react elements
 */


var PostMailchimpCampaignPanel = function PostMailchimpCampaignPanel() {
  var _meta$mc4wp_mailchimp;

  var meta = getCurrentPost().meta;

  var _useState = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["useState"])((_meta$mc4wp_mailchimp = meta.mc4wp_mailchimp_campaign) !== null && _meta$mc4wp_mailchimp !== void 0 ? _meta$mc4wp_mailchimp : {}),
      _useState2 = _slicedToArray(_useState, 2),
      campaign = _useState2[0],
      setCampaign = _useState2[1];

  var _useState3 = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["useState"])(false),
      _useState4 = _slicedToArray(_useState3, 2),
      busy = _useState4[0],
      setBusy = _useState4[1];

  var onClick = function onClick() {
    if (busy) {
      return;
    }

    var postId = getCurrentPostId();

    if (postId === null || isEditedPostDirty() || isCleanNewPost()) {
      window.alert(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('There are unsaved changes. Please save the post first.', 'mailchimp-for-wp'));
      return;
    }

    if (campaign.id && !window.confirm(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('Heads up! This will overwrite the content in your existing Mailchimp campaign. Are you sure you want to proceed?', 'mailchimp-for-wp'))) {
      return;
    }

    setBusy(true);
    fetch("".concat(window.ajaxurl, "?action=mc4wp_create_campaign_of_post&post_id=").concat(postId)).then(function (res) {
      return res.json();
    }).then(function (_ref) {
      var success = _ref.success,
          data = _ref.data;

      if (!success) {
        throw new Error('Not successfully');
      }

      createSuccessNotice(campaign.id ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('The Mailchimp campaign was updated. Go to the', 'mailchimp-for-wp') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('The Mailchimp campaign is created. Go to the', 'mailchimp-for-wp'), {
        actions: [{
          label: 'campaign.',
          url: 'https://admin.mailchimp.com/campaigns/edit?id=' + data.web_id
        }]
      });
      setCampaign(data);
    })["catch"](function () {
      var message = campaign.id ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('Error updating campaign. Check the debug log for errors.', 'mailchimp-for-wp') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('Error creating campaign. Check the debug log for errors.', 'mailchimp-for-wp');
      createErrorNotice(message);
    })["finally"](function () {
      //Prevent from infinite loop
      setBusy(false);
    });
  };

  return /*#__PURE__*/React.createElement(_wordpress_edit_post__WEBPACK_IMPORTED_MODULE_2__["PluginDocumentSettingPanel"], {
    name: "mc4wp-post-campaign-panel",
    title: 'Mailchimp for WordPress',
    className: "mc4wp-post-campaign-panel"
  }, /*#__PURE__*/React.createElement("div", {
    className: 'components-panel__row'
  }, campaign.id ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('This post has an email campaign in Mailchimp. Use the button below to update the campaign with the contents of this post.', 'mailchimp-for-wp') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('Use the button below to create an email campaign in Mailchimp based on the contents of this post.', 'mailchimp-for-wp')), /*#__PURE__*/React.createElement("div", {
    className: 'components-panel__row'
  }, /*#__PURE__*/React.createElement(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["Button"], {
    isBusy: busy,
    onClick: onClick,
    disabled: busy,
    isPrimary: true
  }, campaign.id ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('Update campaign', 'mailchimp-for-wp') : Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('Create campaign', 'mailchimp-for-wp'))), campaign.id && /*#__PURE__*/React.createElement("div", {
    className: 'components-panel__row'
  }, /*#__PURE__*/React.createElement(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__["ExternalLink"], {
    href: 'https://admin.mailchimp.com/campaigns/edit?id=' + campaign.web_id
  }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('Go to campaign in Mailchimp.', 'mailchimp-for-wp'))));
};

Object(_wordpress_plugins__WEBPACK_IMPORTED_MODULE_0__["registerPlugin"])('mc4wp-plugin-post-campaign-document-panel', {
  render: PostMailchimpCampaignPanel,
  icon: /*#__PURE__*/React.createElement("svg", null, /*#__PURE__*/React.createElement("path", {
    fill: "#a0a5aa",
    width: "24",
    height: "24",
    viewBox: "0 0 24 24",
    d: "M 8.0097656 0.052734375 A 8 8 0 0 0 0.009765625 8.0527344 A 8 8 0 0 0 8.0097656 16.052734 A 8 8 0 0 0 16.009766 8.0527344 A 8 8 0 0 0 8.0097656 0.052734375 z M 9.2597656 4.171875 C 9.3205456 4.171875 9.9296146 5.0233822 10.611328 6.0664062 C 11.293041 7.1094313 12.296018 8.5331666 12.841797 9.2285156 L 13.833984 10.492188 L 13.316406 11.041016 C 13.031321 11.342334 12.708299 11.587891 12.599609 11.587891 C 12.253798 11.587891 11.266634 10.490156 10.349609 9.0859375 C 9.8610009 8.3377415 9.4126385 7.7229 9.3515625 7.71875 C 9.2904825 7.71455 9.2402344 8.3477011 9.2402344 9.1269531 L 9.2402344 10.544922 L 8.5839844 10.982422 C 8.2233854 11.223015 7.8735746 11.418294 7.8066406 11.417969 C 7.7397106 11.417644 7.4861075 10.997223 7.2421875 10.482422 C 6.9982675 9.9676199 6.6560079 9.3946444 6.4824219 9.2089844 L 6.1679688 8.8710938 L 6.0664062 9.34375 C 5.7203313 10.974656 5.6693219 11.090791 5.0917969 11.505859 C 4.5805569 11.873288 4.2347982 12.017623 4.1914062 11.882812 C 4.1839062 11.859632 4.1482681 11.574497 4.1113281 11.25 C 3.9708341 10.015897 3.5347399 8.7602861 2.8105469 7.5019531 C 2.5672129 7.0791451 2.5711235 7.0651693 2.9765625 6.8320312 C 3.2046215 6.7008903 3.5466561 6.4845105 3.7363281 6.3515625 C 4.0587811 6.1255455 4.1076376 6.1466348 4.4941406 6.6679688 C 4.8138896 7.0992628 4.9275606 7.166285 4.9941406 6.96875 C 5.0960956 6.666263 6.181165 5.8574219 6.484375 5.8574219 C 6.600668 5.8574219 6.8857635 6.1981904 7.1171875 6.6152344 C 7.3486105 7.0322784 7.5790294 7.3728809 7.6308594 7.3730469 C 7.7759584 7.3735219 7.9383234 5.8938023 7.8339844 5.5195312 C 7.7605544 5.2561423 7.8865035 5.0831575 8.4453125 4.6796875 C 8.8327545 4.3999485 9.1989846 4.171875 9.2597656 4.171875 z "
  }))
});

/***/ })
/******/ ]);PK     M\.& l5  5  4  post-campaign/dist/js/admin/post-campaign.min.js.mapnu [        {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external {\"this\":[\"wp\",\"i18n\"]}","webpack:///external {\"this\":[\"wp\",\"components\"]}","webpack:///external {\"this\":[\"wp\",\"element\"]}","webpack:///external {\"this\":[\"wp\",\"data\"]}","webpack:///external {\"this\":[\"wp\",\"plugins\"]}","webpack:///external {\"this\":[\"wp\",\"editPost\"]}","webpack:///./js/admin/PostCampaign.jsx"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","this","select","isEditedPostDirty","getCurrentPost","getCurrentPostId","isCleanNewPost","dispatch","createSuccessNotice","createErrorNotice","registerPlugin","render","meta","useState","mc4wp_mailchimp_campaign","campaign","setCampaign","busy","setBusy","title","className","id","__","isBusy","onClick","postId","window","alert","confirm","fetch","ajaxurl","then","res","json","success","data","Error","actions","label","url","web_id","message","disabled","isPrimary","href","icon","fill","width","height","viewBox"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,iBClFpD,WAAahC,EAAOD,QAAUkC,KAAS,GAAQ,KAAhD,I,eCAC,WAAajC,EAAOD,QAAUkC,KAAS,GAAc,WAAtD,I,eCAC,WAAajC,EAAOD,QAAUkC,KAAS,GAAW,QAAnD,I,eCAC,WAAajC,EAAOD,QAAUkC,KAAS,GAAQ,KAAhD,I,eCAC,WAAajC,EAAOD,QAAUkC,KAAS,GAAW,QAAnD,I,eCAC,WAAajC,EAAOD,QAAUkC,KAAS,GAAY,SAApD,I,+hCCWIC,iBAAO,eAJVC,E,EAAAA,kBACAC,E,EAAAA,eACAC,E,EAAAA,iBACAC,E,EAAAA,e,EAEkDC,mBAAS,gBAApDC,E,EAAAA,oBAAqBC,E,EAAAA,kBA4I7BC,yBAAe,4CAA6C,CAC3DC,OAxIkC,WAAM,MAClCC,EAAOR,IAAiBQ,KADU,IAERC,mBAAQ,UACvCD,EAAKE,gCADkC,QACN,IAHM,GAEjCC,EAFiC,KAEvBC,EAFuB,SAKhBH,oBAAS,GALO,GAKjCI,EALiC,KAK3BC,EAL2B,KA0FxC,OACC,oBAAC,6BAAD,CACC1C,KAAK,4BACL2C,MAAO,0BACPC,UAAU,6BAEV,2BAAKA,UAAW,yBACdL,EAASM,GACPC,aACA,4HACA,oBAEAA,aACA,oGACA,qBAGJ,2BAAKF,UAAW,yBACf,oBAAC,SAAD,CACCG,OAAQN,EACRO,QAvGY,WACf,IAIMC,EAJFR,IAKW,QADTQ,EAASpB,MACQF,KAAuBG,IAC7CoB,OAAOC,MACNL,aACC,yDACA,qBAQFP,EAASM,KACRK,OAAOE,QACPN,aACC,mHACA,uBAOHJ,GAAQ,GAERW,MAAM,GAAD,OACDH,OAAOI,QADN,yDAC8DL,IAEjEM,KAAK,SAACC,GAAD,OAASA,EAAIC,SAClBF,KAAK,YAAuB,IAApBG,EAAoB,EAApBA,QAASC,EAAW,EAAXA,KACjB,IAAKD,EACJ,MAAM,IAAIE,MAAM,oBAGjB5B,EACCO,EAASM,GACNC,aACA,gDACA,oBAEAA,aACA,+CACA,oBAEH,CACCe,QAAS,CACR,CACCC,MAAO,YACPC,IACC,iDACAJ,EAAKK,WAMVxB,EAAYmB,KA/Bd,MAiCQ,WACN,IAAMM,EAAU1B,EAASM,GACtBC,aACA,2DACA,oBAEAA,aACA,2DACA,oBAGHb,EAAkBgC,KA5CpB,QA8CU,WAERvB,GAAQ,QAyBPwB,SAAUzB,EACV0B,WAAS,GAER5B,EAASM,GACPC,aAAG,kBAAmB,oBACtBA,aAAG,kBAAmB,sBAG1BP,EAASM,IACT,2BAAKD,UAAW,yBACf,oBAAC,eAAD,CACCwB,KACC,iDACA7B,EAASyB,QAGTlB,aAAG,+BAAgC,wBAUzCuB,KACC,+BACC,4BACCC,KAAK,UACLC,MAAM,KACNC,OAAO,KACPC,QAAQ,YACR1E,EAAE","file":"js/admin/post-campaign.min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 6);\n","(function() { module.exports = this[\"wp\"][\"i18n\"]; }());","(function() { module.exports = this[\"wp\"][\"components\"]; }());","(function() { module.exports = this[\"wp\"][\"element\"]; }());","(function() { module.exports = this[\"wp\"][\"data\"]; }());","(function() { module.exports = this[\"wp\"][\"plugins\"]; }());","(function() { module.exports = this[\"wp\"][\"editPost\"]; }());","import { registerPlugin } from '@wordpress/plugins';\nimport { Button, ExternalLink } from '@wordpress/components';\nimport { PluginDocumentSettingPanel } from '@wordpress/edit-post';\nimport { useState } from '@wordpress/element';\nimport { select, dispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nconst {\n\tisEditedPostDirty,\n\tgetCurrentPost,\n\tgetCurrentPostId,\n\tisCleanNewPost,\n} = select('core/editor');\nconst { createSuccessNotice, createErrorNotice } = dispatch('core/notices');\n\n/**\n * @return {*} react elements\n */\nconst PostMailchimpCampaignPanel = () => {\n\tconst meta = getCurrentPost().meta;\n\tconst [campaign, setCampaign] = useState(\n\t\tmeta.mc4wp_mailchimp_campaign ?? {}\n\t);\n\tconst [busy, setBusy] = useState(false);\n\n\tconst onClick = () => {\n\t\tif (busy) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst postId = getCurrentPostId();\n\t\tif (postId === null || isEditedPostDirty() || isCleanNewPost()) {\n\t\t\twindow.alert(\n\t\t\t\t__(\n\t\t\t\t\t'There are unsaved changes. Please save the post first.',\n\t\t\t\t\t'mailchimp-for-wp'\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\tcampaign.id &&\n\t\t\t!window.confirm(\n\t\t\t\t__(\n\t\t\t\t\t'Heads up! This will overwrite the content in your existing Mailchimp campaign. Are you sure you want to proceed?',\n\t\t\t\t\t'mailchimp-for-wp'\n\t\t\t\t)\n\t\t\t)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetBusy(true);\n\n\t\tfetch(\n\t\t\t`${window.ajaxurl}?action=mc4wp_create_campaign_of_post&post_id=${postId}`\n\t\t)\n\t\t\t.then((res) => res.json())\n\t\t\t.then(({ success, data }) => {\n\t\t\t\tif (!success) {\n\t\t\t\t\tthrow new Error('Not successfully');\n\t\t\t\t}\n\n\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\tcampaign.id\n\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t'The Mailchimp campaign was updated. Go to the',\n\t\t\t\t\t\t\t\t'mailchimp-for-wp'\n\t\t\t\t\t\t  )\n\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t'The Mailchimp campaign is created. Go to the',\n\t\t\t\t\t\t\t\t'mailchimp-for-wp'\n\t\t\t\t\t\t  ),\n\t\t\t\t\t{\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: 'campaign.',\n\t\t\t\t\t\t\t\turl:\n\t\t\t\t\t\t\t\t\t'https://admin.mailchimp.com/campaigns/edit?id=' +\n\t\t\t\t\t\t\t\t\tdata.web_id,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tsetCampaign(data);\n\t\t\t})\n\t\t\t.catch(() => {\n\t\t\t\tconst message = campaign.id\n\t\t\t\t\t? __(\n\t\t\t\t\t\t\t'Error updating campaign. Check the debug log for errors.',\n\t\t\t\t\t\t\t'mailchimp-for-wp'\n\t\t\t\t\t  )\n\t\t\t\t\t: __(\n\t\t\t\t\t\t\t'Error creating campaign. Check the debug log for errors.',\n\t\t\t\t\t\t\t'mailchimp-for-wp'\n\t\t\t\t\t  );\n\n\t\t\t\tcreateErrorNotice(message);\n\t\t\t})\n\t\t\t.finally(() => {\n\t\t\t\t//Prevent from infinite loop\n\t\t\t\tsetBusy(false);\n\t\t\t});\n\t};\n\n\treturn (\n\t\t<PluginDocumentSettingPanel\n\t\t\tname=\"mc4wp-post-campaign-panel\"\n\t\t\ttitle={'Mailchimp for WordPress'}\n\t\t\tclassName=\"mc4wp-post-campaign-panel\"\n\t\t>\n\t\t\t<div className={'components-panel__row'}>\n\t\t\t\t{campaign.id\n\t\t\t\t\t? __(\n\t\t\t\t\t\t\t'This post has an email campaign in Mailchimp. Use the button below to update the campaign with the contents of this post.',\n\t\t\t\t\t\t\t'mailchimp-for-wp'\n\t\t\t\t\t  )\n\t\t\t\t\t: __(\n\t\t\t\t\t\t\t'Use the button below to create an email campaign in Mailchimp based on the contents of this post.',\n\t\t\t\t\t\t\t'mailchimp-for-wp'\n\t\t\t\t\t  )}\n\t\t\t</div>\n\t\t\t<div className={'components-panel__row'}>\n\t\t\t\t<Button\n\t\t\t\t\tisBusy={busy}\n\t\t\t\t\tonClick={onClick}\n\t\t\t\t\tdisabled={busy}\n\t\t\t\t\tisPrimary\n\t\t\t\t>\n\t\t\t\t\t{campaign.id\n\t\t\t\t\t\t? __('Update campaign', 'mailchimp-for-wp')\n\t\t\t\t\t\t: __('Create campaign', 'mailchimp-for-wp')}\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t\t{campaign.id && (\n\t\t\t\t<div className={'components-panel__row'}>\n\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\thref={\n\t\t\t\t\t\t\t'https://admin.mailchimp.com/campaigns/edit?id=' +\n\t\t\t\t\t\t\tcampaign.web_id\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{__('Go to campaign in Mailchimp.', 'mailchimp-for-wp')}\n\t\t\t\t\t</ExternalLink>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</PluginDocumentSettingPanel>\n\t);\n};\n\nregisterPlugin('mc4wp-plugin-post-campaign-document-panel', {\n\trender: PostMailchimpCampaignPanel,\n\ticon: (\n\t\t<svg>\n\t\t\t<path\n\t\t\t\tfill=\"#a0a5aa\"\n\t\t\t\twidth=\"24\"\n\t\t\t\theight=\"24\"\n\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\td=\"M 8.0097656 0.052734375 A 8 8 0 0 0 0.009765625 8.0527344 A 8 8 0 0 0 8.0097656 16.052734 A 8 8 0 0 0 16.009766 8.0527344 A 8 8 0 0 0 8.0097656 0.052734375 z M 9.2597656 4.171875 C 9.3205456 4.171875 9.9296146 5.0233822 10.611328 6.0664062 C 11.293041 7.1094313 12.296018 8.5331666 12.841797 9.2285156 L 13.833984 10.492188 L 13.316406 11.041016 C 13.031321 11.342334 12.708299 11.587891 12.599609 11.587891 C 12.253798 11.587891 11.266634 10.490156 10.349609 9.0859375 C 9.8610009 8.3377415 9.4126385 7.7229 9.3515625 7.71875 C 9.2904825 7.71455 9.2402344 8.3477011 9.2402344 9.1269531 L 9.2402344 10.544922 L 8.5839844 10.982422 C 8.2233854 11.223015 7.8735746 11.418294 7.8066406 11.417969 C 7.7397106 11.417644 7.4861075 10.997223 7.2421875 10.482422 C 6.9982675 9.9676199 6.6560079 9.3946444 6.4824219 9.2089844 L 6.1679688 8.8710938 L 6.0664062 9.34375 C 5.7203313 10.974656 5.6693219 11.090791 5.0917969 11.505859 C 4.5805569 11.873288 4.2347982 12.017623 4.1914062 11.882812 C 4.1839062 11.859632 4.1482681 11.574497 4.1113281 11.25 C 3.9708341 10.015897 3.5347399 8.7602861 2.8105469 7.5019531 C 2.5672129 7.0791451 2.5711235 7.0651693 2.9765625 6.8320312 C 3.2046215 6.7008903 3.5466561 6.4845105 3.7363281 6.3515625 C 4.0587811 6.1255455 4.1076376 6.1466348 4.4941406 6.6679688 C 4.8138896 7.0992628 4.9275606 7.166285 4.9941406 6.96875 C 5.0960956 6.666263 6.181165 5.8574219 6.484375 5.8574219 C 6.600668 5.8574219 6.8857635 6.1981904 7.1171875 6.6152344 C 7.3486105 7.0322784 7.5790294 7.3728809 7.6308594 7.3730469 C 7.7759584 7.3735219 7.9383234 5.8938023 7.8339844 5.5195312 C 7.7605544 5.2561423 7.8865035 5.0831575 8.4453125 4.6796875 C 8.8327545 4.3999485 9.1989846 4.171875 9.2597656 4.171875 z \"\n\t\t\t/>\n\t\t</svg>\n\t),\n});\n"],"sourceRoot":""}PK     M\¹(  (  0  post-campaign/dist/js/admin/post-campaign.min.jsnu [        !function(n){var r={};function i(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.m=n,i.c=r,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=6)}([function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){!function(){e.exports=this.wp.plugins}()},function(e,t){!function(){e.exports=this.wp.editPost}()},function(e,t,n){"use strict";n.r(t);var r=n(4),l=n(1),p=n(5),u=n(2),i=n(3),s=n(0);function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var o=Object(i.select)("core/editor"),f=o.isEditedPostDirty,d=o.getCurrentPost,h=o.getCurrentPostId,b=o.isCleanNewPost,c=Object(i.dispatch)("core/notices"),w=c.createSuccessNotice,g=c.createErrorNotice;Object(r.registerPlugin)("mc4wp-plugin-post-campaign-document-panel",{render:function(){var e,t=d().meta,n=m(Object(u.useState)(null!==(e=t.mc4wp_mailchimp_campaign)&&void 0!==e?e:{}),2),r=n[0],i=n[1],a=m(Object(u.useState)(!1),2),o=a[0],c=a[1];return React.createElement(p.PluginDocumentSettingPanel,{name:"mc4wp-post-campaign-panel",title:"Mailchimp for WordPress",className:"mc4wp-post-campaign-panel"},React.createElement("div",{className:"components-panel__row"},r.id?Object(s.__)("This post has an email campaign in Mailchimp. Use the button below to update the campaign with the contents of this post.","mailchimp-for-wp"):Object(s.__)("Use the button below to create an email campaign in Mailchimp based on the contents of this post.","mailchimp-for-wp")),React.createElement("div",{className:"components-panel__row"},React.createElement(l.Button,{isBusy:o,onClick:function(){var e;o||(null===(e=h())||f()||b()?window.alert(Object(s.__)("There are unsaved changes. Please save the post first.","mailchimp-for-wp")):r.id&&!window.confirm(Object(s.__)("Heads up! This will overwrite the content in your existing Mailchimp campaign. Are you sure you want to proceed?","mailchimp-for-wp"))||(c(!0),fetch("".concat(window.ajaxurl,"?action=mc4wp_create_campaign_of_post&post_id=").concat(e)).then(function(e){return e.json()}).then(function(e){var t=e.success,n=e.data;if(!t)throw new Error("Not successfully");w(r.id?Object(s.__)("The Mailchimp campaign was updated. Go to the","mailchimp-for-wp"):Object(s.__)("The Mailchimp campaign is created. Go to the","mailchimp-for-wp"),{actions:[{label:"campaign.",url:"https://admin.mailchimp.com/campaigns/edit?id="+n.web_id}]}),i(n)}).catch(function(){var e=r.id?Object(s.__)("Error updating campaign. Check the debug log for errors.","mailchimp-for-wp"):Object(s.__)("Error creating campaign. Check the debug log for errors.","mailchimp-for-wp");g(e)}).finally(function(){c(!1)})))},disabled:o,isPrimary:!0},r.id?Object(s.__)("Update campaign","mailchimp-for-wp"):Object(s.__)("Create campaign","mailchimp-for-wp"))),r.id&&React.createElement("div",{className:"components-panel__row"},React.createElement(l.ExternalLink,{href:"https://admin.mailchimp.com/campaigns/edit?id="+r.web_id},Object(s.__)("Go to campaign in Mailchimp.","mailchimp-for-wp"))))},icon:React.createElement("svg",null,React.createElement("path",{fill:"#a0a5aa",width:"24",height:"24",viewBox:"0 0 24 24",d:"M 8.0097656 0.052734375 A 8 8 0 0 0 0.009765625 8.0527344 A 8 8 0 0 0 8.0097656 16.052734 A 8 8 0 0 0 16.009766 8.0527344 A 8 8 0 0 0 8.0097656 0.052734375 z M 9.2597656 4.171875 C 9.3205456 4.171875 9.9296146 5.0233822 10.611328 6.0664062 C 11.293041 7.1094313 12.296018 8.5331666 12.841797 9.2285156 L 13.833984 10.492188 L 13.316406 11.041016 C 13.031321 11.342334 12.708299 11.587891 12.599609 11.587891 C 12.253798 11.587891 11.266634 10.490156 10.349609 9.0859375 C 9.8610009 8.3377415 9.4126385 7.7229 9.3515625 7.71875 C 9.2904825 7.71455 9.2402344 8.3477011 9.2402344 9.1269531 L 9.2402344 10.544922 L 8.5839844 10.982422 C 8.2233854 11.223015 7.8735746 11.418294 7.8066406 11.417969 C 7.7397106 11.417644 7.4861075 10.997223 7.2421875 10.482422 C 6.9982675 9.9676199 6.6560079 9.3946444 6.4824219 9.2089844 L 6.1679688 8.8710938 L 6.0664062 9.34375 C 5.7203313 10.974656 5.6693219 11.090791 5.0917969 11.505859 C 4.5805569 11.873288 4.2347982 12.017623 4.1914062 11.882812 C 4.1839062 11.859632 4.1482681 11.574497 4.1113281 11.25 C 3.9708341 10.015897 3.5347399 8.7602861 2.8105469 7.5019531 C 2.5672129 7.0791451 2.5711235 7.0651693 2.9765625 6.8320312 C 3.2046215 6.7008903 3.5466561 6.4845105 3.7363281 6.3515625 C 4.0587811 6.1255455 4.1076376 6.1466348 4.4941406 6.6679688 C 4.8138896 7.0992628 4.9275606 7.166285 4.9941406 6.96875 C 5.0960956 6.666263 6.181165 5.8574219 6.484375 5.8574219 C 6.600668 5.8574219 6.8857635 6.1981904 7.1171875 6.6152344 C 7.3486105 7.0322784 7.5790294 7.3728809 7.6308594 7.3730469 C 7.7759584 7.3735219 7.9383234 5.8938023 7.8339844 5.5195312 C 7.7605544 5.2561423 7.8865035 5.0831575 8.4453125 4.6796875 C 8.8327545 4.3999485 9.1989846 4.171875 9.2597656 4.171875 z "}))})}]);
//# sourceMappingURL=post-campaign.min.js.mapPK     M\J.2  2    post-campaign/.gitattributesnu [        assets              export-ignore
.babelrc            export-ignore
.gitignore          export-ignore
package.json        export-ignore
package-lock.json   export-ignore
README.md           export-ignore
webpack.config.js    export-ignore
node_modules        export-ignore
.eslintrc           export-ignorePK     M\R{      ecommerce3/ecommerce3.phpnu [        <?php

defined('ABSPATH') or exit;

// make sure WooCommerce is installed & activated.
if (!class_exists('WooCommerce')) {
    return;
}

define('MC4WP_ECOMMERCE_VERSION', '1.0');
require_once __DIR__ . '/includes/class-ecommerce.php';
require_once __DIR__ . '/includes/class-helper.php';
require_once __DIR__ . '/includes/functions.php';
require_once __DIR__ . '/includes/class-worker.php';
require_once __DIR__ . '/includes/class-lock.php';

// load settings
$settings = mc4wp_ecommerce_get_settings();

// register ecommerce & tracker in service container (for lazy loading)
$mc4wp = mc4wp();
$mc4wp['ecommerce.options'] = $settings;
$mc4wp['ecommerce.tracker'] = function () use ($settings) {
    require_once __DIR__ . '/includes/class-tracker.php';
    return new MC4WP_Ecommerce_Tracker(__FILE__, $settings);
};
$mc4wp['ecommerce.transformer'] = function () use ($mc4wp, $settings) {
    require_once __DIR__ . '/includes/interface-transformer.php';

    if (!defined('WOOCOMMERCE_VERSION') || version_compare(WOOCOMMERCE_VERSION, '3.0', '<')) {
        require_once __DIR__ . '/includes/class-transformer-wc2.php';
        return new MC4WP_Ecommerce_Object_Transformer_WC2($settings, $mc4wp['ecommerce.tracker']);
    }

    require_once __DIR__ . '/includes/class-transformer-wc3.php';
    return new MC4WP_Ecommerce_Object_Transformer_WC3($settings, $mc4wp['ecommerce.tracker']);
};
$mc4wp['ecommerce'] = function () use ($mc4wp, $settings) {
    return new MC4WP_Ecommerce($settings['store_id'], $mc4wp['ecommerce.transformer']);
};

$mc4wp['ecommerce.queue'] = function () {
    return new MC4WP_Queue('mc4wp_ecommerce_queue');
};

$mc4wp['ecommerce.worker'] = function () use ($mc4wp, $settings) {
    return new MC4WP_Ecommerce_Worker($settings, $mc4wp['ecommerce'], $mc4wp['ecommerce.queue']);
};

// enable queue & worker if e-commerce is enabled in settings
if ($settings['enable_product_tracking']) {
    add_filter('cron_schedules', '_mc4wp_ecommerce_cron_schedules');

    /** @var MC4WP_Ecommerce_Tracker */
    $mc4wp['ecommerce.tracker']->hook();

    // setup worker (processes items from queue)
    $mc4wp['ecommerce.worker']->hook();

    // setup product observer  (adds jobs to queue)
    require_once __DIR__ . '/includes/class-object-observer.php';
    require_once __DIR__ . '/includes/class-product-observer.php';
    $product_observer = new MC4WP_Ecommerce_Product_Observer($mc4wp['ecommerce'], $mc4wp['ecommerce.queue']);
    $product_observer->hook();

    if ($settings['enable_order_tracking']) {
        require_once __DIR__ . '/includes/class-order-observer.php';
        $order_observer = new MC4WP_Ecommerce_Order_Observer($mc4wp['ecommerce'], $mc4wp['ecommerce.queue']);
        $order_observer->hook();
    }

    // setup cart observer (adds jobs to queue)
    if ($settings['enable_cart_tracking']) {
        require_once __DIR__ . '/includes/class-cart-observer.php';
        $cart_observer = new MC4WP_Ecommerce_Cart_Observer(__FILE__, $mc4wp['ecommerce'], $mc4wp['ecommerce.queue'], $mc4wp['ecommerce.transformer']);
        $cart_observer->hook();
    }
}

// setup admin stuffs?
if (is_admin()) {
    if (defined('DOING_AJAX') && DOING_AJAX) {
        require_once __DIR__ . '/includes/class-ajax.php';
        $ajax = new MC4WP_Ecommerce_Admin_Ajax();
        $ajax->hook();
    } else {
        require_once __DIR__ . '/includes/class-admin.php';
        require_once __DIR__ . '/includes/class-object-count.php';

        $admin = new MC4WP_Ecommerce_Admin(__FILE__, $mc4wp['ecommerce.queue'], $settings);
        $admin->add_hooks();
    }
}

// register command when running cli
if (defined('WP_CLI') && WP_CLI) {
    require_once __DIR__ . '/includes/class-command.php';
    WP_CLI::add_command('mc4wp-ecommerce', 'MC4WP_Ecommerce_Command');
}
PK     M\
I{$  {$  $  ecommerce3/includes/class-worker.phpnu [        <?php

class MC4WP_Ecommerce_Worker
{

    /**
     * @var MC4WP_Queue
     */
    protected $queue;

    /**
     * @var MC4WP_Ecommerce
     */
    protected $ecommerce;

    /**
     * @var array
     */
    protected $settings;

    /**
     * MC4WP_Ecommerce_Worker constructor.
     *
     * @param array $settings
     * @param MC4WP_Ecommerce $ecommerce
     * @param MC4WP_Queue $queue
     */
    public function __construct(array $settings, MC4WP_Ecommerce $ecommerce, MC4WP_Queue $queue)
    {
        $this->settings = $settings;
        $this->ecommerce = $ecommerce;
        $this->queue = $queue;
    }

    /**
     * Hook
     */
    public function hook()
    {
        add_action('mc4wp_ecommerce_process_queue', array( $this, 'work' ));
    }

    /**
     * Work!
     *
     * TODO: Re-schedule failed jobs in a separate queue maybe?
     */
    public function work()
    {
    	$lock = new MC4WP_Lock( 'ecommerce_queue');
    	if (! $lock->acquire()) {
    		return;
	    }

    	// loop over queued jobs
        while (($job = $this->queue->get()) && $job instanceof MC4WP_Queue_Job) {

            // ensure job data matches expected format
            if (empty($job->data['method']) || ! method_exists($this, $job->data['method'])) {
                $this->queue->delete($job);
                continue;
            }

            // call job method with args
            try {
                $success = call_user_func_array(array( $this, $job->data['method'] ), $job->data['args']);
            } catch (Error $e) {
                $message = sprintf('E-Commerce: Failed to process background job. %s in %s:%d', $e->getMessage(), $e->getFile(), $e->getLine());
                $this->get_log()->error($message);
            } catch (Exception $e) {
                $message = sprintf('E-Commerce: Failed to process background job. %s in %s:%d', $e->getMessage(), $e->getFile(), $e->getLine());
                $this->get_log()->error($message);
            }

            // remove job from queue & force save
            $this->queue->delete($job);
            $this->queue->save();
        }

        // save again to handle deleted jobs properly too
        $this->queue->save();

    	// release lock
    	$lock->release();
    }

    /**
     * @param int $id
     *
     * @return bool
     */
    public function add_order($id)
    {
        try {
            $this->ecommerce->update_order($id);
        } catch (Exception $e) {
            if ($e->getCode() === MC4WP_Ecommerce::ERR_NO_ITEMS) {
                $this->get_log()->warning(sprintf("E-Commerce: Skipping order #%d. %s", $id, $e->getMessage()));
            } elseif ($e->getCode() === MC4WP_Ecommerce::ERR_NO_EMAIL_ADDRESS) {
                $this->get_log()->warning(sprintf("E-Commerce: Skipping order #%d. Order has no email address.", $id, $e->getMessage()));
            } else {
                $this->get_log()->error(sprintf("E-Commerce: Error adding order #%d. %s", $id, $e));
            }
            return false;
        }

        $this->get_log()->info(sprintf("E-Commerce: Successfully added order #%d.", $id));
        return true;
    }

    /**
     * @param int $id
     *
     * @return bool
     */
    public function delete_order($id)
    {
        // do nothing if order is not tracked
        if (! $this->ecommerce->is_object_tracked($id)) {
            return false;
        }

        try {
            $this->ecommerce->delete_order($id);
        } catch (Exception $e) {
            $this->get_log()->error(sprintf("E-Commerce: Error deleting order #%d. %s", $id, $e));
            return false;
        }

        $this->get_log()->info(sprintf("E-Commerce: Successfully deleted order #%d.", $id));
        return true;
    }

    /**
     * @param int $id
     *
     * @return bool
     */
    public function add_product($id)
    {
        try {
            $this->ecommerce->update_product($id);
        } catch (Exception $e) {
            $this->get_log()->error(sprintf("E-Commerce: Error updating product #%d. %s", $id, $e));
            return false;
        }

        $this->get_log()->info(sprintf("E-Commerce: Successfully updated product #%d.", $id));
        return true;
    }

    /**
     * @param int $id
     *
     * @return bool
     */
    public function delete_product($id)
    {
        try {
            $this->ecommerce->delete_product($id);
        } catch (Exception $e) {
            $this->get_log()->error(sprintf("E-Commerce: Error deleting product #%d. %s", $id, $e));
            return false;
        }

        $this->get_log()->info(sprintf("E-Commerce: Successfully deleted product #%d.", $id));
        return true;
    }

    /**
     * @param string $cart_id
     * @param WC_Customer|WP_User|object|int $customer
     * @param array $cart_contents
     *
     * @return bool
     */
    public function update_cart($cart_id, $customer, $cart_contents = array())
    {
        // turn $user_id into WP_User object
        if (is_numeric($customer)) {
            $customer = get_userdata($customer);
        }

        try {
            $this->ecommerce->update_cart($cart_id, $customer, $cart_contents);
        } catch (Exception $e) {
            if ($e->getCode() === MC4WP_Ecommerce::ERR_NO_ITEMS) {
                $this->get_log()->warning(sprintf("E-Commerce: Skipping cart #%s. %s", $cart_id, $e->getMessage()));
            } else {
                $this->get_log()->error(sprintf("E-Commerce: Error updating cart #%s. %s", $cart_id, $e));
            }
            return false;
        }

        $this->get_log()->info(sprintf("E-Commerce: Successfully updated cart #%s.", $cart_id));
    }

    /**
     * @param string $cart_id
     *
     * @return bool
     */
    public function delete_cart($cart_id)
    {
        try {
            $this->ecommerce->delete_cart($cart_id);
        } catch (MC4WP_API_Resource_Not_Found_Exception $e) {
            // cart was never in Mailchimp. Don't log.
            return false;
        } catch (Exception $e) {
            $this->get_log()->error(sprintf("E-Commerce: Error deleting cart #%s. %s", $cart_id, $e));
            return false;
        }

        $this->get_log()->info(sprintf("E-Commerce: Successfully deleted cart #%s.", $cart_id));
        return true;
    }

    /**
     * @param int $user_id
     *
     * @return bool
     */
    public function update_customer($user_id)
    {
        $user = get_userdata($user_id);

        // do nothing if user no longer exists by now.
        if (! $user instanceof WP_User) {
            return false;
        }

        try {
            $this->ecommerce->update_customer($user);
        } catch (MC4WP_API_Resource_Not_Found_Exception $e) {
            // Customer was not in Mailchimp, can happen in case of email address update (since we use that as ID).
            // It's okay
            return true;
        } catch (Exception $e) {
            $this->get_log()->error(sprintf("E-Commerce: Error updating user #%d. %s", $user_id, $e));
            return false;
        }

        $this->get_log()->info(sprintf("E-Commerce: Successfully updated user #%d.", $user_id));
        return true;
    }

    public function update_promo($post_id)
    {
        try {
            $this->ecommerce->update_promo($post_id);
        } catch (Exception $e) {
            $this->get_log()->error(sprintf("E-Commerce: Error updating promo #%d. %s", $post_id, $e));
            return false;
        }

        $this->get_log()->info(sprintf("E-Commerce: Successfully updated promo #%d.", $post_id));
        return true;
    }

    public function delete_promo($post_id)
    {
        try {
            $this->ecommerce->delete_promo($post_id);
        } catch (Exception $e) {
            $this->get_log()->error(sprintf("E-Commerce: Error deleting promo #%d. %s", $post_id, $e));
            return false;
        }

        $this->get_log()->info(sprintf("E-Commerce: Successfully deleted promo  #%d.", $post_id));
        return true;
    }

    public function update_subscriber_email($old_email_address, $new_email_address)
    {
        if (empty($this->settings['store']['list_id'])) {
            return true;
        }

        $list_id = $this->settings['store']['list_id'];
        $api = mc4wp_get_api_v3();

        try {
            $data = $api->get_list_member($list_id, $old_email_address);

            // we can only update email addresses of members with a "subscribed" status in Mailchimp
            if ($data->status !== 'subscribed') {
                return true;
            }

            $api->update_list_member($list_id, $old_email_address, array( 'email_address' => $new_email_address ));
        } catch (MC4WP_API_Resource_Not_Found_Exception $e) {
            // this means the customer was not on the list; which is okay
            return true;
        } catch (Exception $e) {
            $this->get_log()->error(sprintf("E-Commerce: Error updating customer email. %s", $e));
            return false;
        }

        $this->get_log()->info(sprintf("E-Commerce: Successfully updated customer email from %s to %s.", $old_email_address, $new_email_address));
        return true;
    }

    /**
     * @return MC4WP_Debug_Log
     */
    private function get_log()
    {
        return mc4wp('log');
    }
}
PK     M\;r~  ~  "  ecommerce3/includes/class-ajax.phpnu [        <?php

class MC4WP_Ecommerce_Admin_Ajax
{
    public function hook()
    {
        add_action('wp_ajax_mc4wp_ecommerce_process_queue', array( $this, 'process_queue' ));
        add_action('wp_ajax_mc4wp_ecommerce_reset_queue', array( $this, 'reset_queue' ));
        add_action('wp_ajax_mc4wp_ecommerce_sync_orders', array( $this, 'sync_objects') );
	    add_action('wp_ajax_mc4wp_ecommerce_sync_products', array( $this, 'sync_objects') );
    }

    /**
     * Checks if current user has `manage_options` capability or kills the request.
     */
    private function authorize()
    {
        if (! current_user_can('manage_options')) {
            status_header(401);
            exit;
        }
    }

    /**
     * Process the background queue.
     */
    public function process_queue()
    {
        $this->authorize();
        do_action('mc4wp_ecommerce_process_queue');
        wp_send_json(true);
        exit;
    }

    /**
    * Process the background queue.
    */
    public function reset_queue()
    {
        $this->authorize();
        $queue = mc4wp('ecommerce.queue');
        $queue->reset();
        $queue->save();
        wp_send_json(true);
        exit;
    }

    public function sync_objects() {
	    /** @var MC4WP_Ecommerce $ecommerce */
	    $ecommerce = mc4wp('ecommerce');

	    // Read request data
	    $type = $_GET['action'] === 'mc4wp_ecommerce_sync_orders' ? 'orders' : 'products';
	    $ids = (array) json_decode(file_get_contents('php://input'));
	    if (count($ids) === 0) {
	    	wp_send_json(array());
	    	exit;
	    }
	    $current = 0;
	    $results = array();

	    do {
		    $object_id = $ids[ $current++ ];

		    switch ( $type ) {
			    case 'orders':
				    // unset tracking cookies temporarily because these would be the admin's cookie
				    unset( $_COOKIE[ 'mc_tc' ] );
				    unset( $_COOKIE[ 'mc_cid' ] );

				    try {
					    $ecommerce->update_order( $object_id );
					    $results[] = sprintf( 'Added order %d', $object_id );
				    } catch ( Exception $e ) {
					    if ( $e->getCode() === MC4WP_Ecommerce::ERR_NO_ITEMS ) {
						    $results[] = sprintf( "Skipped order #%d: %s", $object_id, $e->getMessage() );
					    } else if ( $e->getCode() === MC4WP_Ecommerce::ERR_NO_EMAIL_ADDRESS ) {
						    $results[] = sprintf( "Skipped order #%d: %s", $object_id, __( 'Order has no email address', 'mc4wp-premium' ) );
					    } else {
						    $results[] = sprintf( "Error adding order #%d: %s", $object_id, $e );
					    }
				    }
				    break;

			    case 'products':
				    try {
					    $ecommerce->update_product( $object_id );
					    $results[] = sprintf( 'Added product #%d', $object_id );
				    } catch ( Exception $e ) {
					    $results[] = sprintf( "Error adding product #%d: %s", $object_id, $e );
				    }
				    break;
		    }

		// keep going as long as there are ID's and while we have more than 5 seconds left in this request
	    } while ( $current < count($ids) && $this->get_execution_time_left() > 5.00 );

	    // return the results array
	    wp_send_json($results); ;
    }

    private function get_execution_time_left() {
	    $max_execution_time = (int) ini_get('max_execution_time');
	    $request_time = microtime(true) - WP_START_TIMESTAMP;
	    return $max_execution_time - $request_time;
    }

    /**
     * @return MC4WP_Ecommerce
     */
    public function get_ecommerce()
    {
        return mc4wp('ecommerce');
    }
}
PK     M\a    -  ecommerce3/includes/class-object-observer.phpnu [        <?php

abstract class MC4WP_Ecommerce_Object_Observer {
    /**
     * @var MC4WP_Queue
     */
    protected $queue;

    /**
     * Remove pending jobs from the queue
     *
     * @param string $method
     * @param int $object_id
     */
    protected function remove_pending_jobs($method, $object_id)
    {
        $jobs = $this->queue->all();
        foreach ($jobs as $job) {
            if ($job->data['method'] === $method && $job->data['args'][0] == $object_id) {
                $this->queue->delete($job);
            }
        }
    }

    /**
     * Add a job to the queue.
     *
     * @param string $method
     * @param int $object_id
     */
    protected function add_pending_job($method, $object_id)
    {
        $this->queue->put(
            array(
                'method' => $method,
                'args' => array( $object_id )
            )
        );

        // ensure queue event is scheduled
        _mc4wp_ecommerce_schedule_events();
    }

}PK     M\7u0x  x  !  ecommerce3/includes/functions.phpnu [        <?php

defined('ABSPATH') or exit;

/**
 * @since 3.3
 * @return array
 */
function mc4wp_ecommerce_get_settings()
{
    $options = get_option('mc4wp_ecommerce', array());
    $options = is_array($options) ? $options : array();
    $defaults = array(
        'enable_product_tracking' => 0,
        'enable_order_tracking' => 0,
        'enable_cart_tracking' => 0,
        'load_mcjs_script' => 0,
        'include_all_order_statuses' => 0,
        'store_id' => '',
        'store' => array(
            'list_id' => '',
            'name' => get_bloginfo('name'),
            'currency_code' => get_woocommerce_currency(),
            'is_syncing' => 1,
        ),
        'mcjs_url' => '',
        'last_updated' => null,
    );

    if (isset($options['enable_object_tracking'])) {
        $options['enable_product_tracking'] = $options['enable_object_tracking'];
        $options['enable_order_tracking'] = $options['enable_object_tracking'];
        unset($options['enable_object_tracking']);
    }

    // merge saved options with defaults
    $options = array_merge($defaults, $options);
    $options['store'] = array_merge($defaults['store'], $options['store']);

    // fill store_id dynamically if it's empty
    if (empty($options['store_id'])) {
        $options['store_id'] = (string) md5(get_option('siteurl', ''));
    }

    // backwards compat for moved mcjs_url prop
    if (empty($options['mcjs_url']) && ! empty($options['store']['mcjs_url'])) {
        $options['mcjs_url'] = $options['store']['mcjs_url'];
        unset($options['store']['mcjs_url']);
    }

    // disable cart & order tracking if product tracking is disabled
    if (!$options['enable_product_tracking']) {
        $options['enable_cart_tracking'] = 0;
        $options['enable_order_tracking'] = 0;
    }


    /**
     * Filters the options array
     *
     * @param array $options
     */
    $options = apply_filters('mc4wp_ecommerce_options', $options);

    return $options;
}

/**
 * @since 3.3.2
 *
 * @param array $new_settings
 * @return array $settings
 */
function mc4wp_ecommerce_update_settings(array $new_settings)
{
    $old_settings = mc4wp_ecommerce_get_settings();
    $settings = array_replace_recursive($old_settings, $new_settings);
    update_option('mc4wp_ecommerce', $settings);
    return $settings;
}

/**
 * Gets which order statuses should be stored in Mailchimp.
 *
 * @private
 * @since 3.3
 * @return array
 */
function mc4wp_ecommerce_get_order_statuses()
{
    $order_statuses = array( 'wc-completed', 'wc-processing' );

    // include non-completed orders when setting is enabled (for Order Notifications, mostly)
    $opts = mc4wp_ecommerce_get_settings();
    if ($opts['include_all_order_statuses']) {
        $order_statuses = array_merge($order_statuses, array( 'wc-pending', 'wc-cancelled', 'wc-on-hold', 'wc-refunded', 'wc-failed'));
    }

    /**
     * Filters the order statuses to send to Mailchimp
     *
     * @param array $order_statuses
     * @since 3.3
     */
    $order_statuses = apply_filters('mc4wp_ecommerce_order_statuses', $order_statuses);

    /**
     * @deprecated Use mc4wp_ecommerce_order_statuses instead.
     * @ignore
     */
    $order_statuses = apply_filters('mc4wp_ecommerce360_order_statuses', $order_statuses);

    return $order_statuses;
}

/**
 * @param array $schedules
 * @return array
 */
function _mc4wp_ecommerce_cron_schedules($schedules)
{
    $schedules['every-minute'] = array(
        'interval' => 60,
        'display' => __('Every minute', 'mc4wp-ecommerce'),
    );
    return $schedules;
}

/**
 * Schedule e-commerce events with WP Cron.
 */
function _mc4wp_ecommerce_schedule_events()
{
    /**
    * Allows you to disable the WP Cron schedule for processing the queue.
    *
    * To be used when you process the queue over WP CLI using `wp mc4wp-ecommerce process-queue`
    */
    if (! apply_filters('mc4wp_ecommerce_schedule_process_queue_event', true)) {
        return;
    }

    $event_name = 'mc4wp_ecommerce_process_queue';
    $actual_next = wp_next_scheduled($event_name);

    if (! $actual_next || $actual_next > (time() + 600)) {
        wp_schedule_event(time() + 60, 'every-minute', $event_name);
    }
}
PK     M\Tem    .  ecommerce3/includes/class-product-observer.phpnu [        <?php

class MC4WP_Ecommerce_Product_Observer extends MC4WP_Ecommerce_Object_Observer
{
    /**
     * @var MC4WP_Ecommerce
     */
    protected $ecommerce;

    /**
     * MC4WP_Ecommerce_Scheduler constructor.
     *
     * @param MC4WP_Ecommerce $ecommerce
     * @param MC4WP_Queue $queue
     */
    public function __construct(MC4WP_Ecommerce $ecommerce, MC4WP_Queue $queue)
    {
        $this->ecommerce = $ecommerce;
        $this->queue = $queue;
    }

    /**
     * Hook
     */
    public function hook()
    {
        // update products
        add_action('woocommerce_new_product', array($this, 'on_product_save'));
        add_action('save_post_product', array( $this, 'on_product_save' ));

        // delete products & orders when they're deleted in WP
        add_action('delete_post', array( $this, 'on_post_delete'));

        // update promo code
        add_action('save_post_shop_coupon', array( $this, 'on_coupon_update' ));
    }

    // hook: save_post_product
    public function on_product_save($post_id)
    {
        // skip auto saves
        if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
            return;
        }

        $this->add_pending_job('add_product', $post_id);
        $this->queue->save();
    }

    // hook: delete_post
    public function on_post_delete($post_id)
    {
        $post = get_post($post_id);

        // products
        if ($post->post_type === 'product') {
            $this->remove_pending_jobs('add_product', $post_id);
            $this->add_pending_job('delete_product', $post_id);
            $this->queue->save();
        }

        // coupons / promo codes
        if ($post->post_type === 'shop_coupon') {
            $this->on_coupon_delete($post_id);
        }
    }

    public function on_coupon_update($post_id)
    {
        // skip auto saves
        if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
            return;
        }

		// skip if coupon tracking is disabled
		if (apply_filters('mc4wp_ecommerce_enable_coupon_tracking', true) === false) {
			return;
		}

        $post_status = get_post_status($post_id);
        switch ($post_status) {
            // only published promos should be sent to Mailchimp
            case 'publish':
                $this->remove_pending_jobs('delete_promo', $post_id);
                $this->add_pending_job('update_promo', $post_id);
                $this->queue->save();
            break;

            default:
                $this->remove_pending_jobs('update_promo', $post_id);
                $this->add_pending_job('delete_promo', $post_id);
                $this->queue->save();
            break;
        }
    }

    public function on_coupon_delete($post_id)
    {
	    // skip if coupon tracking is disabled
	    if (apply_filters('mc4wp_ecommerce_enable_coupon_tracking', true) === false) {
		    return;
	    }

        $this->remove_pending_jobs('update_promo', $post_id);
        $this->add_pending_job('delete_promo', $post_id);
        $this->queue->save();
    }
}
PK     M\	    %  ecommerce3/includes/class-tracker.phpnu [        <?php

class MC4WP_Ecommerce_Tracker
{
    private $plugin_file;
    private $settings;

    /**
    * @var string $plugin_file
    * @var array $settings
    */
    public function __construct($plugin_file, $settings)
    {
        $this->plugin_file = $plugin_file;
        $this->settings = $settings;
    }

    /**
     * Add hooks
     */
    public function hook()
    {
        add_action('wp_enqueue_scripts', array( $this, 'enqueue_assets' ));
        add_action('wp_footer', array( $this, 'output_mcjs_script' ), 60);
        add_action('woocommerce_checkout_update_order_meta', array( $this, 'attach_order_meta' ), 50);
    }

    /**
     * Enqueue script on checkout page that periodically sends form data for guest checkouts.
     */
    public function enqueue_assets()
    {
	    add_filter( 'script_loader_tag', array( $this, 'add_async_attribute' ), 20, 2 );
        wp_enqueue_script('mc4wp-ecommerce-tracker', plugins_url("/assets/js/tracker.js", $this->plugin_file), array(), MC4WP_PREMIUM_VERSION, true);
    }

	public function add_async_attribute( $tag, $handle )
	{
		if ( $handle !== 'mc4wp-ecommerce-tracker' || stripos( $tag, 'defer' ) !== false ) {
			return $tag;
		}

		return str_replace( ' src=', ' defer src=', $tag );
	}

    public function output_mcjs_script()
    {
        if (! $this->settings['load_mcjs_script'] || empty($this->settings['mcjs_url'])) {
            return;
        }

        printf('<script id="mcjs">!function(c,h,i,m,p){m=c.createElement(h),p=c.getElementsByTagName(h)[0],m.async=1,m.src=i,p.parentNode.insertBefore(m,p)}(document,"script","%s");</script>', $this->settings['mcjs_url']);
    }

    /**
     * @param int $order_id
     */
    public function attach_order_meta($order_id)
    {
        $tracking_code = $this->get_tracking_code();
        if (! empty($tracking_code)) {
            update_post_meta($order_id, 'mc_tc', $tracking_code);
        }

        $campaign_id = $this->get_campaign_id();
        if (! empty($campaign_id)) {
            update_post_meta($order_id, 'mc_cid', $campaign_id);
        }

        $email_id = $this->get_email_id();
        if (! empty($email_id)) {
            update_post_meta($order_id, 'mc_eid', $email_id);
        }

        $landing_site = $this->get_landing_site();
        if (! empty($landing_site)) {
            update_post_meta($order_id, 'mc_landing_site', $landing_site);
        }
    }

    /**
     * @param int $order_id (optional)
     * @param string $key
     * @param bool $from_request
     * @return string
     */
    protected function get_value($order_id, $key, $from_request = true)
    {
        $value = '';

        // first, get from order meta
        if ($order_id && is_numeric($order_id)) {
            $value = $this->get_meta_value($order_id, $key);
        }

        if ($from_request) {

            // then, get from URL
            if (empty($value)) {
                $value = $this->get_url_value($key);
            }

            // then, get from cookie
            if (empty($value)) {
                $value = $this->get_cookie_value($key);
            }
        }

        return (string) $value;
    }

    /**
     * @param string $key
     *
     * @return string
     */
    protected function get_url_value($key)
    {
        return empty($_GET[$key]) ? '' : (string) $_GET[ $key ];
    }

    /**
     * @param string $key
     *
     * @return string
     */
    protected function get_cookie_value($key)
    {
        return empty($_COOKIE[ $key ]) ? '' : (string) $_COOKIE[ $key ];
    }

    /**
     * @param int $order_id
     * @param string $key
     *
     * @return string
     */
    protected function get_meta_value($order_id, $key)
    {
        return (string) get_post_meta($order_id, $key, true);
    }

    /**
     * @param int $order_id
     * @param bool $from_request
     * @return string
     */
    public function get_tracking_code($order_id = null, $from_request = true)
    {
        return $this->get_value($order_id, 'mc_tc', $from_request);
    }


    /**
     * @param int $order_id (optional)
     * @param bool $from_request
     *
     * @return string
     */
    public function get_campaign_id($order_id = null, $from_request = true)
    {
        return $this->get_value($order_id, 'mc_cid', $from_request);
    }


    /**
     * @param int $order_id (optional)
     * @param bool $from_request
     * @return string
     */
    public function get_email_id($order_id = null, $from_request = true)
    {
        return $this->get_value($order_id, 'mc_eid', $from_request);
    }

    /**
     * @param int $order_id (optionaL)
     * @param bool $from_request
     * @return string
     */
    public function get_landing_site($order_id = null, $from_request = true)
    {
        return $this->get_value($order_id, 'mc_landing_site', $from_request);
    }
}
PK     M\	  	  $  ecommerce3/includes/views/wizard.phpnu [        <?php defined('ABSPATH') or exit;

$current = (int) $_GET['wizard'];

$steps = array(
    '1' => __('Setup your store', 'mc4wp-ecommerce'),
    '2' => __('Add your products', 'mc4wp-ecommerce'),
    '3' => __('Add your orders', 'mc4wp-ecommerce'),
);
?>

<div class="wrap ecommerce" id="mc4wp-admin">
    <div class="mc4wp-wizard">

        <h1 class="mc4wp-page-title">E-Commerce Configuration</h1>

		<?php
		if (isset($_GET['order-sync-started']) || isset($_GET['product-sync-started'])) {
			echo '<div class="notice notice-info">';
			echo '<p>', sprintf( __( 'Synchronization process started. Please keep an eye on <a href="%s">the debug log</a> for any issues.', 'mc4wp-premium' ), admin_url( 'admin.php?page=mailchimp-for-wp-other' ) ), '</p>';
			echo '</div>';
		}
		?>

        <div class="mc4wp-wizard-steps-nav">
            <?php
			foreach ($steps as $number => $label) {
				printf('<div class="step %s">', $number == $current ? 'current' : '');
				if ($current > $number) {
					printf('<a href="%s">%d. %s</a>', add_query_arg(array( 'wizard' => $number )), $number, $label);
				} else {
					printf('<span>%d. %s</span>', $number, $label);
				}
				printf("</div>");
			}
			?>
        </div>

        <div class="mc4wp-well">

            <div class="mc4wp-wizard-step clearfix" style="display: <?php echo $current == 1 ? 'block' : 'none'; ?>">
                <?php require __DIR__ . '/parts/config-store.php'; ?>
                <br style="clear: none;" />
            </div>

            <div class="mc4wp-wizard-step clearfix" style="display: <?php echo $current == 2 ? 'block' : 'none'; ?>">
                <?php require __DIR__ . '/parts/config-products.php'; ?>
                <br style="clear: none;" />

                <p class="submit">
                    <a class="button button-primary next" href="<?php echo add_query_arg(array( 'wizard' => 3 )); ?>"><?php _e('Next', 'mc4wp-ecommerce'); ?></a>
                </p>
            </div>

            <div class="mc4wp-wizard-step clearfix" style="display: <?php echo $current == 3 ? 'block' : 'none'; ?>">
                <?php require __DIR__ . '/parts/config-orders.php'; ?>
                <br style="clear: none;" />

                <p class="submit">
                    <a class="button button-primary next" href="<?php echo remove_query_arg('wizard'); ?>"><?php _e('Finish', 'mc4wp-ecommerce'); ?></a>
                </p>
            </div>


        </div><!-- / .well -->
    </div><!-- / .wizard -->
</div><!-- / .wrap -->
PK     M\(  (  (  ecommerce3/includes/views/admin-page.phpnu [        <?php
defined('ABSPATH') or exit;
?>

<div id="mc4wp-admin" class="wrap ecommerce">

	<h1 class="mc4wp-page-title">
		<?php echo __('Mailchimp for WordPress', 'mc4wp-ecommerce') . ': ' . __('E-Commerce', 'mc4wp-ecommerce'); ?>
	</h1>

	<?php
	if (isset($_GET['order-sync-started']) || isset($_GET['product-sync-started'])) {
		echo '<div class="notice notice-info">';
		echo '<p>', sprintf( __( 'Synchronization process started. Please keep an eye on <a href="%s">the debug log</a> for any issues.', 'mc4wp-premium' ), admin_url( 'admin.php?page=mailchimp-for-wp-other' ) ), '</p>';
		echo '</div>';
	}
	?>

	<?php if ($connected_list) {
    ?>
    <form method="POST">
		<input type="hidden" name="_mc4wp_action" value="save_ecommerce_settings" />
	    <?php wp_nonce_field( '_mc4wp_action', '_wpnonce' ); ?>
		<input type="hidden" name="_redirect_to" value="<?php echo admin_url( 'admin.php?page=mailchimp-for-wp-ecommerce' ); ?>" />

		<table class="form-table">

            <tr valign="top">
                <th scope="row">
                    <label><?php _e('Synchronize products?', 'mc4wp-ecommerce'); ?></label>
                </th>
                <td>
                    <label class="choice-wrap"><input type="radio" name="mc4wp_ecommerce[enable_product_tracking]" value="1" <?php checked($settings['enable_product_tracking'], 1); ?> />&rlm; <?php _e('Yes'); ?></label>
                    <label class="choice-wrap"><input type="radio" name="mc4wp_ecommerce[enable_product_tracking]" value="0" <?php checked($settings['enable_product_tracking'], 0); ?> />&rlm; <?php _e('No'); ?></label>
                    <p class="description"><?php _e('This synchronizes all product data with Mailchimp.', 'mc4wp-ecommerce'); ?></p>
                </td>
            </tr>

            <?php $config = array( 'element' => 'mc4wp_ecommerce[enable_product_tracking]', 'value' => 1, 'hide' => false ); ?>
            <tr valign="top" data-showif="<?php echo esc_attr(json_encode($config)); ?>">
				<th scope="row">
					<label><?php _e('Synchronize orders?', 'mc4wp-ecommerce'); ?></label>
				</th>
				<td>
					<label class="choice-wrap"><input type="radio" name="mc4wp_ecommerce[enable_order_tracking]" value="1" <?php checked($settings['enable_order_tracking'], 1); ?> />&rlm; <?php _e('Yes'); ?></label>
					<label class="choice-wrap"><input type="radio" name="mc4wp_ecommerce[enable_order_tracking]" value="0" <?php checked($settings['enable_order_tracking'], 0); ?> />&rlm; <?php _e('No'); ?></label>
					<p class="description"><?php _e('This synchronizes all customer & order data with Mailchimp.', 'mc4wp-ecommerce'); ?></p>
				</td>
			</tr>

			<!-- Track all order statuses -->
			<?php $config = array( 'element' => 'mc4wp_ecommerce[enable_order_tracking]', 'value' => 1, 'hide' => false ); ?>
			<tr valign="top" data-showif="<?php echo esc_attr(json_encode($config)); ?>">
				<th scope="row">
					<label><?php _e('Include all order statuses?', 'mc4wp-ecommerce'); ?></label>
				</th>
				<td>
					<label class="choice-wrap"><input type="radio" name="mc4wp_ecommerce[include_all_order_statuses]" value="1" <?php checked($settings['include_all_order_statuses'], 1); ?> />&rlm; <?php _e('Yes'); ?></label>
					<label class="choice-wrap"><input type="radio" name="mc4wp_ecommerce[include_all_order_statuses]" value="0" <?php checked($settings['include_all_order_statuses'], 0); ?> />&rlm; <?php _e('No'); ?></label>
					<p class="description"><?php
    _e('By default, only completed orders are sent to Mailchimp. Select "Yes" to send refunded, cancelled and pending orders too. This is only needed if you use the Order Notifications automation.', 'mc4wp-ecommerce'); ?>
					</p>
				</td>
			</tr>

			<?php $config = array( 'element' => 'mc4wp_ecommerce[enable_order_tracking]', 'value' => 1, 'hide' => false ); ?>
			<tr valign="top" data-showif="<?php echo esc_attr(json_encode($config)); ?>">
				<th scope="row">
					<label><?php _e('Enable cart tracking?', 'mc4wp-ecommerce'); ?></label>
				</th>
				<td>
					<label class="choice-wrap"><input type="radio" name="mc4wp_ecommerce[enable_cart_tracking]" value="1" <?php checked($settings['enable_cart_tracking'], 1); ?> />&rlm; <?php _e('Yes'); ?></label>
					<label class="choice-wrap"><input type="radio" name="mc4wp_ecommerce[enable_cart_tracking]" value="0" <?php checked($settings['enable_cart_tracking'], 0); ?> />&rlm; <?php _e('No'); ?></label>
					<p class="description"><?php printf(__('This allows you to <a href="%s">setup an abandoned cart recovery workflow in Mailchimp</a>.', 'mc4wp-ecommerce'), 'https://www.mc4wp.com/kb/enabling-abandoned-cart-recovery/#utm_source=wp-plugin&utm_medium=mc4wp-premium&utm_campaign=ecommerce-settings-page'); ?></p>
				</td>
			</tr>

			<?php $config = array( 'element' => 'mc4wp_ecommerce[enable_product_tracking]', 'value' => 1, 'hide' => false ); ?>
			<tr valign="top" data-showif="<?php echo esc_attr(json_encode($config)); ?>">
				<th scope="row">
					<label><?php _e('Load MC.js?', 'mc4wp-ecommerce'); ?></label>
				</th>
				<td>
					<label class="choice-wrap"><input type="radio" name="mc4wp_ecommerce[load_mcjs_script]" value="1" <?php checked($settings['load_mcjs_script'], 1); ?> />&rlm; <?php _e('Yes'); ?></label>
					<label class="choice-wrap"><input type="radio" name="mc4wp_ecommerce[load_mcjs_script]" value="0" <?php checked($settings['load_mcjs_script'], 0); ?> />&rlm; <?php _e('No'); ?></label>
					<p class="description"><?php _e('Enabling this loads a JavaScript file from Mailchimp that allows for product retargeting & pop-ups.', 'mc4wp-ecommerce'); ?></p>
				</td>
			</tr>

		</table>

		<?php submit_button(); ?>
	</form>

	<div class="mc4wp-margin-m"></div>

	<div>
		<h2><?php _e('Manage Mailchimp data', 'mc4wp-ecommerce'); ?></h2>


		<p>
			<?php printf(__('Your store is currently connected to <strong>%s</strong> in Mailchimp as <strong>%s</strong>. (<a href="%s">edit store settings</a>)', 'mc4wp-ecommerce'), sprintf('<a href="https://admin.mailchimp.com/lists/members/?id=%s">%s</a>', $connected_list->web_id, esc_html($connected_list->name)), esc_html($settings['store']['name']), add_query_arg(array( 'edit' => 'store' ))); ?>
		</p>

<?php
// show last updated timestamp
if (! empty($settings['last_updated'])) {
    $formatted_date = gmdate(get_option('date_format') . ' ' . get_option('time_format'), $settings['last_updated'] + (get_option('gmt_offset', 0) * 3600));
    printf('<p><strong>' . __('Last updated:', 'mc4wp-ecommerce') . '</strong> %s</p>', $formatted_date);
}

    if ($queue) {
        $next_run = wp_next_scheduled('mc4wp_ecommerce_process_queue');
        $seconds_until_next_run = $next_run - time();
        $count = count($queue->all());

        echo '<div class="mc4wp-well mc4wp-margin-s">';
        echo '<h3>' . __('Queued background jobs', 'mc4wp-ecommerce') . '</h3>';
        echo '<p>';

        echo sprintf(__('<strong id="mc4wp-pending-background-jobs-count">%d</strong> background jobs waiting to be processed.', 'mc4wp-ecommerce'), $count);

        if ($count > 0) {
            echo ' ' . sprintf(__('Pending jobs will be processed in <strong data-countdown="true">%s</strong> seconds.'), max(0, $seconds_until_next_run));

            if ($seconds_until_next_run <= 0) {
                add_action('shutdown', 'spawn_cron');
            }
        }

        echo '</p>';

        if ($count > 0) {
            echo '<div id="queue-processor"></div>';
        }

        echo '<p class="description">' . sprintf(__('Please keep an eye on the <a href="%s">debug log</a> for any errors.', 'mc4wp-ecommerce'), admin_url('admin.php?page=mailchimp-for-wp-other')) . '</p>';

        echo sprintf('<pre class="mc4wp-margin-s" style="display: %s;">', isset($_GET['debug']) || isset($_GET['debug_queue']) ? '' : 'none');
        var_dump($queue->all());
        echo '</pre>';


        echo '</div>';
    } ?>

		<!-- products wizard -->
		<div class="mc4wp-well mc4wp-margin-s">
			<?php require __DIR__ . '/parts/config-products.php'; ?>
		</div>
		<!-- / End products wizard -->

		<!-- orders wizard -->
		<div class="mc4wp-well mc4wp-margin-s">
			<?php require __DIR__ . '/parts/config-orders.php'; ?>
		</div>
		<!-- / End orders wizard -->

		<div class="mc4wp-margin-l mc4wp-well" style="background-color: rgba(255, 50, 50, 0.10);">
			<h3><?php _e('Reset Mailchimp connection', 'mc4wp-ecommerce'); ?></h3>
			<p>	<?php printf(__('Your store is currently connected to <strong>%s</strong> in Mailchimp as <strong>%s</strong>.', 'mc4wp-ecommerce'), sprintf('<a href="https://admin.mailchimp.com/lists/members/?id=%s">%s</a>', $connected_list->web_id, esc_html($connected_list->name)), esc_html($settings['store']['name'])); ?>
		<?php _e('Use the button below to disconnect your store.', 'mc4wp-ecommerce'); ?>
			</p>
			<form method="POST" data-confirm="<?php esc_attr_e('Are you sure you want to reset all of your e-commerce data?', 'malchimp-for-wp'); ?>">
				<input type="hidden" name="_mc4wp_action" value="ecommerce_reset">
                <?php wp_nonce_field( '_mc4wp_action', '_wpnonce' ); ?>
                <p>
					<label><input type="checkbox" name="delete_store_in_mailchimp" value="1" checked /> <?php _e('Delete store data from Mailchimp.', 'mc4wp-ecommerce'); ?></label>
				</p>
				<p>
					<input type="submit" value="<?php esc_attr_e('Reset store', 'mc4wp-ecommerce'); ?>" class="button button-secondary" />
				</p>
			</form>
		</div>

	</div> <!-- / End store data overview -->
	<?php
} else {
        ?>
		<div class="mc4wp-margin-l">
			<h3><?php _e('Connect your store to Mailchimp', 'mc4wp-ecommerce'); ?></h3>
			<p><?php printf(__('To use the e-commerce features, please start by <a href="%s">connecting your store to Mailchimp</a>.', 'mc4wp-ecommerce'), add_query_arg(array( 'wizard' => 1 ))); ?></p>
		</div>
	<?php
    } ?>

    <div class="mc4wp-margin-m"></div>

	<!-- help link -->
	<p>
		<?php printf(__('For more information on <a href="%s">using Mailchimp e-commerce</a>, please refer to our knowledge base.', 'mc4wp-ecommerce'), 'https://www.mc4wp.com/kb/what-is-ecommerce/'); ?>
	</p>
	<!-- / help link -->

    <div class="mc4wp-margin-m"></div>

</div><!-- / End page wrap -->
PK     M\Oh  h  3  ecommerce3/includes/views/parts/config-products.phpnu [        <?php
/** @var MC4WP_Ecommerce_Object_Count $product_count */
?>

<h3>
    <?php _e('Products', 'mc4wp-ecommerce'); ?>
    <?php printf('<span class="mc4wp-status-label">%d/%d</span>', $product_count->tracked, $product_count->all); ?>
</h3>

<p>
    <?php _e('Your products have to be synchronized to Mailchimp before we can proceed to tracking your orders.', 'mc4wp-ecommerce'); ?>
</p>

<div data-wizard="products" data-object-ids="<?php echo esc_attr( json_encode($untracked_product_ids) ); ?>"></div>
<noscript><?php esc_html_e('Please enable JavaScript to use this feature.', 'mc4wp-ecommerce'); ?></noscript>

PK     M\X  X  1  ecommerce3/includes/views/parts/config-orders.phpnu [        <?php
/** @var MC4WP_Ecommerce_Object_Count $order_count */
?>
<h3>
    <?php _e('Orders', 'mc4wp-ecommerce'); ?>
    <?php printf('<span class="mc4wp-status-label">%d/%d</span>', $order_count->tracked, $order_count->all); ?>
</h3>

<p>
    <?php _e('Adding your orders to Mailchimp will allow you to see purchases made by your list subscribers.', 'mc4wp-ecommerce'); ?>
</p>

<div data-wizard="orders" data-object-ids="<?php echo esc_attr( json_encode($untracked_order_ids) ); ?>"></div>
<noscript><?php esc_html_e('Please enable JavaScript to use this feature.', 'mc4wp-ecommerce'); ?></noscript>

PK     M\s;    0  ecommerce3/includes/views/parts/config-store.phpnu [        <!-- Store configuration -->
<h3><?php _e('Store settings', 'mc4wp-ecommerce'); ?></h3>

<form method="post">
    <input type="hidden" name="_mc4wp_action" value="save_ecommerce_settings" />
	<?php wp_nonce_field( '_mc4wp_action', '_wpnonce' ); ?>
    <input type="hidden" name="_redirect_to" value="<?php echo add_query_arg(array( 'wizard' => '2' )); ?>" />
    <table class="form-table">
        <tr valign="top">
            <th scope="row">
                <label><?php _e('Name', 'mc4wp-ecommerce'); ?></label>
            </th>
            <td>
                <input class="regular-text" name="mc4wp_ecommerce[store][name]" value="<?php echo esc_attr($settings['store']['name']); ?>" required />
                <p class="description"><?php _e('The name of your store.', 'mc4wp-ecommerce'); ?></p>
            </td>
        </tr>
        <tr valign="top">
            <th scope="row">
                <label><?php _e('List', 'mc4wp-ecommerce'); ?></label>
            </th>
            <td>
                <select name="mc4wp_ecommerce[store][list_id]" required <?php if (! empty($disable_list_select)) {
    echo 'disabled';
} ?>>
                    <option value="" readonly><?php _e('Select a Mailchimp list', 'mc4wp-ecommerce'); ?></option>
                    <?php foreach ($lists as $list) {
    ?>
                        <option value="<?php echo esc_attr($list->id); ?>" <?php selected($settings['store']['list_id'], $list->id); ?>><?php echo esc_html($list->name); ?></option>
                    <?php
} ?>
                </select>
                <p class="description">
                    <?php _e('The Mailchimp list associated with your store.', 'mc4wp-ecommerce'); ?>
                    <?php if (! empty($disable_list_select)) {
        echo sprintf(' <span><a href="%s">' . __('How to change this?', 'mc4wp-ecommerce') . '</a></span>', 'https://www.mc4wp.com/kb/change-mailchimp-ecommerce-list/');
    } ?>
                </p>
            </td>
        </tr>
        <tr valign="top">
            <th scope="row">
                <label><?php _e('Currency', 'mc4wp-ecommerce'); ?></label>
            </th>
            <td>
                <select name="mc4wp_ecommerce[store][currency_code]" required>
                    <option readonly><?php _e('Select a currency', 'mc4wp-ecommerce'); ?></option>
                    <?php foreach (get_woocommerce_currencies() as $code => $label) {
        ?>
                        <option value="<?php echo esc_attr($code); ?>" <?php selected($settings['store']['currency_code'], $code); ?>><?php echo esc_html($label); ?></option>
                    <?php
    } ?>
                </select>
                <p class="description"><?php _e('The currency that your store accepts.', 'mc4wp-ecommerce'); ?></p>
            </td>
        </tr>
        <tr valign="top">
            <th scope="row">
                <label><?php _e('Enable automations?', 'mc4wp-ecommerce'); ?></label>
            </th>
            <td>
                <label class="choice-wrap"><input type="radio" name="mc4wp_ecommerce[store][is_syncing]" value="0" <?php checked($settings['store']['is_syncing'], 0); ?> />&rlm; <?php _e('Yes'); ?></label>
                <label class="choice-wrap"><input type="radio" name="mc4wp_ecommerce[store][is_syncing]" value="1" <?php checked($settings['store']['is_syncing'], 1); ?> />&rlm; <?php _e('No'); ?></label>
                <p class="description"><?php _e('Should adding orders or carts to Mailchimp send out e-commerce automations? Do not forget to re-enable this after you are done connecting your store to Mailchimp.', 'mc4wp-ecommerce'); ?></p>
            </td>
        </tr>
    </table>

    <?php submit_button(__('Save store', 'mc4wp-ecommerce')); ?>

</form>

<!-- / Store configuration -->
PK     M\BK7q  q  (  ecommerce3/includes/views/edit-store.phpnu [        <?php
defined('ABSPATH') or exit;

$disable_list_select = true;
?>

<div id="mc4wp-admin" class="wrap ecommerce">

	<h1 class="mc4wp-page-title">
		<?php echo __('Mailchimp for WordPress', 'mc4wp-ecommerce') . ': ' . __('E-Commerce', 'mc4wp-ecommerce'); ?>
	</h1>

	<?php require __DIR__ . '/parts/config-store.php'; ?>

	<p>
		<a href="<?php echo admin_url('admin.php?page=mailchimp-for-wp-ecommerce'); ?>">&lsaquo; Go back</a>
	</p>

    <div class="mc4wp-margin-m"></div>

	<!-- help link -->
	<p>
		<?php printf(__('For more information on <a href="%s">using Mailchimp e-commerce</a>, please refer to our knowledge base.', 'mc4wp-ecommerce'), 'https://www.mc4wp.com/kb/what-is-ecommerce/#utm_source=wp-plugin&utm_medium=mc4wp-premium&utm_campaign=ecommerce-settings-page'); ?>
	</p>
	<!-- / help link -->

    <div class="mc4wp-margin-m"></div>

</div><!-- / End page wrap -->
PK     M\9F&  &  "  ecommerce3/includes/class-lock.phpnu [        <?php

/**
 * Class MC4WP_Lock
 *
 * @see https://symfony.com/doc/current/components/lock.html
 */
class MC4WP_Lock {
	private $ttl;
	private $option_name;
	private $acquired = false;

	public function __construct( $name, $ttl = 300 ) {
		$this->option_name = 'mc4wp_lock_' . $name;
		$this->ttl = $ttl;
	}

	private function ensure_row_exists() {
		global $wpdb;
		$sql = $wpdb->prepare("SELECT COUNT(*) FROM {$wpdb->options} WHERE option_name = %s;", $this->option_name );
		$count = (int) $wpdb->get_var( $sql );
		if ( $count === 1 ) {
			return;
		}

		$sql = $wpdb->prepare( "INSERT INTO {$wpdb->options} (option_name, option_value, autoload) VALUES(%s, '0', 'no');", $this->option_name );
		$wpdb->query( $sql );
	}

	/**
	 * @return bool
	 */
	public function acquire() {
		global $wpdb;
		$this->ensure_row_exists();
		$current_time = time();
		$max_time = $current_time - $this->ttl;
		$sql = $wpdb->prepare( "UPDATE {$wpdb->options} SET option_value = %s WHERE option_name = %s AND option_value < %d;", $current_time, $this->option_name, $max_time );
		$success = ( (int) $wpdb->query( $sql ) ) === 1;
		if ( true === $success ) {
			$this->acquired = true;
		}
		return $success;
	}

	/**
	 * @return bool
	 */
	public function release() {
		if ( true !== $this->acquired ) {
			return false;
		}

		global $wpdb;
		$sql = $wpdb->prepare( "UPDATE {$wpdb->options} SET option_value = '0' WHERE option_name = %s;", $this->option_name );
		$success = ( (int) $wpdb->query( $sql ) ) === 1;
		if ( $success ) {
			$this->acquired = false;
		}
		return $success;
	}
}
PK     M\rd  rd  '  ecommerce3/includes/class-ecommerce.phpnu [        <?php

/**
* Class MC4WP_Ecommerce
*
* @since 4.0
*/
class MC4WP_Ecommerce
{

    /**
    * @const string
    */
    const META_KEY = 'mc4wp_updated_at';

    /**
    * @var MC4WP_Ecommerce_Object_Transformer
    */
    public $transformer;

    /**
    * @var string The ID of the store object in Mailchimp
    */
    private $store_id;

    const ERR_NO_ITEMS = 29001;
    const ERR_NO_EMAIL_ADDRESS = 29002;

    /**
    * Constructor
    *
    * @param string $store_id
    * @param MC4WP_Ecommerce_Object_Transformer $transformer
    */
    public function __construct($store_id, MC4WP_Ecommerce_Object_Transformer $transformer)
    {
        $this->store_id = $store_id;
        $this->transformer = $transformer;
    }

    /**
    * @param string $store_id
    */
    public function set_store_id($store_id)
    {
        $this->store_id = $store_id;
    }

    /**
    * Update the "last updated" settings to now.
    *
    * @param int $post_id
    */
    public function touch($post_id = 0)
    {
        if ($post_id) {
            update_post_meta($post_id, self::META_KEY, date('c'));
        }

        mc4wp_ecommerce_update_settings(array( 'last_updated' => time() ));
    }

    /**
     * @param string $cart_id
     *
     * @return object
     * @throws MC4WP_API_Exception|Exception
     */
    public function get_cart($cart_id)
    {
        $api = $this->get_api();

        return $api->get_ecommerce_store_cart($this->store_id, $cart_id);
    }

    /**
     * Add OR update a cart in Mailchimp.
     *
     * @param string $cart_id
     * @param object|WC_Customer|WP_User $customer
     * @param array $cart_contents
     *
     * @return bool
     * @throws MC4WP_API_Exception|Exception
     */
    public function update_cart($cart_id, $customer, array $cart_contents)
    {
        /**
         * Determine if a cart will be sent to Mailchimp.
         *
         * @param bool $send
         * @param object|WC_Customer|WP_User $customer
         * @param array $cart_contents
         *
         * @return bool on true will be sent to Mailchimp otherwise not.
         */
        $send_to_mailchimp = apply_filters('mc4wp_ecommerce_send_cart_to_mailchimp', true, $customer, $cart_contents);
        if (! $send_to_mailchimp) {
            return false;
        }

        $api = $this->get_api();
        $store_id = $this->store_id;

        if (is_array($customer) && isset($customer['customer'])) {
            // For backwards compatibility with queue data from before MC4WP Premium v3.4
            $cart_data = $customer;
        } else {
            $customer_data = $this->transformer->customer($customer);
            $cart_data = $this->transformer->cart($customer_data, $cart_contents);
        }

        // add (or update) customer
        $customer_data = $api->add_ecommerce_store_customer($store_id, $cart_data['customer']);

        // replace customer object in cart data with array with just an id
        $cart_data['customer'] = array(
            'id' => $customer_data->id,
        );

        // add or update cart
        try {
            $cart_data = $api->update_ecommerce_store_cart($store_id, $cart_id, $cart_data);
        } catch (MC4WP_API_Resource_Not_Found_Exception $e) {
            $cart_data = $api->add_ecommerce_store_cart($store_id, $cart_data);
        }

        $this->touch();

        return true;
    }

    /**
     * @param string $cart_id
     *
     * @return bool
     * @throws Exception
     */
    public function delete_cart($cart_id)
    {
        $api = $this->get_api();
        $store_id = $this->store_id;
        $result = $api->delete_ecommerce_store_cart($store_id, $cart_id);
        $this->touch();
        return $result;
    }

    /**
     * @param WP_User|WC_Order|object $customer_data
     *
     * @return string
     * @throws MC4WP_API_Exception|Exception
     */
    private function add_or_update_customer($customer_data)
    {
        $api = $this->get_api();
        $store_id = $this->store_id;

        // get customer data
        $customer_data = $this->transformer->customer($customer_data);

        // add or update customer
        $api->add_ecommerce_store_customer($store_id, $customer_data);

        $this->touch();

        return $customer_data['id'];
    }

    /**
     * @param WP_User|WC_Order|object $customer_data
     *
     * @return string
     * @throws MC4WP_API_Exception|Exception
     */
    public function update_customer($customer_data)
    {
        /**
         * Determine if a customer get sent to mailchimp.
         *
         * @param bool
         * @param WP_User|WC_Order|object
         *
         * @return bool on true it will be sent to Mailchimp on false not.
         */
        $send_to_mailchimp = apply_filters('mc4wp_ecommerce_send_customer_to_mailchimp', true, $customer_data);
        if (! $send_to_mailchimp) {
            return '';
        }

        $api = $this->get_api();
        $store_id = $this->store_id;

	    // allow short-circuiting this method by return false from the filter hook called in the transformer class
	    $customer_data = $this->transformer->customer($customer_data);
	    if (false === is_array($customer_data)) {
		    return false;
	    }

        // update customer
        $api->update_ecommerce_store_customer($store_id, $customer_data['id'], $customer_data);

        $this->touch();

        return $customer_data['id'];
    }

    /**
    * @param int|WC_Order $order
    * @return boolean
    * @throws MC4WP_API_Exception|Exception
    */
    public function update_order($order)
    {
        // get & validate order
        $order = wc_get_order($order);
        if (! $order instanceof WC_Order) {
            throw new Exception(sprintf("Order #%d is not a valid order ID.", $order));
        }

        /**
        * Filters whether the order should be sent to Mailchimp.
        *
        * @param boolean $send Whether to send the order to Mailchimp, defaults to true.
        * @param WC_Order $order The order object.
        * @return bool
        */
        $send_to_mailchimp = apply_filters('mc4wp_ecommerce_send_order_to_mailchimp', true, $order);
        if (! $send_to_mailchimp) {
            return false;
        }

        // add or update customer in Mailchimp
        $this->add_or_update_customer($order);

        // get order data
        $order_id = $this->transformer->order_id($order);

	    // allow short-circuiting this method by return false from the filter hook called in the transformer class
	    $data = $this->transformer->order($order);
        if (false === is_array($data)) {
        	return false;
        }

        // validate existence of products in order
        foreach ($data['lines'] as $key => $line) {
            $product = wc_get_product($line['product_id']);
            $product_variation = wc_get_product($line['product_variant_id']);
            if (! $product || ! $product_variation) {
                // product or variant does no longer exist, replace with a generic deleted product.
                $this->ensure_deleted_product();

                // replace ID with ID of the generic "deleted product"
                $data['lines'][$key]['product_id'] = 'deleted';
                $data['lines'][$key]['product_variant_id'] = 'deleted';
            }
        }

        // throw exception if order contains no lines
        if (empty($data['lines'])) {
            throw new Exception("Order contains no items.", self::ERR_NO_ITEMS);
        }

        // add OR update order in Mailchimp
        return $this->is_object_tracked($order_id) ? $this->order_update($order, $data) : $this->order_add($order, $data);
    }

    /**
    * @param int $order_id
    *
    * @return boolean
    *
    * @throws MC4WP_API_Exception|Exception
    */
    public function delete_order($order_id)
    {
        $api = $this->get_api();
        $store_id = $this->store_id;

        try {
            $success = $api->delete_ecommerce_store_order($store_id, $order_id);
        } catch (MC4WP_API_Resource_Not_Found_Exception $e) {
            // good, order already non-existing
            $success = true;
        }

        // remove meta on success
        delete_post_meta($order_id, self::META_KEY);

        $this->touch();

        return $success;
    }

    /**
    * @param WC_Order $order
    * @param array $data
    * @param bool $recurse
    *
    * @return bool
    *
    * @throws MC4WP_API_Exception|Exception
    */
    private function order_add(WC_Order $order, array $data, $recurse = true)
    {
        $api = $this->get_api();
        $store_id = $this->store_id;

        // check for method existence first because wc pre-3.0
        $order_id = $this->transformer->order_id($order);
        $order_number = $this->transformer->order_number($order);

        try {
            $response = $api->add_ecommerce_store_order($store_id, $data);
        } catch (MC4WP_API_Exception $e) {
            // update order if it already exists
            if ($recurse && stripos($e->detail, 'order with the provided ID already exists') !== false) {
                return $this->order_update($order, $data, false);
            }

            // if campaign_id data is corrupted somehow, retry without campaign data.
            if (! empty($data['campaign_id']) && stripos($e->detail, 'campaign with the provided ID does not exist') !== false) {
                unset($data['campaign_id']);
                return $this->order_add($order, $data);
            }

            throw $e;
        }

        $this->touch($order_id);
        return true;
    }

    /**
     * @param WC_Order $order
     * @param array $data
     * @param bool $recurse
     * @return bool
     * @throws MC4WP_API_Exception|Exception
     */
    private function order_update(WC_Order $order, array $data, $recurse = true)
    {
        $api = $this->get_api();
        $store_id = $this->store_id;

        // check for method existence first because wc pre-3.0
        $order_id = $this->transformer->order_id($order);
        $order_number = $this->transformer->order_number($order);

        try {
            // use order number here as that is what we send in order_add too.
            $response = $api->update_ecommerce_store_order($store_id, $order_number, $data);
        } catch (MC4WP_API_Resource_Not_Found_Exception $e) {
            if ($recurse) {
                return $this->order_add($order, $data, false);
            }

            throw $e;
        } catch (MC4WP_API_Exception $e) {
            // if campaign_id data is corrupted somehow, retry without campaign data.
            if (! empty($data['campaign_id']) && stripos($e->detail, 'campaign with the provided ID does not exist') !== false) {
                unset($data['campaign_id']);
                return $this->order_update($order, $data);
            }

            throw $e;
        }

        $this->touch($order_id);
        return true;
    }

    /**
    * Since Mailchimp does not allow connecting two sites that share the same domain (they strip off the entire subdirectory part) we generate a unique domain here.
    *
    * @return string
    */
    private function get_site_domain()
    {
        $domain = str_ireplace(array( 'https://', 'http://', '://' ), '', get_home_url());

        if (is_multisite() && strpos($domain, '/') > strpos($domain, '.')) {
            $subdir_pos = strpos($domain, '/');
            $subdir = substr($domain, $subdir_pos + 1);
            $domain = substr($domain, 0, $subdir_pos);
            $domain = $subdir . '.' . $domain;
        }

        return $domain;
    }

    /**
    * Add or update store in Mailchimp.
    *
    * @param array $data
    * @throws MC4WP_API_Exception|Exception
    * @return object
    */
    public function update_store(array $data)
    {
        $api = $this->get_api();
        $store_id = $this->store_id;

        $data['id'] = (string) $store_id;
        $data['platform'] = 'WooCommerce';
        $data['domain'] = $this->get_site_domain();
        $data['email_address'] = get_option('admin_email');
        $data['primary_locale'] = substr(get_locale(), 0, 2);
        $data['address'] = array(
            'address1' => get_option('woocommerce_store_address', ''),
            'address2' => get_option('woocommerce_store_address_2', ''),
            'city' => get_option('woocommerce_store_city', ''),
            'postal_code' => get_option('woocommerce_store_postcode', ''),
            'country_code' => get_option('woocommerce_default_country', ''),
        );

        // make sure we got a boolean value.
        if (isset($data['is_syncing'])) {
            $data['is_syncing'] = !!$data['is_syncing'];
        }

        /**
        * Filter the store data we send to Mailchimp.
        *
        * @param array $data
        */
        $data = apply_filters('mc4wp_ecommerce_store_data', $data);

        try {
            $res = $api->update_ecommerce_store($store_id, $data);
        } catch (MC4WP_API_Resource_Not_Found_Exception $e) {
            $res = $api->add_ecommerce_store($data);
        } catch (MC4WP_API_Exception $e) {
            if ($e->status == 400 && stripos($e->detail, "list may not be changed") !== false) {
                // delete local tracking indicators
                delete_post_meta_by_key(MC4WP_Ecommerce::META_KEY);

                // delete old store
                $api->delete_ecommerce_store($store_id);

                // add new store
                $res = $api->add_ecommerce_store($data);
            } else {
                throw $e;
            }
        }

        $this->touch();

        return $res;
    }

    /**
     * @throws MC4WP_API_Exception|Exception
     */
    public function ensure_connected_site()
    {
        $api = $this->get_api();
        $client = $api->get_client();

        try {
            // first, query site to see if it exists
            $resource = sprintf('/connected-sites/%s', $this->store_id);
            $response = $client->get($resource, array());
        } catch (MC4WP_API_Resource_Not_Found_Exception $e) {
            // if it does not exist, add it
            $response = $client->post('/connected-sites', array(
                'foreign_id' => $this->store_id,
                'domain' => $this->get_site_domain(),
            ));
        }
    }

    /**
     * @throws MC4WP_API_Exception|Exception
     */
    public function verify_store_script_installation()
    {
        $api = $this->get_api();
        $client = $api->get_client();
        $resource = sprintf('/connected-sites/%s/actions/verify-script-installation', $this->store_id);
        $client->post($resource, array());
    }

    /**
    * Add or update a product + variants in Mailchimp.
    *
    * TODO: Mailchimp interface does not yet reflect product "updates".
    *
    * @param int|WC_Product $product Post object or post ID of the product.
    * @return boolean
    * @throws MC4WP_API_Exception|Exception
    */
    public function update_product($product)
    {
        $product = wc_get_product($product);

        // check if product exists
        if (! $product instanceof WC_Product) {
            throw new Exception(sprintf("#%d is not a valid product ID", $product));
        }

        $product_id = $this->transformer->product_id($product);

        // make sure product is not a product-variation
        if ($product instanceof WC_Product_Variation) {
            throw new Exception(sprintf("#%d is a variation of another product. Use the variable parent product instead.", $product_id));
        }

        $product_data = $this->transformer->product($product);
        $variants_data = $this->transformer->product_variants($product);
        return $this->is_object_tracked($product_id) ? $this->product_update($product, $product_data, $variants_data) : $this->product_add($product, $product_data, $variants_data);
    }

    /**
    * @param int $product_id
    * @return boolean
    *
    * @throws MC4WP_API_Exception|Exception
    */
    public function delete_product($product_id)
    {
        $api = $this->get_api();
        $store_id = $this->store_id;

        try {
            $success = $api->delete_ecommerce_store_product($store_id, $product_id);
        } catch (MC4WP_API_Resource_Not_Found_Exception $e) {
            // product or store already non-existing: good!
            $success = true;
        }

        delete_post_meta($product_id, self::META_KEY);

        $this->touch();

        return $success;
    }


    /**
    * @param WC_Product $product
    * @param array $product_data
    * @param array $variants_data
    * @param bool $recurse
    *
    * @return bool
    *
    * @throws MC4WP_API_Exception|Exception
    */
    private function product_add(WC_Product $product, array $product_data, $variants_data = array(), $recurse = true)
    {
        $api = $this->get_api();
        $store_id = $this->store_id;
        $product_id = $this->transformer->product_id($product);

        try {
            $response = $api->add_ecommerce_store_product($store_id, $product_data);

            // update each variant separately to work around Mailchimp API timeout issues with many variations (as of Jan 04, 2019)
            foreach ($variants_data as $variant_data) {
                $api->add_ecommerce_store_product_variant($store_id, $product_id, $variant_data);
            }
        } catch (MC4WP_API_Exception $e) {
            // update product if it already exists remotely.
            if ($recurse && (stripos($e->detail, 'product with the provided ID already exists') || stripos($e->detail, 'variant with the provided ID already exists'))) {
                return $this->product_update($product, $product_data, $variants_data, false);
            }

            throw $e;
        }

        $this->touch($product_id);
        return true;
    }

    /**
     * @param WC_Product $product
     * @param array $product_data
     * @param array $variants_data
     * @param bool $recurse
     * @return bool
     * @throws MC4WP_API_Exception|Exception
     */
    private function product_update(WC_Product $product, array $product_data, $variants_data = array(), $recurse = true)
    {
        $api = $this->get_api();
        $store_id = $this->store_id;
        $product_id = $this->transformer->product_id($product);

        try {
            // this method was added in Mailchimp for WordPress v4.0.12
            if (method_exists($api, 'update_ecommerce_store_product')) {
                $response = $api->update_ecommerce_store_product($store_id, $product_id, $product_data);
            }

            // update each variant separately to work around Mailchimp API timeout issues with many variations (as of Jan 04, 2019)
            foreach ($variants_data as $variant_data) {
                $api->add_ecommerce_store_product_variant($store_id, $product_id, $variant_data);
            }
        } catch (MC4WP_API_Resource_Not_Found_Exception $e) {
            if ($recurse) {
                return $this->product_add($product, $product_data, $variants_data, false);
            }

            throw $e;
        }

        $this->touch($product_id);
        return true;
    }

    /**
    * @param int $object_id
    *
    * @return bool
    */
    public function is_object_tracked($object_id)
    {
        return !! get_post_meta($object_id, self::META_KEY, true);
    }

    /**
     * @return \MC4WP_API_v3
     * @throws Exception
     */
    private function get_api()
    {
        return mc4wp('api');
    }

    /**
     * Ensures the existence of a deleted product in Mailchimp, to be used in orders referencing a no-longer existing product.
     *
     * @return void
     * @throws MC4WP_API_Exception|Exception
     */
    private function ensure_deleted_product()
    {
        static $exists = false;

        if ($exists) {
            return;
        }

        // create or update deleted product in Mailchimp
        $store_id = $this->store_id;
        $api = $this->get_api();

        $product_id = 'deleted';
        $product_title = '(deleted product)';
        $data = array(
            'id' => $product_id,
            'title' => $product_title,
            'variants' => array(
                array(
                    'id' => $product_id,
                    'title' => $product_title,
                    'inventory_quantity' => 0,
                )
            )
        );

        try {
            $response = $api->update_ecommerce_store_product($store_id, $product_id, $data);
        } catch (MC4WP_API_Resource_Not_Found_Exception $e) {
            $response = $api->add_ecommerce_store_product($store_id, $data);
        }

        // set flag to short-circuit this function next time it runs
        $exists = true;
    }


    /**********************
    * 		Promo codes 	 *
    **********************/

    /**
     * Deletes the associated promo from the connected store.
     * @param int $coupon_id
     * @throws MC4WP_API_Exception|Exception
     */
    public function delete_promo($coupon_id)
    {
        $store_id = $this->store_id;
        $api = $this->get_api();

        // fail silently if API class does not have method. This means user should update their Mailchimp for WordPress version.
        if (! method_exists($api, 'delete_ecommerce_store_promo_rule')) {
            return;
        }

        try {
            // TODO: Check if we need to delete children of the promo rule?
            //$api->delete_ecommerce_store_promo_rule_promo_code( $store_id, $coupon_id, $coupon_id );
            $api->delete_ecommerce_store_promo_rule($store_id, $coupon_id);
        } catch (MC4WP_API_Resource_Not_Found_Exception $e) {
            // good. promo was not there to begin with.
        }

        $this->touch();
    }

    /**
     * Adds or updates the associated promo in the connected store.
     * @param int $coupon_id
     * @throws MC4WP_API_Exception|Exception
     */
    public function update_promo($coupon_id)
    {
        $store_id = $this->store_id;
        $api = $this->get_api();

        // fail silently if API class does not have method. This means user should update their Mailchimp for WordPress version.
        if (! method_exists($api, 'delete_ecommerce_store_promo_rule')) {
            return;
        }

        $wc_coupon = new WC_Coupon($coupon_id);

        // fail silently if on WooCommerce v2.x
        if (! method_exists($wc_coupon, 'get_code')) {
            return;
        }

        // create promo rule
        $promo_rule_data = array(
            'id' => (string) $coupon_id,
            'title' => (string) $wc_coupon->get_code(),
            'description' => (string) $wc_coupon->get_description(),
            'enabled' => true,
            'amount' => (float) $wc_coupon->get_amount('edit'),
        );

        if (empty($promo_rule_data['description'])) {
            $promo_rule_data['description'] = (string) $wc_coupon->get_code();
        }

        // determine whether rule is enabled
        $expires = $wc_coupon->get_date_expires();
        if ($expires) {
            $promo_rule_data['ends_at'] = (string) $expires;

            if (current_time('timestamp', true) >= $expires->getTimestamp()) {
                $promo_rule_data['enabled'] = false;
            }
        }

        switch ($wc_coupon->get_discount_type()) {
            case 'fixed_product':
                $promo_rule_data['type'] = 'fixed';
                $promo_rule_data['target'] = 'per_item';
            break;

            case 'fixed_cart':
                $promo_rule_data['type'] = 'fixed';
                $promo_rule_data['target'] = 'total';
            break;

            case 'percent':
                $promo_rule_data['type'] = 'percentage';
                $promo_rule_data['target'] = 'total';
                $promo_rule_data['amount'] = (float) $wc_coupon->get_amount('edit') / 100;
            break;
        }

        /**
        * Filters the promo rule data before it is sent to Mailchimp
        *
        * @param array $promo_rule_data
        */
        $promo_rule_data = apply_filters('mc4wp_ecommerce_promo_rule_data', $promo_rule_data);

        try {
            $api->update_ecommerce_store_promo_rule($store_id, $promo_rule_data['id'], $promo_rule_data);
        } catch (MC4WP_API_Resource_Not_Found_Exception $e) {
            $api->add_ecommerce_store_promo_rule($store_id, $promo_rule_data);
        }

        // create promo code (child of promo rule)
        $redemption_url = add_query_arg(array(
            'coupon_code' => urlencode($wc_coupon->get_code()),
        ), get_home_url());

        $promo_code_data = array(
            'id' => (string) $coupon_id,
            'code' => (string) $wc_coupon->get_code(),
            'redemption_url' => (string) $redemption_url,
            'usage_count' => (int) $wc_coupon->get_usage_count(),
            'enabled' => $promo_rule_data['enabled'],
        );

        /**
        * Filters the promo code data before it is sent to Mailchimp
        *
        * @param array $promo_code_data
        */
        $promo_code_data = apply_filters('mc4wp_ecommerce_promo_code_data', $promo_code_data);

        try {
            $api->update_ecommerce_store_promo_rule_promo_code($store_id, $promo_rule_data['id'], $promo_code_data['id'], $promo_code_data);
        } catch (MC4WP_API_Resource_Not_Found_Exception $e) {
            $api->add_ecommerce_store_promo_rule_promo_code($store_id, $promo_rule_data['id'], $promo_code_data);
        }

        // update stats on when we last updated
        $this->touch();
    }
}
PK     M\DY    $  ecommerce3/includes/class-helper.phpnu [        <?php


class MC4WP_Ecommerce_Helper
{

    /**
    * @var WPDB
    */
    private $db;

    /**
    * MC4WP_Ecommerce_Helper constructor.
    */
    public function __construct()
    {
        $this->db = $GLOBALS['wpdb'];
    }

    public function get_order_ids()
    {
        $query = $this->get_order_query('DISTINCT(p.id)', false);
        return $this->db->get_col($query);
    }

    public function get_tracked_order_ids()
    {
        $query = $this->get_order_query('DISTINCT(p.id)', true);
        return $this->db->get_col($query);
    }

    public function get_product_ids()
    {
        $query = $this->get_product_query('DISTINCT(p.id)');
        return $this->db->get_col($query);
    }

    public function get_tracked_product_ids()
    {
        $query = $this->get_product_query('DISTINCT(p.id)', true);
        return $this->db->get_col($query);
    }

    /**
    * @param string $select
    * @param bool $tracked_only
    *
    * @return string
    */
    private function get_product_query($select = 'p.*', $tracked_only = false)
    {
	    $query = sprintf("SELECT %s FROM {$this->db->posts} p ", $select);
    	if ($tracked_only) {
		    $query .= sprintf(" RIGHT JOIN {$this->db->postmeta} pm ON p.id = pm.post_id AND pm.meta_key = '%s' ", MC4WP_Ecommerce::META_KEY);
	    }
	    $query .= "WHERE p.post_type = 'product'
			AND p.post_status IN('publish', 'draft', 'private', 'trash') ";

        // order by descending product ID so we start with newest first
        if (strpos($select, 'COUNT') === false) {
	        $query .= " ORDER BY p.id DESC";
        }

        return $query;
    }

    /**
    * @param string $select
    * @param bool $tracked_only
    *
    * @return string
    */
    private function get_order_query($select = 'p.*', $tracked_only = false)
    {
    	// TODO: Improve performance by not really checking for valid email address here.
        $query = "SELECT %s FROM {$this->db->posts} p LEFT JOIN {$this->db->postmeta} pm ON p.id = pm.post_id
			WHERE p.post_type = 'shop_order'
			AND p.post_status IN( %s )";

        // add IN clause for order statuses
        $order_statuses = mc4wp_ecommerce_get_order_statuses();
        $query = sprintf($query, $select . ' ', "'" . join("', '", $this->db->_escape($order_statuses)) . "'");

        if ($tracked_only) {
            $query .= sprintf(" AND pm.meta_key = '%s'", MC4WP_Ecommerce::META_KEY);
        } else {
            $query .= " AND pm.meta_key IN ('_billing_email', 'billing_email', '_customer_user') AND pm.meta_value != '' AND pm.meta_value != '0'";
        }

        // order by descending order ID so we start with newest orders first
        if (strpos($select, 'COUNT') === false) {
            $query .= " ORDER BY p.id DESC";
        }

        return $query;
    }

    /**
    * @param string $email_address
    *
    * @return float
    * @see wc_get_customer_total_spent
    */
    public function get_total_spent_for_email($email_address)
    {

        // use WooCommmerce method when this is a registered customer
        // note that this uses the WooCommerce registered order statuses for "reports" (vs the ones from mc4wp_ecommerce_get_order_statuses())
        if (function_exists('wc_get_customer_total_spent')) {
            $user = get_user_by('email', $email_address);
            if ($user instanceof WP_User && in_array('customer', $user->roles)) {
                return floatval(wc_get_customer_total_spent($user->ID));
            }
        }

        $order_statuses = mc4wp_ecommerce_get_order_statuses();
        $in = join("', '", $this->db->_escape($order_statuses));

        $query = "SELECT SUM(meta2.meta_value)
		FROM {$this->db->posts} as posts
		LEFT JOIN {$this->db->postmeta} AS meta ON posts.ID = meta.post_id AND ( meta.meta_key = '_billing_email' OR meta.meta_key = 'billing_email' )
		LEFT JOIN {$this->db->postmeta} AS meta2 ON posts.ID = meta2.post_id AND meta2.meta_key = '_order_total'
		WHERE   meta.meta_value     = %s
		AND     posts.post_type     = 'shop_order'
		AND     posts.post_status   IN( '{$in}' )
		";

        $query = $this->db->prepare($query, $email_address);

        $result = $this->db->get_var($query);
        return floatval($result);
    }

    /**
    * @param string $email_address
    *
    * @return int
    * @see wc_get_customer_order_count
    */
    public function get_order_count_for_email($email_address)
    {

        // use WooCommmerce method when this is a registered customer
	    // note that this uses the WooCommerce registered order statuses for "reports" (vs the ones from mc4wp_ecommerce_get_order_statuses())
        if (function_exists('wc_get_customer_order_count')) {
            $user = get_user_by('email', $email_address);
            if ($user instanceof WP_User && in_array('customer', $user->roles)) {
                return intval(wc_get_customer_order_count($user->ID));
            }
        }

        $order_statuses = mc4wp_ecommerce_get_order_statuses();
        $in = join("', '", $this->db->_escape($order_statuses));

        $query = "SELECT COUNT(DISTINCT(posts.id))
		FROM {$this->db->posts} as posts
		LEFT JOIN {$this->db->postmeta} AS meta ON posts.ID = meta.post_id
		WHERE meta.meta_key = '_billing_email' AND meta.meta_value     = %s
		AND posts.post_type     = 'shop_order'
		AND posts.post_status   IN( '{$in}' )
		";

        $query = $this->db->prepare($query, $email_address);
        $result = $this->db->get_var($query);
        return intval($result);
    }
}
PK     M\Z9  9  -  ecommerce3/includes/class-transformer-wc2.phpnu [        <?php

/**
 * Class MC4WP_Ecommerce_Object_Transformer_Legacy
 *
 * Handles WooCommerce < 3.0 objects.
 */
class MC4WP_Ecommerce_Object_Transformer_WC2 implements MC4WP_Ecommerce_Object_Transformer
{

    /**
     * @var MC4WP_Ecommerce_Tracker
     */
    protected $tracker;

    /**
     * @var array
     */
    protected $settings;

    /**
     * MC4WP_Ecommerce_Object_Transformer constructor.
     *
     * @param array $settings
     * @param MC4WP_Ecommerce_Tracker $tracker
     */
    public function __construct(array $settings, MC4WP_Ecommerce_Tracker $tracker)
    {
        $this->settings = $settings;
        $this->tracker = $tracker;
    }

    /**
     * @param string $email_address
     *
     * @return string
     */
    public function get_customer_id($email_address)
    {
        return (string) md5(strtolower($email_address));
    }

    /**
     * @param string $customer_email_address
     * @see get_customer_id
     * @return string
     */
    public function get_cart_id($customer_email_address)
    {
        $date = date('Y-m-d');
        $customer_email_address = strtolower(trim($customer_email_address));
        return md5($date . $customer_email_address);
    }

    /**
     * @param object|WP_User|WC_Order $object
     *
     * @return array
     *
     * @throws Exception
     */
    public function customer($object)
    {

        // first, attempt to get billing_email from order or customer object.
        $billing_email = isset($object->billing_email) ? $object->billing_email : '';

        // if the above failed, try "user_email" property
        if (empty($billing_email) && ! empty($object->user_email)) {
            $billing_email = $object->user_email;
        }

        if (empty($billing_email)) {
            throw new Exception("Customer data requires a billing_email property", MC4WP_Ecommerce::ERR_NO_EMAIL_ADDRESS);
        }


        $helper = new MC4WP_Ecommerce_Helper();
        $customer_data = array(
            'email_address' => (string) $billing_email,
            'opt_in_status' => false,
            'address' => array(),
        );

        // add order count
        $order_count = $helper->get_order_count_for_email($billing_email);
        if (! empty($order_count)) {
            $customer_data['orders_count'] = $order_count;
        }

        // add total spent
        $total_spent = $helper->get_total_spent_for_email($billing_email);
        if (! empty($total_spent)) {
            $customer_data['total_spent'] = $total_spent;
        }

        // fill top-level keys
        $map = array(
            'billing_first_name' => 'first_name',
            'billing_last_name' => 'last_name'
        );
        foreach ($map as $source_property => $target_property) {
            if (! empty($object->$source_property)) {
                $customer_data[ $target_property ] = $object->$source_property;
            }
        }


        // fill address keys
        $map = array(
            'billing_address_1' => 'address1',
            'billing_address_2' => 'address2',
            'billing_city' => 'city',
            'billing_state' => 'province',
            'billing_postcode' => 'postal_code',
            'billing_country' => 'country'
        );
        foreach ($map as $source_property => $target_property) {
            if (! empty($object->$source_property)) {
                $customer_data['address'][ $target_property ] = $object->$source_property;
            }
        }

        // strip off empty address property
        if (empty($customer_data['address'])) {
            unset($customer_data['address']);
        }

        /**
         * Filter the customer data before it is sent to Mailchimp.
         */
        $customer_data = apply_filters('mc4wp_ecommerce_customer_data', $customer_data);

        // set ID because we don't want that to be filtered.
        $customer_data['id'] = $this->get_customer_id($billing_email);

        return $customer_data;
    }

    public function order_number(WC_Order $order)
    {
        if (! method_exists($order, 'get_order_number')) {
            return $order->id;
        }

        // WC 2.x prepended a # character
        $order_number = $order->get_order_number();
        if ($order_number[0] === '#') {
            return trim($order_number, '#');
        }

        return $order_number;
    }

    /**
     * @param WC_Order $order
     *
     * @return array
     */
    public function order(WC_Order $order)
    {
        $billing_email = $order->billing_email;

        // generate order data
        $items = $order->get_items();

        // generate item lines data
        $order_lines_data = array();
        foreach ($items as $item_id => $item) {
            // calculate cost of a single item
            $item_price = $item['line_total'] / $item['qty'];

            $line_data = array(
                'id' => (string) $item_id,
                'product_id' => (string) $item['product_id'],
                'product_variant_id' => (string) $item['product_id'],
                'quantity' => (int) $item['qty'],
                'price' => floatval($item_price),
            );

            // use variation ID if set.
            if (! empty($item['variation_id'])) {
                $line_data['product_variant_id'] = (string) $item['variation_id'];
            }

            $order_lines_data[] = $line_data;
        }

        // use order number instead of ID, because emails.
        $order_number = $this->order_number($order);

        // add order
        $order_data = array(
            'id' => (string) $order_number,
            'customer' => array( 'id' => $this->get_customer_id($billing_email) ),
            'order_total' => floatval($order->get_total()),
            'tax_total' => floatval($order->get_total_tax()),
            'shipping_total' => floatval($order->get_total_shipping()),
            'currency_code' => (string) $order->get_order_currency(),
            'lines' => (array) $order_lines_data,
            'processed_at_foreign' => date('Y-m-d H:i:s', strtotime($order->order_date)),
        );

        // set order status
        switch ($order->get_status()) {
            case 'pending':
            case 'on-hold':
            case 'processing':
                $order_data['financial_status'] = 'pending';
                break;

            case 'completed':
                $order_data['financial_status'] = 'paid';
                $order_data['fulfillment_status'] = 'fulfilled';
                break;

            case 'cancelled':
                $order_data['financial_status'] = 'cancelled';
                break;

            case 'refunded':
                $order_data['financial_status'] = 'refunded';
                break;

        }

        // add tracking code(s)
        $tracking_code = $this->tracker->get_tracking_code($order->id);
        if (! empty($tracking_code)) {
            $order_data['tracking_code'] = $tracking_code;
        }

        $campaign_id = $this->tracker->get_campaign_id($order->id);
        if (! empty($campaign_id)) {
            $order_data['campaign_id'] = $campaign_id;
        }

        /**
         * Filter order data that is sent to Mailchimp.
         *
         * @param array $order_data
         * @param WC_Order $order
         */
        $order_data = apply_filters('mc4wp_ecommerce_order_data', $order_data, $order);

        return $order_data;
    }

    public function order_id(WC_Order $order)
    {
        if (method_exists($order, 'get_id')) {
            return $order->get_id();
        }

        if (!empty($order->id)) {
            return $order->id;
        }

        throw new Exception('Can not get ID from order');
    }

    /**
     * @param WC_Product $product
     * @return int
     * @throws Exception
     */
    public function product_id(WC_Product $product)
    {
        if (method_exists($product, 'get_id')) {
            return $product->get_id();
        }

        if (!empty($product->id)) {
            return $product->id;
        }

        throw new Exception('Can not get ID from product');
    }

    /**
     * @param WC_Product $product
     *
     * @return array
     */
    public function product(WC_Product $product)
    {

        // data to send to Mailchimp
        $product_data = array(
            // required
            'id' => (string) $product->id,
            'title' => (string) strip_tags($product->get_title()),
            'url' => (string) $product->get_permalink(),
            'variants' => array(
                $this->get_product_variant_data($product),
            ),
            'image_url' => function_exists('get_the_post_thumbnail_url') ? (string) get_the_post_thumbnail_url($product->id, 'shop_single') : '',
        );

        // add product categories, joined together by "|"
        $category_names = array();
        $category_objects = get_the_terms($product->id, 'product_cat');
        if (is_array($category_objects)) {
            foreach ($category_objects as $term) {
                $category_names[] = $term->name;
            }
            if (! empty($category_names)) {
                $product_data['vendor'] = join('|', $category_names);
            }
        }

        /**
         * Filter product data that is sent to Mailchimp.
         *
         * @param array $product_data
         */
        $product_data = apply_filters('mc4wp_ecommerce_product_data', $product_data);
        return $product_data;
    }

    /**
     * @param WC_Product $product
     *
     * @return array
     */
    public function product_variants(WC_Product $product)
    {
        // init product variants
        $variants = array();
        if ($product instanceof WC_Product_Variable) {
            $children = $product->get_children();
            foreach ($children as $product_variation_id) {
                $product_variation = wc_get_product($product_variation_id);
                
                if ($product_variation instanceof WC_Product) {
                    $variants[] = $this->get_product_variant_data($product_variation);
                }
            }
        }

        /**
         * Filter product data that is sent to Mailchimp.
         *
         * @param array $variants_data
         */
        $variants = apply_filters('mc4wp_ecommerce_product_variants_data', $variants, $product);
        return $variants;
    }

    /**
     * @param WC_Product $product
     * @return array
     */
    private function get_product_variant_data(WC_Product $product)
    {

        // determine inventory quantity; default to 0 for unpublished products
        $post = $product->get_post_data();
        $inventory_quantity = 0;

        // only get actual stock qty when product is published & visible
        if ($post->post_status === 'publish' && $product->visibility !== 'hidden') {
            if ($product->managing_stock()) {
                $inventory_quantity = $product->get_stock_quantity();
            } else {
                $out_of_stock = $product->stock_status !== 'instock';
                $inventory_quantity = $out_of_stock ? 0 : 1; // default to 1 when not managing stock & not manually set to "out of stock"
            }
        }

        $data = array(
            // required
            'id' => (string) (! empty($product->variation_id) ? $product->variation_id : $product->id),
            'title' => (string) strip_tags($product->get_title()),
            'url' => (string) $product->get_permalink(),

            // optional
            'sku' => (string) $product->get_sku(),
            'price' => floatval($product->get_price()),
            'image_url' => function_exists('get_the_post_thumbnail_url') ? (string) get_the_post_thumbnail_url($product->id, 'shop_single') : '',
            'inventory_quantity' => (int) $inventory_quantity
        );

        // if product is variation, replace title with variation attributes.
        // check if parent is set to prevent fatal error.... WooCommerce, ugh.
        if ($product instanceof WC_Product_Variation && function_exists('wc_get_formatted_variation') && $product->parent) {
            $variations = wc_get_formatted_variation($product, true);
            if (! empty($variations)) {
                $data['title'] = (string) $variations;
            }
        }

        return $data;
    }

    /**
     * @param array $customer
     * @param array $cart_items
     *
     * @return array
     *
     * @throws Exception
     */
    public function cart(array $customer, array $cart_items)
    {
        $lines_data = array();
        $order_total = 0.00;

        // check if cart has lines
        if (empty($cart_items)) {
            throw new Exception("Cart has no item lines", MC4WP_Ecommerce::ERR_NO_ITEMS);
        }

        // generate data for cart lines
        foreach ($cart_items as $line_id => $cart_item) {
            $product_variant_id = ! empty($cart_item['variation_id']) ? $cart_item['variation_id'] : $cart_item['product_id'];
            $product = wc_get_product($product_variant_id);

            // check if product exists before adding to line data
            if (! $product) {
                continue;
            }

            $lines_data[] = array(
                'id' => (string) $line_id,
                'product_id' => (string) $cart_item['product_id'],
                'product_variant_id' => (string) $product_variant_id,
                'quantity' => (int) $cart_item['quantity'],
                'price' => floatval($product->get_price()),
            );

            $order_total += floatval($product->get_price()) * $cart_item['quantity'];
        }

        $cart_id = $this->get_cart_id($customer['email_address']);
        $cart_url = function_exists('wc_get_cart_url') ? wc_get_cart_url() : get_permalink(wc_get_page_id('cart'));
        $checkout_url = add_query_arg(array( 'mc_cart_id' => $cart_id ), $cart_url);
        $cart_data = array(
            'id' => (string) $cart_id,
            'customer' => $customer,
            'checkout_url' => (string) $checkout_url,
            'currency_code' => (string) $this->settings['store']['currency_code'],
            'order_total' => (float) $order_total,
            'lines' => (array) $lines_data,
        );

        /**
         * Filters the cart data that is sent to Mailchimp.
         *
         * @param array $cart_data
         * @param array $cart_items
         */
        $cart_data = apply_filters('mc4wp_ecommerce_cart_data', $cart_data, $cart_items);

        return $cart_data;
    }
}
PK     M\ToM  oM  -  ecommerce3/includes/class-transformer-wc3.phpnu [        <?php

class MC4WP_Ecommerce_Object_Transformer_WC3 implements MC4WP_Ecommerce_Object_Transformer
{

    /**
     * @var MC4WP_Ecommerce_Tracker
     */
    protected $tracker;

    /**
     * @var array
     */
    protected $settings;

    /**
     * MC4WP_Ecommerce_Object_Transformer constructor.
     *
     * @param array $settings
     * @param MC4WP_Ecommerce_Tracker $tracker
     */
    public function __construct(array $settings, MC4WP_Ecommerce_Tracker $tracker)
    {
        $this->settings = $settings;
        $this->tracker = $tracker;
    }

    /**
     * @param WC_Order|WP_User|WC_Customer|object $object
     * @param string $property
     *
     * @return string
     */
    private function get_object_property($object, $property)
    {
        // since WooCommerce 3.0, but only on instances of WC_Order and WC_Customer
        $method_name = 'get_' . $property;
        if (method_exists($object, $method_name)) {
            return $object->{$method_name}();
        }

        // instances of WP_User or WC_Customer
        if (!empty($object->{$property})) {
            return $object->{$property};
        }

        return '';
    }

    /**
     * @param string $email_address
     * @return string
     */
    public function get_customer_id($email_address)
    {
        return (string) md5(strtolower($email_address));
    }

    /**
     * Generate unique cart ID based on email address + today's date in Y-m-d
     *
     * @param string $customer_email_address
     * @see get_customer_id
     * @return string
     */
    public function get_cart_id($customer_email_address)
    {
        $date = date('Y-m-d');
        $customer_email_address = strtolower(trim($customer_email_address));
        $cart_id = md5($date . $customer_email_address);
        return $cart_id;
    }

    /**
     * @param object|WP_User|WC_Order|WC_Customer $object
     * @return array
     * @throws Exception
     * @link https://mailchimp.com/developer/api/marketing/ecommerce-customers/add-customer/
     */
    public function customer($object)
    {
        // first, attempt to get billing_email from order or customer object.
        $billing_email = (string) $this->get_object_property($object, 'billing_email');
        $user_email = (string) $this->get_object_property($object, 'user_email');

        // if the above failed, try "user_email" property
        if ('' === $billing_email && '' !== $user_email) {
            $billing_email = $user_email;
        }

        if ('' === $billing_email) {
            throw new Exception("Customer data requires a billing_email property", MC4WP_Ecommerce::ERR_NO_EMAIL_ADDRESS);
        }


        $customer_data = array(
            'email_address' => $billing_email,
            'opt_in_status' => false,
        );

        // fill top-level keys
        $map = array(
            'billing_first_name' => 'first_name',
            'billing_last_name' => 'last_name',
            'billing_company' => 'company',
        );
        foreach ($map as $source_property => $target_property) {
            $value = $this->get_object_property($object, $source_property);
            if (!empty($value)) {
                $customer_data[$target_property] = $value;
            }
        }

        // fill address keys
        $address_data = array(
            'address1' => $this->get_object_property($object, 'billing_address_1'),
            'address2' => $this->get_object_property($object, 'billing_address_2'),
            'city' => $this->get_object_property($object, 'billing_city'),
            'province' => $this->get_object_property($object, 'billing_state'),
            'postal_code' => $this->get_object_property($object, 'billing_postcode'),
            'country_code' => $this->get_object_property($object, 'billing_country'),
        );

        // only add address to data if this looks like a complete address
        // this is because mailchimp doesn't validate the format here. but DOES in subsequent POST list/members calls.
        if (!empty($address_data['address1'])
            && !empty($address_data['city'])
            && !empty($address_data['province'])
            && !empty($address_data['postal_code'])
            && !empty($address_data['country_code'])
        ) {
            $customer_data['address'] = $address_data;
        }

        /**
         * Filter the customer data before it is sent to Mailchimp.
         *
         * @array $customer_data
         */
        $customer_data = apply_filters('mc4wp_ecommerce_customer_data', $customer_data);

        // set ID because we don't want that to be filtered.
        $customer_data['id'] = $this->get_customer_id($billing_email);

        return $customer_data;
    }

    /**
     * @param WC_Order $order
     * @return int
     * @throws Exception
     */
    public function order_id(WC_Order $order)
    {
        if (method_exists($order, 'get_id')) {
            return $order->get_id();
        }

        if (!empty($order->id)) {
            return $order->id;
        }

        throw new Exception('Can not get ID from order');
    }

    /**
     * @param WC_Product $product
     * @return int
     * @throws Exception
     */
    public function product_id(WC_Product $product)
    {
        if (method_exists($product, 'get_id')) {
            return $product->get_id();
        }

        if (!empty($product->id)) {
            return $product->id;
        }

        throw new Exception('Can not get ID from product');
    }

    public function order_number(WC_Order $order)
    {
        return trim($order->get_order_number(), '#');
    }

    /**
     * @param WC_Order $order
     * @return array
     * @link https://mailchimp.com/developer/api/marketing/ecommerce-orders/add-order/
     */
    public function order(WC_Order $order)
    {
        $order_id = $order->get_id();
        $order_number = $this->order_number($order);
        $billing_email = $order->get_billing_email();

        // generate item lines data
        $items = $order->get_items('line_item');
        $order_lines_data = array();

        /**
         * @var int $item_id
         * @var WC_Order_Item_Product $item
         */
        foreach ($items as $item_id => $item) {
            // get item ID from method
            $item_id = method_exists($item, 'get_id') ? $item->get_id() : $item_id;

            // product may not exist anymore by now, we validate this outside of this class
            $product_id = $item->get_product_id();

            // calculate cost of a single item
            $qty = (int) $item->get_quantity();

            // sanity check for quantity
            if ($qty === 0) {
                continue;
            }

            $item_price = (float) ($item->get_total() / $qty);
            $line_data = array(
                'id' => (string) $item_id,
                'product_id' => (string) $product_id,
                'product_variant_id' => (string) $product_id,
                'quantity' => $qty,
                'price' =>  $item_price,
            );

            // use variation ID if set & product variation exists
            $variation_id = $item->get_variation_id();
            if (!empty($variation_id)) {
                $variation_product = wc_get_product($variation_id);

                if ($variation_product && $variation_product->get_parent_id() === $product_id) {
                    $line_data['product_variant_id'] = (string) $variation_id;
                }
            }

            $order_lines_data[] = $line_data;
        }

        // add order
        $customer_id = $this->get_customer_id($billing_email);
        $order_data = array(
            'id' => (string) $order_number, // use order number instead of ID, because emails.
            'customer' => array('id' => $customer_id),
            'order_total' => floatval($order->get_total()),
            'tax_total' => floatval($order->get_total_tax()),
            'shipping_total' => floatval($order->get_shipping_total()),
            'discount_total' => floatval($order->get_discount_total()),
            'currency_code' => (string) $order->get_currency(),
            'lines' => (array) $order_lines_data,
            'billing_address' => $this->order_billing_address($order),
        );

        if ($order->has_shipping_address()) {
            $order_data['shipping_address'] = $this->order_shipping_address($order);
        }

        // merge in order statuses (financial_status, fulfillment_status)
        $statuses = $this->order_status($order);
        $order_data = array_merge($order_data, $statuses);

        $date_created = $order->get_date_created();
        if ($date_created !== null) {
            $order_data['processed_at_foreign'] = $date_created->setTimezone(new \DateTimeZone('UTC'))->format(DateTime::ISO8601);
        }

        // add tracking code(s)
        $tracking_code = $this->tracker->get_tracking_code($order_id, false);
        if (!empty($tracking_code)) {
            $order_data['tracking_code'] = $tracking_code;
        }

        $campaign_id = $this->tracker->get_campaign_id($order_id, false);
        if (!empty($campaign_id)) {
            $order_data['campaign_id'] = $campaign_id;
        }

        $landing_site = $this->tracker->get_landing_site($order_id, false);
        if (! empty($landing_site)) {
            $order_data['landing_site'] = $landing_site;
        }

        // only send `order_url` if it looks like an actual domain, because mailchimp will reject values like "localhost/order/5"
        $order_url = $order->get_view_order_url();
        if (strpos($order_url, '.') && strpos($order_url, 'wordpress.') === false && strpos($order_url, '.localhost') === false) {
            $order_data['order_url'] = $order_url;
        }

        /**
         * Filter order data that is sent to Mailchimp.
         *
         * @param array $order_data
         * @param WC_Order $order
         */
        $order_data = apply_filters('mc4wp_ecommerce_order_data', $order_data, $order);

        return $order_data;
    }

    /**
     * @param WC_Product $product
     * @return array
     * @link https://mailchimp.com/developer/api/marketing/ecommerce-products/add-product/
     */
    public function product(WC_Product $product)
    {
        // data to send to Mailchimp
        $product_data = array(
            // required
            'id' => (string) $product->get_id(),
            'title' => (string) strip_tags($product->get_title()),
            'url' => (string) $product->get_permalink(),
            'variants' => array(
                $this->get_product_variant_data($product) // only add main product as a variation here
            ),

            // optional
            'type' => (string) $product->get_type(),
            'image_url' => function_exists('get_the_post_thumbnail_url') ? (string) get_the_post_thumbnail_url($product->get_id(), 'shop_single') : '',
        );

        // add product categories, joined together by "|"
        $category_names = array();
        $category_objects = get_the_terms($product->get_id(), 'product_cat');
        if (is_array($category_objects)) {
            foreach ($category_objects as $term) {
                $category_names[] = $term->name;
            }
            if (!empty($category_names)) {
                $product_data['vendor'] = join('|', $category_names);
            }
        }

        /**
         * Filter product data that is sent to Mailchimp.
         *
         * @param array $product_data
         */
        $product_data = apply_filters('mc4wp_ecommerce_product_data', $product_data, $product);
        return $product_data;
    }

    /**
     * @param WC_Product $product
     *
     * @return array
     */
    public function product_variants(WC_Product $product)
    {
        // add product variants if this is a variable product
        $variants = array();
        $children = $product->get_children();
        if (is_array($children)) {
            foreach ($children as $product_variation_id) {
                $product_variation = wc_get_product($product_variation_id);

                // only add variation if it exists
                if ($product_variation instanceof WC_Product) {
                    $variants[] = $this->get_product_variant_data($product_variation);
                }
            }
        }

        /**
         * Filter product data that is sent to Mailchimp.
         *
         * @param array $variants_data
         */
        $variants = apply_filters('mc4wp_ecommerce_product_variants_data', $variants, $product);

        return $variants;
    }

    /**
     * @param WC_Product $product
     * @return array
     */
    private function get_product_variant_data(WC_Product $product)
    {

        // determine inventory quantity; default to 0 for unpublished products
        $inventory_quantity = 0;
        $visibility = 'hidden';

        // only get actual stock qty when product is published & visible
        if ($product->get_status() === 'publish' && $product->get_catalog_visibility() !== 'hidden') {
            $visibility = 'visible';

            if ($product->managing_stock()) {
                $inventory_quantity = $product->get_stock_quantity();
            } else {
                $out_of_stock = $product->get_stock_status() !== 'instock';
                $inventory_quantity = $out_of_stock ? 0 : 1; // default to 1 when not managing stock & not manually set to "out of stock"
            }
        }

        $data = array(
            // required
            'id' => (string) $product->get_id(),
            'title' => (string) strip_tags($product->get_title()),
            'url' => (string) $product->get_permalink(),

            // optional
            'price' => (float) $product->get_price(),
            'image_url' => function_exists('get_the_post_thumbnail_url') ? (string) get_the_post_thumbnail_url($product->get_id(), 'shop_single') : '',
            'inventory_quantity' => (int) $inventory_quantity,
            'visibility' => $visibility,
        );

        // add SKU
        $sku = (string) $product->get_sku();
        if ($sku !== '') {
        	$data['sku'] = $sku;
        	$data['title'] .= ' (' . $sku . ')';
        }

        return $data;
    }

    /**
     * @param array $customer_data
     * @param array $cart_items
     *
     * @return array
     *
     * @throws Exception
     */
    public function cart(array $customer_data, array $cart_items)
    {
        $lines_data = array();
        $order_total = 0.00;
        $tax_total = 0.00;

        // check if cart has lines
        if (empty($cart_items)) {
            throw new Exception("Cart has no item lines", MC4WP_Ecommerce::ERR_NO_ITEMS);
        }

        // generate data for cart lines
        foreach ($cart_items as $line_id => $cart_item) {
            $product_variant_id = !empty($cart_item['variation_id']) ? $cart_item['variation_id'] : $cart_item['product_id'];
            $product = wc_get_product($product_variant_id);

            // check if product exists before adding to line data
            if (! $product) {
                continue;
            }

            // get product ID from product object if it's a variable product
            $product_id = $cart_item['product_id'];
            if ($product_id !== $product_variant_id) {
                $product_id = $product->get_parent_id();
            }

            $lines_data[] = array(
                'id' => (string) $line_id,
                'product_id' => (string) $product_id,
                'product_variant_id' => (string) $product_variant_id,
                'quantity' => (int) $cart_item['quantity'],
                'price' => isset($cart_item['line_total']) ? floatval($cart_item['line_total']) / floatval($cart_item['quantity']) : floatval($product->get_price()),
            );

            $order_total += isset($cart_item['line_subtotal']) ? floatval($cart_item['line_subtotal']) : floatval($product->get_price()) * $cart_item['quantity'];
            $tax_total += isset($cart_item['line_tax']) ? floatval($cart_item['line_tax']) : 0.00;
        }

        $cart_id = $this->get_cart_id($customer_data['email_address']);
        $checkout_url = add_query_arg(array('mc_cart_id' => $cart_id), wc_get_cart_url());
        $cart_data = array(
            'id' => (string) $cart_id,
            'customer' => $customer_data,
            'checkout_url' => (string) $checkout_url,
            'currency_code' => (string) $this->settings['store']['currency_code'],
            'tax_total' => (float) $tax_total,
            'order_total' => (float) $order_total,
            'lines' => (array) $lines_data,
        );

        /**
         * Filters the cart data that is sent to Mailchimp.
         *
         * @param array $cart_data
         * @param array $cart_items Raw cart items array coming from WooCommerce.
         */
        $cart_data = apply_filters('mc4wp_ecommerce_cart_data', $cart_data, $cart_items);

        return $cart_data;
    }

    /**
     * @see https://mailchimp.com/developer/guides/getting-started-with-ecommerce/#Order_Notifications
     * @param WC_Order $order
     * @return array
     */
    private function order_status(WC_Order $order)
    {
        $map = array(
            'pending' => array(
                'financial_status' => 'pending', // Sends the order confirmation
            ),
            'on-hold' => array(
                'financial_status' => 'pending', // Sends the order confirmation
            ),
            'processing' => array(
                'financial_status' => 'pending', // Sends the order confirmation
            ),
            'completed' => array(
                'financial_status' => 'paid', // Sends the order invoice
                'fulfillment_status' => 'fulfilled', // Sends the shipping confirmation
            ),
            'cancelled' => array(
                'financial_status' => 'cancelled', // Sends cancellation confirmation
            ),
            'refunded' => array(
                'financial_status' => 'refunded', // Sends refund confirmation
            ),
            'failed' => array(),
        );

        $status = (string) $order->get_status();
        if (isset($map[$status])) {
            return $map[$status];
        }

        return array();
    }

    /**
     * @param WC_Order $order
     * @return object
     */
    private function order_shipping_address(WC_Order $order)
    {
        return (object) array(
            'name' => sprintf('%s %s', $order->get_shipping_first_name(), $order->get_shipping_last_name()),
            'company' => $order->get_shipping_company(),
            'address1' => $order->get_shipping_address_1(),
            'address2' => $order->get_shipping_address_2(),
            'city' => $order->get_shipping_city(),
            'province' => $order->get_shipping_state(),
            'postal_code' => $order->get_shipping_postcode(),
            'country' => $order->get_shipping_country(),
        );
    }

    /**
     * @param WC_Order $order
     * @return object
     */
    private function order_billing_address(WC_Order $order)
    {
        return (object) array(
            'name' => sprintf('%s %s', $order->get_billing_first_name(), $order->get_billing_last_name()),
            'company' => $order->get_billing_company(),
            'phone' => $order->get_billing_phone(),
            'address1' => $order->get_billing_address_1(),
            'address2' => $order->get_billing_address_2(),
            'city' => $order->get_billing_city(),
            'province' => $order->get_billing_state(),
            'postal_code' => $order->get_billing_postcode(),
            'country' => $order->get_billing_country(),
        );
    }
}
PK     M\<  <  -  ecommerce3/includes/interface-transformer.phpnu [        <?php

interface MC4WP_Ecommerce_Object_Transformer
{
    public function get_customer_id($email_address);
    public function get_cart_id($customer_email_address);
    public function customer($object);
    public function order(WC_Order $order);
    public function order_id(WC_Order $order);
    public function order_number(WC_Order $order);
    public function product(WC_Product $product);
    public function product_id(WC_Product $product);
    public function product_variants(WC_Product $product);
    public function cart(array $customer, array $cart_items);
}
PK     M\BX  X  ,  ecommerce3/includes/class-order-observer.phpnu [        <?php

class MC4WP_Ecommerce_Order_Observer extends MC4WP_Ecommerce_Object_Observer
{
    /**
     * @var MC4WP_Ecommerce
     */
    protected $ecommerce;

    /**
     * MC4WP_Ecommerce_Scheduler constructor.
     *
     * @param MC4WP_Ecommerce $ecommerce
     * @param MC4WP_Queue $queue
     */
    public function __construct(MC4WP_Ecommerce $ecommerce, MC4WP_Queue $queue)
    {
        $this->ecommerce = $ecommerce;
        $this->queue = $queue;
    }

    /**
     * Hook
     */
    public function hook()
    {
        // update or delete orders
        add_action('save_post_shop_order', array( $this, 'on_order_change' ));
        add_action('woocommerce_order_status_changed', array( $this, 'on_order_change' ));

        // delete products & orders when they're deleted in WP
        add_action('delete_post', array( $this, 'on_post_delete'));

        // updating users
        add_action('profile_update', array( $this, 'on_user_update' ));

        // user meta update
        add_action('update_user_meta', array($this, 'on_user_meta_update'), 10, 4);
    }

    // hook: save_post_shop_order
    public function on_order_change($post_id)
    {
        // skip auto saves
        if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
            return;
        }

        $statuses = mc4wp_ecommerce_get_order_statuses();
        $post = get_post($post_id);
        $method = in_array($post->post_status, $statuses) ? 'add_order' : 'delete_order';
        $reversed_method = $method === 'add_order' ? 'delete_order' : 'add_order';

        // remove all previous pending jobs which would be reversed by this new job anyway.
        $this->remove_pending_jobs($reversed_method, $post_id);

        // add new job
        $this->add_pending_job($method, $post_id);
        $this->queue->save();
    }

    // hook: delete_post
    public function on_post_delete($post_id)
    {
        $post = get_post($post_id);

        if ($post->post_type === 'shop_order') {
            $this->remove_pending_jobs('add_order', $post_id);
            $this->add_pending_job('delete_order', $post_id);
            $this->queue->save();
        }
    }

    // hook: profile_update
    public function on_user_update($user_id)
    {
        $user = get_userdata($user_id);

        // do nothing if user is not a WC Customer
        if (! $user || ! in_array('customer', $user->roles)) {
            return;
        }

        // don't update if user has no known email address
        $has_email_address = ! empty($user->billing_email) || ! empty($user->user_email);
        if (! $has_email_address) {
            return;
        }
        
        $this->add_pending_job('update_customer', $user_id);
        $this->queue->save();
    }

    public function on_user_meta_update($meta_id, $user_id, $meta_key, $new_meta_value)
    {
        if ($meta_key !== 'billing_email') {
            return;
        }

        if (empty($new_meta_value)) {
            return;
        }

        // if old billing_email matches new billing_email, do nothing
        $old_meta_value = get_user_meta($user_id, $meta_key, true);
        if ($old_meta_value == $new_meta_value) {
            return;
        }

        $this->queue->put(array(
            'method' => 'update_subscriber_email',
            'args' => array(
                $old_meta_value,
                $new_meta_value,
            )
        ));
    }

}
PK     M\+2  +2  #  ecommerce3/includes/class-admin.phpnu [        <?php

/**
* Class MC4WP_Ecommerce_Admin
*
* @ignore
*/
class MC4WP_Ecommerce_Admin
{

    /**
    * @var string
    */
    protected $plugin_file;

    /**
    * @var array
    */
    protected $settings;

    /**
    * @var MC4WP_Queue
    */
    protected $queue;

	/**
	 * MC4WP_Ecommerce_Admin constructor.
	 *
	 * @param string $plugin_file
	 * @param MC4WP_Queue|null $queue
	 * @param array $settings
	 */
    public function __construct($plugin_file, $queue, array $settings)
    {
    	$this->plugin_file = $plugin_file;
        $this->queue = $queue;
        $this->settings = $settings;

        // Don't typehint $queue in constructor as this may be null when e-commerce is disabled
    }

    /**
    * Add hooks
    */
    public function add_hooks()
    {
        add_filter('mc4wp_admin_menu_items', array( $this, 'menu_items' ));
        add_action('mc4wp_admin_save_ecommerce_settings', array( $this, 'save_settings' ));
        add_action('mc4wp_admin_ecommerce_reset', array( $this, 'reset_data' ));
        add_action('mc4wp_admin_ecommerce_rollback_to_v2', array( $this, 'rollback_to_v2' ));
        add_action('mc4wp_admin_ecommerce_queue_all_products', array( $this, 'queue_all_products' ));
        add_action('mc4wp_admin_ecommerce_queue_all_orders', array( $this, 'queue_all_orders' ));
        add_action('admin_notices', array($this, 'admin_notices'));


        // if connected to a list, add bulk actions for products, orders & coupons
        if (! empty($this->settings['store']['list_id']) && $this->settings['enable_product_tracking']) {
            $post_types = array( 'product', 'shop_coupon' );
            if ($this->settings['enable_order_tracking']) {
                $post_types[] = 'shop_order';
            }

            foreach ($post_types as $post_type) {
                add_filter('bulk_actions-edit-' . $post_type, array( $this, 'bulk_action_add'));
                add_filter('handle_bulk_actions-edit-' . $post_type, array( $this, 'bulk_action_handle' ), 10, 3);
            }
            add_action('admin_notices', array( $this, 'bulk_action_admin_notice' ));
        }
    }

    public function admin_notices() {
        if (!isset($_GET['page']) || strpos($_GET['page'], 'mailchimp-for-wp') !== 0) {
            return;
        }

        // show notice when e-commerce automations are still disabled
        if (! empty($this->settings['store']['list_id']) && $this->settings['store']['is_syncing']) {
            echo '<div class="notice notice-warning"><p>'. sprintf(__('<strong>Heads up!</strong> Your e-commerce automations in Mailchimp are disabled right now. If you\'re done adding products and orders, do not forget to <a href="%s">re-enable automations here</a>.', 'mc4wp-ecommerce'), admin_url('admin.php?page=mailchimp-for-wp-ecommerce&edit=store')).'</p></div>';
        }
    }

    // GET /wp-admin/admin.php?page=mailchimp-for-wp-ecommerce&_mc4wp_action=ecommerce_queue_all_products
    public function queue_all_products()
    {
        $helper = new MC4WP_Ecommerce_Helper();
        $product_ids = $helper->get_product_ids();

        foreach ($product_ids as $product_id) {
            $this->queue->put(array(
                'method' => 'add_product',
                'args' => array( $product_id )
            ));
        }

        $this->queue->save();
    }

	// GET /wp-admin/admin.php?page=mailchimp-for-wp-ecommerce&_mc4wp_action=ecommerce_queue_all_orders
    public function queue_all_orders()
    {
        $helper = new MC4WP_Ecommerce_Helper();
        $ids = $helper->get_order_ids();

        foreach ($ids as $id) {
            $this->queue->put(array(
                'method' => 'add_order',
                'args' => array( $id )
            ));
        }

        $this->queue->save();
    }

    /**
    * Runs logic for saving e-commerce settings & wizard.
    */
    public function save_settings()
    {
        // check if queue processor is scheduled
        _mc4wp_ecommerce_schedule_events();

        $ecommerce = $this->get_ecommerce();
        $messages = $this->get_admin_messages();

        $dirty = stripslashes_deep($_POST['mc4wp_ecommerce']);

        // merge with current settings to allow passing partial arrays
        $current = $this->settings;
        $dirty = array_replace_recursive($current, $dirty);
        $diff = array_diff($dirty['store'], $current['store']);

        if (! empty($diff)) {
            try {
                $store_data = $ecommerce->update_store($dirty['store']);
            } catch (Exception $e) {
                $messages->flash((string) $e, 'error');
                $_POST['_redirect_to'] = '';
                return; // return means we're not saving
            }

            // store actual store ID + mc.js script url
            $dirty['store_id'] = $store_data->id;
            $dirty['mcjs_url'] = $store_data->connected_site->site_script->url;
            $ecommerce->set_store_id($store_data->id);
        }


        // verify script installation after it is toggled
        if ($dirty['load_mcjs_script'] == 1 && $current['load_mcjs_script'] == 0) {
            try {
                $ecommerce->ensure_connected_site();
                $ecommerce->verify_store_script_installation();
            } catch (MC4WP_API_Exception $e) {
                // error verifying script installation (store not found)
                $this->get_log()->error(sprintf('E-Commerce: error verifying script installation. %s', $e));
                $messages->flash("Error enabling MC.js. Please re-connect your store to Mailchimp.", 'error');
                return; // return means we're not saving
            }
        }

        // save new settings if something changed
        if ($dirty != $current || ! empty($diff)) {
            update_option('mc4wp_ecommerce', $dirty);
            $messages->flash('Settings saved!');
        }
    }

    /**
    * @param array $items
    *
    * @return array
    */
    public function menu_items($items)
    {
        $items[] = array(
            'title' => __('E-Commerce', 'mc4wp-ecommerce'),
            'text' => __('E-Commerce', 'mc4wp-ecommerce'),
            'slug' => 'ecommerce',
            'callback' => array( $this, 'show_settings_page' ),
            'load_callback', array( $this, 'redirect_to_wizard' ),
        );

        return $items;
    }

    /**
    * Redirect to wizard when store settings are empty.
    */
    public function redirect_to_wizard()
    {
        $settings = $this->settings;

        if ($settings['enable_product_tracking'] && empty($settings['store']['list_id']) && ! isset($_GET['wizard'])) {
            wp_safe_redirect(add_query_arg(array( 'wizard' => 1 )));
        }
    }

    /**
    * Show settings page
    */
    public function show_settings_page()
    {
        $settings = $this->settings;
        $mailchimp = new MC4WP_MailChimp();
        $lists = $mailchimp->get_lists();
        $connected_list = null;

        $helper = new MC4WP_Ecommerce_Helper();

        $product_ids = $helper->get_product_ids();
        $tracked_product_ids = $helper->get_tracked_product_ids();
        $order_ids = $helper->get_order_ids();
        $tracked_order_ids = $helper->get_tracked_order_ids();

        // we need to reset array index here because array_diff preserves it
        $untracked_product_ids = array_values(array_diff($product_ids, $tracked_product_ids));
        $untracked_order_ids = array_values(array_diff($order_ids, $tracked_order_ids));

        $product_count = new MC4WP_Ecommerce_Object_Count(count($product_ids), count($untracked_product_ids));
        $order_count = new MC4WP_Ecommerce_Object_Count(count($order_ids), count($untracked_order_ids));

        $assets_url = plugins_url('/assets', $this->plugin_file);
        wp_enqueue_style('mc4wp-ecommerce-admin', $assets_url . '/css/admin.css', array(), MC4WP_PREMIUM_VERSION);
        wp_enqueue_script('mc4wp-ecommerce-admin', $assets_url . '/js/admin.js', array(), MC4WP_PREMIUM_VERSION, true);
        wp_localize_script('mc4wp-ecommerce-admin', 'mc4wp_ecommerce', array(
            'i18n' => array(
                'done' => __('All done!', 'mc4wp-ecommerce'),
                'pause' => __('Pause', 'mc4wp-ecommerce'),
                'resume' => __('Resume', 'mc4wp-ecommerce'),
                'confirmation' => __('Are you sure you want to do this?', 'mc4wp-ecommerce'),
                'process' => __('Process now', 'mc4wp-ecommerce'),
                'reset' => __('Clear queue', 'mc4wp-ecommerce'),
                'processing' => __('Processing queue, please wait.', 'mc4wp-ecommerce'),
            ),
//            'product_count' => $product_count,
//            'product_ids' => $untracked_product_ids,
//            'order_count' => $order_count,
//            'order_ids' => (array) $untracked_order_ids,
        ));

        // get connected list
        if (! empty($settings['store']['list_id'])) {
            $connected_list = $mailchimp->get_list($settings['store']['list_id']);
        }

        $queue = $this->queue;

        if (isset($_GET['edit']) && $_GET['edit'] === 'store') {
            require __DIR__ . '/views/edit-store.php';
        } elseif (! empty($_GET['wizard'])) {
            require __DIR__ . '/views/wizard.php';
        } else {
            require __DIR__ . '/views/admin-page.php';
        }
    }

    /**
    * Resets all e-commerce data
    */
    public function reset_data()
    {
        $this->settings['store']['list_id'] = '';
        update_option('mc4wp_ecommerce', $this->settings);

        // delete local tracking indicators
        delete_post_meta_by_key(MC4WP_Ecommerce::META_KEY);

        if (! empty($_POST['delete_store_in_mailchimp'])) {
            // remove store in mailchimp
            try {
                $this->get_api()->delete_ecommerce_store($this->settings['store_id']);
            } catch (MC4WP_API_Resource_Not_Found_Exception $e) {
                // good.
            } catch (Exception $e) {
                // bad.
                $this->get_admin_messages()->flash((string) $e, 'error');
                return;
            }
        }

        $this->settings['store_id'] = '';
        update_option('mc4wp_ecommerce', $this->settings);
    }

    public function bulk_action_add($bulk_actions)
    {
        $bulk_actions['mc4wp_ecommerce_bulk_sync_objects'] = __('Synchronise with Mailchimp', 'mc4wp-premium');
        return $bulk_actions;
    }

    public function bulk_action_handle($redirect_to, $doaction, $post_ids)
    {
        if ($doaction !== 'mc4wp_ecommerce_bulk_sync_objects' || empty($post_ids)) {
            return $redirect_to;
        }

        // trigger save_post_${post_type} so object observer can queue a new job
        $post_type = get_post_type($post_ids[0]);
        foreach ($post_ids as $post_id) {
            do_action('save_post_' . $post_type, $post_id);
        }

        $redirect_to = add_query_arg('mc4wp_ecommerce_bulk_synced_objects', count($post_ids), $redirect_to);
        return $redirect_to;
    }

    public function bulk_action_admin_notice()
    {
        if (empty($_REQUEST['mc4wp_ecommerce_bulk_synced_objects'])) {
            return;
        }

        $count = intval($_REQUEST['mc4wp_ecommerce_bulk_synced_objects']);
        $next_run = wp_next_scheduled('mc4wp_ecommerce_process_queue');

        echo '<div id="message" class="updated fade">';
        echo '<p>' . sprintf(__('Added <strong>%d</strong> synchronisation job to MC4WP\'s  background queue. Currently <a href="%s">pending background jobs</a> will be processed on <strong>%s</strong> at <strong>%s</strong>.', 'mc4wp-premium'), $count, admin_url('admin.php?page=mailchimp-for-wp-ecommerce'), date(get_option('date_format'), $next_run), date(get_option('time_format'), $next_run)) . '</p>';
        echo '</div>';
    }

    /**
     * @return MC4WP_Debug_Log
     */
    private function get_log()
    {
        return mc4wp('log');
    }

    /**
    * @return MC4WP_API_v3
    */
    private function get_api()
    {
        return mc4wp('api');
    }

    /**
    * @return MC4WP_Ecommerce
    */
    private function get_ecommerce()
    {
        return mc4wp('ecommerce');
    }

    /**
    * @return MC4WP_Admin_Messages
    */
    private function get_admin_messages()
    {
        return mc4wp('admin.messages');
    }

    /**
     * Rolls back to e-commerce on API v2.
     */
    public function rollback_to_v2()
    {
        // re-enable old option
        $options = get_option('mc4wp', array());
        $options['ecommerce'] = 1;
        update_option('mc4wp', $options);

        // delete new option
        delete_option('mc4wp_ecommerce');

        // redirect to wizard
        wp_redirect(admin_url('admin.php?page=mailchimp-for-wp-other'));
        exit;
    }
}
PK     M\b|-  -  %  ecommerce3/includes/class-command.phpnu [        <?php
defined('ABSPATH') or exit;

/**
 * Class MC4WP_Ecommerce_Command
 */
class MC4WP_Ecommerce_Command extends WP_CLI_Command
{

    /**
     * @var MC4WP_Ecommerce
     */
    protected $ecommerce;

    /**
     * MC4WP_Ecommerce_Command constructor.
     */
    public function __construct()
    {
        parent::__construct();

        $this->ecommerce = mc4wp('ecommerce');
    }

    /**
     * Tracks the order with the given ID in Mailchimp
     *
     * @param $args
     * @param $assoc_args
     *
     * ## OPTIONS
     *
     * <order_id>
     * : Order to add to Mailchimp
     *
     * ## EXAMPLES
     *
     *     wp mc4wp-ecommerce add-order
     *
     * @synopsis <order_id>
     *
     * @subcommand add-order
     */
    public function add_order($args, $assoc_args = array())
    {
        $order_id = (int) $args[0];

        try {
            $success = $this->ecommerce->update_order($order_id);
        } catch (Exception $e) {
            WP_CLI::warning(sprintf("Error adding order %d: %s", $order_id, $e));
            return;
        }

        WP_CLI::success(sprintf('Added order #%d.', $order_id));
    }

    /**
     * Deletes the order with the given ID in Mailchimp
     *
     * @param $args
     * @param $assoc_args
     *
     * ## OPTIONS
     *
     * <order_id>
     * : Order to delete in Mailchimp
     *
     * ## EXAMPLES
     *
     *     wp mc4wp-ecommerce delete-order
     *
     * @synopsis <order_id>
     *
     * @subcommand delete-order
     */
    public function delete_order($args, $assoc_args = array())
    {
        $order_id = (int) $args[0];

        try {
            $this->ecommerce->delete_order($order_id);
        } catch (Exception $e) {
            WP_CLI::warning(sprintf("Error deleting order %d: %s", $order_id, $e));
            return;
        }

        WP_CLI::success(sprintf('Deleted order #%d.', $order_id));
    }

    /**
     * Adds multiple untracked orders, starting with the most recent orders.
     *
     * @param $args
     * @param $assoc_args
     *
     * ## OPTIONS
     *
     * [--<limit>=<limit>]
     * : Limit # of orders to this number. Default: 1000
     *
     * [--offset=<offset>]
     * : Skip the first # orders. Default: 0
     *
     * [--delay=<delay>]
     * : Add a delay (in ms) between each product. Default: 0
     *
     * ## EXAMPLES
     *
     *     wp mc4wp-ecommerce add-orders --limit=5000 --offset=1000 --delay=500
     *
     * @synopsis [--limit=<limit>] [--offset=<offset>] [--delay=<delay>]
     *
     * @subcommand add-orders
     */
    public function add_orders($args, $assoc_args = array())
    {
        $offset = empty($assoc_args['offset']) ? 0 : (int) $assoc_args['offset'];
        $limit = empty($assoc_args['limit']) ? 1000 : (int) $assoc_args['limit'];
        $delay = empty($assoc_args['delay']) ? 0 : (int) $assoc_args['delay'] * 1000;

        $helper = new MC4WP_Ecommerce_Helper();
        $ids = array_diff($helper->get_order_ids(), $helper->get_tracked_order_ids());
        $ids = array_slice($ids, $offset, $limit);
        $count = count($ids);

        WP_CLI::log(sprintf("%d orders found.", $count));

        foreach ($ids as $id) {
            $this->add_order(array( $id ));
            usleep($delay);
        }

        WP_CLI::success('Done!');
    }

    /**
     * Deletes all orders from Mailchimp
     *
     * @param $args
     * @param $assoc_args
     *
     * ## EXAMPLES
     *
     *     wp mc4wp-ecommerce delete-orders
     *
     * @subcommand delete-orders
     */
    public function delete_orders($args, $assoc_args = array())
    {
        $helper = new MC4WP_Ecommerce_Helper();
        $ids = $helper->get_tracked_order_ids();

        WP_CLI::log(sprintf('%d orders found.', count($ids)));

        foreach ($ids as $order_id) {
            $this->delete_order(array( $order_id ));
        }

        WP_CLI::log('Done!');
    }

    /**
     * Adds multiple untracked products, starting with the most recent product.
     *
     * @param $args
     * @param $assoc_args
     *
     * ## OPTIONS
     *
     * [--<limit>=<limit>]
     * : Limit # of products to this number. Default: 1000
     *
     * [--offset=<offset>]
     * : Skip the first # products. Default: 0
     *
     * [--delay=<delay>]
     * : Add a delay (in ms) between each product. Default: 0
     *
     * ## EXAMPLES
     *
     *     wp mc4wp-ecommerce add-products --limit=5000 --offset=1000 --delay=500
     *
     * @synopsis [--limit=<limit>] [--offset=<offset>] [--delay=<delay>]
     *
     * @subcommand add-products
     */
    public function add_products($args, $assoc_args = array())
    {
        $offset = empty($assoc_args['offset']) ? 0 : (int) $assoc_args['offset'];
        $limit = empty($assoc_args['limit']) ? 1000 : (int) $assoc_args['limit'];
        $delay = empty($assoc_args['delay']) ? 0 : (int) $assoc_args['delay'] * 1000;

        $helper = new MC4WP_Ecommerce_Helper();
        $ids = array_diff($helper->get_product_ids(), $helper->get_tracked_product_ids());
        $ids = array_slice($ids, $offset, $limit);

        WP_CLI::log(sprintf('%d products found.', count($ids)));

        foreach ($ids as $product_id) {
            $this->add_product(array( $product_id ));
            usleep($delay);
        }

        WP_CLI::log('Done!');
    }

    /**
     * Deletes all products from Mailchimp
     *
     * @param $args
     * @param $assoc_args
     *
     * ## EXAMPLES
     *
     *     wp mc4wp-ecommerce delete-products
     *
     * @subcommand delete-products
     */
    public function delete_products($args, $assoc_args = array())
    {
        $helper = new MC4WP_Ecommerce_Helper();
        $ids = $helper->get_tracked_product_ids();

        WP_CLI::log(sprintf('%d products found.', count($ids)));

        foreach ($ids as $product_id) {
            $this->delete_product(array( $product_id ));
        }

        WP_CLI::log('Done!');
    }

    /**
     * Adds the product with the given ID to Mailchimp
     *
     * @param $args
     * @param $assoc_args
     *
     * ## OPTIONS
     *
     * <product_id>
     * : ID of the product to add to Mailchimp
     *
     * ## EXAMPLES
     *
     *     wp mc4wp-ecommerce add-product
     *
     * @synopsis <product_id>
     *
     * @subcommand add-product
     */
    public function add_product($args, $assoc_args = array())
    {
        $product_id = (int) $args[0];

        try {
            $success = $this->ecommerce->update_product($product_id);
        } catch (Exception $e) {
            WP_CLI::warning(sprintf("Error adding product %d: %s", $product_id, $e));
            return;
        }

        WP_CLI::success(sprintf('Success! Added product #%d.', $product_id));
    }

    /**
     * Deletes the product with the given ID from Mailchimp
     *
     * @param $args
     * @param $assoc_args
     *
     * ## OPTIONS
     *
     * <product_id>
     * : ID of the product to delete from Mailchimp
     *
     * ## EXAMPLES
     *
     *     wp mc4wp-ecommerce delete-product
     *
     * @synopsis <product_id>
     *
     * @subcommand delete-product
     */
    public function delete_product($args, $assoc_args = array())
    {
        $product_id = (int) $args[0];

        try {
            $this->ecommerce->delete_product($product_id);
        } catch (Exception $e) {
            WP_CLI::warning(sprintf("Error deleting product %d: %s", $product_id, $e));
            return;
        }

        WP_CLI::success(sprintf('Success! Deleted product #%d.', $product_id));
    }

    /**
     * Processes all queued background jobs.
     *
     * @param $args
     * @param $assoc_args
     *
     * [--delay=<delay>]
     * : Add a delay (in ms) between each job. Default: 0
     *
     * ## EXAMPLES
     *
     *     wp mc4wp-ecommerce process-queue --delay=500
     *
     * @synopsis [--delay=<delay>]
     *
     * @subcommand process-queue
     */
    public function process_queue($args, $assoc_args = array())
    {
        $delay = empty($assoc_args['delay']) ? 0 : (int) $assoc_args['delay'] * 1000;

        /** @var MC4WP_Queue $queue */
        $queue = mc4wp('ecommerce.queue');
        $worker = mc4wp('ecommerce.worker');
        $count = count($queue->all());
        WP_CLI::log(sprintf('%d pending jobs in queue.', $count));

        while (($job = $queue->get())) {

            // ensure job data matches expected format
            if (empty($job->data['method']) || ! method_exists($worker, $job->data['method'])) {
                $queue->delete($job);
                continue;
            }

            // call job method with args
            try {

                // create string representation of job args
                $job_method_args = '';
                foreach ($job->data['args'] as $arg) {
                    if (is_scalar($arg)) {
                        $job_method_args = $job_method_args . $arg . ' ';
                    } elseif (is_object($arg) && ! empty($arg->ID)) {
                        $job_method_args = $job_method_args . $arg->ID . ' ';
                    }
                }

                WP_CLI::log(sprintf('Processing job: %s %s', $job->data['method'], $job_method_args));
                $success = call_user_func_array(array( $worker, $job->data['method'] ), $job->data['args']);
            } catch (Error $e) {
                $message = sprintf('Failed processing job. %s in %s:%d', $e->getMessage(), $e->getFile(), $e->getLine());
                WP_CLI::warning($message);
            }

            // remove job from queue & force save
            $queue->delete($job);
            $queue->save();

            // delay execution by the specified delay
            usleep($delay);
        }


        WP_CLI::success('Done!');
    }

    /**
     * Synchronises all coupons with Mailchimp.
     * @param $args
     * @param $assoc_args
     *
     * ## EXAMPLES
     *
     *     wp mc4wp-ecommerce sync-coupons
     *
     * @subcommand sync-coupons
     */
    public function sync_coupons($args, $assoc_args = array())
    {
        $coupons = get_posts(array(
            'post_type' => 'shop_coupon',
            'post_status' => 'any',
            'numberposts' => -1
        ));

        $count = count($coupons);
        WP_CLI::log(sprintf('Found %d coupons', $count));

        foreach ($coupons as $c) {
            try {
                if ($c->post_status == 'publish') {
                    WP_CLI::log(sprintf('Adding or updating coupon "%s" #%d', $c->post_title, $c->ID));
                    $this->ecommerce->update_promo($c->ID);
                } else {
                    WP_CLI::log(sprintf('Deleting coupon "%s" #%d', $c->post_title, $c->ID));
                    $this->ecommerce->delete_promo($c->ID);
                }
            } catch (MC4WP_API_Exception $e) {
                WP_CLI::error(sprintf('API Error: %s', $e));
            }
        }

        WP_CLI::success('Done!');
    }

    /**
    * Resets (empties) the job queue.
    *
    * @param $args
    * @param $assoc_args
    *
    * ## EXAMPLES
    *
    *     wp mc4wp-ecommerce reset-queue
    *
    * @subcommand reset-queue
    */
    public function reset_queue($args, $assoc_args = array())
    {
        /** @var MC4WP_Queue $queue */
        $queue = mc4wp('ecommerce.queue');
        $count = count($queue->all());
        WP_CLI::log(sprintf('Deleting %d pending jobs in queue.', $count));
        $queue->reset();
        $queue->save();
        WP_CLI::success('Done!');
    }
}
PK     M\J'  J'  +  ecommerce3/includes/class-cart-observer.phpnu [        <?php

class MC4WP_Ecommerce_Cart_Observer
{

	/**
	 * @var string
	 */
	private $plugin_file;

	/**
	 * @var MC4WP_Queue
	 */
	protected $queue;

	/**
	 * @var MC4WP_Ecommerce
	 */
	private $ecommerce;

	/**
	 * @var MC4WP_Ecommerce_Object_Transformer
	 */
	private $transformer;

	/**
	 * MC4WP_Ecommerce_Tracker constructor.
	 *
	 * @param string $plugin_file
	 * @param MC4WP_Ecommerce $ecommerce
	 * @param MC4WP_Queue $queue
	 * @param MC4WP_Ecommerce_Object_Transformer $transformer
	 */
	public function __construct($plugin_file, MC4WP_Ecommerce $ecommerce, MC4WP_Queue $queue, MC4WP_Ecommerce_Object_Transformer $transformer)
	{
		$this->plugin_file = $plugin_file;
		$this->ecommerce = $ecommerce;
		$this->queue = $queue;
		$this->transformer = $transformer;
	}

	/**
	 * Add hooks
	 */
	public function hook()
	{
		add_action('parse_request', array( $this, 'repopulate_cart_from_mailchimp' ));
		add_action('wp_enqueue_scripts', array( $this, 'enqueue_assets' ));
		add_action('wp_ajax_mc4wp_ecommerce_schedule_cart', array( $this, 'on_checkout_form_change' ));
		add_action('wp_ajax_nopriv_mc4wp_ecommerce_schedule_cart', array( $this, 'on_checkout_form_change' ));
		add_action('woocommerce_order_status_changed', array($this, 'on_order_status_change'), 10, 4);
		add_action('woocommerce_after_cart_item_restored', array( $this, 'on_cart_updated' ));
		add_action('woocommerce_after_cart_item_quantity_update', array( $this, 'on_cart_updated' ));
		add_action('woocommerce_add_to_cart', array( $this, 'on_cart_updated' ), 9);
		add_action('woocommerce_cart_item_removed', array( $this, 'on_cart_updated' ));
		add_action('woocommerce_cart_emptied', array( $this, 'on_cart_updated' ));
		add_action('wp_login', array( $this, 'on_cart_updated' ), 10, 2);
	}

	/**
	 * Repopulates a cart from Mailchimp if the "mc_cart_id" parameter is set.
	 */
	public function repopulate_cart_from_mailchimp()
	{
		if (empty($_GET['mc_cart_id'])) {
			return;
		}

		$cart_id = $_GET['mc_cart_id'];
		try {
			$cart_data = $this->ecommerce->get_cart($cart_id);
		} catch (Exception $e) {
			return;
		}

		/**
		 * Fires just before an abandoned cart from Mailchimp is added to the WooCommerce cart session.
		 *
		 * If you use this to override the default cart population, make sure to redirect after you are done.
		 *
		 * @param object $cart_data The data retrieved from Mailchimp.
		 * @link http://developer.mailchimp.com/documentation/mailchimp/reference/ecommerce/stores/carts/#read-get_ecommerce_stores_store_id_carts_cart_id
		 */
		do_action('mc4wp_ecommerce_restore_abandoned_cart', $cart_data);

		// empty cart
		$wc_cart = WC()->cart;
		$wc_cart->empty_cart();

		// add items from Mailchimp cart object
		foreach ($cart_data->lines as $line) {
			$variation_id = $line->product_variant_id != $line->product_id ? $line->product_variant_id : 0;
			$wc_cart->add_to_cart($line->product_id, $line->quantity, $variation_id);
		}

		// remove pending update & delete jobs
		$this->remove_pending_jobs('delete_cart', $cart_id);
		$this->remove_pending_jobs('update_cart', $cart_id);
		$this->queue->save();

		wp_redirect(remove_query_arg('mc_cart_id'));
		exit;
	}

	/**
	 * @param string $method
	 * @param int $object_id
	 */
	private function remove_pending_jobs($method, $object_id)
	{
		$jobs = $this->queue->all();
		foreach ($jobs as $job) {
			if ($job->data['method'] === $method && $job->data['args'][0] == $object_id) {
				$this->queue->delete($job);
			}
		}
	}

	/**
	 * @param string $method
	 * @param array $args
	 */
	private function add_pending_job($method, array $args)
	{
		$this->queue->put(
			array(
				'method' => $method,
				'args' => $args
			)
		);
	}

	/**
	 * Enqueue script on checkout page that periodically sends form data for guest checkouts.
	 */
	public function enqueue_assets()
	{
		// do not load script if user is logged in or if not on checkout page
		if (is_user_logged_in() || ! is_checkout()) {
			return;
		}

		// do not load if feature is disabled through constant or filter hook
		if ((defined('MC4WP_ECOMMERCE_DISABLE_GUEST_CART_TRACKING') && MC4WP_ECOMMERCE_DISABLE_GUEST_CART_TRACKING) || apply_filters('mc4wp_ecommerce_disable_guest_cart_tracking', false)) {
			return;
		}

		add_filter( 'script_loader_tag', array( $this, 'add_async_attribute' ), 20, 2 );
		wp_enqueue_script('mc4wp-ecommerce-cart', plugins_url("/assets/js/cart.js", $this->plugin_file), array(), MC4WP_PREMIUM_VERSION, true);

		wp_localize_script(
			'mc4wp-ecommerce-cart',
			'mc4wp_ecommerce_cart',
			array(
				'ajax_url' => admin_url('admin-ajax.php')
			)
		);
	}

	public function add_async_attribute( $tag, $handle )
	{
		if ( $handle !== 'mc4wp-ecommerce-cart' || stripos( $tag, 'defer' ) !== false ) {
			return $tag;
		}

		return str_replace( ' src=', ' defer src=', $tag );
	}

	// triggered via JavaScript hooked into checkoutForm.change
	public function on_checkout_form_change()
	{
		$customer_data = json_decode(stripslashes(file_get_contents("php://input")), false);

		// make sure we have at least an email_address
		if (empty($customer_data->billing_email)) {
			wp_send_json_error();
			exit;
		}

		// get cart, safely.
		$wc_cart = WC()->cart;
		if (! $wc_cart instanceof WC_Cart) {
			wp_send_json_error();
			return;
		}

		// only send cart to Mailchimp if email address looks valid
		if (is_email($customer_data->billing_email)) {
			$cart_id = $this->transformer->get_cart_id($customer_data->billing_email);

			// remove other pending updates from queue
			$this->remove_pending_jobs('update_cart', $cart_id);

			// update remote cart if we have items in cart
			if (! $this->is_cart_empty($wc_cart)) {
				$cart_contents = $this->get_cart_contents($wc_cart);
				$this->add_pending_job('update_cart', array($cart_id, $customer_data, $cart_contents));
			} else {
				$this->add_pending_job('delete_cart', array($cart_id));
			}
		}

		// delete previous cart if email address changed
		if (! empty($customer_data->previous_billing_email) && $customer_data->previous_billing_email !== $customer_data->billing_email) {

			// get previous cart ID
			$previous_cart_id = $this->transformer->get_cart_id($customer_data->previous_billing_email);

			// schedule cart deletion
			$this->add_pending_job('delete_cart', array( $previous_cart_id ));
		}

		$this->queue->save();
		wp_send_json_success();
		exit;
	}

	public function on_order_status_change($order_id, $from, $to, $order)
	{
		// keep cart in Mailchimp if order status is pending or failed
		$order_statuses_to_keep = array('', 'pending', 'failed');
		if (in_array($to, $order_statuses_to_keep)) {
			return;
		}

		// delete cart in Mailchimp if coming from pending or failed status
		if (! in_array($from, $order_statuses_to_keep)) {
			return;
		}

		$billing_email = method_exists($order, 'get_billing_email') ? $order->get_billing_email() : $order->billing_email;
		$cart_id = $this->transformer->get_cart_id($billing_email);
		$this->remove_pending_jobs('update_cart', $cart_id);
		$this->add_pending_job('delete_cart', array( $cart_id ));
		$this->queue->save();
	}


	/**
	 * @param mixed $a
	 * @param mixed|WP_User $b
	 *
	 * @throws Exception
	 *
	 * @see woocommerce_cart_item_removed
	 * @see woocommerce_cart_emptied
	 * @see wp_login
	 * @see woocommerce_after_cart_item_restored
	 * @see woocommerce_after_cart_item_quantity_update
	 * @see woocommerce_add_to_cart
	 */
	public function on_cart_updated( $a = null, $b = null )
	{
		// since WooCommerce 3.0
		if ( !class_exists('WC_Customer')) {
			return;
		}

		$user_id = $b instanceof WP_User ? $b->ID : get_current_user_id();
		$customer = new \WC_Customer($user_id, true);

		// get email address from billing_email or user_email property
		$email_address = $customer->get_billing_email();
		if (empty($email_address)) {
			if ($user_id > 0) {
				$this->get_log()->info( "E-Commerce: Skipping cart update for logged-in user without email address." );
			} else {
				$this->get_log()->debug( "E-Commerce: Skipping cart update for logged-out guest user without email address." );
			}
			return;
		}

		// sanity check, sometimes this returns null apparently?
		$wc_cart = WC()->cart;
		if (! $wc_cart instanceof WC_Cart) {
			return;
		}

		$cart_id = $this->transformer->get_cart_id($email_address);

		// delete cart from Mailchimp if it is now empty
		if ($this->is_cart_empty($wc_cart)) {
			// remove pending updates from queue
			$this->remove_pending_jobs('update_cart', $cart_id);

			// schedule cart deletion
			$this->add_pending_job('delete_cart', array( $cart_id ));
			$this->queue->save();
			return;
		}

		// remove other pending updates from queue
		$this->remove_pending_jobs('update_cart', $cart_id);

		// use user ID if this is a logged-in user, store data in queue otherwise
		$customer = $user_id > 0 ? $user_id : (object) array(
			'billing_email' => $customer->get_billing_email(),
			'first_name' => $customer->get_first_name(),
			'last_name' => $customer->get_last_name(),
		);
		$cart_contents = $this->get_cart_contents($wc_cart);

		// add data to queue
		$this->add_pending_job('update_cart', array($cart_id, $customer, $cart_contents));
		$this->queue->save();
	}

	private function get_cart_contents(WC_Cart $wc_cart)
	{
		// schedule new update with latest data
		$cart_contents = method_exists($wc_cart, 'get_cart_contents') ? $wc_cart->get_cart_contents() : $wc_cart->cart_contents;

		// remove data key as it holds an entire PHP object which we don't want to store
		$cart_contents = array_map(function($item) {
			if (isset($item['data'])) {
				unset($item['data']);
			}
			return $item;
		}, $cart_contents);

		return $cart_contents;
	}

	/**
	 * @param WC_Cart $cart
	 * @return bool
	 */
	private function is_cart_empty(WC_Cart $cart)
	{
		// for backwards compatibility with WooCommerce 2.2
		if (! method_exists($cart, 'is_empty')) {
			return (0 === count($cart->get_cart()));
		}

		return $cart->is_empty();
	}

	/**
	 * @return MC4WP_Debug_Log
	 */
	private function get_log()
	{
		return mc4wp('log');
	}
}
PK     M\]6Z    *  ecommerce3/includes/class-object-count.phpnu [        <?php

class MC4WP_Ecommerce_Object_Count
{

    /**
     * @var int
     */
    public $all;

    /**
     * @var int
     */
    public $tracked;

    /**
     * @var int
     */
    public $untracked;

    /**
     * @var int
     */
    public $percentage;

    /**
     * MC4WP_Ecommerce_Object_Count constructor.
     *
     * @param int $all
     * @param int $untracked
     */
    public function __construct($all, $untracked = 0)
    {
        $this->all = (int) $all;
        $this->untracked = (int) $untracked;
        $this->tracked = $this->all - $this->untracked;
        $this->percentage = $this->tracked > 0 ? $this->tracked / $this->all * 100 : 0;
    }
}
PK     M\?      ecommerce3/assets/js/cart.jsnu [        !function t(r,l,o){function c(i,e){if(!l[i]){if(!r[i]){var n="function"==typeof require&&require;if(!e&&n)return n(i,!0);if(a)return a(i,!0);throw(e=new Error("Cannot find module '"+i+"'")).code="MODULE_NOT_FOUND",e}n=l[i]={exports:{}},r[i][0].call(n.exports,function(e){return c(r[i][1][e]||e)},n,n.exports,t,r,l,o)}return l[i].exports}for(var a="function"==typeof require&&require,e=0;e<o.length;e++)c(o[e]);return c}({1:[function(e,i,n){"use strict";var r,t=document.querySelector('form.woocommerce-checkout, form[name="checkout"]'),l="",o=!1,c=("undefined"!=typeof mc4wp_ecommerce_cart?mc4wp_ecommerce_cart:woocommerce_params).ajax_url;function a(e){e=t.querySelector('[name="'.concat(e,'"]'));return e?e.value.trim():""}function _(e){var i,n={previous_billing_email:l,billing_email:a("billing_email"),billing_first_name:a("billing_first_name"),billing_last_name:a("billing_last_name"),billing_address_1:a("billing_address_1"),billing_address_2:a("billing_address_2"),billing_city:a("billing_city"),billing_state:a("billing_state"),billing_postcode:a("billing_postcode"),billing_country:a("billing_country")},t=JSON.stringify(n);"string"==typeof(i=n.billing_email)&&""!==i&&/\S+@\S+\.\S+/.test(i)&&t!==r&&((i=new XMLHttpRequest).open("POST",c+"?action=mc4wp_ecommerce_schedule_cart",e),i.setRequestHeader("Content-Type","application/json"),i.send(t),r=t,l=n.billing_email)}t&&(t.addEventListener("change",function(){_(!0)}),t.addEventListener("submit",function(){o=!0}),window.addEventListener("beforeunload",function(){o||_(!1)}))},{}]},{},[1]);PK     M\      ecommerce3/assets/js/tracker.jsnu [        !function r(o,i,c){function u(n,e){if(!i[n]){if(!o[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(f)return f(n,!0);throw(e=new Error("Cannot find module '"+n+"'")).code="MODULE_NOT_FOUND",e}t=i[n]={exports:{}},o[n][0].call(t.exports,function(e){return u(o[n][1][e]||e)},t,t.exports,r,o,i,c)}return i[n].exports}for(var f="function"==typeof require&&require,e=0;e<c.length;e++)u(c[e]);return u}({1:[function(e,n,t){"use strict";function r(e,n,t){var r,t=t?((r=new Date).setTime(r.getTime()+24*t*60*60*1e3),"; expires="+r.toGMTString()):"";document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(n)+t+"; path=/"}n.exports={read:function(e){for(var n=encodeURIComponent(e)+"=",t=document.cookie.split(";"),r=0;r<t.length;r++){for(var o=t[r];" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(n))return decodeURIComponent(o.substring(n.length,o.length))}return null},create:r,erase:function(e){r(e,"",-1)}}},{}],2:[function(e,n,t){"use strict";var r=e("./_cookie.js");["mc_cid","mc_eid","mc_tc"].forEach(function(e){n=e;var n=(n=new RegExp(n+"=([^&]+)").exec(window.location.search))&&0<n.length?n[1]:"";""!==n&&r.create(e,n,14)}),r.read("mc_landing_site")||r.create("mc_landing_site",window.location.href,7)},{"./_cookie.js":1}]},{},[2]);PK     M\:Fh    $  ecommerce3/assets/js/cart.min.js.mapnu [        {"version":3,"file":"cart.min.js","sources":["ecommerce3/assets/js/cart.js"],"sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){\n'use strict';\n\nvar checkoutForm = document.querySelector('form.woocommerce-checkout, form[name=\"checkout\"]');\nvar previousEmailAddress = '';\nvar previousDataString;\nvar formSubmitted = false;\nvar ajaxurl = typeof mc4wp_ecommerce_cart !== \"undefined\" ? mc4wp_ecommerce_cart.ajax_url : woocommerce_params.ajax_url;\n\nfunction isEmailAddressValid(emailAddress) {\n  var regex = /\\S+@\\S+\\.\\S+/;\n  return typeof emailAddress === \"string\" && emailAddress !== '' && regex.test(emailAddress);\n}\n\nfunction getFieldValue(fieldName) {\n  var field = checkoutForm.querySelector(\"[name=\\\"\".concat(fieldName, \"\\\"]\"));\n\n  if (!field) {\n    return '';\n  }\n\n  return field.value.trim();\n}\n\nfunction sendFormData(async) {\n  var data = {\n    previous_billing_email: previousEmailAddress,\n    billing_email: getFieldValue('billing_email'),\n    billing_first_name: getFieldValue('billing_first_name'),\n    billing_last_name: getFieldValue('billing_last_name'),\n    billing_address_1: getFieldValue('billing_address_1'),\n    billing_address_2: getFieldValue('billing_address_2'),\n    billing_city: getFieldValue('billing_city'),\n    billing_state: getFieldValue('billing_state'),\n    billing_postcode: getFieldValue('billing_postcode'),\n    billing_country: getFieldValue('billing_country')\n  };\n  var dataString = JSON.stringify(data); // schedule cart update if email looks valid && data changed.\n\n  if (isEmailAddressValid(data.billing_email) && dataString !== previousDataString) {\n    var request = new XMLHttpRequest();\n    request.open('POST', ajaxurl + \"?action=mc4wp_ecommerce_schedule_cart\", async);\n    request.setRequestHeader('Content-Type', 'application/json');\n    request.send(dataString);\n    previousDataString = dataString;\n    previousEmailAddress = data.billing_email;\n  }\n}\n\nif (checkoutForm) {\n  checkoutForm.addEventListener('change', function () {\n    sendFormData(true);\n  });\n  checkoutForm.addEventListener('submit', function () {\n    formSubmitted = true;\n  }); // always send before unloading window, but not if form was submitted\n\n  window.addEventListener('beforeunload', function () {\n    if (!formSubmitted) {\n      sendFormData(false);\n    }\n  });\n}\n\n},{}]},{},[1]);\n"],"names":["r","e","n","t","o","i","f","c","require","u","a","Error","code","p","exports","call","length","1","module","previousDataString","checkoutForm","document","querySelector","previousEmailAddress","formSubmitted","ajaxurl","mc4wp_ecommerce_cart","woocommerce_params","ajax_url","getFieldValue","fieldName","field","concat","value","trim","sendFormData","async","emailAddress","data","previous_billing_email","billing_email","billing_first_name","billing_last_name","billing_address_1","billing_address_2","billing_city","billing_state","billing_postcode","billing_country","dataString","JSON","stringify","test","request","XMLHttpRequest","open","setRequestHeader","send","addEventListener","window"],"mappings":"CAAY,SAASA,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIE,EAAE,mBAAmBC,SAASA,QAAQ,IAAIF,GAAGC,EAAE,OAAOA,EAAEF,GAAE,GAAI,GAAGI,EAAE,OAAOA,EAAEJ,GAAE,GAAkD,MAA1CK,EAAE,IAAIC,MAAM,uBAAuBN,EAAE,MAAaO,KAAK,mBAAmBF,EAAMG,EAAEX,EAAEG,GAAG,CAACS,QAAQ,IAAIb,EAAEI,GAAG,GAAGU,KAAKF,EAAEC,QAAQ,SAASd,GAAoB,OAAOI,EAAlBH,EAAEI,GAAG,GAAGL,IAAeA,IAAIa,EAAEA,EAAEC,QAAQd,EAAEC,EAAEC,EAAEC,GAAG,OAAOD,EAAEG,GAAGS,QAAQ,IAAI,IAAIL,EAAE,mBAAmBD,SAASA,QAAQH,EAAE,EAAEA,EAAEF,EAAEa,OAAOX,IAAID,EAAED,EAAEE,IAAI,OAAOD,EAA7b,CAA4c,CAACa,EAAE,CAAC,SAAST,EAAQU,EAAOJ,gBAGxe,IAEIK,EAFAC,EAAeC,SAASC,cAAc,oDACtCC,EAAuB,GAEvBC,GAAgB,EAChBC,GAA0C,oBAAzBC,qBAAuCA,qBAAgCC,oBAAXC,SAOjF,SAASC,EAAcC,GACjBC,EAAQX,EAAaE,cAAc,UAAWU,OAAOF,EAAW,OAEpE,OAAKC,EAIEA,EAAME,MAAMC,OAHV,GAMX,SAASC,EAAaC,GACpB,IAhB2BC,EAgBvBC,EAAO,CACTC,uBAAwBhB,EACxBiB,cAAeX,EAAc,iBAC7BY,mBAAoBZ,EAAc,sBAClCa,kBAAmBb,EAAc,qBACjCc,kBAAmBd,EAAc,qBACjCe,kBAAmBf,EAAc,qBACjCgB,aAAchB,EAAc,gBAC5BiB,cAAejB,EAAc,iBAC7BkB,iBAAkBlB,EAAc,oBAChCmB,gBAAiBnB,EAAc,oBAE7BoB,EAAaC,KAAKC,UAAUb,GA1BD,iBAFJD,EA8BHC,EAAKE,gBA5B+B,KAAjBH,GAD/B,eAC4De,KAAKf,IA4B9BY,IAAe9B,KACxDkC,EAAU,IAAIC,gBACVC,KAAK,OAAQ9B,EAAU,wCAAyCW,GACxEiB,EAAQG,iBAAiB,eAAgB,oBACzCH,EAAQI,KAAKR,GACb9B,EAAqB8B,EACrB1B,EAAuBe,EAAKE,eAI5BpB,IACFA,EAAasC,iBAAiB,SAAU,WACtCvB,GAAa,KAEff,EAAasC,iBAAiB,SAAU,WACtClC,GAAgB,IAGlBmC,OAAOD,iBAAiB,eAAgB,WACjClC,GACHW,GAAa,OAKjB,KAAK,GAAG,CAAC"}PK     M\UV       ecommerce3/assets/js/cart.min.jsnu [        !function t(r,l,o){function c(i,e){if(!l[i]){if(!r[i]){var n="function"==typeof require&&require;if(!e&&n)return n(i,!0);if(a)return a(i,!0);throw(n=new Error("Cannot find module '"+i+"'")).code="MODULE_NOT_FOUND",n}n=l[i]={exports:{}},r[i][0].call(n.exports,function(e){return c(r[i][1][e]||e)},n,n.exports,t,r,l,o)}return l[i].exports}for(var a="function"==typeof require&&require,e=0;e<o.length;e++)c(o[e]);return c}({1:[function(e,i,n){"use strict";var r,t=document.querySelector('form.woocommerce-checkout, form[name="checkout"]'),l="",o=!1,c=("undefined"!=typeof mc4wp_ecommerce_cart?mc4wp_ecommerce_cart:woocommerce_params).ajax_url;function a(e){e=t.querySelector('[name="'.concat(e,'"]'));return e?e.value.trim():""}function _(e){var i,n={previous_billing_email:l,billing_email:a("billing_email"),billing_first_name:a("billing_first_name"),billing_last_name:a("billing_last_name"),billing_address_1:a("billing_address_1"),billing_address_2:a("billing_address_2"),billing_city:a("billing_city"),billing_state:a("billing_state"),billing_postcode:a("billing_postcode"),billing_country:a("billing_country")},t=JSON.stringify(n);"string"==typeof(i=n.billing_email)&&""!==i&&/\S+@\S+\.\S+/.test(i)&&t!==r&&((i=new XMLHttpRequest).open("POST",c+"?action=mc4wp_ecommerce_schedule_cart",e),i.setRequestHeader("Content-Type","application/json"),i.send(t),r=t,l=n.billing_email)}t&&(t.addEventListener("change",function(){_(!0)}),t.addEventListener("submit",function(){o=!0}),window.addEventListener("beforeunload",function(){o||_(!1)}))},{}]},{},[1]);PK     M\ȗS-  -    ecommerce3/assets/js/admin.jsnu [        !function r(o,i,l){function a(t,e){if(!i[t]){if(!o[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(u)return u(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}n=i[t]={exports:{}},o[t][0].call(n.exports,function(e){return a(o[t][1][e]||e)},n,n.exports,r,o,i,l)}return i[t].exports}for(var u="function"==typeof require&&require,e=0;e<l.length;e++)a(l[e]);return a}({1:[function(e,t,n){"use strict";t.exports=function(t){for(var e=document.querySelectorAll("[data-confirm]"),n=0;n<e.length;n++){var r=e[n];r.addEventListener("FORM"===r.tagName?"submit":"click",function(e){return!!confirm(e.target.getAttribute("data-confirm")||t.confirmation)||(e.preventDefault(),!1)})}}},{}],2:[function(e,t,n){"use strict";var r=e("mithril"),e={},o=mc4wp_ecommerce.i18n,i={working:!1,done:!1,action:"process"};function l(e){i.action=e.target.value}function a(e){confirm(o.confirmation)?i.action=e.target.value:e.preventDefault()}function u(e){e&&e.preventDefault(),i.working=!0,i.done=!1,r.request({method:"POST",url:ajaxurl+"?action=mc4wp_ecommerce_"+i.action+"_queue"}).then(function(e){i.done=!0,i.working=!1,document.getElementById("mc4wp-pending-background-jobs-count").innerText="0"}).catch(function(e){console.log(e)})}e.view=function(){return r("form",{method:"POST",onsubmit:u},[r("p",[r("button",{type:"submit",className:"button button-primary",value:"process",disabled:i.working||i.done,onclick:l},i.done&&"process"===i.action?o.done:o.process),r.trust("&nbsp; or &nbsp;"),r("button",{type:"submit",className:"button button-link-delete",value:"reset",disabled:i.working||i.done,onclick:a},i.done&&"reset"===i.action?o.done:o.reset)]),i.working?r("p.description",[" ",r("span.mc4wp-loader")," ",r("span",o.processing)]):""])},t.exports=e},{mithril:8}],3:[function(e,t,n){"use strict";mc4wp_ecommerce.i18n;var d=e("mithril");function r(e,t,n){function r(){d.request({method:"POST",url:window.ajaxurl+"?action=mc4wp_ecommerce_sync_".concat(t),body:n.slice(a,a+10)}).then(function(e){a+=e.length,u=a/n.length,c.push({date:new Date,messages:e}),a<n.length?r():s=!(l=!1)})}function o(){f.parentNode.removeChild(f),(l=!l)&&r()}function i(e){e.dom.scrollTop=e.dom.scrollHeight}var l=!1,a=0,u=0,s=0===n.length,c=[],f=e.parentElement.querySelector(".mc4wp-status-label");return{view:function(){return d("div",[d("p",[d("button.button",{onclick:o,disabled:s},s?"All done!":l?"Stop":"Start")," ",l?d("span.description",(100*u).toFixed(2)+"% — Please wait... This can take a while if you have many "+t+"."):""]),d("div.mc4wp-margin-m",{style:0<c.length?"display: block;":"display: none;"},[d("div.results",{style:"max-height: 240px; overflow-y: scroll;",oncreate:i,onupdate:i},c.map(function(e){return d("div.mc4wp-margin-s",[d("div",[d("strong",e.date.toLocaleString())]),e.messages.map(function(e){return d("div",e)})])})),d("p",[d("a",{href:"",onclick:function(e){e.preventDefault(),c=[]}},"Clear results")])])])}}}[].forEach.call(document.querySelectorAll("[data-wizard]"),function(e){var t=e.getAttribute("data-wizard"),n=JSON.parse(e.getAttribute("data-object-ids"));d.mount(e,r(e,t,n))})},{mithril:8}],4:[function(e,t,n){"use strict";var r=e("mithril"),o=e("./_queue-processor.js"),e=(e("./_confirm-attr.js")(),e("./_wizard.js"),document.getElementById("queue-processor"));e&&r.mount(e,o)},{"./_confirm-attr.js":1,"./_queue-processor.js":2,"./_wizard.js":3,mithril:8}],5:[function(e,t,n){"use strict";var u=e("../render/vnode");t.exports=function(r,e,t){var o=[],n=!1,i=!1;function l(){if(n)throw new Error("Nested m.redraw.sync() call");n=!0;for(var e=0;e<o.length;e+=2)try{r(o[e],u(o[e+1]),a)}catch(e){t.error(e)}n=!1}function a(){i||(i=!0,e(function(){i=!1,l()}))}return a.sync=l,{mount:function(e,t){if(null!=t&&null==t.view&&"function"!=typeof t)throw new TypeError("m.mount(element, component) expects a component, not a vnode");var n=o.indexOf(e);0<=n&&(o.splice(n,2),r(e,[],a)),null!=t&&(o.push(e,t),r(e,u(t),a))},redraw:a}}},{"../render/vnode":24}],6:[function(e,t,n){!function(A){!function(){"use strict";var k=e("../render/vnode"),i=e("../render/hyperscript"),T=e("../promise/promise"),o=e("../pathname/build"),E=e("../pathname/parse"),S=e("../pathname/compileTemplate"),j=e("../pathname/assign"),_={};t.exports=function(d,p){var u;function m(e,t,n){var r;e=o(e,t),null!=u?(u(),t=n?n.state:null,r=n?n.title:null,n&&n.replace?d.history.replaceState(t,r,x.prefix+e):d.history.pushState(t,r,x.prefix+e)):d.location.href=x.prefix+e}var h,v,y,g,w=_,b=x.SKIP={};function x(e,t,n){if(null==e)throw new Error("Ensure the DOM element that was passed to `m.route` is not undefined");var r,s=0,c=Object.keys(n).map(function(e){if("/"!==e[0])throw new SyntaxError("Routes must start with a `/`");if(/:([^\/\.-]+)(\.{3})?:/.test(e))throw new SyntaxError("Route parameter names must be separated with either `/`, `.`, or `-`");return{route:e,component:n[e],check:S(e)}}),o="function"==typeof A?A:setTimeout,f=T.resolve(),i=!1;if((u=null)!=t){var l=E(t);if(!c.some(function(e){return e.check(l)}))throw new ReferenceError("Default route doesn't match any known routes")}function a(){i=!1;var e=d.location.hash,l=("#"!==x.prefix[0]&&(e=d.location.search+e,"?"!==x.prefix[0]&&"/"!==(e=d.location.pathname+e)[0]&&(e="/"+e)),e.concat().replace(/(?:%[a-f89][a-f0-9])+/gim,decodeURIComponent).slice(x.prefix.length)),a=E(l);function u(){if(l===t)throw new Error("Could not resolve default route "+t);m(t,null,{replace:!0})}j(a.params,d.history.state),function t(n){for(;n<c.length;n++){var r,e,o,i;if(c[n].check(a))return r=c[n].component,e=c[n].route,i=g=function(e){if(i===g){if(e===b)return t(n+1);h=null==e||"function"!=typeof e.view&&"function"!=typeof e?"div":e,v=a.params,y=l,g=null,w=r.render?r:null,2===s?p.redraw():(s=2,p.redraw.sync())}},void((o=r).view||"function"==typeof r?(r={},i(o)):r.onmatch?f.then(function(){return r.onmatch(a.params,l,e)}).then(i,u):i("div"))}u()}(0)}return u=function(){i||(i=!0,o(a))},"function"==typeof d.history.pushState?d.addEventListener("popstate",u,!(r=function(){d.removeEventListener("popstate",u,!1)})):"#"===x.prefix[0]&&(u=null,d.addEventListener("hashchange",a,!(r=function(){d.removeEventListener("hashchange",a,!1)}))),p.mount(e,{onbeforeupdate:function(){return!(!(s=s?2:1)||_===w)},oncreate:a,onremove:r,view:function(){var e;if(s&&_!==w)return e=[k(h,v.key,v)],w?w.render(e[0]):e}})}return x.set=function(e,t,n){null!=g&&((n=n||{}).replace=!0),g=null,m(e,t,n)},x.get=function(){return y},x.prefix="#!",x.Link={view:function(e){var n,r,o=e.attrs.options,t={},t=(j(t,e.attrs),t.selector=t.options=t.key=t.oninit=t.oncreate=t.onbeforeupdate=t.onupdate=t.onbeforeremove=t.onremove=null,i(e.attrs.selector||"a",t,e.children));return(t.attrs.disabled=Boolean(t.attrs.disabled))?(t.attrs.href=null,t.attrs["aria-disabled"]="true",t.attrs.onclick=null):(n=t.attrs.onclick,r=t.attrs.href,t.attrs.href=x.prefix+r,t.attrs.onclick=function(e){var t;"function"==typeof n?t=n.call(e.currentTarget,e):null!=n&&"object"==typeof n&&"function"==typeof n.handleEvent&&n.handleEvent(e),!1===t||e.defaultPrevented||0!==e.button&&0!==e.which&&1!==e.which||e.currentTarget.target&&"_self"!==e.currentTarget.target||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||(e.preventDefault(),e.redraw=!1,x.set(r,null,o))}),t}},x.param=function(e){return v&&null!=e?v[e]:v},x}}.call(this)}.call(this,e("timers").setImmediate)},{"../pathname/assign":10,"../pathname/build":11,"../pathname/compileTemplate":12,"../pathname/parse":13,"../promise/promise":15,"../render/hyperscript":20,"../render/vnode":24,timers:29}],7:[function(e,t,n){"use strict";var r=e("./render/hyperscript");r.trust=e("./render/trust"),r.fragment=e("./render/fragment"),t.exports=r},{"./render/fragment":19,"./render/hyperscript":20,"./render/trust":23}],8:[function(e,t,n){"use strict";function r(){return o.apply(this,arguments)}var o=e("./hyperscript"),i=e("./request"),l=e("./mount-redraw");r.m=o,r.trust=o.trust,r.fragment=o.fragment,r.mount=l.mount,r.route=e("./route"),r.render=e("./render"),r.redraw=l.redraw,r.request=i.request,r.jsonp=i.jsonp,r.parseQueryString=e("./querystring/parse"),r.buildQueryString=e("./querystring/build"),r.parsePathname=e("./pathname/parse"),r.buildPathname=e("./pathname/build"),r.vnode=e("./render/vnode"),r.PromisePolyfill=e("./promise/polyfill"),t.exports=r},{"./hyperscript":7,"./mount-redraw":9,"./pathname/build":11,"./pathname/parse":13,"./promise/polyfill":14,"./querystring/build":16,"./querystring/parse":17,"./render":18,"./render/vnode":24,"./request":25,"./route":27}],9:[function(e,t,n){"use strict";var r=e("./render");t.exports=e("./api/mount-redraw")(r,requestAnimationFrame,console)},{"./api/mount-redraw":5,"./render":18}],10:[function(e,t,n){"use strict";t.exports=Object.assign||function(t,n){n&&Object.keys(n).forEach(function(e){t[e]=n[e]})}},{}],11:[function(e,t,n){"use strict";var f=e("../querystring/build"),d=e("./assign");t.exports=function(e,r){if(/:([^\/\.-]+)(\.{3})?:/.test(e))throw new SyntaxError("Template parameter names *must* be separated");if(null==r)return e;var t=e.indexOf("?"),n=e.indexOf("#"),o=n<0?e.length:n,i=e.slice(0,t<0?o:t),l={},i=(d(l,r),i.replace(/:([^\/\.-]+)(\.{3})?/g,function(e,t,n){return delete l[t],null==r[t]?e:n?r[t]:encodeURIComponent(String(r[t]))})),a=i.indexOf("?"),u=i.indexOf("#"),s=u<0?i.length:u,c=i.slice(0,a<0?s:a),o=(0<=t&&(c+=e.slice(t,o)),0<=a&&(c+=(t<0?"?":"&")+i.slice(a,s)),f(l));return o&&(c+=(t<0&&a<0?"?":"&")+o),0<=n&&(c+=e.slice(n)),0<=u&&(c+=(n<0?"":"&")+i.slice(u)),c}},{"../querystring/build":16,"./assign":10}],12:[function(e,t,n){"use strict";var a=e("./parse");t.exports=function(e){var r=a(e),o=Object.keys(r.params),i=[],l=new RegExp("^"+r.path.replace(/:([^\/.-]+)(\.{3}|\.(?!\.)|-)?|[\\^$*+.()|\[\]{}]/g,function(e,t,n){return null==t?"\\"+e:(i.push({k:t,r:"..."===n}),"..."===n?"(.*)":"."===n?"([^/]+)\\.":"([^/]+)"+(n||""))})+"$");return function(e){for(var t=0;t<o.length;t++)if(r.params[o[t]]!==e.params[o[t]])return!1;if(!i.length)return l.test(e.path);var n=l.exec(e.path);if(null==n)return!1;for(t=0;t<i.length;t++)e.params[i[t].k]=i[t].r?n[t+1]:decodeURIComponent(n[t+1]);return!0}}},{"./parse":13}],13:[function(e,t,n){"use strict";var o=e("../querystring/parse");t.exports=function(e){var t=e.indexOf("?"),n=e.indexOf("#"),n=n<0?e.length:n,r=e.slice(0,t<0?n:t).replace(/\/{2,}/g,"/");return r?1<(r="/"!==r[0]?"/"+r:r).length&&"/"===r[r.length-1]&&(r=r.slice(0,-1)):r="/",{path:r,params:t<0?{}:o(e.slice(t+1,n))}}},{"../querystring/parse":17}],14:[function(e,t,n){!function(n){!function(){"use strict";function d(e){if(!(this instanceof d))throw new Error("Promise must be called with `new`");if("function"!=typeof e)throw new TypeError("executor must be a function");var i=this,l=[],a=[],o=t(l,!0),u=t(a,!1),s=i._instance={resolvers:l,rejectors:a},c="function"==typeof n?n:setTimeout;function t(r,o){return function t(n){var e;try{if(!o||null==n||"object"!=typeof n&&"function"!=typeof n||"function"!=typeof(e=n.then))c(function(){o||0!==r.length||console.error("Possible unhandled promise rejection:",n);for(var e=0;e<r.length;e++)r[e](n);l.length=0,a.length=0,s.state=o,s.retry=function(){t(n)}});else{if(n===i)throw new TypeError("Promise can't be resolved w/ itself");f(e.bind(n))}}catch(e){u(e)}}}function f(e){var n=0;function t(t){return function(e){0<n++||t(e)}}var r=t(u);try{e(t(o),r)}catch(e){r(e)}}f(e)}d.prototype.then=function(e,t){var o,i,l=this._instance;function n(t,e,n,r){e.push(function(e){if("function"!=typeof t)n(e);else try{o(t(e))}catch(e){i&&i(e)}}),"function"==typeof l.retry&&r===l.state&&l.retry()}var r=new d(function(e,t){o=e,i=t});return n(e,l.resolvers,o,!0),n(t,l.rejectors,i,!1),r},d.prototype.catch=function(e){return this.then(null,e)},d.prototype.finally=function(t){return this.then(function(e){return d.resolve(t()).then(function(){return e})},function(e){return d.resolve(t()).then(function(){return d.reject(e)})})},d.resolve=function(t){return t instanceof d?t:new d(function(e){e(t)})},d.reject=function(n){return new d(function(e,t){t(n)})},d.all=function(a){return new d(function(n,r){var o=a.length,i=0,l=[];if(0===a.length)n([]);else for(var e=0;e<a.length;e++)!function(t){function e(e){i++,l[t]=e,i===o&&n(l)}null==a[t]||"object"!=typeof a[t]&&"function"!=typeof a[t]||"function"!=typeof a[t].then?e(a[t]):a[t].then(e,r)}(e)})},d.race=function(r){return new d(function(e,t){for(var n=0;n<r.length;n++)r[n].then(e,t)})},t.exports=d}.call(this)}.call(this,e("timers").setImmediate)},{timers:29}],15:[function(n,r,e){!function(t){!function(){"use strict";var e=n("./polyfill");"undefined"!=typeof window?(void 0===window.Promise?window.Promise=e:window.Promise.prototype.finally||(window.Promise.prototype.finally=e.prototype.finally),r.exports=window.Promise):void 0!==t?(void 0===t.Promise?t.Promise=e:t.Promise.prototype.finally||(t.Promise.prototype.finally=e.prototype.finally),r.exports=t.Promise):r.exports=e}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./polyfill":14}],16:[function(e,t,n){"use strict";t.exports=function(e){if("[object Object]"!==Object.prototype.toString.call(e))return"";var t,o=[];for(t in e)!function e(t,n){if(Array.isArray(n))for(var r=0;r<n.length;r++)e(t+"["+r+"]",n[r]);else if("[object Object]"===Object.prototype.toString.call(n))for(var r in n)e(t+"["+r+"]",n[r]);else o.push(encodeURIComponent(t)+(null!=n&&""!==n?"="+encodeURIComponent(n):""))}(t,e[t]);return o.join("&")}},{}],17:[function(e,t,n){"use strict";t.exports=function(e){if(""===e||null==e)return{};for(var t=(e="?"===e.charAt(0)?e.slice(1):e).split("&"),n={},r={},o=0;o<t.length;o++){var i=t[o].split("="),l=decodeURIComponent(i[0]),a=2===i.length?decodeURIComponent(i[1]):"",u=("true"===a?a=!0:"false"===a&&(a=!1),l.split(/\]\[?|\[/)),s=r;-1<l.indexOf("[")&&u.pop();for(var c=0;c<u.length;c++){var f,d=u[c],p=u[c+1],p=""==p||!isNaN(parseInt(p,10));if(""===d)null==n[l=u.slice(0,c).join()]&&(n[l]=Array.isArray(s)?s.length:0),d=n[l]++;else if("__proto__"===d)break;c===u.length-1?s[d]=a:(null==(f=null!=(f=Object.getOwnPropertyDescriptor(s,d))?f.value:f)&&(s[d]=f=p?[]:{}),s=f)}}return r}},{}],18:[function(e,t,n){"use strict";t.exports=e("./render/render")(window)},{"./render/render":22}],19:[function(e,t,n){"use strict";var r=e("../render/vnode"),o=e("./hyperscriptVnode");t.exports=function(){var e=o.apply(0,arguments);return e.tag="[",e.children=r.normalizeChildren(e.children),e}},{"../render/vnode":24,"./hyperscriptVnode":21}],20:[function(e,t,n){"use strict";var u=e("../render/vnode"),s=e("./hyperscriptVnode"),c=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,f={},d={}.hasOwnProperty;function p(e){for(var t in e)if(d.call(e,t))return;return 1}t.exports=function(e){if(null==e||"string"!=typeof e&&"function"!=typeof e&&"function"!=typeof e.view)throw Error("The selector must be either a string or a component.");var t=s.apply(1,arguments);if("string"!=typeof e||(t.children=u.normalizeChildren(t.children),"["===e))return t.tag=e,t;var n=f[e]||function(e){for(var t,n="div",r=[],o={};t=c.exec(e);){var i=t[1],l=t[2];""===i&&""!==l?n=l:"#"===i?o.id=l:"."===i?r.push(l):"["===t[3][0]&&(i=(i=t[6])&&i.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\"),"class"===t[4]?r.push(i):o[t[4]]=""===i?i:i||!0)}return 0<r.length&&(o.className=r.join(" ")),f[e]={tag:n,attrs:o}}(e),r=t,o=r.attrs,e=u.normalizeChildren(r.children),i=(t=d.call(o,"class"))?o.class:o.className;if(r.tag=n.tag,r.attrs=null,r.children=void 0,!p(n.attrs)&&!p(o)){var l,a={};for(l in o)d.call(o,l)&&(a[l]=o[l]);o=a}for(l in n.attrs)d.call(n.attrs,l)&&"className"!==l&&!d.call(o,l)&&(o[l]=n.attrs[l]);for(l in null==i&&null==n.attrs.className||(o.className=null!=i?null!=n.attrs.className?String(n.attrs.className)+" "+String(i):i:null!=n.attrs.className?n.attrs.className:null),t&&(o.class=null),o)if(d.call(o,l)&&"key"!==l){r.attrs=o;break}return Array.isArray(e)&&1===e.length&&null!=e[0]&&"#"===e[0].tag?r.text=e[0].children:r.children=e,r}},{"../render/vnode":24,"./hyperscriptVnode":21}],21:[function(e,t,n){"use strict";var r=e("../render/vnode");t.exports=function(){var e,t=arguments[this],n=this+1;if(null==t?t={}:"object"==typeof t&&null==t.tag&&!Array.isArray(t)||(t={},n=this),arguments.length===n+1)e=arguments[n],Array.isArray(e)||(e=[e]);else for(e=[];n<arguments.length;)e.push(arguments[n++]);return r("",t.key,t,e)}},{"../render/vnode":24}],22:[function(e,t,n){"use strict";var Y=e("../render/vnode");t.exports=function(e){var u,S=e&&e.document,t={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"};function $(e){return e.attrs&&e.attrs.xmlns||t[e.tag]}function s(e,t){if(e.state!==t)throw new Error("`vnode.state` must not be modified")}function R(e){var t=e.state;try{return this.apply(t,arguments)}finally{s(e,t)}}function D(){try{return S.activeElement}catch(e){return null}}function _(e,t,n,r,o,i,l){for(var a=n;a<r;a++){var u=t[a];null!=u&&M(e,u,o,l,i)}}function M(e,t,n,r,o){var i,l,a,u,s=t.tag;if("string"==typeof s)switch(t.state={},null!=t.attrs&&N(t.attrs,t,n),s){case"#":c=e,d=o,(f=t).dom=S.createTextNode(f.children),j(c,f.dom,d);break;case"<":F(e,t,r,o);break;case"[":var c=e,f=t,d=n,p=r,m=o,h=S.createDocumentFragment();null!=f.children&&(v=f.children,_(h,v,0,v.length,d,null,p)),f.dom=h.firstChild,f.domSize=h.childNodes.length,j(c,h,m);break;default:var v=e,p=t,h=n,m=r,y=o,g=p.tag,w=p.attrs,b=w&&w.is,b=(m=$(p)||m)?b?S.createElementNS(m,g,{is:b}):S.createElementNS(m,g):b?S.createElement(g,{is:b}):S.createElement(g);if(p.dom=b,null!=w){var x=p;var k=w;var T=m;for(var E in k)B(x,E,null,k[E],T)}if(j(v,b,y),!V(p)){null!=p.text&&(""!==p.text?b.textContent=p.text:p.children=[Y("#",void 0,void 0,p.text,void 0,void 0)]);if(null!=p.children){g=p.children,_(b,g,0,g.length,h,null,m);if("select"===p.tag&&null!=w){y=p;b=w;"value"in b&&(null===b.value?-1!==y.dom.selectedIndex&&(y.dom.value=null):(g=""+b.value,y.dom.value===g&&-1!==y.dom.selectedIndex||(y.dom.value=g)));"selectedIndex"in b&&B(y,"selectedIndex",null,b.selectedIndex,void 0)}}}}else s=e,a=r,u=o,function(e,t){var n;if("function"==typeof e.tag.view){if(e.state=Object.create(e.tag),null!=(n=e.state.view).$$reentrantLock$$)return;n.$$reentrantLock$$=!0}else{if(e.state=void 0,null!=(n=e.tag).$$reentrantLock$$)return;n.$$reentrantLock$$=!0,e.state=null!=e.tag.prototype&&"function"==typeof e.tag.prototype.view?new e.tag(e):e.tag(e)}N(e.state,e,t),null!=e.attrs&&N(e.attrs,e,t);if(e.instance=Y.normalize(R.call(e.state.view,e)),e.instance===e)throw Error("A view cannot return the vnode it received as argument");n.$$reentrantLock$$=null}(i=t,l=n),null!=i.instance?(M(s,i.instance,l,a,u),i.dom=i.instance.dom,i.domSize=null!=i.dom?i.instance.domSize:0):i.domSize=0}var c={caption:"table",thead:"table",tbody:"table",tfoot:"table",tr:"tbody",th:"tr",td:"tr",colgroup:"table",col:"colgroup"};function F(e,t,n,r){for(var o,i=t.children.match(/^\s*?<(\w+)/im)||[],l=S.createElement(c[i[1]]||"div"),a=("http://www.w3.org/2000/svg"===n?(l.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+t.children+"</svg>",l=l.firstChild):l.innerHTML=t.children,t.dom=l.firstChild,t.domSize=l.childNodes.length,t.instance=[],S.createDocumentFragment());o=l.firstChild;)t.instance.push(o),a.appendChild(o);j(e,a,r)}function U(e,t,n,r,o,i){if(t!==n&&(null!=t||null!=n))if(null==t||0===t.length)_(e,n,0,n.length,r,o,i);else if(null==n||0===n.length)z(e,t,0,t.length);else{var l=null!=t[0]&&null!=t[0].key,a=null!=n[0]&&null!=n[0].key,u=0,s=0;if(!l)for(;s<t.length&&null==t[s];)s++;if(!a)for(;u<n.length&&null==n[u];)u++;if(null!==a||null!=l)if(l!=a)z(e,t,s,t.length),_(e,n,u,n.length,r,o,i);else if(a){for(var c,f,d,p,m=t.length-1,h=n.length-1;s<=m&&u<=h&&(d=t[m],E=n[h],d.key===E.key);)d!==E&&H(e,d,E,r,o,i),null!=E.dom&&(o=E.dom),m--,h--;for(;s<=m&&u<=h&&(c=t[s],f=n[u],c.key===f.key);)s++,u++,c!==f&&H(e,c,f,r,C(t,s,o),i);for(;s<=m&&u<=h&&u!==h&&c.key===E.key&&d.key===f.key;)O(e,d,p=C(t,s,o)),d!==f&&H(e,d,f,r,p,i),++u<=--h&&O(e,c,o),c!==E&&H(e,c,E,r,o,i),null!=E.dom&&(o=E.dom),d=t[--m],E=n[h],c=t[++s],f=n[u];for(;s<=m&&u<=h&&d.key===E.key;)d!==E&&H(e,d,E,r,o,i),null!=E.dom&&(o=E.dom),d=t[--m],E=n[--h];if(h<u)z(e,t,s,m+1);else if(m<s)_(e,n,u,h+1,r,o,i);else{for(var v,y,l=o,g=h-u+1,w=new Array(g),b=0,x=0,k=2147483647,T=0,x=0;x<g;x++)w[x]=-1;for(x=h;u<=x;x--){var E,S=(v=null==v?function(e,t,n){for(var r=Object.create(null);t<n;t++){var o=e[t];null==o||null!=(o=o.key)&&(r[o]=t)}return r}(t,s,m+1):v)[(E=n[x]).key];null!=S&&(k=S<k?S:-1,d=t[w[x-u]=S],t[S]=null,d!==E&&H(e,d,E,r,o,i),null!=E.dom&&(o=E.dom),T++)}if(o=l,T!==m-s+1&&z(e,t,s,m+1),0===T)_(e,n,u,h+1,r,o,i);else if(-1===k)for(b=(y=function(e){for(var t=[0],n=0,r=0,o=0,i=A.length=e.length,o=0;o<i;o++)A[o]=e[o];for(o=0;o<i;++o)if(-1!==e[o]){var l=t[t.length-1];if(e[l]<e[o])A[o]=l,t.push(o);else{for(n=0,r=t.length-1;n<r;){var a=(n>>>1)+(r>>>1)+(n&r&1);e[t[a]]<e[o]?n=1+a:r=a}e[o]<e[t[n]]&&(0<n&&(A[o]=t[n-1]),t[n]=o)}}n=t.length,r=t[n-1];for(;0<n--;)t[n]=r,r=A[r];return A.length=0,t}(w)).length-1,x=h;u<=x;x--)f=n[x],-1===w[x-u]?M(e,f,r,i,o):y[b]===x-u?b--:O(e,f,o),null!=f.dom&&(o=n[x].dom);else for(x=h;u<=x;x--)f=n[x],-1===w[x-u]&&M(e,f,r,i,o),null!=f.dom&&(o=n[x].dom)}}else{for(var j=(t.length<n.length?t:n).length,u=u<s?u:s;u<j;u++)(c=t[u])===(f=n[u])||null==c&&null==f||(null==c?M(e,f,r,i,C(t,u+1,o)):null==f?K(e,c):H(e,c,f,r,C(t,u+1,o),i));t.length>j&&z(e,t,u,t.length),n.length>j&&_(e,n,u,n.length,r,o,i)}}}function H(e,t,n,r,o,i){var l=t.tag;if(l===n.tag){if(n.state=t.state,n.events=t.events,!function(e,t){do{var n;if(null!=e.attrs&&"function"==typeof e.attrs.onbeforeupdate)if(void 0!==(n=R.call(e.attrs.onbeforeupdate,e,t))&&!n)break;if("string"!=typeof e.tag&&"function"==typeof e.state.onbeforeupdate)if(void 0!==(n=R.call(e.state.onbeforeupdate,e,t))&&!n)break;return}while(0);return e.dom=t.dom,e.domSize=t.domSize,e.instance=t.instance,e.attrs=t.attrs,e.children=t.children,e.text=t.text,1}(n,t))if("string"==typeof l)switch(null!=n.attrs&&W(n.attrs,n,r),l){case"#":var a=t,u=n;a.children.toString()!==u.children.toString()&&(a.dom.nodeValue=u.children),u.dom=a.dom;break;case"<":u=e,a=n,c=i,f=o,(d=t).children!==a.children?(J(u,d),F(u,a,c,f)):(a.dom=d.dom,a.domSize=d.domSize,a.instance=d.instance);break;case"[":var s=n,c=r,f=o,d=i,p=(U(e,t.children,s.children,c,f,d),0),m=s.children;if((s.dom=null)!=m){for(var h=0;h<m.length;h++){var v=m[h];null!=v&&null!=v.dom&&(null==s.dom&&(s.dom=v.dom),p+=v.domSize||1)}1!==p&&(s.domSize=p)}break;default:var y,g=t,w=n,b=r,x=i,L=w.dom=g.dom,k=(x=$(w)||x,"textarea"===w.tag&&(null==w.attrs&&(w.attrs={}),null!=w.text&&(w.attrs.value=w.text,w.text=void 0)),w),T=g.attrs,E=w.attrs,S=x;if(null!=E)for(var j in E)B(k,j,T&&T[j],E[j],S);if(null!=T)for(var j in T)if(null!=(y=T[j])&&(null==E||null==E[j])){_=void 0;A=void 0;C=void 0;O=void 0;O=void 0;var _=k;var A=j;var C=y;var O=S;"key"===A||"is"===A||null==C||Q(A)||("o"!==A[0]||"n"!==A[1]||Q(A)?"style"===A?X(_.dom,C,null):!G(_,A,O)||"className"===A||"value"===A&&("option"===_.tag||"select"===_.tag&&-1===_.dom.selectedIndex&&_.dom===D())||"input"===_.tag&&"type"===A?(-1!==(O=A.indexOf(":"))&&(A=A.slice(O+1)),!1!==C&&_.dom.removeAttribute("className"===A?"class":A)):_.dom[A]=null:Z(_,A,void 0))}V(w)||(null!=g.text&&null!=w.text&&""!==w.text?g.text.toString()!==w.text.toString()&&(g.dom.firstChild.nodeValue=w.text):(null!=g.text&&(g.children=[Y("#",void 0,void 0,g.text,void 0,g.dom.firstChild)]),null!=w.text&&(w.children=[Y("#",void 0,void 0,w.text,void 0,void 0)]),U(L,g.children,w.children,b,null,x)))}else{var l=e,z=t,N=n,q=r,I=o,P=i;if(N.instance=Y.normalize(R.call(N.state.view,N)),N.instance===N)throw Error("A view cannot return the vnode it received as argument");W(N.state,N,q),null!=N.attrs&&W(N.attrs,N,q),null!=N.instance?(null==z.instance?M(l,N.instance,q,P,I):H(l,z.instance,N.instance,q,I,P),N.dom=N.instance.dom,N.domSize=N.instance.domSize):null!=z.instance?(K(l,z.instance),N.dom=void 0,N.domSize=0):(N.dom=z.dom,N.domSize=z.domSize)}}else K(e,t),M(e,n,r,i,o)}var A=[];function C(e,t,n){for(;t<e.length;t++)if(null!=e[t]&&null!=e[t].dom)return e[t].dom;return n}function O(e,t,n){var r=S.createDocumentFragment();!function e(t,n,r){for(;null!=r.dom&&r.dom.parentNode===t;){if("string"!=typeof r.tag){if(null!=(r=r.instance))continue}else if("<"===r.tag)for(var o=0;o<r.instance.length;o++)n.appendChild(r.instance[o]);else if("["!==r.tag)n.appendChild(r.dom);else if(1===r.children.length){if(null!=(r=r.children[0]))continue}else for(o=0;o<r.children.length;o++){var i=r.children[o];null!=i&&e(t,n,i)}break}}(e,r,t),j(e,r,n)}function j(e,t,n){null!=n?e.insertBefore(t,n):e.appendChild(t)}function V(e){if(null!=e.attrs&&(null!=e.attrs.contenteditable||null!=e.attrs.contentEditable)){var t=e.children;if(null!=t&&1===t.length&&"<"===t[0].tag){var n=t[0].children;e.dom.innerHTML!==n&&(e.dom.innerHTML=n)}else if(null!=e.text||null!=t&&0!==t.length)throw new Error("Child node of a contenteditable must be trusted");return 1}}function z(e,t,n,r){for(var o=n;o<r;o++){var i=t[o];null!=i&&K(e,i)}}function K(e,t){var n,r,o,i,l=0,a=t.state;function u(){s(t,a),d(t),f(e,t)}"string"!=typeof t.tag&&"function"==typeof t.state.onbeforeremove&&null!=(o=R.call(t.state.onbeforeremove,t))&&"function"==typeof o.then&&(l=1,n=o),t.attrs&&"function"==typeof t.attrs.onbeforeremove&&null!=(o=R.call(t.attrs.onbeforeremove,t))&&"function"==typeof o.then&&(l|=2,r=o),s(t,a),l?(null!=n&&n.then(i=function(){1&l&&((l&=2)||u())},i),null!=r&&r.then(i=function(){2&l&&((l&=1)||u())},i)):(d(t),f(e,t))}function J(e,t){for(var n=0;n<t.instance.length;n++)e.removeChild(t.instance[n])}function f(e,t){for(;null!=t.dom&&t.dom.parentNode===e;){if("string"!=typeof t.tag){if(null!=(t=t.instance))continue}else if("<"===t.tag)J(e,t);else{if("["!==t.tag&&(e.removeChild(t.dom),!Array.isArray(t.children)))break;if(1===t.children.length){if(null!=(t=t.children[0]))continue}else for(var n=0;n<t.children.length;n++){var r=t.children[n];null!=r&&f(e,r)}}break}}function d(e){if("string"!=typeof e.tag&&"function"==typeof e.state.onremove&&R.call(e.state.onremove,e),e.attrs&&"function"==typeof e.attrs.onremove&&R.call(e.attrs.onremove,e),"string"!=typeof e.tag)null!=e.instance&&d(e.instance);else{var t=e.children;if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];null!=r&&d(r)}}}function B(e,t,n,r,o){if("key"!==t&&"is"!==t&&null!=r&&!Q(t)&&(n!==r||(i=e,"value"===(l=t)||"checked"===l||"selectedIndex"===l||"selected"===l&&i.dom===D()||"option"===i.tag&&i.dom.parentNode===S.activeElement)||"object"==typeof r)){var i,l;if("o"===t[0]&&"n"===t[1])return Z(e,t,r);if("xlink:"===t.slice(0,6))e.dom.setAttributeNS("http://www.w3.org/1999/xlink",t.slice(6),r);else if("style"===t)X(e.dom,n,r);else if(G(e,t,o)){if("value"===t){if(("input"===e.tag||"textarea"===e.tag)&&e.dom.value===""+r&&e.dom===D())return;if("select"===e.tag&&null!==n&&e.dom.value===""+r)return;if("option"===e.tag&&null!==n&&e.dom.value===""+r)return}"input"===e.tag&&"type"===t?e.dom.setAttribute(t,r):e.dom[t]=r}else"boolean"==typeof r?r?e.dom.setAttribute(t,""):e.dom.removeAttribute(t):e.dom.setAttribute("className"===t?"class":t,r)}}function Q(e){return"oninit"===e||"oncreate"===e||"onupdate"===e||"onremove"===e||"onbeforeremove"===e||"onbeforeupdate"===e}function G(e,t,n){return void 0===n&&(-1<e.tag.indexOf("-")||null!=e.attrs&&e.attrs.is||"href"!==t&&"list"!==t&&"form"!==t&&"width"!==t&&"height"!==t)&&t in e.dom}var n=/[A-Z]/g;function r(e){return"-"+e.toLowerCase()}function i(e){return"-"===e[0]&&"-"===e[1]?e:"cssFloat"===e?"float":e.replace(n,r)}function X(e,t,n){if(t!==n)if(null==n)e.style.cssText="";else if("object"!=typeof n)e.style.cssText=n;else if(null==t||"object"!=typeof t)for(var r in e.style.cssText="",n)null!=(o=n[r])&&e.style.setProperty(i(r),String(o));else{for(var r in n){var o;null!=(o=n[r])&&(o=String(o))!==String(t[r])&&e.style.setProperty(i(r),o)}for(var r in t)null!=t[r]&&null==n[r]&&e.style.removeProperty(i(r))}}function o(){this._=u}function Z(e,t,n){null!=e.events?e.events[t]!==n&&(null==n||"function"!=typeof n&&"object"!=typeof n?(null!=e.events[t]&&e.dom.removeEventListener(t.slice(2),e.events,!1),e.events[t]=void 0):(null==e.events[t]&&e.dom.addEventListener(t.slice(2),e.events,!1),e.events[t]=n)):null==n||"function"!=typeof n&&"object"!=typeof n||(e.events=new o,e.dom.addEventListener(t.slice(2),e.events,!1),e.events[t]=n)}function N(e,t,n){"function"==typeof e.oninit&&R.call(e.oninit,t),"function"==typeof e.oncreate&&n.push(R.bind(e.oncreate,t))}function W(e,t,n){"function"==typeof e.onupdate&&n.push(R.bind(e.onupdate,t))}return(o.prototype=Object.create(null)).handleEvent=function(e){var t,n=this["on"+e.type];"function"==typeof n?t=n.call(e.currentTarget,e):"function"==typeof n.handleEvent&&n.handleEvent(e),this._&&!1!==e.redraw&&(0,this._)(),!1===t&&(e.preventDefault(),e.stopPropagation())},function(e,t,n){if(!e)throw new TypeError("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var r=[],o=D(),i=e.namespaceURI,l=(null==e.vnodes&&(e.textContent=""),t=Y.normalizeChildren(Array.isArray(t)?t:[t]),u);try{u="function"==typeof n?n:void 0,U(e,e.vnodes,t,r,null,"http://www.w3.org/1999/xhtml"===i?void 0:i)}finally{u=l}e.vnodes=t,null!=o&&D()!==o&&"function"==typeof o.focus&&o.focus();for(var a=0;a<r.length;a++)r[a]()}}},{"../render/vnode":24}],23:[function(e,t,n){"use strict";var r=e("../render/vnode");t.exports=function(e){return r("<",void 0,void 0,e=null==e?"":e,void 0,void 0)}},{"../render/vnode":24}],24:[function(e,t,n){"use strict";function o(e,t,n,r,o,i){return{tag:e,key:t,attrs:n,children:r,text:o,dom:i,domSize:void 0,state:void 0,events:void 0,instance:void 0}}o.normalize=function(e){return Array.isArray(e)?o("[",void 0,void 0,o.normalizeChildren(e),void 0,void 0):null==e||"boolean"==typeof e?null:"object"==typeof e?e:o("#",void 0,void 0,String(e),void 0,void 0)},o.normalizeChildren=function(e){var t=[];if(e.length){for(var n=null!=e[0]&&null!=e[0].key,r=1;r<e.length;r++)if((null!=e[r]&&null!=e[r].key)!=n)throw new TypeError("Vnodes must either always have keys or never have keys!");for(r=0;r<e.length;r++)t[r]=o.normalize(e[r])}return t},t.exports=o},{}],25:[function(e,t,n){"use strict";var r=e("./promise/promise"),o=e("./mount-redraw");t.exports=e("./request/request")(window,r,o.redraw)},{"./mount-redraw":9,"./promise/promise":15,"./request/request":26}],26:[function(e,t,n){"use strict";var s=e("../pathname/build");t.exports=function(m,n,a){var l=0;function u(e){return new n(e)}function e(l){return function(t,r){"string"!=typeof t?t=(r=t).url:null==r&&(r={});var e=new n(function(n,e){l(s(t,r.params),r,function(e){if("function"==typeof r.type)if(Array.isArray(e))for(var t=0;t<e.length;t++)e[t]=new r.type(e[t]);else e=new r.type(e);n(e)},e)});if(!0===r.background)return e;var o=0;function i(){0==--o&&"function"==typeof a&&a()}return function t(n){var r=n.then;n.constructor=u;n.then=function(){o++;var e=r.apply(n,arguments);return e.then(i,function(e){if(i(),0===o)throw e}),t(e)};return n}(e)}}function h(e,t){for(var n in e.headers)if({}.hasOwnProperty.call(e.headers,n)&&t.test(n))return 1}return u.prototype=n.prototype,u.__proto__=n,{request:e(function(i,l,a,u){var e,t,n=null!=l.method?l.method.toUpperCase():"GET",r=l.body,o=!(null!=l.serialize&&l.serialize!==JSON.serialize||r instanceof m.FormData),s=l.responseType||("function"==typeof l.extract?"":"json"),c=new m.XMLHttpRequest,f=!1,d=c,p=c.abort;for(t in c.abort=function(){f=!0,p.call(this)},c.open(n,i,!1!==l.async,"string"==typeof l.user?l.user:void 0,"string"==typeof l.password?l.password:void 0),o&&null!=r&&!h(l,/^content-type$/i)&&c.setRequestHeader("Content-Type","application/json; charset=utf-8"),"function"==typeof l.deserialize||h(l,/^accept$/i)||c.setRequestHeader("Accept","application/json, text/*"),l.withCredentials&&(c.withCredentials=l.withCredentials),l.timeout&&(c.timeout=l.timeout),c.responseType=s,l.headers)!{}.hasOwnProperty.call(l.headers,t)||c.setRequestHeader(t,l.headers[t]);c.onreadystatechange=function(e){if(!f&&4===e.target.readyState)try{var t,n=200<=e.target.status&&e.target.status<300||304===e.target.status||/^file:\/\//i.test(i),r=e.target.response;if("json"===s?e.target.responseType||"function"==typeof l.extract||(r=JSON.parse(e.target.responseText)):s&&"text"!==s||null==r&&(r=e.target.responseText),"function"==typeof l.extract?(r=l.extract(e.target,l),n=!0):"function"==typeof l.deserialize&&(r=l.deserialize(r)),n)a(r);else{try{t=e.target.responseText}catch(e){t=r}var o=new Error(t);o.code=e.target.status,o.response=r,u(o)}}catch(e){u(e)}},"function"==typeof l.config&&(c=l.config(c,l,i)||c)!==d&&(e=c.abort,c.abort=function(){f=!0,e.call(this)}),null==r?c.send():"function"==typeof l.serialize?c.send(l.serialize(r)):r instanceof m.FormData?c.send(r):c.send(JSON.stringify(r))}),jsonp:e(function(e,t,n,r){var o=t.callbackName||"_mithril_"+Math.round(1e16*Math.random())+"_"+l++,i=m.document.createElement("script");m[o]=function(e){delete m[o],i.parentNode.removeChild(i),n(e)},i.onerror=function(){delete m[o],i.parentNode.removeChild(i),r(new Error("JSONP request failed"))},i.src=e+(e.indexOf("?")<0?"?":"&")+encodeURIComponent(t.callbackKey||"callback")+"="+encodeURIComponent(o),m.document.documentElement.appendChild(i)})}}},{"../pathname/build":11}],27:[function(e,t,n){"use strict";var r=e("./mount-redraw");t.exports=e("./api/router")(window,r)},{"./api/router":6,"./mount-redraw":9}],28:[function(e,t,n){var r,o,t=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{o="function"==typeof clearTimeout?clearTimeout:l}catch(e){o=l}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return(r=setTimeout)(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}var u,s=[],c=!1,f=-1;function d(){c&&u&&(c=!1,u.length?s=u.concat(s):f=-1,s.length&&p())}function p(){if(!c){for(var e=a(d),t=(c=!0,s.length);t;){for(u=s,s=[];++f<t;)u&&u[f].run();f=-1,t=s.length}u=null,c=!1,!function(t){if(o===clearTimeout)return clearTimeout(t);if((o===l||!o)&&clearTimeout)return(o=clearTimeout)(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function h(){}t.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new m(e,t)),1!==s.length||c||a(p)},m.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=h,t.addListener=h,t.once=h,t.off=h,t.removeListener=h,t.removeAllListeners=h,t.emit=h,t.prependListener=h,t.prependOnceListener=h,t.listeners=function(e){return[]},t.binding=function(e){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(e){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},{}],29:[function(u,e,s){!function(n,a){!function(){var r=u("process/browser.js").nextTick,e=Function.prototype.apply,o=Array.prototype.slice,i={},l=0;function t(e,t){this._id=e,this._clearFn=t}s.setTimeout=function(){return new t(e.call(setTimeout,window,arguments),clearTimeout)},s.setInterval=function(){return new t(e.call(setInterval,window,arguments),clearInterval)},s.clearTimeout=s.clearInterval=function(e){e.close()},t.prototype.unref=t.prototype.ref=function(){},t.prototype.close=function(){this._clearFn.call(window,this._id)},s.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},s.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},s._unrefActive=s.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0<=t&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},s.setImmediate="function"==typeof n?n:function(e){var t=l++,n=!(arguments.length<2)&&o.call(arguments,1);return i[t]=!0,r(function(){i[t]&&(n?e.apply(null,n):e.call(null),s.clearImmediate(t))}),t},s.clearImmediate="function"==typeof a?a:function(e){delete i[e]}}.call(this)}.call(this,u("timers").setImmediate,u("timers").clearImmediate)},{"process/browser.js":28,timers:29}]},{},[4]);PK     M\pLc Lc %  ecommerce3/assets/js/admin.min.js.mapnu [        {"version":3,"file":"admin.min.js","sources":["ecommerce3/assets/js/admin.js"],"sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){\n'use strict';\n\nmodule.exports = function (i18n) {\n  var confirmationElements = document.querySelectorAll('[data-confirm]');\n\n  for (var i = 0; i < confirmationElements.length; i++) {\n    var element = confirmationElements[i];\n    element.addEventListener(element.tagName === 'FORM' ? 'submit' : 'click', function (e) {\n      var sure = confirm(e.target.getAttribute('data-confirm') || i18n.confirmation);\n\n      if (!sure) {\n        e.preventDefault();\n        return false;\n      }\n\n      return true;\n    });\n  }\n};\n\n},{}],2:[function(require,module,exports){\n'use strict';\n\nvar m = require('mithril');\n\nvar qp = {};\nvar i18n = mc4wp_ecommerce.i18n;\nvar state = {\n  working: false,\n  done: false,\n  action: \"process\"\n};\n\nfunction chooseProcess(e) {\n  state.action = e.target.value;\n}\n\nfunction chooseReset(e) {\n  if (confirm(i18n.confirmation)) {\n    state.action = e.target.value;\n  } else {\n    e.preventDefault();\n  }\n}\n\nfunction process(e) {\n  e && e.preventDefault();\n  state.working = true;\n  state.done = false;\n  m.request({\n    method: \"POST\",\n    url: ajaxurl + \"?action=\" + \"mc4wp_ecommerce_\" + state.action + \"_queue\"\n  }).then(function (result) {\n    state.done = true;\n    state.working = false; // update element stating number of pending background jobs\n\n    document.getElementById('mc4wp-pending-background-jobs-count').innerText = \"0\";\n  })[\"catch\"](function (e) {\n    console.log(e);\n  });\n}\n\nqp.view = function () {\n  return m('form', {\n    method: \"POST\",\n    onsubmit: process\n  }, [m('p', [m('button', {\n    type: \"submit\",\n    className: \"button button-primary\",\n    value: 'process',\n    disabled: state.working || state.done,\n    onclick: chooseProcess\n  }, state.done && state.action === 'process' ? i18n.done : i18n.process), m.trust('&nbsp; or &nbsp;'), m('button', {\n    type: \"submit\",\n    className: \"button button-link-delete\",\n    value: 'reset',\n    disabled: state.working || state.done,\n    onclick: chooseReset\n  }, state.done && state.action === 'reset' ? i18n.done : i18n.reset)]), state.working ? m('p.description', [' ', m('span.mc4wp-loader'), ' ', m('span', i18n.processing)]) : '']);\n};\n\nmodule.exports = qp;\n\n},{\"mithril\":8}],3:[function(require,module,exports){\n\"use strict\";\n\nvar i18n = mc4wp_ecommerce.i18n;\n\nvar m = require('mithril');\n\nfunction a(mount, type, ids) {\n  var running = false;\n  var current = 0;\n  var progress = 0.00;\n  var done = ids.length === 0;\n  var log = [];\n  var statusLabel = mount.parentElement.querySelector('.mc4wp-status-label');\n\n  var tick = function tick() {\n    m.request({\n      method: 'POST',\n      url: window.ajaxurl + \"?action=mc4wp_ecommerce_sync_\".concat(type),\n      body: ids.slice(current, current + 10)\n    }).then(function (results) {\n      current += results.length;\n      progress = current / ids.length; // add results to log\n\n      log.push({\n        date: new Date(),\n        messages: results\n      }); // keep going or finish\n\n      if (current < ids.length) {\n        tick();\n      } else {\n        running = false;\n        done = true;\n      }\n    });\n  };\n\n  var toggle = function toggle() {\n    statusLabel.parentNode.removeChild(statusLabel);\n    running = !running;\n\n    if (!running) {\n      return;\n    }\n\n    tick();\n  };\n\n  var scrollToBottom = function scrollToBottom(vnode) {\n    vnode.dom.scrollTop = vnode.dom.scrollHeight;\n  };\n\n  return {\n    view: function view() {\n      return m('div', [m('p', [m('button.button', {\n        onclick: toggle,\n        disabled: done\n      }, done ? 'All done!' : running ? 'Stop' : 'Start'), \" \", running ? m('span.description', (progress * 100).toFixed(2) + '% — Please wait... This can take a while if you have many ' + type + '.') : '']), m('div.mc4wp-margin-m', {\n        style: log.length > 0 ? 'display: block;' : 'display: none;'\n      }, [m('div.results', {\n        style: 'max-height: 240px; overflow-y: scroll;',\n        oncreate: scrollToBottom,\n        onupdate: scrollToBottom\n      }, log.map(function (l) {\n        return m('div.mc4wp-margin-s', [m('div', [m('strong', l.date.toLocaleString())]), l.messages.map(function (msg) {\n          return m('div', msg);\n        })]);\n      })), m('p', [m('a', {\n        href: '',\n        onclick: function onclick(evt) {\n          evt.preventDefault();\n          log = [];\n        }\n      }, 'Clear results')])])]);\n    }\n  };\n}\n\n[].forEach.call(document.querySelectorAll('[data-wizard]'), function (mount) {\n  var type = mount.getAttribute('data-wizard'),\n      objectIds = JSON.parse(mount.getAttribute('data-object-ids'));\n  m.mount(mount, a(mount, type, objectIds));\n});\n\n},{\"mithril\":8}],4:[function(require,module,exports){\n\"use strict\";\n\nvar m = require('mithril');\n\nvar QueueProcessor = require('./_queue-processor.js'); // ask for confirmation for elements with [data-confirm] attribute\n\n\nrequire('./_confirm-attr.js')(); // initial sync wizards for orders and products\n\n\nrequire('./_wizard.js'); // queue processor\n\n\nvar queueRootElement = document.getElementById('queue-processor');\n\nif (queueRootElement) {\n  m.mount(queueRootElement, QueueProcessor);\n}\n\n},{\"./_confirm-attr.js\":1,\"./_queue-processor.js\":2,\"./_wizard.js\":3,\"mithril\":8}],5:[function(require,module,exports){\n\"use strict\";\n\nvar Vnode = require(\"../render/vnode\");\n\nmodule.exports = function (render, schedule, console) {\n  var subscriptions = [];\n  var rendering = false;\n  var pending = false;\n\n  function sync() {\n    if (rendering) throw new Error(\"Nested m.redraw.sync() call\");\n    rendering = true;\n\n    for (var i = 0; i < subscriptions.length; i += 2) {\n      try {\n        render(subscriptions[i], Vnode(subscriptions[i + 1]), redraw);\n      } catch (e) {\n        console.error(e);\n      }\n    }\n\n    rendering = false;\n  }\n\n  function redraw() {\n    if (!pending) {\n      pending = true;\n      schedule(function () {\n        pending = false;\n        sync();\n      });\n    }\n  }\n\n  redraw.sync = sync;\n\n  function mount(root, component) {\n    if (component != null && component.view == null && typeof component !== \"function\") {\n      throw new TypeError(\"m.mount(element, component) expects a component, not a vnode\");\n    }\n\n    var index = subscriptions.indexOf(root);\n\n    if (index >= 0) {\n      subscriptions.splice(index, 2);\n      render(root, [], redraw);\n    }\n\n    if (component != null) {\n      subscriptions.push(root, component);\n      render(root, Vnode(component), redraw);\n    }\n  }\n\n  return {\n    mount: mount,\n    redraw: redraw\n  };\n};\n\n},{\"../render/vnode\":24}],6:[function(require,module,exports){\n(function (setImmediate){(function (){\n\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar Vnode = require(\"../render/vnode\");\n\nvar m = require(\"../render/hyperscript\");\n\nvar Promise = require(\"../promise/promise\");\n\nvar buildPathname = require(\"../pathname/build\");\n\nvar parsePathname = require(\"../pathname/parse\");\n\nvar compileTemplate = require(\"../pathname/compileTemplate\");\n\nvar assign = require(\"../pathname/assign\");\n\nvar sentinel = {};\n\nmodule.exports = function ($window, mountRedraw) {\n  var fireAsync;\n\n  function setPath(path, data, options) {\n    path = buildPathname(path, data);\n\n    if (fireAsync != null) {\n      fireAsync();\n      var state = options ? options.state : null;\n      var title = options ? options.title : null;\n      if (options && options.replace) $window.history.replaceState(state, title, route.prefix + path);else $window.history.pushState(state, title, route.prefix + path);\n    } else {\n      $window.location.href = route.prefix + path;\n    }\n  }\n\n  var currentResolver = sentinel,\n      component,\n      attrs,\n      currentPath,\n      _lastUpdate;\n\n  var SKIP = route.SKIP = {};\n\n  function route(root, defaultRoute, routes) {\n    if (root == null) throw new Error(\"Ensure the DOM element that was passed to `m.route` is not undefined\"); // 0 = start\n    // 1 = init\n    // 2 = ready\n\n    var state = 0;\n    var compiled = Object.keys(routes).map(function (route) {\n      if (route[0] !== \"/\") throw new SyntaxError(\"Routes must start with a `/`\");\n\n      if (/:([^\\/\\.-]+)(\\.{3})?:/.test(route)) {\n        throw new SyntaxError(\"Route parameter names must be separated with either `/`, `.`, or `-`\");\n      }\n\n      return {\n        route: route,\n        component: routes[route],\n        check: compileTemplate(route)\n      };\n    });\n    var callAsync = typeof setImmediate === \"function\" ? setImmediate : setTimeout;\n    var p = Promise.resolve();\n    var scheduled = false;\n    var onremove;\n    fireAsync = null;\n\n    if (defaultRoute != null) {\n      var defaultData = parsePathname(defaultRoute);\n\n      if (!compiled.some(function (i) {\n        return i.check(defaultData);\n      })) {\n        throw new ReferenceError(\"Default route doesn't match any known routes\");\n      }\n    }\n\n    function resolveRoute() {\n      scheduled = false; // Consider the pathname holistically. The prefix might even be invalid,\n      // but that's not our problem.\n\n      var prefix = $window.location.hash;\n\n      if (route.prefix[0] !== \"#\") {\n        prefix = $window.location.search + prefix;\n\n        if (route.prefix[0] !== \"?\") {\n          prefix = $window.location.pathname + prefix;\n          if (prefix[0] !== \"/\") prefix = \"/\" + prefix;\n        }\n      } // This seemingly useless `.concat()` speeds up the tests quite a bit,\n      // since the representation is consistently a relatively poorly\n      // optimized cons string.\n\n\n      var path = prefix.concat().replace(/(?:%[a-f89][a-f0-9])+/gim, decodeURIComponent).slice(route.prefix.length);\n      var data = parsePathname(path);\n      assign(data.params, $window.history.state);\n\n      function fail() {\n        if (path === defaultRoute) throw new Error(\"Could not resolve default route \" + defaultRoute);\n        setPath(defaultRoute, null, {\n          replace: true\n        });\n      }\n\n      loop(0);\n\n      function loop(i) {\n        // 0 = init\n        // 1 = scheduled\n        // 2 = done\n        for (; i < compiled.length; i++) {\n          if (compiled[i].check(data)) {\n            var payload = compiled[i].component;\n            var matchedRoute = compiled[i].route;\n            var localComp = payload;\n\n            var update = _lastUpdate = function lastUpdate(comp) {\n              if (update !== _lastUpdate) return;\n              if (comp === SKIP) return loop(i + 1);\n              component = comp != null && (typeof comp.view === \"function\" || typeof comp === \"function\") ? comp : \"div\";\n              attrs = data.params, currentPath = path, _lastUpdate = null;\n              currentResolver = payload.render ? payload : null;\n              if (state === 2) mountRedraw.redraw();else {\n                state = 2;\n                mountRedraw.redraw.sync();\n              }\n            }; // There's no understating how much I *wish* I could\n            // use `async`/`await` here...\n\n\n            if (payload.view || typeof payload === \"function\") {\n              payload = {};\n              update(localComp);\n            } else if (payload.onmatch) {\n              p.then(function () {\n                return payload.onmatch(data.params, path, matchedRoute);\n              }).then(update, fail);\n            } else update(\"div\");\n\n            return;\n          }\n        }\n\n        fail();\n      }\n    } // Set it unconditionally so `m.route.set` and `m.route.Link` both work,\n    // even if neither `pushState` nor `hashchange` are supported. It's\n    // cleared if `hashchange` is used, since that makes it automatically\n    // async.\n\n\n    fireAsync = function fireAsync() {\n      if (!scheduled) {\n        scheduled = true;\n        callAsync(resolveRoute);\n      }\n    };\n\n    if (typeof $window.history.pushState === \"function\") {\n      onremove = function onremove() {\n        $window.removeEventListener(\"popstate\", fireAsync, false);\n      };\n\n      $window.addEventListener(\"popstate\", fireAsync, false);\n    } else if (route.prefix[0] === \"#\") {\n      fireAsync = null;\n\n      onremove = function onremove() {\n        $window.removeEventListener(\"hashchange\", resolveRoute, false);\n      };\n\n      $window.addEventListener(\"hashchange\", resolveRoute, false);\n    }\n\n    return mountRedraw.mount(root, {\n      onbeforeupdate: function onbeforeupdate() {\n        state = state ? 2 : 1;\n        return !(!state || sentinel === currentResolver);\n      },\n      oncreate: resolveRoute,\n      onremove: onremove,\n      view: function view() {\n        if (!state || sentinel === currentResolver) return; // Wrap in a fragment to preserve existing key semantics\n\n        var vnode = [Vnode(component, attrs.key, attrs)];\n        if (currentResolver) vnode = currentResolver.render(vnode[0]);\n        return vnode;\n      }\n    });\n  }\n\n  route.set = function (path, data, options) {\n    if (_lastUpdate != null) {\n      options = options || {};\n      options.replace = true;\n    }\n\n    _lastUpdate = null;\n    setPath(path, data, options);\n  };\n\n  route.get = function () {\n    return currentPath;\n  };\n\n  route.prefix = \"#!\";\n  route.Link = {\n    view: function view(vnode) {\n      var options = vnode.attrs.options; // Remove these so they don't get overwritten\n\n      var attrs = {},\n          onclick,\n          href;\n      assign(attrs, vnode.attrs); // The first two are internal, but the rest are magic attributes\n      // that need censored to not screw up rendering.\n\n      attrs.selector = attrs.options = attrs.key = attrs.oninit = attrs.oncreate = attrs.onbeforeupdate = attrs.onupdate = attrs.onbeforeremove = attrs.onremove = null; // Do this now so we can get the most current `href` and `disabled`.\n      // Those attributes may also be specified in the selector, and we\n      // should honor that.\n\n      var child = m(vnode.attrs.selector || \"a\", attrs, vnode.children); // Let's provide a *right* way to disable a route link, rather than\n      // letting people screw up accessibility on accident.\n      //\n      // The attribute is coerced so users don't get surprised over\n      // `disabled: 0` resulting in a button that's somehow routable\n      // despite being visibly disabled.\n\n      if (child.attrs.disabled = Boolean(child.attrs.disabled)) {\n        child.attrs.href = null;\n        child.attrs[\"aria-disabled\"] = \"true\"; // If you *really* do want to do this on a disabled link, use\n        // an `oncreate` hook to add it.\n\n        child.attrs.onclick = null;\n      } else {\n        onclick = child.attrs.onclick;\n        href = child.attrs.href;\n        child.attrs.href = route.prefix + href;\n\n        child.attrs.onclick = function (e) {\n          var result;\n\n          if (typeof onclick === \"function\") {\n            result = onclick.call(e.currentTarget, e);\n          } else if (onclick == null || _typeof(onclick) !== \"object\") {// do nothing\n          } else if (typeof onclick.handleEvent === \"function\") {\n            onclick.handleEvent(e);\n          } // Adapted from React Router's implementation:\n          // https://github.com/ReactTraining/react-router/blob/520a0acd48ae1b066eb0b07d6d4d1790a1d02482/packages/react-router-dom/modules/Link.js\n          //\n          // Try to be flexible and intuitive in how we handle links.\n          // Fun fact: links aren't as obvious to get right as you\n          // would expect. There's a lot more valid ways to click a\n          // link than this, and one might want to not simply click a\n          // link, but right click or command-click it to copy the\n          // link target, etc. Nope, this isn't just for blind people.\n\n\n          if ( // Skip if `onclick` prevented default\n          result !== false && !e.defaultPrevented && ( // Ignore everything but left clicks\n          e.button === 0 || e.which === 0 || e.which === 1) && ( // Let the browser handle `target=_blank`, etc.\n          !e.currentTarget.target || e.currentTarget.target === \"_self\") && // No modifier keys\n          !e.ctrlKey && !e.metaKey && !e.shiftKey && !e.altKey) {\n            e.preventDefault();\n            e.redraw = false;\n            route.set(href, null, options);\n          }\n        };\n      }\n\n      return child;\n    }\n  };\n\n  route.param = function (key) {\n    return attrs && key != null ? attrs[key] : attrs;\n  };\n\n  return route;\n};\n\n}).call(this)}).call(this,require(\"timers\").setImmediate)\n},{\"../pathname/assign\":10,\"../pathname/build\":11,\"../pathname/compileTemplate\":12,\"../pathname/parse\":13,\"../promise/promise\":15,\"../render/hyperscript\":20,\"../render/vnode\":24,\"timers\":29}],7:[function(require,module,exports){\n\"use strict\";\n\nvar hyperscript = require(\"./render/hyperscript\");\n\nhyperscript.trust = require(\"./render/trust\");\nhyperscript.fragment = require(\"./render/fragment\");\nmodule.exports = hyperscript;\n\n},{\"./render/fragment\":19,\"./render/hyperscript\":20,\"./render/trust\":23}],8:[function(require,module,exports){\n\"use strict\";\n\nvar hyperscript = require(\"./hyperscript\");\n\nvar request = require(\"./request\");\n\nvar mountRedraw = require(\"./mount-redraw\");\n\nvar m = function m() {\n  return hyperscript.apply(this, arguments);\n};\n\nm.m = hyperscript;\nm.trust = hyperscript.trust;\nm.fragment = hyperscript.fragment;\nm.mount = mountRedraw.mount;\nm.route = require(\"./route\");\nm.render = require(\"./render\");\nm.redraw = mountRedraw.redraw;\nm.request = request.request;\nm.jsonp = request.jsonp;\nm.parseQueryString = require(\"./querystring/parse\");\nm.buildQueryString = require(\"./querystring/build\");\nm.parsePathname = require(\"./pathname/parse\");\nm.buildPathname = require(\"./pathname/build\");\nm.vnode = require(\"./render/vnode\");\nm.PromisePolyfill = require(\"./promise/polyfill\");\nmodule.exports = m;\n\n},{\"./hyperscript\":7,\"./mount-redraw\":9,\"./pathname/build\":11,\"./pathname/parse\":13,\"./promise/polyfill\":14,\"./querystring/build\":16,\"./querystring/parse\":17,\"./render\":18,\"./render/vnode\":24,\"./request\":25,\"./route\":27}],9:[function(require,module,exports){\n\"use strict\";\n\nvar render = require(\"./render\");\n\nmodule.exports = require(\"./api/mount-redraw\")(render, requestAnimationFrame, console);\n\n},{\"./api/mount-redraw\":5,\"./render\":18}],10:[function(require,module,exports){\n\"use strict\";\n\nmodule.exports = Object.assign || function (target, source) {\n  if (source) Object.keys(source).forEach(function (key) {\n    target[key] = source[key];\n  });\n};\n\n},{}],11:[function(require,module,exports){\n\"use strict\";\n\nvar buildQueryString = require(\"../querystring/build\");\n\nvar assign = require(\"./assign\"); // Returns `path` from `template` + `params`\n\n\nmodule.exports = function (template, params) {\n  if (/:([^\\/\\.-]+)(\\.{3})?:/.test(template)) {\n    throw new SyntaxError(\"Template parameter names *must* be separated\");\n  }\n\n  if (params == null) return template;\n  var queryIndex = template.indexOf(\"?\");\n  var hashIndex = template.indexOf(\"#\");\n  var queryEnd = hashIndex < 0 ? template.length : hashIndex;\n  var pathEnd = queryIndex < 0 ? queryEnd : queryIndex;\n  var path = template.slice(0, pathEnd);\n  var query = {};\n  assign(query, params);\n  var resolved = path.replace(/:([^\\/\\.-]+)(\\.{3})?/g, function (m, key, variadic) {\n    delete query[key]; // If no such parameter exists, don't interpolate it.\n\n    if (params[key] == null) return m; // Escape normal parameters, but not variadic ones.\n\n    return variadic ? params[key] : encodeURIComponent(String(params[key]));\n  }); // In case the template substitution adds new query/hash parameters.\n\n  var newQueryIndex = resolved.indexOf(\"?\");\n  var newHashIndex = resolved.indexOf(\"#\");\n  var newQueryEnd = newHashIndex < 0 ? resolved.length : newHashIndex;\n  var newPathEnd = newQueryIndex < 0 ? newQueryEnd : newQueryIndex;\n  var result = resolved.slice(0, newPathEnd);\n  if (queryIndex >= 0) result += template.slice(queryIndex, queryEnd);\n  if (newQueryIndex >= 0) result += (queryIndex < 0 ? \"?\" : \"&\") + resolved.slice(newQueryIndex, newQueryEnd);\n  var querystring = buildQueryString(query);\n  if (querystring) result += (queryIndex < 0 && newQueryIndex < 0 ? \"?\" : \"&\") + querystring;\n  if (hashIndex >= 0) result += template.slice(hashIndex);\n  if (newHashIndex >= 0) result += (hashIndex < 0 ? \"\" : \"&\") + resolved.slice(newHashIndex);\n  return result;\n};\n\n},{\"../querystring/build\":16,\"./assign\":10}],12:[function(require,module,exports){\n\"use strict\";\n\nvar parsePathname = require(\"./parse\"); // Compiles a template into a function that takes a resolved path (without query\n// strings) and returns an object containing the template parameters with their\n// parsed values. This expects the input of the compiled template to be the\n// output of `parsePathname`. Note that it does *not* remove query parameters\n// specified in the template.\n\n\nmodule.exports = function (template) {\n  var templateData = parsePathname(template);\n  var templateKeys = Object.keys(templateData.params);\n  var keys = [];\n  var regexp = new RegExp(\"^\" + templateData.path.replace( // I escape literal text so people can use things like `:file.:ext` or\n  // `:lang-:locale` in routes. This is all merged into one pass so I\n  // don't also accidentally escape `-` and make it harder to detect it to\n  // ban it from template parameters.\n  /:([^\\/.-]+)(\\.{3}|\\.(?!\\.)|-)?|[\\\\^$*+.()|\\[\\]{}]/g, function (m, key, extra) {\n    if (key == null) return \"\\\\\" + m;\n    keys.push({\n      k: key,\n      r: extra === \"...\"\n    });\n    if (extra === \"...\") return \"(.*)\";\n    if (extra === \".\") return \"([^/]+)\\\\.\";\n    return \"([^/]+)\" + (extra || \"\");\n  }) + \"$\");\n  return function (data) {\n    // First, check the params. Usually, there isn't any, and it's just\n    // checking a static set.\n    for (var i = 0; i < templateKeys.length; i++) {\n      if (templateData.params[templateKeys[i]] !== data.params[templateKeys[i]]) return false;\n    } // If no interpolations exist, let's skip all the ceremony\n\n\n    if (!keys.length) return regexp.test(data.path);\n    var values = regexp.exec(data.path);\n    if (values == null) return false;\n\n    for (var i = 0; i < keys.length; i++) {\n      data.params[keys[i].k] = keys[i].r ? values[i + 1] : decodeURIComponent(values[i + 1]);\n    }\n\n    return true;\n  };\n};\n\n},{\"./parse\":13}],13:[function(require,module,exports){\n\"use strict\";\n\nvar parseQueryString = require(\"../querystring/parse\"); // Returns `{path, params}` from `url`\n\n\nmodule.exports = function (url) {\n  var queryIndex = url.indexOf(\"?\");\n  var hashIndex = url.indexOf(\"#\");\n  var queryEnd = hashIndex < 0 ? url.length : hashIndex;\n  var pathEnd = queryIndex < 0 ? queryEnd : queryIndex;\n  var path = url.slice(0, pathEnd).replace(/\\/{2,}/g, \"/\");\n  if (!path) path = \"/\";else {\n    if (path[0] !== \"/\") path = \"/\" + path;\n    if (path.length > 1 && path[path.length - 1] === \"/\") path = path.slice(0, -1);\n  }\n  return {\n    path: path,\n    params: queryIndex < 0 ? {} : parseQueryString(url.slice(queryIndex + 1, queryEnd))\n  };\n};\n\n},{\"../querystring/parse\":17}],14:[function(require,module,exports){\n(function (setImmediate){(function (){\n\"use strict\";\n/** @constructor */\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar PromisePolyfill = function PromisePolyfill(executor) {\n  if (!(this instanceof PromisePolyfill)) throw new Error(\"Promise must be called with `new`\");\n  if (typeof executor !== \"function\") throw new TypeError(\"executor must be a function\");\n  var self = this,\n      resolvers = [],\n      rejectors = [],\n      resolveCurrent = handler(resolvers, true),\n      rejectCurrent = handler(rejectors, false);\n  var instance = self._instance = {\n    resolvers: resolvers,\n    rejectors: rejectors\n  };\n  var callAsync = typeof setImmediate === \"function\" ? setImmediate : setTimeout;\n\n  function handler(list, shouldAbsorb) {\n    return function execute(value) {\n      var then;\n\n      try {\n        if (shouldAbsorb && value != null && (_typeof(value) === \"object\" || typeof value === \"function\") && typeof (then = value.then) === \"function\") {\n          if (value === self) throw new TypeError(\"Promise can't be resolved w/ itself\");\n          executeOnce(then.bind(value));\n        } else {\n          callAsync(function () {\n            if (!shouldAbsorb && list.length === 0) console.error(\"Possible unhandled promise rejection:\", value);\n\n            for (var i = 0; i < list.length; i++) {\n              list[i](value);\n            }\n\n            resolvers.length = 0, rejectors.length = 0;\n            instance.state = shouldAbsorb;\n\n            instance.retry = function () {\n              execute(value);\n            };\n          });\n        }\n      } catch (e) {\n        rejectCurrent(e);\n      }\n    };\n  }\n\n  function executeOnce(then) {\n    var runs = 0;\n\n    function run(fn) {\n      return function (value) {\n        if (runs++ > 0) return;\n        fn(value);\n      };\n    }\n\n    var onerror = run(rejectCurrent);\n\n    try {\n      then(run(resolveCurrent), onerror);\n    } catch (e) {\n      onerror(e);\n    }\n  }\n\n  executeOnce(executor);\n};\n\nPromisePolyfill.prototype.then = function (onFulfilled, onRejection) {\n  var self = this,\n      instance = self._instance;\n\n  function handle(callback, list, next, state) {\n    list.push(function (value) {\n      if (typeof callback !== \"function\") next(value);else try {\n        resolveNext(callback(value));\n      } catch (e) {\n        if (rejectNext) rejectNext(e);\n      }\n    });\n    if (typeof instance.retry === \"function\" && state === instance.state) instance.retry();\n  }\n\n  var resolveNext, rejectNext;\n  var promise = new PromisePolyfill(function (resolve, reject) {\n    resolveNext = resolve, rejectNext = reject;\n  });\n  handle(onFulfilled, instance.resolvers, resolveNext, true), handle(onRejection, instance.rejectors, rejectNext, false);\n  return promise;\n};\n\nPromisePolyfill.prototype[\"catch\"] = function (onRejection) {\n  return this.then(null, onRejection);\n};\n\nPromisePolyfill.prototype[\"finally\"] = function (callback) {\n  return this.then(function (value) {\n    return PromisePolyfill.resolve(callback()).then(function () {\n      return value;\n    });\n  }, function (reason) {\n    return PromisePolyfill.resolve(callback()).then(function () {\n      return PromisePolyfill.reject(reason);\n    });\n  });\n};\n\nPromisePolyfill.resolve = function (value) {\n  if (value instanceof PromisePolyfill) return value;\n  return new PromisePolyfill(function (resolve) {\n    resolve(value);\n  });\n};\n\nPromisePolyfill.reject = function (value) {\n  return new PromisePolyfill(function (resolve, reject) {\n    reject(value);\n  });\n};\n\nPromisePolyfill.all = function (list) {\n  return new PromisePolyfill(function (resolve, reject) {\n    var total = list.length,\n        count = 0,\n        values = [];\n    if (list.length === 0) resolve([]);else for (var i = 0; i < list.length; i++) {\n      (function (i) {\n        function consume(value) {\n          count++;\n          values[i] = value;\n          if (count === total) resolve(values);\n        }\n\n        if (list[i] != null && (_typeof(list[i]) === \"object\" || typeof list[i] === \"function\") && typeof list[i].then === \"function\") {\n          list[i].then(consume, reject);\n        } else consume(list[i]);\n      })(i);\n    }\n  });\n};\n\nPromisePolyfill.race = function (list) {\n  return new PromisePolyfill(function (resolve, reject) {\n    for (var i = 0; i < list.length; i++) {\n      list[i].then(resolve, reject);\n    }\n  });\n};\n\nmodule.exports = PromisePolyfill;\n\n}).call(this)}).call(this,require(\"timers\").setImmediate)\n},{\"timers\":29}],15:[function(require,module,exports){\n(function (global){(function (){\n\"use strict\";\n\nvar PromisePolyfill = require(\"./polyfill\");\n\nif (typeof window !== \"undefined\") {\n  if (typeof window.Promise === \"undefined\") {\n    window.Promise = PromisePolyfill;\n  } else if (!window.Promise.prototype[\"finally\"]) {\n    window.Promise.prototype[\"finally\"] = PromisePolyfill.prototype[\"finally\"];\n  }\n\n  module.exports = window.Promise;\n} else if (typeof global !== \"undefined\") {\n  if (typeof global.Promise === \"undefined\") {\n    global.Promise = PromisePolyfill;\n  } else if (!global.Promise.prototype[\"finally\"]) {\n    global.Promise.prototype[\"finally\"] = PromisePolyfill.prototype[\"finally\"];\n  }\n\n  module.exports = global.Promise;\n} else {\n  module.exports = PromisePolyfill;\n}\n\n}).call(this)}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{\"./polyfill\":14}],16:[function(require,module,exports){\n\"use strict\";\n\nmodule.exports = function (object) {\n  if (Object.prototype.toString.call(object) !== \"[object Object]\") return \"\";\n  var args = [];\n\n  for (var key in object) {\n    destructure(key, object[key]);\n  }\n\n  return args.join(\"&\");\n\n  function destructure(key, value) {\n    if (Array.isArray(value)) {\n      for (var i = 0; i < value.length; i++) {\n        destructure(key + \"[\" + i + \"]\", value[i]);\n      }\n    } else if (Object.prototype.toString.call(value) === \"[object Object]\") {\n      for (var i in value) {\n        destructure(key + \"[\" + i + \"]\", value[i]);\n      }\n    } else args.push(encodeURIComponent(key) + (value != null && value !== \"\" ? \"=\" + encodeURIComponent(value) : \"\"));\n  }\n};\n\n},{}],17:[function(require,module,exports){\n\"use strict\";\n\nmodule.exports = function (string) {\n  if (string === \"\" || string == null) return {};\n  if (string.charAt(0) === \"?\") string = string.slice(1);\n  var entries = string.split(\"&\"),\n      counters = {},\n      data = {};\n\n  for (var i = 0; i < entries.length; i++) {\n    var entry = entries[i].split(\"=\");\n    var key = decodeURIComponent(entry[0]);\n    var value = entry.length === 2 ? decodeURIComponent(entry[1]) : \"\";\n    if (value === \"true\") value = true;else if (value === \"false\") value = false;\n    var levels = key.split(/\\]\\[?|\\[/);\n    var cursor = data;\n    if (key.indexOf(\"[\") > -1) levels.pop();\n\n    for (var j = 0; j < levels.length; j++) {\n      var level = levels[j],\n          nextLevel = levels[j + 1];\n      var isNumber = nextLevel == \"\" || !isNaN(parseInt(nextLevel, 10));\n\n      if (level === \"\") {\n        var key = levels.slice(0, j).join();\n\n        if (counters[key] == null) {\n          counters[key] = Array.isArray(cursor) ? cursor.length : 0;\n        }\n\n        level = counters[key]++;\n      } // Disallow direct prototype pollution\n      else if (level === \"__proto__\") break;\n\n      if (j === levels.length - 1) cursor[level] = value;else {\n        // Read own properties exclusively to disallow indirect\n        // prototype pollution\n        var desc = Object.getOwnPropertyDescriptor(cursor, level);\n        if (desc != null) desc = desc.value;\n        if (desc == null) cursor[level] = desc = isNumber ? [] : {};\n        cursor = desc;\n      }\n    }\n  }\n\n  return data;\n};\n\n},{}],18:[function(require,module,exports){\n\"use strict\";\n\nmodule.exports = require(\"./render/render\")(window);\n\n},{\"./render/render\":22}],19:[function(require,module,exports){\n\"use strict\";\n\nvar Vnode = require(\"../render/vnode\");\n\nvar hyperscriptVnode = require(\"./hyperscriptVnode\");\n\nmodule.exports = function () {\n  var vnode = hyperscriptVnode.apply(0, arguments);\n  vnode.tag = \"[\";\n  vnode.children = Vnode.normalizeChildren(vnode.children);\n  return vnode;\n};\n\n},{\"../render/vnode\":24,\"./hyperscriptVnode\":21}],20:[function(require,module,exports){\n\"use strict\";\n\nvar Vnode = require(\"../render/vnode\");\n\nvar hyperscriptVnode = require(\"./hyperscriptVnode\");\n\nvar selectorParser = /(?:(^|#|\\.)([^#\\.\\[\\]]+))|(\\[(.+?)(?:\\s*=\\s*(\"|'|)((?:\\\\[\"'\\]]|.)*?)\\5)?\\])/g;\nvar selectorCache = {};\nvar hasOwn = {}.hasOwnProperty;\n\nfunction isEmpty(object) {\n  for (var key in object) {\n    if (hasOwn.call(object, key)) return false;\n  }\n\n  return true;\n}\n\nfunction compileSelector(selector) {\n  var match,\n      tag = \"div\",\n      classes = [],\n      attrs = {};\n\n  while (match = selectorParser.exec(selector)) {\n    var type = match[1],\n        value = match[2];\n    if (type === \"\" && value !== \"\") tag = value;else if (type === \"#\") attrs.id = value;else if (type === \".\") classes.push(value);else if (match[3][0] === \"[\") {\n      var attrValue = match[6];\n      if (attrValue) attrValue = attrValue.replace(/\\\\([\"'])/g, \"$1\").replace(/\\\\\\\\/g, \"\\\\\");\n      if (match[4] === \"class\") classes.push(attrValue);else attrs[match[4]] = attrValue === \"\" ? attrValue : attrValue || true;\n    }\n  }\n\n  if (classes.length > 0) attrs.className = classes.join(\" \");\n  return selectorCache[selector] = {\n    tag: tag,\n    attrs: attrs\n  };\n}\n\nfunction execSelector(state, vnode) {\n  var attrs = vnode.attrs;\n  var children = Vnode.normalizeChildren(vnode.children);\n  var hasClass = hasOwn.call(attrs, \"class\");\n  var className = hasClass ? attrs[\"class\"] : attrs.className;\n  vnode.tag = state.tag;\n  vnode.attrs = null;\n  vnode.children = undefined;\n\n  if (!isEmpty(state.attrs) && !isEmpty(attrs)) {\n    var newAttrs = {};\n\n    for (var key in attrs) {\n      if (hasOwn.call(attrs, key)) newAttrs[key] = attrs[key];\n    }\n\n    attrs = newAttrs;\n  }\n\n  for (var key in state.attrs) {\n    if (hasOwn.call(state.attrs, key) && key !== \"className\" && !hasOwn.call(attrs, key)) {\n      attrs[key] = state.attrs[key];\n    }\n  }\n\n  if (className != null || state.attrs.className != null) attrs.className = className != null ? state.attrs.className != null ? String(state.attrs.className) + \" \" + String(className) : className : state.attrs.className != null ? state.attrs.className : null;\n  if (hasClass) attrs[\"class\"] = null;\n\n  for (var key in attrs) {\n    if (hasOwn.call(attrs, key) && key !== \"key\") {\n      vnode.attrs = attrs;\n      break;\n    }\n  }\n\n  if (Array.isArray(children) && children.length === 1 && children[0] != null && children[0].tag === \"#\") {\n    vnode.text = children[0].children;\n  } else {\n    vnode.children = children;\n  }\n\n  return vnode;\n}\n\nfunction hyperscript(selector) {\n  if (selector == null || typeof selector !== \"string\" && typeof selector !== \"function\" && typeof selector.view !== \"function\") {\n    throw Error(\"The selector must be either a string or a component.\");\n  }\n\n  var vnode = hyperscriptVnode.apply(1, arguments);\n\n  if (typeof selector === \"string\") {\n    vnode.children = Vnode.normalizeChildren(vnode.children);\n    if (selector !== \"[\") return execSelector(selectorCache[selector] || compileSelector(selector), vnode);\n  }\n\n  vnode.tag = selector;\n  return vnode;\n}\n\nmodule.exports = hyperscript;\n\n},{\"../render/vnode\":24,\"./hyperscriptVnode\":21}],21:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar Vnode = require(\"../render/vnode\"); // Call via `hyperscriptVnode.apply(startOffset, arguments)`\n//\n// The reason I do it this way, forwarding the arguments and passing the start\n// offset in `this`, is so I don't have to create a temporary array in a\n// performance-critical path.\n//\n// In native ES6, I'd instead add a final `...args` parameter to the\n// `hyperscript` and `fragment` factories and define this as\n// `hyperscriptVnode(...args)`, since modern engines do optimize that away. But\n// ES5 (what Mithril requires thanks to IE support) doesn't give me that luxury,\n// and engines aren't nearly intelligent enough to do either of these:\n//\n// 1. Elide the allocation for `[].slice.call(arguments, 1)` when it's passed to\n//    another function only to be indexed.\n// 2. Elide an `arguments` allocation when it's passed to any function other\n//    than `Function.prototype.apply` or `Reflect.apply`.\n//\n// In ES6, it'd probably look closer to this (I'd need to profile it, though):\n// module.exports = function(attrs, ...children) {\n//     if (attrs == null || typeof attrs === \"object\" && attrs.tag == null && !Array.isArray(attrs)) {\n//         if (children.length === 1 && Array.isArray(children[0])) children = children[0]\n//     } else {\n//         children = children.length === 0 && Array.isArray(attrs) ? attrs : [attrs, ...children]\n//         attrs = undefined\n//     }\n//\n//     if (attrs == null) attrs = {}\n//     return Vnode(\"\", attrs.key, attrs, children)\n// }\n\n\nmodule.exports = function () {\n  var attrs = arguments[this],\n      start = this + 1,\n      children;\n\n  if (attrs == null) {\n    attrs = {};\n  } else if (_typeof(attrs) !== \"object\" || attrs.tag != null || Array.isArray(attrs)) {\n    attrs = {};\n    start = this;\n  }\n\n  if (arguments.length === start + 1) {\n    children = arguments[start];\n    if (!Array.isArray(children)) children = [children];\n  } else {\n    children = [];\n\n    while (start < arguments.length) {\n      children.push(arguments[start++]);\n    }\n  }\n\n  return Vnode(\"\", attrs.key, attrs, children);\n};\n\n},{\"../render/vnode\":24}],22:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar Vnode = require(\"../render/vnode\");\n\nmodule.exports = function ($window) {\n  var $doc = $window && $window.document;\n  var currentRedraw;\n  var nameSpace = {\n    svg: \"http://www.w3.org/2000/svg\",\n    math: \"http://www.w3.org/1998/Math/MathML\"\n  };\n\n  function getNameSpace(vnode) {\n    return vnode.attrs && vnode.attrs.xmlns || nameSpace[vnode.tag];\n  } //sanity check to discourage people from doing `vnode.state = ...`\n\n\n  function checkState(vnode, original) {\n    if (vnode.state !== original) throw new Error(\"`vnode.state` must not be modified\");\n  } //Note: the hook is passed as the `this` argument to allow proxying the\n  //arguments without requiring a full array allocation to do so. It also\n  //takes advantage of the fact the current `vnode` is the first argument in\n  //all lifecycle methods.\n\n\n  function callHook(vnode) {\n    var original = vnode.state;\n\n    try {\n      return this.apply(original, arguments);\n    } finally {\n      checkState(vnode, original);\n    }\n  } // IE11 (at least) throws an UnspecifiedError when accessing document.activeElement when\n  // inside an iframe. Catch and swallow this error, and heavy-handidly return null.\n\n\n  function activeElement() {\n    try {\n      return $doc.activeElement;\n    } catch (e) {\n      return null;\n    }\n  } //create\n\n\n  function createNodes(parent, vnodes, start, end, hooks, nextSibling, ns) {\n    for (var i = start; i < end; i++) {\n      var vnode = vnodes[i];\n\n      if (vnode != null) {\n        createNode(parent, vnode, hooks, ns, nextSibling);\n      }\n    }\n  }\n\n  function createNode(parent, vnode, hooks, ns, nextSibling) {\n    var tag = vnode.tag;\n\n    if (typeof tag === \"string\") {\n      vnode.state = {};\n      if (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks);\n\n      switch (tag) {\n        case \"#\":\n          createText(parent, vnode, nextSibling);\n          break;\n\n        case \"<\":\n          createHTML(parent, vnode, ns, nextSibling);\n          break;\n\n        case \"[\":\n          createFragment(parent, vnode, hooks, ns, nextSibling);\n          break;\n\n        default:\n          createElement(parent, vnode, hooks, ns, nextSibling);\n      }\n    } else createComponent(parent, vnode, hooks, ns, nextSibling);\n  }\n\n  function createText(parent, vnode, nextSibling) {\n    vnode.dom = $doc.createTextNode(vnode.children);\n    insertNode(parent, vnode.dom, nextSibling);\n  }\n\n  var possibleParents = {\n    caption: \"table\",\n    thead: \"table\",\n    tbody: \"table\",\n    tfoot: \"table\",\n    tr: \"tbody\",\n    th: \"tr\",\n    td: \"tr\",\n    colgroup: \"table\",\n    col: \"colgroup\"\n  };\n\n  function createHTML(parent, vnode, ns, nextSibling) {\n    var match = vnode.children.match(/^\\s*?<(\\w+)/im) || []; // not using the proper parent makes the child element(s) vanish.\n    //     var div = document.createElement(\"div\")\n    //     div.innerHTML = \"<td>i</td><td>j</td>\"\n    //     console.log(div.innerHTML)\n    // --> \"ij\", no <td> in sight.\n\n    var temp = $doc.createElement(possibleParents[match[1]] || \"div\");\n\n    if (ns === \"http://www.w3.org/2000/svg\") {\n      temp.innerHTML = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\">\" + vnode.children + \"</svg>\";\n      temp = temp.firstChild;\n    } else {\n      temp.innerHTML = vnode.children;\n    }\n\n    vnode.dom = temp.firstChild;\n    vnode.domSize = temp.childNodes.length; // Capture nodes to remove, so we don't confuse them.\n\n    vnode.instance = [];\n    var fragment = $doc.createDocumentFragment();\n    var child;\n\n    while (child = temp.firstChild) {\n      vnode.instance.push(child);\n      fragment.appendChild(child);\n    }\n\n    insertNode(parent, fragment, nextSibling);\n  }\n\n  function createFragment(parent, vnode, hooks, ns, nextSibling) {\n    var fragment = $doc.createDocumentFragment();\n\n    if (vnode.children != null) {\n      var children = vnode.children;\n      createNodes(fragment, children, 0, children.length, hooks, null, ns);\n    }\n\n    vnode.dom = fragment.firstChild;\n    vnode.domSize = fragment.childNodes.length;\n    insertNode(parent, fragment, nextSibling);\n  }\n\n  function createElement(parent, vnode, hooks, ns, nextSibling) {\n    var tag = vnode.tag;\n    var attrs = vnode.attrs;\n    var is = attrs && attrs.is;\n    ns = getNameSpace(vnode) || ns;\n    var element = ns ? is ? $doc.createElementNS(ns, tag, {\n      is: is\n    }) : $doc.createElementNS(ns, tag) : is ? $doc.createElement(tag, {\n      is: is\n    }) : $doc.createElement(tag);\n    vnode.dom = element;\n\n    if (attrs != null) {\n      setAttrs(vnode, attrs, ns);\n    }\n\n    insertNode(parent, element, nextSibling);\n\n    if (!maybeSetContentEditable(vnode)) {\n      if (vnode.text != null) {\n        if (vnode.text !== \"\") element.textContent = vnode.text;else vnode.children = [Vnode(\"#\", undefined, undefined, vnode.text, undefined, undefined)];\n      }\n\n      if (vnode.children != null) {\n        var children = vnode.children;\n        createNodes(element, children, 0, children.length, hooks, null, ns);\n        if (vnode.tag === \"select\" && attrs != null) setLateSelectAttrs(vnode, attrs);\n      }\n    }\n  }\n\n  function initComponent(vnode, hooks) {\n    var sentinel;\n\n    if (typeof vnode.tag.view === \"function\") {\n      vnode.state = Object.create(vnode.tag);\n      sentinel = vnode.state.view;\n      if (sentinel.$$reentrantLock$$ != null) return;\n      sentinel.$$reentrantLock$$ = true;\n    } else {\n      vnode.state = void 0;\n      sentinel = vnode.tag;\n      if (sentinel.$$reentrantLock$$ != null) return;\n      sentinel.$$reentrantLock$$ = true;\n      vnode.state = vnode.tag.prototype != null && typeof vnode.tag.prototype.view === \"function\" ? new vnode.tag(vnode) : vnode.tag(vnode);\n    }\n\n    initLifecycle(vnode.state, vnode, hooks);\n    if (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks);\n    vnode.instance = Vnode.normalize(callHook.call(vnode.state.view, vnode));\n    if (vnode.instance === vnode) throw Error(\"A view cannot return the vnode it received as argument\");\n    sentinel.$$reentrantLock$$ = null;\n  }\n\n  function createComponent(parent, vnode, hooks, ns, nextSibling) {\n    initComponent(vnode, hooks);\n\n    if (vnode.instance != null) {\n      createNode(parent, vnode.instance, hooks, ns, nextSibling);\n      vnode.dom = vnode.instance.dom;\n      vnode.domSize = vnode.dom != null ? vnode.instance.domSize : 0;\n    } else {\n      vnode.domSize = 0;\n    }\n  } //update\n\n  /**\n   * @param {Element|Fragment} parent - the parent element\n   * @param {Vnode[] | null} old - the list of vnodes of the last `render()` call for\n   *                               this part of the tree\n   * @param {Vnode[] | null} vnodes - as above, but for the current `render()` call.\n   * @param {Function[]} hooks - an accumulator of post-render hooks (oncreate/onupdate)\n   * @param {Element | null} nextSibling - the next DOM node if we're dealing with a\n   *                                       fragment that is not the last item in its\n   *                                       parent\n   * @param {'svg' | 'math' | String | null} ns) - the current XML namespace, if any\n   * @returns void\n   */\n  // This function diffs and patches lists of vnodes, both keyed and unkeyed.\n  //\n  // We will:\n  //\n  // 1. describe its general structure\n  // 2. focus on the diff algorithm optimizations\n  // 3. discuss DOM node operations.\n  // ## Overview:\n  //\n  // The updateNodes() function:\n  // - deals with trivial cases\n  // - determines whether the lists are keyed or unkeyed based on the first non-null node\n  //   of each list.\n  // - diffs them and patches the DOM if needed (that's the brunt of the code)\n  // - manages the leftovers: after diffing, are there:\n  //   - old nodes left to remove?\n  // \t - new nodes to insert?\n  // \t deal with them!\n  //\n  // The lists are only iterated over once, with an exception for the nodes in `old` that\n  // are visited in the fourth part of the diff and in the `removeNodes` loop.\n  // ## Diffing\n  //\n  // Reading https://github.com/localvoid/ivi/blob/ddc09d06abaef45248e6133f7040d00d3c6be853/packages/ivi/src/vdom/implementation.ts#L617-L837\n  // may be good for context on longest increasing subsequence-based logic for moving nodes.\n  //\n  // In order to diff keyed lists, one has to\n  //\n  // 1) match nodes in both lists, per key, and update them accordingly\n  // 2) create the nodes present in the new list, but absent in the old one\n  // 3) remove the nodes present in the old list, but absent in the new one\n  // 4) figure out what nodes in 1) to move in order to minimize the DOM operations.\n  //\n  // To achieve 1) one can create a dictionary of keys => index (for the old list), then iterate\n  // over the new list and for each new vnode, find the corresponding vnode in the old list using\n  // the map.\n  // 2) is achieved in the same step: if a new node has no corresponding entry in the map, it is new\n  // and must be created.\n  // For the removals, we actually remove the nodes that have been updated from the old list.\n  // The nodes that remain in that list after 1) and 2) have been performed can be safely removed.\n  // The fourth step is a bit more complex and relies on the longest increasing subsequence (LIS)\n  // algorithm.\n  //\n  // the longest increasing subsequence is the list of nodes that can remain in place. Imagine going\n  // from `1,2,3,4,5` to `4,5,1,2,3` where the numbers are not necessarily the keys, but the indices\n  // corresponding to the keyed nodes in the old list (keyed nodes `e,d,c,b,a` => `b,a,e,d,c` would\n  //  match the above lists, for example).\n  //\n  // In there are two increasing subsequences: `4,5` and `1,2,3`, the latter being the longest. We\n  // can update those nodes without moving them, and only call `insertNode` on `4` and `5`.\n  //\n  // @localvoid adapted the algo to also support node deletions and insertions (the `lis` is actually\n  // the longest increasing subsequence *of old nodes still present in the new list*).\n  //\n  // It is a general algorithm that is fireproof in all circumstances, but it requires the allocation\n  // and the construction of a `key => oldIndex` map, and three arrays (one with `newIndex => oldIndex`,\n  // the `LIS` and a temporary one to create the LIS).\n  //\n  // So we cheat where we can: if the tails of the lists are identical, they are guaranteed to be part of\n  // the LIS and can be updated without moving them.\n  //\n  // If two nodes are swapped, they are guaranteed not to be part of the LIS, and must be moved (with\n  // the exception of the last node if the list is fully reversed).\n  //\n  // ## Finding the next sibling.\n  //\n  // `updateNode()` and `createNode()` expect a nextSibling parameter to perform DOM operations.\n  // When the list is being traversed top-down, at any index, the DOM nodes up to the previous\n  // vnode reflect the content of the new list, whereas the rest of the DOM nodes reflect the old\n  // list. The next sibling must be looked for in the old list using `getNextSibling(... oldStart + 1 ...)`.\n  //\n  // In the other scenarios (swaps, upwards traversal, map-based diff),\n  // the new vnodes list is traversed upwards. The DOM nodes at the bottom of the list reflect the\n  // bottom part of the new vnodes list, and we can use the `v.dom`  value of the previous node\n  // as the next sibling (cached in the `nextSibling` variable).\n  // ## DOM node moves\n  //\n  // In most scenarios `updateNode()` and `createNode()` perform the DOM operations. However,\n  // this is not the case if the node moved (second and fourth part of the diff algo). We move\n  // the old DOM nodes before updateNode runs because it enables us to use the cached `nextSibling`\n  // variable rather than fetching it using `getNextSibling()`.\n  //\n  // The fourth part of the diff currently inserts nodes unconditionally, leading to issues\n  // like #1791 and #1999. We need to be smarter about those situations where adjascent old\n  // nodes remain together in the new list in a way that isn't covered by parts one and\n  // three of the diff algo.\n\n\n  function updateNodes(parent, old, vnodes, hooks, nextSibling, ns) {\n    if (old === vnodes || old == null && vnodes == null) return;else if (old == null || old.length === 0) createNodes(parent, vnodes, 0, vnodes.length, hooks, nextSibling, ns);else if (vnodes == null || vnodes.length === 0) removeNodes(parent, old, 0, old.length);else {\n      var isOldKeyed = old[0] != null && old[0].key != null;\n      var isKeyed = vnodes[0] != null && vnodes[0].key != null;\n      var start = 0,\n          oldStart = 0;\n      if (!isOldKeyed) while (oldStart < old.length && old[oldStart] == null) {\n        oldStart++;\n      }\n      if (!isKeyed) while (start < vnodes.length && vnodes[start] == null) {\n        start++;\n      }\n      if (isKeyed === null && isOldKeyed == null) return; // both lists are full of nulls\n\n      if (isOldKeyed !== isKeyed) {\n        removeNodes(parent, old, oldStart, old.length);\n        createNodes(parent, vnodes, start, vnodes.length, hooks, nextSibling, ns);\n      } else if (!isKeyed) {\n        // Don't index past the end of either list (causes deopts).\n        var commonLength = old.length < vnodes.length ? old.length : vnodes.length; // Rewind if necessary to the first non-null index on either side.\n        // We could alternatively either explicitly create or remove nodes when `start !== oldStart`\n        // but that would be optimizing for sparse lists which are more rare than dense ones.\n\n        start = start < oldStart ? start : oldStart;\n\n        for (; start < commonLength; start++) {\n          o = old[start];\n          v = vnodes[start];\n          if (o === v || o == null && v == null) continue;else if (o == null) createNode(parent, v, hooks, ns, getNextSibling(old, start + 1, nextSibling));else if (v == null) removeNode(parent, o);else updateNode(parent, o, v, hooks, getNextSibling(old, start + 1, nextSibling), ns);\n        }\n\n        if (old.length > commonLength) removeNodes(parent, old, start, old.length);\n        if (vnodes.length > commonLength) createNodes(parent, vnodes, start, vnodes.length, hooks, nextSibling, ns);\n      } else {\n        // keyed diff\n        var oldEnd = old.length - 1,\n            end = vnodes.length - 1,\n            map,\n            o,\n            v,\n            oe,\n            ve,\n            topSibling; // bottom-up\n\n        while (oldEnd >= oldStart && end >= start) {\n          oe = old[oldEnd];\n          ve = vnodes[end];\n          if (oe.key !== ve.key) break;\n          if (oe !== ve) updateNode(parent, oe, ve, hooks, nextSibling, ns);\n          if (ve.dom != null) nextSibling = ve.dom;\n          oldEnd--, end--;\n        } // top-down\n\n\n        while (oldEnd >= oldStart && end >= start) {\n          o = old[oldStart];\n          v = vnodes[start];\n          if (o.key !== v.key) break;\n          oldStart++, start++;\n          if (o !== v) updateNode(parent, o, v, hooks, getNextSibling(old, oldStart, nextSibling), ns);\n        } // swaps and list reversals\n\n\n        while (oldEnd >= oldStart && end >= start) {\n          if (start === end) break;\n          if (o.key !== ve.key || oe.key !== v.key) break;\n          topSibling = getNextSibling(old, oldStart, nextSibling);\n          moveNodes(parent, oe, topSibling);\n          if (oe !== v) updateNode(parent, oe, v, hooks, topSibling, ns);\n          if (++start <= --end) moveNodes(parent, o, nextSibling);\n          if (o !== ve) updateNode(parent, o, ve, hooks, nextSibling, ns);\n          if (ve.dom != null) nextSibling = ve.dom;\n          oldStart++;\n          oldEnd--;\n          oe = old[oldEnd];\n          ve = vnodes[end];\n          o = old[oldStart];\n          v = vnodes[start];\n        } // bottom up once again\n\n\n        while (oldEnd >= oldStart && end >= start) {\n          if (oe.key !== ve.key) break;\n          if (oe !== ve) updateNode(parent, oe, ve, hooks, nextSibling, ns);\n          if (ve.dom != null) nextSibling = ve.dom;\n          oldEnd--, end--;\n          oe = old[oldEnd];\n          ve = vnodes[end];\n        }\n\n        if (start > end) removeNodes(parent, old, oldStart, oldEnd + 1);else if (oldStart > oldEnd) createNodes(parent, vnodes, start, end + 1, hooks, nextSibling, ns);else {\n          // inspired by ivi https://github.com/ivijs/ivi/ by Boris Kaul\n          var originalNextSibling = nextSibling,\n              vnodesLength = end - start + 1,\n              oldIndices = new Array(vnodesLength),\n              li = 0,\n              i = 0,\n              pos = 2147483647,\n              matched = 0,\n              map,\n              lisIndices;\n\n          for (i = 0; i < vnodesLength; i++) {\n            oldIndices[i] = -1;\n          }\n\n          for (i = end; i >= start; i--) {\n            if (map == null) map = getKeyMap(old, oldStart, oldEnd + 1);\n            ve = vnodes[i];\n            var oldIndex = map[ve.key];\n\n            if (oldIndex != null) {\n              pos = oldIndex < pos ? oldIndex : -1; // becomes -1 if nodes were re-ordered\n\n              oldIndices[i - start] = oldIndex;\n              oe = old[oldIndex];\n              old[oldIndex] = null;\n              if (oe !== ve) updateNode(parent, oe, ve, hooks, nextSibling, ns);\n              if (ve.dom != null) nextSibling = ve.dom;\n              matched++;\n            }\n          }\n\n          nextSibling = originalNextSibling;\n          if (matched !== oldEnd - oldStart + 1) removeNodes(parent, old, oldStart, oldEnd + 1);\n          if (matched === 0) createNodes(parent, vnodes, start, end + 1, hooks, nextSibling, ns);else {\n            if (pos === -1) {\n              // the indices of the indices of the items that are part of the\n              // longest increasing subsequence in the oldIndices list\n              lisIndices = makeLisIndices(oldIndices);\n              li = lisIndices.length - 1;\n\n              for (i = end; i >= start; i--) {\n                v = vnodes[i];\n                if (oldIndices[i - start] === -1) createNode(parent, v, hooks, ns, nextSibling);else {\n                  if (lisIndices[li] === i - start) li--;else moveNodes(parent, v, nextSibling);\n                }\n                if (v.dom != null) nextSibling = vnodes[i].dom;\n              }\n            } else {\n              for (i = end; i >= start; i--) {\n                v = vnodes[i];\n                if (oldIndices[i - start] === -1) createNode(parent, v, hooks, ns, nextSibling);\n                if (v.dom != null) nextSibling = vnodes[i].dom;\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n\n  function updateNode(parent, old, vnode, hooks, nextSibling, ns) {\n    var oldTag = old.tag,\n        tag = vnode.tag;\n\n    if (oldTag === tag) {\n      vnode.state = old.state;\n      vnode.events = old.events;\n      if (shouldNotUpdate(vnode, old)) return;\n\n      if (typeof oldTag === \"string\") {\n        if (vnode.attrs != null) {\n          updateLifecycle(vnode.attrs, vnode, hooks);\n        }\n\n        switch (oldTag) {\n          case \"#\":\n            updateText(old, vnode);\n            break;\n\n          case \"<\":\n            updateHTML(parent, old, vnode, ns, nextSibling);\n            break;\n\n          case \"[\":\n            updateFragment(parent, old, vnode, hooks, nextSibling, ns);\n            break;\n\n          default:\n            updateElement(old, vnode, hooks, ns);\n        }\n      } else updateComponent(parent, old, vnode, hooks, nextSibling, ns);\n    } else {\n      removeNode(parent, old);\n      createNode(parent, vnode, hooks, ns, nextSibling);\n    }\n  }\n\n  function updateText(old, vnode) {\n    if (old.children.toString() !== vnode.children.toString()) {\n      old.dom.nodeValue = vnode.children;\n    }\n\n    vnode.dom = old.dom;\n  }\n\n  function updateHTML(parent, old, vnode, ns, nextSibling) {\n    if (old.children !== vnode.children) {\n      removeHTML(parent, old);\n      createHTML(parent, vnode, ns, nextSibling);\n    } else {\n      vnode.dom = old.dom;\n      vnode.domSize = old.domSize;\n      vnode.instance = old.instance;\n    }\n  }\n\n  function updateFragment(parent, old, vnode, hooks, nextSibling, ns) {\n    updateNodes(parent, old.children, vnode.children, hooks, nextSibling, ns);\n    var domSize = 0,\n        children = vnode.children;\n    vnode.dom = null;\n\n    if (children != null) {\n      for (var i = 0; i < children.length; i++) {\n        var child = children[i];\n\n        if (child != null && child.dom != null) {\n          if (vnode.dom == null) vnode.dom = child.dom;\n          domSize += child.domSize || 1;\n        }\n      }\n\n      if (domSize !== 1) vnode.domSize = domSize;\n    }\n  }\n\n  function updateElement(old, vnode, hooks, ns) {\n    var element = vnode.dom = old.dom;\n    ns = getNameSpace(vnode) || ns;\n\n    if (vnode.tag === \"textarea\") {\n      if (vnode.attrs == null) vnode.attrs = {};\n\n      if (vnode.text != null) {\n        vnode.attrs.value = vnode.text; //FIXME handle multiple children\n\n        vnode.text = undefined;\n      }\n    }\n\n    updateAttrs(vnode, old.attrs, vnode.attrs, ns);\n\n    if (!maybeSetContentEditable(vnode)) {\n      if (old.text != null && vnode.text != null && vnode.text !== \"\") {\n        if (old.text.toString() !== vnode.text.toString()) old.dom.firstChild.nodeValue = vnode.text;\n      } else {\n        if (old.text != null) old.children = [Vnode(\"#\", undefined, undefined, old.text, undefined, old.dom.firstChild)];\n        if (vnode.text != null) vnode.children = [Vnode(\"#\", undefined, undefined, vnode.text, undefined, undefined)];\n        updateNodes(element, old.children, vnode.children, hooks, null, ns);\n      }\n    }\n  }\n\n  function updateComponent(parent, old, vnode, hooks, nextSibling, ns) {\n    vnode.instance = Vnode.normalize(callHook.call(vnode.state.view, vnode));\n    if (vnode.instance === vnode) throw Error(\"A view cannot return the vnode it received as argument\");\n    updateLifecycle(vnode.state, vnode, hooks);\n    if (vnode.attrs != null) updateLifecycle(vnode.attrs, vnode, hooks);\n\n    if (vnode.instance != null) {\n      if (old.instance == null) createNode(parent, vnode.instance, hooks, ns, nextSibling);else updateNode(parent, old.instance, vnode.instance, hooks, nextSibling, ns);\n      vnode.dom = vnode.instance.dom;\n      vnode.domSize = vnode.instance.domSize;\n    } else if (old.instance != null) {\n      removeNode(parent, old.instance);\n      vnode.dom = undefined;\n      vnode.domSize = 0;\n    } else {\n      vnode.dom = old.dom;\n      vnode.domSize = old.domSize;\n    }\n  }\n\n  function getKeyMap(vnodes, start, end) {\n    var map = Object.create(null);\n\n    for (; start < end; start++) {\n      var vnode = vnodes[start];\n\n      if (vnode != null) {\n        var key = vnode.key;\n        if (key != null) map[key] = start;\n      }\n    }\n\n    return map;\n  } // Lifted from ivi https://github.com/ivijs/ivi/\n  // takes a list of unique numbers (-1 is special and can\n  // occur multiple times) and returns an array with the indices\n  // of the items that are part of the longest increasing\n  // subsequece\n\n\n  var lisTemp = [];\n\n  function makeLisIndices(a) {\n    var result = [0];\n    var u = 0,\n        v = 0,\n        i = 0;\n    var il = lisTemp.length = a.length;\n\n    for (var i = 0; i < il; i++) {\n      lisTemp[i] = a[i];\n    }\n\n    for (var i = 0; i < il; ++i) {\n      if (a[i] === -1) continue;\n      var j = result[result.length - 1];\n\n      if (a[j] < a[i]) {\n        lisTemp[i] = j;\n        result.push(i);\n        continue;\n      }\n\n      u = 0;\n      v = result.length - 1;\n\n      while (u < v) {\n        // Fast integer average without overflow.\n        // eslint-disable-next-line no-bitwise\n        var c = (u >>> 1) + (v >>> 1) + (u & v & 1);\n\n        if (a[result[c]] < a[i]) {\n          u = c + 1;\n        } else {\n          v = c;\n        }\n      }\n\n      if (a[i] < a[result[u]]) {\n        if (u > 0) lisTemp[i] = result[u - 1];\n        result[u] = i;\n      }\n    }\n\n    u = result.length;\n    v = result[u - 1];\n\n    while (u-- > 0) {\n      result[u] = v;\n      v = lisTemp[v];\n    }\n\n    lisTemp.length = 0;\n    return result;\n  }\n\n  function getNextSibling(vnodes, i, nextSibling) {\n    for (; i < vnodes.length; i++) {\n      if (vnodes[i] != null && vnodes[i].dom != null) return vnodes[i].dom;\n    }\n\n    return nextSibling;\n  } // This covers a really specific edge case:\n  // - Parent node is keyed and contains child\n  // - Child is removed, returns unresolved promise in `onbeforeremove`\n  // - Parent node is moved in keyed diff\n  // - Remaining children still need moved appropriately\n  //\n  // Ideally, I'd track removed nodes as well, but that introduces a lot more\n  // complexity and I'm not exactly interested in doing that.\n\n\n  function moveNodes(parent, vnode, nextSibling) {\n    var frag = $doc.createDocumentFragment();\n    moveChildToFrag(parent, frag, vnode);\n    insertNode(parent, frag, nextSibling);\n  }\n\n  function moveChildToFrag(parent, frag, vnode) {\n    // Dodge the recursion overhead in a few of the most common cases.\n    while (vnode.dom != null && vnode.dom.parentNode === parent) {\n      if (typeof vnode.tag !== \"string\") {\n        vnode = vnode.instance;\n        if (vnode != null) continue;\n      } else if (vnode.tag === \"<\") {\n        for (var i = 0; i < vnode.instance.length; i++) {\n          frag.appendChild(vnode.instance[i]);\n        }\n      } else if (vnode.tag !== \"[\") {\n        // Don't recurse for text nodes *or* elements, just fragments\n        frag.appendChild(vnode.dom);\n      } else if (vnode.children.length === 1) {\n        vnode = vnode.children[0];\n        if (vnode != null) continue;\n      } else {\n        for (var i = 0; i < vnode.children.length; i++) {\n          var child = vnode.children[i];\n          if (child != null) moveChildToFrag(parent, frag, child);\n        }\n      }\n\n      break;\n    }\n  }\n\n  function insertNode(parent, dom, nextSibling) {\n    if (nextSibling != null) parent.insertBefore(dom, nextSibling);else parent.appendChild(dom);\n  }\n\n  function maybeSetContentEditable(vnode) {\n    if (vnode.attrs == null || vnode.attrs.contenteditable == null && // attribute\n    vnode.attrs.contentEditable == null // property\n    ) return false;\n    var children = vnode.children;\n\n    if (children != null && children.length === 1 && children[0].tag === \"<\") {\n      var content = children[0].children;\n      if (vnode.dom.innerHTML !== content) vnode.dom.innerHTML = content;\n    } else if (vnode.text != null || children != null && children.length !== 0) throw new Error(\"Child node of a contenteditable must be trusted\");\n\n    return true;\n  } //remove\n\n\n  function removeNodes(parent, vnodes, start, end) {\n    for (var i = start; i < end; i++) {\n      var vnode = vnodes[i];\n      if (vnode != null) removeNode(parent, vnode);\n    }\n  }\n\n  function removeNode(parent, vnode) {\n    var mask = 0;\n    var original = vnode.state;\n    var stateResult, attrsResult;\n\n    if (typeof vnode.tag !== \"string\" && typeof vnode.state.onbeforeremove === \"function\") {\n      var result = callHook.call(vnode.state.onbeforeremove, vnode);\n\n      if (result != null && typeof result.then === \"function\") {\n        mask = 1;\n        stateResult = result;\n      }\n    }\n\n    if (vnode.attrs && typeof vnode.attrs.onbeforeremove === \"function\") {\n      var result = callHook.call(vnode.attrs.onbeforeremove, vnode);\n\n      if (result != null && typeof result.then === \"function\") {\n        // eslint-disable-next-line no-bitwise\n        mask |= 2;\n        attrsResult = result;\n      }\n    }\n\n    checkState(vnode, original); // If we can, try to fast-path it and avoid all the overhead of awaiting\n\n    if (!mask) {\n      onremove(vnode);\n      removeChild(parent, vnode);\n    } else {\n      if (stateResult != null) {\n        var next = function next() {\n          // eslint-disable-next-line no-bitwise\n          if (mask & 1) {\n            mask &= 2;\n            if (!mask) reallyRemove();\n          }\n        };\n\n        stateResult.then(next, next);\n      }\n\n      if (attrsResult != null) {\n        var next = function next() {\n          // eslint-disable-next-line no-bitwise\n          if (mask & 2) {\n            mask &= 1;\n            if (!mask) reallyRemove();\n          }\n        };\n\n        attrsResult.then(next, next);\n      }\n    }\n\n    function reallyRemove() {\n      checkState(vnode, original);\n      onremove(vnode);\n      removeChild(parent, vnode);\n    }\n  }\n\n  function removeHTML(parent, vnode) {\n    for (var i = 0; i < vnode.instance.length; i++) {\n      parent.removeChild(vnode.instance[i]);\n    }\n  }\n\n  function removeChild(parent, vnode) {\n    // Dodge the recursion overhead in a few of the most common cases.\n    while (vnode.dom != null && vnode.dom.parentNode === parent) {\n      if (typeof vnode.tag !== \"string\") {\n        vnode = vnode.instance;\n        if (vnode != null) continue;\n      } else if (vnode.tag === \"<\") {\n        removeHTML(parent, vnode);\n      } else {\n        if (vnode.tag !== \"[\") {\n          parent.removeChild(vnode.dom);\n          if (!Array.isArray(vnode.children)) break;\n        }\n\n        if (vnode.children.length === 1) {\n          vnode = vnode.children[0];\n          if (vnode != null) continue;\n        } else {\n          for (var i = 0; i < vnode.children.length; i++) {\n            var child = vnode.children[i];\n            if (child != null) removeChild(parent, child);\n          }\n        }\n      }\n\n      break;\n    }\n  }\n\n  function onremove(vnode) {\n    if (typeof vnode.tag !== \"string\" && typeof vnode.state.onremove === \"function\") callHook.call(vnode.state.onremove, vnode);\n    if (vnode.attrs && typeof vnode.attrs.onremove === \"function\") callHook.call(vnode.attrs.onremove, vnode);\n\n    if (typeof vnode.tag !== \"string\") {\n      if (vnode.instance != null) onremove(vnode.instance);\n    } else {\n      var children = vnode.children;\n\n      if (Array.isArray(children)) {\n        for (var i = 0; i < children.length; i++) {\n          var child = children[i];\n          if (child != null) onremove(child);\n        }\n      }\n    }\n  } //attrs\n\n\n  function setAttrs(vnode, attrs, ns) {\n    for (var key in attrs) {\n      setAttr(vnode, key, null, attrs[key], ns);\n    }\n  }\n\n  function setAttr(vnode, key, old, value, ns) {\n    if (key === \"key\" || key === \"is\" || value == null || isLifecycleMethod(key) || old === value && !isFormAttribute(vnode, key) && _typeof(value) !== \"object\") return;\n    if (key[0] === \"o\" && key[1] === \"n\") return updateEvent(vnode, key, value);\n    if (key.slice(0, 6) === \"xlink:\") vnode.dom.setAttributeNS(\"http://www.w3.org/1999/xlink\", key.slice(6), value);else if (key === \"style\") updateStyle(vnode.dom, old, value);else if (hasPropertyKey(vnode, key, ns)) {\n      if (key === \"value\") {\n        // Only do the coercion if we're actually going to check the value.\n\n        /* eslint-disable no-implicit-coercion */\n        //setting input[value] to same value by typing on focused element moves cursor to end in Chrome\n        if ((vnode.tag === \"input\" || vnode.tag === \"textarea\") && vnode.dom.value === \"\" + value && vnode.dom === activeElement()) return; //setting select[value] to same value while having select open blinks select dropdown in Chrome\n\n        if (vnode.tag === \"select\" && old !== null && vnode.dom.value === \"\" + value) return; //setting option[value] to same value while having select open blinks select dropdown in Chrome\n\n        if (vnode.tag === \"option\" && old !== null && vnode.dom.value === \"\" + value) return;\n        /* eslint-enable no-implicit-coercion */\n      } // If you assign an input type that is not supported by IE 11 with an assignment expression, an error will occur.\n\n\n      if (vnode.tag === \"input\" && key === \"type\") vnode.dom.setAttribute(key, value);else vnode.dom[key] = value;\n    } else {\n      if (typeof value === \"boolean\") {\n        if (value) vnode.dom.setAttribute(key, \"\");else vnode.dom.removeAttribute(key);\n      } else vnode.dom.setAttribute(key === \"className\" ? \"class\" : key, value);\n    }\n  }\n\n  function removeAttr(vnode, key, old, ns) {\n    if (key === \"key\" || key === \"is\" || old == null || isLifecycleMethod(key)) return;\n    if (key[0] === \"o\" && key[1] === \"n\" && !isLifecycleMethod(key)) updateEvent(vnode, key, undefined);else if (key === \"style\") updateStyle(vnode.dom, old, null);else if (hasPropertyKey(vnode, key, ns) && key !== \"className\" && !(key === \"value\" && (vnode.tag === \"option\" || vnode.tag === \"select\" && vnode.dom.selectedIndex === -1 && vnode.dom === activeElement())) && !(vnode.tag === \"input\" && key === \"type\")) {\n      vnode.dom[key] = null;\n    } else {\n      var nsLastIndex = key.indexOf(\":\");\n      if (nsLastIndex !== -1) key = key.slice(nsLastIndex + 1);\n      if (old !== false) vnode.dom.removeAttribute(key === \"className\" ? \"class\" : key);\n    }\n  }\n\n  function setLateSelectAttrs(vnode, attrs) {\n    if (\"value\" in attrs) {\n      if (attrs.value === null) {\n        if (vnode.dom.selectedIndex !== -1) vnode.dom.value = null;\n      } else {\n        var normalized = \"\" + attrs.value; // eslint-disable-line no-implicit-coercion\n\n        if (vnode.dom.value !== normalized || vnode.dom.selectedIndex === -1) {\n          vnode.dom.value = normalized;\n        }\n      }\n    }\n\n    if (\"selectedIndex\" in attrs) setAttr(vnode, \"selectedIndex\", null, attrs.selectedIndex, undefined);\n  }\n\n  function updateAttrs(vnode, old, attrs, ns) {\n    if (attrs != null) {\n      for (var key in attrs) {\n        setAttr(vnode, key, old && old[key], attrs[key], ns);\n      }\n    }\n\n    var val;\n\n    if (old != null) {\n      for (var key in old) {\n        if ((val = old[key]) != null && (attrs == null || attrs[key] == null)) {\n          removeAttr(vnode, key, val, ns);\n        }\n      }\n    }\n  }\n\n  function isFormAttribute(vnode, attr) {\n    return attr === \"value\" || attr === \"checked\" || attr === \"selectedIndex\" || attr === \"selected\" && vnode.dom === activeElement() || vnode.tag === \"option\" && vnode.dom.parentNode === $doc.activeElement;\n  }\n\n  function isLifecycleMethod(attr) {\n    return attr === \"oninit\" || attr === \"oncreate\" || attr === \"onupdate\" || attr === \"onremove\" || attr === \"onbeforeremove\" || attr === \"onbeforeupdate\";\n  }\n\n  function hasPropertyKey(vnode, key, ns) {\n    // Filter out namespaced keys\n    return ns === undefined && ( // If it's a custom element, just keep it.\n    vnode.tag.indexOf(\"-\") > -1 || vnode.attrs != null && vnode.attrs.is || // If it's a normal element, let's try to avoid a few browser bugs.\n    key !== \"href\" && key !== \"list\" && key !== \"form\" && key !== \"width\" && key !== \"height\" // && key !== \"type\"\n    // Defer the property check until *after* we check everything.\n    ) && key in vnode.dom;\n  } //style\n\n\n  var uppercaseRegex = /[A-Z]/g;\n\n  function toLowerCase(capital) {\n    return \"-\" + capital.toLowerCase();\n  }\n\n  function normalizeKey(key) {\n    return key[0] === \"-\" && key[1] === \"-\" ? key : key === \"cssFloat\" ? \"float\" : key.replace(uppercaseRegex, toLowerCase);\n  }\n\n  function updateStyle(element, old, style) {\n    if (old === style) {// Styles are equivalent, do nothing.\n    } else if (style == null) {\n      // New style is missing, just clear it.\n      element.style.cssText = \"\";\n    } else if (_typeof(style) !== \"object\") {\n      // New style is a string, let engine deal with patching.\n      element.style.cssText = style;\n    } else if (old == null || _typeof(old) !== \"object\") {\n      // `old` is missing or a string, `style` is an object.\n      element.style.cssText = \"\"; // Add new style properties\n\n      for (var key in style) {\n        var value = style[key];\n        if (value != null) element.style.setProperty(normalizeKey(key), String(value));\n      }\n    } else {\n      // Both old & new are (different) objects.\n      // Update style properties that have changed\n      for (var key in style) {\n        var value = style[key];\n\n        if (value != null && (value = String(value)) !== String(old[key])) {\n          element.style.setProperty(normalizeKey(key), value);\n        }\n      } // Remove style properties that no longer exist\n\n\n      for (var key in old) {\n        if (old[key] != null && style[key] == null) {\n          element.style.removeProperty(normalizeKey(key));\n        }\n      }\n    }\n  } // Here's an explanation of how this works:\n  // 1. The event names are always (by design) prefixed by `on`.\n  // 2. The EventListener interface accepts either a function or an object\n  //    with a `handleEvent` method.\n  // 3. The object does not inherit from `Object.prototype`, to avoid\n  //    any potential interference with that (e.g. setters).\n  // 4. The event name is remapped to the handler before calling it.\n  // 5. In function-based event handlers, `ev.target === this`. We replicate\n  //    that below.\n  // 6. In function-based event handlers, `return false` prevents the default\n  //    action and stops event propagation. We replicate that below.\n\n\n  function EventDict() {\n    // Save this, so the current redraw is correctly tracked.\n    this._ = currentRedraw;\n  }\n\n  EventDict.prototype = Object.create(null);\n\n  EventDict.prototype.handleEvent = function (ev) {\n    var handler = this[\"on\" + ev.type];\n    var result;\n    if (typeof handler === \"function\") result = handler.call(ev.currentTarget, ev);else if (typeof handler.handleEvent === \"function\") handler.handleEvent(ev);\n    if (this._ && ev.redraw !== false) (0, this._)();\n\n    if (result === false) {\n      ev.preventDefault();\n      ev.stopPropagation();\n    }\n  }; //event\n\n\n  function updateEvent(vnode, key, value) {\n    if (vnode.events != null) {\n      if (vnode.events[key] === value) return;\n\n      if (value != null && (typeof value === \"function\" || _typeof(value) === \"object\")) {\n        if (vnode.events[key] == null) vnode.dom.addEventListener(key.slice(2), vnode.events, false);\n        vnode.events[key] = value;\n      } else {\n        if (vnode.events[key] != null) vnode.dom.removeEventListener(key.slice(2), vnode.events, false);\n        vnode.events[key] = undefined;\n      }\n    } else if (value != null && (typeof value === \"function\" || _typeof(value) === \"object\")) {\n      vnode.events = new EventDict();\n      vnode.dom.addEventListener(key.slice(2), vnode.events, false);\n      vnode.events[key] = value;\n    }\n  } //lifecycle\n\n\n  function initLifecycle(source, vnode, hooks) {\n    if (typeof source.oninit === \"function\") callHook.call(source.oninit, vnode);\n    if (typeof source.oncreate === \"function\") hooks.push(callHook.bind(source.oncreate, vnode));\n  }\n\n  function updateLifecycle(source, vnode, hooks) {\n    if (typeof source.onupdate === \"function\") hooks.push(callHook.bind(source.onupdate, vnode));\n  }\n\n  function shouldNotUpdate(vnode, old) {\n    do {\n      if (vnode.attrs != null && typeof vnode.attrs.onbeforeupdate === \"function\") {\n        var force = callHook.call(vnode.attrs.onbeforeupdate, vnode, old);\n        if (force !== undefined && !force) break;\n      }\n\n      if (typeof vnode.tag !== \"string\" && typeof vnode.state.onbeforeupdate === \"function\") {\n        var force = callHook.call(vnode.state.onbeforeupdate, vnode, old);\n        if (force !== undefined && !force) break;\n      }\n\n      return false;\n    } while (false); // eslint-disable-line no-constant-condition\n\n\n    vnode.dom = old.dom;\n    vnode.domSize = old.domSize;\n    vnode.instance = old.instance; // One would think having the actual latest attributes would be ideal,\n    // but it doesn't let us properly diff based on our current internal\n    // representation. We have to save not only the old DOM info, but also\n    // the attributes used to create it, as we diff *that*, not against the\n    // DOM directly (with a few exceptions in `setAttr`). And, of course, we\n    // need to save the children and text as they are conceptually not\n    // unlike special \"attributes\" internally.\n\n    vnode.attrs = old.attrs;\n    vnode.children = old.children;\n    vnode.text = old.text;\n    return true;\n  }\n\n  return function (dom, vnodes, redraw) {\n    if (!dom) throw new TypeError(\"Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.\");\n    var hooks = [];\n    var active = activeElement();\n    var namespace = dom.namespaceURI; // First time rendering into a node clears it out\n\n    if (dom.vnodes == null) dom.textContent = \"\";\n    vnodes = Vnode.normalizeChildren(Array.isArray(vnodes) ? vnodes : [vnodes]);\n    var prevRedraw = currentRedraw;\n\n    try {\n      currentRedraw = typeof redraw === \"function\" ? redraw : undefined;\n      updateNodes(dom, dom.vnodes, vnodes, hooks, null, namespace === \"http://www.w3.org/1999/xhtml\" ? undefined : namespace);\n    } finally {\n      currentRedraw = prevRedraw;\n    }\n\n    dom.vnodes = vnodes; // `document.activeElement` can return null: https://html.spec.whatwg.org/multipage/interaction.html#dom-document-activeelement\n\n    if (active != null && activeElement() !== active && typeof active.focus === \"function\") active.focus();\n\n    for (var i = 0; i < hooks.length; i++) {\n      hooks[i]();\n    }\n  };\n};\n\n},{\"../render/vnode\":24}],23:[function(require,module,exports){\n\"use strict\";\n\nvar Vnode = require(\"../render/vnode\");\n\nmodule.exports = function (html) {\n  if (html == null) html = \"\";\n  return Vnode(\"<\", undefined, undefined, html, undefined, undefined);\n};\n\n},{\"../render/vnode\":24}],24:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction Vnode(tag, key, attrs, children, text, dom) {\n  return {\n    tag: tag,\n    key: key,\n    attrs: attrs,\n    children: children,\n    text: text,\n    dom: dom,\n    domSize: undefined,\n    state: undefined,\n    events: undefined,\n    instance: undefined\n  };\n}\n\nVnode.normalize = function (node) {\n  if (Array.isArray(node)) return Vnode(\"[\", undefined, undefined, Vnode.normalizeChildren(node), undefined, undefined);\n  if (node == null || typeof node === \"boolean\") return null;\n  if (_typeof(node) === \"object\") return node;\n  return Vnode(\"#\", undefined, undefined, String(node), undefined, undefined);\n};\n\nVnode.normalizeChildren = function (input) {\n  var children = [];\n\n  if (input.length) {\n    var isKeyed = input[0] != null && input[0].key != null; // Note: this is a *very* perf-sensitive check.\n    // Fun fact: merging the loop like this is somehow faster than splitting\n    // it, noticeably so.\n\n    for (var i = 1; i < input.length; i++) {\n      if ((input[i] != null && input[i].key != null) !== isKeyed) {\n        throw new TypeError(\"Vnodes must either always have keys or never have keys!\");\n      }\n    }\n\n    for (var i = 0; i < input.length; i++) {\n      children[i] = Vnode.normalize(input[i]);\n    }\n  }\n\n  return children;\n};\n\nmodule.exports = Vnode;\n\n},{}],25:[function(require,module,exports){\n\"use strict\";\n\nvar PromisePolyfill = require(\"./promise/promise\");\n\nvar mountRedraw = require(\"./mount-redraw\");\n\nmodule.exports = require(\"./request/request\")(window, PromisePolyfill, mountRedraw.redraw);\n\n},{\"./mount-redraw\":9,\"./promise/promise\":15,\"./request/request\":26}],26:[function(require,module,exports){\n\"use strict\";\n\nvar buildPathname = require(\"../pathname/build\");\n\nmodule.exports = function ($window, Promise, oncompletion) {\n  var callbackCount = 0;\n\n  function PromiseProxy(executor) {\n    return new Promise(executor);\n  } // In case the global Promise is some userland library's where they rely on\n  // `foo instanceof this.constructor`, `this.constructor.resolve(value)`, or\n  // similar. Let's *not* break them.\n\n\n  PromiseProxy.prototype = Promise.prototype;\n  PromiseProxy.__proto__ = Promise; // eslint-disable-line no-proto\n\n  function makeRequest(factory) {\n    return function (url, args) {\n      if (typeof url !== \"string\") {\n        args = url;\n        url = url.url;\n      } else if (args == null) args = {};\n\n      var promise = new Promise(function (resolve, reject) {\n        factory(buildPathname(url, args.params), args, function (data) {\n          if (typeof args.type === \"function\") {\n            if (Array.isArray(data)) {\n              for (var i = 0; i < data.length; i++) {\n                data[i] = new args.type(data[i]);\n              }\n            } else data = new args.type(data);\n          }\n\n          resolve(data);\n        }, reject);\n      });\n      if (args.background === true) return promise;\n      var count = 0;\n\n      function complete() {\n        if (--count === 0 && typeof oncompletion === \"function\") oncompletion();\n      }\n\n      return wrap(promise);\n\n      function wrap(promise) {\n        var then = promise.then; // Set the constructor, so engines know to not await or resolve\n        // this as a native promise. At the time of writing, this is\n        // only necessary for V8, but their behavior is the correct\n        // behavior per spec. See this spec issue for more details:\n        // https://github.com/tc39/ecma262/issues/1577. Also, see the\n        // corresponding comment in `request/tests/test-request.js` for\n        // a bit more background on the issue at hand.\n\n        promise.constructor = PromiseProxy;\n\n        promise.then = function () {\n          count++;\n          var next = then.apply(promise, arguments);\n          next.then(complete, function (e) {\n            complete();\n            if (count === 0) throw e;\n          });\n          return wrap(next);\n        };\n\n        return promise;\n      }\n    };\n  }\n\n  function hasHeader(args, name) {\n    for (var key in args.headers) {\n      if ({}.hasOwnProperty.call(args.headers, key) && name.test(key)) return true;\n    }\n\n    return false;\n  }\n\n  return {\n    request: makeRequest(function (url, args, resolve, reject) {\n      var method = args.method != null ? args.method.toUpperCase() : \"GET\";\n      var body = args.body;\n      var assumeJSON = (args.serialize == null || args.serialize === JSON.serialize) && !(body instanceof $window.FormData);\n      var responseType = args.responseType || (typeof args.extract === \"function\" ? \"\" : \"json\");\n      var xhr = new $window.XMLHttpRequest(),\n          aborted = false;\n      var original = xhr,\n          replacedAbort;\n      var abort = xhr.abort;\n\n      xhr.abort = function () {\n        aborted = true;\n        abort.call(this);\n      };\n\n      xhr.open(method, url, args.async !== false, typeof args.user === \"string\" ? args.user : undefined, typeof args.password === \"string\" ? args.password : undefined);\n\n      if (assumeJSON && body != null && !hasHeader(args, /^content-type$/i)) {\n        xhr.setRequestHeader(\"Content-Type\", \"application/json; charset=utf-8\");\n      }\n\n      if (typeof args.deserialize !== \"function\" && !hasHeader(args, /^accept$/i)) {\n        xhr.setRequestHeader(\"Accept\", \"application/json, text/*\");\n      }\n\n      if (args.withCredentials) xhr.withCredentials = args.withCredentials;\n      if (args.timeout) xhr.timeout = args.timeout;\n      xhr.responseType = responseType;\n\n      for (var key in args.headers) {\n        if ({}.hasOwnProperty.call(args.headers, key)) {\n          xhr.setRequestHeader(key, args.headers[key]);\n        }\n      }\n\n      xhr.onreadystatechange = function (ev) {\n        // Don't throw errors on xhr.abort().\n        if (aborted) return;\n\n        if (ev.target.readyState === 4) {\n          try {\n            var success = ev.target.status >= 200 && ev.target.status < 300 || ev.target.status === 304 || /^file:\\/\\//i.test(url); // When the response type isn't \"\" or \"text\",\n            // `xhr.responseText` is the wrong thing to use.\n            // Browsers do the right thing and throw here, and we\n            // should honor that and do the right thing by\n            // preferring `xhr.response` where possible/practical.\n\n            var response = ev.target.response,\n                message;\n\n            if (responseType === \"json\") {\n              // For IE and Edge, which don't implement\n              // `responseType: \"json\"`.\n              if (!ev.target.responseType && typeof args.extract !== \"function\") response = JSON.parse(ev.target.responseText);\n            } else if (!responseType || responseType === \"text\") {\n              // Only use this default if it's text. If a parsed\n              // document is needed on old IE and friends (all\n              // unsupported), the user should use a custom\n              // `config` instead. They're already using this at\n              // their own risk.\n              if (response == null) response = ev.target.responseText;\n            }\n\n            if (typeof args.extract === \"function\") {\n              response = args.extract(ev.target, args);\n              success = true;\n            } else if (typeof args.deserialize === \"function\") {\n              response = args.deserialize(response);\n            }\n\n            if (success) resolve(response);else {\n              try {\n                message = ev.target.responseText;\n              } catch (e) {\n                message = response;\n              }\n\n              var error = new Error(message);\n              error.code = ev.target.status;\n              error.response = response;\n              reject(error);\n            }\n          } catch (e) {\n            reject(e);\n          }\n        }\n      };\n\n      if (typeof args.config === \"function\") {\n        xhr = args.config(xhr, args, url) || xhr; // Propagate the `abort` to any replacement XHR as well.\n\n        if (xhr !== original) {\n          replacedAbort = xhr.abort;\n\n          xhr.abort = function () {\n            aborted = true;\n            replacedAbort.call(this);\n          };\n        }\n      }\n\n      if (body == null) xhr.send();else if (typeof args.serialize === \"function\") xhr.send(args.serialize(body));else if (body instanceof $window.FormData) xhr.send(body);else xhr.send(JSON.stringify(body));\n    }),\n    jsonp: makeRequest(function (url, args, resolve, reject) {\n      var callbackName = args.callbackName || \"_mithril_\" + Math.round(Math.random() * 1e16) + \"_\" + callbackCount++;\n      var script = $window.document.createElement(\"script\");\n\n      $window[callbackName] = function (data) {\n        delete $window[callbackName];\n        script.parentNode.removeChild(script);\n        resolve(data);\n      };\n\n      script.onerror = function () {\n        delete $window[callbackName];\n        script.parentNode.removeChild(script);\n        reject(new Error(\"JSONP request failed\"));\n      };\n\n      script.src = url + (url.indexOf(\"?\") < 0 ? \"?\" : \"&\") + encodeURIComponent(args.callbackKey || \"callback\") + \"=\" + encodeURIComponent(callbackName);\n      $window.document.documentElement.appendChild(script);\n    })\n  };\n};\n\n},{\"../pathname/build\":11}],27:[function(require,module,exports){\n\"use strict\";\n\nvar mountRedraw = require(\"./mount-redraw\");\n\nmodule.exports = require(\"./api/router\")(window, mountRedraw);\n\n},{\"./api/router\":6,\"./mount-redraw\":9}],28:[function(require,module,exports){\n\"use strict\";\n\n// shim for using process in browser\nvar process = module.exports = {}; // cached from whatever global is present so that test runners that stub it\n// don't break things.  But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals.  It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n  throw new Error('setTimeout has not been defined');\n}\n\nfunction defaultClearTimeout() {\n  throw new Error('clearTimeout has not been defined');\n}\n\n(function () {\n  try {\n    if (typeof setTimeout === 'function') {\n      cachedSetTimeout = setTimeout;\n    } else {\n      cachedSetTimeout = defaultSetTimout;\n    }\n  } catch (e) {\n    cachedSetTimeout = defaultSetTimout;\n  }\n\n  try {\n    if (typeof clearTimeout === 'function') {\n      cachedClearTimeout = clearTimeout;\n    } else {\n      cachedClearTimeout = defaultClearTimeout;\n    }\n  } catch (e) {\n    cachedClearTimeout = defaultClearTimeout;\n  }\n})();\n\nfunction runTimeout(fun) {\n  if (cachedSetTimeout === setTimeout) {\n    //normal enviroments in sane situations\n    return setTimeout(fun, 0);\n  } // if setTimeout wasn't available but was latter defined\n\n\n  if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n    cachedSetTimeout = setTimeout;\n    return setTimeout(fun, 0);\n  }\n\n  try {\n    // when when somebody has screwed with setTimeout but no I.E. maddness\n    return cachedSetTimeout(fun, 0);\n  } catch (e) {\n    try {\n      // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n      return cachedSetTimeout.call(null, fun, 0);\n    } catch (e) {\n      // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n      return cachedSetTimeout.call(this, fun, 0);\n    }\n  }\n}\n\nfunction runClearTimeout(marker) {\n  if (cachedClearTimeout === clearTimeout) {\n    //normal enviroments in sane situations\n    return clearTimeout(marker);\n  } // if clearTimeout wasn't available but was latter defined\n\n\n  if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n    cachedClearTimeout = clearTimeout;\n    return clearTimeout(marker);\n  }\n\n  try {\n    // when when somebody has screwed with setTimeout but no I.E. maddness\n    return cachedClearTimeout(marker);\n  } catch (e) {\n    try {\n      // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally\n      return cachedClearTimeout.call(null, marker);\n    } catch (e) {\n      // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n      // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n      return cachedClearTimeout.call(this, marker);\n    }\n  }\n}\n\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n  if (!draining || !currentQueue) {\n    return;\n  }\n\n  draining = false;\n\n  if (currentQueue.length) {\n    queue = currentQueue.concat(queue);\n  } else {\n    queueIndex = -1;\n  }\n\n  if (queue.length) {\n    drainQueue();\n  }\n}\n\nfunction drainQueue() {\n  if (draining) {\n    return;\n  }\n\n  var timeout = runTimeout(cleanUpNextTick);\n  draining = true;\n  var len = queue.length;\n\n  while (len) {\n    currentQueue = queue;\n    queue = [];\n\n    while (++queueIndex < len) {\n      if (currentQueue) {\n        currentQueue[queueIndex].run();\n      }\n    }\n\n    queueIndex = -1;\n    len = queue.length;\n  }\n\n  currentQueue = null;\n  draining = false;\n  runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n  var args = new Array(arguments.length - 1);\n\n  if (arguments.length > 1) {\n    for (var i = 1; i < arguments.length; i++) {\n      args[i - 1] = arguments[i];\n    }\n  }\n\n  queue.push(new Item(fun, args));\n\n  if (queue.length === 1 && !draining) {\n    runTimeout(drainQueue);\n  }\n}; // v8 likes predictible objects\n\n\nfunction Item(fun, array) {\n  this.fun = fun;\n  this.array = array;\n}\n\nItem.prototype.run = function () {\n  this.fun.apply(null, this.array);\n};\n\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\n\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) {\n  return [];\n};\n\nprocess.binding = function (name) {\n  throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () {\n  return '/';\n};\n\nprocess.chdir = function (dir) {\n  throw new Error('process.chdir is not supported');\n};\n\nprocess.umask = function () {\n  return 0;\n};\n\n},{}],29:[function(require,module,exports){\n(function (setImmediate,clearImmediate){(function (){\n\"use strict\";\n\nvar nextTick = require('process/browser.js').nextTick;\n\nvar apply = Function.prototype.apply;\nvar slice = Array.prototype.slice;\nvar immediateIds = {};\nvar nextImmediateId = 0; // DOM APIs, for completeness\n\nexports.setTimeout = function () {\n  return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);\n};\n\nexports.setInterval = function () {\n  return new Timeout(apply.call(setInterval, window, arguments), clearInterval);\n};\n\nexports.clearTimeout = exports.clearInterval = function (timeout) {\n  timeout.close();\n};\n\nfunction Timeout(id, clearFn) {\n  this._id = id;\n  this._clearFn = clearFn;\n}\n\nTimeout.prototype.unref = Timeout.prototype.ref = function () {};\n\nTimeout.prototype.close = function () {\n  this._clearFn.call(window, this._id);\n}; // Does not start the time, just sets up the members needed.\n\n\nexports.enroll = function (item, msecs) {\n  clearTimeout(item._idleTimeoutId);\n  item._idleTimeout = msecs;\n};\n\nexports.unenroll = function (item) {\n  clearTimeout(item._idleTimeoutId);\n  item._idleTimeout = -1;\n};\n\nexports._unrefActive = exports.active = function (item) {\n  clearTimeout(item._idleTimeoutId);\n  var msecs = item._idleTimeout;\n\n  if (msecs >= 0) {\n    item._idleTimeoutId = setTimeout(function onTimeout() {\n      if (item._onTimeout) item._onTimeout();\n    }, msecs);\n  }\n}; // That's not how node.js implements it but the exposed api is the same.\n\n\nexports.setImmediate = typeof setImmediate === \"function\" ? setImmediate : function (fn) {\n  var id = nextImmediateId++;\n  var args = arguments.length < 2 ? false : slice.call(arguments, 1);\n  immediateIds[id] = true;\n  nextTick(function onNextTick() {\n    if (immediateIds[id]) {\n      // fn.call() is faster so we optimize for the common use-case\n      // @see http://jsperf.com/call-apply-segu\n      if (args) {\n        fn.apply(null, args);\n      } else {\n        fn.call(null);\n      } // Prevent ids from leaking\n\n\n      exports.clearImmediate(id);\n    }\n  });\n  return id;\n};\nexports.clearImmediate = typeof clearImmediate === \"function\" ? clearImmediate : function (id) {\n  delete immediateIds[id];\n};\n\n}).call(this)}).call(this,require(\"timers\").setImmediate,require(\"timers\").clearImmediate)\n},{\"process/browser.js\":28,\"timers\":29}]},{},[4]);\n"],"names":["r","e","n","t","o","i","f","c","require","u","a","Error","code","p","exports","call","length","1","module","i18n","confirmationElements","document","querySelectorAll","element","addEventListener","tagName","confirm","target","getAttribute","confirmation","preventDefault","2","m","qp","mc4wp_ecommerce","state","working","done","action","chooseProcess","value","chooseReset","process","request","method","url","ajaxurl","then","result","getElementById","innerText","console","log","view","onsubmit","type","className","disabled","onclick","trust","reset","processing","mithril","3","mount","ids","tick","window","concat","body","slice","current","results","progress","push","date","Date","messages","running","toggle","statusLabel","parentNode","removeChild","scrollToBottom","vnode","dom","scrollTop","scrollHeight","parentElement","querySelector","toFixed","style","oncreate","onupdate","map","l","toLocaleString","msg","href","evt","forEach","objectIds","JSON","parse","4","QueueProcessor","queueRootElement","./_confirm-attr.js","./_queue-processor.js","./_wizard.js","5","Vnode","render","schedule","subscriptions","rendering","pending","sync","redraw","error","root","component","TypeError","index","indexOf","splice","../render/vnode","6","setImmediate","_typeof","obj","Symbol","iterator","constructor","prototype","Promise","buildPathname","parsePathname","compileTemplate","assign","sentinel","$window","mountRedraw","fireAsync","setPath","path","data","options","title","replace","history","replaceState","route","prefix","pushState","location","attrs","currentPath","_lastUpdate","currentResolver","SKIP","defaultRoute","routes","onremove","compiled","Object","keys","SyntaxError","test","check","callAsync","setTimeout","resolve","scheduled","defaultData","some","ReferenceError","resolveRoute","hash","search","pathname","decodeURIComponent","fail","params","loop","payload","matchedRoute","localComp","update","comp","onmatch","removeEventListener","onbeforeupdate","key","set","get","Link","selector","oninit","onbeforeremove","child","children","Boolean","currentTarget","handleEvent","defaultPrevented","button","which","ctrlKey","metaKey","shiftKey","altKey","param","this","../pathname/assign","../pathname/build","../pathname/compileTemplate","../pathname/parse","../promise/promise","../render/hyperscript","timers","7","hyperscript","fragment","./render/fragment","./render/hyperscript","./render/trust","8","apply","arguments","jsonp","parseQueryString","buildQueryString","PromisePolyfill","./hyperscript","./mount-redraw","./pathname/build","./pathname/parse","./promise/polyfill","./querystring/build","./querystring/parse","./render","./render/vnode","./request","./route","9","requestAnimationFrame","./api/mount-redraw","10","source","11","template","queryIndex","hashIndex","queryEnd","query","resolved","variadic","encodeURIComponent","String","newQueryIndex","newHashIndex","newQueryEnd","querystring","../querystring/build","./assign","12","templateData","templateKeys","regexp","RegExp","extra","k","values","exec","./parse","13","../querystring/parse","14","executor","self","resolvers","rejectors","resolveCurrent","handler","rejectCurrent","instance","_instance","list","shouldAbsorb","execute","retry","executeOnce","bind","runs","run","fn","onerror","onFulfilled","onRejection","resolveNext","rejectNext","handle","callback","next","promise","reject","reason","all","total","count","consume","race","15","global","./polyfill","16","object","toString","args","destructure","Array","isArray","join","17","string","entries","charAt","split","counters","entry","levels","cursor","pop","j","level","nextLevel","isNumber","isNaN","parseInt","desc","getOwnPropertyDescriptor","18","./render/render","19","hyperscriptVnode","tag","normalizeChildren","./hyperscriptVnode","20","selectorParser","selectorCache","hasOwn","hasOwnProperty","isEmpty","hasClass","undefined","newAttrs","text","execSelector","match","classes","id","attrValue","compileSelector","21","start","22","currentRedraw","$doc","nameSpace","svg","math","getNameSpace","xmlns","checkState","original","callHook","activeElement","createNodes","parent","vnodes","end","hooks","nextSibling","ns","createNode","initLifecycle","createTextNode","insertNode","createHTML","createDocumentFragment","firstChild","domSize","childNodes","createFragment","is","createElementNS","createElement","setAttr","setAttrs","maybeSetContentEditable","textContent","normalized","selectedIndex","setLateSelectAttrs","create","$$reentrantLock$$","normalize","initComponent","possibleParents","caption","thead","tbody","tfoot","tr","th","td","colgroup","col","temp","innerHTML","appendChild","updateNodes","old","removeNodes","isOldKeyed","isKeyed","oldStart","v","oe","topSibling","oldEnd","ve","updateNode","getNextSibling","moveNodes","lisIndices","originalNextSibling","vnodesLength","oldIndices","li","pos","matched","oldIndex","getKeyMap","il","lisTemp","makeLisIndices","commonLength","removeNode","oldTag","events","force","shouldNotUpdate","updateLifecycle","nodeValue","updateText","removeHTML","updateFragment","val","isLifecycleMethod","updateStyle","hasPropertyKey","nsLastIndex","removeAttribute","updateEvent","removeAttr","updateAttrs","updateElement","updateComponent","frag","moveChildToFrag","insertBefore","contenteditable","contentEditable","content","stateResult","attrsResult","mask","reallyRemove","attr","setAttributeNS","setAttribute","uppercaseRegex","toLowerCase","capital","normalizeKey","cssText","setProperty","removeProperty","EventDict","_","ev","stopPropagation","active","namespace","namespaceURI","prevRedraw","focus","23","html","24","node","input","25","./promise/promise","./request/request","26","oncompletion","callbackCount","PromiseProxy","makeRequest","factory","background","complete","wrap","hasHeader","name","headers","__proto__","replacedAbort","toUpperCase","assumeJSON","serialize","FormData","responseType","extract","xhr","XMLHttpRequest","aborted","abort","open","async","user","password","setRequestHeader","deserialize","withCredentials","timeout","onreadystatechange","readyState","message","success","status","response","responseText","config","send","stringify","callbackName","Math","round","random","script","src","callbackKey","documentElement","27","./api/router","28","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","defaultClearTimeout","runTimeout","fun","clearTimeout","currentQueue","queue","draining","queueIndex","cleanUpNextTick","drainQueue","len","marker","runClearTimeout","Item","array","noop","nextTick","browser","env","argv","version","versions","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","dir","umask","29","clearImmediate","Function","immediateIds","nextImmediateId","Timeout","clearFn","_id","_clearFn","setInterval","clearInterval","close","unref","ref","enroll","item","msecs","_idleTimeoutId","_idleTimeout","unenroll","_unrefActive","_onTimeout","process/browser.js"],"mappings":"CAAY,SAASA,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIE,EAAE,mBAAmBC,SAASA,QAAQ,IAAIF,GAAGC,EAAE,OAAOA,EAAEF,GAAE,GAAI,GAAGI,EAAE,OAAOA,EAAEJ,GAAE,GAAkD,MAA1CK,EAAE,IAAIC,MAAM,uBAAuBN,EAAE,MAAaO,KAAK,mBAAmBF,EAAMG,EAAEX,EAAEG,GAAG,CAACS,QAAQ,IAAIb,EAAEI,GAAG,GAAGU,KAAKF,EAAEC,QAAQ,SAASd,GAAoB,OAAOI,EAAlBH,EAAEI,GAAG,GAAGL,IAAeA,IAAIa,EAAEA,EAAEC,QAAQd,EAAEC,EAAEC,EAAEC,GAAG,OAAOD,EAAEG,GAAGS,QAAQ,IAAI,IAAIL,EAAE,mBAAmBD,SAASA,QAAQH,EAAE,EAAEA,EAAEF,EAAEa,OAAOX,IAAID,EAAED,EAAEE,IAAI,OAAOD,EAA7b,CAA4c,CAACa,EAAE,CAAC,SAAST,EAAQU,EAAOJ,gBAGxeI,EAAOJ,QAAU,SAAUK,GAGzB,IAFA,IAAIC,EAAuBC,SAASC,iBAAiB,kBAE5CjB,EAAI,EAAGA,EAAIe,EAAqBJ,OAAQX,IAAK,CACpD,IAAIkB,EAAUH,EAAqBf,GACnCkB,EAAQC,iBAAqC,SAApBD,EAAQE,QAAqB,SAAW,QAAS,SAAUxB,GAGlF,QAFWyB,QAAQzB,EAAE0B,OAAOC,aAAa,iBAAmBT,EAAKU,gBAG/D5B,EAAE6B,kBACK,QAQb,IAAIC,EAAE,CAAC,SAASvB,EAAQU,EAAOJ,gBAGjC,IAAIkB,EAAIxB,EAAQ,WAEZyB,EAAK,GACLd,EAAOe,gBAAgBf,KACvBgB,EAAQ,CACVC,SAAS,EACTC,MAAM,EACNC,OAAQ,WAGV,SAASC,EAActC,GACrBkC,EAAMG,OAASrC,EAAE0B,OAAOa,MAG1B,SAASC,EAAYxC,GACfyB,QAAQP,EAAKU,cACfM,EAAMG,OAASrC,EAAE0B,OAAOa,MAExBvC,EAAE6B,iBAIN,SAASY,EAAQzC,GACfA,GAAKA,EAAE6B,iBACPK,EAAMC,SAAU,EAChBD,EAAME,MAAO,EACbL,EAAEW,QAAQ,CACRC,OAAQ,OACRC,IAAKC,QAAU,2BAAkCX,EAAMG,OAAS,WAC/DS,KAAK,SAAUC,GAChBb,EAAME,MAAO,EACbF,EAAMC,SAAU,EAEhBf,SAAS4B,eAAe,uCAAuCC,UAAY,MACnE,MAAE,SAAUjD,GACpBkD,QAAQC,IAAInD,KAIhBgC,EAAGoB,KAAO,WACR,OAAOrB,EAAE,OAAQ,CACfY,OAAQ,OACRU,SAAUZ,GACT,CAACV,EAAE,IAAK,CAACA,EAAE,SAAU,CACtBuB,KAAM,SACNC,UAAW,wBACXhB,MAAO,UACPiB,SAAUtB,EAAMC,SAAWD,EAAME,KACjCqB,QAASnB,GACRJ,EAAME,MAAyB,YAAjBF,EAAMG,OAAuBnB,EAAKkB,KAAOlB,EAAKuB,SAAUV,EAAE2B,MAAM,oBAAqB3B,EAAE,SAAU,CAChHuB,KAAM,SACNC,UAAW,4BACXhB,MAAO,QACPiB,SAAUtB,EAAMC,SAAWD,EAAME,KACjCqB,QAASjB,GACRN,EAAME,MAAyB,UAAjBF,EAAMG,OAAqBnB,EAAKkB,KAAOlB,EAAKyC,SAAUzB,EAAMC,QAAUJ,EAAE,gBAAiB,CAAC,IAAKA,EAAE,qBAAsB,IAAKA,EAAE,OAAQb,EAAK0C,cAAgB,MAG9K3C,EAAOJ,QAAUmB,GAEf,CAAC6B,QAAU,IAAIC,EAAE,CAAC,SAASvD,EAAQU,EAAOJ,gBAGjCoB,gBAAgBf,KAA3B,IAEIa,EAAIxB,EAAQ,WAEhB,SAASE,EAAEsD,EAAOT,EAAMU,GAQX,SAAPC,IACFlC,EAAEW,QAAQ,CACRC,OAAQ,OACRC,IAAKsB,OAAOrB,QAAU,gCAAgCsB,OAAOb,GAC7Dc,KAAMJ,EAAIK,MAAMC,EAASA,EAAU,MAClCxB,KAAK,SAAUyB,GAChBD,GAAWC,EAAQxD,OACnByD,EAAWF,EAAUN,EAAIjD,OAEzBoC,EAAIsB,KAAK,CACPC,KAAM,IAAIC,KACVC,SAAUL,IAGRD,EAAUN,EAAIjD,OAChBkD,IAGA7B,IADAyC,GAAU,KAMH,SAATC,IACFC,EAAYC,WAAWC,YAAYF,IACnCF,GAAWA,IAMXZ,IAGmB,SAAjBiB,EAAyCC,GAC3CA,EAAMC,IAAIC,UAAYF,EAAMC,IAAIE,aA1ClC,IAAIT,GAAU,EACVP,EAAU,EACVE,EAAW,EACXpC,EAAsB,IAAf4B,EAAIjD,OACXoC,EAAM,GACN4B,EAAchB,EAAMwB,cAAcC,cAAc,uBAwCpD,MAAO,CACLpC,KAAM,WACJ,OAAOrB,EAAE,MAAO,CAACA,EAAE,IAAK,CAACA,EAAE,gBAAiB,CAC1C0B,QAASqB,EACTtB,SAAUpB,GACTA,EAAO,YAAcyC,EAAU,OAAS,SAAU,IAAKA,EAAU9C,EAAE,oBAAgC,IAAXyC,GAAgBiB,QAAQ,GAAK,6DAA+DnC,EAAO,KAAO,KAAMvB,EAAE,qBAAsB,CACjO2D,MAAoB,EAAbvC,EAAIpC,OAAa,kBAAoB,kBAC3C,CAACgB,EAAE,cAAe,CACnB2D,MAAO,yCACPC,SAAUT,EACVU,SAAUV,GACT/B,EAAI0C,IAAI,SAAUC,GACnB,OAAO/D,EAAE,qBAAsB,CAACA,EAAE,MAAO,CAACA,EAAE,SAAU+D,EAAEpB,KAAKqB,oBAAqBD,EAAElB,SAASiB,IAAI,SAAUG,GACzG,OAAOjE,EAAE,MAAOiE,UAEfjE,EAAE,IAAK,CAACA,EAAE,IAAK,CAClBkE,KAAM,GACNxC,QAAS,SAAiByC,GACxBA,EAAIrE,iBACJsB,EAAM,KAEP,yBAKT,GAAGgD,QAAQrF,KAAKM,SAASC,iBAAiB,iBAAkB,SAAU0C,GACpE,IAAIT,EAAOS,EAAMpC,aAAa,eAC1ByE,EAAYC,KAAKC,MAAMvC,EAAMpC,aAAa,oBAC9CI,EAAEgC,MAAMA,EAAOtD,EAAEsD,EAAOT,EAAM8C,OAG9B,CAACvC,QAAU,IAAI0C,EAAE,CAAC,SAAShG,EAAQU,EAAOJ,gBAG5C,IAAIkB,EAAIxB,EAAQ,WAEZiG,EAAiBjG,EAAQ,yBAG7BA,EAAQ,qBAARA,GAGAA,EAAQ,gBAGJkG,EAAmBrF,SAAS4B,eAAe,mBAE3CyD,GACF1E,EAAEgC,MAAM0C,EAAkBD,IAG1B,CAACE,qBAAqB,EAAEC,wBAAwB,EAAEC,eAAe,EAAE/C,QAAU,IAAIgD,EAAE,CAAC,SAAStG,EAAQU,EAAOJ,gBAG9G,IAAIiG,EAAQvG,EAAQ,mBAEpBU,EAAOJ,QAAU,SAAUkG,EAAQC,EAAU9D,GAC3C,IAAI+D,EAAgB,GAChBC,GAAY,EACZC,GAAU,EAEd,SAASC,IACP,GAAIF,EAAW,MAAM,IAAIxG,MAAM,+BAC/BwG,GAAY,EAEZ,IAAK,IAAI9G,EAAI,EAAGA,EAAI6G,EAAclG,OAAQX,GAAK,EAC7C,IACE2G,EAAOE,EAAc7G,GAAI0G,EAAMG,EAAc7G,EAAI,IAAKiH,GACtD,MAAOrH,GACPkD,EAAQoE,MAAMtH,GAIlBkH,GAAY,EAGd,SAASG,IACFF,IACHA,GAAU,EACVH,EAAS,WACPG,GAAU,EACVC,OAyBN,OApBAC,EAAOD,KAAOA,EAoBP,CACLrD,MAnBF,SAAewD,EAAMC,GACnB,GAAiB,MAAbA,GAAuC,MAAlBA,EAAUpE,MAAqC,mBAAdoE,EACxD,MAAM,IAAIC,UAAU,gEAGtB,IAAIC,EAAQT,EAAcU,QAAQJ,GAErB,GAATG,IACFT,EAAcW,OAAOF,EAAO,GAC5BX,EAAOQ,EAAM,GAAIF,IAGF,MAAbG,IACFP,EAAcxC,KAAK8C,EAAMC,GACzBT,EAAOQ,EAAMT,EAAMU,GAAYH,KAMjCA,OAAQA,KAIV,CAACQ,kBAAkB,KAAKC,EAAE,CAAC,SAASvH,EAAQU,EAAOJ,IACrD,SAAWkH,IAAc,wBAGzB,SAASC,EAAQC,GAAmV,OAAtOD,EAArD,mBAAXE,QAAoD,iBAApBA,OAAOC,SAAmC,SAAiBF,GAAO,cAAcA,GAA2B,SAAiBA,GAAO,OAAOA,GAAyB,mBAAXC,QAAyBD,EAAIG,cAAgBF,QAAUD,IAAQC,OAAOG,UAAY,gBAAkBJ,IAAyBA,GAEnX,IAAInB,EAAQvG,EAAQ,mBAEhBwB,EAAIxB,EAAQ,yBAEZ+H,EAAU/H,EAAQ,sBAElBgI,EAAgBhI,EAAQ,qBAExBiI,EAAgBjI,EAAQ,qBAExBkI,EAAkBlI,EAAQ,+BAE1BmI,EAASnI,EAAQ,sBAEjBoI,EAAW,GAEf1H,EAAOJ,QAAU,SAAU+H,EAASC,GAClC,IAAIC,EAEJ,SAASC,EAAQC,EAAMC,EAAMC,GAG3B,IAEMhH,EAJN8G,EAAOT,EAAcS,EAAMC,GAEV,MAAbH,GACFA,IACI5G,EAAQgH,EAAUA,EAAQhH,MAAQ,KAClCiH,EAAQD,EAAUA,EAAQC,MAAQ,KAClCD,GAAWA,EAAQE,QAASR,EAAQS,QAAQC,aAAapH,EAAOiH,EAAOI,EAAMC,OAASR,GAAWJ,EAAQS,QAAQI,UAAUvH,EAAOiH,EAAOI,EAAMC,OAASR,IAE5JJ,EAAQc,SAASzD,KAAOsD,EAAMC,OAASR,EAI3C,IACIxB,EACAmC,EACAC,EACAC,EAJAC,EAAkBnB,EAMlBoB,EAAOR,EAAMQ,KAAO,GAExB,SAASR,EAAMhC,EAAMyC,EAAcC,GACjC,GAAY,MAAR1C,EAAc,MAAM,IAAI7G,MAAM,wEAIlC,IAiBIwJ,EAjBAhI,EAAQ,EACRiI,EAAWC,OAAOC,KAAKJ,GAAQpE,IAAI,SAAU0D,GAC/C,GAAiB,MAAbA,EAAM,GAAY,MAAM,IAAIe,YAAY,gCAE5C,GAAI,wBAAwBC,KAAKhB,GAC/B,MAAM,IAAIe,YAAY,wEAGxB,MAAO,CACLf,MAAOA,EACP/B,UAAWyC,EAAOV,GAClBiB,MAAO/B,EAAgBc,MAGvBkB,EAAoC,mBAAjB1C,EAA8BA,EAAe2C,WAChE9J,EAAI0H,EAAQqC,UACZC,GAAY,EAIhB,IAFA9B,EAAY,OAERkB,EAAsB,CACxB,IAAIa,EAAcrC,EAAcwB,GAEhC,IAAKG,EAASW,KAAK,SAAU1K,GAC3B,OAAOA,EAAEoK,MAAMK,KAEf,MAAM,IAAIE,eAAe,gDAI7B,SAASC,IACPJ,GAAY,EAGZ,IAAIpB,EAASZ,EAAQc,SAASuB,KAEN,MAApB1B,EAAMC,OAAO,KACfA,EAASZ,EAAQc,SAASwB,OAAS1B,EAEX,MAApBD,EAAMC,OAAO,IAEG,OADlBA,EAASZ,EAAQc,SAASyB,SAAW3B,GAC1B,KAAYA,EAAS,IAAMA,IAO1C,IAAIR,EAAOQ,EAAOrF,SAASiF,QAAQ,2BAA4BgC,oBAAoB/G,MAAMkF,EAAMC,OAAOzI,QAClGkI,EAAOT,EAAcQ,GAGzB,SAASqC,IACP,GAAIrC,IAASgB,EAAc,MAAM,IAAItJ,MAAM,mCAAqCsJ,GAChFjB,EAAQiB,EAAc,KAAM,CAC1BZ,SAAS,IALbV,EAAOO,EAAKqC,OAAQ1C,EAAQS,QAAQnH,OAWpC,SAASqJ,EAAKnL,GAIZ,KAAOA,EAAI+J,EAASpJ,OAAQX,IAC1B,GAAI+J,EAAS/J,GAAGoK,MAAMvB,GAAO,CAC3B,IAAIuC,EAAUrB,EAAS/J,GAAGoH,UACtBiE,EAAetB,EAAS/J,GAAGmJ,MAC3BmC,EAAYF,EAEZG,EAAS9B,EAAc,SAAoB+B,GAC7C,GAAID,IAAW9B,EAAf,CACA,GAAI+B,IAAS7B,EAAM,OAAOwB,EAAKnL,EAAI,GACnCoH,EAAoB,MAARoE,GAAsC,mBAAdA,EAAKxI,MAAuC,mBAATwI,EAA8B,MAAPA,EAC9FjC,EAAQV,EAAKqC,OAAQ1B,EAAcZ,EAAMa,EAAc,KACvDC,EAAkB0B,EAAQzE,OAASyE,EAAU,KAC/B,IAAVtJ,EAAa2G,EAAYxB,UAC3BnF,EAAQ,EACR2G,EAAYxB,OAAOD,UAevB,YATIoE,EAAQpI,MAA2B,mBAAZoI,GACzBA,EAAU,GACVG,EAAOD,IACEF,EAAQK,QACjBjL,EAAEkC,KAAK,WACL,OAAO0I,EAAQK,QAAQ5C,EAAKqC,OAAQtC,EAAMyC,KACzC3I,KAAK6I,EAAQN,GACXM,EAAO,QAMlBN,IAvCFE,CAAK,GAsEP,OAvBAzC,EAAY,WACL8B,IACHA,GAAY,EACZH,EAAUO,KAI2B,mBAA9BpC,EAAQS,QAAQI,WACzBS,EAAW,WACTtB,EAAQkD,oBAAoB,WAAYhD,GAAW,IAGrDF,EAAQrH,iBAAiB,WAAYuH,GAAW,IACnB,MAApBS,EAAMC,OAAO,KACtBV,EAAY,KAEZoB,EAAW,WACTtB,EAAQkD,oBAAoB,aAAcd,GAAc,IAG1DpC,EAAQrH,iBAAiB,aAAcyJ,GAAc,IAGhDnC,EAAY9E,MAAMwD,EAAM,CAC7BwE,eAAgB,WAEd,UADA7J,EAAQA,EAAQ,EAAI,IACDyG,IAAamB,IAElCnE,SAAUqF,EACVd,SAAUA,EACV9G,KAAM,WACJ,GAAKlB,GAASyG,IAAamB,EAA3B,CAEA,IAAI3E,EAAQ,CAAC2B,EAAMU,EAAWmC,EAAMqC,IAAKrC,IAEzC,OADqBxE,EAAjB2E,EAAyBA,EAAgB/C,OAAO5B,EAAM,IACnDA,MA2Fb,OAtFAoE,EAAM0C,IAAM,SAAUjD,EAAMC,EAAMC,GACb,MAAfW,KACFX,EAAUA,GAAW,IACbE,SAAU,GAGpBS,EAAc,KACdd,EAAQC,EAAMC,EAAMC,IAGtBK,EAAM2C,IAAM,WACV,OAAOtC,GAGTL,EAAMC,OAAS,KACfD,EAAM4C,KAAO,CACX/I,KAAM,SAAc+B,GAClB,IAGI1B,EACAwC,EAJAiD,EAAU/D,EAAMwE,MAAMT,QAEtBS,EAAQ,GAGZjB,EAAOiB,EAAOxE,EAAMwE,OAGpBA,EAAMyC,SAAWzC,EAAMT,QAAUS,EAAMqC,IAAMrC,EAAM0C,OAAS1C,EAAMhE,SAAWgE,EAAMoC,eAAiBpC,EAAM/D,SAAW+D,EAAM2C,eAAiB3C,EAAMO,SAAW,KAIzJqC,EAAQxK,EAAEoD,EAAMwE,MAAMyC,UAAY,IAAKzC,EAAOxE,EAAMqH,UAiDxD,OA1CID,EAAM5C,MAAMnG,SAAWiJ,QAAQF,EAAM5C,MAAMnG,YAC7C+I,EAAM5C,MAAM1D,KAAO,KACnBsG,EAAM5C,MAAM,iBAAmB,OAG/B4C,EAAM5C,MAAMlG,QAAU,OAEtBA,EAAU8I,EAAM5C,MAAMlG,QACtBwC,EAAOsG,EAAM5C,MAAM1D,KACnBsG,EAAM5C,MAAM1D,KAAOsD,EAAMC,OAASvD,EAElCsG,EAAM5C,MAAMlG,QAAU,SAAUzD,GAC9B,IAAI+C,EAEmB,mBAAZU,EACTV,EAASU,EAAQ3C,KAAKd,EAAE0M,cAAe1M,GACnB,MAAXyD,GAAwC,WAArBuE,EAAQvE,IACI,mBAAxBA,EAAQkJ,aACxBlJ,EAAQkJ,YAAY3M,IAaX,IAAX+C,GAAqB/C,EAAE4M,kBACV,IAAb5M,EAAE6M,QAA4B,IAAZ7M,EAAE8M,OAA2B,IAAZ9M,EAAE8M,OACpC9M,EAAE0M,cAAchL,QAAqC,UAA3B1B,EAAE0M,cAAchL,QAC1C1B,EAAE+M,SAAY/M,EAAEgN,SAAYhN,EAAEiN,UAAajN,EAAEkN,SAC5ClN,EAAE6B,iBACF7B,EAAEqH,QAAS,EACXkC,EAAM0C,IAAIhG,EAAM,KAAMiD,MAKrBqD,IAIXhD,EAAM4D,MAAQ,SAAUnB,GACtB,OAAOrC,GAAgB,MAAPqC,EAAcrC,EAAMqC,GAAOrC,GAGtCJ,IAGNzI,KAAKsM,OAAQtM,KAAKsM,KAAK7M,EAAQ,UAAUwH,eAC1C,CAACsF,qBAAqB,GAAGC,oBAAoB,GAAGC,8BAA8B,GAAGC,oBAAoB,GAAGC,qBAAqB,GAAGC,wBAAwB,GAAG7F,kBAAkB,GAAG8F,OAAS,KAAKC,EAAE,CAAC,SAASrN,EAAQU,EAAOJ,gBAG3N,IAAIgN,EAActN,EAAQ,wBAE1BsN,EAAYnK,MAAQnD,EAAQ,kBAC5BsN,EAAYC,SAAWvN,EAAQ,qBAC/BU,EAAOJ,QAAUgN,GAEf,CAACE,oBAAoB,GAAGC,uBAAuB,GAAGC,iBAAiB,KAAKC,EAAE,CAAC,SAAS3N,EAAQU,EAAOJ,gBAS7F,SAAJkB,IACF,OAAO8L,EAAYM,MAAMf,KAAMgB,WAPjC,IAAIP,EAActN,EAAQ,iBAEtBmC,EAAUnC,EAAQ,aAElBsI,EAActI,EAAQ,kBAM1BwB,EAAEA,EAAI8L,EACN9L,EAAE2B,MAAQmK,EAAYnK,MACtB3B,EAAE+L,SAAWD,EAAYC,SACzB/L,EAAEgC,MAAQ8E,EAAY9E,MACtBhC,EAAEwH,MAAQhJ,EAAQ,WAClBwB,EAAEgF,OAASxG,EAAQ,YACnBwB,EAAEsF,OAASwB,EAAYxB,OACvBtF,EAAEW,QAAUA,EAAQA,QACpBX,EAAEsM,MAAQ3L,EAAQ2L,MAClBtM,EAAEuM,iBAAmB/N,EAAQ,uBAC7BwB,EAAEwM,iBAAmBhO,EAAQ,uBAC7BwB,EAAEyG,cAAgBjI,EAAQ,oBAC1BwB,EAAEwG,cAAgBhI,EAAQ,oBAC1BwB,EAAEoD,MAAQ5E,EAAQ,kBAClBwB,EAAEyM,gBAAkBjO,EAAQ,sBAC5BU,EAAOJ,QAAUkB,GAEf,CAAC0M,gBAAgB,EAAEC,iBAAiB,EAAEC,mBAAmB,GAAGC,mBAAmB,GAAGC,qBAAqB,GAAGC,sBAAsB,GAAGC,sBAAsB,GAAGC,WAAW,GAAGC,iBAAiB,GAAGC,YAAY,GAAGC,UAAU,KAAKC,EAAE,CAAC,SAAS7O,EAAQU,EAAOJ,gBAGzP,IAAIkG,EAASxG,EAAQ,YAErBU,EAAOJ,QAAUN,EAAQ,qBAARA,CAA8BwG,EAAQsI,sBAAuBnM,UAE5E,CAACoM,qBAAqB,EAAEN,WAAW,KAAKO,GAAG,CAAC,SAAShP,EAAQU,EAAOJ,gBAGtEI,EAAOJ,QAAUuJ,OAAO1B,QAAU,SAAUhH,EAAQ8N,GAC9CA,GAAQpF,OAAOC,KAAKmF,GAAQrJ,QAAQ,SAAU6F,GAChDtK,EAAOsK,GAAOwD,EAAOxD,OAIvB,IAAIyD,GAAG,CAAC,SAASlP,EAAQU,EAAOJ,gBAGlC,IAAI0N,EAAmBhO,EAAQ,wBAE3BmI,EAASnI,EAAQ,YAGrBU,EAAOJ,QAAU,SAAU6O,EAAUpE,GACnC,GAAI,wBAAwBf,KAAKmF,GAC/B,MAAM,IAAIpF,YAAY,gDAGxB,GAAc,MAAVgB,EAAgB,OAAOoE,EAC3B,IAAIC,EAAaD,EAAS/H,QAAQ,KAC9BiI,EAAYF,EAAS/H,QAAQ,KAC7BkI,EAAWD,EAAY,EAAIF,EAAS3O,OAAS6O,EAE7C5G,EAAO0G,EAASrL,MAAM,EADZsL,EAAa,EAAIE,EAAWF,GAEtCG,EAAQ,GACZpH,EAAOoH,EAAOxE,GACd,IAAIyE,EAAW/G,EAAKI,QAAQ,wBAAyB,SAAUrH,EAAGiK,EAAKgE,GAGrE,cAFOF,EAAM9D,GAEM,MAAfV,EAAOU,GAAqBjK,EAEzBiO,EAAW1E,EAAOU,GAAOiE,mBAAmBC,OAAO5E,EAAOU,OAG/DmE,EAAgBJ,EAASpI,QAAQ,KACjCyI,EAAeL,EAASpI,QAAQ,KAChC0I,EAAcD,EAAe,EAAIL,EAAShP,OAASqP,EAEnDrN,EAASgN,EAAS1L,MAAM,EADX8L,EAAgB,EAAIE,EAAcF,GAEjC,GAAdR,IAAiB5M,GAAU2M,EAASrL,MAAMsL,EAAYE,IACrC,GAAjBM,IAAoBpN,IAAW4M,EAAa,EAAI,IAAM,KAAOI,EAAS1L,MAAM8L,EAAeE,IAC3FC,EAAc/B,EAAiBuB,GAInC,OAHIQ,IAAavN,IAAW4M,EAAa,GAAKQ,EAAgB,EAAI,IAAM,KAAOG,GAC9D,GAAbV,IAAgB7M,GAAU2M,EAASrL,MAAMuL,IACzB,GAAhBQ,IAAmBrN,IAAW6M,EAAY,EAAI,GAAK,KAAOG,EAAS1L,MAAM+L,IACtErN,IAGP,CAACwN,uBAAuB,GAAGC,WAAW,KAAKC,GAAG,CAAC,SAASlQ,EAAQU,EAAOJ,gBAGzE,IAAI2H,EAAgBjI,EAAQ,WAO5BU,EAAOJ,QAAU,SAAU6O,GACzB,IAAIgB,EAAelI,EAAckH,GAC7BiB,EAAevG,OAAOC,KAAKqG,EAAapF,QACxCjB,EAAO,GACPuG,EAAS,IAAIC,OAAO,IAAMH,EAAa1H,KAAKI,QAIhD,qDAAsD,SAAUrH,EAAGiK,EAAK8E,GACtE,OAAW,MAAP9E,EAAoB,KAAOjK,GAC/BsI,EAAK5F,KAAK,CACRsM,EAAG/E,EACHjM,EAAa,QAAV+Q,IAES,QAAVA,EAAwB,OACd,MAAVA,EAAsB,aACnB,WAAaA,GAAS,OAC1B,KACL,OAAO,SAAU7H,GAGf,IAAK,IAAI7I,EAAI,EAAGA,EAAIuQ,EAAa5P,OAAQX,IACvC,GAAIsQ,EAAapF,OAAOqF,EAAavQ,MAAQ6I,EAAKqC,OAAOqF,EAAavQ,IAAK,OAAO,EAIpF,IAAKiK,EAAKtJ,OAAQ,OAAO6P,EAAOrG,KAAKtB,EAAKD,MAC1C,IAAIgI,EAASJ,EAAOK,KAAKhI,EAAKD,MAC9B,GAAc,MAAVgI,EAAgB,OAAO,EAE3B,IAAS5Q,EAAI,EAAGA,EAAIiK,EAAKtJ,OAAQX,IAC/B6I,EAAKqC,OAAOjB,EAAKjK,GAAG2Q,GAAK1G,EAAKjK,GAAGL,EAAIiR,EAAO5Q,EAAI,GAAKgL,mBAAmB4F,EAAO5Q,EAAI,IAGrF,OAAO,KAIT,CAAC8Q,UAAU,KAAKC,GAAG,CAAC,SAAS5Q,EAAQU,EAAOJ,gBAG9C,IAAIyN,EAAmB/N,EAAQ,wBAG/BU,EAAOJ,QAAU,SAAU+B,GACzB,IAAI+M,EAAa/M,EAAI+E,QAAQ,KACzBiI,EAAYhN,EAAI+E,QAAQ,KACxBkI,EAAWD,EAAY,EAAIhN,EAAI7B,OAAS6O,EAExC5G,EAAOpG,EAAIyB,MAAM,EADPsL,EAAa,EAAIE,EAAWF,GACTvG,QAAQ,UAAW,KAKpD,OAJKJ,EAEe,GADGA,EAAL,MAAZA,EAAK,GAAmB,IAAMA,EAC9BA,GAAKjI,QAAwC,MAA1BiI,EAAKA,EAAKjI,OAAS,KAAYiI,EAAOA,EAAK3E,MAAM,GAAI,IAFnE2E,EAAO,IAIX,CACLA,KAAMA,EACNsC,OAAQqE,EAAa,EAAI,GAAKrB,EAAiB1L,EAAIyB,MAAMsL,EAAa,EAAGE,OAI3E,CAACuB,uBAAuB,KAAKC,GAAG,CAAC,SAAS9Q,EAAQU,EAAOJ,IAC3D,SAAWkH,IAAc,wBAIzB,SAASC,EAAQC,GAAmV,OAAtOD,EAArD,mBAAXE,QAAoD,iBAApBA,OAAOC,SAAmC,SAAiBF,GAAO,cAAcA,GAA2B,SAAiBA,GAAO,OAAOA,GAAyB,mBAAXC,QAAyBD,EAAIG,cAAgBF,QAAUD,IAAQC,OAAOG,UAAY,gBAAkBJ,IAAyBA,GAE7V,SAAlBuG,EAA2C8C,GAC7C,KAAMlE,gBAAgBoB,GAAkB,MAAM,IAAI9N,MAAM,qCACxD,GAAwB,mBAAb4Q,EAAyB,MAAM,IAAI7J,UAAU,+BACxD,IAAI8J,EAAOnE,KACPoE,EAAY,GACZC,EAAY,GACZC,EAAiBC,EAAQH,GAAW,GACpCI,EAAgBD,EAAQF,GAAW,GACnCI,EAAWN,EAAKO,UAAY,CAC9BN,UAAWA,EACXC,UAAWA,GAEThH,EAAoC,mBAAjB1C,EAA8BA,EAAe2C,WAEpE,SAASiH,EAAQI,EAAMC,GACrB,OAAO,SAASC,EAAQ1P,GACtB,IAAIO,EAEJ,IACE,IAAIkP,GAAyB,MAATzP,GAAqC,WAAnByF,EAAQzF,IAAwC,mBAAVA,GAAwD,mBAAvBO,EAAOP,EAAMO,MAIxH2H,EAAU,WACHuH,GAAgC,IAAhBD,EAAKhR,QAAcmC,QAAQoE,MAAM,wCAAyC/E,GAE/F,IAAK,IAAInC,EAAI,EAAGA,EAAI2R,EAAKhR,OAAQX,IAC/B2R,EAAK3R,GAAGmC,GAGViP,EAAUzQ,OAAS,EAAG0Q,EAAU1Q,OAAS,EACzC8Q,EAAS3P,MAAQ8P,EAEjBH,EAASK,MAAQ,WACfD,EAAQ1P,UAfkI,CAC9I,GAAIA,IAAUgP,EAAM,MAAM,IAAI9J,UAAU,uCACxC0K,EAAYrP,EAAKsP,KAAK7P,KAiBxB,MAAOvC,GACP4R,EAAc5R,KAKpB,SAASmS,EAAYrP,GACnB,IAAIuP,EAAO,EAEX,SAASC,EAAIC,GACX,OAAO,SAAUhQ,GACF,EAAT8P,KACJE,EAAGhQ,IAIP,IAAIiQ,EAAUF,EAAIV,GAElB,IACE9O,EAAKwP,EAAIZ,GAAiBc,GAC1B,MAAOxS,GACPwS,EAAQxS,IAIZmS,EAAYb,GAGd9C,EAAgBnG,UAAUvF,KAAO,SAAU2P,EAAaC,GACtD,IAcIC,EAAaC,EAbbf,EADOzE,KACS0E,UAEpB,SAASe,EAAOC,EAAUf,EAAMgB,EAAM7Q,GACpC6P,EAAKtN,KAAK,SAAUlC,GAClB,GAAwB,mBAAbuQ,EAAyBC,EAAKxQ,QAAY,IACnDoQ,EAAYG,EAASvQ,IACrB,MAAOvC,GACH4S,GAAYA,EAAW5S,MAGD,mBAAnB6R,EAASK,OAAwBhQ,IAAU2P,EAAS3P,OAAO2P,EAASK,QAIjF,IAAIc,EAAU,IAAIxE,EAAgB,SAAU7D,EAASsI,GACnDN,EAAchI,EAASiI,EAAaK,IAGtC,OADAJ,EAAOJ,EAAaZ,EAASL,UAAWmB,GAAa,GAAOE,EAAOH,EAAab,EAASJ,UAAWmB,GAAY,GACzGI,GAGTxE,EAAgBnG,UAAiB,MAAI,SAAUqK,GAC7C,OAAOtF,KAAKtK,KAAK,KAAM4P,IAGzBlE,EAAgBnG,UAAmB,QAAI,SAAUyK,GAC/C,OAAO1F,KAAKtK,KAAK,SAAUP,GACzB,OAAOiM,EAAgB7D,QAAQmI,KAAYhQ,KAAK,WAC9C,OAAOP,KAER,SAAU2Q,GACX,OAAO1E,EAAgB7D,QAAQmI,KAAYhQ,KAAK,WAC9C,OAAO0L,EAAgByE,OAAOC,QAKpC1E,EAAgB7D,QAAU,SAAUpI,GAClC,OAAIA,aAAiBiM,EAAwBjM,EACtC,IAAIiM,EAAgB,SAAU7D,GACnCA,EAAQpI,MAIZiM,EAAgByE,OAAS,SAAU1Q,GACjC,OAAO,IAAIiM,EAAgB,SAAU7D,EAASsI,GAC5CA,EAAO1Q,MAIXiM,EAAgB2E,IAAM,SAAUpB,GAC9B,OAAO,IAAIvD,EAAgB,SAAU7D,EAASsI,GAC5C,IAAIG,EAAQrB,EAAKhR,OACbsS,EAAQ,EACRrC,EAAS,GACb,GAAoB,IAAhBe,EAAKhR,OAAc4J,EAAQ,SAAS,IAAK,IAAIvK,EAAI,EAAGA,EAAI2R,EAAKhR,OAAQX,KACvE,SAAWA,GACT,SAASkT,EAAQ/Q,GACf8Q,IACArC,EAAO5Q,GAAKmC,EACR8Q,IAAUD,GAAOzI,EAAQqG,GAGhB,MAAXe,EAAK3R,IAAoC,WAArB4H,EAAQ+J,EAAK3R,KAAuC,mBAAZ2R,EAAK3R,IAA8C,mBAAjB2R,EAAK3R,GAAG0C,KAEnGwQ,EAAQvB,EAAK3R,IADlB2R,EAAK3R,GAAG0C,KAAKwQ,EAASL,GAR1B,CAUG7S,MAKToO,EAAgB+E,KAAO,SAAUxB,GAC/B,OAAO,IAAIvD,EAAgB,SAAU7D,EAASsI,GAC5C,IAAK,IAAI7S,EAAI,EAAGA,EAAI2R,EAAKhR,OAAQX,IAC/B2R,EAAK3R,GAAG0C,KAAK6H,EAASsI,MAK5BhS,EAAOJ,QAAU2N,GAEd1N,KAAKsM,OAAQtM,KAAKsM,KAAK7M,EAAQ,UAAUwH,eAC1C,CAAC4F,OAAS,KAAK6F,GAAG,CAAC,SAASjT,EAAQU,EAAOJ,IAC7C,SAAW4S,IAAQ,wBAGnB,IAAIjF,EAAkBjO,EAAQ,cAER,oBAAX2D,aACqB,IAAnBA,OAAOoE,QAChBpE,OAAOoE,QAAUkG,EACPtK,OAAOoE,QAAQD,UAAmB,UAC5CnE,OAAOoE,QAAQD,UAAmB,QAAImG,EAAgBnG,UAAmB,SAG3EpH,EAAOJ,QAAUqD,OAAOoE,cACG,IAAXmL,QACc,IAAnBA,EAAOnL,QAChBmL,EAAOnL,QAAUkG,EACPiF,EAAOnL,QAAQD,UAAmB,UAC5CoL,EAAOnL,QAAQD,UAAmB,QAAImG,EAAgBnG,UAAmB,SAG3EpH,EAAOJ,QAAU4S,EAAOnL,SAExBrH,EAAOJ,QAAU2N,GAGhB1N,KAAKsM,OAAQtM,KAAKsM,KAAuB,oBAAXqG,OAAyBA,OAAyB,oBAATlC,KAAuBA,KAAyB,oBAAXrN,OAAyBA,OAAS,KAC/I,CAACwP,aAAa,KAAKC,GAAG,CAAC,SAASpT,EAAQU,EAAOJ,gBAGjDI,EAAOJ,QAAU,SAAU+S,GACzB,GAA+C,oBAA3CxJ,OAAO/B,UAAUwL,SAAS/S,KAAK8S,GAA+B,MAAO,GACzE,IAES5H,EAFL8H,EAAO,GAEX,IAAS9H,KAAO4H,GAMhB,SAASG,EAAY/H,EAAKzJ,GACxB,GAAIyR,MAAMC,QAAQ1R,GAChB,IAAK,IAAInC,EAAI,EAAGA,EAAImC,EAAMxB,OAAQX,IAChC2T,EAAY/H,EAAM,IAAM5L,EAAI,IAAKmC,EAAMnC,SAEpC,GAA8C,oBAA1CgK,OAAO/B,UAAUwL,SAAS/S,KAAKyB,GACxC,IAAK,IAAInC,KAAKmC,EACZwR,EAAY/H,EAAM,IAAM5L,EAAI,IAAKmC,EAAMnC,SAEpC0T,EAAKrP,KAAKwL,mBAAmBjE,IAAiB,MAATzJ,GAA2B,KAAVA,EAAe,IAAM0N,mBAAmB1N,GAAS,KAd9GwR,CAAY/H,EAAK4H,EAAO5H,IAG1B,OAAO8H,EAAKI,KAAK,OAejB,IAAIC,GAAG,CAAC,SAAS5T,EAAQU,EAAOJ,gBAGlCI,EAAOJ,QAAU,SAAUuT,GACzB,GAAe,KAAXA,GAA2B,MAAVA,EAAgB,MAAO,GAM5C,IAJA,IAAIC,GAD0BD,EAAL,MAArBA,EAAOE,OAAO,GAAqBF,EAAO/P,MAAM,GACtC+P,GAAOG,MAAM,KACvBC,EAAW,GACXvL,EAAO,GAEF7I,EAAI,EAAGA,EAAIiU,EAAQtT,OAAQX,IAAK,CACvC,IAAIqU,EAAQJ,EAAQjU,GAAGmU,MAAM,KACzBvI,EAAMZ,mBAAmBqJ,EAAM,IAC/BlS,EAAyB,IAAjBkS,EAAM1T,OAAeqK,mBAAmBqJ,EAAM,IAAM,GAClD,SAAVlS,EAAkBA,GAAQ,EAAwB,UAAVA,IAAmBA,GAAQ,GACvE,IAAImS,EAAS1I,EAAIuI,MAAM,YACnBI,EAAS1L,GACW,EAApB+C,EAAIrE,QAAQ,MAAW+M,EAAOE,MAElC,IAAK,IAAIC,EAAI,EAAGA,EAAIH,EAAO3T,OAAQ8T,IAAK,CACtC,IAAIC,EAAQJ,EAAOG,GACfE,EAAYL,EAAOG,EAAI,GACvBG,EAAwB,IAAbD,IAAoBE,MAAMC,SAASH,EAAW,KAE7D,GAAc,KAAVD,EAGmB,MAAjBN,EAFAxI,EAAM0I,EAAOrQ,MAAM,EAAGwQ,GAAGX,UAG3BM,EAASxI,GAAOgI,MAAMC,QAAQU,GAAUA,EAAO5T,OAAS,GAG1D+T,EAAQN,EAASxI,UAEd,GAAc,cAAV8I,EAAuB,MAE5BD,IAAMH,EAAO3T,OAAS,EAAG4T,EAAOG,GAASvS,GAK/B,OADM4S,EAAN,OADRA,EAAO/K,OAAOgL,yBAAyBT,EAAQG,IAC1BK,EAAK5S,MAC1B4S,KAAcR,EAAOG,GAASK,EAAOH,EAAW,GAAK,IACzDL,EAASQ,IAKf,OAAOlM,IAGP,IAAIoM,GAAG,CAAC,SAAS9U,EAAQU,EAAOJ,gBAGlCI,EAAOJ,QAAUN,EAAQ,kBAARA,CAA2B2D,SAE1C,CAACoR,kBAAkB,KAAKC,GAAG,CAAC,SAAShV,EAAQU,EAAOJ,gBAGtD,IAAIiG,EAAQvG,EAAQ,mBAEhBiV,EAAmBjV,EAAQ,sBAE/BU,EAAOJ,QAAU,WACf,IAAIsE,EAAQqQ,EAAiBrH,MAAM,EAAGC,WAGtC,OAFAjJ,EAAMsQ,IAAM,IACZtQ,EAAMqH,SAAW1F,EAAM4O,kBAAkBvQ,EAAMqH,UACxCrH,IAGP,CAAC0C,kBAAkB,GAAG8N,qBAAqB,KAAKC,GAAG,CAAC,SAASrV,EAAQU,EAAOJ,gBAG9E,IAAIiG,EAAQvG,EAAQ,mBAEhBiV,EAAmBjV,EAAQ,sBAE3BsV,EAAiB,+EACjBC,EAAgB,GAChBC,EAAS,GAAGC,eAEhB,SAASC,EAAQrC,GACf,IAAK,IAAI5H,KAAO4H,EACd,GAAImC,EAAOjV,KAAK8S,EAAQ5H,GAAM,OAGhC,OAAO,EAsFT/K,EAAOJ,QAhBP,SAAqBuL,GACnB,GAAgB,MAAZA,GAAwC,iBAAbA,GAA6C,mBAAbA,GAAoD,mBAAlBA,EAAShJ,KACxG,MAAM1C,MAAM,wDAGd,IAAIyE,EAAQqQ,EAAiBrH,MAAM,EAAGC,WAEtC,MAAwB,iBAAbhC,IACTjH,EAAMqH,SAAW1F,EAAM4O,kBAAkBvQ,EAAMqH,UAC9B,MAAbJ,GArDR,SAAsBlK,EAAOiD,GAC3B,IAAIwE,EAAQxE,EAAMwE,MACd6C,EAAW1F,EAAM4O,kBAAkBvQ,EAAMqH,UACzC0J,EAAWH,EAAOjV,KAAK6I,EAAO,SAC9BpG,EAAY2S,EAAWvM,EAAa,MAAIA,EAAMpG,UAKlD,GAJA4B,EAAMsQ,IAAMvT,EAAMuT,IAClBtQ,EAAMwE,MAAQ,KACdxE,EAAMqH,cAAW2J,GAEZF,EAAQ/T,EAAMyH,SAAWsM,EAAQtM,GAAQ,CAC5C,IAESqC,EAFLoK,EAAW,GAEf,IAASpK,KAAOrC,EACVoM,EAAOjV,KAAK6I,EAAOqC,KAAMoK,EAASpK,GAAOrC,EAAMqC,IAGrDrC,EAAQyM,EAGV,IAASpK,KAAO9J,EAAMyH,MAChBoM,EAAOjV,KAAKoB,EAAMyH,MAAOqC,IAAgB,cAARA,IAAwB+J,EAAOjV,KAAK6I,EAAOqC,KAC9ErC,EAAMqC,GAAO9J,EAAMyH,MAAMqC,IAO7B,IAASA,KAHQ,MAAbzI,GAA8C,MAAzBrB,EAAMyH,MAAMpG,YAAmBoG,EAAMpG,UAAyB,MAAbA,EAA6C,MAAzBrB,EAAMyH,MAAMpG,UAAoB2M,OAAOhO,EAAMyH,MAAMpG,WAAa,IAAM2M,OAAO3M,GAAaA,EAAqC,MAAzBrB,EAAMyH,MAAMpG,UAAoBrB,EAAMyH,MAAMpG,UAAY,MACxP2S,IAAUvM,EAAa,MAAI,MAEfA,EACd,GAAIoM,EAAOjV,KAAK6I,EAAOqC,IAAgB,QAARA,EAAe,CAC5C7G,EAAMwE,MAAQA,EACd,MAUJ,OANIqK,MAAMC,QAAQzH,IAAiC,IAApBA,EAASzL,QAA+B,MAAfyL,EAAS,IAAkC,MAApBA,EAAS,GAAGiJ,IACzFtQ,EAAMkR,KAAO7J,EAAS,GAAGA,SAEzBrH,EAAMqH,SAAWA,EAGZrH,EAYwBmR,CAAaR,EAAc1J,IA5E5D,SAAyBA,GAMvB,IALA,IAAImK,EACAd,EAAM,MACNe,EAAU,GACV7M,EAAQ,GAEL4M,EAAQV,EAAe5E,KAAK7E,IAAW,CAC5C,IAAI9I,EAAOiT,EAAM,GACbhU,EAAQgU,EAAM,GACL,KAATjT,GAAyB,KAAVf,EAAckT,EAAMlT,EAAwB,MAATe,EAAcqG,EAAM8M,GAAKlU,EAAwB,MAATe,EAAckT,EAAQ/R,KAAKlC,GAAgC,MAAhBgU,EAAM,GAAG,KAEjIG,GADXA,EAAYH,EAAM,KACKG,EAAUtN,QAAQ,YAAa,MAAMA,QAAQ,QAAS,MAChE,UAAbmN,EAAM,GAAgBC,EAAQ/R,KAAKiS,GAAgB/M,EAAM4M,EAAM,IAAoB,KAAdG,EAAmBA,EAAYA,IAAa,GAKzH,OADqB,EAAjBF,EAAQzV,SAAY4I,EAAMpG,UAAYiT,EAAQtC,KAAK,MAChD4B,EAAc1J,GAAY,CAC/BqJ,IAAKA,EACL9L,MAAOA,GAyD8DgN,CAAgBvK,GAAWjH,IAGlGA,EAAMsQ,IAAMrJ,EACLjH,KAKP,CAAC0C,kBAAkB,GAAG8N,qBAAqB,KAAKiB,GAAG,CAAC,SAASrW,EAAQU,EAAOJ,gBAG9E,SAASmH,EAAQC,GAAmV,OAAtOD,EAArD,mBAAXE,QAAoD,iBAApBA,OAAOC,SAAmC,SAAiBF,GAAO,cAAcA,GAA2B,SAAiBA,GAAO,OAAOA,GAAyB,mBAAXC,QAAyBD,EAAIG,cAAgBF,QAAUD,IAAQC,OAAOG,UAAY,gBAAkBJ,IAAyBA,GAEnX,IAAInB,EAAQvG,EAAQ,mBA+BpBU,EAAOJ,QAAU,WACf,IAEI2L,EAFA7C,EAAQyE,UAAUhB,MAClByJ,EAAQzJ,KAAO,EAUnB,GAPa,MAATzD,EACFA,EAAQ,GACoB,WAAnB3B,EAAQ2B,IAAoC,MAAbA,EAAM8L,MAAezB,MAAMC,QAAQtK,KAC3EA,EAAQ,GACRkN,EAAQzJ,MAGNgB,UAAUrN,SAAW8V,EAAQ,EAC/BrK,EAAW4B,UAAUyI,GAChB7C,MAAMC,QAAQzH,KAAWA,EAAW,CAACA,SAI1C,IAFAA,EAAW,GAEJqK,EAAQzI,UAAUrN,QACvByL,EAAS/H,KAAK2J,UAAUyI,MAI5B,OAAO/P,EAAM,GAAI6C,EAAMqC,IAAKrC,EAAO6C,KAGnC,CAAC3E,kBAAkB,KAAKiP,GAAG,CAAC,SAASvW,EAAQU,EAAOJ,gBAGtD,SAASmH,EAAQC,GAAmV,OAAtOD,EAArD,mBAAXE,QAAoD,iBAApBA,OAAOC,SAAmC,SAAiBF,GAAO,cAAcA,GAA2B,SAAiBA,GAAO,OAAOA,GAAyB,mBAAXC,QAAyBD,EAAIG,cAAgBF,QAAUD,IAAQC,OAAOG,UAAY,gBAAkBJ,IAAyBA,GAEnX,IAAInB,EAAQvG,EAAQ,mBAEpBU,EAAOJ,QAAU,SAAU+H,GACzB,IACImO,EADAC,EAAOpO,GAAWA,EAAQxH,SAE1B6V,EAAY,CACdC,IAAK,6BACLC,KAAM,sCAGR,SAASC,EAAajS,GACpB,OAAOA,EAAMwE,OAASxE,EAAMwE,MAAM0N,OAASJ,EAAU9R,EAAMsQ,KAI7D,SAAS6B,EAAWnS,EAAOoS,GACzB,GAAIpS,EAAMjD,QAAUqV,EAAU,MAAM,IAAI7W,MAAM,sCAOhD,SAAS8W,EAASrS,GAChB,IAAIoS,EAAWpS,EAAMjD,MAErB,IACE,OAAOkL,KAAKe,MAAMoJ,EAAUnJ,WAC5B,QACAkJ,EAAWnS,EAAOoS,IAMtB,SAASE,IACP,IACE,OAAOT,EAAKS,cACZ,MAAOzX,GACP,OAAO,MAKX,SAAS0X,EAAYC,EAAQC,EAAQf,EAAOgB,EAAKC,EAAOC,EAAaC,GACnE,IAAK,IAAI5X,EAAIyW,EAAOzW,EAAIyX,EAAKzX,IAAK,CAChC,IAAI+E,EAAQyS,EAAOxX,GAEN,MAAT+E,GACF8S,EAAWN,EAAQxS,EAAO2S,EAAOE,EAAID,IAK3C,SAASE,EAAWN,EAAQxS,EAAO2S,EAAOE,EAAID,GAC5C,IA4IuBJ,EAAQxS,EAAc6S,EAAID,EAnH/BJ,EAAQxS,EAAO4S,EAzB7BtC,EAAMtQ,EAAMsQ,IAEhB,GAAmB,iBAARA,EAIT,OAHAtQ,EAAMjD,MAAQ,GACK,MAAfiD,EAAMwE,OAAeuO,EAAc/S,EAAMwE,MAAOxE,EAAO2S,GAEnDrC,GACN,IAAK,IAkBSkC,EAjBDA,EAiBgBI,EAjBDA,GAiBN5S,EAjBDA,GAkBnBC,IAAM4R,EAAKmB,eAAehT,EAAMqH,UACtC4L,EAAWT,EAAQxS,EAAMC,IAAK2S,GAlBxB,MAEF,IAAK,IACHM,EAAWV,EAAQxS,EAAO6S,EAAID,GAC9B,MAEF,IAAK,KA0DX,SAAwBJ,EAAQxS,EAAO2S,EAAOE,EAAID,GAChD,IAAIjK,EAAWkJ,EAAKsB,yBAEpB,CAAA,IACM9L,EADgB,MAAlBrH,EAAMqH,WACJA,EAAWrH,EAAMqH,SACrBkL,EAAY5J,EAAUtB,EAAU,EAAGA,EAASzL,OAAQ+W,EAAO,KAAME,IAGnE7S,EAAMC,IAAM0I,EAASyK,WACrBpT,EAAMqT,QAAU1K,EAAS2K,WAAW1X,OACpCqX,EAAWT,EAAQ7J,EAAUiK,GAnEvBW,CAAef,EAAQxS,EAAO2S,EAAOE,EAAID,GACzC,MAEF,SAmEN,SAAuBJ,EAAQxS,EAAO2S,EAAOE,EAAID,GAC/C,IAAItC,EAAMtQ,EAAMsQ,IACZ9L,EAAQxE,EAAMwE,MACdgP,EAAKhP,GAASA,EAAMgP,GAEpBrX,GADJ0W,EAAKZ,EAAajS,IAAU6S,GACTW,EAAK3B,EAAK4B,gBAAgBZ,EAAIvC,EAAK,CACpDkD,GAAIA,IACD3B,EAAK4B,gBAAgBZ,EAAIvC,GAAOkD,EAAK3B,EAAK6B,cAAcpD,EAAK,CAChEkD,GAAIA,IACD3B,EAAK6B,cAAcpD,GACxBtQ,EAAMC,IAAM9D,EAEC,MAATqI,GAwrBN,SAAkBxE,EAAOwE,EAAOqO,GAC9B,IAAK,IAAIhM,KAAOrC,EACdmP,EAAQ3T,EAAO6G,EAAK,KAAMrC,EAAMqC,GAAMgM,GAzrBtCe,CAAS5T,EAAOwE,EAAOqO,GAGzBI,EAAWT,EAAQrW,EAASyW,GAEvBiB,EAAwB7T,KACT,MAAdA,EAAMkR,OACW,KAAflR,EAAMkR,KAAa/U,EAAQ2X,YAAc9T,EAAMkR,KAAUlR,EAAMqH,SAAW,CAAC1F,EAAM,SAAKqP,OAAWA,EAAWhR,EAAMkR,UAAMF,OAAWA,KAGnH,MAAlBhR,EAAMqH,WACJA,EAAWrH,EAAMqH,SACrBkL,EAAYpW,EAASkL,EAAU,EAAGA,EAASzL,OAAQ+W,EAAO,KAAME,GAC9C,WAAd7S,EAAMsQ,KAA6B,MAAT9L,GAqtBpC,SAA4BxE,EAAOwE,GACjC,CAAA,IAIQuP,EAJJ,UAAWvP,IACO,OAAhBA,EAAMpH,OACyB,IAA7B4C,EAAMC,IAAI+T,gBAAsBhU,EAAMC,IAAI7C,MAAQ,OAElD2W,EAAa,GAAKvP,EAAMpH,MAExB4C,EAAMC,IAAI7C,QAAU2W,IAA2C,IAA7B/T,EAAMC,IAAI+T,gBAC9ChU,EAAMC,IAAI7C,MAAQ2W,KAKpB,kBAAmBvP,GAAOmP,EAAQ3T,EAAO,gBAAiB,KAAMwE,EAAMwP,mBAAehD,GAluBxCiD,CAAmBjU,EAAOwE,KA5FrEkP,CAAclB,EAAQxS,EAAO2S,EAAOE,EAAID,QAwHvBJ,EAtHAA,EAsHsBK,EAtHAA,EAsHID,EAtHAA,EA+FnD,SAAuB5S,EAAO2S,GAC5B,IAAInP,EAEJ,GAA8B,mBAAnBxD,EAAMsQ,IAAIrS,KAAqB,CAGxC,GAFA+B,EAAMjD,MAAQkI,OAAOiP,OAAOlU,EAAMsQ,KAEA,OADlC9M,EAAWxD,EAAMjD,MAAMkB,MACVkW,kBAA2B,OACxC3Q,EAAS2Q,mBAAoB,MACxB,CAGL,GAFAnU,EAAMjD,WAAQ,EAEoB,OADlCyG,EAAWxD,EAAMsQ,KACJ6D,kBAA2B,OACxC3Q,EAAS2Q,mBAAoB,EAC7BnU,EAAMjD,MAA+B,MAAvBiD,EAAMsQ,IAAIpN,WAAyD,mBAA7BlD,EAAMsQ,IAAIpN,UAAUjF,KAAsB,IAAI+B,EAAMsQ,IAAItQ,GAASA,EAAMsQ,IAAItQ,GAGjI+S,EAAc/S,EAAMjD,MAAOiD,EAAO2S,GACf,MAAf3S,EAAMwE,OAAeuO,EAAc/S,EAAMwE,MAAOxE,EAAO2S,GAE3D,GADA3S,EAAM0M,SAAW/K,EAAMyS,UAAU/B,EAAS1W,KAAKqE,EAAMjD,MAAMkB,KAAM+B,IAC7DA,EAAM0M,WAAa1M,EAAO,MAAMzE,MAAM,0DAC1CiI,EAAS2Q,kBAAoB,KAI7BE,CAD+BrU,EAtHAA,EAsHO2S,EAtHAA,GAyHhB,MAAlB3S,EAAM0M,UACRoG,EAAWN,EAAQxS,EAAM0M,SAAUiG,EAAOE,EAAID,GAC9C5S,EAAMC,IAAMD,EAAM0M,SAASzM,IAC3BD,EAAMqT,QAAuB,MAAbrT,EAAMC,IAAcD,EAAM0M,SAAS2G,QAAU,GAE7DrT,EAAMqT,QAAU,EAtHpB,IAAIiB,EAAkB,CACpBC,QAAS,QACTC,MAAO,QACPC,MAAO,QACPC,MAAO,QACPC,GAAI,QACJC,GAAI,KACJC,GAAI,KACJC,SAAU,QACVC,IAAK,YAGP,SAAS7B,EAAWV,EAAQxS,EAAO6S,EAAID,GACrC,IAAIxB,EAAQpR,EAAMqH,SAAS+J,MAAM,kBAAoB,GAMjD4D,EAAOnD,EAAK6B,cAAcY,EAAgBlD,EAAM,KAAO,OAEhD,+BAAPyB,GACFmC,EAAKC,UAAY,2CAA+CjV,EAAMqH,SAAW,SACjF2N,EAAOA,EAAK5B,YAEZ4B,EAAKC,UAAYjV,EAAMqH,SAGzBrH,EAAMC,IAAM+U,EAAK5B,WACjBpT,EAAMqT,QAAU2B,EAAK1B,WAAW1X,OAEhCoE,EAAM0M,SAAW,GAIjB,IAHA,IACItF,EADAuB,EAAWkJ,EAAKsB,yBAGb/L,EAAQ4N,EAAK5B,YAClBpT,EAAM0M,SAASpN,KAAK8H,GACpBuB,EAASuM,YAAY9N,GAGvB6L,EAAWT,EAAQ7J,EAAUiK,GAsL/B,SAASuC,EAAY3C,EAAQ4C,EAAK3C,EAAQE,EAAOC,EAAaC,GAC5D,GAAIuC,IAAQ3C,IAAiB,MAAP2C,GAAyB,MAAV3C,GAA4B,GAAW,MAAP2C,GAA8B,IAAfA,EAAIxZ,OAAc2W,EAAYC,EAAQC,EAAQ,EAAGA,EAAO7W,OAAQ+W,EAAOC,EAAaC,QAAS,GAAc,MAAVJ,GAAoC,IAAlBA,EAAO7W,OAAcyZ,EAAY7C,EAAQ4C,EAAK,EAAGA,EAAIxZ,YAAa,CACvQ,IAAI0Z,EAAuB,MAAVF,EAAI,IAA4B,MAAdA,EAAI,GAAGvO,IACtC0O,EAAuB,MAAb9C,EAAO,IAA+B,MAAjBA,EAAO,GAAG5L,IACzC6K,EAAQ,EACR8D,EAAW,EACf,IAAKF,EAAY,KAAOE,EAAWJ,EAAIxZ,QAA2B,MAAjBwZ,EAAII,IACnDA,IAEF,IAAKD,EAAS,KAAO7D,EAAQe,EAAO7W,QAA2B,MAAjB6W,EAAOf,IACnDA,IAEF,GAAgB,OAAZ6D,GAAkC,MAAdD,EAExB,GAAIA,GAAeC,EACjBF,EAAY7C,EAAQ4C,EAAKI,EAAUJ,EAAIxZ,QACvC2W,EAAYC,EAAQC,EAAQf,EAAOe,EAAO7W,OAAQ+W,EAAOC,EAAaC,QACjE,GAAK0C,EAgBL,CAWL,IATA,IAGIva,EACAya,EACAC,EAEAC,EAPAC,EAASR,EAAIxZ,OAAS,EACtB8W,EAAMD,EAAO7W,OAAS,EAQT4Z,GAAVI,GAA6BlE,GAAPgB,IAC3BgD,EAAKN,EAAIQ,GACTC,EAAKpD,EAAOC,GACRgD,EAAG7O,MAAQgP,EAAGhP,MACd6O,IAAOG,GAAIC,EAAWtD,EAAQkD,EAAIG,EAAIlD,EAAOC,EAAaC,GAChD,MAAVgD,EAAG5V,MAAa2S,EAAciD,EAAG5V,KACrC2V,IAAUlD,IAIZ,KAAiB8C,GAAVI,GAA6BlE,GAAPgB,IAC3B1X,EAAIoa,EAAII,GACRC,EAAIhD,EAAOf,GACP1W,EAAE6L,MAAQ4O,EAAE5O,MAChB2O,IAAY9D,IACR1W,IAAMya,GAAGK,EAAWtD,EAAQxX,EAAGya,EAAG9C,EAAOoD,EAAeX,EAAKI,EAAU5C,GAAcC,GAI3F,KAAiB2C,GAAVI,GAA6BlE,GAAPgB,GACvBhB,IAAUgB,GACV1X,EAAE6L,MAAQgP,EAAGhP,KAAO6O,EAAG7O,MAAQ4O,EAAE5O,KAErCmP,EAAUxD,EAAQkD,EADlBC,EAAaI,EAAeX,EAAKI,EAAU5C,IAEvC8C,IAAOD,GAAGK,EAAWtD,EAAQkD,EAAID,EAAG9C,EAAOgD,EAAY9C,KACrDnB,KAAWgB,GAAKsD,EAAUxD,EAAQxX,EAAG4X,GACvC5X,IAAM6a,GAAIC,EAAWtD,EAAQxX,EAAG6a,EAAIlD,EAAOC,EAAaC,GAC9C,MAAVgD,EAAG5V,MAAa2S,EAAciD,EAAG5V,KAGrCyV,EAAKN,IADLQ,GAEAC,EAAKpD,EAAOC,GACZ1X,EAAIoa,IAJJI,GAKAC,EAAIhD,EAAOf,GAIb,KAAiB8D,GAAVI,GAA6BlE,GAAPgB,GACvBgD,EAAG7O,MAAQgP,EAAGhP,KACd6O,IAAOG,GAAIC,EAAWtD,EAAQkD,EAAIG,EAAIlD,EAAOC,EAAaC,GAChD,MAAVgD,EAAG5V,MAAa2S,EAAciD,EAAG5V,KAErCyV,EAAKN,IADLQ,GAEAC,EAAKpD,IAFKC,GAKZ,GAAYA,EAARhB,EAAa2D,EAAY7C,EAAQ4C,EAAKI,EAAUI,EAAS,QAAQ,GAAeA,EAAXJ,EAAmBjD,EAAYC,EAAQC,EAAQf,EAAOgB,EAAM,EAAGC,EAAOC,EAAaC,OAAS,CAYnK,IAVA,IAOInS,EACAuV,EARAC,EAAsBtD,EACtBuD,EAAezD,EAAMhB,EAAQ,EAC7B0E,EAAa,IAAIvH,MAAMsH,GACvBE,EAAK,EACLpb,EAAI,EACJqb,EAAM,WACNC,EAAU,EAITtb,EAAI,EAAGA,EAAIkb,EAAclb,IAC5Bmb,EAAWnb,IAAM,EAGnB,IAAKA,EAAIyX,EAAUhB,GAALzW,EAAYA,IAAK,CAG7B,IADA4a,EACIW,GAFa9V,EAAN,MAAPA,EAwKd,SAAmB+R,EAAQf,EAAOgB,GAGhC,IAFA,IAAIhS,EAAMuE,OAAOiP,OAAO,MAEjBxC,EAAQgB,EAAKhB,IAAS,CAC3B,IAAI1R,EAAQyS,EAAOf,GAEN,MAAT1R,GAES,OADP6G,EAAM7G,EAAM6G,OACCnG,EAAImG,GAAO6K,GAIhC,OAAOhR,EApLwB+V,CAAUrB,EAAKI,EAAUI,EAAS,GAE1ClV,IADfmV,EAAKpD,EAAOxX,IACU4L,KAEN,MAAZ2P,IACFF,EAAME,EAAWF,EAAME,GAAY,EAGnCd,EAAKN,EADLgB,EAAWnb,EAAIyW,GAAS8E,GAExBpB,EAAIoB,GAAY,KACZd,IAAOG,GAAIC,EAAWtD,EAAQkD,EAAIG,EAAIlD,EAAOC,EAAaC,GAChD,MAAVgD,EAAG5V,MAAa2S,EAAciD,EAAG5V,KACrCsW,KAMJ,GAFA3D,EAAcsD,EACVK,IAAYX,EAASJ,EAAW,GAAGH,EAAY7C,EAAQ4C,EAAKI,EAAUI,EAAS,GACnE,IAAZW,EAAehE,EAAYC,EAAQC,EAAQf,EAAOgB,EAAM,EAAGC,EAAOC,EAAaC,QACjF,IAAa,IAATyD,EAMF,IAFAD,GADAJ,EAwKZ,SAAwB3a,GAOtB,IANA,IAAIsC,EAAS,CAAC,GACVvC,EAAI,EACJoa,EAAI,EACJxa,EAAI,EACJyb,EAAKC,EAAQ/a,OAASN,EAAEM,OAEnBX,EAAI,EAAGA,EAAIyb,EAAIzb,IACtB0b,EAAQ1b,GAAKK,EAAEL,GAGjB,IAASA,EAAI,EAAGA,EAAIyb,IAAMzb,EACxB,IAAc,IAAVK,EAAEL,GAAN,CACA,IAAIyU,EAAI9R,EAAOA,EAAOhC,OAAS,GAE/B,GAAIN,EAAEoU,GAAKpU,EAAEL,GACX0b,EAAQ1b,GAAKyU,EACb9R,EAAO0B,KAAKrE,OAFd,CASA,IAHAI,EAAI,EACJoa,EAAI7X,EAAOhC,OAAS,EAEbP,EAAIoa,GAAG,CAGZ,IAAIta,GAAKE,IAAM,IAAMoa,IAAM,IAAMpa,EAAIoa,EAAI,GAErCna,EAAEsC,EAAOzC,IAAMG,EAAEL,GACnBI,EAAQ,EAAJF,EAEJsa,EAAIta,EAIJG,EAAEL,GAAKK,EAAEsC,EAAOvC,MACV,EAAJA,IAAOsb,EAAQ1b,GAAK2C,EAAOvC,EAAI,IACnCuC,EAAOvC,GAAKJ,IAIhBI,EAAIuC,EAAOhC,OACX6Z,EAAI7X,EAAOvC,EAAI,GAEf,KAAa,EAANA,KACLuC,EAAOvC,GAAKoa,EACZA,EAAIkB,EAAQlB,GAId,OADAkB,EAAQ/a,OAAS,EACVgC,EA3NgBgZ,CAAeR,IACZxa,OAAS,EAEpBX,EAAIyX,EAAUhB,GAALzW,EAAYA,IACxBwa,EAAIhD,EAAOxX,IACoB,IAA3Bmb,EAAWnb,EAAIyW,GAAeoB,EAAWN,EAAQiD,EAAG9C,EAAOE,EAAID,GAC7DqD,EAAWI,KAAQpb,EAAIyW,EAAO2E,IAAUL,EAAUxD,EAAQiD,EAAG7C,GAEtD,MAAT6C,EAAExV,MAAa2S,EAAcH,EAAOxX,GAAGgF,UAG7C,IAAKhF,EAAIyX,EAAUhB,GAALzW,EAAYA,IACxBwa,EAAIhD,EAAOxX,IACoB,IAA3Bmb,EAAWnb,EAAIyW,IAAeoB,EAAWN,EAAQiD,EAAG9C,EAAOE,EAAID,GACtD,MAAT6C,EAAExV,MAAa2S,EAAcH,EAAOxX,GAAGgF,UA9HhC,CAQnB,IANA,IAAI4W,GAAezB,EAAIxZ,OAAS6W,EAAO7W,OAASwZ,EAAa3C,GAAT7W,OAIpD8V,EAAQA,EAAQ8D,EAAW9D,EAAQ8D,EAE5B9D,EAAQmF,EAAcnF,KAC3B1W,EAAIoa,EAAI1D,OACR+D,EAAIhD,EAAOf,KACS,MAAL1W,GAAkB,MAALya,IAAkC,MAALza,EAAW8X,EAAWN,EAAQiD,EAAG9C,EAAOE,EAAIkD,EAAeX,EAAK1D,EAAQ,EAAGkB,IAA4B,MAAL6C,EAAWqB,EAAWtE,EAAQxX,GAAQ8a,EAAWtD,EAAQxX,EAAGya,EAAG9C,EAAOoD,EAAeX,EAAK1D,EAAQ,EAAGkB,GAAcC,IAG5QuC,EAAIxZ,OAASib,GAAcxB,EAAY7C,EAAQ4C,EAAK1D,EAAO0D,EAAIxZ,QAC/D6W,EAAO7W,OAASib,GAActE,EAAYC,EAAQC,EAAQf,EAAOe,EAAO7W,OAAQ+W,EAAOC,EAAaC,KAwH9G,SAASiD,EAAWtD,EAAQ4C,EAAKpV,EAAO2S,EAAOC,EAAaC,GAC1D,IA4CkBL,EAAQ4C,EAAKpV,EAAO6S,EAAID,EA5CtCmE,EAAS3B,EAAI9E,IAGjB,GAAIyG,IAFM/W,EAAMsQ,KAKd,GAFAtQ,EAAMjD,MAAQqY,EAAIrY,MAClBiD,EAAMgX,OAAS5B,EAAI4B,QAwkBvB,SAAyBhX,EAAOoV,GAC9B,EAAG,CAEC,IAKI6B,EANN,GAAmB,MAAfjX,EAAMwE,OAAuD,mBAA/BxE,EAAMwE,MAAMoC,eAE5C,QAAcoK,KADViG,EAAQ5E,EAAS1W,KAAKqE,EAAMwE,MAAMoC,eAAgB5G,EAAOoV,MACjC6B,EAAO,MAGrC,GAAyB,iBAAdjX,EAAMsQ,KAA0D,mBAA/BtQ,EAAMjD,MAAM6J,eAEtD,QAAcoK,KADViG,EAAQ5E,EAAS1W,KAAKqE,EAAMjD,MAAM6J,eAAgB5G,EAAOoV,MACjC6B,EAAO,MAGrC,OAAO,QACA,GAgBT,OAbAjX,EAAMC,IAAMmV,EAAInV,IAChBD,EAAMqT,QAAU+B,EAAI/B,QACpBrT,EAAM0M,SAAW0I,EAAI1I,SAQrB1M,EAAMwE,MAAQ4Q,EAAI5Q,MAClBxE,EAAMqH,SAAW+N,EAAI/N,SACrBrH,EAAMkR,KAAOkE,EAAIlE,MACV,EApmBDgG,CAAgBlX,EAAOoV,GAE3B,GAAsB,iBAAX2B,EAKT,OAJmB,MAAf/W,EAAMwE,OACR2S,EAAgBnX,EAAMwE,MAAOxE,EAAO2S,GAG9BoE,GACN,IAAK,KAsBb,SAAoB3B,EAAKpV,GACnBoV,EAAI/N,SAASqH,aAAe1O,EAAMqH,SAASqH,aAC7C0G,EAAInV,IAAImX,UAAYpX,EAAMqH,UAG5BrH,EAAMC,IAAMmV,EAAInV,IA1BRoX,CAAWjC,EAAKpV,GAChB,MAEF,IAAK,IA0BOwS,EAzBCA,EAyBYxS,EAzBCA,EAyBM6S,EAzBCA,EAyBGD,EAzBCA,GAyBjBwC,EAzBCA,GA0BnB/N,WAAarH,EAAMqH,UACzBiQ,EAAW9E,EAAQ4C,GACnBlC,EAAWV,EAAQxS,EAAO6S,EAAID,KAE9B5S,EAAMC,IAAMmV,EAAInV,IAChBD,EAAMqT,QAAU+B,EAAI/B,QACpBrT,EAAM0M,SAAW0I,EAAI1I,UA/Bf,MAEF,IAAK,KAiCb,SAAwB8F,EAAQ4C,EAAKpV,EAAO2S,EAAOC,EAAaC,GAC9DsC,EAAY3C,EAAQ4C,EAAI/N,SAAUrH,EAAMqH,SAAUsL,EAAOC,EAAaC,GACtE,IAAIQ,EAAU,EACVhM,EAAWrH,EAAMqH,SAGrB,GAFArH,EAAMC,IAAM,KAEI,MAAZoH,EAAkB,CACpB,IAAK,IAAIpM,EAAI,EAAGA,EAAIoM,EAASzL,OAAQX,IAAK,CACxC,IAAImM,EAAQC,EAASpM,GAER,MAATmM,GAA8B,MAAbA,EAAMnH,MACR,MAAbD,EAAMC,MAAaD,EAAMC,IAAMmH,EAAMnH,KACzCoT,GAAWjM,EAAMiM,SAAW,GAIhB,IAAZA,IAAerT,EAAMqT,QAAUA,IAhD7BkE,CAAe/E,EAAQ4C,EAAKpV,EAAO2S,EAAOC,EAAaC,GACvD,MAEF,SAiDR,SAAuBuC,EAAKpV,EAAO2S,EAAOE,GACxC,IAAI1W,EAAU6D,EAAMC,IAAMmV,EAAInV,IAC9B4S,EAAKZ,EAAajS,IAAU6S,EAEV,aAAd7S,EAAMsQ,MACW,MAAftQ,EAAMwE,QAAexE,EAAMwE,MAAQ,IAErB,MAAdxE,EAAMkR,OACRlR,EAAMwE,MAAMpH,MAAQ4C,EAAMkR,KAE1BlR,EAAMkR,UAAOF,KA2WnB,SAAqBhR,EAAOoV,EAAK5Q,EAAOqO,GACtC,GAAa,MAATrO,EACF,IAAK,IAAIqC,KAAOrC,EACdmP,EAAQ3T,EAAO6G,EAAKuO,GAAOA,EAAIvO,GAAMrC,EAAMqC,GAAMgM,GAIrD,IAAI2E,EAEJ,GAAW,MAAPpC,EACF,IAAK,IAAIvO,KAAOuO,EACU,OAAnBoC,EAAMpC,EAAIvO,KAA2B,MAATrC,GAA+B,MAAdA,EAAMqC,IAtC9D,SAAoB7G,EAAO6G,EAAKuO,EAAKvC,GACvB,QAARhM,GAAyB,OAARA,GAAuB,MAAPuO,GAAeqC,EAAkB5Q,KACvD,MAAXA,EAAI,IAAyB,MAAXA,EAAI,IAAe4Q,EAAkB5Q,GAA0D,UAARA,EAAiB6Q,EAAY1X,EAAMC,IAAKmV,EAAK,OAAeuC,EAAe3X,EAAO6G,EAAKgM,IAAe,cAARhM,GAAiC,UAARA,IAAkC,WAAd7G,EAAMsQ,KAAkC,WAAdtQ,EAAMsQ,MAAiD,IAA7BtQ,EAAMC,IAAI+T,eAAwBhU,EAAMC,MAAQqS,MAAqC,UAAdtS,EAAMsQ,KAA2B,SAARzJ,IAIrX,KADjB+Q,EAAc/Q,EAAIrE,QAAQ,QACNqE,EAAMA,EAAI3H,MAAM0Y,EAAc,KAC1C,IAARxC,GAAepV,EAAMC,IAAI4X,gBAAwB,cAARhR,EAAsB,QAAUA,IAJ7E7G,EAAMC,IAAI4G,GAAO,KAD8CiR,EAAY9X,EAAO6G,OAAKmK,IAqCnF+G,CAAW/X,EAAO6G,EAAK2Q,EAAK3E,IAnXlCmF,CAAYhY,EAAOoV,EAAI5Q,MAAOxE,EAAMwE,MAAOqO,GAEtCgB,EAAwB7T,KACX,MAAZoV,EAAIlE,MAA8B,MAAdlR,EAAMkR,MAA+B,KAAflR,EAAMkR,KAC9CkE,EAAIlE,KAAKxC,aAAe1O,EAAMkR,KAAKxC,aAAY0G,EAAInV,IAAImT,WAAWgE,UAAYpX,EAAMkR,OAExE,MAAZkE,EAAIlE,OAAckE,EAAI/N,SAAW,CAAC1F,EAAM,SAAKqP,OAAWA,EAAWoE,EAAIlE,UAAMF,EAAWoE,EAAInV,IAAImT,cAClF,MAAdpT,EAAMkR,OAAclR,EAAMqH,SAAW,CAAC1F,EAAM,SAAKqP,OAAWA,EAAWhR,EAAMkR,UAAMF,OAAWA,KAClGmE,EAAYhZ,EAASiZ,EAAI/N,SAAUrH,EAAMqH,SAAUsL,EAAO,KAAME,KAtE5DoF,CAAc7C,EAAKpV,EAAO2S,EAAOE,QA2E3C,SAAyBL,EAAQ4C,EAAKpV,EAAO2S,EAAOC,EAAaC,GAE/D,GADA7S,EAAM0M,SAAW/K,EAAMyS,UAAU/B,EAAS1W,KAAKqE,EAAMjD,MAAMkB,KAAM+B,IAC7DA,EAAM0M,WAAa1M,EAAO,MAAMzE,MAAM,0DAC1C4b,EAAgBnX,EAAMjD,MAAOiD,EAAO2S,GACjB,MAAf3S,EAAMwE,OAAe2S,EAAgBnX,EAAMwE,MAAOxE,EAAO2S,GAEvC,MAAlB3S,EAAM0M,UACY,MAAhB0I,EAAI1I,SAAkBoG,EAAWN,EAAQxS,EAAM0M,SAAUiG,EAAOE,EAAID,GAAkBkD,EAAWtD,EAAQ4C,EAAI1I,SAAU1M,EAAM0M,SAAUiG,EAAOC,EAAaC,GAC/J7S,EAAMC,IAAMD,EAAM0M,SAASzM,IAC3BD,EAAMqT,QAAUrT,EAAM0M,SAAS2G,SACN,MAAhB+B,EAAI1I,UACboK,EAAWtE,EAAQ4C,EAAI1I,UACvB1M,EAAMC,SAAM+Q,EACZhR,EAAMqT,QAAU,IAEhBrT,EAAMC,IAAMmV,EAAInV,IAChBD,EAAMqT,QAAU+B,EAAI/B,SAzFb6E,CAAgB1F,EAAQ4C,EAAKpV,EAAO2S,EAAOC,EAAaC,QAE/DiE,EAAWtE,EAAQ4C,GACnBtC,EAAWN,EAAQxS,EAAO2S,EAAOE,EAAID,GA8GzC,IAAI+D,EAAU,GAwDd,SAASZ,EAAetD,EAAQxX,EAAG2X,GACjC,KAAO3X,EAAIwX,EAAO7W,OAAQX,IACxB,GAAiB,MAAbwX,EAAOxX,IAA+B,MAAjBwX,EAAOxX,GAAGgF,IAAa,OAAOwS,EAAOxX,GAAGgF,IAGnE,OAAO2S,EAWT,SAASoD,EAAUxD,EAAQxS,EAAO4S,GAChC,IAAIuF,EAAOtG,EAAKsB,0BAKlB,SAASiF,EAAgB5F,EAAQ2F,EAAMnY,GAErC,KAAoB,MAAbA,EAAMC,KAAeD,EAAMC,IAAIJ,aAAe2S,GAAQ,CAC3D,GAAyB,iBAAdxS,EAAMsQ,KAEf,GAAa,OADbtQ,EAAQA,EAAM0M,UACK,cACd,GAAkB,MAAd1M,EAAMsQ,IACf,IAAK,IAAIrV,EAAI,EAAGA,EAAI+E,EAAM0M,SAAS9Q,OAAQX,IACzCkd,EAAKjD,YAAYlV,EAAM0M,SAASzR,SAE7B,GAAkB,MAAd+E,EAAMsQ,IAEf6H,EAAKjD,YAAYlV,EAAMC,UAClB,GAA8B,IAA1BD,EAAMqH,SAASzL,QAExB,GAAa,OADboE,EAAQA,EAAMqH,SAAS,IACJ,cAEnB,IAAK,IAAIpM,EAAI,EAAGA,EAAI+E,EAAMqH,SAASzL,OAAQX,IAAK,CAC9C,IAAImM,EAAQpH,EAAMqH,SAASpM,GACd,MAATmM,GAAegR,EAAgB5F,EAAQ2F,EAAM/Q,GAIrD,OA3BFgR,CAAgB5F,EAAQ2F,EAAMnY,GAC9BiT,EAAWT,EAAQ2F,EAAMvF,GA8B3B,SAASK,EAAWT,EAAQvS,EAAK2S,GACZ,MAAfA,EAAqBJ,EAAO6F,aAAapY,EAAK2S,GAAkBJ,EAAO0C,YAAYjV,GAGzF,SAAS4T,EAAwB7T,GAC/B,GAAmB,MAAfA,EAAMwE,QAAgD,MAA/BxE,EAAMwE,MAAM8T,iBACR,MAA/BtY,EAAMwE,MAAM+T,iBADZ,CAGA,IAAIlR,EAAWrH,EAAMqH,SAErB,GAAgB,MAAZA,GAAwC,IAApBA,EAASzL,QAAoC,MAApByL,EAAS,GAAGiJ,IAAa,CACxE,IAAIkI,EAAUnR,EAAS,GAAGA,SACtBrH,EAAMC,IAAIgV,YAAcuD,IAASxY,EAAMC,IAAIgV,UAAYuD,QACtD,GAAkB,MAAdxY,EAAMkR,MAA4B,MAAZ7J,GAAwC,IAApBA,EAASzL,OAAc,MAAM,IAAIL,MAAM,mDAE5F,OAAO,GAIT,SAAS8Z,EAAY7C,EAAQC,EAAQf,EAAOgB,GAC1C,IAAK,IAAIzX,EAAIyW,EAAOzW,EAAIyX,EAAKzX,IAAK,CAChC,IAAI+E,EAAQyS,EAAOxX,GACN,MAAT+E,GAAe8W,EAAWtE,EAAQxS,IAI1C,SAAS8W,EAAWtE,EAAQxS,GAC1B,IAEIyY,EAAaC,EAYX9a,EA4BEgQ,EA1CJ+K,EAAO,EACPvG,EAAWpS,EAAMjD,MAqDrB,SAAS6b,IACPzG,EAAWnS,EAAOoS,GAClBrN,EAAS/E,GACTF,EAAY0S,EAAQxS,GArDG,iBAAdA,EAAMsQ,KAA0D,mBAA/BtQ,EAAMjD,MAAMoK,gBAGxC,OAFVvJ,EAASyU,EAAS1W,KAAKqE,EAAMjD,MAAMoK,eAAgBnH,KAEV,mBAAhBpC,EAAOD,OAClCgb,EAAO,EACPF,EAAc7a,GAIdoC,EAAMwE,OAA+C,mBAA/BxE,EAAMwE,MAAM2C,gBAGtB,OAFVvJ,EAASyU,EAAS1W,KAAKqE,EAAMwE,MAAM2C,eAAgBnH,KAEV,mBAAhBpC,EAAOD,OAElCgb,GAAQ,EACRD,EAAc9a,GAIlBuU,EAAWnS,EAAOoS,GAEbuG,GAIgB,MAAfF,GASFA,EAAY9a,KARRiQ,EAAO,WAEE,EAAP+K,KACFA,GAAQ,IACGC,MAIQhL,GAGN,MAAf8K,GASFA,EAAY/a,KARRiQ,EAAO,WAEE,EAAP+K,KACFA,GAAQ,IACGC,MAIQhL,KAxBzB7I,EAAS/E,GACTF,EAAY0S,EAAQxS,IAkCxB,SAASsX,EAAW9E,EAAQxS,GAC1B,IAAK,IAAI/E,EAAI,EAAGA,EAAI+E,EAAM0M,SAAS9Q,OAAQX,IACzCuX,EAAO1S,YAAYE,EAAM0M,SAASzR,IAItC,SAAS6E,EAAY0S,EAAQxS,GAE3B,KAAoB,MAAbA,EAAMC,KAAeD,EAAMC,IAAIJ,aAAe2S,GAAQ,CAC3D,GAAyB,iBAAdxS,EAAMsQ,KAEf,GAAa,OADbtQ,EAAQA,EAAM0M,UACK,cACd,GAAkB,MAAd1M,EAAMsQ,IACfgH,EAAW9E,EAAQxS,OACd,CACL,GAAkB,MAAdA,EAAMsQ,MACRkC,EAAO1S,YAAYE,EAAMC,MACpB4O,MAAMC,QAAQ9O,EAAMqH,WAAW,MAGtC,GAA8B,IAA1BrH,EAAMqH,SAASzL,QAEjB,GAAa,OADboE,EAAQA,EAAMqH,SAAS,IACJ,cAEnB,IAAK,IAAIpM,EAAI,EAAGA,EAAI+E,EAAMqH,SAASzL,OAAQX,IAAK,CAC9C,IAAImM,EAAQpH,EAAMqH,SAASpM,GACd,MAATmM,GAAetH,EAAY0S,EAAQpL,IAK7C,OAIJ,SAASrC,EAAS/E,GAIhB,GAHyB,iBAAdA,EAAMsQ,KAAoD,mBAAzBtQ,EAAMjD,MAAMgI,UAAyBsN,EAAS1W,KAAKqE,EAAMjD,MAAMgI,SAAU/E,GACjHA,EAAMwE,OAAyC,mBAAzBxE,EAAMwE,MAAMO,UAAyBsN,EAAS1W,KAAKqE,EAAMwE,MAAMO,SAAU/E,GAE1E,iBAAdA,EAAMsQ,IACO,MAAlBtQ,EAAM0M,UAAkB3H,EAAS/E,EAAM0M,cACtC,CACL,IAAIrF,EAAWrH,EAAMqH,SAErB,GAAIwH,MAAMC,QAAQzH,GAChB,IAAK,IAAIpM,EAAI,EAAGA,EAAIoM,EAASzL,OAAQX,IAAK,CACxC,IAAImM,EAAQC,EAASpM,GACR,MAATmM,GAAerC,EAASqC,KAapC,SAASuM,EAAQ3T,EAAO6G,EAAKuO,EAAKhY,EAAOyV,GACvC,GAAY,QAARhM,GAAyB,OAARA,GAAyB,MAATzJ,IAAiBqa,EAAkB5Q,KAAQuO,IAAQhY,IAsEjE4C,EAtE2FA,EAuElG,WADc6Y,EAtE2FhS,IAuErF,YAATgS,GAA+B,kBAATA,GAAqC,aAATA,GAAuB7Y,EAAMC,MAAQqS,KAAiC,WAAdtS,EAAMsQ,KAAoBtQ,EAAMC,IAAIJ,aAAegS,EAAKS,gBAvEzC,WAAnBzP,EAAQzF,IAAzI,CAsEF,IAAyB4C,EAAO6Y,EArE9B,GAAe,MAAXhS,EAAI,IAAyB,MAAXA,EAAI,GAAY,OAAOiR,EAAY9X,EAAO6G,EAAKzJ,GAAxB0a,EAC7C,GAAwB,WAApBjR,EAAI3H,MAAM,EAAG,GAAiBc,EAAMC,IAAI6Y,eAAe,+BAAgCjS,EAAI3H,MAAM,GAAI9B,QAAY,GAAY,UAARyJ,EAAiB6Q,EAAY1X,EAAMC,IAAKmV,EAAKhY,QAAY,GAAIua,EAAe3X,EAAO6G,EAAKgM,GAAK,CACpN,GAAY,UAARhM,EAAiB,CAKnB,IAAmB,UAAd7G,EAAMsQ,KAAiC,aAAdtQ,EAAMsQ,MAAuBtQ,EAAMC,IAAI7C,QAAU,GAAKA,GAAS4C,EAAMC,MAAQqS,IAAiB,OAE5H,GAAkB,WAAdtS,EAAMsQ,KAA4B,OAAR8E,GAAgBpV,EAAMC,IAAI7C,QAAU,GAAKA,EAAO,OAE9E,GAAkB,WAAd4C,EAAMsQ,KAA4B,OAAR8E,GAAgBpV,EAAMC,IAAI7C,QAAU,GAAKA,EAAO,OAK9D,UAAd4C,EAAMsQ,KAA2B,SAARzJ,EAAgB7G,EAAMC,IAAI8Y,aAAalS,EAAKzJ,GAAY4C,EAAMC,IAAI4G,GAAOzJ,MAEjF,kBAAVA,EACLA,EAAO4C,EAAMC,IAAI8Y,aAAalS,EAAK,IAAS7G,EAAMC,IAAI4X,gBAAgBhR,GACrE7G,EAAMC,IAAI8Y,aAAqB,cAARlS,EAAsB,QAAUA,EAAKzJ,IAqDvE,SAASqa,EAAkBoB,GACzB,MAAgB,WAATA,GAA8B,aAATA,GAAgC,aAATA,GAAgC,aAATA,GAAgC,mBAATA,GAAsC,mBAATA,EAGhI,SAASlB,EAAe3X,EAAO6G,EAAKgM,GAElC,YAAc7B,IAAP6B,KACmB,EAA1B7S,EAAMsQ,IAAI9N,QAAQ,MAA4B,MAAfxC,EAAMwE,OAAiBxE,EAAMwE,MAAMgP,IAC1D,SAAR3M,GAA0B,SAARA,GAA0B,SAARA,GAA0B,UAARA,GAA2B,WAARA,IAEpEA,KAAO7G,EAAMC,IAIpB,IAAI+Y,EAAiB,SAErB,SAASC,EAAYC,GACnB,MAAO,IAAMA,EAAQD,cAGvB,SAASE,EAAatS,GACpB,MAAkB,MAAXA,EAAI,IAAyB,MAAXA,EAAI,GAAaA,EAAc,aAARA,EAAqB,QAAUA,EAAI5C,QAAQ+U,EAAgBC,GAG7G,SAASvB,EAAYvb,EAASiZ,EAAK7U,GACjC,GAAI6U,IAAQ7U,EACL,GAAa,MAATA,EAETpE,EAAQoE,MAAM6Y,QAAU,QACnB,GAAuB,WAAnBvW,EAAQtC,GAEjBpE,EAAQoE,MAAM6Y,QAAU7Y,OACnB,GAAW,MAAP6U,GAAgC,WAAjBvS,EAAQuS,GAIhC,IAAK,IAAIvO,KAFT1K,EAAQoE,MAAM6Y,QAAU,GAER7Y,EAED,OADTnD,EAAQmD,EAAMsG,KACC1K,EAAQoE,MAAM8Y,YAAYF,EAAatS,GAAMkE,OAAO3N,QAEpE,CAGL,IAAK,IAAIyJ,KAAOtG,EAAO,CACrB,IAAInD,EAES,OAFTA,EAAQmD,EAAMsG,MAEIzJ,EAAQ2N,OAAO3N,MAAY2N,OAAOqK,EAAIvO,KAC1D1K,EAAQoE,MAAM8Y,YAAYF,EAAatS,GAAMzJ,GAKjD,IAAK,IAAIyJ,KAAOuO,EACE,MAAZA,EAAIvO,IAA8B,MAAdtG,EAAMsG,IAC5B1K,EAAQoE,MAAM+Y,eAAeH,EAAatS,KAiBlD,SAAS0S,IAEPtR,KAAKuR,EAAI5H,EAkBX,SAASkG,EAAY9X,EAAO6G,EAAKzJ,GACX,MAAhB4C,EAAMgX,OACJhX,EAAMgX,OAAOnQ,KAASzJ,IAEb,MAATA,GAAmC,mBAAVA,GAA2C,WAAnByF,EAAQzF,IAIlC,MAArB4C,EAAMgX,OAAOnQ,IAAc7G,EAAMC,IAAI0G,oBAAoBE,EAAI3H,MAAM,GAAIc,EAAMgX,QAAQ,GACzFhX,EAAMgX,OAAOnQ,QAAOmK,IAJK,MAArBhR,EAAMgX,OAAOnQ,IAAc7G,EAAMC,IAAI7D,iBAAiByK,EAAI3H,MAAM,GAAIc,EAAMgX,QAAQ,GACtFhX,EAAMgX,OAAOnQ,GAAOzJ,IAKJ,MAATA,GAAmC,mBAAVA,GAA2C,WAAnByF,EAAQzF,KAClE4C,EAAMgX,OAAS,IAAIuC,EACnBvZ,EAAMC,IAAI7D,iBAAiByK,EAAI3H,MAAM,GAAIc,EAAMgX,QAAQ,GACvDhX,EAAMgX,OAAOnQ,GAAOzJ,GAKxB,SAAS2V,EAAc1I,EAAQrK,EAAO2S,GACP,mBAAlBtI,EAAOnD,QAAuBmL,EAAS1W,KAAK0O,EAAOnD,OAAQlH,GACvC,mBAApBqK,EAAO7J,UAAyBmS,EAAMrT,KAAK+S,EAASpF,KAAK5C,EAAO7J,SAAUR,IAGvF,SAASmX,EAAgB9M,EAAQrK,EAAO2S,GACP,mBAApBtI,EAAO5J,UAAyBkS,EAAMrT,KAAK+S,EAASpF,KAAK5C,EAAO5J,SAAUT,IAmCvF,OA3EAuZ,EAAUrW,UAAY+B,OAAOiP,OAAO,OAEhB1M,YAAc,SAAUiS,GAC1C,IACI7b,EADA4O,EAAUvE,KAAK,KAAOwR,EAAGtb,MAEN,mBAAZqO,EAAwB5O,EAAS4O,EAAQ7Q,KAAK8d,EAAGlS,cAAekS,GAA4C,mBAAxBjN,EAAQhF,aAA4BgF,EAAQhF,YAAYiS,GACnJxR,KAAKuR,IAAmB,IAAdC,EAAGvX,SAAkB,EAAI+F,KAAKuR,MAE7B,IAAX5b,IACF6b,EAAG/c,iBACH+c,EAAGC,oBAiEA,SAAUzZ,EAAKwS,EAAQvQ,GAC5B,IAAKjC,EAAK,MAAM,IAAIqC,UAAU,qFAC9B,IAAIqQ,EAAQ,GACRgH,EAASrH,IACTsH,EAAY3Z,EAAI4Z,aAEF,MAAd5Z,EAAIwS,SAAgBxS,EAAI6T,YAAc,IAC1CrB,EAAS9Q,EAAM4O,kBAAkB1B,MAAMC,QAAQ2D,GAAUA,EAAS,CAACA,IACnE,IAAIqH,EAAalI,EAEjB,IACEA,EAAkC,mBAAX1P,EAAwBA,OAAS8O,EACxDmE,EAAYlV,EAAKA,EAAIwS,OAAQA,EAAQE,EAAO,KAAoB,iCAAdiH,OAA+C5I,EAAY4I,GAC7G,QACAhI,EAAgBkI,EAGlB7Z,EAAIwS,OAASA,EAEC,MAAVkH,GAAkBrH,MAAoBqH,GAAkC,mBAAjBA,EAAOI,OAAsBJ,EAAOI,QAE/F,IAAK,IAAI9e,EAAI,EAAGA,EAAI0X,EAAM/W,OAAQX,IAChC0X,EAAM1X,QAKV,CAACyH,kBAAkB,KAAKsX,GAAG,CAAC,SAAS5e,EAAQU,EAAOJ,gBAGtD,IAAIiG,EAAQvG,EAAQ,mBAEpBU,EAAOJ,QAAU,SAAUue,GAEzB,OAAOtY,EAAM,SAAKqP,OAAWA,EADXiJ,EAAN,MAARA,EAAqB,GACeA,OAAMjJ,OAAWA,KAGzD,CAACtO,kBAAkB,KAAKwX,GAAG,CAAC,SAAS9e,EAAQU,EAAOJ,gBAGtD,SAASmH,EAAQC,GAAmV,OAAtOD,EAArD,mBAAXE,QAAoD,iBAApBA,OAAOC,SAAmC,SAAiBF,GAAO,cAAcA,GAA2B,SAAiBA,GAAO,OAAOA,GAAyB,mBAAXC,QAAyBD,EAAIG,cAAgBF,QAAUD,IAAQC,OAAOG,UAAY,gBAAkBJ,IAAyBA,GAEnX,SAASnB,EAAM2O,EAAKzJ,EAAKrC,EAAO6C,EAAU6J,EAAMjR,GAC9C,MAAO,CACLqQ,IAAKA,EACLzJ,IAAKA,EACLrC,MAAOA,EACP6C,SAAUA,EACV6J,KAAMA,EACNjR,IAAKA,EACLoT,aAASrC,EACTjU,WAAOiU,EACPgG,YAAQhG,EACRtE,cAAUsE,GAIdrP,EAAMyS,UAAY,SAAU+F,GAC1B,OAAItL,MAAMC,QAAQqL,GAAcxY,EAAM,SAAKqP,OAAWA,EAAWrP,EAAM4O,kBAAkB4J,QAAOnJ,OAAWA,GAC/F,MAARmJ,GAAgC,kBAATA,EAA2B,KAChC,WAAlBtX,EAAQsX,GAA2BA,EAChCxY,EAAM,SAAKqP,OAAWA,EAAWjG,OAAOoP,QAAOnJ,OAAWA,IAGnErP,EAAM4O,kBAAoB,SAAU6J,GAClC,IAAI/S,EAAW,GAEf,GAAI+S,EAAMxe,OAAQ,CAKhB,IAJA,IAAI2Z,EAAsB,MAAZ6E,EAAM,IAA8B,MAAhBA,EAAM,GAAGvT,IAIlC5L,EAAI,EAAGA,EAAImf,EAAMxe,OAAQX,IAChC,IAAiB,MAAZmf,EAAMnf,IAA8B,MAAhBmf,EAAMnf,GAAG4L,MAAiB0O,EACjD,MAAM,IAAIjT,UAAU,2DAIxB,IAASrH,EAAI,EAAGA,EAAImf,EAAMxe,OAAQX,IAChCoM,EAASpM,GAAK0G,EAAMyS,UAAUgG,EAAMnf,IAIxC,OAAOoM,GAGTvL,EAAOJ,QAAUiG,GAEf,IAAI0Y,GAAG,CAAC,SAASjf,EAAQU,EAAOJ,gBAGlC,IAAI2N,EAAkBjO,EAAQ,qBAE1BsI,EAActI,EAAQ,kBAE1BU,EAAOJ,QAAUN,EAAQ,oBAARA,CAA6B2D,OAAQsK,EAAiB3F,EAAYxB,SAEjF,CAACqH,iBAAiB,EAAE+Q,oBAAoB,GAAGC,oBAAoB,KAAKC,GAAG,CAAC,SAASpf,EAAQU,EAAOJ,gBAGlG,IAAI0H,EAAgBhI,EAAQ,qBAE5BU,EAAOJ,QAAU,SAAU+H,EAASN,EAASsX,GAC3C,IAAIC,EAAgB,EAEpB,SAASC,EAAaxO,GACpB,OAAO,IAAIhJ,EAAQgJ,GASrB,SAASyO,EAAYC,GACnB,OAAO,SAAUpd,EAAKkR,GACD,iBAARlR,EAETA,GADAkR,EAAOlR,GACGA,IACO,MAARkR,IAAcA,EAAO,IAEhC,IAAId,EAAU,IAAI1K,EAAQ,SAAUqC,EAASsI,GAC3C+M,EAAQzX,EAAc3F,EAAKkR,EAAKxI,QAASwI,EAAM,SAAU7K,GACvD,GAAyB,mBAAd6K,EAAKxQ,KACd,GAAI0Q,MAAMC,QAAQhL,GAChB,IAAK,IAAI7I,EAAI,EAAGA,EAAI6I,EAAKlI,OAAQX,IAC/B6I,EAAK7I,GAAK,IAAI0T,EAAKxQ,KAAK2F,EAAK7I,SAE1B6I,EAAO,IAAI6K,EAAKxQ,KAAK2F,GAG9B0B,EAAQ1B,IACPgK,KAEL,IAAwB,IAApBa,EAAKmM,WAAqB,OAAOjN,EACrC,IAAIK,EAAQ,EAEZ,SAAS6M,IACS,KAAV7M,GAAuC,mBAAjBuM,GAA6BA,IAG3D,OAEA,SAASO,EAAKnN,GACZ,IAAIlQ,EAAOkQ,EAAQlQ,KAQnBkQ,EAAQ5K,YAAc0X,EAEtB9M,EAAQlQ,KAAO,WACbuQ,IACA,IAAIN,EAAOjQ,EAAKqL,MAAM6E,EAAS5E,WAK/B,OAJA2E,EAAKjQ,KAAKod,EAAU,SAAUlgB,GAE5B,GADAkgB,IACc,IAAV7M,EAAa,MAAMrT,IAElBmgB,EAAKpN,IAGd,OAAOC,EAvBFmN,CAAKnN,IA4BhB,SAASoN,EAAUtM,EAAMuM,GACvB,IAAK,IAAIrU,KAAO8H,EAAKwM,QACnB,GAAI,GAAGtK,eAAelV,KAAKgT,EAAKwM,QAAStU,IAAQqU,EAAK9V,KAAKyB,GAAM,OAAO,EAM5E,OAlEA8T,EAAazX,UAAYC,EAAQD,UACjCyX,EAAaS,UAAYjY,EAiElB,CACL5F,QAASqd,EAAY,SAAUnd,EAAKkR,EAAMnJ,EAASsI,GACjD,IAOIuN,EAsBKxU,EA7BLrJ,EAAwB,MAAfmR,EAAKnR,OAAiBmR,EAAKnR,OAAO8d,cAAgB,MAC3Drc,EAAO0P,EAAK1P,KACZsc,IAAgC,MAAlB5M,EAAK6M,WAAqB7M,EAAK6M,YAActa,KAAKsa,WAAgBvc,aAAgBwE,EAAQgY,UACxGC,EAAe/M,EAAK+M,eAAyC,mBAAjB/M,EAAKgN,QAAyB,GAAK,QAC/EC,EAAM,IAAInY,EAAQoY,eAClBC,GAAU,EACV1J,EAAWwJ,EAEXG,EAAQH,EAAIG,MAqBhB,IAASlV,KAnBT+U,EAAIG,MAAQ,WACVD,GAAU,EACVC,EAAMpgB,KAAKsM,OAGb2T,EAAII,KAAKxe,EAAQC,GAAoB,IAAfkR,EAAKsN,MAAsC,iBAAdtN,EAAKuN,KAAoBvN,EAAKuN,UAAOlL,EAAoC,iBAAlBrC,EAAKwN,SAAwBxN,EAAKwN,cAAWnL,GAEnJuK,GAAsB,MAARtc,IAAiBgc,EAAUtM,EAAM,oBACjDiN,EAAIQ,iBAAiB,eAAgB,mCAGP,mBAArBzN,EAAK0N,aAA+BpB,EAAUtM,EAAM,cAC7DiN,EAAIQ,iBAAiB,SAAU,4BAG7BzN,EAAK2N,kBAAiBV,EAAIU,gBAAkB3N,EAAK2N,iBACjD3N,EAAK4N,UAASX,EAAIW,QAAU5N,EAAK4N,SACrCX,EAAIF,aAAeA,EAEH/M,EAAKwM,SACf,GAAGtK,eAAelV,KAAKgT,EAAKwM,QAAStU,IACvC+U,EAAIQ,iBAAiBvV,EAAK8H,EAAKwM,QAAQtU,IAI3C+U,EAAIY,mBAAqB,SAAU/C,GAEjC,IAAIqC,GAEyB,IAAzBrC,EAAGld,OAAOkgB,WACZ,IACE,IAOIC,EAPAC,EAA8B,KAApBlD,EAAGld,OAAOqgB,QAAiBnD,EAAGld,OAAOqgB,OAAS,KAA4B,MAArBnD,EAAGld,OAAOqgB,QAAkB,cAAcxX,KAAK3H,GAM9Gof,EAAWpD,EAAGld,OAAOsgB,SAuBzB,GApBqB,SAAjBnB,EAGGjC,EAAGld,OAAOmf,cAAwC,mBAAjB/M,EAAKgN,UAAwBkB,EAAW3b,KAAKC,MAAMsY,EAAGld,OAAOugB,eACzFpB,GAAiC,SAAjBA,GAMV,MAAZmB,IAAkBA,EAAWpD,EAAGld,OAAOugB,cAGjB,mBAAjBnO,EAAKgN,SACdkB,EAAWlO,EAAKgN,QAAQlC,EAAGld,OAAQoS,GACnCgO,GAAU,GAC2B,mBAArBhO,EAAK0N,cACrBQ,EAAWlO,EAAK0N,YAAYQ,IAG1BF,EAASnX,EAAQqX,OAAe,CAClC,IACEH,EAAUjD,EAAGld,OAAOugB,aACpB,MAAOjiB,GACP6hB,EAAUG,EAGZ,IAAI1a,EAAQ,IAAI5G,MAAMmhB,GACtBva,EAAM3G,KAAOie,EAAGld,OAAOqgB,OACvBza,EAAM0a,SAAWA,EACjB/O,EAAO3L,IAET,MAAOtH,GACPiT,EAAOjT,KAKc,mBAAhB8T,EAAKoO,SACdnB,EAAMjN,EAAKoO,OAAOnB,EAAKjN,EAAMlR,IAAQme,KAEzBxJ,IACViJ,EAAgBO,EAAIG,MAEpBH,EAAIG,MAAQ,WACVD,GAAU,EACVT,EAAc1f,KAAKsM,QAKb,MAARhJ,EAAc2c,EAAIoB,OAA0C,mBAAnBrO,EAAK6M,UAA0BI,EAAIoB,KAAKrO,EAAK6M,UAAUvc,IAAgBA,aAAgBwE,EAAQgY,SAAUG,EAAIoB,KAAK/d,GAAW2c,EAAIoB,KAAK9b,KAAK+b,UAAUhe,MAEpMiK,MAAO0R,EAAY,SAAUnd,EAAKkR,EAAMnJ,EAASsI,GAC/C,IAAIoP,EAAevO,EAAKuO,cAAgB,YAAcC,KAAKC,MAAsB,KAAhBD,KAAKE,UAAmB,IAAM3C,IAC3F4C,EAAS7Z,EAAQxH,SAASyX,cAAc,UAE5CjQ,EAAQyZ,GAAgB,SAAUpZ,UACzBL,EAAQyZ,GACfI,EAAOzd,WAAWC,YAAYwd,GAC9B9X,EAAQ1B,IAGVwZ,EAAOjQ,QAAU,kBACR5J,EAAQyZ,GACfI,EAAOzd,WAAWC,YAAYwd,GAC9BxP,EAAO,IAAIvS,MAAM,0BAGnB+hB,EAAOC,IAAM9f,GAAOA,EAAI+E,QAAQ,KAAO,EAAI,IAAM,KAAOsI,mBAAmB6D,EAAK6O,aAAe,YAAc,IAAM1S,mBAAmBoS,GACtIzZ,EAAQxH,SAASwhB,gBAAgBvI,YAAYoI,QAKjD,CAACnV,oBAAoB,KAAKuV,GAAG,CAAC,SAAStiB,EAAQU,EAAOJ,gBAGxD,IAAIgI,EAActI,EAAQ,kBAE1BU,EAAOJ,QAAUN,EAAQ,eAARA,CAAwB2D,OAAQ2E,IAE/C,CAACia,eAAe,EAAEpU,iBAAiB,IAAIqU,GAAG,CAAC,SAASxiB,EAAQU,EAAOJ,gBAIrE,IAKImiB,EACAC,EANAxgB,EAAUxB,EAAOJ,QAAU,GAQ/B,SAASqiB,IACP,MAAM,IAAIxiB,MAAM,mCAGlB,SAASyiB,IACP,MAAM,IAAIziB,MAAM,qCAyBlB,SAAS0iB,EAAWC,GAClB,GAAIL,IAAqBtY,WAEvB,OAAOA,WAAW2Y,EAAK,GAIzB,IAAKL,IAAqBE,IAAqBF,IAAqBtY,WAElE,OADAsY,EAAmBtY,WACZA,WAAW2Y,EAAK,GAGzB,IAEE,OAAOL,EAAiBK,EAAK,GAC7B,MAAOrjB,GACP,IAEE,OAAOgjB,EAAiBliB,KAAK,KAAMuiB,EAAK,GACxC,MAAOrjB,GAEP,OAAOgjB,EAAiBliB,KAAKsM,KAAMiW,EAAK,MA3C9C,WACE,IAEIL,EADwB,mBAAftY,WACUA,WAEAwY,EAErB,MAAOljB,GACPgjB,EAAmBE,EAGrB,IAEID,EAD0B,mBAAjBK,aACYA,aAEAH,EAEvB,MAAOnjB,GACPijB,EAAqBE,GAlBzB,GA2EA,IAEII,EAFAC,EAAQ,GACRC,GAAW,EAEXC,GAAc,EAElB,SAASC,IACFF,GAAaF,IAIlBE,GAAW,EAEPF,EAAaxiB,OACfyiB,EAAQD,EAAapf,OAAOqf,GAE5BE,GAAc,EAGZF,EAAMziB,QACR6iB,KAIJ,SAASA,IACP,IAAIH,EAAJ,CAIA,IAAI/B,EAAU0B,EAAWO,GACzBF,GAAW,EAGX,IAFA,IAAII,EAAML,EAAMziB,OAET8iB,GAAK,CAIV,IAHAN,EAAeC,EACfA,EAAQ,KAECE,EAAaG,GAChBN,GACFA,EAAaG,GAAYpR,MAI7BoR,GAAc,EACdG,EAAML,EAAMziB,OAGdwiB,EAAe,KACfE,GAAW,EA1Eb,SAAyBK,GACvB,GAAIb,IAAuBK,aAEzB,OAAOA,aAAaQ,GAItB,IAAKb,IAAuBE,IAAwBF,IAAuBK,aAEzE,OADAL,EAAqBK,aACdA,aAAaQ,GAGtB,IAESb,EAAmBa,GAC1B,MAAO9jB,GACP,IAEE,OAAOijB,EAAmBniB,KAAK,KAAMgjB,GACrC,MAAO9jB,GAGP,OAAOijB,EAAmBniB,KAAKsM,KAAM0W,KAqDzCC,CAAgBrC,IAoBlB,SAASsC,EAAKX,EAAKY,GACjB7W,KAAKiW,IAAMA,EACXjW,KAAK6W,MAAQA,EAef,SAASC,KAlCTzhB,EAAQ0hB,SAAW,SAAUd,GAC3B,IAAIvP,EAAO,IAAIE,MAAM5F,UAAUrN,OAAS,GAExC,GAAuB,EAAnBqN,UAAUrN,OACZ,IAAK,IAAIX,EAAI,EAAGA,EAAIgO,UAAUrN,OAAQX,IACpC0T,EAAK1T,EAAI,GAAKgO,UAAUhO,GAI5BojB,EAAM/e,KAAK,IAAIuf,EAAKX,EAAKvP,IAEJ,IAAjB0P,EAAMziB,QAAiB0iB,GACzBL,EAAWQ,IAUfI,EAAK3b,UAAUiK,IAAM,WACnBlF,KAAKiW,IAAIlV,MAAM,KAAMf,KAAK6W,QAG5BxhB,EAAQ0G,MAAQ,UAChB1G,EAAQ2hB,SAAU,EAClB3hB,EAAQ4hB,IAAM,GACd5hB,EAAQ6hB,KAAO,GACf7hB,EAAQ8hB,QAAU,GAElB9hB,EAAQ+hB,SAAW,GAInB/hB,EAAQgiB,GAAKP,EACbzhB,EAAQiiB,YAAcR,EACtBzhB,EAAQkiB,KAAOT,EACfzhB,EAAQmiB,IAAMV,EACdzhB,EAAQoiB,eAAiBX,EACzBzhB,EAAQqiB,mBAAqBZ,EAC7BzhB,EAAQsiB,KAAOb,EACfzhB,EAAQuiB,gBAAkBd,EAC1BzhB,EAAQwiB,oBAAsBf,EAE9BzhB,EAAQyiB,UAAY,SAAU7E,GAC5B,MAAO,IAGT5d,EAAQ0iB,QAAU,SAAU9E,GAC1B,MAAM,IAAI3f,MAAM,qCAGlB+B,EAAQ2iB,IAAM,WACZ,MAAO,KAGT3iB,EAAQ4iB,MAAQ,SAAUC,GACxB,MAAM,IAAI5kB,MAAM,mCAGlB+B,EAAQ8iB,MAAQ,WACd,OAAO,IAGP,IAAIC,GAAG,CAAC,SAASjlB,EAAQU,EAAOJ,IAClC,SAAWkH,EAAa0d,IAAgB,wBAGxC,IAAItB,EAAW5jB,EAAQ,sBAAsB4jB,SAEzChW,EAAQuX,SAASrd,UAAU8F,MAC3B9J,EAAQ2P,MAAM3L,UAAUhE,MACxBshB,EAAe,GACfC,EAAkB,EActB,SAASC,EAAQpP,EAAIqP,GACnB1Y,KAAK2Y,IAAMtP,EACXrJ,KAAK4Y,SAAWF,EAdlBjlB,EAAQ6J,WAAa,WACnB,OAAO,IAAImb,EAAQ1X,EAAMrN,KAAK4J,WAAYxG,OAAQkK,WAAYkV,eAGhEziB,EAAQolB,YAAc,WACpB,OAAO,IAAIJ,EAAQ1X,EAAMrN,KAAKmlB,YAAa/hB,OAAQkK,WAAY8X,gBAGjErlB,EAAQyiB,aAAeziB,EAAQqlB,cAAgB,SAAUxE,GACvDA,EAAQyE,SAQVN,EAAQxd,UAAU+d,MAAQP,EAAQxd,UAAUge,IAAM,aAElDR,EAAQxd,UAAU8d,MAAQ,WACxB/Y,KAAK4Y,SAASllB,KAAKoD,OAAQkJ,KAAK2Y,MAIlCllB,EAAQylB,OAAS,SAAUC,EAAMC,GAC/BlD,aAAaiD,EAAKE,gBAClBF,EAAKG,aAAeF,GAGtB3lB,EAAQ8lB,SAAW,SAAUJ,GAC3BjD,aAAaiD,EAAKE,gBAClBF,EAAKG,cAAgB,GAGvB7lB,EAAQ+lB,aAAe/lB,EAAQie,OAAS,SAAUyH,GAChDjD,aAAaiD,EAAKE,gBAClB,IAAID,EAAQD,EAAKG,aAEJ,GAATF,IACFD,EAAKE,eAAiB/b,WAAW,WAC3B6b,EAAKM,YAAYN,EAAKM,cACzBL,KAKP3lB,EAAQkH,aAAuC,mBAAjBA,EAA8BA,EAAe,SAAUwK,GACnF,IAAIkE,EAAKmP,IACL9R,IAAO1F,UAAUrN,OAAS,IAAYsD,EAAMvD,KAAKsN,UAAW,GAgBhE,OAfAuX,EAAalP,IAAM,EACnB0N,EAAS,WACHwB,EAAalP,KAGX3C,EACFvB,EAAGpE,MAAM,KAAM2F,GAEfvB,EAAGzR,KAAK,MAIVD,EAAQ4kB,eAAehP,MAGpBA,GAET5V,EAAQ4kB,eAA2C,mBAAnBA,EAAgCA,EAAiB,SAAUhP,UAClFkP,EAAalP,KAGnB3V,KAAKsM,OAAQtM,KAAKsM,KAAK7M,EAAQ,UAAUwH,aAAaxH,EAAQ,UAAUklB,iBACzE,CAACqB,qBAAqB,GAAGnZ,OAAS,MAAM,GAAG,CAAC"}PK     M\0L    #  ecommerce3/assets/js/tracker.min.jsnu [        !function r(o,i,c){function u(n,e){if(!i[n]){if(!o[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(f)return f(n,!0);throw(t=new Error("Cannot find module '"+n+"'")).code="MODULE_NOT_FOUND",t}t=i[n]={exports:{}},o[n][0].call(t.exports,function(e){return u(o[n][1][e]||e)},t,t.exports,r,o,i,c)}return i[n].exports}for(var f="function"==typeof require&&require,e=0;e<c.length;e++)u(c[e]);return u}({1:[function(e,n,t){"use strict";function r(e,n,t){var r=t?((r=new Date).setTime(r.getTime()+24*t*60*60*1e3),"; expires="+r.toGMTString()):"";document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(n)+r+"; path=/"}n.exports={read:function(e){for(var n=encodeURIComponent(e)+"=",t=document.cookie.split(";"),r=0;r<t.length;r++){for(var o=t[r];" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(n))return decodeURIComponent(o.substring(n.length,o.length))}return null},create:r,erase:function(e){r(e,"",-1)}}},{}],2:[function(e,n,t){"use strict";var r=e("./_cookie.js");["mc_cid","mc_eid","mc_tc"].forEach(function(e){var n,n=(n=e,(n=new RegExp(n+"=([^&]+)").exec(window.location.search))&&0<n.length?n[1]:"");""!==n&&r.create(e,n,14)}),r.read("mc_landing_site")||r.create("mc_landing_site",window.location.href,7)},{"./_cookie.js":1}]},{},[2]);PK     M\u-5a  a  '  ecommerce3/assets/js/tracker.min.js.mapnu [        {"version":3,"file":"tracker.min.js","sources":["ecommerce3/assets/js/tracker.js"],"sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){\n\"use strict\";\n\n/**\n * Creates a cookie\n *\n * @param name\n * @param value\n * @param days\n */\nfunction create(name, value, days) {\n  var expires;\n\n  if (days) {\n    var date = new Date();\n    date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);\n    expires = '; expires=' + date.toGMTString();\n  } else {\n    expires = '';\n  }\n\n  document.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) + expires + '; path=/';\n}\n/**\n * Reads a cookie\n *\n * @param name\n * @returns {*}\n */\n\n\nfunction read(name) {\n  var nameEQ = encodeURIComponent(name) + '=';\n  var ca = document.cookie.split(';');\n\n  for (var i = 0; i < ca.length; i++) {\n    var c = ca[i];\n\n    while (c.charAt(0) === ' ') {\n      c = c.substring(1, c.length);\n    }\n\n    if (c.indexOf(nameEQ) === 0) return decodeURIComponent(c.substring(nameEQ.length, c.length));\n  }\n\n  return null;\n}\n/**\n * Erases a cookie\n *\n * @param name\n */\n\n\nfunction erase(name) {\n  create(name, '', -1);\n}\n\nmodule.exports = {\n  read: read,\n  create: create,\n  erase: erase\n};\n\n},{}],2:[function(require,module,exports){\n\"use strict\";\n\nvar cookie = require('./_cookie.js');\n\nfunction getUrlValue(key) {\n  var regex = new RegExp(key + '=([^&]+)');\n  var matches = regex.exec(window.location.search);\n\n  if (matches && matches.length > 0) {\n    return matches[1];\n  }\n\n  return '';\n} // set mc_cid, mc_eid & mc_tc cookies if url params are set\n\n\n['mc_cid', 'mc_eid', 'mc_tc'].forEach(function (name) {\n  var value = getUrlValue(name);\n\n  if (value !== '') {\n    cookie.create(name, value, 14);\n  }\n}); // store landing site in mc_landing_site cookie, if not set\n\nif (!cookie.read('mc_landing_site')) {\n  cookie.create('mc_landing_site', window.location.href, 7);\n}\n\n},{\"./_cookie.js\":1}]},{},[2]);\n"],"names":["r","e","n","t","o","i","f","c","require","u","a","Error","code","p","exports","call","length","1","module","create","name","value","days","expires","date","Date","setTime","getTime","toGMTString","document","cookie","encodeURIComponent","read","nameEQ","ca","split","charAt","substring","indexOf","decodeURIComponent","erase","2","forEach","key","matches","RegExp","exec","window","location","search","href","./_cookie.js"],"mappings":"CAAY,SAASA,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIE,EAAE,mBAAmBC,SAASA,QAAQ,IAAIF,GAAGC,EAAE,OAAOA,EAAEF,GAAE,GAAI,GAAGI,EAAE,OAAOA,EAAEJ,GAAE,GAAkD,MAA1CK,EAAE,IAAIC,MAAM,uBAAuBN,EAAE,MAAaO,KAAK,mBAAmBF,EAAMG,EAAEX,EAAEG,GAAG,CAACS,QAAQ,IAAIb,EAAEI,GAAG,GAAGU,KAAKF,EAAEC,QAAQ,SAASd,GAAoB,OAAOI,EAAlBH,EAAEI,GAAG,GAAGL,IAAeA,IAAIa,EAAEA,EAAEC,QAAQd,EAAEC,EAAEC,EAAEC,GAAG,OAAOD,EAAEG,GAAGS,QAAQ,IAAI,IAAIL,EAAE,mBAAmBD,SAASA,QAAQH,EAAE,EAAEA,EAAEF,EAAEa,OAAOX,IAAID,EAAED,EAAEE,IAAI,OAAOD,EAA7b,CAA4c,CAACa,EAAE,CAAC,SAAST,EAAQU,EAAOJ,gBAUxe,SAASK,EAAOC,EAAMC,EAAOC,GAC3B,IAKEC,EAHED,IACEE,EAAO,IAAIC,MACVC,QAAQF,EAAKG,UAAmB,GAAPL,EAAY,GAAK,GAAK,KAC1C,aAAeE,EAAKI,eAEpB,GAGZC,SAASC,OAASC,mBAAmBX,GAAQ,IAAMW,mBAAmBV,GAASE,EAAU,WAqC3FL,EAAOJ,QAAU,CACfkB,KA5BF,SAAcZ,GAIZ,IAHA,IAAIa,EAASF,mBAAmBX,GAAQ,IACpCc,EAAKL,SAASC,OAAOK,MAAM,KAEtB9B,EAAI,EAAGA,EAAI6B,EAAGlB,OAAQX,IAAK,CAGlC,IAFA,IAAIE,EAAI2B,EAAG7B,GAEY,MAAhBE,EAAE6B,OAAO,IACd7B,EAAIA,EAAE8B,UAAU,EAAG9B,EAAES,QAGvB,GAA0B,IAAtBT,EAAE+B,QAAQL,GAAe,OAAOM,mBAAmBhC,EAAE8B,UAAUJ,EAAOjB,OAAQT,EAAES,SAGtF,OAAO,MAePG,OAAQA,EACRqB,MAPF,SAAepB,GACbD,EAAOC,EAAM,IAAK,MASlB,IAAIqB,EAAE,CAAC,SAASjC,EAAQU,EAAOJ,gBAGjC,IAAIgB,EAAStB,EAAQ,gBAcrB,CAAC,SAAU,SAAU,SAASkC,QAAQ,SAAUtB,GAC9C,IAbmBuB,EAaftB,GAbesB,EAaKvB,GAXpBwB,EADQ,IAAIC,OAAOF,EAAM,YACTG,KAAKC,OAAOC,SAASC,UAET,EAAjBL,EAAQ5B,OACd4B,EAAQ,GAGV,IAOO,KAAVvB,GACFS,EAAOX,OAAOC,EAAMC,EAAO,MAI1BS,EAAOE,KAAK,oBACfF,EAAOX,OAAO,kBAAmB4B,OAAOC,SAASE,KAAM,IAGvD,CAACC,eAAe,KAAK,GAAG,CAAC"}PK     M\o-      !  ecommerce3/assets/js/admin.min.jsnu [        !function r(o,i,l){function a(t,e){if(!i[t]){if(!o[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(u)return u(t,!0);throw(n=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",n}n=i[t]={exports:{}},o[t][0].call(n.exports,function(e){return a(o[t][1][e]||e)},n,n.exports,r,o,i,l)}return i[t].exports}for(var u="function"==typeof require&&require,e=0;e<l.length;e++)a(l[e]);return a}({1:[function(e,t,n){"use strict";t.exports=function(t){for(var e=document.querySelectorAll("[data-confirm]"),n=0;n<e.length;n++){var r=e[n];r.addEventListener("FORM"===r.tagName?"submit":"click",function(e){return!!confirm(e.target.getAttribute("data-confirm")||t.confirmation)||(e.preventDefault(),!1)})}}},{}],2:[function(e,t,n){"use strict";var r=e("mithril"),e={},o=mc4wp_ecommerce.i18n,i={working:!1,done:!1,action:"process"};function l(e){i.action=e.target.value}function a(e){confirm(o.confirmation)?i.action=e.target.value:e.preventDefault()}function u(e){e&&e.preventDefault(),i.working=!0,i.done=!1,r.request({method:"POST",url:ajaxurl+"?action=mc4wp_ecommerce_"+i.action+"_queue"}).then(function(e){i.done=!0,i.working=!1,document.getElementById("mc4wp-pending-background-jobs-count").innerText="0"}).catch(function(e){console.log(e)})}e.view=function(){return r("form",{method:"POST",onsubmit:u},[r("p",[r("button",{type:"submit",className:"button button-primary",value:"process",disabled:i.working||i.done,onclick:l},i.done&&"process"===i.action?o.done:o.process),r.trust("&nbsp; or &nbsp;"),r("button",{type:"submit",className:"button button-link-delete",value:"reset",disabled:i.working||i.done,onclick:a},i.done&&"reset"===i.action?o.done:o.reset)]),i.working?r("p.description",[" ",r("span.mc4wp-loader")," ",r("span",o.processing)]):""])},t.exports=e},{mithril:8}],3:[function(e,t,n){"use strict";mc4wp_ecommerce.i18n;var d=e("mithril");function r(e,t,n){function r(){d.request({method:"POST",url:window.ajaxurl+"?action=mc4wp_ecommerce_sync_".concat(t),body:n.slice(a,a+10)}).then(function(e){a+=e.length,u=a/n.length,c.push({date:new Date,messages:e}),a<n.length?r():s=!(l=!1)})}function o(){f.parentNode.removeChild(f),(l=!l)&&r()}function i(e){e.dom.scrollTop=e.dom.scrollHeight}var l=!1,a=0,u=0,s=0===n.length,c=[],f=e.parentElement.querySelector(".mc4wp-status-label");return{view:function(){return d("div",[d("p",[d("button.button",{onclick:o,disabled:s},s?"All done!":l?"Stop":"Start")," ",l?d("span.description",(100*u).toFixed(2)+"% — Please wait... This can take a while if you have many "+t+"."):""]),d("div.mc4wp-margin-m",{style:0<c.length?"display: block;":"display: none;"},[d("div.results",{style:"max-height: 240px; overflow-y: scroll;",oncreate:i,onupdate:i},c.map(function(e){return d("div.mc4wp-margin-s",[d("div",[d("strong",e.date.toLocaleString())]),e.messages.map(function(e){return d("div",e)})])})),d("p",[d("a",{href:"",onclick:function(e){e.preventDefault(),c=[]}},"Clear results")])])])}}}[].forEach.call(document.querySelectorAll("[data-wizard]"),function(e){var t=e.getAttribute("data-wizard"),n=JSON.parse(e.getAttribute("data-object-ids"));d.mount(e,r(e,t,n))})},{mithril:8}],4:[function(e,t,n){"use strict";var r=e("mithril"),o=e("./_queue-processor.js");e("./_confirm-attr.js")(),e("./_wizard.js");e=document.getElementById("queue-processor");e&&r.mount(e,o)},{"./_confirm-attr.js":1,"./_queue-processor.js":2,"./_wizard.js":3,mithril:8}],5:[function(e,t,n){"use strict";var u=e("../render/vnode");t.exports=function(r,e,t){var o=[],n=!1,i=!1;function l(){if(n)throw new Error("Nested m.redraw.sync() call");n=!0;for(var e=0;e<o.length;e+=2)try{r(o[e],u(o[e+1]),a)}catch(e){t.error(e)}n=!1}function a(){i||(i=!0,e(function(){i=!1,l()}))}return a.sync=l,{mount:function(e,t){if(null!=t&&null==t.view&&"function"!=typeof t)throw new TypeError("m.mount(element, component) expects a component, not a vnode");var n=o.indexOf(e);0<=n&&(o.splice(n,2),r(e,[],a)),null!=t&&(o.push(e,t),r(e,u(t),a))},redraw:a}}},{"../render/vnode":24}],6:[function(e,t,n){!function(A){!function(){"use strict";function i(e){return(i="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)}var S=e("../render/vnode"),l=e("../render/hyperscript"),k=e("../promise/promise"),o=e("../pathname/build"),T=e("../pathname/parse"),E=e("../pathname/compileTemplate"),j=e("../pathname/assign"),_={};t.exports=function(d,p){var u;function m(e,t,n){var r;e=o(e,t),null!=u?(u(),r=n?n.state:null,t=n?n.title:null,n&&n.replace?d.history.replaceState(r,t,x.prefix+e):d.history.pushState(r,t,x.prefix+e)):d.location.href=x.prefix+e}var h,v,y,g,w=_,b=x.SKIP={};function x(e,t,n){if(null==e)throw new Error("Ensure the DOM element that was passed to `m.route` is not undefined");var r,s=0,c=Object.keys(n).map(function(e){if("/"!==e[0])throw new SyntaxError("Routes must start with a `/`");if(/:([^\/\.-]+)(\.{3})?:/.test(e))throw new SyntaxError("Route parameter names must be separated with either `/`, `.`, or `-`");return{route:e,component:n[e],check:E(e)}}),o="function"==typeof A?A:setTimeout,f=k.resolve(),i=!1;if((u=null)!=t){var l=T(t);if(!c.some(function(e){return e.check(l)}))throw new ReferenceError("Default route doesn't match any known routes")}function a(){i=!1;var e=d.location.hash;"#"!==x.prefix[0]&&(e=d.location.search+e,"?"!==x.prefix[0]&&"/"!==(e=d.location.pathname+e)[0]&&(e="/"+e));var l=e.concat().replace(/(?:%[a-f89][a-f0-9])+/gim,decodeURIComponent).slice(x.prefix.length),a=T(l);function u(){if(l===t)throw new Error("Could not resolve default route "+t);m(t,null,{replace:!0})}j(a.params,d.history.state),function t(n){for(;n<c.length;n++)if(c[n].check(a)){var r=c[n].component,e=c[n].route,o=r,i=g=function(e){if(i===g){if(e===b)return t(n+1);h=null==e||"function"!=typeof e.view&&"function"!=typeof e?"div":e,v=a.params,y=l,g=null,w=r.render?r:null,2===s?p.redraw():(s=2,p.redraw.sync())}};return void(r.view||"function"==typeof r?(r={},i(o)):r.onmatch?f.then(function(){return r.onmatch(a.params,l,e)}).then(i,u):i("div"))}u()}(0)}return u=function(){i||(i=!0,o(a))},"function"==typeof d.history.pushState?(r=function(){d.removeEventListener("popstate",u,!1)},d.addEventListener("popstate",u,!1)):"#"===x.prefix[0]&&(u=null,r=function(){d.removeEventListener("hashchange",a,!1)},d.addEventListener("hashchange",a,!1)),p.mount(e,{onbeforeupdate:function(){return!(!(s=s?2:1)||_===w)},oncreate:a,onremove:r,view:function(){if(s&&_!==w){var e=[S(h,v.key,v)];return e=w?w.render(e[0]):e}}})}return x.set=function(e,t,n){null!=g&&((n=n||{}).replace=!0),g=null,m(e,t,n)},x.get=function(){return y},x.prefix="#!",x.Link={view:function(e){var n,r,o=e.attrs.options,t={};j(t,e.attrs),t.selector=t.options=t.key=t.oninit=t.oncreate=t.onbeforeupdate=t.onupdate=t.onbeforeremove=t.onremove=null;e=l(e.attrs.selector||"a",t,e.children);return(e.attrs.disabled=Boolean(e.attrs.disabled))?(e.attrs.href=null,e.attrs["aria-disabled"]="true",e.attrs.onclick=null):(n=e.attrs.onclick,r=e.attrs.href,e.attrs.href=x.prefix+r,e.attrs.onclick=function(e){var t;"function"==typeof n?t=n.call(e.currentTarget,e):null==n||"object"!==i(n)||"function"==typeof n.handleEvent&&n.handleEvent(e),!1===t||e.defaultPrevented||0!==e.button&&0!==e.which&&1!==e.which||e.currentTarget.target&&"_self"!==e.currentTarget.target||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||(e.preventDefault(),e.redraw=!1,x.set(r,null,o))}),e}},x.param=function(e){return v&&null!=e?v[e]:v},x}}.call(this)}.call(this,e("timers").setImmediate)},{"../pathname/assign":10,"../pathname/build":11,"../pathname/compileTemplate":12,"../pathname/parse":13,"../promise/promise":15,"../render/hyperscript":20,"../render/vnode":24,timers:29}],7:[function(e,t,n){"use strict";var r=e("./render/hyperscript");r.trust=e("./render/trust"),r.fragment=e("./render/fragment"),t.exports=r},{"./render/fragment":19,"./render/hyperscript":20,"./render/trust":23}],8:[function(e,t,n){"use strict";function r(){return o.apply(this,arguments)}var o=e("./hyperscript"),i=e("./request"),l=e("./mount-redraw");r.m=o,r.trust=o.trust,r.fragment=o.fragment,r.mount=l.mount,r.route=e("./route"),r.render=e("./render"),r.redraw=l.redraw,r.request=i.request,r.jsonp=i.jsonp,r.parseQueryString=e("./querystring/parse"),r.buildQueryString=e("./querystring/build"),r.parsePathname=e("./pathname/parse"),r.buildPathname=e("./pathname/build"),r.vnode=e("./render/vnode"),r.PromisePolyfill=e("./promise/polyfill"),t.exports=r},{"./hyperscript":7,"./mount-redraw":9,"./pathname/build":11,"./pathname/parse":13,"./promise/polyfill":14,"./querystring/build":16,"./querystring/parse":17,"./render":18,"./render/vnode":24,"./request":25,"./route":27}],9:[function(e,t,n){"use strict";var r=e("./render");t.exports=e("./api/mount-redraw")(r,requestAnimationFrame,console)},{"./api/mount-redraw":5,"./render":18}],10:[function(e,t,n){"use strict";t.exports=Object.assign||function(t,n){n&&Object.keys(n).forEach(function(e){t[e]=n[e]})}},{}],11:[function(e,t,n){"use strict";var f=e("../querystring/build"),d=e("./assign");t.exports=function(e,r){if(/:([^\/\.-]+)(\.{3})?:/.test(e))throw new SyntaxError("Template parameter names *must* be separated");if(null==r)return e;var t=e.indexOf("?"),n=e.indexOf("#"),o=n<0?e.length:n,i=e.slice(0,t<0?o:t),l={};d(l,r);var a=i.replace(/:([^\/\.-]+)(\.{3})?/g,function(e,t,n){return delete l[t],null==r[t]?e:n?r[t]:encodeURIComponent(String(r[t]))}),u=a.indexOf("?"),s=a.indexOf("#"),c=s<0?a.length:s,i=a.slice(0,u<0?c:u);0<=t&&(i+=e.slice(t,o)),0<=u&&(i+=(t<0?"?":"&")+a.slice(u,c));c=f(l);return c&&(i+=(t<0&&u<0?"?":"&")+c),0<=n&&(i+=e.slice(n)),0<=s&&(i+=(n<0?"":"&")+a.slice(s)),i}},{"../querystring/build":16,"./assign":10}],12:[function(e,t,n){"use strict";var a=e("./parse");t.exports=function(e){var r=a(e),o=Object.keys(r.params),i=[],l=new RegExp("^"+r.path.replace(/:([^\/.-]+)(\.{3}|\.(?!\.)|-)?|[\\^$*+.()|\[\]{}]/g,function(e,t,n){return null==t?"\\"+e:(i.push({k:t,r:"..."===n}),"..."===n?"(.*)":"."===n?"([^/]+)\\.":"([^/]+)"+(n||""))})+"$");return function(e){for(var t=0;t<o.length;t++)if(r.params[o[t]]!==e.params[o[t]])return!1;if(!i.length)return l.test(e.path);var n=l.exec(e.path);if(null==n)return!1;for(t=0;t<i.length;t++)e.params[i[t].k]=i[t].r?n[t+1]:decodeURIComponent(n[t+1]);return!0}}},{"./parse":13}],13:[function(e,t,n){"use strict";var o=e("../querystring/parse");t.exports=function(e){var t=e.indexOf("?"),n=e.indexOf("#"),r=n<0?e.length:n,n=e.slice(0,t<0?r:t).replace(/\/{2,}/g,"/");return n?1<(n="/"!==n[0]?"/"+n:n).length&&"/"===n[n.length-1]&&(n=n.slice(0,-1)):n="/",{path:n,params:t<0?{}:o(e.slice(t+1,r))}}},{"../querystring/parse":17}],14:[function(e,t,n){!function(n){!function(){"use strict";function d(e){return(d="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 p(e){if(!(this instanceof p))throw new Error("Promise must be called with `new`");if("function"!=typeof e)throw new TypeError("executor must be a function");var i=this,l=[],a=[],o=t(l,!0),u=t(a,!1),s=i._instance={resolvers:l,rejectors:a},c="function"==typeof n?n:setTimeout;function t(r,o){return function t(n){var e;try{if(!o||null==n||"object"!==d(n)&&"function"!=typeof n||"function"!=typeof(e=n.then))c(function(){o||0!==r.length||console.error("Possible unhandled promise rejection:",n);for(var e=0;e<r.length;e++)r[e](n);l.length=0,a.length=0,s.state=o,s.retry=function(){t(n)}});else{if(n===i)throw new TypeError("Promise can't be resolved w/ itself");f(e.bind(n))}}catch(e){u(e)}}}function f(e){var n=0;function t(t){return function(e){0<n++||t(e)}}var r=t(u);try{e(t(o),r)}catch(e){r(e)}}f(e)}p.prototype.then=function(e,t){var o,i,l=this._instance;function n(t,e,n,r){e.push(function(e){if("function"!=typeof t)n(e);else try{o(t(e))}catch(e){i&&i(e)}}),"function"==typeof l.retry&&r===l.state&&l.retry()}var r=new p(function(e,t){o=e,i=t});return n(e,l.resolvers,o,!0),n(t,l.rejectors,i,!1),r},p.prototype.catch=function(e){return this.then(null,e)},p.prototype.finally=function(t){return this.then(function(e){return p.resolve(t()).then(function(){return e})},function(e){return p.resolve(t()).then(function(){return p.reject(e)})})},p.resolve=function(t){return t instanceof p?t:new p(function(e){e(t)})},p.reject=function(n){return new p(function(e,t){t(n)})},p.all=function(a){return new p(function(n,r){var o=a.length,i=0,l=[];if(0===a.length)n([]);else for(var e=0;e<a.length;e++)!function(t){function e(e){i++,l[t]=e,i===o&&n(l)}null==a[t]||"object"!==d(a[t])&&"function"!=typeof a[t]||"function"!=typeof a[t].then?e(a[t]):a[t].then(e,r)}(e)})},p.race=function(r){return new p(function(e,t){for(var n=0;n<r.length;n++)r[n].then(e,t)})},t.exports=p}.call(this)}.call(this,e("timers").setImmediate)},{timers:29}],15:[function(n,r,e){!function(t){!function(){"use strict";var e=n("./polyfill");"undefined"!=typeof window?(void 0===window.Promise?window.Promise=e:window.Promise.prototype.finally||(window.Promise.prototype.finally=e.prototype.finally),r.exports=window.Promise):void 0!==t?(void 0===t.Promise?t.Promise=e:t.Promise.prototype.finally||(t.Promise.prototype.finally=e.prototype.finally),r.exports=t.Promise):r.exports=e}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./polyfill":14}],16:[function(e,t,n){"use strict";t.exports=function(e){if("[object Object]"!==Object.prototype.toString.call(e))return"";var t,o=[];for(t in e)!function e(t,n){if(Array.isArray(n))for(var r=0;r<n.length;r++)e(t+"["+r+"]",n[r]);else if("[object Object]"===Object.prototype.toString.call(n))for(var r in n)e(t+"["+r+"]",n[r]);else o.push(encodeURIComponent(t)+(null!=n&&""!==n?"="+encodeURIComponent(n):""))}(t,e[t]);return o.join("&")}},{}],17:[function(e,t,n){"use strict";t.exports=function(e){if(""===e||null==e)return{};for(var t=(e="?"===e.charAt(0)?e.slice(1):e).split("&"),n={},r={},o=0;o<t.length;o++){var i=t[o].split("="),l=decodeURIComponent(i[0]),a=2===i.length?decodeURIComponent(i[1]):"";"true"===a?a=!0:"false"===a&&(a=!1);var u=l.split(/\]\[?|\[/),s=r;-1<l.indexOf("[")&&u.pop();for(var c=0;c<u.length;c++){var f=u[c],d=u[c+1],p=""==d||!isNaN(parseInt(d,10));if(""===f)null==n[l=u.slice(0,c).join()]&&(n[l]=Array.isArray(s)?s.length:0),f=n[l]++;else if("__proto__"===f)break;c===u.length-1?s[f]=a:(null==(d=null!=(d=Object.getOwnPropertyDescriptor(s,f))?d.value:d)&&(s[f]=d=p?[]:{}),s=d)}}return r}},{}],18:[function(e,t,n){"use strict";t.exports=e("./render/render")(window)},{"./render/render":22}],19:[function(e,t,n){"use strict";var r=e("../render/vnode"),o=e("./hyperscriptVnode");t.exports=function(){var e=o.apply(0,arguments);return e.tag="[",e.children=r.normalizeChildren(e.children),e}},{"../render/vnode":24,"./hyperscriptVnode":21}],20:[function(e,t,n){"use strict";var u=e("../render/vnode"),r=e("./hyperscriptVnode"),a=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,s={},c={}.hasOwnProperty;function f(e){for(var t in e)if(c.call(e,t))return;return 1}t.exports=function(e){if(null==e||"string"!=typeof e&&"function"!=typeof e&&"function"!=typeof e.view)throw Error("The selector must be either a string or a component.");var t=r.apply(1,arguments);return"string"==typeof e&&(t.children=u.normalizeChildren(t.children),"["!==e)?function(e,t){var n=t.attrs,r=u.normalizeChildren(t.children),o=c.call(n,"class"),i=o?n.class:n.className;if(t.tag=e.tag,t.attrs=null,t.children=void 0,!f(e.attrs)&&!f(n)){var l,a={};for(l in n)c.call(n,l)&&(a[l]=n[l]);n=a}for(l in e.attrs)c.call(e.attrs,l)&&"className"!==l&&!c.call(n,l)&&(n[l]=e.attrs[l]);for(l in null==i&&null==e.attrs.className||(n.className=null!=i?null!=e.attrs.className?String(e.attrs.className)+" "+String(i):i:null!=e.attrs.className?e.attrs.className:null),o&&(n.class=null),n)if(c.call(n,l)&&"key"!==l){t.attrs=n;break}return Array.isArray(r)&&1===r.length&&null!=r[0]&&"#"===r[0].tag?t.text=r[0].children:t.children=r,t}(s[e]||function(e){for(var t,n="div",r=[],o={};t=a.exec(e);){var i=t[1],l=t[2];""===i&&""!==l?n=l:"#"===i?o.id=l:"."===i?r.push(l):"["===t[3][0]&&(l=(l=t[6])&&l.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\"),"class"===t[4]?r.push(l):o[t[4]]=""===l?l:l||!0)}return 0<r.length&&(o.className=r.join(" ")),s[e]={tag:n,attrs:o}}(e),t):(t.tag=e,t)}},{"../render/vnode":24,"./hyperscriptVnode":21}],21:[function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=e("../render/vnode");t.exports=function(){var e,t=arguments[this],n=this+1;if(null==t?t={}:"object"===r(t)&&null==t.tag&&!Array.isArray(t)||(t={},n=this),arguments.length===n+1)e=arguments[n],Array.isArray(e)||(e=[e]);else for(e=[];n<arguments.length;)e.push(arguments[n++]);return o("",t.key,t,e)}},{"../render/vnode":24}],22:[function(e,t,n){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var $=e("../render/vnode");t.exports=function(e){var u,p=e&&e.document,t={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"};function m(e){return e.attrs&&e.attrs.xmlns||t[e.tag]}function s(e,t){if(e.state!==t)throw new Error("`vnode.state` must not be modified")}function h(e){var t=e.state;try{return this.apply(t,arguments)}finally{s(e,t)}}function d(){try{return p.activeElement}catch(e){return null}}function _(e,t,n,r,o,i,l){for(var a=n;a<r;a++){var u=t[a];null!=u&&A(e,u,o,l,i)}}function A(e,t,n,r,o){var i,l,a,u,s,c,f,d=t.tag;if("string"==typeof d)switch(t.state={},null!=t.attrs&&P(t.attrs,t,n),d){case"#":s=e,f=o,(c=t).dom=p.createTextNode(c.children),g(s,c.dom,f);break;case"<":v(e,t,r,o);break;case"[":!function(e,t,n,r,o){var i=p.createDocumentFragment();{var l;null!=t.children&&(l=t.children,_(i,l,0,l.length,n,null,r))}t.dom=i.firstChild,t.domSize=i.childNodes.length,g(e,i,o)}(e,t,n,r,o);break;default:!function(e,t,n,r,o){var i=t.tag,l=t.attrs,a=l&&l.is,i=(r=m(t)||r)?a?p.createElementNS(r,i,{is:a}):p.createElementNS(r,i):a?p.createElement(i,{is:a}):p.createElement(i);t.dom=i,null!=l&&function(e,t,n){for(var r in t)S(e,r,null,t[r],n)}(t,l,r);g(e,i,o),w(t)||(null!=t.text&&(""!==t.text?i.textContent=t.text:t.children=[$("#",void 0,void 0,t.text,void 0,void 0)]),null!=t.children&&(o=t.children,_(i,o,0,o.length,n,null,r),"select"===t.tag&&null!=l&&function(e,t){{var n;"value"in t&&(null===t.value?-1!==e.dom.selectedIndex&&(e.dom.value=null):(n=""+t.value,e.dom.value===n&&-1!==e.dom.selectedIndex||(e.dom.value=n)))}"selectedIndex"in t&&S(e,"selectedIndex",null,t.selectedIndex,void 0)}(t,l)))}(e,t,n,r,o)}else i=e,a=r,u=o,function(e,t){var n;if("function"==typeof e.tag.view){if(e.state=Object.create(e.tag),null!=(n=e.state.view).$$reentrantLock$$)return;n.$$reentrantLock$$=!0}else{if(e.state=void 0,null!=(n=e.tag).$$reentrantLock$$)return;n.$$reentrantLock$$=!0,e.state=null!=e.tag.prototype&&"function"==typeof e.tag.prototype.view?new e.tag(e):e.tag(e)}P(e.state,e,t),null!=e.attrs&&P(e.attrs,e,t);if(e.instance=$.normalize(h.call(e.state.view,e)),e.instance===e)throw Error("A view cannot return the vnode it received as argument");n.$$reentrantLock$$=null}(l=t,d=n),null!=l.instance?(A(i,l.instance,d,a,u),l.dom=l.instance.dom,l.domSize=null!=l.dom?l.instance.domSize:0):l.domSize=0}var c={caption:"table",thead:"table",tbody:"table",tfoot:"table",tr:"tbody",th:"tr",td:"tr",colgroup:"table",col:"colgroup"};function v(e,t,n,r){var o=t.children.match(/^\s*?<(\w+)/im)||[],i=p.createElement(c[o[1]]||"div");"http://www.w3.org/2000/svg"===n?(i.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+t.children+"</svg>",i=i.firstChild):i.innerHTML=t.children,t.dom=i.firstChild,t.domSize=i.childNodes.length,t.instance=[];for(var l,a=p.createDocumentFragment();l=i.firstChild;)t.instance.push(l),a.appendChild(l);g(e,a,r)}function y(e,t,n,r,o,i){if(t!==n&&(null!=t||null!=n))if(null==t||0===t.length)_(e,n,0,n.length,r,o,i);else if(null==n||0===n.length)q(e,t,0,t.length);else{var l=null!=t[0]&&null!=t[0].key,a=null!=n[0]&&null!=n[0].key,u=0,s=0;if(!l)for(;s<t.length&&null==t[s];)s++;if(!a)for(;u<n.length&&null==n[u];)u++;if(null!==a||null!=l)if(l!=a)q(e,t,s,t.length),_(e,n,u,n.length,r,o,i);else if(a){for(var c,f,d,p,m=t.length-1,h=n.length-1;s<=m&&u<=h&&(d=t[m],T=n[h],d.key===T.key);)d!==T&&C(e,d,T,r,o,i),null!=T.dom&&(o=T.dom),m--,h--;for(;s<=m&&u<=h&&(c=t[s],f=n[u],c.key===f.key);)s++,u++,c!==f&&C(e,c,f,r,z(t,s,o),i);for(;s<=m&&u<=h&&u!==h&&c.key===T.key&&d.key===f.key;)N(e,d,p=z(t,s,o)),d!==f&&C(e,d,f,r,p,i),++u<=--h&&N(e,c,o),c!==T&&C(e,c,T,r,o,i),null!=T.dom&&(o=T.dom),d=t[--m],T=n[h],c=t[++s],f=n[u];for(;s<=m&&u<=h&&d.key===T.key;)d!==T&&C(e,d,T,r,o,i),null!=T.dom&&(o=T.dom),d=t[--m],T=n[--h];if(h<u)q(e,t,s,m+1);else if(m<s)_(e,n,u,h+1,r,o,i);else{for(var v,y,a=o,g=h-u+1,w=new Array(g),b=0,x=0,S=2147483647,k=0,x=0;x<g;x++)w[x]=-1;for(x=h;u<=x;x--){var T,E=(v=null==v?function(e,t,n){for(var r=Object.create(null);t<n;t++){var o=e[t];null==o||null!=(o=o.key)&&(r[o]=t)}return r}(t,s,m+1):v)[(T=n[x]).key];null!=E&&(S=E<S?E:-1,d=t[w[x-u]=E],t[E]=null,d!==T&&C(e,d,T,r,o,i),null!=T.dom&&(o=T.dom),k++)}if(o=a,k!==m-s+1&&q(e,t,s,m+1),0===k)_(e,n,u,h+1,r,o,i);else if(-1===S)for(b=(y=function(e){for(var t=[0],n=0,r=0,o=0,i=O.length=e.length,o=0;o<i;o++)O[o]=e[o];for(o=0;o<i;++o)if(-1!==e[o]){var l=t[t.length-1];if(e[l]<e[o])O[o]=l,t.push(o);else{for(n=0,r=t.length-1;n<r;){var a=(n>>>1)+(r>>>1)+(n&r&1);e[t[a]]<e[o]?n=1+a:r=a}e[o]<e[t[n]]&&(0<n&&(O[o]=t[n-1]),t[n]=o)}}n=t.length,r=t[n-1];for(;0<n--;)t[n]=r,r=O[r];return O.length=0,t}(w)).length-1,x=h;u<=x;x--)f=n[x],-1===w[x-u]?A(e,f,r,i,o):y[b]===x-u?b--:N(e,f,o),null!=f.dom&&(o=n[x].dom);else for(x=h;u<=x;x--)f=n[x],-1===w[x-u]&&A(e,f,r,i,o),null!=f.dom&&(o=n[x].dom)}}else{for(var j=(t.length<n.length?t:n).length,u=u<s?u:s;u<j;u++)(c=t[u])===(f=n[u])||null==c&&null==f||(null==c?A(e,f,r,i,z(t,u+1,o)):null==f?I(e,c):C(e,c,f,r,z(t,u+1,o),i));t.length>j&&q(e,t,u,t.length),n.length>j&&_(e,n,u,n.length,r,o,i)}}}function C(e,t,n,r,o,i){var l,a,u,s,c,f=t.tag;if(f===n.tag){if(n.state=t.state,n.events=t.events,!function(e,t){do{var n;if(null!=e.attrs&&"function"==typeof e.attrs.onbeforeupdate)if(void 0!==(n=h.call(e.attrs.onbeforeupdate,e,t))&&!n)break;if("string"!=typeof e.tag&&"function"==typeof e.state.onbeforeupdate)if(void 0!==(n=h.call(e.state.onbeforeupdate,e,t))&&!n)break;return!1}while(0);return e.dom=t.dom,e.domSize=t.domSize,e.instance=t.instance,e.attrs=t.attrs,e.children=t.children,e.text=t.text,!0}(n,t))if("string"==typeof f)switch(null!=n.attrs&&L(n.attrs,n,r),f){case"#":!function(e,t){e.children.toString()!==t.children.toString()&&(e.dom.nodeValue=t.children);t.dom=e.dom}(t,n);break;case"<":l=e,u=n,s=i,c=o,(a=t).children!==u.children?(b(l,a),v(l,u,s,c)):(u.dom=a.dom,u.domSize=a.domSize,u.instance=a.instance);break;case"[":!function(e,t,n,r,o,i){y(e,t.children,n.children,r,o,i);var l=0,a=n.children;if(n.dom=null,null!=a){for(var u=0;u<a.length;u++){var s=a[u];null!=s&&null!=s.dom&&(null==n.dom&&(n.dom=s.dom),l+=s.domSize||1)}1!==l&&(n.domSize=l)}}(e,t,n,r,o,i);break;default:!function(e,t,n,r){var o=t.dom=e.dom;r=m(t)||r,"textarea"===t.tag&&(null==t.attrs&&(t.attrs={}),null!=t.text&&(t.attrs.value=t.text,t.text=void 0));(function(e,t,n,r){if(null!=n)for(var o in n)S(e,o,t&&t[o],n[o],r);var i;if(null!=t)for(var o in t)null==(i=t[o])||null!=n&&null!=n[o]||function(e,t,n,r){"key"===t||"is"===t||null==n||k(t)||("o"!==t[0]||"n"!==t[1]||k(t)?"style"===t?E(e.dom,n,null):!T(e,t,r)||"className"===t||"value"===t&&("option"===e.tag||"select"===e.tag&&-1===e.dom.selectedIndex&&e.dom===d())||"input"===e.tag&&"type"===t?(-1!==(r=t.indexOf(":"))&&(t=t.slice(r+1)),!1!==n&&e.dom.removeAttribute("className"===t?"class":t)):e.dom[t]=null:j(e,t,void 0))}(e,o,i,r)})(t,e.attrs,t.attrs,r),w(t)||(null!=e.text&&null!=t.text&&""!==t.text?e.text.toString()!==t.text.toString()&&(e.dom.firstChild.nodeValue=t.text):(null!=e.text&&(e.children=[$("#",void 0,void 0,e.text,void 0,e.dom.firstChild)]),null!=t.text&&(t.children=[$("#",void 0,void 0,t.text,void 0,void 0)]),y(o,e.children,t.children,n,null,r)))}(t,n,r,i)}else!function(e,t,n,r,o,i){if(n.instance=$.normalize(h.call(n.state.view,n)),n.instance===n)throw Error("A view cannot return the vnode it received as argument");L(n.state,n,r),null!=n.attrs&&L(n.attrs,n,r);null!=n.instance?(null==t.instance?A(e,n.instance,r,i,o):C(e,t.instance,n.instance,r,o,i),n.dom=n.instance.dom,n.domSize=n.instance.domSize):null!=t.instance?(I(e,t.instance),n.dom=void 0,n.domSize=0):(n.dom=t.dom,n.domSize=t.domSize)}(e,t,n,r,o,i)}else I(e,t),A(e,n,r,i,o)}var O=[];function z(e,t,n){for(;t<e.length;t++)if(null!=e[t]&&null!=e[t].dom)return e[t].dom;return n}function N(e,t,n){var r=p.createDocumentFragment();!function e(t,n,r){for(;null!=r.dom&&r.dom.parentNode===t;){if("string"!=typeof r.tag){if(null!=(r=r.instance))continue}else if("<"===r.tag)for(var o=0;o<r.instance.length;o++)n.appendChild(r.instance[o]);else if("["!==r.tag)n.appendChild(r.dom);else if(1===r.children.length){if(null!=(r=r.children[0]))continue}else for(var o=0;o<r.children.length;o++){var i=r.children[o];null!=i&&e(t,n,i)}break}}(e,r,t),g(e,r,n)}function g(e,t,n){null!=n?e.insertBefore(t,n):e.appendChild(t)}function w(e){if(null!=e.attrs&&(null!=e.attrs.contenteditable||null!=e.attrs.contentEditable)){var t=e.children;if(null!=t&&1===t.length&&"<"===t[0].tag){var n=t[0].children;e.dom.innerHTML!==n&&(e.dom.innerHTML=n)}else if(null!=e.text||null!=t&&0!==t.length)throw new Error("Child node of a contenteditable must be trusted");return 1}}function q(e,t,n,r){for(var o=n;o<r;o++){var i=t[o];null!=i&&I(e,i)}}function I(e,t){var n,r,o,i,l=0,a=t.state;function u(){s(t,a),x(t),f(e,t)}"string"!=typeof t.tag&&"function"==typeof t.state.onbeforeremove&&null!=(o=h.call(t.state.onbeforeremove,t))&&"function"==typeof o.then&&(l=1,n=o),t.attrs&&"function"==typeof t.attrs.onbeforeremove&&null!=(o=h.call(t.attrs.onbeforeremove,t))&&"function"==typeof o.then&&(l|=2,r=o),s(t,a),l?(null!=n&&n.then(i=function(){1&l&&((l&=2)||u())},i),null!=r&&r.then(i=function(){2&l&&((l&=1)||u())},i)):(x(t),f(e,t))}function b(e,t){for(var n=0;n<t.instance.length;n++)e.removeChild(t.instance[n])}function f(e,t){for(;null!=t.dom&&t.dom.parentNode===e;){if("string"!=typeof t.tag){if(null!=(t=t.instance))continue}else if("<"===t.tag)b(e,t);else{if("["!==t.tag&&(e.removeChild(t.dom),!Array.isArray(t.children)))break;if(1===t.children.length){if(null!=(t=t.children[0]))continue}else for(var n=0;n<t.children.length;n++){var r=t.children[n];null!=r&&f(e,r)}}break}}function x(e){if("string"!=typeof e.tag&&"function"==typeof e.state.onremove&&h.call(e.state.onremove,e),e.attrs&&"function"==typeof e.attrs.onremove&&h.call(e.attrs.onremove,e),"string"!=typeof e.tag)null!=e.instance&&x(e.instance);else{var t=e.children;if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];null!=r&&x(r)}}}function S(e,t,n,r,o){if("key"!==t&&"is"!==t&&null!=r&&!k(t)&&(n!==r||(i=e,"value"===(l=t)||"checked"===l||"selectedIndex"===l||"selected"===l&&i.dom===d()||"option"===i.tag&&i.dom.parentNode===p.activeElement)||"object"===a(r))){var i,l;if("o"===t[0]&&"n"===t[1])return j(e,t,r),0;if("xlink:"===t.slice(0,6))e.dom.setAttributeNS("http://www.w3.org/1999/xlink",t.slice(6),r);else if("style"===t)E(e.dom,n,r);else if(T(e,t,o)){if("value"===t){if(("input"===e.tag||"textarea"===e.tag)&&e.dom.value===""+r&&e.dom===d())return;if("select"===e.tag&&null!==n&&e.dom.value===""+r)return;if("option"===e.tag&&null!==n&&e.dom.value===""+r)return}"input"===e.tag&&"type"===t?e.dom.setAttribute(t,r):e.dom[t]=r}else"boolean"==typeof r?r?e.dom.setAttribute(t,""):e.dom.removeAttribute(t):e.dom.setAttribute("className"===t?"class":t,r)}}function k(e){return"oninit"===e||"oncreate"===e||"onupdate"===e||"onremove"===e||"onbeforeremove"===e||"onbeforeupdate"===e}function T(e,t,n){return void 0===n&&(-1<e.tag.indexOf("-")||null!=e.attrs&&e.attrs.is||"href"!==t&&"list"!==t&&"form"!==t&&"width"!==t&&"height"!==t)&&t in e.dom}var n=/[A-Z]/g;function r(e){return"-"+e.toLowerCase()}function i(e){return"-"===e[0]&&"-"===e[1]?e:"cssFloat"===e?"float":e.replace(n,r)}function E(e,t,n){if(t!==n)if(null==n)e.style.cssText="";else if("object"!==a(n))e.style.cssText=n;else if(null==t||"object"!==a(t))for(var r in e.style.cssText="",n)null!=(o=n[r])&&e.style.setProperty(i(r),String(o));else{for(var r in n){var o;null!=(o=n[r])&&(o=String(o))!==String(t[r])&&e.style.setProperty(i(r),o)}for(var r in t)null!=t[r]&&null==n[r]&&e.style.removeProperty(i(r))}}function o(){this._=u}function j(e,t,n){null!=e.events?e.events[t]!==n&&(null==n||"function"!=typeof n&&"object"!==a(n)?(null!=e.events[t]&&e.dom.removeEventListener(t.slice(2),e.events,!1),e.events[t]=void 0):(null==e.events[t]&&e.dom.addEventListener(t.slice(2),e.events,!1),e.events[t]=n)):null==n||"function"!=typeof n&&"object"!==a(n)||(e.events=new o,e.dom.addEventListener(t.slice(2),e.events,!1),e.events[t]=n)}function P(e,t,n){"function"==typeof e.oninit&&h.call(e.oninit,t),"function"==typeof e.oncreate&&n.push(h.bind(e.oncreate,t))}function L(e,t,n){"function"==typeof e.onupdate&&n.push(h.bind(e.onupdate,t))}return(o.prototype=Object.create(null)).handleEvent=function(e){var t,n=this["on"+e.type];"function"==typeof n?t=n.call(e.currentTarget,e):"function"==typeof n.handleEvent&&n.handleEvent(e),this._&&!1!==e.redraw&&(0,this._)(),!1===t&&(e.preventDefault(),e.stopPropagation())},function(e,t,n){if(!e)throw new TypeError("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var r=[],o=d(),i=e.namespaceURI;null==e.vnodes&&(e.textContent=""),t=$.normalizeChildren(Array.isArray(t)?t:[t]);var l=u;try{u="function"==typeof n?n:void 0,y(e,e.vnodes,t,r,null,"http://www.w3.org/1999/xhtml"===i?void 0:i)}finally{u=l}e.vnodes=t,null!=o&&d()!==o&&"function"==typeof o.focus&&o.focus();for(var a=0;a<r.length;a++)r[a]()}}},{"../render/vnode":24}],23:[function(e,t,n){"use strict";var r=e("../render/vnode");t.exports=function(e){return r("<",void 0,void 0,e=null==e?"":e,void 0,void 0)}},{"../render/vnode":24}],24:[function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t,n,r,o,i){return{tag:e,key:t,attrs:n,children:r,text:o,dom:i,domSize:void 0,state:void 0,events:void 0,instance:void 0}}o.normalize=function(e){return Array.isArray(e)?o("[",void 0,void 0,o.normalizeChildren(e),void 0,void 0):null==e||"boolean"==typeof e?null:"object"===r(e)?e:o("#",void 0,void 0,String(e),void 0,void 0)},o.normalizeChildren=function(e){var t=[];if(e.length){for(var n=null!=e[0]&&null!=e[0].key,r=1;r<e.length;r++)if((null!=e[r]&&null!=e[r].key)!=n)throw new TypeError("Vnodes must either always have keys or never have keys!");for(r=0;r<e.length;r++)t[r]=o.normalize(e[r])}return t},t.exports=o},{}],25:[function(e,t,n){"use strict";var r=e("./promise/promise"),o=e("./mount-redraw");t.exports=e("./request/request")(window,r,o.redraw)},{"./mount-redraw":9,"./promise/promise":15,"./request/request":26}],26:[function(e,t,n){"use strict";var s=e("../pathname/build");t.exports=function(m,n,a){var l=0;function u(e){return new n(e)}function e(l){return function(t,r){"string"!=typeof t?t=(r=t).url:null==r&&(r={});var e=new n(function(n,e){l(s(t,r.params),r,function(e){if("function"==typeof r.type)if(Array.isArray(e))for(var t=0;t<e.length;t++)e[t]=new r.type(e[t]);else e=new r.type(e);n(e)},e)});if(!0===r.background)return e;var o=0;function i(){0==--o&&"function"==typeof a&&a()}return function t(n){var r=n.then;n.constructor=u;n.then=function(){o++;var e=r.apply(n,arguments);return e.then(i,function(e){if(i(),0===o)throw e}),t(e)};return n}(e)}}function h(e,t){for(var n in e.headers)if({}.hasOwnProperty.call(e.headers,n)&&t.test(n))return 1}return u.prototype=n.prototype,u.__proto__=n,{request:e(function(i,l,a,u){var e,t,n=null!=l.method?l.method.toUpperCase():"GET",r=l.body,o=!(null!=l.serialize&&l.serialize!==JSON.serialize||r instanceof m.FormData),s=l.responseType||("function"==typeof l.extract?"":"json"),c=new m.XMLHttpRequest,f=!1,d=c,p=c.abort;for(t in c.abort=function(){f=!0,p.call(this)},c.open(n,i,!1!==l.async,"string"==typeof l.user?l.user:void 0,"string"==typeof l.password?l.password:void 0),o&&null!=r&&!h(l,/^content-type$/i)&&c.setRequestHeader("Content-Type","application/json; charset=utf-8"),"function"==typeof l.deserialize||h(l,/^accept$/i)||c.setRequestHeader("Accept","application/json, text/*"),l.withCredentials&&(c.withCredentials=l.withCredentials),l.timeout&&(c.timeout=l.timeout),c.responseType=s,l.headers)!{}.hasOwnProperty.call(l.headers,t)||c.setRequestHeader(t,l.headers[t]);c.onreadystatechange=function(e){if(!f&&4===e.target.readyState)try{var t,n=200<=e.target.status&&e.target.status<300||304===e.target.status||/^file:\/\//i.test(i),r=e.target.response;if("json"===s?e.target.responseType||"function"==typeof l.extract||(r=JSON.parse(e.target.responseText)):s&&"text"!==s||null==r&&(r=e.target.responseText),"function"==typeof l.extract?(r=l.extract(e.target,l),n=!0):"function"==typeof l.deserialize&&(r=l.deserialize(r)),n)a(r);else{try{t=e.target.responseText}catch(e){t=r}var o=new Error(t);o.code=e.target.status,o.response=r,u(o)}}catch(e){u(e)}},"function"==typeof l.config&&(c=l.config(c,l,i)||c)!==d&&(e=c.abort,c.abort=function(){f=!0,e.call(this)}),null==r?c.send():"function"==typeof l.serialize?c.send(l.serialize(r)):r instanceof m.FormData?c.send(r):c.send(JSON.stringify(r))}),jsonp:e(function(e,t,n,r){var o=t.callbackName||"_mithril_"+Math.round(1e16*Math.random())+"_"+l++,i=m.document.createElement("script");m[o]=function(e){delete m[o],i.parentNode.removeChild(i),n(e)},i.onerror=function(){delete m[o],i.parentNode.removeChild(i),r(new Error("JSONP request failed"))},i.src=e+(e.indexOf("?")<0?"?":"&")+encodeURIComponent(t.callbackKey||"callback")+"="+encodeURIComponent(o),m.document.documentElement.appendChild(i)})}}},{"../pathname/build":11}],27:[function(e,t,n){"use strict";var r=e("./mount-redraw");t.exports=e("./api/router")(window,r)},{"./api/router":6,"./mount-redraw":9}],28:[function(e,t,n){"use strict";var r,o,t=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{o="function"==typeof clearTimeout?clearTimeout:l}catch(e){o=l}}();var u,s=[],c=!1,f=-1;function d(){c&&u&&(c=!1,u.length?s=u.concat(s):f=-1,s.length&&p())}function p(){if(!c){var e=a(d);c=!0;for(var t=s.length;t;){for(u=s,s=[];++f<t;)u&&u[f].run();f=-1,t=s.length}u=null,c=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===l||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function h(){}t.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new m(e,t)),1!==s.length||c||a(p)},m.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=h,t.addListener=h,t.once=h,t.off=h,t.removeListener=h,t.removeAllListeners=h,t.emit=h,t.prependListener=h,t.prependOnceListener=h,t.listeners=function(e){return[]},t.binding=function(e){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(e){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},{}],29:[function(u,e,s){!function(n,a){!function(){"use strict";var r=u("process/browser.js").nextTick,e=Function.prototype.apply,o=Array.prototype.slice,i={},l=0;function t(e,t){this._id=e,this._clearFn=t}s.setTimeout=function(){return new t(e.call(setTimeout,window,arguments),clearTimeout)},s.setInterval=function(){return new t(e.call(setInterval,window,arguments),clearInterval)},s.clearTimeout=s.clearInterval=function(e){e.close()},t.prototype.unref=t.prototype.ref=function(){},t.prototype.close=function(){this._clearFn.call(window,this._id)},s.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},s.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},s._unrefActive=s.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0<=t&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},s.setImmediate="function"==typeof n?n:function(e){var t=l++,n=!(arguments.length<2)&&o.call(arguments,1);return i[t]=!0,r(function(){i[t]&&(n?e.apply(null,n):e.call(null),s.clearImmediate(t))}),t},s.clearImmediate="function"==typeof a?a:function(e){delete i[e]}}.call(this)}.call(this,u("timers").setImmediate,u("timers").clearImmediate)},{"process/browser.js":28,timers:29}]},{},[4]);PK     M\7J  J  #  ecommerce3/assets/src/js/_wizard.jsnu [        const i18n = mc4wp_ecommerce.i18n;
const m = require('mithril');

function a(mount, type, ids) {
	let running = false;
	let current = 0;
	let progress = 0.00;
	let done = ids.length === 0;
	let log = [];
	let statusLabel = mount.parentElement.querySelector('.mc4wp-status-label');

	const tick = () => {
		m.request({
			method: 'POST',
			url: window.ajaxurl + `?action=mc4wp_ecommerce_sync_${type}`,
			body: ids.slice(current, current + 10)
		}).then((results) => {
			current += results.length
			progress = current / ids.length;

			// add results to log
			log.push({
				date: new Date(),
				messages: results,
			})

			// keep going or finish
			if (current < ids.length) {
				tick();
			} else {
				running = false;
				done = true;
			}
		})
	}

	const toggle = function() {
		statusLabel.parentNode.removeChild(statusLabel);

		running = !running;
		if (!running) {
			return;
		}

		tick();
	}

	const scrollToBottom = function(vnode) {
		vnode.dom.scrollTop = vnode.dom.scrollHeight;
	}

	return {
		view: function() {
			return m('div', [
					m('p', [
						m('button.button', { onclick: toggle, disabled: done }, done ? 'All done!' : running ? 'Stop' : 'Start'),
						" ",
						(running ? m('span.description', (progress * 100).toFixed(2) + '% — Please wait... This can take a while if you have many ' + type + '.') : ''),
					]),
					m('div.mc4wp-margin-m', { style: log.length > 0 ? 'display: block;' : 'display: none;' }, [
						m('div.results', { style: 'max-height: 240px; overflow-y: scroll;', oncreate: scrollToBottom, onupdate: scrollToBottom }, log.map(l => m('div.mc4wp-margin-s', [
							m('div', [ m('strong', l.date.toLocaleString() )]),
							l.messages.map(msg => m('div', msg)),
						]))),
						m('p', [
							m('a', { href: '', onclick: (evt) => { evt.preventDefault(); log = []; } }, 'Clear results'),
						])
					])
				]);
		}
	}
}

[].forEach.call(document.querySelectorAll('[data-wizard]'), (mount) => {
	let type = mount.getAttribute('data-wizard'),
		objectIds = JSON.parse(mount.getAttribute('data-object-ids'));

	m.mount(mount, a(mount, type, objectIds));
})


PK     M\;[    #  ecommerce3/assets/src/js/_cookie.jsnu [        /**
 * Creates a cookie
 *
 * @param name
 * @param value
 * @param days
 */
function create (name, value, days) {
  let expires

  if (days) {
    const date = new Date()
    date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000))
    expires = '; expires=' + date.toGMTString()
  } else {
    expires = ''
  }
  document.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) + expires + '; path=/'
}

/**
 * Reads a cookie
 *
 * @param name
 * @returns {*}
 */
function read (name) {
  const nameEQ = encodeURIComponent(name) + '='
  const ca = document.cookie.split(';')
  for (let i = 0; i < ca.length; i++) {
    let c = ca[i]
    while (c.charAt(0) === ' ') c = c.substring(1, c.length)
    if (c.indexOf(nameEQ) === 0) return decodeURIComponent(c.substring(nameEQ.length, c.length))
  }
  return null
}

/**
 * Erases a cookie
 *
 * @param name
 */
function erase (name) {
  create(name, '', -1)
}

module.exports = { read, create, erase }
PK     M\j;;  ;  )  ecommerce3/assets/src/js/_confirm-attr.jsnu [        'use strict';

module.exports = function(i18n) {
    var confirmationElements = document.querySelectorAll('[data-confirm]');
    for( var i=0; i<confirmationElements.length; i++ ) {
        var element = confirmationElements[i];
        element.addEventListener(element.tagName === 'FORM' ? 'submit' : 'click', function(e) {
            var sure = confirm(e.target.getAttribute('data-confirm') || i18n.confirmation);

            if( ! sure ) {
                e.preventDefault();
                return false;
            }

            return true;
        });
    }
};PK     M\       ecommerce3/assets/src/js/cart.jsnu [        'use strict';

const checkoutForm = document.querySelector('form.woocommerce-checkout, form[name="checkout"]');
let previousEmailAddress = '';
let previousDataString;
let formSubmitted = false;
const ajaxurl = typeof(mc4wp_ecommerce_cart) !== "undefined" ? mc4wp_ecommerce_cart.ajax_url : woocommerce_params.ajax_url;

function isEmailAddressValid(emailAddress) {
   const regex = /\S+@\S+\.\S+/;
   return typeof(emailAddress) === "string" && emailAddress !== '' && regex.test(emailAddress);
}

function getFieldValue(fieldName) {
   let field = checkoutForm.querySelector(`[name="${fieldName}"]`);
   if (!field) {
      return '';
   }

   return field.value.trim();
}

function sendFormData(async) {
   let data = {
      previous_billing_email: previousEmailAddress,
      billing_email:  getFieldValue('billing_email'),
      billing_first_name:  getFieldValue('billing_first_name'),
      billing_last_name:  getFieldValue('billing_last_name'),
      billing_address_1:  getFieldValue('billing_address_1'),
      billing_address_2:  getFieldValue('billing_address_2'),
      billing_city:  getFieldValue('billing_city'),
      billing_state:  getFieldValue('billing_state'),
      billing_postcode:  getFieldValue('billing_postcode'),
      billing_country:  getFieldValue('billing_country'),
   };
   const dataString = JSON.stringify(data);

   // schedule cart update if email looks valid && data changed.
   if( isEmailAddressValid(data.billing_email) && dataString !== previousDataString ) {
      const request = new XMLHttpRequest();
      request.open('POST', ajaxurl + "?action=mc4wp_ecommerce_schedule_cart", async);
      request.setRequestHeader('Content-Type', 'application/json');
      request.send(dataString);

      previousDataString = dataString;
      previousEmailAddress = data.billing_email;
   }
}

if( checkoutForm ) {
   checkoutForm.addEventListener('change', function() {
      sendFormData(true);
   });

   checkoutForm.addEventListener('submit', function() {
      formSubmitted = true;
   });

   // always send before unloading window, but not if form was submitted
   window.addEventListener('beforeunload', function() {
      if( ! formSubmitted ) {
         sendFormData(false);
      }
   });
}

PK     M\-d  d  #  ecommerce3/assets/src/js/tracker.jsnu [        const cookie = require('./_cookie.js');

function getUrlValue(key) {
	const regex = new RegExp(key+'=([^&]+)');
	const matches = regex.exec(window.location.search)
	if (matches && matches.length > 0) {
		return matches[1];
	}

	return '';
}

// set mc_cid, mc_eid & mc_tc cookies if url params are set
[ 'mc_cid', 'mc_eid', 'mc_tc' ].forEach((name) => {
	const value = getUrlValue(name);
	if (value !== '') {
		cookie.create(name, value, 14);
	}
})

// store landing site in mc_landing_site cookie, if not set
if (!cookie.read('mc_landing_site')) {
	cookie.create('mc_landing_site', window.location.href, 7);
}

PK     M\L-℩    !  ecommerce3/assets/src/js/admin.jsnu [        const m = require('mithril');
const QueueProcessor = require('./_queue-processor.js');

// ask for confirmation for elements with [data-confirm] attribute
require('./_confirm-attr.js')();

// initial sync wizards for orders and products
require('./_wizard.js');


// queue processor
const queueRootElement = document.getElementById('queue-processor');
if (queueRootElement) {
    m.mount(queueRootElement, QueueProcessor);
}
PK     M\1  1  ,  ecommerce3/assets/src/js/_queue-processor.jsnu [        'use strict';

const m = require('mithril');
let qp = {};
const i18n = mc4wp_ecommerce.i18n;
const state = {
   working: false,
   done: false,
   action: "process",
};

function chooseProcess(e) {
  state.action = e.target.value;
}

function chooseReset(e) {
  if(confirm(i18n.confirmation)) {
    state.action = e.target.value;
  } else {
    e.preventDefault();
  }
}

function process(e) {
    e && e.preventDefault();

    state.working = true;
    state.done = false;

    m.request({
      method: "POST",
      url: ajaxurl + "?action=" + "mc4wp_ecommerce_"+ state.action +"_queue",
    }).then(function(result) {
       state.done = true;
       state.working = false;

       // update element stating number of pending background jobs
       document.getElementById('mc4wp-pending-background-jobs-count').innerText = "0";
    }).catch(function(e) {
       console.log(e);
    })
}

qp.view = function() {
    return m('form', {
        method: "POST",
        onsubmit: process,
    }, [
       m('p', [
          m( 'button', {
               type: "submit",
               className: "button button-primary",
               value: 'process',
               disabled: state.working || state.done,
               onclick: chooseProcess,
           }, state.done && state.action === 'process' ? i18n.done : i18n.process),
          m.trust('&nbsp; or &nbsp;'),
          m( 'button', {
               type: "submit",
               className: "button button-link-delete",
               value: 'reset',
               disabled: state.working || state.done,
               onclick: chooseReset,
           }, state.done && state.action === 'reset' ? i18n.done : i18n.reset),
       ]),
       state.working ? m('p.description', [ ' ', m('span.mc4wp-loader'), ' ', m('span', i18n.processing )]) : ''
    ]);
};

module.exports = qp;
PK     M\U9Pj  j  #  ecommerce3/assets/src/css/admin.cssnu [        .mc4wp-status-label {
    border: 1px solid #333;
    padding: 3px 5px;
    font-size: 12px;
    font-weight: normal;
    margin-left: 20px;
    display: inline-block;
}

#mc4wp-admin.ecommerce {
    max-width: 1000px;
}

.mc4wp-well {
    background: white;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    display: block;
    max-width: 820px;
    border: 1px solid #bbb;
}

.mc4wp-well h3 {
    margin-top: 0;
}

.mc4wp-well p:last-of-type,
.mc4wp-well .submit {
    margin-bottom: 0;
}

.mc4wp-wizard-steps-nav {
    font-size: 14px;
    color: #666;
    display: inline-block;
}

.mc4wp-wizard-steps-nav div {
    display: inline-block;
    margin: 20px;
}

.mc4wp-wizard-steps-nav .current {
    color: #222;
    font-weight: bold;
}

.mc4wp-wizard-steps-nav a:before,
.mc4wp-wizard-steps-nav span:before {
    content: "/ ";
    color: #BBB;
}

.mc4wp-wizard-steps-nav a,
.mc4wp-wizard-steps-nav span {
    margin-right: 5px;
    color: #666;
    text-decoration: none;
}

.mc4wp-wizard {
    max-width: 680px;
}

.mc4wp-wizard .submit input,
.mc4wp-wizard .submit a {
    float: right;
}

.mc4wp-loader {
    margin-left: 12px;
}

#mc4wp-admin.ecommerce label.choice-wrap,
#mc4wp-admin.ecommerce input[type="radio"] + label,
#mc4wp-admin.ecommerce input[type="checkbox"] + label {
    font-weight: normal;
    display: inline-block;
    margin-right: 12px;
}
PK     M\X&JC  C    ecommerce3/assets/css/admin.cssnu [        .mc4wp-status-label{border:1px solid #333;padding:3px 5px;font-size:12px;font-weight:400;margin-left:20px;display:inline-block}#mc4wp-admin.ecommerce{max-width:1000px}.mc4wp-well{background:#fff;padding:20px;width:100%;box-sizing:border-box;display:block;max-width:820px;border:1px solid #bbb}.mc4wp-well h3{margin-top:0}.mc4wp-well .submit,.mc4wp-well p:last-of-type{margin-bottom:0}.mc4wp-wizard-steps-nav{font-size:14px;color:#666;display:inline-block}.mc4wp-wizard-steps-nav div{display:inline-block;margin:20px}.mc4wp-wizard-steps-nav .current{color:#222;font-weight:700}.mc4wp-wizard-steps-nav a:before,.mc4wp-wizard-steps-nav span:before{content:"/ ";color:#bbb}.mc4wp-wizard-steps-nav a,.mc4wp-wizard-steps-nav span{margin-right:5px;color:#666;text-decoration:none}.mc4wp-wizard{max-width:680px}.mc4wp-wizard .submit a,.mc4wp-wizard .submit input{float:right}.mc4wp-loader{margin-left:12px}#mc4wp-admin.ecommerce input[type=checkbox]+label,#mc4wp-admin.ecommerce input[type=radio]+label,#mc4wp-admin.ecommerce label.choice-wrap{font-weight:400;display:inline-block;margin-right:12px}PK     M\v3  3    ecommerce3/README.mdnu [        ### Mailchimp for WordPress E-Commerce

This plugin contains all E-Commerce related functionality for Mailchimp for WordPress.

Not sure how to install this plugin? Please have a look at the [installation guide](https://www.mc4wp.com/kb/installation-instructions/).

More help articles can be found in [our knowledge base](https://www.mc4wp.com/kb/) or in our [code reference](http://developer.mc4wp.com/) for developers.

Enjoy!

Danny, Harish & Arne
[mc4wp.com](https://www.mc4wp.com)

Mailchimp for WordPress is a product by [ibericode](https://ibericode.com/)PK       M\Ԣ      -                multiple-forms/includes/class-forms-table.phpnu [        PK       M\k  k  5            !  multiple-forms/includes/class-widget-enhancements.phpnu [        PK       M\/m̳    '            (  multiple-forms/includes/class-admin.phpnu [        PK       M\	pm    !            -  multiple-forms/multiple-forms.phpnu [        PK       M\U$F  F  '            B/  multiple-forms/views/forms-overview.phpnu [        PK       M\U                  5  multiple-forms/README.mdnu [        PK       M\E/              6  package-lock.jsonnu [        PK       M\=F  F              W ecommerce2/ecommerce2.phpnu [        PK       M\3PR	  	  $            ^ ecommerce2/includes/class-worker.phpnu [        PK       M\QK  K  %            th ecommerce2/includes/class-tracker.phpnu [        PK       M\G    3            u ecommerce2/includes/views/track-previous-orders.phpnu [        PK       M\:pL    &            B{ ecommerce2/includes/views/settings.phpnu [        PK       M\q_'  _'  '            ~ ecommerce2/includes/class-ecommerce.phpnu [        PK       M\nK
  
  $            ] ecommerce2/includes/class-helper.phpnu [        PK       M\B֐e!%  !%  #            K ecommerce2/includes/class-admin.phpnu [        PK       M\d    %             ecommerce2/includes/class-command.phpnu [        PK       M\I"c
  c
               ecommerce2/assets/js/admin.jsnu [        PK       M\ڊ!_  _  !            ^ ecommerce2/assets/src/js/admin.jsnu [        PK       M\H    )             ecommerce2/assets/src/js/_progress-bar.jsnu [        PK       M\G    $            : ecommerce2/assets/src/js/_request.jsnu [        PK       M\	  	  *            ! includes/class-required-plugins-notice.phpnu [        PK       M\g    /            	 logging/includes/class-dashboard-log-widget.phpnu [        PK       M\<t@{  {  #            	 logging/includes/class-log-item.phpnu [        PK       M\*/'  '               	 logging/includes/class-graph.phpnu [        PK       M\=*=  =  !            ;	 logging/includes/class-logger.phpnu [        PK       M\xR  R              y	 logging/includes/functions.phpnu [        PK       M\lRf$  $  $            |	 logging/includes/class-installer.phpnu [        PK       M\,Apx  x  '            %	 logging/includes/class-log-exporter.phpnu [        PK       M\Uq&  &  $            	 logging/includes/class-log-table.phpnu [        PK       M\1)Hn&  &                	 logging/includes/class-admin.phpnu [        PK       M\-l!+ + %            	 logging/assets/js/admin-statistics.jsnu [        PK       M\is)    )            { logging/assets/src/js/admin-statistics.jsnu [        PK       M\D\9  9                logging/assets/src/css/admin.cssnu [        PK       M\^mլ                P logging/assets/css/admin.cssnu [        PK       M\z      8             logging/migrations/4.6.2-change-datetime-column-type.phpnu [        PK       M\{    3             logging/migrations/3.0-update-integration-types.phpnu [        PK       M\c  c  )             logging/migrations/3.0-update-columns.phpnu [        PK       M\ч      /             logging/migrations/4.5.10-url-column-length.phpnu [        PK       M\[    1             logging/migrations/3.2-change-table-structure.phpnu [        PK       M\    &            $ logging/migrations/3.2-update-data.phpnu [        PK       M\4x\  \  0            a logging/migrations/4.7.3-change-column-types.phpnu [        PK       M\Sy    )             logging/migrations/3.0-remove-success.phpnu [        PK       M\-7    '             logging/migrations/3.0-create-table.phpnu [        PK       M\r|	  |	  &            z logging/views/admin-reports-export.phpnu [        PK       M\8    (            L logging/views/admin-reports-advanced.phpnu [        PK       M\y                B logging/views/admin-reports.phpnu [        PK       M\Dv+    (            0	 logging/views/admin-reports-log_item.phpnu [        PK       M\|^    #             logging/views/admin-reports-log.phpnu [        PK       M\M  M  *            Z logging/views/admin-reports-statistics.phpnu [        PK       M\(3  3  2            1 logging/views/admin-reports-log_item_not_found.phpnu [        PK       M\X)  )              2 logging/logging.phpnu [        PK       M\QF                  6 logging/README.mdnu [        PK       M\j?~    .            6 email-notifications/includes/class-factory.phpnu [        PK       M\
  
  ,            ? email-notifications/includes/class-admin.phpnu [        PK       M\c%yv32  32  9            +K email-notifications/includes/class-email-notification.phpnu [        PK       M\-I`    &            } email-notifications/assets/js/admin.jsnu [        PK       M\3    *            5 email-notifications/assets/src/js/admin.jsnu [        PK       M\O    <            k email-notifications/migrations/3.0.5-more-email-settings.phpnu [        PK       M\5+a    &            Ǌ email-notifications/views/settings.phpnu [        PK       M\tݕ                  Ȗ email-notifications/README.mdnu [        PK       M\3Pb[    +             email-notifications/email-notifications.phpnu [        PK       M\\:  :  (             ajax-forms/includes/class-ajax-forms.phpnu [        PK       M\pb    #             ajax-forms/includes/class-admin.phpnu [        PK       M\sl  l  "            ̯ ajax-forms/assets/js/ajax-forms.jsnu [        PK       M\ˋF  F  (             ajax-forms/assets/src/js/_form-loader.jsnu [        PK       M\]],    &            ( ajax-forms/assets/src/js/ajax-forms.jsnu [        PK       M\\FO  O  )            B ajax-forms/assets/src/img/ajax-loader.gifnu [        PK       M\\FO  O  %             ajax-forms/assets/img/ajax-loader.gifnu [        PK       M\%u/w  w               ajax-forms/ajax-forms.phpnu [        PK       M\ *7R                  N ajax-forms/README.mdnu [        PK       M\;ǋ                 licensing/licensing.phpnu [        PK       M\UJ    !             licensing/class-api-exception.phpnu [        PK       M\w                 E licensing/views/license-form.phpnu [        PK       M\[T7  7              N licensing/class-api-client.phpnu [        PK       M\zxA-  A-               licensing/class-admin.phpnu [        PK       M\6.oC    %            ]# ecommerce-loader/ecommerce-loader.phpnu [        PK       M\                F& mc4wp-premium.phpnu [        PK       M\q728  8              n3 CHANGELOG.mdnu [        PK       M\SJ~      	             info.jsonnu [        PK       M\y                 user-sync/src/class-worker.phpnu [        PK       M\S 
   
                user-sync/src/class-observer.phpnu [        PK       M\([cj  j  #             user-sync/src/class-cli-command.phpnu [        PK       M\Mߒ                 user-sync/src/functions.phpnu [        PK       M\H:    !             user-sync/src/default-filters.phpnu [        PK       M\ d!  d!               user-sync/src/class-users.phpnu [        PK       M\ˁ    $            s  user-sync/src/class-user-handler.phpnu [        PK       M\|l  l  (             user-sync/src/class-webhook-listener.phpnu [        PK       M\mLS    %            O& user-sync/src/class-ajax-listener.phpnu [        PK       M\_Xj(  j(              Z2 user-sync/src/class-admin.phpnu [        PK       M\N                [ user-sync/src/class-tools.phpnu [        PK       M\P+  +              b user-sync/assets/js/admin.jsnu [        PK       M\&~5  5  '            s user-sync/assets/src/js/admin/wizard.jsnu [        PK       M\,n`ު    '             user-sync/assets/src/js/admin/logger.jsnu [        PK       M\0    -              user-sync/assets/src/js/admin/field-mapper.jsnu [        PK       M\s      %             user-sync/assets/src/js/admin/user.jsnu [        PK       M\؎e  e                user-sync/assets/src/js/admin.jsnu [        PK       M\f  f  "             user-sync/assets/src/css/admin.cssnu [        PK       M\}P`B  B               user-sync/assets/css/admin.cssnu [        PK       M\oe                 user-sync/user-sync.phpnu [        PK       M\	a4  a4  !            k$ user-sync/views/settings-page.phpnu [        PK       M\3*                  Y user-sync/vendor/autoload.phpnu [        PK       M\t!ו      1            Z user-sync/vendor/composer/autoload_namespaces.phpnu [        PK       M\Ԩ*    -            [ user-sync/vendor/composer/autoload_static.phpnu [        PK       M\ .  .  !            c` user-sync/vendor/composer/LICENSEnu [        PK       M\GG    +            d user-sync/vendor/composer/autoload_real.phpnu [        PK       M\z4  4  )            l user-sync/vendor/composer/ClassLoader.phpnu [        PK       M\D      +             user-sync/vendor/composer/autoload_psr4.phpnu [        PK       M\AeG?  ?  /             user-sync/vendor/composer/autoload_classmap.phpnu [        PK       M\?                   vendor/autoload.phpnu [        PK       M\t!ו      '             vendor/composer/autoload_namespaces.phpnu [        PK       M\S                t vendor/composer/installed.phpnu [        PK       M\!L    #             vendor/composer/autoload_static.phpnu [        PK       M\ .  .               vendor/composer/LICENSEnu [        PK       M\,"k{7  7  !             vendor/composer/autoload_real.phpnu [        PK       M\5Ky>  >               vendor/composer/ClassLoader.phpnu [        PK       M\T":  :  %             vendor/composer/InstalledVersions.phpnu [        PK       M\D      !            > vendor/composer/autoload_psr4.phpnu [        PK       M\s|
  
  %            d? vendor/composer/autoload_classmap.phpnu [        PK       M\GO    ,            J append-form-to-post/includes/class-admin.phpnu [        PK       M\F%    -            S append-form-to-post/includes/class-plugin.phpnu [        PK       M\?2"  "  +            [ append-form-to-post/append-form-to-post.phpnu [        PK       M\v-`                W] lucy/lucy.phpnu [        PK       M\*,L                b lucy/assets/js/script.jsnu [        PK       M\3T  T  &            e( lucy/assets/src/js/third-party/lucy.jsnu [        PK       M\4  4              < lucy/assets/src/js/script.jsnu [        PK       M\-a	  	              @ lucy/assets/src/css/styles.cssnu [        PK       M\                `J lucy/assets/css/styles.cssnu [        PK       M\뚊      <            Q styles-builder/includes/migrations/3.0.2-file-permission.phpnu [        PK       M\I|ۋC	  C	  (            R styles-builder/includes/class-public.phpnu [        PK       M\P<-  -  '            H\ styles-builder/includes/class-admin.phpnu [        PK       M\[L  L  0            m styles-builder/includes/class-styles-builder.phpnu [        PK       M\M      *             styles-builder/assets/js/styles-builder.jsnu [        PK       M\(  (  2             styles-builder/assets/src/js/_accordion-element.jsnu [        PK       M\vR  R  '             styles-builder/assets/src/js/_option.jsnu [        PK       M\C0"  0"  -            7 styles-builder/assets/src/js/_form-preview.jsnu [        PK       M\    .             styles-builder/assets/src/js/styles-builder.jsnu [        PK       M\0O    *             styles-builder/assets/src/js/_accordion.jsnu [        PK       M\O$:    +             styles-builder/assets/src/css/admin.css.mapnu [        PK       M\y̒к    +            J styles-builder/assets/src/css/admin.min.cssnu [        PK       M\$~    '            _ styles-builder/assets/src/css/admin.cssnu [        PK       M\y̒к    '            P styles-builder/assets/css/admin.min.cssnu [        PK       M\y̒к    #            a" styles-builder/assets/css/admin.cssnu [        PK       M\e5      !            n& styles-builder/styles-builder.phpnu [        PK       M\^"    #            ' styles-builder/views/css-styles.phpnu [        PK       M\Ǿb1    %            F styles-builder/views/form-preview.phpnu [        PK       M\`  `  '            .L styles-builder/views/styles-builder.phpnu [        PK       M\A!                U styles-builder/README.mdnu [        PK       M\Ɵ    +             custom-color-theme/includes/class-theme.phpnu [        PK       M\Ϲ    /             custom-color-theme/includes/class-rgb-color.phpnu [        PK       M\BEHW    +            ! custom-color-theme/includes/class-admin.phpnu [        PK       M\ˌ    '            + custom-color-theme/views/custom-css.phpnu [        PK       M\va    $            	 custom-color-theme/views/setting.phpnu [        PK       M\J0  0  )            Z custom-color-theme/custom-color-theme.phpnu [        PK       M\<5                   custom-color-theme/README.mdnu [        PK       M\ԐЬ    	             README.mdnu [        PK       M\!*
                 autocomplete/autocomplete.phpnu [        PK       M\Pc    ,             autocomplete/includes/class-autocomplete.phpnu [        PK       M\a    %             autocomplete/includes/class-admin.phpnu [        PK       M\ط    &             autocomplete/assets/js/autocomplete.jsnu [        PK       M\    *             autocomplete/assets/src/js/autocomplete.jsnu [        PK       M\}$    ,             autocomplete/assets/src/css/autocomplete.cssnu [        PK       M\AY8  8  (             autocomplete/assets/css/autocomplete.cssnu [        PK       M\j1                   autocomplete/README.mdnu [        PK       M\3ٕ&p
  p
  1             post-campaign/includes/class-gutenberg-editor.phpnu [        PK       M\p    8            U post-campaign/includes/class-post-mailchimp-campaign.phpnu [        PK       M\>0?  ?              u% post-campaign/template.htmlnu [        PK       M\><R^  ^              e post-campaign/post-campaign.phpnu [        PK       M\aTC;58  58  ,            ig post-campaign/dist/js/admin/post-campaign.jsnu [        PK       M\.& l5  5  4             post-campaign/dist/js/admin/post-campaign.min.js.mapnu [        PK       M\¹(  (  0             post-campaign/dist/js/admin/post-campaign.min.jsnu [        PK       M\J.2  2               post-campaign/.gitattributesnu [        PK       M\R{                  ecommerce3/ecommerce3.phpnu [        PK       M\
I{$  {$  $            ! ecommerce3/includes/class-worker.phpnu [        PK       M\;r~  ~  "            % ecommerce3/includes/class-ajax.phpnu [        PK       M\a    -            3 ecommerce3/includes/class-object-observer.phpnu [        PK       M\7u0x  x  !            7 ecommerce3/includes/functions.phpnu [        PK       M\Tem    .            H ecommerce3/includes/class-product-observer.phpnu [        PK       M\	    %            T ecommerce3/includes/class-tracker.phpnu [        PK       M\	  	  $            @h ecommerce3/includes/views/wizard.phpnu [        PK       M\(  (  (            nr ecommerce3/includes/views/admin-page.phpnu [        PK       M\Oh  h  3            ˚ ecommerce3/includes/views/parts/config-products.phpnu [        PK       M\X  X  1             ecommerce3/includes/views/parts/config-orders.phpnu [        PK       M\s;    0            O ecommerce3/includes/views/parts/config-store.phpnu [        PK       M\BK7q  q  (             ecommerce3/includes/views/edit-store.phpnu [        PK       M\9F&  &  "            K ecommerce3/includes/class-lock.phpnu [        PK       M\rd  rd  '            ù ecommerce3/includes/class-ecommerce.phpnu [        PK       M\DY    $             ecommerce3/includes/class-helper.phpnu [        PK       M\Z9  9  -            p4 ecommerce3/includes/class-transformer-wc2.phpnu [        PK       M\ToM  oM  -            m ecommerce3/includes/class-transformer-wc3.phpnu [        PK       M\<  <  -             ecommerce3/includes/interface-transformer.phpnu [        PK       M\BX  X  ,            4 ecommerce3/includes/class-order-observer.phpnu [        PK       M\+2  +2  #             ecommerce3/includes/class-admin.phpnu [        PK       M\b|-  -  %            f ecommerce3/includes/class-command.phpnu [        PK       M\J'  J'  +            + ecommerce3/includes/class-cart-observer.phpnu [        PK       M\]6Z    *            }S ecommerce3/includes/class-object-count.phpnu [        PK       M\?                {V ecommerce3/assets/js/cart.jsnu [        PK       M\                \ ecommerce3/assets/js/tracker.jsnu [        PK       M\:Fh    $            !b ecommerce3/assets/js/cart.min.js.mapnu [        PK       M\UV                 v ecommerce3/assets/js/cart.min.jsnu [        PK       M\ȗS-  -              n| ecommerce3/assets/js/admin.jsnu [        PK       M\pLc Lc %            
 ecommerce3/assets/js/admin.min.js.mapnu [        PK       M\0L    #            n ecommerce3/assets/js/tracker.min.jsnu [        PK       M\u-5a  a  '            s ecommerce3/assets/js/tracker.min.js.mapnu [        PK       M\o-      !             ecommerce3/assets/js/admin.min.jsnu [        PK       M\7J  J  #             ecommerce3/assets/src/js/_wizard.jsnu [        PK       M\;[    #            ! ecommerce3/assets/src/js/_cookie.jsnu [        PK       M\j;;  ;  )            % ecommerce3/assets/src/js/_confirm-attr.jsnu [        PK       M\                 M( ecommerce3/assets/src/js/cart.jsnu [        PK       M\-d  d  #            ^1 ecommerce3/assets/src/js/tracker.jsnu [        PK       M\L-℩    !            4 ecommerce3/assets/src/js/admin.jsnu [        PK       M\1  1  ,            6 ecommerce3/assets/src/js/_queue-processor.jsnu [        PK       M\U9Pj  j  #            = ecommerce3/assets/src/css/admin.cssnu [        PK       M\X&JC  C              YC ecommerce3/assets/css/admin.cssnu [        PK       M\v3  3              G ecommerce3/README.mdnu [        PK     