Version Description
Download this release
Release Info
Developer | techjewel |
Plugin | Contact Form Plugin – Fastest Contact Form Builder Plugin for WordPress by Fluent Forms |
Version | 1.1.1 |
Comparing to | |
See all releases |
Version 1.1.1
- app/Databases/DatabaseMigrator.php +24 -0
- app/Databases/Migrations/FormAnalytics.php +49 -0
- app/Databases/Migrations/FormMeta.php +42 -0
- app/Databases/Migrations/FormSubmissionMeta.php +53 -0
- app/Databases/Migrations/FormSubmissions.php +57 -0
- app/Databases/Migrations/FormTransactions.php +59 -0
- app/Databases/Migrations/Forms.php +40 -0
- app/Global/Common.php +134 -0
- app/Helpers/Helper.php +48 -0
- app/Hooks/Ajax.php +172 -0
- app/Hooks/Backend.php +35 -0
- app/Hooks/Common.php +17 -0
- app/Hooks/Frontend.php +14 -0
- app/Modules/Acl/Acl.php +90 -0
- app/Modules/Activator.php +44 -0
- app/Modules/AnalyticsModule.php +13 -0
- app/Modules/Component/Component.php +607 -0
- app/Modules/Deactivator.php +15 -0
- app/Modules/EditorButtonModule.php +62 -0
- app/Modules/Entries/Entries.php +308 -0
- app/Modules/Entries/EntryQuery.php +91 -0
- app/Modules/Entries/Export.php +75 -0
- app/Modules/Form/Analytics.php +120 -0
- app/Modules/Form/Form.php +262 -0
- app/Modules/Form/FormHandler.php +314 -0
- app/Modules/Form/Inputs.php +39 -0
- app/Modules/Form/Settings/ExtraSettings.php +95 -0
- app/Modules/Form/Settings/FormSettings.php +129 -0
- app/Modules/Form/Settings/Validator/Confirmations.php +74 -0
- app/Modules/Form/Settings/Validator/MailChimps.php +67 -0
- app/Modules/Form/Settings/Validator/Notifications.php +91 -0
- app/Modules/Form/Settings/Validator/Validator.php +26 -0
- app/Modules/Integration/BaseIntegration.php +103 -0
- app/Modules/Integration/MailChimpIntegration.php +167 -0
- app/Modules/ProcessExteriorModule.php +70 -0
- app/Modules/ReCaptcha/ReCaptcha.php +41 -0
- app/Modules/Registerer/Menu.php +286 -0
- app/Modules/Renderer/GlobalSettings/Settings.php +52 -0
- app/Modules/Settings/Settings.php +175 -0
- app/Providers/BackendProvider.php +30 -0
- app/Providers/CommonProvider.php +30 -0
- app/Providers/CsvProvider.php +13 -0
- app/Providers/FluentValidatorProvider.php +13 -0
- app/Providers/FormBuilderProvider.php +35 -0
- app/Providers/FrontendProvider.php +30 -0
- app/Providers/MenuProvider.php +46 -0
- app/Providers/WpFluentProvider.php +13 -0
- app/Services/Browser/Browser.php +1733 -0
- app/Services/ConditionAssesor.php +72 -0
- app/Services/FormBuilder/Components.php +116 -0
- app/Services/FormBuilder/Components/ActionHook.php +29 -0
- app/Services/FormBuilder/Components/Address.php +53 -0
- app/Services/FormBuilder/Components/BaseComponent.php +213 -0
- app/Services/FormBuilder/Components/Checkable.php +46 -0
- app/Services/FormBuilder/Components/Container.php +48 -0
- app/Services/FormBuilder/Components/CustomHtml.php +19 -0
- app/Services/FormBuilder/Components/DateTime.php +54 -0
- app/Services/FormBuilder/Components/FormStep.php +98 -0
- app/Services/FormBuilder/Components/Name.php +45 -0
- app/Services/FormBuilder/Components/Recaptcha.php +39 -0
- app/Services/FormBuilder/Components/Repeat.php +58 -0
- app/Services/FormBuilder/Components/SectionBreak.php +25 -0
- app/Services/FormBuilder/Components/Select.php +53 -0
- app/Services/FormBuilder/Components/SelectCountry.php +80 -0
- app/Services/FormBuilder/Components/Shortcode.php +27 -0
- app/Services/FormBuilder/Components/SubmitButton.php +26 -0
- app/Services/FormBuilder/Components/TermsAndConditions.php +41 -0
- app/Services/FormBuilder/Components/Text.php +30 -0
- app/Services/FormBuilder/Components/TextArea.php +32 -0
- app/Services/FormBuilder/CountryNames.php +269 -0
- app/Services/FormBuilder/DefaultElements.php +1030 -0
- app/Services/FormBuilder/EditorShortcodeParser.php +158 -0
- app/Services/FormBuilder/FormBuilder.php +141 -0
- app/Services/FormBuilder/GroupSetterProxy.php +39 -0
- app/Services/FormBuilder/Notifications/EmailNotification.php +70 -0
- app/Services/FormParser.php +325 -0
- app/Services/FormResponseParser.php +71 -0
- app/Services/Integrations/MailChimp.php +441 -0
- app/Services/Providers/MailChimp.php +148 -0
- app/Services/Slack.php +117 -0
- app/Services/csv/LICENSE +20 -0
- app/Services/csv/autoload.php +23 -0
- app/Services/csv/composer.json +49 -0
- app/Services/csv/src/AbstractCsv.php +273 -0
- app/Services/csv/src/Config/Controls.php +235 -0
- app/Services/csv/src/Config/Output.php +309 -0
- app/Services/csv/src/Exception/InvalidRowException.php +71 -0
- app/Services/csv/src/Modifier/MapIterator.php +56 -0
- app/Services/csv/src/Modifier/QueryFilter.php +298 -0
- app/Services/csv/src/Modifier/RowFilter.php +187 -0
- app/Services/csv/src/Modifier/StreamFilter.php +299 -0
- app/Services/csv/src/Modifier/StreamIterator.php +334 -0
- app/Services/csv/src/Plugin/ColumnConsistencyValidator.php +100 -0
- app/Services/csv/src/Plugin/ForbiddenNullValuesValidator.php +39 -0
- app/Services/csv/src/Plugin/SkipNullValuesFormatter.php +37 -0
- app/Services/csv/src/Reader.php +339 -0
- app/Services/csv/src/Writer.php +170 -0
- app/Services/fluentvalidator/autoload.php +24 -0
- app/Services/fluentvalidator/fluentvalidator.php +21 -0
- app/Services/fluentvalidator/src/Arr.php +169 -0
- app/Services/fluentvalidator/src/MessageBag.php +220 -0
- app/Services/fluentvalidator/src/ValidatesAttributes.php +261 -0
- app/Services/fluentvalidator/src/ValidationRuleParser.php +42 -0
- app/Services/fluentvalidator/src/Validator.php +238 -0
- app/Services/wpfluent/autoload.php +27 -0
- app/Services/wpfluent/libs/viocon/autoload.php +24 -0
- app/Services/wpfluent/libs/viocon/src/Viocon/AliasFacade.php +47 -0
- app/Services/wpfluent/libs/viocon/src/Viocon/Container.php +140 -0
- app/Services/wpfluent/libs/viocon/src/Viocon/VioconException.php +7 -0
- app/Services/wpfluent/src/AliasFacade.php +43 -0
- app/Services/wpfluent/src/Connection.php +186 -0
- app/Services/wpfluent/src/EventHandler.php +98 -0
- app/Services/wpfluent/src/Exception.php +6 -0
- app/Services/wpfluent/src/QueryBuilder/Adapters/BaseAdapter.php +545 -0
- app/Services/wpfluent/src/QueryBuilder/Adapters/Mysql.php +9 -0
- app/Services/wpfluent/src/QueryBuilder/JoinBuilder.php +45 -0
- app/Services/wpfluent/src/QueryBuilder/NestedCriteria.php +20 -0
- app/Services/wpfluent/src/QueryBuilder/QueryBuilderHandler.php +1135 -0
- app/Services/wpfluent/src/QueryBuilder/QueryObject.php +102 -0
- app/Services/wpfluent/src/QueryBuilder/Raw.php +34 -0
- app/Services/wpfluent/src/QueryBuilder/Transaction.php +27 -0
- app/Services/wpfluent/src/QueryBuilder/TransactionHaltException.php +7 -0
- app/Services/wpfluent/wpfluent.php +36 -0
- app/index.php +2 -0
- config/app.php +32 -0
- config/fluentform.php +36 -0
- config/index.php +2 -0
- fluentform.php +20 -0
- framework/Config/Config.php +138 -0
- framework/Config/ConfigProvider.php +70 -0
- framework/Exception/ExceptionHandler.php +79 -0
- framework/Exception/UnResolveableEntityException.php +8 -0
- framework/Foundation/AppFacade.php +43 -0
- framework/Foundation/AppProvider.php +43 -0
- framework/Foundation/Application.php +251 -0
- framework/Foundation/Bootstrap.php +204 -0
- framework/Foundation/Container.php +316 -0
- framework/Foundation/Facade.stub +10 -0
- framework/Foundation/FacadeLoaderTrait.php +57 -0
- framework/Foundation/HelpersTrait.php +331 -0
- framework/Foundation/HookReference.php +47 -0
- framework/Foundation/PathsAndUrlsTrait.php +155 -0
- framework/Foundation/Provider.php +36 -0
- framework/Foundation/SetGetAttributesTrait.php +114 -0
- framework/Helpers/ArrayHelper.php +162 -0
- framework/Request/Request.php +216 -0
- framework/Request/RequestProvider.php +19 -0
- framework/View/View.php +32 -0
- framework/View/ViewProvider.php +19 -0
- framework/index.php +2 -0
- glue.json +19 -0
- index.php +2 -0
- public/css/fluent-all-forms.css +2 -0
- public/css/fluent-all-forms.css.map +1 -0
- public/css/fluent-forms-admin-sass.css +2 -0
- public/css/fluent-forms-admin-sass.css.map +1 -0
- public/css/fluent-forms-admin.css +2 -0
- public/css/fluent-forms-admin.css.map +1 -0
- public/css/fluent-forms-public.css +2 -0
- public/css/fluent-forms-public.css.map +1 -0
- public/css/fluentform-public-default.css +2 -0
- public/css/fluentform-public-default.css.map +1 -0
- public/css/settings_global.css +2 -0
- public/css/settings_global.css.map +1 -0
- public/fonts/element-icons.ttf +0 -0
- public/fonts/element-icons.woff +0 -0
- public/fonts/fluentform.eot +0 -0
- public/fonts/fluentform.svg +55 -0
- public/fonts/fluentform.ttf +0 -0
- public/fonts/fluentform.woff +0 -0
- public/fonts/vendor/element-ui/lib/theme-chalk/element-icons.ttf +0 -0
- public/fonts/vendor/element-ui/lib/theme-chalk/element-icons.woff +0 -0
- public/images/handle.png +0 -0
- public/images/resize.png +0 -0
- public/img/icon_black_small.png +0 -0
- public/img/recaptcha-placeholder.png +0 -0
- public/js/fluent-all-forms-admin.js +2 -0
- public/js/fluent-all-forms-admin.js.map +1 -0
app/Databases/DatabaseMigrator.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Databases;
|
4 |
+
|
5 |
+
use FluentForm\App\Databases\Migrations\FormAnalytics;
|
6 |
+
use FluentForm\App\Databases\Migrations\Forms;
|
7 |
+
use FluentForm\App\Databases\Migrations\FormMeta;
|
8 |
+
use FluentForm\App\Databases\Migrations\FormSubmissions;
|
9 |
+
use FluentForm\App\Databases\Migrations\FormTransactions;
|
10 |
+
use FluentForm\App\Databases\Migrations\FormSubmissionMeta;
|
11 |
+
use FluentForm\App\Modules\Form\Form;
|
12 |
+
|
13 |
+
class DatabaseMigrator
|
14 |
+
{
|
15 |
+
public static function run()
|
16 |
+
{
|
17 |
+
Forms::migrate();
|
18 |
+
FormMeta::migrate();
|
19 |
+
FormSubmissions::migrate();
|
20 |
+
FormSubmissionMeta::migrate();
|
21 |
+
FormTransactions::migrate();
|
22 |
+
FormAnalytics::migrate();
|
23 |
+
}
|
24 |
+
}
|
app/Databases/Migrations/FormAnalytics.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Databases\Migrations;
|
4 |
+
|
5 |
+
class FormAnalytics
|
6 |
+
{
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Migrate the table.
|
10 |
+
*
|
11 |
+
* @return void
|
12 |
+
*/
|
13 |
+
public static function migrate()
|
14 |
+
{
|
15 |
+
global $wpdb;
|
16 |
+
|
17 |
+
$charsetCollate = $wpdb->get_charset_collate();
|
18 |
+
|
19 |
+
$table = $wpdb->prefix.'fluentform_form_analytics';
|
20 |
+
|
21 |
+
$formTable = $wpdb->prefix.'fluentform_forms';
|
22 |
+
|
23 |
+
if ($wpdb->get_var("SHOW TABLES LIKE '$table'") != $table) {
|
24 |
+
$sql = "CREATE TABLE $table (
|
25 |
+
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
26 |
+
`form_id` INT UNSIGNED NULL,
|
27 |
+
`user_id` INT UNSIGNED NULL,
|
28 |
+
`source_url` VARCHAR(255) NOT NULL,
|
29 |
+
`platform` CHAR(30) NULL,
|
30 |
+
`browser` CHAR(30) NULL,
|
31 |
+
`city` VARCHAR (100) NULL,
|
32 |
+
`country` VARCHAR (100) NULL,
|
33 |
+
`ip` CHAR(15) NULL,
|
34 |
+
`count` INT DEFAULT 1,
|
35 |
+
`created_at` TIMESTAMP NULL,
|
36 |
+
PRIMARY KEY (`id`),
|
37 |
+
INDEX `fluent_analytics_form_id_idx` (`form_id` ASC),
|
38 |
+
CONSTRAINT `fk_fluent_form_meta_analytics_id`
|
39 |
+
FOREIGN KEY (`form_id`)
|
40 |
+
REFERENCES $formTable (`id`)
|
41 |
+
ON DELETE CASCADE
|
42 |
+
ON UPDATE CASCADE) $charsetCollate;";
|
43 |
+
|
44 |
+
require_once(ABSPATH.'wp-admin/includes/upgrade.php');
|
45 |
+
|
46 |
+
dbDelta($sql);
|
47 |
+
}
|
48 |
+
}
|
49 |
+
}
|
app/Databases/Migrations/FormMeta.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Databases\Migrations;
|
4 |
+
|
5 |
+
class FormMeta
|
6 |
+
{
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Migrate the table.
|
10 |
+
*
|
11 |
+
* @return void
|
12 |
+
*/
|
13 |
+
public static function migrate()
|
14 |
+
{
|
15 |
+
global $wpdb;
|
16 |
+
|
17 |
+
$charsetCollate = $wpdb->get_charset_collate();
|
18 |
+
|
19 |
+
$table = $wpdb->prefix.'fluentform_form_meta';
|
20 |
+
|
21 |
+
$formTable = $wpdb->prefix.'fluentform_forms';
|
22 |
+
|
23 |
+
if ($wpdb->get_var("SHOW TABLES LIKE '$table'") != $table) {
|
24 |
+
$sql = "CREATE TABLE $table (
|
25 |
+
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
26 |
+
`form_id` INT UNSIGNED NULL,
|
27 |
+
`meta_key` VARCHAR(255) NOT NULL,
|
28 |
+
`value` LONGTEXT NULL,
|
29 |
+
PRIMARY KEY (`id`),
|
30 |
+
INDEX `fluent_form_id_idx` (`form_id` ASC),
|
31 |
+
CONSTRAINT `fk_fluent_form_meta_form_id`
|
32 |
+
FOREIGN KEY (`form_id`)
|
33 |
+
REFERENCES $formTable (`id`)
|
34 |
+
ON DELETE CASCADE
|
35 |
+
ON UPDATE CASCADE) $charsetCollate;";
|
36 |
+
|
37 |
+
require_once(ABSPATH.'wp-admin/includes/upgrade.php');
|
38 |
+
|
39 |
+
dbDelta($sql);
|
40 |
+
}
|
41 |
+
}
|
42 |
+
}
|
app/Databases/Migrations/FormSubmissionMeta.php
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Databases\Migrations;
|
4 |
+
|
5 |
+
class FormSubmissionMeta
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Migrate the table.
|
9 |
+
*
|
10 |
+
* @return void
|
11 |
+
*/
|
12 |
+
public static function migrate()
|
13 |
+
{
|
14 |
+
global $wpdb;
|
15 |
+
|
16 |
+
$charsetCollate = $wpdb->get_charset_collate();
|
17 |
+
|
18 |
+
$table = $wpdb->prefix.'fluentform_submission_meta';
|
19 |
+
|
20 |
+
$submissionsTable = $wpdb->prefix.'fluentform_submissions';
|
21 |
+
|
22 |
+
$formTable = $wpdb->prefix.'fluentform_forms';
|
23 |
+
|
24 |
+
if ($wpdb->get_var("SHOW TABLES LIKE '$table'") != $table) {
|
25 |
+
$sql = "CREATE TABLE $table (
|
26 |
+
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
|
27 |
+
`response_id` BIGINT(20) UNSIGNED NULL,
|
28 |
+
`form_id` INT UNSIGNED NULL,
|
29 |
+
`meta_key` VARCHAR(45) NULL,
|
30 |
+
`value` LONGTEXT NULL,
|
31 |
+
`status` VARCHAR(45) NULL,
|
32 |
+
`user_id` INT UNSIGNED NULL,
|
33 |
+
`name` VARCHAR(45) NULL,
|
34 |
+
`created_at` TIMESTAMP NULL,
|
35 |
+
`updated_at` TIMESTAMP NULL,
|
36 |
+
PRIMARY KEY (`id`),
|
37 |
+
INDEX `fluent_response_id_idx` (`response_id` ASC),
|
38 |
+
CONSTRAINT `fk_fluent_response_meta_response_id`
|
39 |
+
FOREIGN KEY (`response_id`)
|
40 |
+
REFERENCES $submissionsTable (`id`)
|
41 |
+
ON DELETE CASCADE
|
42 |
+
ON UPDATE CASCADE,
|
43 |
+
CONSTRAINT `fk_fluent_response_meta_form_id`
|
44 |
+
FOREIGN KEY (`form_id`)
|
45 |
+
REFERENCES $formTable (`id`)
|
46 |
+
ON DELETE CASCADE
|
47 |
+
ON UPDATE CASCADE) $charsetCollate;";
|
48 |
+
|
49 |
+
require_once(ABSPATH.'wp-admin/includes/upgrade.php');
|
50 |
+
dbDelta($sql);
|
51 |
+
}
|
52 |
+
}
|
53 |
+
}
|
app/Databases/Migrations/FormSubmissions.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Databases\Migrations;
|
4 |
+
|
5 |
+
class FormSubmissions
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Migrate the table.
|
9 |
+
*
|
10 |
+
* @return void
|
11 |
+
*/
|
12 |
+
public static function migrate()
|
13 |
+
{
|
14 |
+
global $wpdb;
|
15 |
+
|
16 |
+
$charsetCollate = $wpdb->get_charset_collate();
|
17 |
+
|
18 |
+
$table = $wpdb->prefix.'fluentform_submissions';
|
19 |
+
|
20 |
+
$formTable = $wpdb->prefix.'fluentform_forms';
|
21 |
+
|
22 |
+
if ($wpdb->get_var("SHOW TABLES LIKE '$table'") != $table) {
|
23 |
+
$sql = "CREATE TABLE $table (
|
24 |
+
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
|
25 |
+
`form_id` INT UNSIGNED NULL,
|
26 |
+
`serial_number` INT UNSIGNED NULL,
|
27 |
+
`response` LONGTEXT NULL,
|
28 |
+
`source_url` VARCHAR(255) NULL,
|
29 |
+
`user_id` INT UNSIGNED NULL,
|
30 |
+
`status` VARCHAR(45) NULL DEFAULT 'unread' COMMENT 'possible values: read, unread, trashed',
|
31 |
+
`is_favourite` TINYINT(1) NOT NULL DEFAULT 0,
|
32 |
+
`browser` VARCHAR(45) NULL,
|
33 |
+
`device` VARCHAR(45) NULL,
|
34 |
+
`ip` VARCHAR(45) NULL,
|
35 |
+
`city` VARCHAR(45) NULL,
|
36 |
+
`country` VARCHAR(45) NULL,
|
37 |
+
`payment_status` VARCHAR(45) NULL,
|
38 |
+
`payment_method` VARCHAR(45) NULL,
|
39 |
+
`payment_type` VARCHAR(45) NULL,
|
40 |
+
`currency` VARCHAR(45) NULL,
|
41 |
+
`total_paid` FLOAT NULL,
|
42 |
+
`created_at` TIMESTAMP NULL,
|
43 |
+
`updated_at` TIMESTAMP NULL,
|
44 |
+
PRIMARY KEY (`id`),
|
45 |
+
INDEX `fluent_form_id_idx` (`form_id` ASC),
|
46 |
+
CONSTRAINT `fk_fluent_responses_form_id`
|
47 |
+
FOREIGN KEY (`form_id`)
|
48 |
+
REFERENCES $formTable (`id`)
|
49 |
+
ON DELETE CASCADE
|
50 |
+
ON UPDATE CASCADE) $charsetCollate;";
|
51 |
+
|
52 |
+
require_once(ABSPATH.'wp-admin/includes/upgrade.php');
|
53 |
+
|
54 |
+
dbDelta($sql);
|
55 |
+
}
|
56 |
+
}
|
57 |
+
}
|
app/Databases/Migrations/FormTransactions.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Databases\Migrations;
|
4 |
+
|
5 |
+
class FormTransactions
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Migrate the table.
|
9 |
+
*
|
10 |
+
* @return void
|
11 |
+
*/
|
12 |
+
public static function migrate()
|
13 |
+
{
|
14 |
+
global $wpdb;
|
15 |
+
|
16 |
+
$charsetCollate = $wpdb->get_charset_collate();
|
17 |
+
|
18 |
+
$table = $wpdb->prefix.'fluentform_transactions';
|
19 |
+
|
20 |
+
$submissionsTable = $wpdb->prefix.'fluentform_submissions';
|
21 |
+
|
22 |
+
$formTable = $wpdb->prefix.'fluentform_forms';
|
23 |
+
|
24 |
+
if ($wpdb->get_var("SHOW TABLES LIKE '$table'") != $table) {
|
25 |
+
$sql = "CREATE TABLE $table (
|
26 |
+
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
27 |
+
`form_id` INT UNSIGNED NULL,
|
28 |
+
`response_id` BIGINT(20) UNSIGNED NULL,
|
29 |
+
`currency` VARCHAR(45) NULL,
|
30 |
+
`charge_id` VARCHAR(45) NULL,
|
31 |
+
`card_type` VARCHAR(45) NULL,
|
32 |
+
`amount` VARCHAR(45) NULL,
|
33 |
+
`payment_method` VARCHAR(45) NULL,
|
34 |
+
`payment_status` VARCHAR(45) NULL,
|
35 |
+
`payment_type` VARCHAR(45) NULL,
|
36 |
+
`payer_email` VARCHAR(255) NULL,
|
37 |
+
`user_id` INT UNSIGNED NULL,
|
38 |
+
`created_at` TIMESTAMP NULL,
|
39 |
+
`updated_at` TIMESTAMP NULL,
|
40 |
+
PRIMARY KEY (`id`),
|
41 |
+
INDEX `form_id_idx` (`form_id` ASC),
|
42 |
+
INDEX `response_id_idx` (`response_id` ASC),
|
43 |
+
CONSTRAINT `fk_fluent_transactions_form_id`
|
44 |
+
FOREIGN KEY (`form_id`)
|
45 |
+
REFERENCES $formTable (`id`)
|
46 |
+
ON DELETE CASCADE
|
47 |
+
ON UPDATE CASCADE,
|
48 |
+
CONSTRAINT `fk_fluent_transactions_response_id`
|
49 |
+
FOREIGN KEY (`response_id`)
|
50 |
+
REFERENCES $submissionsTable (`id`)
|
51 |
+
ON DELETE CASCADE
|
52 |
+
ON UPDATE CASCADE ) $charsetCollate;";
|
53 |
+
|
54 |
+
require_once(ABSPATH.'wp-admin/includes/upgrade.php');
|
55 |
+
|
56 |
+
dbDelta($sql);
|
57 |
+
}
|
58 |
+
}
|
59 |
+
}
|
app/Databases/Migrations/Forms.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Databases\Migrations;
|
4 |
+
|
5 |
+
class Forms
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Migrate the table.
|
9 |
+
*
|
10 |
+
* @return void
|
11 |
+
*/
|
12 |
+
public static function migrate()
|
13 |
+
{
|
14 |
+
global $wpdb;
|
15 |
+
|
16 |
+
$charsetCollate = $wpdb->get_charset_collate();
|
17 |
+
|
18 |
+
$table = $wpdb->prefix.'fluentform_forms';
|
19 |
+
|
20 |
+
if ($wpdb->get_var("SHOW TABLES LIKE '$table'") != $table) {
|
21 |
+
$sql = "CREATE TABLE $table (
|
22 |
+
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
23 |
+
`title` VARCHAR(255) NOT NULL,
|
24 |
+
`status` VARCHAR(45) NULL DEFAULT 'Draft',
|
25 |
+
`appearance_settings` TEXT NULL,
|
26 |
+
`form_fields` LONGTEXT NULL,
|
27 |
+
`has_payment` TINYINT(1) NOT NULL DEFAULT 0,
|
28 |
+
`type` VARCHAR(45) NULL,
|
29 |
+
`conditions` TEXT NULL,
|
30 |
+
`created_by` INT NULL,
|
31 |
+
`created_at` TIMESTAMP NULL,
|
32 |
+
`updated_at` TIMESTAMP NULL,
|
33 |
+
PRIMARY KEY (`id`)) $charsetCollate;";
|
34 |
+
|
35 |
+
require_once(ABSPATH.'wp-admin/includes/upgrade.php');
|
36 |
+
|
37 |
+
dbDelta($sql);
|
38 |
+
}
|
39 |
+
}
|
40 |
+
}
|
app/Global/Common.php
ADDED
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Declare common (backend|frontend) global functions here
|
5 |
+
* but try not to use any global functions unless you need.
|
6 |
+
*/
|
7 |
+
|
8 |
+
if (! function_exists('dd')) {
|
9 |
+
function dd()
|
10 |
+
{
|
11 |
+
foreach (func_get_args() as $value) {
|
12 |
+
echo "<pre>";
|
13 |
+
print_r($value);
|
14 |
+
echo "</pre><br>";
|
15 |
+
}
|
16 |
+
die;
|
17 |
+
}
|
18 |
+
}
|
19 |
+
|
20 |
+
if (! function_exists('fluentformMix')) {
|
21 |
+
/**
|
22 |
+
* Get the path to a versioned Mix file.
|
23 |
+
*
|
24 |
+
* @param string $path
|
25 |
+
* @param string $manifestDirectory
|
26 |
+
*
|
27 |
+
* @return string
|
28 |
+
* @throws \Exception
|
29 |
+
*/
|
30 |
+
function fluentformMix($path, $manifestDirectory = '')
|
31 |
+
{
|
32 |
+
$env = \FluentForm\App::make('config')->app['env'];
|
33 |
+
|
34 |
+
if ($env != 'dev') {
|
35 |
+
$publicUrl = \FluentForm\App::publicUrl();
|
36 |
+
|
37 |
+
return $publicUrl.$path;
|
38 |
+
}
|
39 |
+
|
40 |
+
static $manifests = [];
|
41 |
+
|
42 |
+
if (substr($path, 0, 1) !== '/') {
|
43 |
+
$path = "/".$path;
|
44 |
+
}
|
45 |
+
|
46 |
+
if ($manifestDirectory && substr($manifestDirectory, 0, 1) !== '/') {
|
47 |
+
$manifestDirectory = "/".$manifestDirectory;
|
48 |
+
}
|
49 |
+
|
50 |
+
$publicPath = \FluentForm\App::publicPath();
|
51 |
+
if (file_exists($publicPath.'/hot')) {
|
52 |
+
return (is_ssl() ? "https" : "http")."://localhost:8080".$path;
|
53 |
+
}
|
54 |
+
|
55 |
+
$manifestPath = $publicPath.$manifestDirectory.'mix-manifest.json';
|
56 |
+
|
57 |
+
if (! isset($manifests[$manifestPath])) {
|
58 |
+
if (! file_exists($manifestPath)) {
|
59 |
+
throw new Exception('The Mix manifest does not exist.');
|
60 |
+
}
|
61 |
+
|
62 |
+
$manifests[$manifestPath] = json_decode(file_get_contents($manifestPath), true);
|
63 |
+
}
|
64 |
+
|
65 |
+
$manifest = $manifests[$manifestPath];
|
66 |
+
|
67 |
+
if (! isset($manifest[$path])) {
|
68 |
+
throw new Exception(
|
69 |
+
"Unable to locate Mix file: ".$path.". Please check your ".
|
70 |
+
'webpack.mix.js output paths and try again.'
|
71 |
+
);
|
72 |
+
}
|
73 |
+
|
74 |
+
return \FluentForm\App::publicUrl($manifestDirectory.$manifest[$path]);
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
if (! function_exists('fluentFormSanitizer')) {
|
79 |
+
/**
|
80 |
+
* Sanitize form inputs recursively.
|
81 |
+
*
|
82 |
+
* @param $input
|
83 |
+
*
|
84 |
+
* @return string $input
|
85 |
+
*/
|
86 |
+
function fluentFormSanitizer($input, $attribute = null, $fields = [])
|
87 |
+
{
|
88 |
+
if (is_string($input)) {
|
89 |
+
if (\FluentForm\Framework\Helpers\ArrayHelper::get($fields, $attribute.'.element') === 'textarea') {
|
90 |
+
$input = sanitize_textarea_field($input);
|
91 |
+
} else {
|
92 |
+
$input = sanitize_text_field($input);
|
93 |
+
}
|
94 |
+
} elseif (is_array($input)) {
|
95 |
+
foreach ($input as $key => &$value) {
|
96 |
+
$attribute = $attribute ? $attribute.'['.$key.']' : $key;
|
97 |
+
|
98 |
+
$value = fluentFormSanitizer($value, $attribute, $fields);
|
99 |
+
|
100 |
+
$attribute = null;
|
101 |
+
}
|
102 |
+
}
|
103 |
+
|
104 |
+
return $input;
|
105 |
+
}
|
106 |
+
}
|
107 |
+
|
108 |
+
if (! function_exists('fluentFormEditorShortCodes')) {
|
109 |
+
function fluentFormEditorShortCodes()
|
110 |
+
{
|
111 |
+
$editor_shortcodes = array(
|
112 |
+
array(
|
113 |
+
'title' => 'General Shortcodes',
|
114 |
+
'shortcodes' => array(
|
115 |
+
'{ip}' => __('IP Address', 'fluentform'),
|
116 |
+
'{date.m/d/Y}' => __('Date (mm/dd/yyyy)', 'fluentform'),
|
117 |
+
'{date.d/m/Y}' => __('Date (dd/mm/yyyy)', 'fluentform'),
|
118 |
+
'{embed_post.ID}' => __('Embebeded Post/Page ID', 'fluentform'),
|
119 |
+
'{embed_post.post_title}' => __('Embebeded Post/Page Title', 'fluentform'),
|
120 |
+
'{embed_post.permalink}' => __('Embebeded URL', 'fluentform'),
|
121 |
+
'{user.ID}' => __('User ID', 'fluentform'),
|
122 |
+
'{user.display_name}' => __('User Display Name', 'fluentform'),
|
123 |
+
'{user.first_name}' => __('User First Name', 'fluentform'),
|
124 |
+
'{user.last_name}' => __('User Last Name', 'fluentform'),
|
125 |
+
'{user.user_email}' => __('User Email', 'fluentform'),
|
126 |
+
'{user.user_login}' => __('User Username', 'fluentform'),
|
127 |
+
'{browser.name}' => __('User Browser Client', 'fluentform'),
|
128 |
+
'{browser.platform}' => __('User Operating System', 'fluentform')
|
129 |
+
)
|
130 |
+
)
|
131 |
+
);
|
132 |
+
return apply_filters('fluentform_editor_shortcodes', $editor_shortcodes);
|
133 |
+
}
|
134 |
+
}
|
app/Helpers/Helper.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Helpers;
|
4 |
+
|
5 |
+
use FluentForm\Framework\Helpers\ArrayHelper;
|
6 |
+
|
7 |
+
class Helper
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* Sanitize form inputs recursively.
|
11 |
+
*
|
12 |
+
* @param $input
|
13 |
+
*
|
14 |
+
* @return string $input
|
15 |
+
*/
|
16 |
+
public static function sanitizer($input, $attribute = null, $fields = [])
|
17 |
+
{
|
18 |
+
if (is_string($input)) {
|
19 |
+
if (ArrayHelper::get($fields, $attribute.'.element') === 'textarea') {
|
20 |
+
$input = sanitize_textarea_field($input);
|
21 |
+
} else {
|
22 |
+
$input = sanitize_text_field($input);
|
23 |
+
}
|
24 |
+
} elseif (is_array($input)) {
|
25 |
+
foreach ($input as $key => &$value) {
|
26 |
+
$attribute = $attribute ? $attribute.'['.$key.']' : $key;
|
27 |
+
|
28 |
+
$value = Helper::sanitizer($value, $attribute, $fields);
|
29 |
+
|
30 |
+
$attribute = null;
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
return $input;
|
35 |
+
}
|
36 |
+
|
37 |
+
public static function makeGlobalSettingsComponentUrl($component = null)
|
38 |
+
{
|
39 |
+
$baseUrl = admin_url('admin.php?page=fluent_forms_settings');
|
40 |
+
|
41 |
+
return $component ? $baseUrl.'#'.ArrayHelper::get($component, 'hash', '') : $baseUrl;
|
42 |
+
}
|
43 |
+
|
44 |
+
public static function getHtmlElementClass($value1, $value2, $class = 'active', $default = '')
|
45 |
+
{
|
46 |
+
return $value1 === $value2 ? $class : $default;
|
47 |
+
}
|
48 |
+
}
|
app/Hooks/Ajax.php
ADDED
@@ -0,0 +1,172 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Add all ajax hooks
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* @var $app \FluentForm\Framework\Foundation\Application
|
9 |
+
*/
|
10 |
+
|
11 |
+
$app->addPublicAjaxAction('fluentform_submit', function () use ($app) {
|
12 |
+
(new \FluentForm\App\Modules\Form\FormHandler($app))->onSubmit();
|
13 |
+
});
|
14 |
+
|
15 |
+
$app->addPublicAjaxAction('fluentform-form-analytics-view', function () use ($app) {
|
16 |
+
(new FluentForm\App\Modules\Form\Analytics($app))->record();
|
17 |
+
});
|
18 |
+
|
19 |
+
$app->addAdminAjaxAction('fluentform-form-analytics-view', function () use ($app) {
|
20 |
+
(new FluentForm\App\Modules\Form\Analytics($app))->record();
|
21 |
+
});
|
22 |
+
|
23 |
+
$app->addAdminAjaxAction('fluentform_submit', function () use ($app) {
|
24 |
+
(new \FluentForm\App\Modules\Form\FormHandler($app))->onSubmit();
|
25 |
+
});
|
26 |
+
|
27 |
+
$app->addAdminAjaxAction('fluentform-global-settings', function () use ($app) {
|
28 |
+
(new \FluentForm\App\Modules\Settings\Settings($app->request))->get();
|
29 |
+
});
|
30 |
+
|
31 |
+
$app->addAdminAjaxAction('fluentform-global-settings-store', function () use ($app) {
|
32 |
+
(new \FluentForm\App\Modules\Settings\Settings($app->request))->store();
|
33 |
+
});
|
34 |
+
|
35 |
+
$app->addAdminAjaxAction('fluentform-forms', function () use ($app) {
|
36 |
+
(new \FluentForm\App\Modules\Form\Form($app))->index();
|
37 |
+
});
|
38 |
+
|
39 |
+
$app->addAdminAjaxAction('fluentform-form-store', function () use ($app) {
|
40 |
+
(new \FluentForm\App\Modules\Form\Form($app))->store();
|
41 |
+
});
|
42 |
+
|
43 |
+
$app->addAdminAjaxAction('fluentform-form-find', function () use ($app) {
|
44 |
+
(new \FluentForm\App\Modules\Form\Form($app))->find();
|
45 |
+
});
|
46 |
+
|
47 |
+
$app->addAdminAjaxAction('fluentform-form-update', function () use ($app) {
|
48 |
+
(new \FluentForm\App\Modules\Form\Form($app))->update();
|
49 |
+
});
|
50 |
+
|
51 |
+
$app->addAdminAjaxAction('fluentform-form-delete', function () use ($app) {
|
52 |
+
(new \FluentForm\App\Modules\Form\Form($app))->delete();
|
53 |
+
});
|
54 |
+
|
55 |
+
$app->addAdminAjaxAction('fluentform-form-inputs', function () use ($app) {
|
56 |
+
(new \FluentForm\App\Modules\Form\Inputs($app))->index();
|
57 |
+
});
|
58 |
+
|
59 |
+
$app->addAdminAjaxAction('fluentform-settings-formSettings', function () use ($app) {
|
60 |
+
(new \FluentForm\App\Modules\Form\Settings\FormSettings($app))->index();
|
61 |
+
});
|
62 |
+
|
63 |
+
$app->addAdminAjaxAction('fluentform-settings-formSettings-store', function () use ($app) {
|
64 |
+
(new \FluentForm\App\Modules\Form\Settings\FormSettings($app))->store();
|
65 |
+
});
|
66 |
+
|
67 |
+
$app->addAdminAjaxAction('fluentform-settings-formSettings-remove', function () use ($app) {
|
68 |
+
(new \FluentForm\App\Modules\Form\Settings\FormSettings($app))->remove();
|
69 |
+
});
|
70 |
+
|
71 |
+
$app->addAdminAjaxAction('fluentform-load-editor-components', function () use ($app) {
|
72 |
+
(new \FluentForm\App\Modules\Component\Component($app))->index();
|
73 |
+
});
|
74 |
+
|
75 |
+
$app->addAdminAjaxAction('fluentform-load-editor-shortcodes', function () use ($app) {
|
76 |
+
(new \FluentForm\App\Modules\Component\Component($app))->getEditorShortcodes();
|
77 |
+
});
|
78 |
+
|
79 |
+
$app->addAdminAjaxAction('fluentform-form-entry-counts', function () use ($app) {
|
80 |
+
(new \FluentForm\App\Modules\Entries\Entries())->getEntriesGroup();
|
81 |
+
});
|
82 |
+
|
83 |
+
$app->addAdminAjaxAction('fluentform-form-entries', function () use ($app) {
|
84 |
+
(new \FluentForm\App\Modules\Entries\Entries())->getEntries();
|
85 |
+
});
|
86 |
+
|
87 |
+
$app->addAdminAjaxAction('fluentform-form-entries-export', function () use ($app) {
|
88 |
+
(new \FluentForm\App\Modules\Entries\Export($app))->index();
|
89 |
+
});
|
90 |
+
|
91 |
+
$app->addAdminAjaxAction('fluentform-get-entry', function () use ($app) {
|
92 |
+
(new \FluentForm\App\Modules\Entries\Entries())->getEntry();
|
93 |
+
});
|
94 |
+
|
95 |
+
$app->addAdminAjaxAction('fluentform-get-entry-notes', function () use ($app) {
|
96 |
+
(new \FluentForm\App\Modules\Entries\Entries())->getNotes();
|
97 |
+
});
|
98 |
+
|
99 |
+
$app->addAdminAjaxAction('fluentform-add-entry-note', function () use ($app) {
|
100 |
+
(new \FluentForm\App\Modules\Entries\Entries())->addNote();
|
101 |
+
});
|
102 |
+
|
103 |
+
$app->addAdminAjaxAction('fluentform-change-entry-status', function () use ($app) {
|
104 |
+
(new \FluentForm\App\Modules\Entries\Entries())->changeEntryStatus();
|
105 |
+
});
|
106 |
+
|
107 |
+
$app->addAdminAjaxAction('fluentform-delete-entry', function () use ($app) {
|
108 |
+
(new \FluentForm\App\Modules\Entries\Entries())->deleteEntry();
|
109 |
+
});
|
110 |
+
|
111 |
+
$app->addAdminAjaxAction('fluentform-change-entry-favorites', function () use ($app) {
|
112 |
+
(new \FluentForm\App\Modules\Entries\Entries())->favoriteChange();
|
113 |
+
});
|
114 |
+
|
115 |
+
$app->addAdminAjaxAction('fluentform-do_entry_bulk_actions', function () use ($app) {
|
116 |
+
(new \FluentForm\App\Modules\Entries\Entries())->handleBulkAction();
|
117 |
+
});
|
118 |
+
|
119 |
+
$app->addAdminAjaxAction('fluentform-get-extra-form-settings', function () use ($app) {
|
120 |
+
(new FluentForm\App\Modules\Form\Settings\ExtraSettings($app))->getExtraSettingNavs();
|
121 |
+
});
|
122 |
+
|
123 |
+
$app->addAdminAjaxAction('fluentform-get-form-settings-extra-component', function () use ($app) {
|
124 |
+
(new FluentForm\App\Modules\Form\Settings\ExtraSettings($app))->getExtraSettingsComponent();
|
125 |
+
});
|
126 |
+
|
127 |
+
$app->addAdminAjaxAction(
|
128 |
+
'fluentform-get-pages',
|
129 |
+
function () {
|
130 |
+
\FluentForm\App\Modules\Acl\Acl::verify('fluentform_forms_manager');
|
131 |
+
|
132 |
+
$pages = get_pages();
|
133 |
+
$formattedPages = [];
|
134 |
+
|
135 |
+
foreach ($pages as $index => $page) {
|
136 |
+
$formattedPages[] = [
|
137 |
+
'ID' => $page->ID,
|
138 |
+
'post_title' => $page->post_title,
|
139 |
+
'guid' => $page->guid
|
140 |
+
];
|
141 |
+
}
|
142 |
+
|
143 |
+
wp_send_json_success([
|
144 |
+
'pages' => $formattedPages
|
145 |
+
], 200);
|
146 |
+
}
|
147 |
+
);
|
148 |
+
|
149 |
+
|
150 |
+
// Mailchimp Integration Endpoints
|
151 |
+
$app->addAdminAjaxAction('fluentform-get-form-mailchimp-settings', function () use ($app) {
|
152 |
+
(new \FluentForm\App\Modules\Integration\MailChimpIntegration($app) )->getMailChimpSettings();
|
153 |
+
});
|
154 |
+
|
155 |
+
$app->addAdminAjaxAction('fluentform-get-mailchimp-lists', function () use ($app) {
|
156 |
+
(new \FluentForm\App\Modules\Integration\MailChimpIntegration($app) )->getMailChimpLists();
|
157 |
+
});
|
158 |
+
|
159 |
+
$app->addAdminAjaxAction('fluentform-get-mailchimp-list-details', function () use ($app) {
|
160 |
+
(new \FluentForm\App\Modules\Integration\MailChimpIntegration($app) )->getMailChimpList();
|
161 |
+
});
|
162 |
+
|
163 |
+
$app->addAdminAjaxAction('fluentform-save-mailchimp-notification', function () use ($app) {
|
164 |
+
(new \FluentForm\App\Modules\Integration\MailChimpIntegration($app) )->saveNotification();
|
165 |
+
});
|
166 |
+
|
167 |
+
$app->addAdminAjaxAction('fluentform-delete-mailchimp-notification', function () use ($app) {
|
168 |
+
(new \FluentForm\App\Modules\Integration\MailChimpIntegration($app) )->deleteNotification();
|
169 |
+
});
|
170 |
+
|
171 |
+
|
172 |
+
|
app/Hooks/Backend.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Declare backend actions/filters/shortcodes
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* @var $app \FluentForm\Framework\Foundation\Application
|
9 |
+
*/
|
10 |
+
|
11 |
+
// Add Entries Menu
|
12 |
+
$app->addAction('ff_fluentform_form_application_view_entries', function ($form_id) use ($app) {
|
13 |
+
(new \FluentForm\App\Modules\Entries\Entries())->renderEntries($form_id);
|
14 |
+
});
|
15 |
+
|
16 |
+
$app->addAction('fluentform_after_form_navigation_editor', function ($form_id) use ($app) {
|
17 |
+
(new \FluentForm\App\Modules\Registerer\Menu($app))->addPreviewButton($form_id);
|
18 |
+
});
|
19 |
+
|
20 |
+
$app->addAction('media_buttons', function () {
|
21 |
+
(new \FluentForm\App\Modules\EditorButtonModule())->addButton();
|
22 |
+
});
|
23 |
+
|
24 |
+
$app->addfilter('fluentform_response_render_select', function ($response) {
|
25 |
+
return \FluentForm\App\Services\FormResponseParser::transformSelectField($response);
|
26 |
+
}, 10, 1);
|
27 |
+
|
28 |
+
$app->addfilter('fluentform_response_render_input_name', function ($response) {
|
29 |
+
return \FluentForm\App\Services\FormResponseParser::transformNameField($response);
|
30 |
+
}, 10, 1);
|
31 |
+
|
32 |
+
// On form submission register slack notifier
|
33 |
+
$app->addAction('fluentform_submission_inserted', function ($submissionId, $formData, $form) {
|
34 |
+
\FluentForm\App\Services\Slack::notify($submissionId, $formData, $form);
|
35 |
+
}, 10, 3);
|
app/Hooks/Common.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Declare common actions/filters/shortcodes
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* @var $app \FluentForm\Framework\Foundation\Application
|
9 |
+
*/
|
10 |
+
|
11 |
+
$component = new \FluentForm\App\Modules\Component\Component($app);
|
12 |
+
$component->addFluentformSubmissionInsertedFilter();
|
13 |
+
$component->addIsRenderableFilter();
|
14 |
+
|
15 |
+
$app->addAction( 'init', function () use ($app) {
|
16 |
+
(new \FluentForm\App\Modules\ProcessExteriorModule())->handleExteriorPages();
|
17 |
+
});
|
app/Hooks/Frontend.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Declare frontend actions/filters/shortcodes
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* @var $app \FluentForm\Framework\Foundation\Application
|
9 |
+
*/
|
10 |
+
|
11 |
+
$component = new \FluentForm\App\Modules\Component\Component($app);
|
12 |
+
$component->addRendererActions();
|
13 |
+
$component->addFluentFormShortCode();
|
14 |
+
$component->addFluentFormDefaultValueParser();
|
app/Modules/Acl/Acl.php
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Modules\Acl;
|
4 |
+
|
5 |
+
class Acl
|
6 |
+
{
|
7 |
+
|
8 |
+
public static function getPermissionSet()
|
9 |
+
{
|
10 |
+
return apply_filters('fluentform_permission_set', [
|
11 |
+
'fluentform_dashboard_access',
|
12 |
+
'fluentform_forms_manager',
|
13 |
+
'fluentform_entries_viewer',
|
14 |
+
'fluentform_settings_manager',
|
15 |
+
'fluentform_full_access',
|
16 |
+
]);
|
17 |
+
}
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Fluentform access controll permissions assignment.
|
21 |
+
*/
|
22 |
+
public static function setPermissions()
|
23 |
+
{
|
24 |
+
// Fire an event letting others know that fluentform
|
25 |
+
// is going to assign permission set to a role.
|
26 |
+
do_action('before_fluentform_permission_set_assignment');
|
27 |
+
|
28 |
+
// The permissions that fluentform supports altogether.
|
29 |
+
$permissions = self::getPermissionSet();
|
30 |
+
|
31 |
+
// The role that fluentform will use
|
32 |
+
// to attach the permission set.
|
33 |
+
$role = get_role('administrator');
|
34 |
+
|
35 |
+
// Looping through permission set to add to the role.
|
36 |
+
foreach ($permissions as $permission) {
|
37 |
+
$role->add_cap($permission);
|
38 |
+
}
|
39 |
+
|
40 |
+
// Fire an event letting others know that fluentform is
|
41 |
+
// done with the permission assignment to the role.
|
42 |
+
do_action('after_fluentform_permission_set_assignment');
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Verify if current user has a fluentform permission.
|
47 |
+
*
|
48 |
+
* @param $permission
|
49 |
+
* @param null $formId
|
50 |
+
* @param string $message
|
51 |
+
* @param bool $json
|
52 |
+
*
|
53 |
+
* @throws \Exception
|
54 |
+
*/
|
55 |
+
public static function verify(
|
56 |
+
$permission,
|
57 |
+
$formId = null,
|
58 |
+
$message = 'You do not have permission to perform this action.',
|
59 |
+
$json = true
|
60 |
+
) {
|
61 |
+
$allowed = self::hasPermission($permission, $formId);
|
62 |
+
|
63 |
+
if (! $allowed) {
|
64 |
+
if ($json) {
|
65 |
+
wp_send_json_error([
|
66 |
+
'message' => $message
|
67 |
+
], 423);
|
68 |
+
} else {
|
69 |
+
throw new \Exception($message);
|
70 |
+
}
|
71 |
+
}
|
72 |
+
}
|
73 |
+
|
74 |
+
public static function hasPermission($permission, $formId = false)
|
75 |
+
{
|
76 |
+
$allowed = current_user_can('fluentform_full_access') ?: current_user_can($permission);
|
77 |
+
return apply_filters('fluentform_verify_user_permission_'.$permission, $allowed, $formId);
|
78 |
+
}
|
79 |
+
|
80 |
+
public static function hasAnyFormPermission($form_id = false )
|
81 |
+
{
|
82 |
+
$allPermissions = self::getPermissionSet();
|
83 |
+
foreach ($allPermissions as $permission) {
|
84 |
+
if(self::hasPermission($permission, $form_id)) {
|
85 |
+
return true;
|
86 |
+
}
|
87 |
+
}
|
88 |
+
return false;
|
89 |
+
}
|
90 |
+
}
|
app/Modules/Activator.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Modules;
|
4 |
+
|
5 |
+
use FluentForm\App\Modules\Acl\Acl;
|
6 |
+
use FluentForm\App\Databases\DatabaseMigrator;
|
7 |
+
|
8 |
+
class Activator
|
9 |
+
{
|
10 |
+
/**
|
11 |
+
* This method will be called on plugin activation
|
12 |
+
* @return void
|
13 |
+
*/
|
14 |
+
public function handleActivation()
|
15 |
+
{
|
16 |
+
// We are going to migrate all the database tables here.
|
17 |
+
DatabaseMigrator::run();
|
18 |
+
|
19 |
+
// Assign fluentform permission set.
|
20 |
+
Acl::setPermissions();
|
21 |
+
|
22 |
+
$this->setDefaultGlobalSettings();
|
23 |
+
$this->setCurrentVersion();
|
24 |
+
}
|
25 |
+
|
26 |
+
private function setDefaultGlobalSettings()
|
27 |
+
{
|
28 |
+
if(!get_option('_fluentform_global_form_settings')) {
|
29 |
+
update_option('__fluentform_global_form_settings', array(
|
30 |
+
'layout' => array(
|
31 |
+
'labelPlacement' => 'topAligned',
|
32 |
+
'helpMessagePlacement' => 'with_label',
|
33 |
+
'errorMessagePlacement' => 'inline',
|
34 |
+
'cssClassName' => ''
|
35 |
+
)
|
36 |
+
));
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
private function setCurrentVersion()
|
41 |
+
{
|
42 |
+
update_option('_fluentform_installed_version', '1.1.0');
|
43 |
+
}
|
44 |
+
}
|
app/Modules/AnalyticsModule.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php namespace FluentForm\App\Modules;
|
2 |
+
|
3 |
+
class AnalyticsModule
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* This method will be called on plugin deactivation
|
7 |
+
* @return void
|
8 |
+
*/
|
9 |
+
public function record()
|
10 |
+
{
|
11 |
+
|
12 |
+
}
|
13 |
+
}
|
app/Modules/Component/Component.php
ADDED
@@ -0,0 +1,607 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Modules\Component;
|
4 |
+
|
5 |
+
use FluentForm\App\Modules\Acl\Acl;
|
6 |
+
use FluentForm\Framework\Foundation\Application;
|
7 |
+
use FluentForm\App\Services\FormBuilder\EditorShortcodeParser;
|
8 |
+
|
9 |
+
class Component
|
10 |
+
{
|
11 |
+
/**
|
12 |
+
* FluentForm\Framework\Foundation\Application
|
13 |
+
* @var $app
|
14 |
+
*/
|
15 |
+
protected $app = null;
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Biuld the instance of this class
|
19 |
+
* @param \FluentForm\Framework\Foundation\Application $app
|
20 |
+
*/
|
21 |
+
public function __construct(Application $app)
|
22 |
+
{
|
23 |
+
$this->app = $app;
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Get all the available components
|
28 |
+
* @return void
|
29 |
+
* @throws \Exception
|
30 |
+
* @throws \FluentForm\Framework\Exception\UnResolveableEntityException
|
31 |
+
*/
|
32 |
+
public function index()
|
33 |
+
{
|
34 |
+
Acl::verify('fluentform_forms_manager');
|
35 |
+
|
36 |
+
$this->app->doAction(
|
37 |
+
'fluent_editor_init',
|
38 |
+
$components = $this->app->make('components')
|
39 |
+
);
|
40 |
+
|
41 |
+
$editorCompnents = $components->sort();
|
42 |
+
$editorCompnents = $this->app->applyFilters('fluent_editor_components', $editorCompnents);
|
43 |
+
$countries = $this->app->load($this->app->appPath('Services/FormBuilder/CountryNames.php'));
|
44 |
+
|
45 |
+
wp_send_json_success(array(
|
46 |
+
'components' => $editorCompnents,
|
47 |
+
'countries' => $countries,
|
48 |
+
'disabled_components' => $this->getDisabledComponents()
|
49 |
+
));
|
50 |
+
exit();
|
51 |
+
}
|
52 |
+
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Get disabled components
|
56 |
+
* @return array
|
57 |
+
*/
|
58 |
+
private function getDisabledComponents()
|
59 |
+
{
|
60 |
+
$isReCaptchaDisabled = !get_option('_fluentform_reCaptcha_keys_status', false);
|
61 |
+
$disabled = array(
|
62 |
+
'recaptcha' => array(
|
63 |
+
'contentComponent' => 'recaptcha',
|
64 |
+
'disabled' => $isReCaptchaDisabled
|
65 |
+
),
|
66 |
+
'input_image' => array(
|
67 |
+
'disabled' => true
|
68 |
+
),
|
69 |
+
'input_file' => array(
|
70 |
+
'disabled' => true
|
71 |
+
),
|
72 |
+
'input_repeat' => array(
|
73 |
+
'disabled' => true
|
74 |
+
),
|
75 |
+
'shortcode' => array(
|
76 |
+
'disabled' => true
|
77 |
+
),
|
78 |
+
'action_hook' => array(
|
79 |
+
'disabled' => true
|
80 |
+
),
|
81 |
+
'form_step' => array(
|
82 |
+
'disabled' => true
|
83 |
+
),
|
84 |
+
'select_country' => array(
|
85 |
+
'disabled' => false
|
86 |
+
)
|
87 |
+
);
|
88 |
+
|
89 |
+
return $disabled;
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Get available shortcodes for editor
|
94 |
+
* @return void
|
95 |
+
* @throws \Exception
|
96 |
+
*/
|
97 |
+
public function getEditorShortcodes()
|
98 |
+
{
|
99 |
+
Acl::verify('fluentform_forms_manager');
|
100 |
+
$editor_shortcodes = fluentFormEditorShortCodes();
|
101 |
+
wp_send_json_success(array('shortcodes' => $editor_shortcodes), 200);
|
102 |
+
exit();
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Register the form renderer shortcode
|
107 |
+
* @return void
|
108 |
+
*/
|
109 |
+
public function addFluentFormShortCode()
|
110 |
+
{
|
111 |
+
$this->app->addShortCode('fluentform', function($atts, $content) {
|
112 |
+
$atts = shortcode_atts( array(
|
113 |
+
'id' => null
|
114 |
+
), $atts);
|
115 |
+
|
116 |
+
if (($form_id = $atts['id'])) {
|
117 |
+
$form = wpFluent()->table('fluentform_forms')->find($form_id);
|
118 |
+
if(!$form) {
|
119 |
+
return;
|
120 |
+
}
|
121 |
+
|
122 |
+
$formSettings = wpFluent()
|
123 |
+
->table('fluentform_form_meta')
|
124 |
+
->where('form_id', $form_id)
|
125 |
+
->where('meta_key', 'formSettings')
|
126 |
+
->first();
|
127 |
+
|
128 |
+
$form->fields = json_decode($form->form_fields, true);
|
129 |
+
if(!$form->fields['fields']) {
|
130 |
+
return;
|
131 |
+
}
|
132 |
+
|
133 |
+
$form->settings = json_decode($formSettings->value, true);
|
134 |
+
$form = apply_filters( 'fluentform_rendering_form', $form );
|
135 |
+
|
136 |
+
$isRenderable = array(
|
137 |
+
'status' => true,
|
138 |
+
'message' => ''
|
139 |
+
);
|
140 |
+
|
141 |
+
$isRenderable = apply_filters('fluentform_is_form_renderable', $isRenderable, $form);
|
142 |
+
|
143 |
+
if(is_array($isRenderable) && !$isRenderable['status']) {
|
144 |
+
return "<div id='ff_form_{$form->id}' class='ff_form_not_render'>{$isRenderable['message']}</div>";
|
145 |
+
}
|
146 |
+
|
147 |
+
$formBuilder = $this->app->make('formBuilder');
|
148 |
+
$output = $formBuilder->build($form);
|
149 |
+
|
150 |
+
wp_enqueue_style(
|
151 |
+
'fluent-form-styles',
|
152 |
+
$this->app->publicUrl('css/fluent-forms-public.css')
|
153 |
+
);
|
154 |
+
|
155 |
+
wp_enqueue_style(
|
156 |
+
'fluentform-public-default',
|
157 |
+
$this->app->publicUrl('css/fluentform-public-default.css')
|
158 |
+
);
|
159 |
+
|
160 |
+
wp_enqueue_script(
|
161 |
+
'fluent-form-submission',
|
162 |
+
$this->app->publicUrl('js/form-submission.js'),
|
163 |
+
array('jquery'),
|
164 |
+
false,
|
165 |
+
true
|
166 |
+
);
|
167 |
+
|
168 |
+
$form_vars = array(
|
169 |
+
'id' => $form->id,
|
170 |
+
'settings' => $form->settings,
|
171 |
+
'rules' => $formBuilder->validationRules,
|
172 |
+
'do_analytics' => apply_filters('fluentform_do_analytics', true)
|
173 |
+
);
|
174 |
+
|
175 |
+
if ($conditionals = $formBuilder->conditions) {
|
176 |
+
wp_enqueue_script(
|
177 |
+
'fluent-form-conditionals',
|
178 |
+
$this->app->publicUrl('js/form-conditionals.js'),
|
179 |
+
array('jquery'),
|
180 |
+
false,
|
181 |
+
true
|
182 |
+
);
|
183 |
+
|
184 |
+
$form_vars['conditionals'] = $conditionals;
|
185 |
+
}
|
186 |
+
|
187 |
+
|
188 |
+
$this->addInlineVars(json_encode($form_vars), $form->id);
|
189 |
+
|
190 |
+
wp_localize_script('fluent-form-submission', 'fluentFormVars', array(
|
191 |
+
'ajaxUrl' => admin_url('admin-ajax.php'),
|
192 |
+
'forms' => (Object) array()
|
193 |
+
));
|
194 |
+
|
195 |
+
return $output;
|
196 |
+
}
|
197 |
+
});
|
198 |
+
}
|
199 |
+
|
200 |
+
/**
|
201 |
+
* Register renderer actions for compiling each element
|
202 |
+
* @return void
|
203 |
+
*/
|
204 |
+
public function addRendererActions()
|
205 |
+
{
|
206 |
+
$actionMappings = [
|
207 |
+
'Select@compile' => ['render_item_select'],
|
208 |
+
'Address@compile' => ['render_item_address'],
|
209 |
+
'Name@compile' => ['render_item_input_name'],
|
210 |
+
'TextArea@compile' => ['render_item_textarea'],
|
211 |
+
'FormStep@StepEnd' => ['render_item_step_end'],
|
212 |
+
'FormStep@compile' => ['render_item_form_step'],
|
213 |
+
'DateTime@compile' => ['render_item_input_date'],
|
214 |
+
'Repeat@compile' => ['render_item_input_repeat'],
|
215 |
+
'Recaptcha@compile' => ['render_item_recaptcha'],
|
216 |
+
'Container@compile' => ['render_item_container'],
|
217 |
+
'Shortcode@compile' => ['render_item_shortcode'],
|
218 |
+
'FormStep@StepStart' => ['render_item_step_start'],
|
219 |
+
'ActionHook@compile' => ['render_item_action_hook'],
|
220 |
+
'CustomHtml@compile' => ['render_item_custom_html'],
|
221 |
+
'SectionBreak@compile' => ['render_item_section_break'],
|
222 |
+
'SubmitButton@compile' => ['render_item_submit_button'],
|
223 |
+
'SelectCountry@compile' => ['render_item_select_country'],
|
224 |
+
'TermsAndConditions@compile' => ['render_item_terms_and_condition'],
|
225 |
+
|
226 |
+
'Checkable@compile' => [
|
227 |
+
'render_item_input_radio',
|
228 |
+
'render_item_input_checkbox',
|
229 |
+
],
|
230 |
+
|
231 |
+
'Text@compile' => [
|
232 |
+
'render_item_input_url',
|
233 |
+
'render_item_input_text',
|
234 |
+
'render_item_input_file',
|
235 |
+
'render_item_input_email',
|
236 |
+
'render_item_input_number',
|
237 |
+
'render_item_input_hidden',
|
238 |
+
'render_item_input_password',
|
239 |
+
],
|
240 |
+
];
|
241 |
+
|
242 |
+
$path = 'FluentForm\App\Services\FormBuilder\Components\\';
|
243 |
+
foreach ($actionMappings as $handler => $actions) {
|
244 |
+
foreach ($actions as $action) {
|
245 |
+
// $this->app->addAction($action, $path.$handler, 10, 2);
|
246 |
+
$this->app->addAction($action, function() use ($path, $handler) {
|
247 |
+
list($class, $method) = $this->app->parseHandler($path.$handler);
|
248 |
+
call_user_func_array(array($class, $method), func_get_args());
|
249 |
+
}, 10, 2);
|
250 |
+
}
|
251 |
+
}
|
252 |
+
}
|
253 |
+
|
254 |
+
/**
|
255 |
+
* Register dynamic value shortcode parser (filter default value)
|
256 |
+
* @return void
|
257 |
+
*/
|
258 |
+
public function addFluentFormDefaultValueParser()
|
259 |
+
{
|
260 |
+
$this->app->addFilter(
|
261 |
+
'fluentform_parse_default_value', function($value, $form) {
|
262 |
+
return EditorShortcodeParser::filter($value, $form);
|
263 |
+
}, 10, 2
|
264 |
+
);
|
265 |
+
}
|
266 |
+
|
267 |
+
/**
|
268 |
+
* Register filter to check whether the form is renderable
|
269 |
+
* @return mixed
|
270 |
+
*/
|
271 |
+
public function addIsRenderableFilter()
|
272 |
+
{
|
273 |
+
$this->app->addFilter('fluentform_is_form_renderable', function($isRenderable, $form) {
|
274 |
+
$checkables = array('limitNumberOfEntries', 'scheduleForm', 'requireLogin');
|
275 |
+
foreach ($form->settings['restrictions'] as $key => $restrictions) {
|
276 |
+
if (in_array($key, $checkables)) {
|
277 |
+
if (!($isRenderable['status'] = $this->{$key}($restrictions, $form, $isRenderable))) {
|
278 |
+
return $isRenderable;
|
279 |
+
}
|
280 |
+
}
|
281 |
+
}
|
282 |
+
|
283 |
+
return $isRenderable;
|
284 |
+
}, 10, 2);
|
285 |
+
}
|
286 |
+
|
287 |
+
/**
|
288 |
+
* Check if limit is set on form submits and it's valid yet
|
289 |
+
* @param array $restrictions
|
290 |
+
* @return bool
|
291 |
+
*/
|
292 |
+
private function limitNumberOfEntries($restrictions, $form, &$isRenderable)
|
293 |
+
{
|
294 |
+
if (!$restrictions['enabled']) {
|
295 |
+
return true;
|
296 |
+
}
|
297 |
+
|
298 |
+
$col = 'created_at';
|
299 |
+
$period = $restrictions['period'];
|
300 |
+
$maxAllowedEntries = $restrictions['numberOfEntries'];
|
301 |
+
$query = wpFluent()->table('fluentform_submissions')->where('form_id', $form->id);
|
302 |
+
|
303 |
+
if ($period == 'day') {
|
304 |
+
$year = "YEAR(`{$col}`) = YEAR(NOW())";
|
305 |
+
$month = "MONTH(`{$col}`) = MONTH(NOW())";
|
306 |
+
$day = "DAY(`{$col}`) = DAY(NOW())";
|
307 |
+
$query->where(wpFluent()->raw("{$year} AND {$month} AND {$day}"));
|
308 |
+
} elseif ($period == 'week') {
|
309 |
+
$query->where(
|
310 |
+
wpFluent()->raw("YEARWEEK(`{$col}`, 1) = YEARWEEK(CURDATE(), 1)")
|
311 |
+
);
|
312 |
+
} elseif ($period == 'month') {
|
313 |
+
$year = "YEAR(`{$col}`) = YEAR(NOW())";
|
314 |
+
$month = "MONTH(`{$col}`) = MONTH(NOW())";
|
315 |
+
$query->where(wpFluent()->raw("{$year} AND {$month}"));
|
316 |
+
} elseif ($period == 'year') {
|
317 |
+
$query->where(wpFluent()->raw("YEAR(`{$col}`) = YEAR(NOW())"));
|
318 |
+
}
|
319 |
+
|
320 |
+
if (!($isAllowed = ($query->count() < $maxAllowedEntries))) {
|
321 |
+
$isRenderable['message'] = $restrictions['limitReachedMsg'];
|
322 |
+
}
|
323 |
+
|
324 |
+
return $isAllowed;
|
325 |
+
}
|
326 |
+
|
327 |
+
/**
|
328 |
+
* Check if form has scheduled date and open for submission
|
329 |
+
* @param array $restrictions
|
330 |
+
* @return bool
|
331 |
+
*/
|
332 |
+
private function scheduleForm($restrictions, $form, &$isRenderable)
|
333 |
+
{
|
334 |
+
if (!$restrictions['enabled']) {
|
335 |
+
return true;
|
336 |
+
}
|
337 |
+
|
338 |
+
$time = time();
|
339 |
+
$start = strtotime($restrictions['start']);
|
340 |
+
$end = strtotime($restrictions['end']);
|
341 |
+
|
342 |
+
if ($time < $start) {
|
343 |
+
$isRenderable['message'] = $restrictions['pendingMsg'];
|
344 |
+
return false;
|
345 |
+
}
|
346 |
+
|
347 |
+
if ($time >= $end) {
|
348 |
+
$isRenderable['message'] = $restrictions['expiredMsg'];
|
349 |
+
return false;
|
350 |
+
}
|
351 |
+
|
352 |
+
return true;
|
353 |
+
}
|
354 |
+
|
355 |
+
/**
|
356 |
+
* * Check if form requires loged in user and user is logged in
|
357 |
+
* @param array $restrictions
|
358 |
+
* @return bool
|
359 |
+
*/
|
360 |
+
private function requireLogin($restrictions, $form, &$isRenderable)
|
361 |
+
{
|
362 |
+
if (!$restrictions['enabled']) {
|
363 |
+
return true;
|
364 |
+
}
|
365 |
+
|
366 |
+
if (!($isLoggedIn = is_user_logged_in())) {
|
367 |
+
$isRenderable['message'] = $restrictions['requireLoginMsg'];
|
368 |
+
}
|
369 |
+
|
370 |
+
return $isLoggedIn;
|
371 |
+
}
|
372 |
+
|
373 |
+
/**
|
374 |
+
* Register fluentform_submission_inserted action
|
375 |
+
* @return void
|
376 |
+
*/
|
377 |
+
public function addFluentformSubmissionInsertedFilter()
|
378 |
+
{
|
379 |
+
$this->app->addAction(
|
380 |
+
'fluentform_submission_inserted', function($insertId, $data, $form) {
|
381 |
+
|
382 |
+
$notifications = wpFluent()
|
383 |
+
->table('fluentform_form_meta')
|
384 |
+
->where('form_id', $form->id)
|
385 |
+
->where('meta_key', 'notifications')
|
386 |
+
->get();
|
387 |
+
|
388 |
+
$enabledNotifications = array();
|
389 |
+
foreach ($notifications as $key => $notification) {
|
390 |
+
$notification = json_decode($notification->value, true);
|
391 |
+
if ($notification['enabled']) {
|
392 |
+
$enabledNotifications[] = $notification;
|
393 |
+
}
|
394 |
+
}
|
395 |
+
|
396 |
+
if($enabledNotifications) {
|
397 |
+
$enabledNotifications = $this->parseNotifications(
|
398 |
+
$enabledNotifications, $insertId, $data, $form
|
399 |
+
);
|
400 |
+
}
|
401 |
+
|
402 |
+
$notifier = $this->app->make(
|
403 |
+
'FluentForm\App\Services\FormBuilder\Notifications\EmailNotification'
|
404 |
+
);
|
405 |
+
|
406 |
+
foreach ($enabledNotifications as $notification) {
|
407 |
+
$notifier->notify($notification, $data, $form);
|
408 |
+
}
|
409 |
+
|
410 |
+
|
411 |
+
}, 10, 3);
|
412 |
+
}
|
413 |
+
|
414 |
+
/**
|
415 |
+
* Add inline scripts [Add localized script using same var]
|
416 |
+
* @param array $vars
|
417 |
+
* @param int $form_id
|
418 |
+
* @return void
|
419 |
+
*/
|
420 |
+
private function addInlineVars($vars, $form_id) {
|
421 |
+
if (!function_exists('wp_add_inline_script')) {
|
422 |
+
wp_add_inline_script(
|
423 |
+
'fluent-form-submission',
|
424 |
+
'window.fluentFormVars.forms["fluentform_'.$form_id.'"] = '.$vars.';'
|
425 |
+
);
|
426 |
+
} else {
|
427 |
+
add_action('wp_footer', function () use ($vars, $form_id) {
|
428 |
+
?>
|
429 |
+
<script type="text/javascript">
|
430 |
+
window.fluentFormVars.forms["fluentform_<?php echo $form_id;?>"] = <?php echo $vars; ?>;
|
431 |
+
</script>
|
432 |
+
<?php
|
433 |
+
}, 100);
|
434 |
+
}
|
435 |
+
}
|
436 |
+
|
437 |
+
|
438 |
+
/**
|
439 |
+
* Parsed Norifications
|
440 |
+
* @param array $notifications
|
441 |
+
* @param int $insertId
|
442 |
+
* @param array $data
|
443 |
+
* @param object $form
|
444 |
+
* @return array $notifications
|
445 |
+
*/
|
446 |
+
private function parseNotifications($notifications, $insertId, $data, $form)
|
447 |
+
{
|
448 |
+
$formattedProperties = array();
|
449 |
+
|
450 |
+
$parsableFields = array(
|
451 |
+
'fromName',
|
452 |
+
'fromEmail',
|
453 |
+
'replyTo',
|
454 |
+
'bcc',
|
455 |
+
'subject',
|
456 |
+
'message'
|
457 |
+
);
|
458 |
+
|
459 |
+
list(
|
460 |
+
$formProperties,
|
461 |
+
$userProperties,
|
462 |
+
$postProperties,
|
463 |
+
$others
|
464 |
+
) = $this->parsePropertiesFor($parsableFields, $notifications);
|
465 |
+
|
466 |
+
$this->setOtherProperties($formattedProperties, $others);
|
467 |
+
$this->setUserProperties($formattedProperties, $userProperties);
|
468 |
+
$this->setPostProperties($formattedProperties, $postProperties, $data);
|
469 |
+
$this->setFormProperties($formattedProperties, $formProperties, $data, $form);
|
470 |
+
|
471 |
+
// If any property is array then make it string
|
472 |
+
foreach ($formattedProperties as $key => $formattedProperty) {
|
473 |
+
if(is_array($formattedProperty)) {
|
474 |
+
$formattedProperties[$key] = implode(', ',$formattedProperty);
|
475 |
+
}
|
476 |
+
}
|
477 |
+
|
478 |
+
foreach ($notifications as &$notification) {
|
479 |
+
if ($notification['sendTo']['type'] == 'field') {
|
480 |
+
$notification['sendTo']['email'] = $formattedProperties['inputs.email'];
|
481 |
+
}
|
482 |
+
|
483 |
+
foreach ($parsableFields as $fieldName) {
|
484 |
+
if (isset($notification[$fieldName])) {
|
485 |
+
foreach ($formattedProperties as $key => $value) {
|
486 |
+
$notification[$fieldName] = str_replace(
|
487 |
+
'{'.$key.'}', $value, $notification[$fieldName]
|
488 |
+
);
|
489 |
+
}
|
490 |
+
}
|
491 |
+
}
|
492 |
+
}
|
493 |
+
|
494 |
+
return $notifications;
|
495 |
+
}
|
496 |
+
|
497 |
+
private function parsePropertiesFor($parsableFields, $notifications)
|
498 |
+
{
|
499 |
+
$totalString = '';
|
500 |
+
foreach ($notifications as $notification) {
|
501 |
+
if ($notification['sendTo']['type'] == 'field') {
|
502 |
+
$totalString .= '{inputs.'.$notification['sendTo']['field'].'}';
|
503 |
+
}
|
504 |
+
foreach ($parsableFields as $fieldName) {
|
505 |
+
$totalString .= $notification[$fieldName];
|
506 |
+
}
|
507 |
+
}
|
508 |
+
|
509 |
+
preg_match_all('/{(.*?)}/', $totalString, $matches);
|
510 |
+
$uniqueMatches = array_unique($matches[1]);
|
511 |
+
$replacables = array_unique($matches[0]);
|
512 |
+
$formProperties = $userProperties = $postProperties = $others = array();
|
513 |
+
foreach ($uniqueMatches as $match) {
|
514 |
+
if (strpos($match, 'user.') !== false) {
|
515 |
+
$userProperties[] = substr($match, strlen('user.'));
|
516 |
+
} elseif (strpos($match, 'inputs.') !== false) {
|
517 |
+
$formProperties[] = substr($match, strlen('inputs.'));
|
518 |
+
} elseif (strpos($match, 'embed_post.') !== false) {
|
519 |
+
$postProperties[] = substr($match, strlen('embed_post.'));
|
520 |
+
} else {
|
521 |
+
$others[] = $match;
|
522 |
+
}
|
523 |
+
}
|
524 |
+
|
525 |
+
return array($formProperties, $userProperties, $postProperties, $others);
|
526 |
+
}
|
527 |
+
|
528 |
+
private function setFormProperties(&$formattedProperties, $formProperties, $data, $form)
|
529 |
+
{
|
530 |
+
if (!$formProperties) return;
|
531 |
+
|
532 |
+
$formParser = new \FluentForm\App\Services\FormParser($form);
|
533 |
+
$formFields = $formParser->getInputs();
|
534 |
+
foreach ($formProperties as $formProperty) {
|
535 |
+
$field = @$formFields[$formProperty];
|
536 |
+
|
537 |
+
if(!$field || !isset($data[$formProperty]) ) {
|
538 |
+
$formattedProperties['inputs.'.$formProperty] = '';
|
539 |
+
continue;
|
540 |
+
}
|
541 |
+
|
542 |
+
$formattedProperties['inputs.'.$formProperty] = apply_filters(
|
543 |
+
'fluentform_response_render_'.$field['element'],
|
544 |
+
$data[$formProperty],
|
545 |
+
$field,
|
546 |
+
$form->id
|
547 |
+
);
|
548 |
+
}
|
549 |
+
}
|
550 |
+
|
551 |
+
private function setUserProperties(&$formattedProperties, $userProperties)
|
552 |
+
{
|
553 |
+
if (!$userProperties) return;
|
554 |
+
|
555 |
+
$user = wp_get_current_user();
|
556 |
+
foreach ($userProperties as $userProperty) {
|
557 |
+
$formattedProperties['user.'.$userProperty] = $user->{$userProperty};
|
558 |
+
}
|
559 |
+
}
|
560 |
+
|
561 |
+
private function setPostProperties(&$formattedProperties, $postProperties, $data)
|
562 |
+
{
|
563 |
+
if (!$postProperties) return;
|
564 |
+
|
565 |
+
$embed_post_id = @$data['__fluent_form_embded_post_id'];
|
566 |
+
if($embed_post_id) {
|
567 |
+
$post = get_post($embed_post_id);
|
568 |
+
$post->permalink = get_the_permalink($post);
|
569 |
+
foreach ($postProperties as $post_property) {
|
570 |
+
$formattedProperties['embed_post.'.$post_property] = $post->{$post_property};
|
571 |
+
}
|
572 |
+
}
|
573 |
+
}
|
574 |
+
|
575 |
+
private function setOtherProperties(&$formattedProperties, $others)
|
576 |
+
{
|
577 |
+
if (!$others) return;
|
578 |
+
|
579 |
+
foreach ($others as $other) {
|
580 |
+
if ($other == 'date.m/d/Y') {
|
581 |
+
$formattedProperties[$other] = date('m/d/YY');
|
582 |
+
continue;
|
583 |
+
} elseif ($other == 'date.d/m/Y') {
|
584 |
+
$formattedProperties[$other] = date('d/m/YY');
|
585 |
+
continue;
|
586 |
+
} elseif ($other == 'browser.platform') {
|
587 |
+
$browser = new \FluentForm\App\Services\Browser\Browser();
|
588 |
+
$formattedProperties[$other] = $browser->getPlatform();
|
589 |
+
continue;
|
590 |
+
} elseif ($other == 'browser.name') {
|
591 |
+
$browser = new \FluentForm\App\Services\Browser\Browser();
|
592 |
+
$formattedProperties[$other] = $browser->getBrowser();
|
593 |
+
continue;
|
594 |
+
} elseif ($other == 'ip') {
|
595 |
+
$formattedProperties[$other] = $this->app->request->getIp();
|
596 |
+
continue;
|
597 |
+
} elseif ($other == 'admin_email') {
|
598 |
+
$formattedProperties[$other] = get_option('admin_email', false);
|
599 |
+
continue;
|
600 |
+
}
|
601 |
+
|
602 |
+
$formattedProperties[$other] = apply_filters(
|
603 |
+
'fluentform_other_shortcodes_'.$other, $other, $data, $form
|
604 |
+
);
|
605 |
+
}
|
606 |
+
}
|
607 |
+
}
|
app/Modules/Deactivator.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Modules;
|
4 |
+
|
5 |
+
class Deactivator
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* This method will be called on plugin deactivation
|
9 |
+
* @return void
|
10 |
+
*/
|
11 |
+
public function handleDeactivation()
|
12 |
+
{
|
13 |
+
// die(__CLASS__);
|
14 |
+
}
|
15 |
+
}
|
app/Modules/EditorButtonModule.php
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php namespace FluentForm\App\Modules;
|
2 |
+
|
3 |
+
use FluentForm\App;
|
4 |
+
use FluentForm\Config;
|
5 |
+
use FluentForm\Request;
|
6 |
+
use FluentForm\View;
|
7 |
+
|
8 |
+
class EditorButtonModule
|
9 |
+
{
|
10 |
+
public function addButton()
|
11 |
+
{
|
12 |
+
$isDisplayButton = $this->pageSupportedMediaButtons();
|
13 |
+
if ( ! $isDisplayButton ) {
|
14 |
+
return;
|
15 |
+
}
|
16 |
+
$this->addMceButtonAssets();
|
17 |
+
echo "<button id='fluent_form_insert_button' class='button'><span style='background-image: url(".App::publicUrl('img/icon_black_small.png')."); width: 16px;height: 16px;background-repeat: no-repeat;display: inline-block;background-size: contain;opacity: 0.4;margin-right: 5px;vertical-align: middle;'></span>".__('Add Form', 'fluentform')."</button>";
|
18 |
+
}
|
19 |
+
|
20 |
+
private function addMceButtonAssets()
|
21 |
+
{
|
22 |
+
wp_enqueue_script(
|
23 |
+
'fluentform_editor_script',
|
24 |
+
fluentformMix('js/fluentform_editor_script.js'),
|
25 |
+
array('jquery')
|
26 |
+
);
|
27 |
+
|
28 |
+
$forms = wpFluent()->table('fluentform_forms')
|
29 |
+
->select(array('id', 'title'))
|
30 |
+
->get();
|
31 |
+
|
32 |
+
$forms = array_map(function($item) {
|
33 |
+
return array('value' => $item->id, 'text'=> $item->title);
|
34 |
+
}, $forms);
|
35 |
+
|
36 |
+
wp_localize_script('fluentform_editor_script', 'fluentform_editor_vars', array(
|
37 |
+
'forms' => $forms
|
38 |
+
));
|
39 |
+
}
|
40 |
+
|
41 |
+
private function pageSupportedMediaButtons()
|
42 |
+
{
|
43 |
+
$currentPage = basename( $_SERVER['PHP_SELF'] );
|
44 |
+
$isEligiblePage = in_array( $currentPage, array(
|
45 |
+
'post.php',
|
46 |
+
'page.php',
|
47 |
+
'page-new.php',
|
48 |
+
'post-new.php',
|
49 |
+
'customize.php',
|
50 |
+
));
|
51 |
+
|
52 |
+
$displayButton = apply_filters( 'fluentform_display_add_form_button', $isEligiblePage );
|
53 |
+
|
54 |
+
return $displayButton;
|
55 |
+
}
|
56 |
+
|
57 |
+
private function getMenuIcon()
|
58 |
+
{
|
59 |
+
return 'data:image/svg+xml;base64,'.base64_encode('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><defs><style>.cls-1{fill:#fff;}</style></defs><title>dashboard_icon</title><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1"><path class="cls-1" d="M15.57,0H4.43A4.43,4.43,0,0,0,0,4.43V15.57A4.43,4.43,0,0,0,4.43,20H15.57A4.43,4.43,0,0,0,20,15.57V4.43A4.43,4.43,0,0,0,15.57,0ZM12.82,14a2.36,2.36,0,0,1-1.66.68H6.5A2.31,2.31,0,0,1,7.18,13a2.36,2.36,0,0,1,1.66-.68l4.66,0A2.34,2.34,0,0,1,12.82,14Zm3.3-3.46a2.36,2.36,0,0,1-1.66.68H3.21a2.25,2.25,0,0,1,.68-1.64,2.36,2.36,0,0,1,1.66-.68H16.79A2.25,2.25,0,0,1,16.12,10.53Zm0-3.73a2.36,2.36,0,0,1-1.66.68H3.21a2.25,2.25,0,0,1,.68-1.64,2.36,2.36,0,0,1,1.66-.68H16.79A2.25,2.25,0,0,1,16.12,6.81Z"/></g></g></svg>');
|
60 |
+
}
|
61 |
+
|
62 |
+
}
|
app/Modules/Entries/Entries.php
ADDED
@@ -0,0 +1,308 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php namespace FluentForm\App\Modules\Entries;
|
2 |
+
|
3 |
+
use FluentForm\View;
|
4 |
+
use FluentForm\App\Modules\Acl\Acl;
|
5 |
+
use FluentForm\App\Services\FormParser;
|
6 |
+
use FluentForm\App\Services\FormResponseParser;
|
7 |
+
|
8 |
+
class Entries extends EntryQuery
|
9 |
+
{
|
10 |
+
protected $responseMetaModel;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Entries constructor.
|
14 |
+
* @throws \Exception
|
15 |
+
*/
|
16 |
+
public function __construct()
|
17 |
+
{
|
18 |
+
Acl::verify('fluentform_entries_viewer');
|
19 |
+
|
20 |
+
parent::__construct();
|
21 |
+
$this->responseMetaModel = wpFluent()->table( 'fluentform_submission_meta' );
|
22 |
+
}
|
23 |
+
|
24 |
+
public function renderEntries($form_id)
|
25 |
+
{
|
26 |
+
wp_enqueue_script('fluentform_form_entries', fluentformMix("js/form_entries.js"));
|
27 |
+
|
28 |
+
$forms = wpFluent()
|
29 |
+
->select(array('id', 'title'))
|
30 |
+
->table('fluentform_forms')
|
31 |
+
->get();
|
32 |
+
|
33 |
+
$form = wpFluent()->table('fluentform_forms')->find($form_id);
|
34 |
+
|
35 |
+
wp_localize_script('fluentform_form_entries', 'fluent_form_entries_vars', array(
|
36 |
+
'all_forms_url' => admin_url('admin.php?page=fluent_forms'),
|
37 |
+
'forms' => $forms,
|
38 |
+
'form_id' => $form->id,
|
39 |
+
'current_form_title' => $form->title,
|
40 |
+
'entries_url_base' => admin_url('admin.php?page=fluent_forms&route=entries&form_id='),
|
41 |
+
'no_found_text' => __('Sorry! No entries found. All your entries will be shown here once you start getting form submissions', 'fluentform')
|
42 |
+
));
|
43 |
+
View::render('admin.form.entries', array(
|
44 |
+
'form_id' => $form_id
|
45 |
+
));
|
46 |
+
}
|
47 |
+
|
48 |
+
public function getEntriesGroup() {
|
49 |
+
$formId = intval($this->request->get('form_id'));
|
50 |
+
$counts = $this->groupCount($formId);
|
51 |
+
wp_send_json_success([
|
52 |
+
'counts' => $counts
|
53 |
+
], 200);
|
54 |
+
}
|
55 |
+
|
56 |
+
public function getEntries() {
|
57 |
+
$formId = intval($this->request->get('form_id'));
|
58 |
+
$currentPage = intval($this->request->get('current_page', 1));
|
59 |
+
$perPage = intval($this->request->get('per_page', 10));
|
60 |
+
$sortBy = sanitize_text_field($this->request->get('sort_by', 'ASC'));
|
61 |
+
$entry_type = sanitize_text_field($this->request->get('entry_type', 'all'));
|
62 |
+
$search = sanitize_text_field($this->request->get('search'));
|
63 |
+
|
64 |
+
$this->formId = $formId;
|
65 |
+
$this->per_page = $perPage;
|
66 |
+
$this->sort_by = $sortBy;
|
67 |
+
$this->page_number = $currentPage;
|
68 |
+
$this->search = $search;
|
69 |
+
|
70 |
+
if($entry_type == 'favorite') {
|
71 |
+
$this->is_favourite = true;
|
72 |
+
} else if($entry_type != 'all') {
|
73 |
+
$this->status = $entry_type;
|
74 |
+
}
|
75 |
+
|
76 |
+
$formMeta = $this->getFormInputsAndLabels($formId);
|
77 |
+
|
78 |
+
|
79 |
+
$submissions = $this->getResponses();
|
80 |
+
$submissions['data'] = FormResponseParser::transformSubmissions($submissions['data'], $formMeta['inputs'], $formId);
|
81 |
+
|
82 |
+
wp_send_json_success([
|
83 |
+
'submissions' => $submissions,
|
84 |
+
'labels' => $formMeta['labels']
|
85 |
+
], 200);
|
86 |
+
exit();
|
87 |
+
}
|
88 |
+
|
89 |
+
public function getEntry() {
|
90 |
+
$formId = intval($this->request->get('form_id'));
|
91 |
+
$entryId = intval($this->request->get('entry_id'));
|
92 |
+
$sortBy = sanitize_text_field($this->request->get('sort_by', 'ASC'));
|
93 |
+
|
94 |
+
|
95 |
+
$this->formId = $formId;
|
96 |
+
$formMeta = $this->getFormInputsAndLabels($formId);
|
97 |
+
|
98 |
+
$submission = $this->getResponse($entryId);
|
99 |
+
|
100 |
+
|
101 |
+
$submission = FormResponseParser::transformSubmission($submission, $formMeta['inputs'], $formId);
|
102 |
+
|
103 |
+
if($submission->user_id) {
|
104 |
+
$user = get_user_by('ID', $submission->user_id);
|
105 |
+
$user_data = array(
|
106 |
+
'name' => $user->display_name,
|
107 |
+
'email' => $user->user_email,
|
108 |
+
'ID' => $user->ID,
|
109 |
+
'permalink' => get_edit_user_link($user->ID)
|
110 |
+
);
|
111 |
+
$submission->user = $user_data;
|
112 |
+
}
|
113 |
+
|
114 |
+
$submission = apply_filters('fluentform_single_response_data', $submission, $this->formId);
|
115 |
+
|
116 |
+
wp_send_json_success(array(
|
117 |
+
'submission' => $submission,
|
118 |
+
'labels' => $formMeta['labels']
|
119 |
+
), 200);
|
120 |
+
|
121 |
+
}
|
122 |
+
|
123 |
+
|
124 |
+
/**
|
125 |
+
* @param $formId
|
126 |
+
* @todo: Implement Caching mechanism so we don't have to parse these things for every request
|
127 |
+
* @return array
|
128 |
+
*/
|
129 |
+
private function getFormInputsAndLabels($formId) {
|
130 |
+
$form = $this->formModel->find($formId);
|
131 |
+
$formParser = new FormParser($form);
|
132 |
+
$formInputs = $formParser->getEntryInputs();
|
133 |
+
$inputLabels = $formParser->getAdminLabels($formInputs);
|
134 |
+
return array(
|
135 |
+
'inputs' => $formInputs,
|
136 |
+
'labels' => $inputLabels
|
137 |
+
);
|
138 |
+
}
|
139 |
+
|
140 |
+
public function getNotes() {
|
141 |
+
$formId = intval($this->request->get('form_id'));
|
142 |
+
$entry_id = intval($this->request->get('entry_id'));
|
143 |
+
|
144 |
+
$notes = $this->responseMetaModel
|
145 |
+
->where('form_id', $formId)
|
146 |
+
->where('response_id', $entry_id)
|
147 |
+
->where('meta_key','_notes')
|
148 |
+
->get();
|
149 |
+
|
150 |
+
foreach ( $notes as $note ) {
|
151 |
+
if($note->user_id) {
|
152 |
+
$note->pemalink = get_edit_user_link($note->user_id);
|
153 |
+
} else {
|
154 |
+
$note->pemalink = false;
|
155 |
+
}
|
156 |
+
}
|
157 |
+
|
158 |
+
$notes = apply_filters('fluentform_entry_notes', $notes, $entry_id, $formId);
|
159 |
+
|
160 |
+
wp_send_json_success([
|
161 |
+
'notes' => $notes
|
162 |
+
], 200);
|
163 |
+
}
|
164 |
+
|
165 |
+
public function addNote() {
|
166 |
+
$entryId = intval($this->request->get('entry_id'));
|
167 |
+
$formId = intval($this->request->get('form_id'));
|
168 |
+
$note = $this->request->get('note');
|
169 |
+
$note_content = sanitize_textarea_field($note['content']);
|
170 |
+
$note_status = sanitize_text_field($note['status']);
|
171 |
+
$user = get_user_by('ID', get_current_user_id());
|
172 |
+
|
173 |
+
$response_note = array(
|
174 |
+
'response_id' => $entryId,
|
175 |
+
'form_id' => $formId,
|
176 |
+
'meta_key' => '_notes',
|
177 |
+
'value' => $note_content,
|
178 |
+
'status' => $note_status,
|
179 |
+
'user_id' => $user->ID,
|
180 |
+
'name' => $user->display_name,
|
181 |
+
'created_at' => date('Y-m-d H:i:s'),
|
182 |
+
'updated_at' => date('Y-m-d H:i:s')
|
183 |
+
);
|
184 |
+
$response_note = apply_filters('fluentform_add_response_note', $response_note);
|
185 |
+
|
186 |
+
$insertId = $this->responseMetaModel->insert($response_note);
|
187 |
+
$added_note = $this->responseMetaModel->find($insertId);
|
188 |
+
do_action('fluentform_new_response_note_added', $insertId, $added_note);
|
189 |
+
wp_send_json_success([
|
190 |
+
'message' => __('Note has been successfully added', 'fluentform'),
|
191 |
+
'note' => $added_note,
|
192 |
+
'insert_id' => $insertId
|
193 |
+
], 200);
|
194 |
+
}
|
195 |
+
|
196 |
+
public function changeEntryStatus() {
|
197 |
+
$formId = intval($this->request->get('form_id'));
|
198 |
+
$entryId = intval($this->request->get('entry_id'));
|
199 |
+
$newStatus = sanitize_text_field($this->request->get('status'));
|
200 |
+
|
201 |
+
$this->responseModel
|
202 |
+
->where('form_id', $formId)
|
203 |
+
->where('id', $entryId)
|
204 |
+
->update(array('status' => $newStatus));
|
205 |
+
|
206 |
+
wp_send_json_success(array(
|
207 |
+
'message' => __('Item has been marked as '.$newStatus, 'fluentform'),
|
208 |
+
'status' => $newStatus
|
209 |
+
), 200);
|
210 |
+
|
211 |
+
}
|
212 |
+
|
213 |
+
public function deleteEntry() {
|
214 |
+
$formId = intval($this->request->get('form_id'));
|
215 |
+
$entryId = intval($this->request->get('entry_id'));
|
216 |
+
$newStatus = sanitize_text_field($this->request->get('status'));
|
217 |
+
|
218 |
+
$this->responseModel
|
219 |
+
->where('form_id', $formId)
|
220 |
+
->where('id', $entryId)
|
221 |
+
->delete();
|
222 |
+
|
223 |
+
wp_send_json_success(array(
|
224 |
+
'message' => __('Item Successfully deleted', 'fluentform'),
|
225 |
+
'status' => $newStatus
|
226 |
+
), 200);
|
227 |
+
}
|
228 |
+
|
229 |
+
public function favoriteChange() {
|
230 |
+
$formId = intval($this->request->get('form_id'));
|
231 |
+
$entryId = intval($this->request->get('entry_id'));
|
232 |
+
$newStatus = intval($this->request->get('is_favourite'));
|
233 |
+
if($newStatus) {
|
234 |
+
$message = __('Item has been added to favorites', 'fluentform');
|
235 |
+
} else {
|
236 |
+
$message = __('Item has been removed from favorites', 'fluentform');
|
237 |
+
}
|
238 |
+
$this->responseModel
|
239 |
+
->where('form_id', $formId)
|
240 |
+
->where('id', $entryId)
|
241 |
+
->update(array('is_favourite' => $newStatus));
|
242 |
+
|
243 |
+
wp_send_json_success(array(
|
244 |
+
'message' => $message,
|
245 |
+
'is_favourite' => $newStatus
|
246 |
+
), 200);
|
247 |
+
}
|
248 |
+
|
249 |
+
|
250 |
+
public function handleBulkAction()
|
251 |
+
{
|
252 |
+
$formId = intval($this->request->get('form_id'));
|
253 |
+
$entries = fluentFormSanitizer($this->request->get('entries', array()));
|
254 |
+
|
255 |
+
$actionType = sanitize_text_field($this->request->get('action_type'));
|
256 |
+
|
257 |
+
if(!$formId || !count($entries)) {
|
258 |
+
wp_send_json_error(array(
|
259 |
+
'message' => __('Please select entries first', 'fluentform')
|
260 |
+
), 400);
|
261 |
+
}
|
262 |
+
|
263 |
+
$message = __('Action Successfully executed', 'fluentform');
|
264 |
+
|
265 |
+
$bulkQuery = wpFluent()->table('fluentform_submissions')
|
266 |
+
->where('form_id', $formId)
|
267 |
+
->whereIn('id', $entries);
|
268 |
+
if($actionType == 'trashed') {
|
269 |
+
$updateData = array(
|
270 |
+
'status' => 'trashed'
|
271 |
+
);
|
272 |
+
$bulkQuery->update($updateData);
|
273 |
+
$message = __('Selected entries successfully trashed', 'fluentform');
|
274 |
+
} else if($actionType == 'delete') {
|
275 |
+
$bulkQuery->delete();
|
276 |
+
$message = __('Selected entries successfully deleted', 'fluentform');
|
277 |
+
} else if($actionType == 'read') {
|
278 |
+
$updateData = array(
|
279 |
+
'status' => 'read'
|
280 |
+
);
|
281 |
+
$bulkQuery->update($updateData);
|
282 |
+
$message = __('Selected entries successfully marked as read', 'fluentform');
|
283 |
+
} else if($actionType == 'unread') {
|
284 |
+
$updateData = array(
|
285 |
+
'status' => 'unread'
|
286 |
+
);
|
287 |
+
$bulkQuery->update($updateData);
|
288 |
+
$message = __('Selected entries successfully marked as unread', 'fluentform');
|
289 |
+
} else if($actionType == 'favorite') {
|
290 |
+
$updateData = array(
|
291 |
+
'is_favourite' => 1
|
292 |
+
);
|
293 |
+
$bulkQuery->update($updateData);
|
294 |
+
$message = __('Selected entries successfully marked as Favorite', 'fluentform');
|
295 |
+
} else if($actionType == 'remove-favorite') {
|
296 |
+
$updateData = array(
|
297 |
+
'is_favourite' => 0
|
298 |
+
);
|
299 |
+
$bulkQuery->update($updateData);
|
300 |
+
$message = __('Selected entries successfully remove from favorite', 'fluentform');
|
301 |
+
}
|
302 |
+
|
303 |
+
wp_send_json_success(array(
|
304 |
+
'message' => $message
|
305 |
+
), 200);
|
306 |
+
}
|
307 |
+
|
308 |
+
}
|
app/Modules/Entries/EntryQuery.php
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php namespace FluentForm\App\Modules\Entries;
|
2 |
+
use FluentForm\App;
|
3 |
+
|
4 |
+
class EntryQuery {
|
5 |
+
/**
|
6 |
+
* @var \FluentForm\Framework\Request\Request $request
|
7 |
+
*/
|
8 |
+
protected $request;
|
9 |
+
protected $formModel;
|
10 |
+
protected $responseModel;
|
11 |
+
|
12 |
+
protected $formId = false;
|
13 |
+
|
14 |
+
protected $per_page = 10;
|
15 |
+
protected $page_number = 1;
|
16 |
+
protected $status = false;
|
17 |
+
protected $is_favourite = null;
|
18 |
+
protected $sort_by = 'ASC';
|
19 |
+
protected $search = false;
|
20 |
+
|
21 |
+
public function __construct() {
|
22 |
+
$this->request = App::make( 'request' );
|
23 |
+
$this->formModel = wpFluent()->table( 'fluentform_forms' );
|
24 |
+
$this->responseModel = wpFluent()->table( 'fluentform_submissions' );
|
25 |
+
}
|
26 |
+
|
27 |
+
public function getResponses() {
|
28 |
+
$query = $this->responseModel
|
29 |
+
->where('form_id', $this->formId)
|
30 |
+
->limit($this->per_page)
|
31 |
+
->orderBy('id', $this->sort_by)
|
32 |
+
->offset(( $this->page_number - 1) * $this->per_page );
|
33 |
+
|
34 |
+
if($this->is_favourite) {
|
35 |
+
$query->where('is_favourite', $this->is_favourite);
|
36 |
+
$query->where('status', '!=', 'trashed');
|
37 |
+
} else {
|
38 |
+
if(!$this->status) {
|
39 |
+
$query->where('status', '!=', 'trashed');
|
40 |
+
} else {
|
41 |
+
$query->where('status', $this->status);
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
if($this->search) {
|
46 |
+
$query->where('response', 'LIKE', '%'.$this->search.'%');
|
47 |
+
}
|
48 |
+
|
49 |
+
$total = $query->count();
|
50 |
+
$responses = $query->get();
|
51 |
+
$responses = apply_filters('fluentform_get_raw_responses', $responses, $this->formId);
|
52 |
+
|
53 |
+
return [
|
54 |
+
'data' => $responses,
|
55 |
+
'paginate' => [
|
56 |
+
'total' => $total,
|
57 |
+
'per_page' => $this->per_page,
|
58 |
+
'current_page' => $this->page_number,
|
59 |
+
'last_page' => ceil($total / $this->per_page)
|
60 |
+
]
|
61 |
+
];
|
62 |
+
}
|
63 |
+
|
64 |
+
public function getResponse($entryId) {
|
65 |
+
$response = $this->responseModel
|
66 |
+
->where('form_id', $this->formId)
|
67 |
+
->find($entryId);
|
68 |
+
return $response;
|
69 |
+
}
|
70 |
+
|
71 |
+
public function groupCount($form_id) {
|
72 |
+
$statuses = $this->responseModel
|
73 |
+
->select($this->responseModel->raw('status, COUNT(*) as count'))
|
74 |
+
->where('form_id', $form_id)
|
75 |
+
->groupBy('status')
|
76 |
+
->get();
|
77 |
+
$counts = array();
|
78 |
+
foreach ($statuses as $status) {
|
79 |
+
$counts[$status->status] = $status->count;
|
80 |
+
}
|
81 |
+
|
82 |
+
$counts['all'] = array_sum($counts);
|
83 |
+
$favorites = wpFluent()
|
84 |
+
->table('fluentform_submissions')
|
85 |
+
->where('form_id', $form_id)
|
86 |
+
->where('is_favourite', 1)
|
87 |
+
->count();
|
88 |
+
$counts['favourites'] = $favorites;
|
89 |
+
return $counts;
|
90 |
+
}
|
91 |
+
}
|
app/Modules/Entries/Export.php
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Modules\Entries;
|
4 |
+
|
5 |
+
use SplTempFileObject;
|
6 |
+
use FluentForm\App\Services\FormParser;
|
7 |
+
use FluentForm\Framework\Helpers\ArrayHelper;
|
8 |
+
use FluentForm\App\Services\FormResponseParser;
|
9 |
+
use FluentForm\Framework\Foundation\Application;
|
10 |
+
|
11 |
+
class Export
|
12 |
+
{
|
13 |
+
/**
|
14 |
+
* @var \FluentForm\Framework\Request\Request
|
15 |
+
*/
|
16 |
+
protected $request;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Export constructor.
|
20 |
+
*
|
21 |
+
* @param \FluentForm\Framework\Foundation\Application $application
|
22 |
+
*/
|
23 |
+
public function __construct(Application $application)
|
24 |
+
{
|
25 |
+
$this->request = $application->request;
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Exports form entries as CSV.
|
30 |
+
*
|
31 |
+
* @todo:: refactor.
|
32 |
+
*/
|
33 |
+
public function index()
|
34 |
+
{
|
35 |
+
$formId = intval($this->request->get('form_id'));
|
36 |
+
|
37 |
+
$form = wpFluent()->table('fluentform_forms')->find($formId);
|
38 |
+
|
39 |
+
$formParser = new FormParser($form);
|
40 |
+
|
41 |
+
$formInputs = $formParser->getEntryInputs();
|
42 |
+
|
43 |
+
$inputLabels = $formParser->getAdminLabels($formInputs);
|
44 |
+
|
45 |
+
$submissions = wpFluent()->table('fluentform_submissions')->where('form_id', $formId)->get();
|
46 |
+
|
47 |
+
$submissions = FormResponseParser::transformSubmissions($submissions, $formInputs, $formId);
|
48 |
+
|
49 |
+
$exportData = [];
|
50 |
+
|
51 |
+
foreach ($submissions as $submission) {
|
52 |
+
$responses = json_decode($submission->response, true);
|
53 |
+
|
54 |
+
$temp = [];
|
55 |
+
|
56 |
+
foreach ($inputLabels as $field => $label) {
|
57 |
+
$value = ArrayHelper::get($responses, $field);
|
58 |
+
|
59 |
+
$temp[] = is_array($value) ? implode(', ', $value) : $value;
|
60 |
+
}
|
61 |
+
|
62 |
+
$exportData[] = $temp;
|
63 |
+
}
|
64 |
+
|
65 |
+
$fileName = 'export-data-'.date('d-m-Y');
|
66 |
+
|
67 |
+
$writer = \League\Csv\Writer::createFromFileObject(new SplTempFileObject());
|
68 |
+
$writer->setDelimiter(",");
|
69 |
+
$writer->setNewline("\r\n");
|
70 |
+
$writer->insertOne($inputLabels);
|
71 |
+
$writer->insertAll($exportData);
|
72 |
+
$writer->output($fileName.'.csv');
|
73 |
+
die();
|
74 |
+
}
|
75 |
+
}
|
app/Modules/Form/Analytics.php
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Modules\Form;
|
4 |
+
|
5 |
+
use FluentForm\App\Services\Browser\Browser;
|
6 |
+
use FluentForm\Framework\Foundation\Application;
|
7 |
+
|
8 |
+
class Analytics
|
9 |
+
{
|
10 |
+
/**
|
11 |
+
* @var \FluentForm\Framework\Foundation\Application
|
12 |
+
*/
|
13 |
+
protected $app;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Build the instance
|
17 |
+
*
|
18 |
+
* @param \FluentForm\Framework\Foundation\Application $app
|
19 |
+
*/
|
20 |
+
public function __construct(Application $app)
|
21 |
+
{
|
22 |
+
$this->app = $app;
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Save form view analytics data
|
27 |
+
*
|
28 |
+
* @return json respoonse
|
29 |
+
*/
|
30 |
+
public function record()
|
31 |
+
{
|
32 |
+
return $this->saveViewAnalytics();
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Save form view analytics data
|
37 |
+
* @return void
|
38 |
+
*/
|
39 |
+
private function saveViewAnalytics()
|
40 |
+
{
|
41 |
+
$formId = $this->app->request->get('formId');
|
42 |
+
if (!$form = wpFluent()->table('fluentform_forms')->find($formId)) {
|
43 |
+
return;
|
44 |
+
}
|
45 |
+
|
46 |
+
$userId = null;
|
47 |
+
if ($user = wp_get_current_user()) {
|
48 |
+
$userId = $user->ID;
|
49 |
+
}
|
50 |
+
|
51 |
+
$browser = new Browser;
|
52 |
+
|
53 |
+
$data = array(
|
54 |
+
'count' => 1,
|
55 |
+
'form_id' => $formId,
|
56 |
+
'user_id' => $userId,
|
57 |
+
'ip' => $this->app->request->getIp(),
|
58 |
+
'browser' => $browser->getBrowser(),
|
59 |
+
'platform' => $browser->getPlatform(),
|
60 |
+
'created_at' => date('Y-m-d H:i:s'),
|
61 |
+
'source_url' => $this->app->request->server('HTTP_REFERER'),
|
62 |
+
);
|
63 |
+
|
64 |
+
$query = wpFluent()
|
65 |
+
->table('fluentform_form_analytics')
|
66 |
+
->where('ip', $data['ip'])
|
67 |
+
->where('form_id', $data['form_id'])
|
68 |
+
->where('source_url', $data['source_url']);
|
69 |
+
|
70 |
+
try {
|
71 |
+
if (($record = $query->first())) {
|
72 |
+
$query->update(array('count' => ++$record->count));
|
73 |
+
} else {
|
74 |
+
wpFluent()->table('fluentform_form_analytics')->insert($data);
|
75 |
+
$this->increaseTotalViews($formId);
|
76 |
+
}
|
77 |
+
|
78 |
+
wp_send_json_success(array(
|
79 |
+
'status' => true,
|
80 |
+
), 200);
|
81 |
+
|
82 |
+
} catch(\Exception $e) {
|
83 |
+
wp_send_json_success(array(
|
84 |
+
'status' => false,
|
85 |
+
), 200);
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Store (create/update) total view of a form
|
91 |
+
* @param int $formId
|
92 |
+
* @return void
|
93 |
+
*/
|
94 |
+
private function increaseTotalViews($formId)
|
95 |
+
{
|
96 |
+
// check if meta is already exists or not
|
97 |
+
$hasCount = wpFluent()
|
98 |
+
->table('fluentform_form_meta')
|
99 |
+
->where('meta_key', '_total_views')
|
100 |
+
->where('form_id', $formId)
|
101 |
+
-> first();
|
102 |
+
|
103 |
+
if($hasCount) {
|
104 |
+
wpFluent()
|
105 |
+
->table('fluentform_form_meta')
|
106 |
+
->where('id', $hasCount->id)
|
107 |
+
->update(array(
|
108 |
+
'value' => intval($hasCount->value) + 1
|
109 |
+
));
|
110 |
+
} else {
|
111 |
+
wpFluent()
|
112 |
+
->table('fluentform_form_meta')
|
113 |
+
->insert(array(
|
114 |
+
'value' => 1,
|
115 |
+
'form_id' => $formId,
|
116 |
+
'meta_key' => '_total_views'
|
117 |
+
));
|
118 |
+
}
|
119 |
+
}
|
120 |
+
}
|
app/Modules/Form/Form.php
ADDED
@@ -0,0 +1,262 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Modules\Form;
|
4 |
+
|
5 |
+
use FluentForm\App\Modules\Acl\Acl;
|
6 |
+
use FluentForm\Framework\Foundation\Application;
|
7 |
+
|
8 |
+
class Form
|
9 |
+
{
|
10 |
+
/**
|
11 |
+
* @var \FluentForm\Framework\Request\Request $request
|
12 |
+
*/
|
13 |
+
protected $request;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Form constructor.
|
17 |
+
*
|
18 |
+
* @param \FluentForm\Framework\Foundation\Application $application
|
19 |
+
*
|
20 |
+
* @throws \Exception
|
21 |
+
*/
|
22 |
+
public function __construct(Application $application)
|
23 |
+
{
|
24 |
+
Acl::verify('fluentform_forms_manager');
|
25 |
+
|
26 |
+
$this->request = $application->request;
|
27 |
+
|
28 |
+
$this->model = wpFluent()->table('fluentform_forms');
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Get all forms from database
|
33 |
+
*
|
34 |
+
* @return void
|
35 |
+
* @throws \Exception
|
36 |
+
*/
|
37 |
+
public function index()
|
38 |
+
{
|
39 |
+
$search = $this->request->get('search');
|
40 |
+
$status = $this->request->get('status');
|
41 |
+
|
42 |
+
$query = $this->model->orderBy('created_at', 'DESC');
|
43 |
+
|
44 |
+
if($status && $status != 'all') {
|
45 |
+
$query->where('status', $status);
|
46 |
+
}
|
47 |
+
|
48 |
+
if($search) {
|
49 |
+
$query->where(function($q) use ($search)
|
50 |
+
{
|
51 |
+
$q->where('id', 'LIKE', '%'.$search.'%');
|
52 |
+
$q->where('title', 'LIKE', '%'.$search.'%');
|
53 |
+
});
|
54 |
+
}
|
55 |
+
|
56 |
+
$forms = $query->paginate();
|
57 |
+
|
58 |
+
foreach ($forms['data'] as $form) {
|
59 |
+
$form->preview_url = site_url('?fluentform_pages=1&preview_id='.$form->id).'#ff_preview';;
|
60 |
+
$form->edit_url = $this->getAdminPermalink('editor', $form->id);
|
61 |
+
$form->entries_url = $this->getAdminPermalink('entries', $form->id);
|
62 |
+
$form->analytics_url = $this->getAdminPermalink('analytics', $form->id);
|
63 |
+
$form->total_views = $this->getFormViewCount($form->id);
|
64 |
+
$form->total_views = $this->getFormViewCount($form->id);
|
65 |
+
$form->total_Submissions = $this->getSubmissionCount($form->id);
|
66 |
+
$form->conversion = $this->getConversionRate($form);
|
67 |
+
}
|
68 |
+
|
69 |
+
wp_send_json($forms, 200);
|
70 |
+
}
|
71 |
+
|
72 |
+
private function getFormViewCount($formId)
|
73 |
+
{
|
74 |
+
$hasCount = wpFluent()
|
75 |
+
->table('fluentform_form_meta')
|
76 |
+
->where('meta_key', '_total_views')
|
77 |
+
->where('form_id', $formId)
|
78 |
+
-> first();
|
79 |
+
if($hasCount)
|
80 |
+
return intval($hasCount->value);
|
81 |
+
return 0;
|
82 |
+
}
|
83 |
+
|
84 |
+
private function getSubmissionCount($formID)
|
85 |
+
{
|
86 |
+
return wpFluent()->table('fluentform_submissions')->where('form_id', $formID)->count();
|
87 |
+
}
|
88 |
+
|
89 |
+
private function getConversionRate($form)
|
90 |
+
{
|
91 |
+
if(!$form->total_Submissions)
|
92 |
+
return 0;
|
93 |
+
|
94 |
+
if(!$form->total_views)
|
95 |
+
return 0;
|
96 |
+
|
97 |
+
return ceil(($form->total_Submissions / $form->total_views) * 100);
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Create a form from backend/editor
|
102 |
+
* @return void
|
103 |
+
*/
|
104 |
+
public function store()
|
105 |
+
{
|
106 |
+
$type = $this->request->get('type', 'form');
|
107 |
+
$title = $this->request->get('title', 'My New Form');
|
108 |
+
$status = $this->request->get('status', 'published');
|
109 |
+
$createdBy = get_current_user_id();
|
110 |
+
|
111 |
+
//$this->validate();
|
112 |
+
|
113 |
+
$now = date("Y-m-d H:i:s");
|
114 |
+
|
115 |
+
$insertData = [
|
116 |
+
'title' => $title,
|
117 |
+
'type' => $type,
|
118 |
+
'status' => $status,
|
119 |
+
'created_by' => $createdBy,
|
120 |
+
'created_at' => $now,
|
121 |
+
'updated_at' => $now
|
122 |
+
];
|
123 |
+
|
124 |
+
$formId = $this->model->insert($insertData);
|
125 |
+
|
126 |
+
|
127 |
+
// add default form settings now
|
128 |
+
$defaultSettings = $this->getFormsDefaultSettings($formId);
|
129 |
+
wpFluent()->table('fluentform_form_meta')
|
130 |
+
->insert(array(
|
131 |
+
'form_id' => $formId,
|
132 |
+
'meta_key' => 'formSettings',
|
133 |
+
'value' => json_encode($defaultSettings)
|
134 |
+
));
|
135 |
+
|
136 |
+
do_action('fluentform_inserted_new_form', $formId, $insertData);
|
137 |
+
|
138 |
+
wp_send_json_success(array(
|
139 |
+
'formId' => $formId,
|
140 |
+
'redirect_url' => admin_url('admin.php?page=fluent_forms&form_id='.$formId.'&route=editor'),
|
141 |
+
'message' => __('Successfully created a form.', 'fluentform')
|
142 |
+
), 200);
|
143 |
+
}
|
144 |
+
|
145 |
+
private function getFormsDefaultSettings($formId = false)
|
146 |
+
{
|
147 |
+
$defaultSettings = array(
|
148 |
+
'confirmation' => array(
|
149 |
+
'redirectTo' => 'samePage',
|
150 |
+
'messageToShow' => 'Thank you for your message. We will get in touch with you shortly',
|
151 |
+
'customPage' => null,
|
152 |
+
'samePageFormBehavior' => 'hide_form',
|
153 |
+
'customUrl' => null
|
154 |
+
),
|
155 |
+
'restrictions' => array(
|
156 |
+
'limitNumberOfEntries' => array(
|
157 |
+
'enabled' => false,
|
158 |
+
'numberOfEntries' => null,
|
159 |
+
'period' => 'total',
|
160 |
+
'limitReachedMsg' => null
|
161 |
+
),
|
162 |
+
'scheduleForm' => array(
|
163 |
+
'enabled' => false,
|
164 |
+
'start' => null,
|
165 |
+
'end' => null,
|
166 |
+
'pendingMsg' => "Form submission is not started yet.",
|
167 |
+
'expiredMsg' => "Form submission is now closed."
|
168 |
+
),
|
169 |
+
'requireLogin' => array(
|
170 |
+
'enabled' => false,
|
171 |
+
'requireLoginMsg' => null,
|
172 |
+
)
|
173 |
+
),
|
174 |
+
'layout' => array(
|
175 |
+
'labelPlacement' => 'topAligned',
|
176 |
+
'helpMessagePlacement' => 'with_label',
|
177 |
+
'errorMessagePlacement' => 'inline',
|
178 |
+
'cssClassName' => ''
|
179 |
+
)
|
180 |
+
);
|
181 |
+
|
182 |
+
$globalSettings = get_option('_fluentform_global_form_settings');
|
183 |
+
|
184 |
+
if(isset($globalSettings['layout'])) {
|
185 |
+
$defaultSettings['layout'] = $globalSettings['layout'];
|
186 |
+
}
|
187 |
+
|
188 |
+
return $defaultSettings;
|
189 |
+
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* Find/Read a from from the database
|
193 |
+
* @return void
|
194 |
+
*/
|
195 |
+
public function find()
|
196 |
+
{
|
197 |
+
$formId = $this->request->get('formId');
|
198 |
+
|
199 |
+
$form = $this->model->find($formId);
|
200 |
+
|
201 |
+
wp_send_json(['form' => $form, 'metas' => []], 200);
|
202 |
+
}
|
203 |
+
|
204 |
+
/**
|
205 |
+
* Save/update a form from backend/editor
|
206 |
+
* @return void
|
207 |
+
*/
|
208 |
+
public function update()
|
209 |
+
{
|
210 |
+
$formId = $this->request->get('formId');
|
211 |
+
$title = $this->request->get('title');
|
212 |
+
$formFields = $this->request->get('formFields');
|
213 |
+
$status = $this->request->get('status', 'Draft');
|
214 |
+
|
215 |
+
$this->validate();
|
216 |
+
|
217 |
+
$this->model->where('id', $formId)->update([
|
218 |
+
'title' => $title,
|
219 |
+
'status' => $status,
|
220 |
+
'form_fields' => $formFields,
|
221 |
+
'updated_at' => date('Y-m-d h:i:s')
|
222 |
+
]);
|
223 |
+
|
224 |
+
wp_send_json([
|
225 |
+
'message' => __('The form is successfully updated.', 'fluentform')
|
226 |
+
], 200);
|
227 |
+
}
|
228 |
+
|
229 |
+
/**
|
230 |
+
* Delete a from from database
|
231 |
+
* @return void
|
232 |
+
*/
|
233 |
+
public function delete()
|
234 |
+
{
|
235 |
+
$formId = $this->request->get('formId');
|
236 |
+
|
237 |
+
$this->model->where('id', $formId)->delete();
|
238 |
+
|
239 |
+
wp_send_json([
|
240 |
+
'message' => __('Successfully deleted the form.', 'fluentform')
|
241 |
+
], 200);
|
242 |
+
}
|
243 |
+
|
244 |
+
/**
|
245 |
+
* Validate a form only by form title
|
246 |
+
* @return void
|
247 |
+
*/
|
248 |
+
private function validate()
|
249 |
+
{
|
250 |
+
if (! $this->request->get('title')) {
|
251 |
+
wp_send_json([
|
252 |
+
'title' => 'The title field is required.'
|
253 |
+
], 423);
|
254 |
+
}
|
255 |
+
}
|
256 |
+
|
257 |
+
private function getAdminPermalink($route, $formId)
|
258 |
+
{
|
259 |
+
$baseUrl = admin_url('admin.php?page=fluent_forms');
|
260 |
+
return $baseUrl.'&route='.$route."&form_id=".$formId;
|
261 |
+
}
|
262 |
+
}
|
app/Modules/Form/FormHandler.php
ADDED
@@ -0,0 +1,314 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Modules\Form;
|
4 |
+
|
5 |
+
use FluentForm\App\Services\FormParser;
|
6 |
+
use FluentForm\App\Services\Browser\Browser;
|
7 |
+
use FluentForm\Framework\Helpers\ArrayHelper;
|
8 |
+
use FluentForm\App\Modules\ReCaptcha\ReCaptcha;
|
9 |
+
use FluentForm\Framework\Foundation\Application;
|
10 |
+
|
11 |
+
class FormHandler
|
12 |
+
{
|
13 |
+
/**
|
14 |
+
* @var \FluentForm\Framework\Foundation\Application
|
15 |
+
*/
|
16 |
+
protected $app;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* @var \FluentForm\App\Services\FormParser
|
20 |
+
*/
|
21 |
+
protected $parser;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* @var array $formData
|
25 |
+
*/
|
26 |
+
protected $formData;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Form Handler constructor.
|
30 |
+
*
|
31 |
+
* @param \FluentForm\Framework\Foundation\Application $app
|
32 |
+
*/
|
33 |
+
public function __construct(Application $app)
|
34 |
+
{
|
35 |
+
$this->app = $app;
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Handle form submition
|
40 |
+
*
|
41 |
+
* @return \Exception
|
42 |
+
*/
|
43 |
+
public function onSubmit()
|
44 |
+
{
|
45 |
+
// Parse the url encoded data from the request object.
|
46 |
+
parse_str($this->app->request->get('data'), $data);
|
47 |
+
|
48 |
+
// Merge it back again to the request object.
|
49 |
+
$this->app->request->merge(['data' => $data]);
|
50 |
+
|
51 |
+
$formId = intval($this->app->request->get('form_id'));
|
52 |
+
|
53 |
+
$form = wpFluent()->table('fluentform_forms')->find($formId);
|
54 |
+
|
55 |
+
// Parse the form and get the flat inputs with validations.
|
56 |
+
$this->parser = (new FormParser($form));
|
57 |
+
$fields = $this->parser->getInputs(['rules']);
|
58 |
+
|
59 |
+
// Sanitize the data properly.
|
60 |
+
$this->formData = fluentFormSanitizer($data, null, $fields);
|
61 |
+
|
62 |
+
// Now validate the data using the previous validations.
|
63 |
+
$this->validate($form, $fields);
|
64 |
+
|
65 |
+
// Prepare the data to be inserted to the DB.
|
66 |
+
$insertData = $this->prepareInsertData($formId);
|
67 |
+
|
68 |
+
$insertId = wpFluent()->table('fluentform_submissions')->insert($insertData);
|
69 |
+
|
70 |
+
try {
|
71 |
+
$this->app->doAction('fluentform_submission_inserted', $insertId, $this->formData, $form);
|
72 |
+
} catch (\Exception $e) {
|
73 |
+
if (defined('WP_DEBUG') && WP_DEBUG) {
|
74 |
+
return $e;
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
$this->sendResponse($insertId, $form);
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Prepare response and do actions/filters
|
83 |
+
* and send the response to the client.
|
84 |
+
*
|
85 |
+
* @param int $insertId
|
86 |
+
* @param \StdClass $form
|
87 |
+
*
|
88 |
+
* @return void
|
89 |
+
*/
|
90 |
+
private function sendResponse($insertId, $form)
|
91 |
+
{
|
92 |
+
$formSettings = wpFluent()->table('fluentform_form_meta')
|
93 |
+
->where('form_id', $form->id)
|
94 |
+
->where('meta_key', 'formSettings')
|
95 |
+
->first();
|
96 |
+
|
97 |
+
$formSettings = json_decode($formSettings->value, true);
|
98 |
+
|
99 |
+
$confirmation = $formSettings['confirmation'];
|
100 |
+
|
101 |
+
if ($confirmation['redirectTo'] == 'samePage') {
|
102 |
+
$returnData = array(
|
103 |
+
'message' => $confirmation['messageToShow'],
|
104 |
+
'formBehavior' => $confirmation['samePageFormBehavior']
|
105 |
+
);
|
106 |
+
} else {
|
107 |
+
$redirectUrl = $confirmation['customUrl'];
|
108 |
+
if ($confirmation['redirectTo'] == 'customPage') {
|
109 |
+
$redirectUrl = get_permalink($confirmation['customPage']);
|
110 |
+
}
|
111 |
+
$returnData = array(
|
112 |
+
'message' => $confirmation['messageToShow'],
|
113 |
+
'redirectUrl' => $redirectUrl
|
114 |
+
);
|
115 |
+
}
|
116 |
+
|
117 |
+
$returnData = $this->app->applyFilters(
|
118 |
+
'fluentform_submission_confirmation', $returnData, $form, $confirmation
|
119 |
+
);
|
120 |
+
|
121 |
+
wp_send_json_success(array(
|
122 |
+
'insert_id' => $insertId,
|
123 |
+
'result' => $returnData
|
124 |
+
), 200);
|
125 |
+
}
|
126 |
+
|
127 |
+
/**
|
128 |
+
* Validate form data.
|
129 |
+
*
|
130 |
+
* @param $form
|
131 |
+
* @param $fields
|
132 |
+
*
|
133 |
+
* @return bool
|
134 |
+
*/
|
135 |
+
private function validate($form, &$fields)
|
136 |
+
{
|
137 |
+
$this->validateRestrictions($form, $fields);
|
138 |
+
|
139 |
+
$this->validateNonce($form->id);
|
140 |
+
|
141 |
+
$this->validateReCaptcha();
|
142 |
+
|
143 |
+
list($rules, $messages) = $this->parser->getValidations($this->formData, $fields);
|
144 |
+
|
145 |
+
// Fire an event so that one can hook into it to work with the rules.
|
146 |
+
$rules = $this->app->applyFilters('fluentform_validation_rules', $rules, $form);
|
147 |
+
|
148 |
+
// Fire an event so that one can hook into it to work with the messages.
|
149 |
+
$messages = $this->app->applyFilters('fluentform_validation_messages', $messages, $form);
|
150 |
+
|
151 |
+
$validator = \FluentValidator\Validator::make($this->formData, $rules, $messages);
|
152 |
+
|
153 |
+
if ($validator->validate()->fails()) {
|
154 |
+
// Fire an event so that one can hook into it to work with the errors.
|
155 |
+
$errors = $this->app->applyFilters('fluentform_validation_error', $validator->errors(), $form);
|
156 |
+
|
157 |
+
wp_send_json(['errors' => $errors], 423);
|
158 |
+
}
|
159 |
+
|
160 |
+
return true;
|
161 |
+
}
|
162 |
+
|
163 |
+
/**
|
164 |
+
* Validate nonce.
|
165 |
+
*
|
166 |
+
* @param $formId
|
167 |
+
*/
|
168 |
+
private function validateNonce($formId)
|
169 |
+
{
|
170 |
+
$shouldVerifyNonce = $this->app->applyFilters('fluentform_nonce_verify', true, $formId);
|
171 |
+
|
172 |
+
if ($shouldVerifyNonce) {
|
173 |
+
$nonce = ArrayHelper::get($this->formData, '_fluentform_'.$formId.'_fluentformnonce');
|
174 |
+
if (! wp_verify_nonce($nonce, 'fluentform-submit-form')) {
|
175 |
+
$errors = $this->app->applyFilters('fluentForm_nonce_error', [
|
176 |
+
'_fluentformnonce' => [
|
177 |
+
__('Nonce verification failed, please try again.', 'fluentform')
|
178 |
+
]
|
179 |
+
]);
|
180 |
+
|
181 |
+
wp_send_json(['errors' => $errors], 423);
|
182 |
+
}
|
183 |
+
}
|
184 |
+
}
|
185 |
+
|
186 |
+
/**
|
187 |
+
* Validate reCaptcha.
|
188 |
+
*
|
189 |
+
* @param $formId
|
190 |
+
*/
|
191 |
+
private function validateReCaptcha()
|
192 |
+
{
|
193 |
+
if ($this->parser->hasElement('recaptcha')) {
|
194 |
+
$isValid = ReCaptcha::validate(ArrayHelper::get($this->formData, 'g-recaptcha-response'));
|
195 |
+
|
196 |
+
if (! $isValid) {
|
197 |
+
wp_send_json([
|
198 |
+
'errors' => [
|
199 |
+
'g-recaptcha-response' => [
|
200 |
+
__('reCaptcha verification failed, please try again.', 'fluentform')
|
201 |
+
]
|
202 |
+
]
|
203 |
+
], 423);
|
204 |
+
}
|
205 |
+
}
|
206 |
+
}
|
207 |
+
|
208 |
+
/**
|
209 |
+
* Validate form data based on the form restrictions settings.
|
210 |
+
*
|
211 |
+
* @param \stdClass $form
|
212 |
+
* @param $fields
|
213 |
+
*/
|
214 |
+
private function validateRestrictions($form, &$fields)
|
215 |
+
{
|
216 |
+
$formSettings = wpFluent()->table('fluentform_form_meta')->where('form_id', $form->id)
|
217 |
+
->where('meta_key', 'formSettings')
|
218 |
+
->first();
|
219 |
+
|
220 |
+
$form->settings = $formSettings ? json_decode($formSettings->value, true) : [];
|
221 |
+
|
222 |
+
$isAllowed = [
|
223 |
+
'status' => true,
|
224 |
+
'message' => ''
|
225 |
+
];
|
226 |
+
|
227 |
+
// This will check the following restriction settings.
|
228 |
+
// 1. limitNumberOfEntries
|
229 |
+
// 2. scheduleForm
|
230 |
+
// 3. requireLogin
|
231 |
+
$isAllowed = apply_filters('fluentform_is_form_renderable', $isAllowed, $form);
|
232 |
+
|
233 |
+
if (! $isAllowed['status']) {
|
234 |
+
wp_send_json([
|
235 |
+
'errors' => [
|
236 |
+
'restricted' => [
|
237 |
+
__($isAllowed['message'], 'fluentform')
|
238 |
+
]
|
239 |
+
]
|
240 |
+
], 423);
|
241 |
+
}
|
242 |
+
|
243 |
+
// Since we are here, we should now handle if the form should be allowed to submit empty.
|
244 |
+
$restrictions = ArrayHelper::get($form->settings, 'restrictions.denyEmptySubmission', []);
|
245 |
+
$this->handleDenyEmptySubmission($restrictions, $fields);
|
246 |
+
}
|
247 |
+
|
248 |
+
/**
|
249 |
+
* Handle response when empty form submission is not allowed.
|
250 |
+
*
|
251 |
+
* @param array $settings
|
252 |
+
* @param $fields
|
253 |
+
*/
|
254 |
+
private function handleDenyEmptySubmission($settings = [], &$fields)
|
255 |
+
{
|
256 |
+
// Determine whether empty form submission is allowed or not.
|
257 |
+
if (ArrayHelper::get($settings, 'enabled')) {
|
258 |
+
// confirm this form has no required fields.
|
259 |
+
if (! $this->parser->hasRequiredFields($fields)) {
|
260 |
+
// Filter out the form data which doesn't have values.
|
261 |
+
$filteredFormData = array_filter(
|
262 |
+
// Filter out the other meta fields that aren't actual inputs.
|
263 |
+
array_intersect_key($this->formData, $fields)
|
264 |
+
);
|
265 |
+
|
266 |
+
if (! count($filteredFormData)) {
|
267 |
+
wp_send_json([
|
268 |
+
'errors' => [
|
269 |
+
'restricted' => [
|
270 |
+
__(ArrayHelper::get($settings, 'message'), 'fluentform')
|
271 |
+
]
|
272 |
+
]
|
273 |
+
], 423);
|
274 |
+
}
|
275 |
+
}
|
276 |
+
}
|
277 |
+
}
|
278 |
+
|
279 |
+
/**
|
280 |
+
* Prepare the data to be inserted to the database.
|
281 |
+
*
|
282 |
+
* @param $formId
|
283 |
+
*
|
284 |
+
* @return array
|
285 |
+
*/
|
286 |
+
private function prepareInsertData($formId)
|
287 |
+
{
|
288 |
+
$previousItem = wpFluent()->table('fluentform_submissions')
|
289 |
+
->where('form_id', $formId)
|
290 |
+
->orderBy('id', 'DESC')
|
291 |
+
->first();
|
292 |
+
|
293 |
+
$serialNumber = 1;
|
294 |
+
|
295 |
+
if ($previousItem) {
|
296 |
+
$serialNumber = $previousItem->serial_number + 1;
|
297 |
+
}
|
298 |
+
|
299 |
+
$browser = new Browser;
|
300 |
+
|
301 |
+
return [
|
302 |
+
'form_id' => $formId,
|
303 |
+
'serial_number' => $serialNumber,
|
304 |
+
'response' => json_encode($this->formData),
|
305 |
+
'source_url' => site_url(ArrayHelper::get($this->formData, '_wp_http_referer')),
|
306 |
+
'user_id' => get_current_user_id(),
|
307 |
+
'browser' => $browser->getBrowser(),
|
308 |
+
'device' => $browser->getPlatform(),
|
309 |
+
'ip' => $this->app->request->getIp(),
|
310 |
+
'created_at' => date("Y-m-d H:i:s"),
|
311 |
+
'updated_at' => date("Y-m-d H:i:s")
|
312 |
+
];
|
313 |
+
}
|
314 |
+
}
|
app/Modules/Form/Inputs.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Modules\Form;
|
4 |
+
|
5 |
+
use FluentForm\App\Modules\Acl\Acl;
|
6 |
+
use FluentForm\App\Services\FormParser;
|
7 |
+
use FluentForm\Framework\Foundation\Application;
|
8 |
+
|
9 |
+
class Inputs
|
10 |
+
{
|
11 |
+
/**
|
12 |
+
* @var \FluentForm\Framework\Request\Request
|
13 |
+
*/
|
14 |
+
private $request;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Build the class instance
|
18 |
+
* @throws \Exception
|
19 |
+
*/
|
20 |
+
public function __construct(Application $application)
|
21 |
+
{
|
22 |
+
Acl::verify('fluentform_forms_manager');
|
23 |
+
|
24 |
+
$this->request = $application->request;
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Get all the flatten form inputs
|
29 |
+
* @return void
|
30 |
+
*/
|
31 |
+
public function index()
|
32 |
+
{
|
33 |
+
$formId = $this->request->get('formId');
|
34 |
+
|
35 |
+
$form = wpFluent()->table('fluentform_forms')->find($formId);
|
36 |
+
$fields = (new FormParser($form))->getEntryInputs(array('admin_label', 'attributes'));
|
37 |
+
wp_send_json($fields, 200);
|
38 |
+
}
|
39 |
+
}
|
app/Modules/Form/Settings/ExtraSettings.php
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Modules\Form\Settings;
|
4 |
+
|
5 |
+
use FluentForm\App;
|
6 |
+
use FluentForm\App\Modules\Acl\Acl;
|
7 |
+
use FluentForm\Framework\Foundation\Application;
|
8 |
+
|
9 |
+
class ExtraSettings
|
10 |
+
{
|
11 |
+
/**
|
12 |
+
* @var \FluentForm\Framework\Request\Request $request
|
13 |
+
*/
|
14 |
+
protected $request;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* @var \WpFluent\QueryBuilder\QueryBuilderHandler
|
18 |
+
*/
|
19 |
+
protected $form_model;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Construct the object
|
23 |
+
* @throws \Exception
|
24 |
+
* @return void
|
25 |
+
*/
|
26 |
+
public function __construct(Application $application)
|
27 |
+
{
|
28 |
+
Acl::verify('fluentform_settings_manager');
|
29 |
+
|
30 |
+
$this->request = $application->request;
|
31 |
+
$this->form_model = wpFluent()->table('fluentform_forms');
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Get extra settig navigations
|
36 |
+
* @return void
|
37 |
+
*/
|
38 |
+
public function getExtraSettingNavs()
|
39 |
+
{
|
40 |
+
$formId = $this->request->get('form_id');
|
41 |
+
$extraSettings = array(
|
42 |
+
array(
|
43 |
+
'name' => 'web_hooks',
|
44 |
+
'label' => __('Web Hooks', 'fluentform'),
|
45 |
+
'action' => 'fluentform_get_settings_page',
|
46 |
+
'addon' => 'Fluent Web Hooks'
|
47 |
+
),
|
48 |
+
array(
|
49 |
+
'name' => 'trello',
|
50 |
+
'label' => __('Trello', 'fluentform'),
|
51 |
+
'action' => 'fluentform_get_settings_page',
|
52 |
+
'addon' => 'Trello'
|
53 |
+
)
|
54 |
+
);
|
55 |
+
wp_send_json_success(
|
56 |
+
array(
|
57 |
+
'setting_navs' => $extraSettings
|
58 |
+
), 200);
|
59 |
+
exit();
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Get extra settigs component
|
64 |
+
* @return void
|
65 |
+
*/
|
66 |
+
public function getExtraSettingsComponent()
|
67 |
+
{
|
68 |
+
$formId = $this->request->get('form_id');
|
69 |
+
$module = $this->request->get('module');
|
70 |
+
|
71 |
+
$component = array(
|
72 |
+
'name' => 'fluentform_settings_'.$module,
|
73 |
+
'props' => ['form_id'],
|
74 |
+
'template' => "<p>Setting Not Found</p>"
|
75 |
+
);
|
76 |
+
|
77 |
+
$component = apply_filters('fluentform_settings_module_'.$module, $component, $formId);
|
78 |
+
|
79 |
+
wp_send_json_success(array(
|
80 |
+
'component' => $component,
|
81 |
+
'name' => 'fluentform_settings_'.$module,
|
82 |
+
'js_url' => site_url().'/test.js'
|
83 |
+
));
|
84 |
+
exit();
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Get trello settigs
|
89 |
+
* @return void
|
90 |
+
*/
|
91 |
+
public function getTrelloSettingsComponent($component, $formId)
|
92 |
+
{
|
93 |
+
return $component;
|
94 |
+
}
|
95 |
+
}
|
app/Modules/Form/Settings/FormSettings.php
ADDED
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Modules\Form\Settings;
|
4 |
+
|
5 |
+
use FluentForm\App\Modules\Acl\Acl;
|
6 |
+
use FluentForm\Framework\Helpers\ArrayHelper;
|
7 |
+
use FluentForm\Framework\Foundation\Application;
|
8 |
+
use FluentForm\App\Modules\Form\Settings\Validator\Validator;
|
9 |
+
|
10 |
+
class FormSettings
|
11 |
+
{
|
12 |
+
/**
|
13 |
+
* @var \FluentForm\Framework\Request\Request
|
14 |
+
*/
|
15 |
+
private $request;
|
16 |
+
|
17 |
+
/**
|
18 |
+
* @var int form ID.
|
19 |
+
*/
|
20 |
+
private $formId;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* The settings (fluentform_form_meta) query builder.
|
24 |
+
*
|
25 |
+
* @var \WpFluent\QueryBuilder\QueryBuilderHandler
|
26 |
+
*/
|
27 |
+
private $settingsQuery;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Construct the object
|
31 |
+
* @throws \Exception
|
32 |
+
*/
|
33 |
+
public function __construct(Application $application)
|
34 |
+
{
|
35 |
+
Acl::verify('fluentform_settings_manager');
|
36 |
+
|
37 |
+
$this->request = $application->request;
|
38 |
+
|
39 |
+
$this->formId = intval($this->request->get('form_id'));
|
40 |
+
|
41 |
+
$this->settingsQuery = wpFluent()->table('fluentform_form_meta')->where('form_id', $this->formId);
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Get settings for a particular form by id
|
46 |
+
* @return void
|
47 |
+
*/
|
48 |
+
public function index()
|
49 |
+
{
|
50 |
+
$metaKey = sanitize_text_field($this->request->get('meta_key'));
|
51 |
+
|
52 |
+
// We'll always try to get a collection for a given meta key.
|
53 |
+
// Acknowledging that a certain meta key can have multiple
|
54 |
+
// results. The developer using the api knows beforehand
|
55 |
+
// that whether the expected result contains multiple
|
56 |
+
// or one value. The developer will access that way.
|
57 |
+
$result = $this->settingsQuery->where('meta_key', $metaKey)->get();
|
58 |
+
|
59 |
+
foreach ($result as $item) {
|
60 |
+
$item->value = json_decode($item->value, true);
|
61 |
+
}
|
62 |
+
|
63 |
+
wp_send_json_success([
|
64 |
+
'result' => $result
|
65 |
+
], 200);
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Save settings/meta for a form in database
|
70 |
+
*/
|
71 |
+
public function store()
|
72 |
+
{
|
73 |
+
$key = sanitize_text_field($this->request->get('meta_key'));
|
74 |
+
|
75 |
+
$value = $this->request->get('value', '');
|
76 |
+
|
77 |
+
$valueArray = $value ? json_decode($value, true) : [];
|
78 |
+
|
79 |
+
if ($key == 'formSettings') {
|
80 |
+
$confirmation = ArrayHelper::get($valueArray, 'confirmation', []);
|
81 |
+
|
82 |
+
Validator::validate('confirmations', $confirmation);
|
83 |
+
} else {
|
84 |
+
Validator::validate($key, $valueArray);
|
85 |
+
}
|
86 |
+
|
87 |
+
$data = [
|
88 |
+
'form_id' => $this->formId,
|
89 |
+
'meta_key' => $key,
|
90 |
+
'value' => $value
|
91 |
+
];
|
92 |
+
|
93 |
+
// If the request has an valid id field it's safe to assume
|
94 |
+
// that the user wants to update an existing settings.
|
95 |
+
// So, we'll proceed to do so by finding it first.
|
96 |
+
$id = intval($this->request->get('id'));
|
97 |
+
|
98 |
+
if ($id) {
|
99 |
+
$settings = $this->settingsQuery->find($id);
|
100 |
+
}
|
101 |
+
|
102 |
+
if (isset($settings)) {
|
103 |
+
$this->settingsQuery->where('id', $settings->id)->update($data);
|
104 |
+
|
105 |
+
$insertId = $settings->id;
|
106 |
+
} else {
|
107 |
+
$insertId = $this->settingsQuery->insert($data);
|
108 |
+
}
|
109 |
+
|
110 |
+
wp_send_json_success([
|
111 |
+
'message' => __('Settings has been saved.', 'fluentform'),
|
112 |
+
'settings' => json_decode($value, true),
|
113 |
+
'id' => $insertId
|
114 |
+
], 200);
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Delete settings/meta from database for a given form
|
119 |
+
* @return void
|
120 |
+
*/
|
121 |
+
public function remove()
|
122 |
+
{
|
123 |
+
$id = intval($this->request->get('id'));
|
124 |
+
|
125 |
+
$this->settingsQuery->where('id', $id)->delete();
|
126 |
+
|
127 |
+
wp_send_json([], 200);
|
128 |
+
}
|
129 |
+
}
|
app/Modules/Form/Settings/Validator/Confirmations.php
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Modules\Form\Settings\Validator;
|
4 |
+
|
5 |
+
use FluentValidator\Validator;
|
6 |
+
|
7 |
+
class Confirmations
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* Validates confirmations settings data.
|
11 |
+
*
|
12 |
+
* @param array $data
|
13 |
+
*
|
14 |
+
* @return bool
|
15 |
+
*/
|
16 |
+
public static function validate($data = [])
|
17 |
+
{
|
18 |
+
// Prepare the validation rules & messages.
|
19 |
+
list($rules, $messages) = static::validations();
|
20 |
+
|
21 |
+
// Make validator instance.
|
22 |
+
$validator = Validator::make($data, $rules, $messages);
|
23 |
+
|
24 |
+
// Add conditional validations if there's any.
|
25 |
+
$validator = static::conditionalValidations($validator);
|
26 |
+
|
27 |
+
// Validate and process response.
|
28 |
+
if ($validator->validate()->fails()) {
|
29 |
+
wp_send_json_error([
|
30 |
+
'errors' => $validator->errors()
|
31 |
+
], 423);
|
32 |
+
}
|
33 |
+
|
34 |
+
return true;
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Produce the necessary validation rules and corresponding messages
|
39 |
+
*
|
40 |
+
* @return array
|
41 |
+
*/
|
42 |
+
public static function validations()
|
43 |
+
{
|
44 |
+
return [
|
45 |
+
[
|
46 |
+
'redirectTo' => 'required',
|
47 |
+
'customPage' => 'required_if:redirectTo,customPage',
|
48 |
+
'customUrl' => 'required_if:redirectTo,customUrl',
|
49 |
+
],
|
50 |
+
[
|
51 |
+
'redirectTo.required' => 'The Confirmation Type field is required.',
|
52 |
+
'customPage.required_if' => 'The Page field is required when Confirmation Type is Page.',
|
53 |
+
'customUrl.required_if' => 'The Redirect URL field is required when Confirmation Type is Redirect.',
|
54 |
+
'customUrl.url' => 'The Redirect URL format is invalid.',
|
55 |
+
]
|
56 |
+
];
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Add conditional validations to the validator.
|
61 |
+
*
|
62 |
+
* @param \FluentValidator\Validator $validator
|
63 |
+
*
|
64 |
+
* @return \FluentValidator\Validator
|
65 |
+
*/
|
66 |
+
public static function conditionalValidations(Validator $validator)
|
67 |
+
{
|
68 |
+
$validator->sometimes('customUrl', 'url', function ($input) {
|
69 |
+
return $input['redirectTo'] === 'customUrl';
|
70 |
+
});
|
71 |
+
|
72 |
+
return $validator;
|
73 |
+
}
|
74 |
+
}
|
app/Modules/Form/Settings/Validator/MailChimps.php
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Modules\Form\Settings\Validator;
|
4 |
+
|
5 |
+
use FluentValidator\Validator;
|
6 |
+
|
7 |
+
class MailChimps
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* Validates mailchimp feed settings data.
|
11 |
+
*
|
12 |
+
* @param array $data
|
13 |
+
*
|
14 |
+
* @return bool
|
15 |
+
*/
|
16 |
+
public static function validate($data = [])
|
17 |
+
{
|
18 |
+
// Prepare the validation rules & messages.
|
19 |
+
list($rules, $messages) = static::validations();
|
20 |
+
|
21 |
+
// Make validator instance.
|
22 |
+
$validator = Validator::make($data, $rules, $messages);
|
23 |
+
|
24 |
+
// Add conditional validations if there's any.
|
25 |
+
$validator = static::conditionalValidations($validator);
|
26 |
+
|
27 |
+
// Validate and process response.
|
28 |
+
if ($validator->validate()->fails()) {
|
29 |
+
wp_send_json_error(['errors' => $validator->errors()], 423);
|
30 |
+
}
|
31 |
+
|
32 |
+
return true;
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Produce the necessary validation rules and corresponding messages
|
37 |
+
*
|
38 |
+
* @return array
|
39 |
+
*/
|
40 |
+
public static function validations()
|
41 |
+
{
|
42 |
+
return [
|
43 |
+
[
|
44 |
+
'name' => 'required',
|
45 |
+
'list' => 'required',
|
46 |
+
'fieldEmailAddress' => 'required',
|
47 |
+
],
|
48 |
+
[
|
49 |
+
'name.required' => 'The Name field is required.',
|
50 |
+
'list.required' => 'The MailChimp List field is required.',
|
51 |
+
'fieldEmailAddress.required' => 'The Email Address field is required.',
|
52 |
+
]
|
53 |
+
];
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Add conditional validations to the validator.
|
58 |
+
*
|
59 |
+
* @param \FluentValidator\Validator $validator
|
60 |
+
*
|
61 |
+
* @return \FluentValidator\Validator
|
62 |
+
*/
|
63 |
+
public static function conditionalValidations(Validator $validator)
|
64 |
+
{
|
65 |
+
return $validator;
|
66 |
+
}
|
67 |
+
}
|
app/Modules/Form/Settings/Validator/Notifications.php
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Modules\Form\Settings\Validator;
|
4 |
+
|
5 |
+
use FluentValidator\Validator;
|
6 |
+
use FluentForm\Framework\Helpers\ArrayHelper;
|
7 |
+
|
8 |
+
class Notifications
|
9 |
+
{
|
10 |
+
/**
|
11 |
+
* Validates notifications settings data.
|
12 |
+
*
|
13 |
+
* @param array $data
|
14 |
+
*
|
15 |
+
* @return bool
|
16 |
+
*/
|
17 |
+
public static function validate($data = [])
|
18 |
+
{
|
19 |
+
// Prepare the validation rules & messages.
|
20 |
+
list($rules, $messages) = static::validations();
|
21 |
+
|
22 |
+
// Make validator instance.
|
23 |
+
$validator = Validator::make($data, $rules, $messages);
|
24 |
+
|
25 |
+
// Add conditional validations if there's any.
|
26 |
+
$validator = static::conditionalValidations($validator);
|
27 |
+
|
28 |
+
// Validate and process response.
|
29 |
+
if ($validator->validate()->fails()) {
|
30 |
+
wp_send_json_error(['errors' => $validator->errors()], 423);
|
31 |
+
}
|
32 |
+
|
33 |
+
return true;
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Produce the necessary validation rules and corresponding messages
|
38 |
+
*
|
39 |
+
* @return array
|
40 |
+
*/
|
41 |
+
public static function validations()
|
42 |
+
{
|
43 |
+
return [
|
44 |
+
[
|
45 |
+
'sendTo.type' => 'required',
|
46 |
+
'sendTo.email' => 'required_if:sendTo.type,email',
|
47 |
+
'sendTo.field' => 'required_if:sendTo.type,field',
|
48 |
+
'subject' => 'required',
|
49 |
+
'message' => 'required',
|
50 |
+
],
|
51 |
+
[
|
52 |
+
'sendTo.type.required' => 'The Send To field is required.',
|
53 |
+
'sendTo.email.required_if' => 'The Send to Email field is required.',
|
54 |
+
'sendTo.field.required_if' => 'The Send to Field field is required.',
|
55 |
+
'sendTo.routing.*.email.required' => 'Please fill all the routing rules above.',
|
56 |
+
]
|
57 |
+
];
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Add conditional validations to the validator.
|
62 |
+
*
|
63 |
+
* @param \FluentValidator\Validator $validator
|
64 |
+
*
|
65 |
+
* @return \FluentValidator\Validator
|
66 |
+
*/
|
67 |
+
public static function conditionalValidations(Validator $validator)
|
68 |
+
{
|
69 |
+
$validator->sometimes('sendTo.routing.*.email', 'required', function ($input) {
|
70 |
+
if (ArrayHelper::get($input, 'sendTo.type') !== 'routing') {
|
71 |
+
return false;
|
72 |
+
}
|
73 |
+
|
74 |
+
$routingInputs = ArrayHelper::get($input, 'sendTo.routing');
|
75 |
+
|
76 |
+
$required = false;
|
77 |
+
|
78 |
+
foreach ($routingInputs as $routingInput) {
|
79 |
+
if (! $routingInput['email'] || ! $routingInput['field'] || ! $routingInput['value']) {
|
80 |
+
$required = true;
|
81 |
+
|
82 |
+
break;
|
83 |
+
}
|
84 |
+
}
|
85 |
+
|
86 |
+
return $required;
|
87 |
+
});
|
88 |
+
|
89 |
+
return $validator;
|
90 |
+
}
|
91 |
+
}
|
app/Modules/Form/Settings/Validator/Validator.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Modules\Form\Settings\Validator;
|
4 |
+
|
5 |
+
class Validator
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Centralized validator for all the settings data.
|
9 |
+
*
|
10 |
+
* @param $key
|
11 |
+
* @param array $data
|
12 |
+
*/
|
13 |
+
public static function validate($key, $data = [])
|
14 |
+
{
|
15 |
+
$key = ucwords($key);
|
16 |
+
|
17 |
+
$class = '\FluentForm\App\Modules\Form\Settings\Validator\\'.$key;
|
18 |
+
|
19 |
+
if (class_exists($class)) {
|
20 |
+
/**
|
21 |
+
* @var $class Confirmations|MailChimps|Notifications
|
22 |
+
*/
|
23 |
+
$class::validate($data);
|
24 |
+
}
|
25 |
+
}
|
26 |
+
}
|
app/Modules/Integration/BaseIntegration.php
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php namespace FluentForm\App\Modules\Integration;
|
2 |
+
|
3 |
+
class BaseIntegration
|
4 |
+
{
|
5 |
+
private $setting_key = '';
|
6 |
+
private $isMultiple = false;
|
7 |
+
private $formId = false;
|
8 |
+
private $isJsonValue = true;
|
9 |
+
|
10 |
+
public function __construct($settings_key = '', $form_id = false, $isMultiple = false)
|
11 |
+
{
|
12 |
+
$this->setting_key = $settings_key;
|
13 |
+
$this->isMultiple = $isMultiple;
|
14 |
+
$this->formId = $form_id;
|
15 |
+
}
|
16 |
+
|
17 |
+
public function setSettingsKey($key)
|
18 |
+
{
|
19 |
+
$this->setting_key = $key;
|
20 |
+
}
|
21 |
+
|
22 |
+
public function setIsMultiple($isMultiple)
|
23 |
+
{
|
24 |
+
$this->isMultiple = $isMultiple;
|
25 |
+
}
|
26 |
+
|
27 |
+
public function setFormId($formId)
|
28 |
+
{
|
29 |
+
$this->formId = $formId;
|
30 |
+
}
|
31 |
+
|
32 |
+
public function setJasonType($type)
|
33 |
+
{
|
34 |
+
$this->isJsonValue = $type;
|
35 |
+
}
|
36 |
+
|
37 |
+
public function save($settings)
|
38 |
+
{
|
39 |
+
return wpFluent()->table('fluentform_form_meta')
|
40 |
+
->insert(array(
|
41 |
+
'meta_key' => $this->setting_key,
|
42 |
+
'form_id' => $this->formId,
|
43 |
+
'value' => json_encode($settings)
|
44 |
+
));
|
45 |
+
}
|
46 |
+
|
47 |
+
public function update($settingsId, $settings)
|
48 |
+
{
|
49 |
+
return wpFluent()->table('fluentform_form_meta')
|
50 |
+
->where('id', $settingsId)
|
51 |
+
->update(array(
|
52 |
+
'value' => json_encode($settings)
|
53 |
+
));
|
54 |
+
}
|
55 |
+
|
56 |
+
public function get($settingsId)
|
57 |
+
{
|
58 |
+
$settings = wpFluent()->table('fluentform_form_meta')
|
59 |
+
->where('form_id', $this->formId)
|
60 |
+
->where('meta_key', $this->setting_key)
|
61 |
+
->find($settingsId);
|
62 |
+
$settings->formattedValue = $this->getFormattedValue($settings);
|
63 |
+
return $settings;
|
64 |
+
}
|
65 |
+
|
66 |
+
public function getAll()
|
67 |
+
{
|
68 |
+
$settingsQuery = wpFluent()->table('fluentform_form_meta')
|
69 |
+
->where('form_id', $this->formId)
|
70 |
+
->where('meta_key', $this->setting_key);
|
71 |
+
if($this->isMultiple) {
|
72 |
+
$settings = $settingsQuery->get();
|
73 |
+
foreach ($settings as $setting) {
|
74 |
+
$setting->formattedValue = $this->getFormattedValue($setting);
|
75 |
+
}
|
76 |
+
} else {
|
77 |
+
$settings = $settingsQuery->first();
|
78 |
+
$settings->formattedValue = $this->getFormattedValue($settings);
|
79 |
+
}
|
80 |
+
return $settings;
|
81 |
+
}
|
82 |
+
|
83 |
+
public function delete($settingsId)
|
84 |
+
{
|
85 |
+
return wpFluent()->table('fluentform_form_meta')
|
86 |
+
->where('meta_key', $this->setting_key)
|
87 |
+
->where('form_id', $this->formId)
|
88 |
+
->where('id', $settingsId)
|
89 |
+
->delete();
|
90 |
+
}
|
91 |
+
|
92 |
+
public function deleteAll()
|
93 |
+
{
|
94 |
+
|
95 |
+
}
|
96 |
+
|
97 |
+
private function getFormattedValue($setting)
|
98 |
+
{
|
99 |
+
if($this->isJsonValue)
|
100 |
+
return json_decode($setting->value, true);
|
101 |
+
return $setting->value;
|
102 |
+
}
|
103 |
+
}
|
app/Modules/Integration/MailChimpIntegration.php
ADDED
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php namespace FluentForm\App\Modules\Integration;
|
2 |
+
|
3 |
+
use FluentForm\App\Services\Integrations\MailChimp;
|
4 |
+
use FluentForm\Framework\Foundation\Application;
|
5 |
+
use FluentValidator\Validator;
|
6 |
+
|
7 |
+
class MailChimpIntegration extends BaseIntegration
|
8 |
+
{
|
9 |
+
private $key = '_mailchimp_feeds';
|
10 |
+
|
11 |
+
private $app;
|
12 |
+
|
13 |
+
public function __construct(Application $application)
|
14 |
+
{
|
15 |
+
parent::__construct( $this->key, $application->request->get( 'form_id' , false ), true );
|
16 |
+
$this->app = $application;
|
17 |
+
}
|
18 |
+
|
19 |
+
public function getMailChimpSettings()
|
20 |
+
{
|
21 |
+
$globalStatus = $this->isConfigured();
|
22 |
+
$integrations = $this->getAll();
|
23 |
+
|
24 |
+
wp_send_json_success(array(
|
25 |
+
'global_status' => $globalStatus,
|
26 |
+
'integrations' => $integrations,
|
27 |
+
'configure_url' => admin_url('admin.php?page=fluent_forms_settings#mailchimp')
|
28 |
+
), 200);
|
29 |
+
|
30 |
+
}
|
31 |
+
|
32 |
+
public function getMailChimpLists()
|
33 |
+
{
|
34 |
+
if(!$this->isConfigured()) {
|
35 |
+
wp_send_json_error(array(
|
36 |
+
'error' => __('MailChimp is not configured yet', 'fluentform')
|
37 |
+
), 400);
|
38 |
+
}
|
39 |
+
$settings = get_option('_fluentform_mailchimp_details');
|
40 |
+
|
41 |
+
try {
|
42 |
+
$MailChimp = new MailChimp($settings['apiKey']);
|
43 |
+
$lists = $MailChimp->get('lists', array( 'count' => 9999 ));
|
44 |
+
if(!$MailChimp->success()) {
|
45 |
+
throw new \Exception($MailChimp->getLastError());
|
46 |
+
}
|
47 |
+
} catch (\Exception $exception) {
|
48 |
+
wp_send_json_error(array(
|
49 |
+
'message' => $exception->getMessage()
|
50 |
+
), 400);
|
51 |
+
}
|
52 |
+
|
53 |
+
$formattedLists = array();
|
54 |
+
|
55 |
+
foreach ($lists['lists'] as $list) {
|
56 |
+
$formattedLists[$list['id']] = $list;
|
57 |
+
}
|
58 |
+
|
59 |
+
wp_send_json_success(array(
|
60 |
+
'lists' => $formattedLists
|
61 |
+
), 200);
|
62 |
+
|
63 |
+
}
|
64 |
+
|
65 |
+
public function getMailChimpList()
|
66 |
+
{
|
67 |
+
if(!$this->isConfigured()) {
|
68 |
+
wp_send_json_error(array(
|
69 |
+
'error' => __('MailChimp is not configured yet', 'fluentform')
|
70 |
+
), 400);
|
71 |
+
}
|
72 |
+
$settings = get_option('_fluentform_mailchimp_details');
|
73 |
+
$list_id = $this->app->request->get('listId');
|
74 |
+
|
75 |
+
try {
|
76 |
+
$MailChimp = new MailChimp($settings['apiKey']);
|
77 |
+
$list = $MailChimp->get('lists/'.$list_id.'/merge-fields', array( 'count' => 9999 ));
|
78 |
+
if(!$MailChimp->success()) {
|
79 |
+
throw new \Exception($MailChimp->getLastError());
|
80 |
+
}
|
81 |
+
} catch (\Exception $exception) {
|
82 |
+
wp_send_json_error(array(
|
83 |
+
'message' => $exception->getMessage()
|
84 |
+
), 400);
|
85 |
+
}
|
86 |
+
|
87 |
+
$mergedFields = $list['merge_fields'];
|
88 |
+
$fields = array();
|
89 |
+
|
90 |
+
foreach ($mergedFields as $merged_field) {
|
91 |
+
$fields[$merged_field['tag']] = $merged_field['name'];
|
92 |
+
}
|
93 |
+
|
94 |
+
wp_send_json_success(array(
|
95 |
+
'merge_fields' => $fields
|
96 |
+
), 200);
|
97 |
+
}
|
98 |
+
|
99 |
+
|
100 |
+
public function saveNotification()
|
101 |
+
{
|
102 |
+
if(!$this->isConfigured()) {
|
103 |
+
wp_send_json_error(array(
|
104 |
+
'error' => __('MailChimp is not configured yet', 'fluentform')
|
105 |
+
), 400);
|
106 |
+
}
|
107 |
+
$notification = $this->app->request->get('notification');
|
108 |
+
$notification_id = $this->app->request->get('notification_id');
|
109 |
+
$notification = json_decode($notification, true);
|
110 |
+
|
111 |
+
// validate notification now
|
112 |
+
$this->validate($notification);
|
113 |
+
$notification = fluentFormSanitizer($notification);
|
114 |
+
|
115 |
+
if($notification_id) {
|
116 |
+
$this->update($notification_id, $notification);
|
117 |
+
$message = __('MailChimp Field successfully updated', 'fluentform');
|
118 |
+
} else {
|
119 |
+
$notification_id = $this->save($notification);
|
120 |
+
$message = __('MailChimp Field successfully created', 'fluentform');
|
121 |
+
}
|
122 |
+
|
123 |
+
wp_send_json_success(array(
|
124 |
+
'message' => $message,
|
125 |
+
'notification_id' => $notification_id
|
126 |
+
), 200);
|
127 |
+
|
128 |
+
}
|
129 |
+
|
130 |
+
public function deleteNotification()
|
131 |
+
{
|
132 |
+
$settingsId = $this->app->request->get('id');
|
133 |
+
$this->delete($settingsId);
|
134 |
+
wp_send_json_success(array(
|
135 |
+
'message' => __('Selected MailChimp Feed is deleted', 'fluentform'),
|
136 |
+
'integrations' => $this->getAll()
|
137 |
+
));
|
138 |
+
}
|
139 |
+
|
140 |
+
private function isConfigured()
|
141 |
+
{
|
142 |
+
$globalStatus = get_option('_fluentform_mailchimp_details');
|
143 |
+
return $globalStatus && $globalStatus['status'];
|
144 |
+
}
|
145 |
+
|
146 |
+
private function validate($notification)
|
147 |
+
{
|
148 |
+
$validate = fluentValidator($notification, array(
|
149 |
+
'name' => 'required',
|
150 |
+
'list_id' => 'required',
|
151 |
+
'fieldEmailAddress' => 'required'
|
152 |
+
), array(
|
153 |
+
'name.required' => __('MailChimp Feed Name is required', 'fluentform'),
|
154 |
+
'list.required' => __(' MailChimp List is required', 'fluentform'),
|
155 |
+
'fieldEmailAddress.required' => __('Email Address is required')
|
156 |
+
))->validate();
|
157 |
+
|
158 |
+
if($validate->fails())
|
159 |
+
{
|
160 |
+
wp_send_json_error(array(
|
161 |
+
'errors' => $validate->errors(),
|
162 |
+
'message' => __('Please fix the errors', 'fluentform')
|
163 |
+
), 400);
|
164 |
+
}
|
165 |
+
return true;
|
166 |
+
}
|
167 |
+
}
|
app/Modules/ProcessExteriorModule.php
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php namespace FluentForm\App\Modules;
|
2 |
+
|
3 |
+
use FluentForm\App;
|
4 |
+
use FluentForm\Config;
|
5 |
+
use FluentForm\Request;
|
6 |
+
use FluentForm\View;
|
7 |
+
|
8 |
+
class ProcessExteriorModule
|
9 |
+
{
|
10 |
+
public function handleExteriorPages()
|
11 |
+
{
|
12 |
+
if(isset($_GET['fluentform_pages']) && $_GET['fluentform_pages'] == 1) {
|
13 |
+
if(isset($_GET['preview_id']) && $_GET['preview_id']) {
|
14 |
+
$form_id = intval($_GET['preview_id']);
|
15 |
+
$this->loadDefaultPageTemplate();
|
16 |
+
$this->renderFormPreview($form_id);
|
17 |
+
}
|
18 |
+
}
|
19 |
+
}
|
20 |
+
|
21 |
+
public function renderFormPreview($form_id)
|
22 |
+
{
|
23 |
+
if(App\Modules\Acl\Acl::hasAnyFormPermission($form_id)) {
|
24 |
+
$form = wpFluent()->table('fluentform_forms')
|
25 |
+
->find($form_id);
|
26 |
+
if($form) {
|
27 |
+
add_action( 'pre_get_posts', array( $this, 'pre_get_posts' ), 100, 1 );
|
28 |
+
add_filter( 'post_thumbnail_html', '__return_empty_string' );
|
29 |
+
add_filter( 'get_the_excerpt', function ($content) {
|
30 |
+
return '';
|
31 |
+
} );
|
32 |
+
add_filter('the_title', function ($title) use ($form) {
|
33 |
+
if(in_the_loop()) {
|
34 |
+
return $form->title;
|
35 |
+
}
|
36 |
+
return $title;
|
37 |
+
}, 100, 1);
|
38 |
+
add_filter('the_content', function($content) use ($form) {
|
39 |
+
if(in_the_loop()) {
|
40 |
+
return View::make( 'public.preview_form', array(
|
41 |
+
'form' => $form
|
42 |
+
) );
|
43 |
+
}
|
44 |
+
return $content;
|
45 |
+
});
|
46 |
+
}
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
private function loadDefaultPageTemplate()
|
51 |
+
{
|
52 |
+
add_filter( 'template_include', function ($original) {
|
53 |
+
return locate_template( array( 'page.php', 'single.php', 'index.php' ) );
|
54 |
+
} );
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Set the posts to one
|
59 |
+
*
|
60 |
+
* @param WP_Query $query
|
61 |
+
*
|
62 |
+
* @return void
|
63 |
+
*/
|
64 |
+
public function pre_get_posts( $query ) {
|
65 |
+
if ( $query->is_main_query() ) {
|
66 |
+
$query->set( 'posts_per_page', 1 );
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
}
|
app/Modules/ReCaptcha/ReCaptcha.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Modules\ReCaptcha;
|
4 |
+
|
5 |
+
use FluentForm\Framework\Helpers\ArrayHelper;
|
6 |
+
|
7 |
+
class ReCaptcha
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* Verify reCaptcha response.
|
11 |
+
*
|
12 |
+
* @param string $token response from the user.
|
13 |
+
* @param null $secret provided or already stored secret key.
|
14 |
+
*
|
15 |
+
* @return bool
|
16 |
+
*/
|
17 |
+
public static function validate($token, $secret = null)
|
18 |
+
{
|
19 |
+
$verifyUrl = 'https://www.google.com/recaptcha/api/siteverify';
|
20 |
+
|
21 |
+
$secret = $secret ?: ArrayHelper::get(get_option('_fluentform_reCaptcha_details'), 'secretKey');
|
22 |
+
|
23 |
+
$response = wp_remote_post($verifyUrl, [
|
24 |
+
'method' => 'POST',
|
25 |
+
'body' => [
|
26 |
+
'secret' => $secret,
|
27 |
+
'response' => $token
|
28 |
+
],
|
29 |
+
]);
|
30 |
+
|
31 |
+
$isValid = false;
|
32 |
+
|
33 |
+
if (! is_wp_error($response)) {
|
34 |
+
$result = json_decode(wp_remote_retrieve_body($response));
|
35 |
+
|
36 |
+
$isValid = $result->success;
|
37 |
+
}
|
38 |
+
|
39 |
+
return $isValid;
|
40 |
+
}
|
41 |
+
}
|
app/Modules/Registerer/Menu.php
ADDED
@@ -0,0 +1,286 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Modules\Registerer;
|
4 |
+
|
5 |
+
use FluentForm\View;
|
6 |
+
use FluentForm\Framework\Foundation\Application;
|
7 |
+
|
8 |
+
class Menu
|
9 |
+
{
|
10 |
+
/**
|
11 |
+
* @var \FluentForm\Framework\Foundation\Application
|
12 |
+
*/
|
13 |
+
protected $app;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Menu constructor.
|
17 |
+
*
|
18 |
+
* @param \FluentForm\Framework\Foundation\Application $application
|
19 |
+
*/
|
20 |
+
public function __construct(Application $application)
|
21 |
+
{
|
22 |
+
$this->app = $application;
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Register menu and sub-menus.
|
27 |
+
*/
|
28 |
+
public function register()
|
29 |
+
{
|
30 |
+
$dashBoardCapability = apply_filters('fluentform_dashboard_capability', 'fluentform_settings_manager');
|
31 |
+
add_menu_page(
|
32 |
+
__('Fluent Form', 'fluentform'),
|
33 |
+
__('Fluent Form', 'fluentform'),
|
34 |
+
$dashBoardCapability,
|
35 |
+
'fluent_forms',
|
36 |
+
array($this, 'renderFormAdminRoute'),
|
37 |
+
$this->getMenuIcon(),
|
38 |
+
25
|
39 |
+
);
|
40 |
+
|
41 |
+
add_submenu_page(
|
42 |
+
'fluent_forms',
|
43 |
+
__('All Forms', 'fluentform'),
|
44 |
+
__('All Forms', 'fluentform'),
|
45 |
+
$dashBoardCapability,
|
46 |
+
'fluent_forms',
|
47 |
+
array($this, 'renderFormAdminRoute')
|
48 |
+
);
|
49 |
+
|
50 |
+
add_submenu_page(
|
51 |
+
'fluent_forms',
|
52 |
+
__('New Form', 'fluentform'),
|
53 |
+
__('New Form', 'fluentform'),
|
54 |
+
apply_filters('fluentform_settings_capability', 'fluentform_settings_manager'),
|
55 |
+
'fluent_forms#add=1',
|
56 |
+
array($this, 'renderFormAdminRoute')
|
57 |
+
);
|
58 |
+
|
59 |
+
// Register global settings sub menu page.
|
60 |
+
add_submenu_page(
|
61 |
+
'fluent_forms',
|
62 |
+
__('Settings', 'fluentform'),
|
63 |
+
__('Settings', 'fluentform'),
|
64 |
+
apply_filters('fluentform_settings_capability', 'fluentform_settings_manager'),
|
65 |
+
'fluent_forms_settings',
|
66 |
+
array($this, 'renderGlobalSettings')
|
67 |
+
);
|
68 |
+
}
|
69 |
+
|
70 |
+
|
71 |
+
private function getMenuIcon()
|
72 |
+
{
|
73 |
+
return 'data:image/svg+xml;base64,'.base64_encode('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><defs><style>.cls-1{fill:#fff;}</style></defs><title>dashboard_icon</title><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1"><path class="cls-1" d="M15.57,0H4.43A4.43,4.43,0,0,0,0,4.43V15.57A4.43,4.43,0,0,0,4.43,20H15.57A4.43,4.43,0,0,0,20,15.57V4.43A4.43,4.43,0,0,0,15.57,0ZM12.82,14a2.36,2.36,0,0,1-1.66.68H6.5A2.31,2.31,0,0,1,7.18,13a2.36,2.36,0,0,1,1.66-.68l4.66,0A2.34,2.34,0,0,1,12.82,14Zm3.3-3.46a2.36,2.36,0,0,1-1.66.68H3.21a2.25,2.25,0,0,1,.68-1.64,2.36,2.36,0,0,1,1.66-.68H16.79A2.25,2.25,0,0,1,16.12,10.53Zm0-3.73a2.36,2.36,0,0,1-1.66.68H3.21a2.25,2.25,0,0,1,.68-1.64,2.36,2.36,0,0,1,1.66-.68H16.79A2.25,2.25,0,0,1,16.12,6.81Z"/></g></g></svg>');
|
74 |
+
}
|
75 |
+
|
76 |
+
public function renderFormAdminRoute()
|
77 |
+
{
|
78 |
+
if (isset($_GET['route']) && isset($_GET['form_id'])) {
|
79 |
+
|
80 |
+
$version = $this->app->getVersion();
|
81 |
+
|
82 |
+
wp_enqueue_style('fluentform_settings_global', fluentformMix("css/settings_global.css"), array(), $version,
|
83 |
+
'all');
|
84 |
+
|
85 |
+
$form_id = intval($_GET['form_id']);
|
86 |
+
|
87 |
+
$formAdminMenus = array(
|
88 |
+
'editor' => array(
|
89 |
+
'slug' => 'editor',
|
90 |
+
'title' => __('Editor', 'fluentform')
|
91 |
+
),
|
92 |
+
'settings' => array(
|
93 |
+
'slug' => 'settings',
|
94 |
+
'hash' => 'basic_settings',
|
95 |
+
'title' => __('Settings', 'fluentform'),
|
96 |
+
'sub_route' => 'form_settings'
|
97 |
+
),
|
98 |
+
'entries' => array(
|
99 |
+
'slug' => 'entries',
|
100 |
+
'hash' => '/',
|
101 |
+
'title' => __('Entries', 'fluentform')
|
102 |
+
)
|
103 |
+
);
|
104 |
+
|
105 |
+
$formAdminMenus = apply_filters('fluentform_form_admin_menu', $formAdminMenus, $form_id);
|
106 |
+
|
107 |
+
$form = wpFluent()->table('fluentform_forms')->find($form_id);
|
108 |
+
|
109 |
+
if(!$form) {
|
110 |
+
echo __("<h2>No form found</h2>", 'fluentform');
|
111 |
+
die();
|
112 |
+
}
|
113 |
+
|
114 |
+
View::render('admin.form.form_wrapper', array(
|
115 |
+
'route' => sanitize_text_field($_GET['route']),
|
116 |
+
'form_id' => $form_id,
|
117 |
+
'form' => $form,
|
118 |
+
'menu_items' => $formAdminMenus
|
119 |
+
));
|
120 |
+
|
121 |
+
return;
|
122 |
+
}
|
123 |
+
$this->renderForms();
|
124 |
+
}
|
125 |
+
|
126 |
+
public function renderSettings($form_id)
|
127 |
+
{
|
128 |
+
$settingsMenus = array(
|
129 |
+
'form_settings' => array(
|
130 |
+
'title' => __('Form Settings', 'fluentform'),
|
131 |
+
'slug' => 'form_settings',
|
132 |
+
'hash' => 'basic_settings'
|
133 |
+
),
|
134 |
+
'email_notifications' => array(
|
135 |
+
'title' => __('Email Notifications', 'fluentform'),
|
136 |
+
'slug' => 'form_settings',
|
137 |
+
'hash' => 'email_notifications'
|
138 |
+
),
|
139 |
+
'mailchimp_integration' => array(
|
140 |
+
'title' => __('MailChimp', 'fluentform'),
|
141 |
+
'slug' => 'form_settings',
|
142 |
+
'hash' => 'mailchimp_integration'
|
143 |
+
),
|
144 |
+
'slack' => array(
|
145 |
+
'title' => __('Slack', 'fluentform'),
|
146 |
+
'slug' => 'form_settings',
|
147 |
+
'hash' => 'slack'
|
148 |
+
)
|
149 |
+
);
|
150 |
+
$settingsMenus = apply_filters('fluentform_form_settings_menu', $settingsMenus, $form_id);
|
151 |
+
$currentRoute = isset($_REQUEST['sub_route']) ? sanitize_text_field($_REQUEST['sub_route']) : '';
|
152 |
+
|
153 |
+
View::render('admin.form.settings_wrapper', array(
|
154 |
+
'form_id' => $form_id,
|
155 |
+
'settings_menus' => $settingsMenus,
|
156 |
+
'current_sub_route' => $currentRoute
|
157 |
+
));
|
158 |
+
}
|
159 |
+
|
160 |
+
public function renderFormSettings($form_id)
|
161 |
+
{
|
162 |
+
$version = $this->app->getVersion();
|
163 |
+
|
164 |
+
|
165 |
+
if (function_exists('wp_enqueue_editor')) {
|
166 |
+
wp_enqueue_editor();
|
167 |
+
}
|
168 |
+
|
169 |
+
wp_enqueue_script('fluentform_form_settings', fluentformMix("js/form_settings_app.js"), array('jquery'), $version,
|
170 |
+
false);
|
171 |
+
|
172 |
+
wp_localize_script('fluentform_form_settings', 'FluentFormApp', array(
|
173 |
+
'form_id' => $form_id,
|
174 |
+
'plugin' => $this->app->getSlug()
|
175 |
+
));
|
176 |
+
|
177 |
+
View::render('admin.form.settings', array(
|
178 |
+
'form_id' => $form_id
|
179 |
+
));
|
180 |
+
}
|
181 |
+
|
182 |
+
public function renderForms()
|
183 |
+
{
|
184 |
+
$version = $this->app->getVersion();
|
185 |
+
|
186 |
+
|
187 |
+
wp_enqueue_script('fluent_all_forms', fluentformMix("js/fluent-all-forms-admin.js"), array('jquery'), $version,
|
188 |
+
false);
|
189 |
+
|
190 |
+
wp_enqueue_style('fluent_all_forms', fluentformMix("css/fluent-all-forms.css"), array(), $version, 'all');
|
191 |
+
|
192 |
+
|
193 |
+
wp_localize_script('fluent_all_forms', 'FluentFormApp', array(
|
194 |
+
'plugin' => $this->app->getSlug()
|
195 |
+
));
|
196 |
+
|
197 |
+
View::render('admin.all_forms', array());
|
198 |
+
}
|
199 |
+
|
200 |
+
public function renderEditor($form_id)
|
201 |
+
{
|
202 |
+
$this->enqueueEditorAssets();
|
203 |
+
echo View::make('admin.form.editor', array(
|
204 |
+
'plugin' => $this->app->getSlug(),
|
205 |
+
'form_id' => $form_id
|
206 |
+
));
|
207 |
+
}
|
208 |
+
|
209 |
+
private function enqueueEditorAssets()
|
210 |
+
{
|
211 |
+
$pluginSlug = $this->app->getSlug();
|
212 |
+
$version = $this->app->getVersion();
|
213 |
+
|
214 |
+
|
215 |
+
wp_enqueue_script('fluentform_editor_script', fluentformMix("js/fluent-forms-editor.js"), ['jquery'], $version,
|
216 |
+
false);
|
217 |
+
|
218 |
+
wp_enqueue_style('fluentform_editor_style', fluentformMix("css/fluent-forms-admin-sass.css"), [], $version,
|
219 |
+
'all');
|
220 |
+
|
221 |
+
wp_enqueue_style('fluentform_editor_sass', fluentformMix("css/fluent-forms-admin.css"), [], $version, 'all');
|
222 |
+
|
223 |
+
$formId = intval($_GET['form_id']);
|
224 |
+
wp_localize_script('fluentform_editor_script', 'FluentFormApp', array(
|
225 |
+
'plugin' => $pluginSlug,
|
226 |
+
'form_id' => $formId,
|
227 |
+
'countries' => $countries = $this->app->load($this->app->appPath('Services/FormBuilder/CountryNames.php')),
|
228 |
+
'form' => wpFluent()->table('fluentform_forms')->find($formId),
|
229 |
+
'plugin_public_url' => $this->app->publicUrl(),
|
230 |
+
'preview_url' => $this->getFormPreviewUrl($formId)
|
231 |
+
));
|
232 |
+
}
|
233 |
+
|
234 |
+
/**
|
235 |
+
* Render global settings page.
|
236 |
+
*
|
237 |
+
* @throws \Exception
|
238 |
+
*/
|
239 |
+
public function renderGlobalSettings()
|
240 |
+
{
|
241 |
+
$version = $this->app->getVersion();
|
242 |
+
|
243 |
+
wp_enqueue_style(
|
244 |
+
'fluentform_settings_global',
|
245 |
+
fluentformMix("css/settings_global.css"),
|
246 |
+
[], $version, 'all'
|
247 |
+
);
|
248 |
+
|
249 |
+
// Fire an event letting others know the current component
|
250 |
+
// that fluentform is rendering for the global settings
|
251 |
+
// page. So that they can hook and load their custom
|
252 |
+
// components on this page dynamically & easily.
|
253 |
+
// N.B. native 'components' will always use
|
254 |
+
// 'settings' as their current component.
|
255 |
+
$currentComponent = apply_filters('fluentform_global_settings_current_component',
|
256 |
+
$this->app->request->get('component', 'settings')
|
257 |
+
);
|
258 |
+
|
259 |
+
$components = apply_filters('fluentform_global_settings_components', [
|
260 |
+
'reCpatcha' => [
|
261 |
+
'hash' => 're_captcha',
|
262 |
+
'title' => 'reCpatcha',
|
263 |
+
],
|
264 |
+
'mailchimp' => [
|
265 |
+
'hash' => 'mailchimp',
|
266 |
+
'title' => 'MailChimp',
|
267 |
+
]
|
268 |
+
]);
|
269 |
+
|
270 |
+
View::render('admin.settings.index', [
|
271 |
+
'components' => $components,
|
272 |
+
'currentComponent' => $currentComponent
|
273 |
+
]);
|
274 |
+
}
|
275 |
+
|
276 |
+
|
277 |
+
private function getFormPreviewUrl($form_id)
|
278 |
+
{
|
279 |
+
return site_url('?fluentform_pages=1&preview_id='.$form_id).'#ff_preview';
|
280 |
+
}
|
281 |
+
|
282 |
+
public function addPreviewButton($formId)
|
283 |
+
{
|
284 |
+
echo '<a target="_blank" class="pull-right el-button el-button--default" href="'.$this->getFormPreviewUrl($formId).'">Preview</a>';
|
285 |
+
}
|
286 |
+
}
|
app/Modules/Renderer/GlobalSettings/Settings.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Modules\Renderer\GlobalSettings;
|
4 |
+
|
5 |
+
use FluentForm\Framework\Foundation\Application;
|
6 |
+
|
7 |
+
class Settings
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* @var \FluentForm\Framework\Foundation\Application
|
11 |
+
*/
|
12 |
+
protected $app;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* GlobalSettings constructor.
|
16 |
+
*
|
17 |
+
* @param \FluentForm\Framework\Foundation\Application $app
|
18 |
+
*/
|
19 |
+
public function __construct(Application $app)
|
20 |
+
{
|
21 |
+
$this->app = $app;
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Render the page for native global settings components
|
26 |
+
*
|
27 |
+
* @throws \Exception
|
28 |
+
*/
|
29 |
+
public function render()
|
30 |
+
{
|
31 |
+
$this->enqueue();
|
32 |
+
|
33 |
+
$this->app->view->render('admin.settings.settings');
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Enqueue necessary resources.
|
38 |
+
*
|
39 |
+
* @throws \Exception
|
40 |
+
*/
|
41 |
+
public function enqueue()
|
42 |
+
{
|
43 |
+
wp_enqueue_script('fluentform-global-settings-js',
|
44 |
+
fluentformMix("js/fluentform-global-settings.js"),
|
45 |
+
['jquery'], $this->app->getVersion(), false
|
46 |
+
);
|
47 |
+
|
48 |
+
wp_localize_script('fluentform-global-settings-js', 'FluentFormApp', [
|
49 |
+
'plugin' => $this->app->getSlug(),
|
50 |
+
]);
|
51 |
+
}
|
52 |
+
}
|
app/Modules/Settings/Settings.php
ADDED
@@ -0,0 +1,175 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Modules\Settings;
|
4 |
+
|
5 |
+
use FluentForm\App\Services\Integrations\MailChimp;
|
6 |
+
use FluentForm\Framework\Request\Request;
|
7 |
+
use FluentForm\Framework\Helpers\ArrayHelper;
|
8 |
+
use FluentForm\App\Modules\ReCaptcha\ReCaptcha;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Global Settings
|
12 |
+
*
|
13 |
+
* @package FluentForm\App\Modules\Settings
|
14 |
+
*/
|
15 |
+
class Settings
|
16 |
+
{
|
17 |
+
/**
|
18 |
+
* @var \FluentForm\Framework\Request\Request
|
19 |
+
*/
|
20 |
+
protected $request;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Settings constructor.
|
24 |
+
*
|
25 |
+
* @param \FluentForm\Framework\Request\Request $request
|
26 |
+
*/
|
27 |
+
public function __construct(Request $request)
|
28 |
+
{
|
29 |
+
$this->request = $request;
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Get a global settings for an specified key.
|
34 |
+
*/
|
35 |
+
public function get()
|
36 |
+
{
|
37 |
+
$key = $this->request->get('key');
|
38 |
+
$values = array();
|
39 |
+
if (is_array($key)) {
|
40 |
+
foreach ($key as $key_item) {
|
41 |
+
$values[$key_item] = get_option($key_item);
|
42 |
+
}
|
43 |
+
} else {
|
44 |
+
$values[$key] = get_option($key);
|
45 |
+
}
|
46 |
+
wp_send_json_success($values, 200);
|
47 |
+
}
|
48 |
+
|
49 |
+
public function store()
|
50 |
+
{
|
51 |
+
$key = $this->request->get('key');
|
52 |
+
$method = 'store'.ucwords($key);
|
53 |
+
|
54 |
+
$allowedMethods = array(
|
55 |
+
'storeReCaptcha',
|
56 |
+
'storeSaveGlobalLayoutSettings',
|
57 |
+
'storeMailChimpSettings'
|
58 |
+
);
|
59 |
+
|
60 |
+
if (in_array($method, $allowedMethods)) {
|
61 |
+
$this->{$method}();
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
public function storeReCaptcha()
|
66 |
+
{
|
67 |
+
$data = $this->request->get('reCaptcha');
|
68 |
+
|
69 |
+
$token = ArrayHelper::get($data, 'token');
|
70 |
+
|
71 |
+
$secretKey = ArrayHelper::get($data, 'secretKey');
|
72 |
+
|
73 |
+
// If token is not empty meaning user verified their captcha.
|
74 |
+
if ($token) {
|
75 |
+
// Validate the reCaptcha response.
|
76 |
+
$status = ReCaptcha::validate($token, $secretKey);
|
77 |
+
|
78 |
+
// reCaptcha is valid. So proceed to store.
|
79 |
+
if ($status) {
|
80 |
+
// Prepare captcha data.
|
81 |
+
$captchaData = [
|
82 |
+
'siteKey' => sanitize_text_field(ArrayHelper::get($data, 'siteKey')),
|
83 |
+
'secretKey' => sanitize_text_field($secretKey)
|
84 |
+
];
|
85 |
+
|
86 |
+
// Update the reCaptcha details with siteKey & secretKey.
|
87 |
+
update_option('_fluentform_reCaptcha_details', $captchaData);
|
88 |
+
|
89 |
+
// Update the reCaptcha validation status.
|
90 |
+
update_option('_fluentform_reCaptcha_keys_status', $status);
|
91 |
+
|
92 |
+
// Send success response letting the user know that
|
93 |
+
// that the reCaptcha is valid and saved properly.
|
94 |
+
wp_send_json_success(array(
|
95 |
+
'message' => __('Your reCaptcha is valid and saved.', 'fluentform'),
|
96 |
+
'status' => $status
|
97 |
+
), 200);
|
98 |
+
} else { // reCatcha is not valid.
|
99 |
+
$message = __('Sorry, Your reCaptcha is not valid, Please try again', 'fluentform');
|
100 |
+
}
|
101 |
+
} else { // The token is empty, so the user didn't verify their captcha.
|
102 |
+
$message = __('Please validate your reCaptcha first and then hit save.', 'fluentform');
|
103 |
+
|
104 |
+
// Get the already stored reCaptcha status.
|
105 |
+
$status = get_option('_fluentform_reCaptcha_keys_status');
|
106 |
+
|
107 |
+
if ($status) {
|
108 |
+
$message = __('Your reCaptcha details are already valid, So no need to save again.', 'fluentform');
|
109 |
+
}
|
110 |
+
}
|
111 |
+
|
112 |
+
wp_send_json_error(array(
|
113 |
+
'message' => $message,
|
114 |
+
'status' => $status
|
115 |
+
), 400);
|
116 |
+
}
|
117 |
+
|
118 |
+
public function storeSaveGlobalLayoutSettings()
|
119 |
+
{
|
120 |
+
$settings = $this->request->get('value');
|
121 |
+
$settings = json_decode($settings, true);
|
122 |
+
$settings = fluentFormSanitizer($settings);
|
123 |
+
update_option('_fluentform_global_form_settings', $settings);
|
124 |
+
wp_send_json_success(array(
|
125 |
+
'message' => __('Global layout settings is saved')
|
126 |
+
), 200);
|
127 |
+
}
|
128 |
+
|
129 |
+
public function storeMailChimpSettings()
|
130 |
+
{
|
131 |
+
$mailChimp =$this->request->get('mailchimp');
|
132 |
+
|
133 |
+
if(!$mailChimp['apiKey']) {
|
134 |
+
$mailChimpSettings = array(
|
135 |
+
'apiKey' => '',
|
136 |
+
'status' => false
|
137 |
+
);
|
138 |
+
// Update the reCaptcha details with siteKey & secretKey.
|
139 |
+
update_option('_fluentform_mailchimp_details', $mailChimpSettings);
|
140 |
+
wp_send_json_success(array(
|
141 |
+
'message' => __('Your settings has been updated', 'fluentform'),
|
142 |
+
'status' => false
|
143 |
+
), 200);
|
144 |
+
}
|
145 |
+
|
146 |
+
// Verify API key now
|
147 |
+
try {
|
148 |
+
$MailChimp = new MailChimp($mailChimp['apiKey']);
|
149 |
+
$result = $MailChimp->get('lists');
|
150 |
+
if(!$MailChimp->success()) {
|
151 |
+
throw new \Exception($MailChimp->getLastError());
|
152 |
+
}
|
153 |
+
} catch (\Exception $exception) {
|
154 |
+
wp_send_json_error(array(
|
155 |
+
'message' => $exception->getMessage()
|
156 |
+
), 400);
|
157 |
+
}
|
158 |
+
|
159 |
+
// MailChimp key is verified now, Proceed now
|
160 |
+
|
161 |
+
$mailChimpSettings = array(
|
162 |
+
'apiKey' => sanitize_text_field($mailChimp['apiKey']),
|
163 |
+
'status' => true
|
164 |
+
);
|
165 |
+
|
166 |
+
// Update the reCaptcha details with siteKey & secretKey.
|
167 |
+
update_option('_fluentform_mailchimp_details', $mailChimpSettings);
|
168 |
+
|
169 |
+
wp_send_json_success(array(
|
170 |
+
'message' => __('Your mailchimp api key has been verfied and successfully set', 'fluentform'),
|
171 |
+
'status' => true
|
172 |
+
), 200);
|
173 |
+
|
174 |
+
}
|
175 |
+
}
|
app/Providers/BackendProvider.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Providers;
|
4 |
+
|
5 |
+
use FluentForm\Framework\Foundation\Provider;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* This provider will be loaded only on backend (admin)
|
9 |
+
*/
|
10 |
+
|
11 |
+
class BackendProvider extends Provider
|
12 |
+
{
|
13 |
+
/**
|
14 |
+
* The provider booting method to boot this provider
|
15 |
+
* @return void
|
16 |
+
*/
|
17 |
+
public function booting()
|
18 |
+
{
|
19 |
+
// ...
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* The provider booted method to be called after booting
|
24 |
+
* @return void
|
25 |
+
*/
|
26 |
+
public function booted()
|
27 |
+
{
|
28 |
+
// ...
|
29 |
+
}
|
30 |
+
}
|
app/Providers/CommonProvider.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* This provider will be loaded always (admin/public)
|
5 |
+
*/
|
6 |
+
|
7 |
+
namespace FluentForm\App\Providers;
|
8 |
+
|
9 |
+
use FluentForm\Framework\Foundation\Provider;
|
10 |
+
|
11 |
+
class CommonProvider extends Provider
|
12 |
+
{
|
13 |
+
/**
|
14 |
+
* The provider booting method to boot this provider
|
15 |
+
* @return void
|
16 |
+
*/
|
17 |
+
public function booting()
|
18 |
+
{
|
19 |
+
// ...
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* The provider booted method to be called after booting
|
24 |
+
* @return void
|
25 |
+
*/
|
26 |
+
public function booted()
|
27 |
+
{
|
28 |
+
// ...
|
29 |
+
}
|
30 |
+
}
|
app/Providers/CsvProvider.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Providers;
|
4 |
+
|
5 |
+
use FluentForm\Framework\Foundation\Provider;
|
6 |
+
|
7 |
+
class CsvProvider extends Provider
|
8 |
+
{
|
9 |
+
public function booting()
|
10 |
+
{
|
11 |
+
require_once $this->app->appPath().'Services/csv/autoload.php';
|
12 |
+
}
|
13 |
+
}
|
app/Providers/FluentValidatorProvider.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Providers;
|
4 |
+
|
5 |
+
use FluentForm\Framework\Foundation\Provider;
|
6 |
+
|
7 |
+
class FluentValidatorProvider extends Provider
|
8 |
+
{
|
9 |
+
public function booting()
|
10 |
+
{
|
11 |
+
require_once $this->app->appPath().'Services/fluentvalidator/fluentvalidator.php';
|
12 |
+
}
|
13 |
+
}
|
app/Providers/FormBuilderProvider.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Providers;
|
4 |
+
|
5 |
+
use FluentForm\Framework\Foundation\Provider;
|
6 |
+
use FluentForm\App\Services\FormBuilder\Components;
|
7 |
+
use FluentForm\App\Services\FormBuilder\FormBuilder;
|
8 |
+
|
9 |
+
class FormBuilderProvider extends Provider
|
10 |
+
{
|
11 |
+
/**
|
12 |
+
* The provider booting method to boot this provider
|
13 |
+
* @return void
|
14 |
+
*/
|
15 |
+
public function booting()
|
16 |
+
{
|
17 |
+
$this->app->bindSingleton('components', function($app) {
|
18 |
+
$file = $app->appPath('Services/FormBuilder/DefaultElements.php');
|
19 |
+
return new Components($app->load($file));
|
20 |
+
}, 'Components');
|
21 |
+
|
22 |
+
$this->app->bind('formBuilder', function($app) {
|
23 |
+
return new FormBuilder($app);
|
24 |
+
}, 'FormBuilder');
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* The provider booted method to be called after booting
|
29 |
+
* @return void
|
30 |
+
*/
|
31 |
+
public function booted()
|
32 |
+
{
|
33 |
+
// ...
|
34 |
+
}
|
35 |
+
}
|
app/Providers/FrontendProvider.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Providers;
|
4 |
+
|
5 |
+
use FluentForm\Framework\Foundation\Provider;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* This provider will be loaded only on frontend (public)
|
9 |
+
*/
|
10 |
+
|
11 |
+
class FrontendProvider extends Provider
|
12 |
+
{
|
13 |
+
/**
|
14 |
+
* The provider booting method to boot this provider
|
15 |
+
* @return void
|
16 |
+
*/
|
17 |
+
public function booting()
|
18 |
+
{
|
19 |
+
// ...
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* The provider booted method to be called after booting
|
24 |
+
* @return void
|
25 |
+
*/
|
26 |
+
public function booted()
|
27 |
+
{
|
28 |
+
// ...
|
29 |
+
}
|
30 |
+
}
|
app/Providers/MenuProvider.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Providers;
|
4 |
+
|
5 |
+
use FluentForm\Framework\Foundation\Provider;
|
6 |
+
|
7 |
+
class MenuProvider extends Provider
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* Bootstrap any application services.
|
11 |
+
*
|
12 |
+
* @return void
|
13 |
+
*/
|
14 |
+
public function booting()
|
15 |
+
{
|
16 |
+
$this->app->addAction(
|
17 |
+
'admin_menu',
|
18 |
+
'\FluentForm\App\Modules\Registerer\Menu@register'
|
19 |
+
);
|
20 |
+
|
21 |
+
$this->app->addAction(
|
22 |
+
'fluentform_global_settings_component_settings',
|
23 |
+
'\FluentForm\App\Modules\Renderer\GlobalSettings\Settings@render'
|
24 |
+
);
|
25 |
+
|
26 |
+
$this->app->addAction(
|
27 |
+
'fluentform_global_settings_component_reCaptcha',
|
28 |
+
'\FluentForm\App\Modules\Renderer\GlobalSettings\Settings@render'
|
29 |
+
);
|
30 |
+
|
31 |
+
$this->app->addAction(
|
32 |
+
'ff_fluentform_form_application_view_editor',
|
33 |
+
'\FluentForm\App\Modules\Registerer\Menu@renderEditor'
|
34 |
+
);
|
35 |
+
|
36 |
+
$this->app->addAction(
|
37 |
+
'ff_fluentform_form_application_view_settings',
|
38 |
+
'\FluentForm\App\Modules\Registerer\Menu@renderSettings'
|
39 |
+
);
|
40 |
+
|
41 |
+
$this->app->addAction(
|
42 |
+
'fluentform_form_settings_container_form_settings',
|
43 |
+
'\FluentForm\App\Modules\Registerer\Menu@renderFormSettings'
|
44 |
+
);
|
45 |
+
}
|
46 |
+
}
|
app/Providers/WpFluentProvider.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Providers;
|
4 |
+
|
5 |
+
use FluentForm\Framework\Foundation\Provider;
|
6 |
+
|
7 |
+
class WpFluentProvider extends Provider
|
8 |
+
{
|
9 |
+
public function booting()
|
10 |
+
{
|
11 |
+
require_once $this->app->appPath().'Services/wpfluent/wpfluent.php';
|
12 |
+
}
|
13 |
+
}
|
app/Services/Browser/Browser.php
ADDED
@@ -0,0 +1,1733 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services\Browser;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* File: Browser.php
|
7 |
+
* Author: Chris Schuld (http://chrisschuld.com/)
|
8 |
+
* Last Modified: July 22nd, 2016
|
9 |
+
* @version 2.0
|
10 |
+
* @package PegasusPHP
|
11 |
+
*
|
12 |
+
* Copyright (C) 2008-2010 Chris Schuld (chris@chrisschuld.com)
|
13 |
+
*
|
14 |
+
* This program is free software; you can redistribute it and/or
|
15 |
+
* modify it under the terms of the GNU General Public License as
|
16 |
+
* published by the Free Software Foundation; either version 2 of
|
17 |
+
* the License, or (at your option) any later version.
|
18 |
+
*
|
19 |
+
* This program is distributed in the hope that it will be useful,
|
20 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22 |
+
* GNU General Public License for more details at:
|
23 |
+
* http://www.gnu.org/copyleft/gpl.html
|
24 |
+
*
|
25 |
+
*
|
26 |
+
* Typical Usage:
|
27 |
+
*
|
28 |
+
* $browser = new Browser();
|
29 |
+
* if( $browser->getBrowser() == Browser::BROWSER_FIREFOX && $browser->getVersion() >= 2 ) {
|
30 |
+
* echo 'You have FireFox version 2 or greater';
|
31 |
+
* }
|
32 |
+
*
|
33 |
+
* User Agents Sampled from: http://www.useragentstring.com/
|
34 |
+
*
|
35 |
+
* This implementation is based on the original work from Gary White
|
36 |
+
* http://apptools.com/phptools/browser/
|
37 |
+
*
|
38 |
+
*/
|
39 |
+
class Browser
|
40 |
+
{
|
41 |
+
private $_agent = '';
|
42 |
+
private $_browser_name = '';
|
43 |
+
private $_version = '';
|
44 |
+
private $_platform = '';
|
45 |
+
private $_os = '';
|
46 |
+
private $_is_aol = false;
|
47 |
+
private $_is_mobile = false;
|
48 |
+
private $_is_tablet = false;
|
49 |
+
private $_is_robot = false;
|
50 |
+
private $_is_facebook = false;
|
51 |
+
private $_aol_version = '';
|
52 |
+
|
53 |
+
const BROWSER_UNKNOWN = 'unknown';
|
54 |
+
const VERSION_UNKNOWN = 'unknown';
|
55 |
+
|
56 |
+
const BROWSER_OPERA = 'Opera'; // http://www.opera.com/
|
57 |
+
const BROWSER_OPERA_MINI = 'Opera Mini'; // http://www.opera.com/mini/
|
58 |
+
const BROWSER_WEBTV = 'WebTV'; // http://www.webtv.net/pc/
|
59 |
+
const BROWSER_EDGE = 'Edge'; // https://www.microsoft.com/edge
|
60 |
+
const BROWSER_IE = 'Internet Explorer'; // http://www.microsoft.com/ie/
|
61 |
+
const BROWSER_POCKET_IE = 'Pocket Internet Explorer'; // http://en.wikipedia.org/wiki/Internet_Explorer_Mobile
|
62 |
+
const BROWSER_KONQUEROR = 'Konqueror'; // http://www.konqueror.org/
|
63 |
+
const BROWSER_ICAB = 'iCab'; // http://www.icab.de/
|
64 |
+
const BROWSER_OMNIWEB = 'OmniWeb'; // http://www.omnigroup.com/applications/omniweb/
|
65 |
+
const BROWSER_FIREBIRD = 'Firebird'; // http://www.ibphoenix.com/
|
66 |
+
const BROWSER_FIREFOX = 'Firefox'; // http://www.mozilla.com/en-US/firefox/firefox.html
|
67 |
+
const BROWSER_ICEWEASEL = 'Iceweasel'; // http://www.geticeweasel.org/
|
68 |
+
const BROWSER_SHIRETOKO = 'Shiretoko'; // http://wiki.mozilla.org/Projects/shiretoko
|
69 |
+
const BROWSER_MOZILLA = 'Mozilla'; // http://www.mozilla.com/en-US/
|
70 |
+
const BROWSER_AMAYA = 'Amaya'; // http://www.w3.org/Amaya/
|
71 |
+
const BROWSER_LYNX = 'Lynx'; // http://en.wikipedia.org/wiki/Lynx
|
72 |
+
const BROWSER_SAFARI = 'Safari'; // http://apple.com
|
73 |
+
const BROWSER_IPHONE = 'iPhone'; // http://apple.com
|
74 |
+
const BROWSER_IPOD = 'iPod'; // http://apple.com
|
75 |
+
const BROWSER_IPAD = 'iPad'; // http://apple.com
|
76 |
+
const BROWSER_CHROME = 'Chrome'; // http://www.google.com/chrome
|
77 |
+
const BROWSER_ANDROID = 'Android'; // http://www.android.com/
|
78 |
+
const BROWSER_GOOGLEBOT = 'GoogleBot'; // http://en.wikipedia.org/wiki/Googlebot
|
79 |
+
|
80 |
+
const BROWSER_YANDEXBOT = 'YandexBot'; // http://yandex.com/bots
|
81 |
+
const BROWSER_YANDEXIMAGERESIZER_BOT = 'YandexImageResizer'; // http://yandex.com/bots
|
82 |
+
const BROWSER_YANDEXIMAGES_BOT = 'YandexImages'; // http://yandex.com/bots
|
83 |
+
const BROWSER_YANDEXVIDEO_BOT = 'YandexVideo'; // http://yandex.com/bots
|
84 |
+
const BROWSER_YANDEXMEDIA_BOT = 'YandexMedia'; // http://yandex.com/bots
|
85 |
+
const BROWSER_YANDEXBLOGS_BOT = 'YandexBlogs'; // http://yandex.com/bots
|
86 |
+
const BROWSER_YANDEXFAVICONS_BOT = 'YandexFavicons'; // http://yandex.com/bots
|
87 |
+
const BROWSER_YANDEXWEBMASTER_BOT = 'YandexWebmaster'; // http://yandex.com/bots
|
88 |
+
const BROWSER_YANDEXDIRECT_BOT = 'YandexDirect'; // http://yandex.com/bots
|
89 |
+
const BROWSER_YANDEXMETRIKA_BOT = 'YandexMetrika'; // http://yandex.com/bots
|
90 |
+
const BROWSER_YANDEXNEWS_BOT = 'YandexNews'; // http://yandex.com/bots
|
91 |
+
const BROWSER_YANDEXCATALOG_BOT = 'YandexCatalog'; // http://yandex.com/bots
|
92 |
+
|
93 |
+
const BROWSER_SLURP = 'Yahoo! Slurp'; // http://en.wikipedia.org/wiki/Yahoo!_Slurp
|
94 |
+
const BROWSER_W3CVALIDATOR = 'W3C Validator'; // http://validator.w3.org/
|
95 |
+
const BROWSER_BLACKBERRY = 'BlackBerry'; // http://www.blackberry.com/
|
96 |
+
const BROWSER_ICECAT = 'IceCat'; // http://en.wikipedia.org/wiki/GNU_IceCat
|
97 |
+
const BROWSER_NOKIA_S60 = 'Nokia S60 OSS Browser'; // http://en.wikipedia.org/wiki/Web_Browser_for_S60
|
98 |
+
const BROWSER_NOKIA = 'Nokia Browser'; // * all other WAP-based browsers on the Nokia Platform
|
99 |
+
const BROWSER_MSN = 'MSN Browser'; // http://explorer.msn.com/
|
100 |
+
const BROWSER_MSNBOT = 'MSN Bot'; // http://search.msn.com/msnbot.htm
|
101 |
+
const BROWSER_BINGBOT = 'Bing Bot'; // http://en.wikipedia.org/wiki/Bingbot
|
102 |
+
const BROWSER_VIVALDI = 'Vivalidi'; // https://vivaldi.com/
|
103 |
+
const BROWSER_YANDEX = 'Yandex'; // https://browser.yandex.ua/
|
104 |
+
|
105 |
+
const BROWSER_NETSCAPE_NAVIGATOR = 'Netscape Navigator'; // http://browser.netscape.com/ (DEPRECATED)
|
106 |
+
const BROWSER_GALEON = 'Galeon'; // http://galeon.sourceforge.net/ (DEPRECATED)
|
107 |
+
const BROWSER_NETPOSITIVE = 'NetPositive'; // http://en.wikipedia.org/wiki/NetPositive (DEPRECATED)
|
108 |
+
const BROWSER_PHOENIX = 'Phoenix'; // http://en.wikipedia.org/wiki/History_of_Mozilla_Firefox (DEPRECATED)
|
109 |
+
const BROWSER_PLAYSTATION = "PlayStation";
|
110 |
+
const BROWSER_SAMSUNG = "SamsungBrowser";
|
111 |
+
const BROWSER_SILK = "Silk";
|
112 |
+
const BROWSER_I_FRAME = "Iframely";
|
113 |
+
const BROWSER_COCOA = "CocoaRestClient";
|
114 |
+
|
115 |
+
const PLATFORM_UNKNOWN = 'unknown';
|
116 |
+
const PLATFORM_WINDOWS = 'Windows';
|
117 |
+
const PLATFORM_WINDOWS_CE = 'Windows CE';
|
118 |
+
const PLATFORM_APPLE = 'Apple';
|
119 |
+
const PLATFORM_LINUX = 'Linux';
|
120 |
+
const PLATFORM_OS2 = 'OS/2';
|
121 |
+
const PLATFORM_BEOS = 'BeOS';
|
122 |
+
const PLATFORM_IPHONE = 'iPhone';
|
123 |
+
const PLATFORM_IPOD = 'iPod';
|
124 |
+
const PLATFORM_IPAD = 'iPad';
|
125 |
+
const PLATFORM_BLACKBERRY = 'BlackBerry';
|
126 |
+
const PLATFORM_NOKIA = 'Nokia';
|
127 |
+
const PLATFORM_FREEBSD = 'FreeBSD';
|
128 |
+
const PLATFORM_OPENBSD = 'OpenBSD';
|
129 |
+
const PLATFORM_NETBSD = 'NetBSD';
|
130 |
+
const PLATFORM_SUNOS = 'SunOS';
|
131 |
+
const PLATFORM_OPENSOLARIS = 'OpenSolaris';
|
132 |
+
const PLATFORM_ANDROID = 'Android';
|
133 |
+
const PLATFORM_PLAYSTATION = "Sony PlayStation";
|
134 |
+
const PLATFORM_ROKU = "Roku";
|
135 |
+
const PLATFORM_APPLE_TV = "Apple TV";
|
136 |
+
const PLATFORM_TERMINAL = "Terminal";
|
137 |
+
const PLATFORM_FIRE_OS = "Fire OS";
|
138 |
+
const PLATFORM_SMART_TV = "SMART-TV";
|
139 |
+
const PLATFORM_CHROME_OS = "Chrome OS";
|
140 |
+
const PLATFORM_JAVA_ANDROID = "Java/Android";
|
141 |
+
const PLATFORM_POSTMAN = "Postman";
|
142 |
+
const PLATFORM_I_FRAME = "Iframely";
|
143 |
+
|
144 |
+
const OPERATING_SYSTEM_UNKNOWN = 'unknown';
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Class constructor
|
148 |
+
*/
|
149 |
+
public function __construct($userAgent = "")
|
150 |
+
{
|
151 |
+
$this->reset();
|
152 |
+
if ($userAgent != "") {
|
153 |
+
$this->setUserAgent($userAgent);
|
154 |
+
} else {
|
155 |
+
$this->determine();
|
156 |
+
}
|
157 |
+
}
|
158 |
+
|
159 |
+
/**
|
160 |
+
* Reset all properties
|
161 |
+
*/
|
162 |
+
public function reset()
|
163 |
+
{
|
164 |
+
$this->_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : "";
|
165 |
+
$this->_browser_name = self::BROWSER_UNKNOWN;
|
166 |
+
$this->_version = self::VERSION_UNKNOWN;
|
167 |
+
$this->_platform = self::PLATFORM_UNKNOWN;
|
168 |
+
$this->_os = self::OPERATING_SYSTEM_UNKNOWN;
|
169 |
+
$this->_is_aol = false;
|
170 |
+
$this->_is_mobile = false;
|
171 |
+
$this->_is_tablet = false;
|
172 |
+
$this->_is_robot = false;
|
173 |
+
$this->_is_facebook = false;
|
174 |
+
$this->_aol_version = self::VERSION_UNKNOWN;
|
175 |
+
}
|
176 |
+
|
177 |
+
/**
|
178 |
+
* Check to see if the specific browser is valid
|
179 |
+
* @param string $browserName
|
180 |
+
* @return bool True if the browser is the specified browser
|
181 |
+
*/
|
182 |
+
function isBrowser($browserName)
|
183 |
+
{
|
184 |
+
return (0 == strcasecmp($this->_browser_name, trim($browserName)));
|
185 |
+
}
|
186 |
+
|
187 |
+
/**
|
188 |
+
* The name of the browser. All return types are from the class contants
|
189 |
+
* @return string Name of the browser
|
190 |
+
*/
|
191 |
+
public function getBrowser()
|
192 |
+
{
|
193 |
+
return $this->_browser_name;
|
194 |
+
}
|
195 |
+
|
196 |
+
/**
|
197 |
+
* Set the name of the browser
|
198 |
+
* @param $browser string The name of the Browser
|
199 |
+
*/
|
200 |
+
public function setBrowser($browser)
|
201 |
+
{
|
202 |
+
$this->_browser_name = $browser;
|
203 |
+
}
|
204 |
+
|
205 |
+
/**
|
206 |
+
* The name of the platform. All return types are from the class contants
|
207 |
+
* @return string Name of the browser
|
208 |
+
*/
|
209 |
+
public function getPlatform()
|
210 |
+
{
|
211 |
+
return $this->_platform;
|
212 |
+
}
|
213 |
+
|
214 |
+
/**
|
215 |
+
* Set the name of the platform
|
216 |
+
* @param string $platform The name of the Platform
|
217 |
+
*/
|
218 |
+
public function setPlatform($platform)
|
219 |
+
{
|
220 |
+
$this->_platform = $platform;
|
221 |
+
}
|
222 |
+
|
223 |
+
/**
|
224 |
+
* The version of the browser.
|
225 |
+
* @return string Version of the browser (will only contain alpha-numeric characters and a period)
|
226 |
+
*/
|
227 |
+
public function getVersion()
|
228 |
+
{
|
229 |
+
return $this->_version;
|
230 |
+
}
|
231 |
+
|
232 |
+
/**
|
233 |
+
* Set the version of the browser
|
234 |
+
* @param string $version The version of the Browser
|
235 |
+
*/
|
236 |
+
public function setVersion($version)
|
237 |
+
{
|
238 |
+
$this->_version = preg_replace('/[^0-9,.,a-z,A-Z-]/', '', $version);
|
239 |
+
}
|
240 |
+
|
241 |
+
/**
|
242 |
+
* The version of AOL.
|
243 |
+
* @return string Version of AOL (will only contain alpha-numeric characters and a period)
|
244 |
+
*/
|
245 |
+
public function getAolVersion()
|
246 |
+
{
|
247 |
+
return $this->_aol_version;
|
248 |
+
}
|
249 |
+
|
250 |
+
/**
|
251 |
+
* Set the version of AOL
|
252 |
+
* @param string $version The version of AOL
|
253 |
+
*/
|
254 |
+
public function setAolVersion($version)
|
255 |
+
{
|
256 |
+
$this->_aol_version = preg_replace('/[^0-9,.,a-z,A-Z]/', '', $version);
|
257 |
+
}
|
258 |
+
|
259 |
+
/**
|
260 |
+
* Is the browser from AOL?
|
261 |
+
* @return boolean True if the browser is from AOL otherwise false
|
262 |
+
*/
|
263 |
+
public function isAol()
|
264 |
+
{
|
265 |
+
return $this->_is_aol;
|
266 |
+
}
|
267 |
+
|
268 |
+
/**
|
269 |
+
* Is the browser from a mobile device?
|
270 |
+
* @return boolean True if the browser is from a mobile device otherwise false
|
271 |
+
*/
|
272 |
+
public function isMobile()
|
273 |
+
{
|
274 |
+
return $this->_is_mobile;
|
275 |
+
}
|
276 |
+
|
277 |
+
/**
|
278 |
+
* Is the browser from a tablet device?
|
279 |
+
* @return boolean True if the browser is from a tablet device otherwise false
|
280 |
+
*/
|
281 |
+
public function isTablet()
|
282 |
+
{
|
283 |
+
return $this->_is_tablet;
|
284 |
+
}
|
285 |
+
|
286 |
+
/**
|
287 |
+
* Is the browser from a robot (ex Slurp,GoogleBot)?
|
288 |
+
* @return boolean True if the browser is from a robot otherwise false
|
289 |
+
*/
|
290 |
+
public function isRobot()
|
291 |
+
{
|
292 |
+
return $this->_is_robot;
|
293 |
+
}
|
294 |
+
|
295 |
+
/**
|
296 |
+
* Is the browser from facebook?
|
297 |
+
* @return boolean True if the browser is from facebook otherwise false
|
298 |
+
*/
|
299 |
+
public function isFacebook()
|
300 |
+
{
|
301 |
+
return $this->_is_facebook;
|
302 |
+
}
|
303 |
+
|
304 |
+
/**
|
305 |
+
* Set the browser to be from AOL
|
306 |
+
* @param $isAol
|
307 |
+
*/
|
308 |
+
public function setAol($isAol)
|
309 |
+
{
|
310 |
+
$this->_is_aol = $isAol;
|
311 |
+
}
|
312 |
+
|
313 |
+
/**
|
314 |
+
* Set the Browser to be mobile
|
315 |
+
* @param boolean $value is the browser a mobile browser or not
|
316 |
+
*/
|
317 |
+
protected function setMobile($value = true)
|
318 |
+
{
|
319 |
+
$this->_is_mobile = $value;
|
320 |
+
}
|
321 |
+
|
322 |
+
/**
|
323 |
+
* Set the Browser to be tablet
|
324 |
+
* @param boolean $value is the browser a tablet browser or not
|
325 |
+
*/
|
326 |
+
protected function setTablet($value = true)
|
327 |
+
{
|
328 |
+
$this->_is_tablet = $value;
|
329 |
+
}
|
330 |
+
|
331 |
+
/**
|
332 |
+
* Set the Browser to be a robot
|
333 |
+
* @param boolean $value is the browser a robot or not
|
334 |
+
*/
|
335 |
+
protected function setRobot($value = true)
|
336 |
+
{
|
337 |
+
$this->_is_robot = $value;
|
338 |
+
}
|
339 |
+
|
340 |
+
/**
|
341 |
+
* Set the Browser to be a Facebook request
|
342 |
+
* @param boolean $value is the browser a robot or not
|
343 |
+
*/
|
344 |
+
protected function setFacebook($value = true)
|
345 |
+
{
|
346 |
+
$this->_is_facebook = $value;
|
347 |
+
}
|
348 |
+
|
349 |
+
/**
|
350 |
+
* Get the user agent value in use to determine the browser
|
351 |
+
* @return string The user agent from the HTTP header
|
352 |
+
*/
|
353 |
+
public function getUserAgent()
|
354 |
+
{
|
355 |
+
return $this->_agent;
|
356 |
+
}
|
357 |
+
|
358 |
+
/**
|
359 |
+
* Set the user agent value (the construction will use the HTTP header value - this will overwrite it)
|
360 |
+
* @param string $agent_string The value for the User Agent
|
361 |
+
*/
|
362 |
+
public function setUserAgent($agent_string)
|
363 |
+
{
|
364 |
+
$this->reset();
|
365 |
+
$this->_agent = $agent_string;
|
366 |
+
$this->determine();
|
367 |
+
}
|
368 |
+
|
369 |
+
/**
|
370 |
+
* Used to determine if the browser is actually "chromeframe"
|
371 |
+
* @since 1.7
|
372 |
+
* @return boolean True if the browser is using chromeframe
|
373 |
+
*/
|
374 |
+
public function isChromeFrame()
|
375 |
+
{
|
376 |
+
return (strpos($this->_agent, "chromeframe") !== false);
|
377 |
+
}
|
378 |
+
|
379 |
+
/**
|
380 |
+
* Returns a formatted string with a summary of the details of the browser.
|
381 |
+
* @return string formatted string with a summary of the browser
|
382 |
+
*/
|
383 |
+
public function __toString()
|
384 |
+
{
|
385 |
+
return "<strong>Browser Name:</strong> {$this->getBrowser()}<br/>\n" .
|
386 |
+
"<strong>Browser Version:</strong> {$this->getVersion()}<br/>\n" .
|
387 |
+
"<strong>Browser User Agent String:</strong> {$this->getUserAgent()}<br/>\n" .
|
388 |
+
"<strong>Platform:</strong> {$this->getPlatform()}<br/>";
|
389 |
+
}
|
390 |
+
|
391 |
+
/**
|
392 |
+
* Protected routine to calculate and determine what the browser is in use (including platform)
|
393 |
+
*/
|
394 |
+
protected function determine()
|
395 |
+
{
|
396 |
+
$this->checkPlatform();
|
397 |
+
$this->checkBrowsers();
|
398 |
+
$this->checkForAol();
|
399 |
+
}
|
400 |
+
|
401 |
+
/**
|
402 |
+
* Protected routine to determine the browser type
|
403 |
+
* @return boolean True if the browser was detected otherwise false
|
404 |
+
*/
|
405 |
+
protected function checkBrowsers()
|
406 |
+
{
|
407 |
+
return (
|
408 |
+
// well-known, well-used
|
409 |
+
// Special Notes:
|
410 |
+
// (1) Opera must be checked before FireFox due to the odd
|
411 |
+
// user agents used in some older versions of Opera
|
412 |
+
// (2) WebTV is strapped onto Internet Explorer so we must
|
413 |
+
// check for WebTV before IE
|
414 |
+
// (3) (deprecated) Galeon is based on Firefox and needs to be
|
415 |
+
// tested before Firefox is tested
|
416 |
+
// (4) OmniWeb is based on Safari so OmniWeb check must occur
|
417 |
+
// before Safari
|
418 |
+
// (5) Netscape 9+ is based on Firefox so Netscape checks
|
419 |
+
// before FireFox are necessary
|
420 |
+
// (6) Vivalid is UA contains both Firefox and Chrome so Vivalid checks
|
421 |
+
// before Firefox and Chrome
|
422 |
+
$this->checkBrowserWebTv() ||
|
423 |
+
$this->checkBrowserEdge() ||
|
424 |
+
$this->checkBrowserInternetExplorer() ||
|
425 |
+
$this->checkBrowserOpera() ||
|
426 |
+
$this->checkBrowserGaleon() ||
|
427 |
+
$this->checkBrowserNetscapeNavigator9Plus() ||
|
428 |
+
$this->checkBrowserVivaldi() ||
|
429 |
+
$this->checkBrowserYandex() ||
|
430 |
+
$this->checkBrowserFirefox() ||
|
431 |
+
$this->checkBrowserChrome() ||
|
432 |
+
$this->checkBrowserOmniWeb() ||
|
433 |
+
|
434 |
+
// common mobile
|
435 |
+
$this->checkBrowserAndroid() ||
|
436 |
+
$this->checkBrowseriPad() ||
|
437 |
+
$this->checkBrowseriPod() ||
|
438 |
+
$this->checkBrowseriPhone() ||
|
439 |
+
$this->checkBrowserBlackBerry() ||
|
440 |
+
$this->checkBrowserNokia() ||
|
441 |
+
|
442 |
+
// common bots
|
443 |
+
$this->checkBrowserGoogleBot() ||
|
444 |
+
$this->checkBrowserMSNBot() ||
|
445 |
+
$this->checkBrowserBingBot() ||
|
446 |
+
$this->checkBrowserSlurp() ||
|
447 |
+
|
448 |
+
// Yandex bots
|
449 |
+
$this->checkBrowserYandexBot() ||
|
450 |
+
$this->checkBrowserYandexImageResizerBot() ||
|
451 |
+
$this->checkBrowserYandexBlogsBot() ||
|
452 |
+
$this->checkBrowserYandexCatalogBot() ||
|
453 |
+
$this->checkBrowserYandexDirectBot() ||
|
454 |
+
$this->checkBrowserYandexFaviconsBot() ||
|
455 |
+
$this->checkBrowserYandexImagesBot() ||
|
456 |
+
$this->checkBrowserYandexMediaBot() ||
|
457 |
+
$this->checkBrowserYandexMetrikaBot() ||
|
458 |
+
$this->checkBrowserYandexNewsBot() ||
|
459 |
+
$this->checkBrowserYandexVideoBot() ||
|
460 |
+
$this->checkBrowserYandexWebmasterBot() ||
|
461 |
+
|
462 |
+
// check for facebook external hit when loading URL
|
463 |
+
$this->checkFacebookExternalHit() ||
|
464 |
+
|
465 |
+
// WebKit base check (post mobile and others)
|
466 |
+
$this->checkBrowserSamsung() ||
|
467 |
+
$this->checkBrowserSilk() ||
|
468 |
+
$this->checkBrowserSafari() ||
|
469 |
+
|
470 |
+
// everyone else
|
471 |
+
$this->checkBrowserNetPositive() ||
|
472 |
+
$this->checkBrowserFirebird() ||
|
473 |
+
$this->checkBrowserKonqueror() ||
|
474 |
+
$this->checkBrowserIcab() ||
|
475 |
+
$this->checkBrowserPhoenix() ||
|
476 |
+
$this->checkBrowserAmaya() ||
|
477 |
+
$this->checkBrowserLynx() ||
|
478 |
+
$this->checkBrowserShiretoko() ||
|
479 |
+
$this->checkBrowserIceCat() ||
|
480 |
+
$this->checkBrowserIceweasel() ||
|
481 |
+
$this->checkBrowserW3CValidator() ||
|
482 |
+
$this->checkBrowserPlayStation() ||
|
483 |
+
$this->checkBrowserIframely() ||
|
484 |
+
$this->checkBrowserCocoa() ||
|
485 |
+
$this->checkBrowserMozilla() /* Mozilla is such an open standard that you must check it last */
|
486 |
+
|
487 |
+
|
488 |
+
);
|
489 |
+
}
|
490 |
+
|
491 |
+
/**
|
492 |
+
* Determine if the user is using a BlackBerry (last updated 1.7)
|
493 |
+
* @return boolean True if the browser is the BlackBerry browser otherwise false
|
494 |
+
*/
|
495 |
+
protected function checkBrowserBlackBerry()
|
496 |
+
{
|
497 |
+
if (stripos($this->_agent, 'blackberry') !== false) {
|
498 |
+
$aresult = explode("/", stristr($this->_agent, "BlackBerry"));
|
499 |
+
if (isset($aresult[1])) {
|
500 |
+
$aversion = explode(' ', $aresult[1]);
|
501 |
+
$this->setVersion($aversion[0]);
|
502 |
+
$this->_browser_name = self::BROWSER_BLACKBERRY;
|
503 |
+
$this->setMobile(true);
|
504 |
+
return true;
|
505 |
+
}
|
506 |
+
}
|
507 |
+
return false;
|
508 |
+
}
|
509 |
+
|
510 |
+
/**
|
511 |
+
* Determine if the user is using an AOL User Agent (last updated 1.7)
|
512 |
+
* @return boolean True if the browser is from AOL otherwise false
|
513 |
+
*/
|
514 |
+
protected function checkForAol()
|
515 |
+
{
|
516 |
+
$this->setAol(false);
|
517 |
+
$this->setAolVersion(self::VERSION_UNKNOWN);
|
518 |
+
|
519 |
+
if (stripos($this->_agent, 'aol') !== false) {
|
520 |
+
$aversion = explode(' ', stristr($this->_agent, 'AOL'));
|
521 |
+
if (isset($aversion[1])) {
|
522 |
+
$this->setAol(true);
|
523 |
+
$this->setAolVersion(preg_replace('/[^0-9\.a-z]/i', '', $aversion[1]));
|
524 |
+
return true;
|
525 |
+
}
|
526 |
+
}
|
527 |
+
return false;
|
528 |
+
}
|
529 |
+
|
530 |
+
/**
|
531 |
+
* Determine if the browser is the GoogleBot or not (last updated 1.7)
|
532 |
+
* @return boolean True if the browser is the GoogletBot otherwise false
|
533 |
+
*/
|
534 |
+
protected function checkBrowserGoogleBot()
|
535 |
+
{
|
536 |
+
if (stripos($this->_agent, 'googlebot') !== false) {
|
537 |
+
$aresult = explode('/', stristr($this->_agent, 'googlebot'));
|
538 |
+
if (isset($aresult[1])) {
|
539 |
+
$aversion = explode(' ', $aresult[1]);
|
540 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
541 |
+
$this->_browser_name = self::BROWSER_GOOGLEBOT;
|
542 |
+
$this->setRobot(true);
|
543 |
+
return true;
|
544 |
+
}
|
545 |
+
}
|
546 |
+
return false;
|
547 |
+
}
|
548 |
+
|
549 |
+
/**
|
550 |
+
* Determine if the browser is the YandexBot or not
|
551 |
+
* @return boolean True if the browser is the YandexBot otherwise false
|
552 |
+
*/
|
553 |
+
protected function checkBrowserYandexBot()
|
554 |
+
{
|
555 |
+
if (stripos($this->_agent, 'YandexBot') !== false) {
|
556 |
+
$aresult = explode('/', stristr($this->_agent, 'YandexBot'));
|
557 |
+
if (isset($aresult[1])) {
|
558 |
+
$aversion = explode(' ', $aresult[1]);
|
559 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
560 |
+
$this->_browser_name = self::BROWSER_YANDEXBOT;
|
561 |
+
$this->setRobot(true);
|
562 |
+
return true;
|
563 |
+
}
|
564 |
+
}
|
565 |
+
return false;
|
566 |
+
}
|
567 |
+
|
568 |
+
/**
|
569 |
+
* Determine if the browser is the YandexImageResizer or not
|
570 |
+
* @return boolean True if the browser is the YandexImageResizer otherwise false
|
571 |
+
*/
|
572 |
+
protected function checkBrowserYandexImageResizerBot()
|
573 |
+
{
|
574 |
+
if (stripos($this->_agent, 'YandexImageResizer') !== false) {
|
575 |
+
$aresult = explode('/', stristr($this->_agent, 'YandexImageResizer'));
|
576 |
+
if (isset($aresult[1])) {
|
577 |
+
$aversion = explode(' ', $aresult[1]);
|
578 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
579 |
+
$this->_browser_name = self::BROWSER_YANDEXIMAGERESIZER_BOT;
|
580 |
+
$this->setRobot(true);
|
581 |
+
return true;
|
582 |
+
}
|
583 |
+
}
|
584 |
+
return false;
|
585 |
+
}
|
586 |
+
|
587 |
+
/**
|
588 |
+
* Determine if the browser is the YandexCatalog or not
|
589 |
+
* @return boolean True if the browser is the YandexCatalog otherwise false
|
590 |
+
*/
|
591 |
+
protected function checkBrowserYandexCatalogBot()
|
592 |
+
{
|
593 |
+
if (stripos($this->_agent, 'YandexCatalog') !== false) {
|
594 |
+
$aresult = explode('/', stristr($this->_agent, 'YandexCatalog'));
|
595 |
+
if (isset($aresult[1])) {
|
596 |
+
$aversion = explode(' ', $aresult[1]);
|
597 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
598 |
+
$this->_browser_name = self::BROWSER_YANDEXCATALOG_BOT;
|
599 |
+
$this->setRobot(true);
|
600 |
+
return true;
|
601 |
+
}
|
602 |
+
}
|
603 |
+
return false;
|
604 |
+
}
|
605 |
+
|
606 |
+
/**
|
607 |
+
* Determine if the browser is the YandexNews or not
|
608 |
+
* @return boolean True if the browser is the YandexNews otherwise false
|
609 |
+
*/
|
610 |
+
protected function checkBrowserYandexNewsBot()
|
611 |
+
{
|
612 |
+
if (stripos($this->_agent, 'YandexNews') !== false) {
|
613 |
+
$aresult = explode('/', stristr($this->_agent, 'YandexNews'));
|
614 |
+
if (isset($aresult[1])) {
|
615 |
+
$aversion = explode(' ', $aresult[1]);
|
616 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
617 |
+
$this->_browser_name = self::BROWSER_YANDEXNEWS_BOT;
|
618 |
+
$this->setRobot(true);
|
619 |
+
return true;
|
620 |
+
}
|
621 |
+
}
|
622 |
+
return false;
|
623 |
+
}
|
624 |
+
|
625 |
+
/**
|
626 |
+
* Determine if the browser is the YandexMetrika or not
|
627 |
+
* @return boolean True if the browser is the YandexMetrika otherwise false
|
628 |
+
*/
|
629 |
+
protected function checkBrowserYandexMetrikaBot()
|
630 |
+
{
|
631 |
+
if (stripos($this->_agent, 'YandexMetrika') !== false) {
|
632 |
+
$aresult = explode('/', stristr($this->_agent, 'YandexMetrika'));
|
633 |
+
if (isset($aresult[1])) {
|
634 |
+
$aversion = explode(' ', $aresult[1]);
|
635 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
636 |
+
$this->_browser_name = self::BROWSER_YANDEXMETRIKA_BOT;
|
637 |
+
$this->setRobot(true);
|
638 |
+
return true;
|
639 |
+
}
|
640 |
+
}
|
641 |
+
return false;
|
642 |
+
}
|
643 |
+
|
644 |
+
/**
|
645 |
+
* Determine if the browser is the YandexDirect or not
|
646 |
+
* @return boolean True if the browser is the YandexDirect otherwise false
|
647 |
+
*/
|
648 |
+
protected function checkBrowserYandexDirectBot()
|
649 |
+
{
|
650 |
+
if (stripos($this->_agent, 'YandexDirect') !== false) {
|
651 |
+
$aresult = explode('/', stristr($this->_agent, 'YandexDirect'));
|
652 |
+
if (isset($aresult[1])) {
|
653 |
+
$aversion = explode(' ', $aresult[1]);
|
654 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
655 |
+
$this->_browser_name = self::BROWSER_YANDEXDIRECT_BOT;
|
656 |
+
$this->setRobot(true);
|
657 |
+
return true;
|
658 |
+
}
|
659 |
+
}
|
660 |
+
return false;
|
661 |
+
}
|
662 |
+
|
663 |
+
/**
|
664 |
+
* Determine if the browser is the YandexWebmaster or not
|
665 |
+
* @return boolean True if the browser is the YandexWebmaster otherwise false
|
666 |
+
*/
|
667 |
+
protected function checkBrowserYandexWebmasterBot()
|
668 |
+
{
|
669 |
+
if (stripos($this->_agent, 'YandexWebmaster') !== false) {
|
670 |
+
$aresult = explode('/', stristr($this->_agent, 'YandexWebmaster'));
|
671 |
+
if (isset($aresult[1])) {
|
672 |
+
$aversion = explode(' ', $aresult[1]);
|
673 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
674 |
+
$this->_browser_name = self::BROWSER_YANDEXWEBMASTER_BOT;
|
675 |
+
$this->setRobot(true);
|
676 |
+
return true;
|
677 |
+
}
|
678 |
+
}
|
679 |
+
return false;
|
680 |
+
}
|
681 |
+
|
682 |
+
/**
|
683 |
+
* Determine if the browser is the YandexFavicons or not
|
684 |
+
* @return boolean True if the browser is the YandexFavicons otherwise false
|
685 |
+
*/
|
686 |
+
protected function checkBrowserYandexFaviconsBot()
|
687 |
+
{
|
688 |
+
if (stripos($this->_agent, 'YandexFavicons') !== false) {
|
689 |
+
$aresult = explode('/', stristr($this->_agent, 'YandexFavicons'));
|
690 |
+
if (isset($aresult[1])) {
|
691 |
+
$aversion = explode(' ', $aresult[1]);
|
692 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
693 |
+
$this->_browser_name = self::BROWSER_YANDEXFAVICONS_BOT;
|
694 |
+
$this->setRobot(true);
|
695 |
+
return true;
|
696 |
+
}
|
697 |
+
}
|
698 |
+
return false;
|
699 |
+
}
|
700 |
+
|
701 |
+
/**
|
702 |
+
* Determine if the browser is the YandexBlogs or not
|
703 |
+
* @return boolean True if the browser is the YandexBlogs otherwise false
|
704 |
+
*/
|
705 |
+
protected function checkBrowserYandexBlogsBot()
|
706 |
+
{
|
707 |
+
if (stripos($this->_agent, 'YandexBlogs') !== false) {
|
708 |
+
$aresult = explode('/', stristr($this->_agent, 'YandexBlogs'));
|
709 |
+
if (isset($aresult[1])) {
|
710 |
+
$aversion = explode(' ', $aresult[1]);
|
711 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
712 |
+
$this->_browser_name = self::BROWSER_YANDEXBLOGS_BOT;
|
713 |
+
$this->setRobot(true);
|
714 |
+
return true;
|
715 |
+
}
|
716 |
+
}
|
717 |
+
return false;
|
718 |
+
}
|
719 |
+
|
720 |
+
/**
|
721 |
+
* Determine if the browser is the YandexMedia or not
|
722 |
+
* @return boolean True if the browser is the YandexMedia otherwise false
|
723 |
+
*/
|
724 |
+
protected function checkBrowserYandexMediaBot()
|
725 |
+
{
|
726 |
+
if (stripos($this->_agent, 'YandexMedia') !== false) {
|
727 |
+
$aresult = explode('/', stristr($this->_agent, 'YandexMedia'));
|
728 |
+
if (isset($aresult[1])) {
|
729 |
+
$aversion = explode(' ', $aresult[1]);
|
730 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
731 |
+
$this->_browser_name = self::BROWSER_YANDEXMEDIA_BOT;
|
732 |
+
$this->setRobot(true);
|
733 |
+
return true;
|
734 |
+
}
|
735 |
+
}
|
736 |
+
return false;
|
737 |
+
}
|
738 |
+
|
739 |
+
/**
|
740 |
+
* Determine if the browser is the YandexVideo or not
|
741 |
+
* @return boolean True if the browser is the YandexVideo otherwise false
|
742 |
+
*/
|
743 |
+
protected function checkBrowserYandexVideoBot()
|
744 |
+
{
|
745 |
+
if (stripos($this->_agent, 'YandexVideo') !== false) {
|
746 |
+
$aresult = explode('/', stristr($this->_agent, 'YandexVideo'));
|
747 |
+
if (isset($aresult[1])) {
|
748 |
+
$aversion = explode(' ', $aresult[1]);
|
749 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
750 |
+
$this->_browser_name = self::BROWSER_YANDEXVIDEO_BOT;
|
751 |
+
$this->setRobot(true);
|
752 |
+
return true;
|
753 |
+
}
|
754 |
+
}
|
755 |
+
return false;
|
756 |
+
}
|
757 |
+
|
758 |
+
/**
|
759 |
+
* Determine if the browser is the YandexImages or not
|
760 |
+
* @return boolean True if the browser is the YandexImages otherwise false
|
761 |
+
*/
|
762 |
+
protected function checkBrowserYandexImagesBot()
|
763 |
+
{
|
764 |
+
if (stripos($this->_agent, 'YandexImages') !== false) {
|
765 |
+
$aresult = explode('/', stristr($this->_agent, 'YandexImages'));
|
766 |
+
if (isset($aresult[1])) {
|
767 |
+
$aversion = explode(' ', $aresult[1]);
|
768 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
769 |
+
$this->_browser_name = self::BROWSER_YANDEXIMAGES_BOT;
|
770 |
+
$this->setRobot(true);
|
771 |
+
return true;
|
772 |
+
}
|
773 |
+
}
|
774 |
+
return false;
|
775 |
+
}
|
776 |
+
|
777 |
+
/**
|
778 |
+
* Determine if the browser is the MSNBot or not (last updated 1.9)
|
779 |
+
* @return boolean True if the browser is the MSNBot otherwise false
|
780 |
+
*/
|
781 |
+
protected function checkBrowserMSNBot()
|
782 |
+
{
|
783 |
+
if (stripos($this->_agent, "msnbot") !== false) {
|
784 |
+
$aresult = explode("/", stristr($this->_agent, "msnbot"));
|
785 |
+
if (isset($aresult[1])) {
|
786 |
+
$aversion = explode(" ", $aresult[1]);
|
787 |
+
$this->setVersion(str_replace(";", "", $aversion[0]));
|
788 |
+
$this->_browser_name = self::BROWSER_MSNBOT;
|
789 |
+
$this->setRobot(true);
|
790 |
+
return true;
|
791 |
+
}
|
792 |
+
}
|
793 |
+
return false;
|
794 |
+
}
|
795 |
+
|
796 |
+
/**
|
797 |
+
* Determine if the browser is the BingBot or not (last updated 1.9)
|
798 |
+
* @return boolean True if the browser is the BingBot otherwise false
|
799 |
+
*/
|
800 |
+
protected function checkBrowserBingBot()
|
801 |
+
{
|
802 |
+
if (stripos($this->_agent, "bingbot") !== false) {
|
803 |
+
$aresult = explode("/", stristr($this->_agent, "bingbot"));
|
804 |
+
if (isset($aresult[1])) {
|
805 |
+
$aversion = explode(" ", $aresult[1]);
|
806 |
+
$this->setVersion(str_replace(";", "", $aversion[0]));
|
807 |
+
$this->_browser_name = self::BROWSER_BINGBOT;
|
808 |
+
$this->setRobot(true);
|
809 |
+
return true;
|
810 |
+
}
|
811 |
+
}
|
812 |
+
return false;
|
813 |
+
}
|
814 |
+
|
815 |
+
/**
|
816 |
+
* Determine if the browser is the W3C Validator or not (last updated 1.7)
|
817 |
+
* @return boolean True if the browser is the W3C Validator otherwise false
|
818 |
+
*/
|
819 |
+
protected function checkBrowserW3CValidator()
|
820 |
+
{
|
821 |
+
if (stripos($this->_agent, 'W3C-checklink') !== false) {
|
822 |
+
$aresult = explode('/', stristr($this->_agent, 'W3C-checklink'));
|
823 |
+
if (isset($aresult[1])) {
|
824 |
+
$aversion = explode(' ', $aresult[1]);
|
825 |
+
$this->setVersion($aversion[0]);
|
826 |
+
$this->_browser_name = self::BROWSER_W3CVALIDATOR;
|
827 |
+
return true;
|
828 |
+
}
|
829 |
+
} else if (stripos($this->_agent, 'W3C_Validator') !== false) {
|
830 |
+
// Some of the Validator versions do not delineate w/ a slash - add it back in
|
831 |
+
$ua = str_replace("W3C_Validator ", "W3C_Validator/", $this->_agent);
|
832 |
+
$aresult = explode('/', stristr($ua, 'W3C_Validator'));
|
833 |
+
if (isset($aresult[1])) {
|
834 |
+
$aversion = explode(' ', $aresult[1]);
|
835 |
+
$this->setVersion($aversion[0]);
|
836 |
+
$this->_browser_name = self::BROWSER_W3CVALIDATOR;
|
837 |
+
return true;
|
838 |
+
}
|
839 |
+
} else if (stripos($this->_agent, 'W3C-mobileOK') !== false) {
|
840 |
+
$this->_browser_name = self::BROWSER_W3CVALIDATOR;
|
841 |
+
$this->setMobile(true);
|
842 |
+
return true;
|
843 |
+
}
|
844 |
+
return false;
|
845 |
+
}
|
846 |
+
|
847 |
+
/**
|
848 |
+
* Determine if the browser is the Yahoo! Slurp Robot or not (last updated 1.7)
|
849 |
+
* @return boolean True if the browser is the Yahoo! Slurp Robot otherwise false
|
850 |
+
*/
|
851 |
+
protected function checkBrowserSlurp()
|
852 |
+
{
|
853 |
+
if (stripos($this->_agent, 'slurp') !== false) {
|
854 |
+
$aresult = explode('/', stristr($this->_agent, 'Slurp'));
|
855 |
+
if (isset($aresult[1])) {
|
856 |
+
$aversion = explode(' ', $aresult[1]);
|
857 |
+
$this->setVersion($aversion[0]);
|
858 |
+
$this->_browser_name = self::BROWSER_SLURP;
|
859 |
+
$this->setRobot(true);
|
860 |
+
$this->setMobile(false);
|
861 |
+
return true;
|
862 |
+
}
|
863 |
+
}
|
864 |
+
return false;
|
865 |
+
}
|
866 |
+
|
867 |
+
/**
|
868 |
+
* Determine if the browser is Edge or not
|
869 |
+
* @return boolean True if the browser is Edge otherwise false
|
870 |
+
*/
|
871 |
+
protected function checkBrowserEdge()
|
872 |
+
{
|
873 |
+
if (stripos($this->_agent, 'Edge/') !== false) {
|
874 |
+
$aresult = explode('/', stristr($this->_agent, 'Edge'));
|
875 |
+
if (isset($aresult[1])) {
|
876 |
+
$aversion = explode(' ', $aresult[1]);
|
877 |
+
$this->setVersion($aversion[0]);
|
878 |
+
$this->setBrowser(self::BROWSER_EDGE);
|
879 |
+
if (stripos($this->_agent, 'Windows Phone') !== false || stripos($this->_agent, 'Android') !== false) {
|
880 |
+
$this->setMobile(true);
|
881 |
+
}
|
882 |
+
return true;
|
883 |
+
}
|
884 |
+
}
|
885 |
+
return false;
|
886 |
+
}
|
887 |
+
|
888 |
+
/**
|
889 |
+
* Determine if the browser is Internet Explorer or not (last updated 1.7)
|
890 |
+
* @return boolean True if the browser is Internet Explorer otherwise false
|
891 |
+
*/
|
892 |
+
protected function checkBrowserInternetExplorer()
|
893 |
+
{
|
894 |
+
// Test for IE11
|
895 |
+
if (stripos($this->_agent, 'Trident/7.0; rv:11.0') !== false) {
|
896 |
+
$this->setBrowser(self::BROWSER_IE);
|
897 |
+
$this->setVersion('11.0');
|
898 |
+
return true;
|
899 |
+
} // Test for v1 - v1.5 IE
|
900 |
+
else if (stripos($this->_agent, 'microsoft internet explorer') !== false) {
|
901 |
+
$this->setBrowser(self::BROWSER_IE);
|
902 |
+
$this->setVersion('1.0');
|
903 |
+
$aresult = stristr($this->_agent, '/');
|
904 |
+
if (preg_match('/308|425|426|474|0b1/i', $aresult)) {
|
905 |
+
$this->setVersion('1.5');
|
906 |
+
}
|
907 |
+
return true;
|
908 |
+
} // Test for versions > 1.5
|
909 |
+
else if (stripos($this->_agent, 'msie') !== false && stripos($this->_agent, 'opera') === false) {
|
910 |
+
// See if the browser is the odd MSN Explorer
|
911 |
+
if (stripos($this->_agent, 'msnb') !== false) {
|
912 |
+
$aresult = explode(' ', stristr(str_replace(';', '; ', $this->_agent), 'MSN'));
|
913 |
+
if (isset($aresult[1])) {
|
914 |
+
$this->setBrowser(self::BROWSER_MSN);
|
915 |
+
$this->setVersion(str_replace(array('(', ')', ';'), '', $aresult[1]));
|
916 |
+
return true;
|
917 |
+
}
|
918 |
+
}
|
919 |
+
$aresult = explode(' ', stristr(str_replace(';', '; ', $this->_agent), 'msie'));
|
920 |
+
if (isset($aresult[1])) {
|
921 |
+
$this->setBrowser(self::BROWSER_IE);
|
922 |
+
$this->setVersion(str_replace(array('(', ')', ';'), '', $aresult[1]));
|
923 |
+
if(preg_match('#trident/([0-9\.]+);#i', $this->_agent, $aresult)){
|
924 |
+
if($aresult[1] == '3.1'){
|
925 |
+
$this->setVersion('7.0');
|
926 |
+
}
|
927 |
+
else if($aresult[1] == '4.0'){
|
928 |
+
$this->setVersion('8.0');
|
929 |
+
}
|
930 |
+
else if($aresult[1] == '5.0'){
|
931 |
+
$this->setVersion('9.0');
|
932 |
+
}
|
933 |
+
else if($aresult[1] == '6.0'){
|
934 |
+
$this->setVersion('10.0');
|
935 |
+
}
|
936 |
+
else if($aresult[1] == '7.0'){
|
937 |
+
$this->setVersion('11.0');
|
938 |
+
}
|
939 |
+
else if($aresult[1] == '8.0'){
|
940 |
+
$this->setVersion('11.0');
|
941 |
+
}
|
942 |
+
}
|
943 |
+
if(stripos($this->_agent, 'IEMobile') !== false) {
|
944 |
+
$this->setBrowser(self::BROWSER_POCKET_IE);
|
945 |
+
$this->setMobile(true);
|
946 |
+
}
|
947 |
+
return true;
|
948 |
+
}
|
949 |
+
} // Test for versions > IE 10
|
950 |
+
else if (stripos($this->_agent, 'trident') !== false) {
|
951 |
+
$this->setBrowser(self::BROWSER_IE);
|
952 |
+
$result = explode('rv:', $this->_agent);
|
953 |
+
if (isset($result[1])) {
|
954 |
+
$this->setVersion(preg_replace('/[^0-9.]+/', '', $result[1]));
|
955 |
+
$this->_agent = str_replace(array("Mozilla", "Gecko"), "MSIE", $this->_agent);
|
956 |
+
}
|
957 |
+
} // Test for Pocket IE
|
958 |
+
else if (stripos($this->_agent, 'mspie') !== false || stripos($this->_agent, 'pocket') !== false) {
|
959 |
+
$aresult = explode(' ', stristr($this->_agent, 'mspie'));
|
960 |
+
if (isset($aresult[1])) {
|
961 |
+
$this->setPlatform(self::PLATFORM_WINDOWS_CE);
|
962 |
+
$this->setBrowser(self::BROWSER_POCKET_IE);
|
963 |
+
$this->setMobile(true);
|
964 |
+
|
965 |
+
if (stripos($this->_agent, 'mspie') !== false) {
|
966 |
+
$this->setVersion($aresult[1]);
|
967 |
+
} else {
|
968 |
+
$aversion = explode('/', $this->_agent);
|
969 |
+
if (isset($aversion[1])) {
|
970 |
+
$this->setVersion($aversion[1]);
|
971 |
+
}
|
972 |
+
}
|
973 |
+
return true;
|
974 |
+
}
|
975 |
+
}
|
976 |
+
return false;
|
977 |
+
}
|
978 |
+
|
979 |
+
/**
|
980 |
+
* Determine if the browser is Opera or not (last updated 1.7)
|
981 |
+
* @return boolean True if the browser is Opera otherwise false
|
982 |
+
*/
|
983 |
+
protected function checkBrowserOpera()
|
984 |
+
{
|
985 |
+
if (stripos($this->_agent, 'opera mini') !== false) {
|
986 |
+
$resultant = stristr($this->_agent, 'opera mini');
|
987 |
+
if (preg_match('/\//', $resultant)) {
|
988 |
+
$aresult = explode('/', $resultant);
|
989 |
+
if (isset($aresult[1])) {
|
990 |
+
$aversion = explode(' ', $aresult[1]);
|
991 |
+
$this->setVersion($aversion[0]);
|
992 |
+
}
|
993 |
+
} else {
|
994 |
+
$aversion = explode(' ', stristr($resultant, 'opera mini'));
|
995 |
+
if (isset($aversion[1])) {
|
996 |
+
$this->setVersion($aversion[1]);
|
997 |
+
}
|
998 |
+
}
|
999 |
+
$this->_browser_name = self::BROWSER_OPERA_MINI;
|
1000 |
+
$this->setMobile(true);
|
1001 |
+
return true;
|
1002 |
+
} else if (stripos($this->_agent, 'opera') !== false) {
|
1003 |
+
$resultant = stristr($this->_agent, 'opera');
|
1004 |
+
if (preg_match('/Version\/(1*.*)$/', $resultant, $matches)) {
|
1005 |
+
$this->setVersion($matches[1]);
|
1006 |
+
} else if (preg_match('/\//', $resultant)) {
|
1007 |
+
$aresult = explode('/', str_replace("(", " ", $resultant));
|
1008 |
+
if (isset($aresult[1])) {
|
1009 |
+
$aversion = explode(' ', $aresult[1]);
|
1010 |
+
$this->setVersion($aversion[0]);
|
1011 |
+
}
|
1012 |
+
} else {
|
1013 |
+
$aversion = explode(' ', stristr($resultant, 'opera'));
|
1014 |
+
$this->setVersion(isset($aversion[1]) ? $aversion[1] : "");
|
1015 |
+
}
|
1016 |
+
if (stripos($this->_agent, 'Opera Mobi') !== false) {
|
1017 |
+
$this->setMobile(true);
|
1018 |
+
}
|
1019 |
+
$this->_browser_name = self::BROWSER_OPERA;
|
1020 |
+
return true;
|
1021 |
+
} else if (stripos($this->_agent, 'OPR') !== false) {
|
1022 |
+
$resultant = stristr($this->_agent, 'OPR');
|
1023 |
+
if (preg_match('/\//', $resultant)) {
|
1024 |
+
$aresult = explode('/', str_replace("(", " ", $resultant));
|
1025 |
+
if (isset($aresult[1])) {
|
1026 |
+
$aversion = explode(' ', $aresult[1]);
|
1027 |
+
$this->setVersion($aversion[0]);
|
1028 |
+
}
|
1029 |
+
}
|
1030 |
+
if (stripos($this->_agent, 'Mobile') !== false) {
|
1031 |
+
$this->setMobile(true);
|
1032 |
+
}
|
1033 |
+
$this->_browser_name = self::BROWSER_OPERA;
|
1034 |
+
return true;
|
1035 |
+
}
|
1036 |
+
return false;
|
1037 |
+
}
|
1038 |
+
|
1039 |
+
/**
|
1040 |
+
* Determine if the browser is Chrome or not (last updated 1.7)
|
1041 |
+
* @return boolean True if the browser is Chrome otherwise false
|
1042 |
+
*/
|
1043 |
+
protected function checkBrowserChrome()
|
1044 |
+
{
|
1045 |
+
if (stripos($this->_agent, 'Chrome') !== false) {
|
1046 |
+
$aresult = explode('/', stristr($this->_agent, 'Chrome'));
|
1047 |
+
if (isset($aresult[1])) {
|
1048 |
+
$aversion = explode(' ', $aresult[1]);
|
1049 |
+
$this->setVersion($aversion[0]);
|
1050 |
+
$this->setBrowser(self::BROWSER_CHROME);
|
1051 |
+
//Chrome on Android
|
1052 |
+
if (stripos($this->_agent, 'Android') !== false) {
|
1053 |
+
if (stripos($this->_agent, 'Mobile') !== false) {
|
1054 |
+
$this->setMobile(true);
|
1055 |
+
} else {
|
1056 |
+
$this->setTablet(true);
|
1057 |
+
}
|
1058 |
+
}
|
1059 |
+
return true;
|
1060 |
+
}
|
1061 |
+
}
|
1062 |
+
return false;
|
1063 |
+
}
|
1064 |
+
|
1065 |
+
|
1066 |
+
/**
|
1067 |
+
* Determine if the browser is WebTv or not (last updated 1.7)
|
1068 |
+
* @return boolean True if the browser is WebTv otherwise false
|
1069 |
+
*/
|
1070 |
+
protected function checkBrowserWebTv()
|
1071 |
+
{
|
1072 |
+
if (stripos($this->_agent, 'webtv') !== false) {
|
1073 |
+
$aresult = explode('/', stristr($this->_agent, 'webtv'));
|
1074 |
+
if (isset($aresult[1])) {
|
1075 |
+
$aversion = explode(' ', $aresult[1]);
|
1076 |
+
$this->setVersion($aversion[0]);
|
1077 |
+
$this->setBrowser(self::BROWSER_WEBTV);
|
1078 |
+
return true;
|
1079 |
+
}
|
1080 |
+
}
|
1081 |
+
return false;
|
1082 |
+
}
|
1083 |
+
|
1084 |
+
/**
|
1085 |
+
* Determine if the browser is NetPositive or not (last updated 1.7)
|
1086 |
+
* @return boolean True if the browser is NetPositive otherwise false
|
1087 |
+
*/
|
1088 |
+
protected function checkBrowserNetPositive()
|
1089 |
+
{
|
1090 |
+
if (stripos($this->_agent, 'NetPositive') !== false) {
|
1091 |
+
$aresult = explode('/', stristr($this->_agent, 'NetPositive'));
|
1092 |
+
if (isset($aresult[1])) {
|
1093 |
+
$aversion = explode(' ', $aresult[1]);
|
1094 |
+
$this->setVersion(str_replace(array('(', ')', ';'), '', $aversion[0]));
|
1095 |
+
$this->setBrowser(self::BROWSER_NETPOSITIVE);
|
1096 |
+
return true;
|
1097 |
+
}
|
1098 |
+
}
|
1099 |
+
return false;
|
1100 |
+
}
|
1101 |
+
|
1102 |
+
/**
|
1103 |
+
* Determine if the browser is Galeon or not (last updated 1.7)
|
1104 |
+
* @return boolean True if the browser is Galeon otherwise false
|
1105 |
+
*/
|
1106 |
+
protected function checkBrowserGaleon()
|
1107 |
+
{
|
1108 |
+
if (stripos($this->_agent, 'galeon') !== false) {
|
1109 |
+
$aresult = explode(' ', stristr($this->_agent, 'galeon'));
|
1110 |
+
$aversion = explode('/', $aresult[0]);
|
1111 |
+
if (isset($aversion[1])) {
|
1112 |
+
$this->setVersion($aversion[1]);
|
1113 |
+
$this->setBrowser(self::BROWSER_GALEON);
|
1114 |
+
return true;
|
1115 |
+
}
|
1116 |
+
}
|
1117 |
+
return false;
|
1118 |
+
}
|
1119 |
+
|
1120 |
+
/**
|
1121 |
+
* Determine if the browser is Konqueror or not (last updated 1.7)
|
1122 |
+
* @return boolean True if the browser is Konqueror otherwise false
|
1123 |
+
*/
|
1124 |
+
protected function checkBrowserKonqueror()
|
1125 |
+
{
|
1126 |
+
if (stripos($this->_agent, 'Konqueror') !== false) {
|
1127 |
+
$aresult = explode(' ', stristr($this->_agent, 'Konqueror'));
|
1128 |
+
$aversion = explode('/', $aresult[0]);
|
1129 |
+
if (isset($aversion[1])) {
|
1130 |
+
$this->setVersion($aversion[1]);
|
1131 |
+
$this->setBrowser(self::BROWSER_KONQUEROR);
|
1132 |
+
return true;
|
1133 |
+
}
|
1134 |
+
}
|
1135 |
+
return false;
|
1136 |
+
}
|
1137 |
+
|
1138 |
+
/**
|
1139 |
+
* Determine if the browser is iCab or not (last updated 1.7)
|
1140 |
+
* @return boolean True if the browser is iCab otherwise false
|
1141 |
+
*/
|
1142 |
+
protected function checkBrowserIcab()
|
1143 |
+
{
|
1144 |
+
if (stripos($this->_agent, 'icab') !== false) {
|
1145 |
+
$aversion = explode(' ', stristr(str_replace('/', ' ', $this->_agent), 'icab'));
|
1146 |
+
if (isset($aversion[1])) {
|
1147 |
+
$this->setVersion($aversion[1]);
|
1148 |
+
$this->setBrowser(self::BROWSER_ICAB);
|
1149 |
+
return true;
|
1150 |
+
}
|
1151 |
+
}
|
1152 |
+
return false;
|
1153 |
+
}
|
1154 |
+
|
1155 |
+
/**
|
1156 |
+
* Determine if the browser is OmniWeb or not (last updated 1.7)
|
1157 |
+
* @return boolean True if the browser is OmniWeb otherwise false
|
1158 |
+
*/
|
1159 |
+
protected function checkBrowserOmniWeb()
|
1160 |
+
{
|
1161 |
+
if (stripos($this->_agent, 'omniweb') !== false) {
|
1162 |
+
$aresult = explode('/', stristr($this->_agent, 'omniweb'));
|
1163 |
+
$aversion = explode(' ', isset($aresult[1]) ? $aresult[1] : "");
|
1164 |
+
$this->setVersion($aversion[0]);
|
1165 |
+
$this->setBrowser(self::BROWSER_OMNIWEB);
|
1166 |
+
return true;
|
1167 |
+
}
|
1168 |
+
return false;
|
1169 |
+
}
|
1170 |
+
|
1171 |
+
/**
|
1172 |
+
* Determine if the browser is Phoenix or not (last updated 1.7)
|
1173 |
+
* @return boolean True if the browser is Phoenix otherwise false
|
1174 |
+
*/
|
1175 |
+
protected function checkBrowserPhoenix()
|
1176 |
+
{
|
1177 |
+
if (stripos($this->_agent, 'Phoenix') !== false) {
|
1178 |
+
$aversion = explode('/', stristr($this->_agent, 'Phoenix'));
|
1179 |
+
if (isset($aversion[1])) {
|
1180 |
+
$this->setVersion($aversion[1]);
|
1181 |
+
$this->setBrowser(self::BROWSER_PHOENIX);
|
1182 |
+
return true;
|
1183 |
+
}
|
1184 |
+
}
|
1185 |
+
return false;
|
1186 |
+
}
|
1187 |
+
|
1188 |
+
/**
|
1189 |
+
* Determine if the browser is Firebird or not (last updated 1.7)
|
1190 |
+
* @return boolean True if the browser is Firebird otherwise false
|
1191 |
+
*/
|
1192 |
+
protected function checkBrowserFirebird()
|
1193 |
+
{
|
1194 |
+
if (stripos($this->_agent, 'Firebird') !== false) {
|
1195 |
+
$aversion = explode('/', stristr($this->_agent, 'Firebird'));
|
1196 |
+
if (isset($aversion[1])) {
|
1197 |
+
$this->setVersion($aversion[1]);
|
1198 |
+
$this->setBrowser(self::BROWSER_FIREBIRD);
|
1199 |
+
return true;
|
1200 |
+
}
|
1201 |
+
}
|
1202 |
+
return false;
|
1203 |
+
}
|
1204 |
+
|
1205 |
+
/**
|
1206 |
+
* Determine if the browser is Netscape Navigator 9+ or not (last updated 1.7)
|
1207 |
+
* NOTE: (http://browser.netscape.com/ - Official support ended on March 1st, 2008)
|
1208 |
+
* @return boolean True if the browser is Netscape Navigator 9+ otherwise false
|
1209 |
+
*/
|
1210 |
+
protected function checkBrowserNetscapeNavigator9Plus()
|
1211 |
+
{
|
1212 |
+
if (stripos($this->_agent, 'Firefox') !== false && preg_match('/Navigator\/([^ ]*)/i', $this->_agent, $matches)) {
|
1213 |
+
$this->setVersion($matches[1]);
|
1214 |
+
$this->setBrowser(self::BROWSER_NETSCAPE_NAVIGATOR);
|
1215 |
+
return true;
|
1216 |
+
} else if (stripos($this->_agent, 'Firefox') === false && preg_match('/Netscape6?\/([^ ]*)/i', $this->_agent, $matches)) {
|
1217 |
+
$this->setVersion($matches[1]);
|
1218 |
+
$this->setBrowser(self::BROWSER_NETSCAPE_NAVIGATOR);
|
1219 |
+
return true;
|
1220 |
+
}
|
1221 |
+
return false;
|
1222 |
+
}
|
1223 |
+
|
1224 |
+
/**
|
1225 |
+
* Determine if the browser is Shiretoko or not (https://wiki.mozilla.org/Projects/shiretoko) (last updated 1.7)
|
1226 |
+
* @return boolean True if the browser is Shiretoko otherwise false
|
1227 |
+
*/
|
1228 |
+
protected function checkBrowserShiretoko()
|
1229 |
+
{
|
1230 |
+
if (stripos($this->_agent, 'Mozilla') !== false && preg_match('/Shiretoko\/([^ ]*)/i', $this->_agent, $matches)) {
|
1231 |
+
$this->setVersion($matches[1]);
|
1232 |
+
$this->setBrowser(self::BROWSER_SHIRETOKO);
|
1233 |
+
return true;
|
1234 |
+
}
|
1235 |
+
return false;
|
1236 |
+
}
|
1237 |
+
|
1238 |
+
/**
|
1239 |
+
* Determine if the browser is Ice Cat or not (http://en.wikipedia.org/wiki/GNU_IceCat) (last updated 1.7)
|
1240 |
+
* @return boolean True if the browser is Ice Cat otherwise false
|
1241 |
+
*/
|
1242 |
+
protected function checkBrowserIceCat()
|
1243 |
+
{
|
1244 |
+
if (stripos($this->_agent, 'Mozilla') !== false && preg_match('/IceCat\/([^ ]*)/i', $this->_agent, $matches)) {
|
1245 |
+
$this->setVersion($matches[1]);
|
1246 |
+
$this->setBrowser(self::BROWSER_ICECAT);
|
1247 |
+
return true;
|
1248 |
+
}
|
1249 |
+
return false;
|
1250 |
+
}
|
1251 |
+
|
1252 |
+
/**
|
1253 |
+
* Determine if the browser is Nokia or not (last updated 1.7)
|
1254 |
+
* @return boolean True if the browser is Nokia otherwise false
|
1255 |
+
*/
|
1256 |
+
protected function checkBrowserNokia()
|
1257 |
+
{
|
1258 |
+
if (preg_match("/Nokia([^\/]+)\/([^ SP]+)/i", $this->_agent, $matches)) {
|
1259 |
+
$this->setVersion($matches[2]);
|
1260 |
+
if (stripos($this->_agent, 'Series60') !== false || strpos($this->_agent, 'S60') !== false) {
|
1261 |
+
$this->setBrowser(self::BROWSER_NOKIA_S60);
|
1262 |
+
} else {
|
1263 |
+
$this->setBrowser(self::BROWSER_NOKIA);
|
1264 |
+
}
|
1265 |
+
$this->setMobile(true);
|
1266 |
+
return true;
|
1267 |
+
}
|
1268 |
+
return false;
|
1269 |
+
}
|
1270 |
+
|
1271 |
+
/**
|
1272 |
+
* Determine if the browser is Firefox or not (last updated 1.7)
|
1273 |
+
* @return boolean True if the browser is Firefox otherwise false
|
1274 |
+
*/
|
1275 |
+
protected function checkBrowserFirefox()
|
1276 |
+
{
|
1277 |
+
if (stripos($this->_agent, 'safari') === false) {
|
1278 |
+
if (preg_match("/Firefox[\/ \(]([^ ;\)]+)/i", $this->_agent, $matches)) {
|
1279 |
+
$this->setVersion($matches[1]);
|
1280 |
+
$this->setBrowser(self::BROWSER_FIREFOX);
|
1281 |
+
//Firefox on Android
|
1282 |
+
if (stripos($this->_agent, 'Android') !== false) {
|
1283 |
+
if (stripos($this->_agent, 'Mobile') !== false) {
|
1284 |
+
$this->setMobile(true);
|
1285 |
+
} else {
|
1286 |
+
$this->setTablet(true);
|
1287 |
+
}
|
1288 |
+
}
|
1289 |
+
return true;
|
1290 |
+
} else if (preg_match("/Firefox$/i", $this->_agent, $matches)) {
|
1291 |
+
$this->setVersion("");
|
1292 |
+
$this->setBrowser(self::BROWSER_FIREFOX);
|
1293 |
+
return true;
|
1294 |
+
}
|
1295 |
+
}
|
1296 |
+
return false;
|
1297 |
+
}
|
1298 |
+
|
1299 |
+
/**
|
1300 |
+
* Determine if the browser is Firefox or not (last updated 1.7)
|
1301 |
+
* @return boolean True if the browser is Firefox otherwise false
|
1302 |
+
*/
|
1303 |
+
protected function checkBrowserIceweasel()
|
1304 |
+
{
|
1305 |
+
if (stripos($this->_agent, 'Iceweasel') !== false) {
|
1306 |
+
$aresult = explode('/', stristr($this->_agent, 'Iceweasel'));
|
1307 |
+
if (isset($aresult[1])) {
|
1308 |
+
$aversion = explode(' ', $aresult[1]);
|
1309 |
+
$this->setVersion($aversion[0]);
|
1310 |
+
$this->setBrowser(self::BROWSER_ICEWEASEL);
|
1311 |
+
return true;
|
1312 |
+
}
|
1313 |
+
}
|
1314 |
+
return false;
|
1315 |
+
}
|
1316 |
+
|
1317 |
+
/**
|
1318 |
+
* Determine if the browser is Mozilla or not (last updated 1.7)
|
1319 |
+
* @return boolean True if the browser is Mozilla otherwise false
|
1320 |
+
*/
|
1321 |
+
protected function checkBrowserMozilla()
|
1322 |
+
{
|
1323 |
+
if (stripos($this->_agent, 'mozilla') !== false && preg_match('/rv:[0-9].[0-9][a-b]?/i', $this->_agent) && stripos($this->_agent, 'netscape') === false) {
|
1324 |
+
$aversion = explode(' ', stristr($this->_agent, 'rv:'));
|
1325 |
+
preg_match('/rv:[0-9].[0-9][a-b]?/i', $this->_agent, $aversion);
|
1326 |
+
$this->setVersion(str_replace('rv:', '', $aversion[0]));
|
1327 |
+
$this->setBrowser(self::BROWSER_MOZILLA);
|
1328 |
+
return true;
|
1329 |
+
} else if (stripos($this->_agent, 'mozilla') !== false && preg_match('/rv:[0-9]\.[0-9]/i', $this->_agent) && stripos($this->_agent, 'netscape') === false) {
|
1330 |
+
$aversion = explode('', stristr($this->_agent, 'rv:'));
|
1331 |
+
$this->setVersion(str_replace('rv:', '', $aversion[0]));
|
1332 |
+
$this->setBrowser(self::BROWSER_MOZILLA);
|
1333 |
+
return true;
|
1334 |
+
} else if (stripos($this->_agent, 'mozilla') !== false && preg_match('/mozilla\/([^ ]*)/i', $this->_agent, $matches) && stripos($this->_agent, 'netscape') === false) {
|
1335 |
+
$this->setVersion($matches[1]);
|
1336 |
+
$this->setBrowser(self::BROWSER_MOZILLA);
|
1337 |
+
return true;
|
1338 |
+
}
|
1339 |
+
return false;
|
1340 |
+
}
|
1341 |
+
|
1342 |
+
/**
|
1343 |
+
* Determine if the browser is Lynx or not (last updated 1.7)
|
1344 |
+
* @return boolean True if the browser is Lynx otherwise false
|
1345 |
+
*/
|
1346 |
+
protected function checkBrowserLynx()
|
1347 |
+
{
|
1348 |
+
if (stripos($this->_agent, 'lynx') !== false) {
|
1349 |
+
$aresult = explode('/', stristr($this->_agent, 'Lynx'));
|
1350 |
+
$aversion = explode(' ', (isset($aresult[1]) ? $aresult[1] : ""));
|
1351 |
+
$this->setVersion($aversion[0]);
|
1352 |
+
$this->setBrowser(self::BROWSER_LYNX);
|
1353 |
+
return true;
|
1354 |
+
}
|
1355 |
+
return false;
|
1356 |
+
}
|
1357 |
+
|
1358 |
+
/**
|
1359 |
+
* Determine if the browser is Amaya or not (last updated 1.7)
|
1360 |
+
* @return boolean True if the browser is Amaya otherwise false
|
1361 |
+
*/
|
1362 |
+
protected function checkBrowserAmaya()
|
1363 |
+
{
|
1364 |
+
if (stripos($this->_agent, 'amaya') !== false) {
|
1365 |
+
$aresult = explode('/', stristr($this->_agent, 'Amaya'));
|
1366 |
+
if (isset($aresult[1])) {
|
1367 |
+
$aversion = explode(' ', $aresult[1]);
|
1368 |
+
$this->setVersion($aversion[0]);
|
1369 |
+
$this->setBrowser(self::BROWSER_AMAYA);
|
1370 |
+
return true;
|
1371 |
+
}
|
1372 |
+
}
|
1373 |
+
return false;
|
1374 |
+
}
|
1375 |
+
|
1376 |
+
/**
|
1377 |
+
* Determine if the browser is Safari or not (last updated 1.7)
|
1378 |
+
* @return boolean True if the browser is Safari otherwise false
|
1379 |
+
*/
|
1380 |
+
protected function checkBrowserSafari()
|
1381 |
+
{
|
1382 |
+
if (stripos($this->_agent, 'Safari') !== false
|
1383 |
+
&& stripos($this->_agent, 'iPhone') === false
|
1384 |
+
&& stripos($this->_agent, 'iPod') === false
|
1385 |
+
) {
|
1386 |
+
|
1387 |
+
$aresult = explode('/', stristr($this->_agent, 'Version'));
|
1388 |
+
if (isset($aresult[1])) {
|
1389 |
+
$aversion = explode(' ', $aresult[1]);
|
1390 |
+
$this->setVersion($aversion[0]);
|
1391 |
+
} else {
|
1392 |
+
$this->setVersion(self::VERSION_UNKNOWN);
|
1393 |
+
}
|
1394 |
+
$this->setBrowser(self::BROWSER_SAFARI);
|
1395 |
+
return true;
|
1396 |
+
}
|
1397 |
+
return false;
|
1398 |
+
}
|
1399 |
+
|
1400 |
+
protected function checkBrowserSamsung()
|
1401 |
+
{
|
1402 |
+
if (stripos($this->_agent, 'SamsungBrowser') !== false) {
|
1403 |
+
|
1404 |
+
$aresult = explode('/', stristr($this->_agent, 'SamsungBrowser'));
|
1405 |
+
if (isset($aresult[1])) {
|
1406 |
+
$aversion = explode(' ', $aresult[1]);
|
1407 |
+
$this->setVersion($aversion[0]);
|
1408 |
+
} else {
|
1409 |
+
$this->setVersion(self::VERSION_UNKNOWN);
|
1410 |
+
}
|
1411 |
+
$this->setBrowser(self::BROWSER_SAMSUNG);
|
1412 |
+
return true;
|
1413 |
+
}
|
1414 |
+
return false;
|
1415 |
+
}
|
1416 |
+
|
1417 |
+
protected function checkBrowserSilk()
|
1418 |
+
{
|
1419 |
+
if (stripos($this->_agent, 'Silk') !== false) {
|
1420 |
+
$aresult = explode('/', stristr($this->_agent, 'Silk'));
|
1421 |
+
if (isset($aresult[1])) {
|
1422 |
+
$aversion = explode(' ', $aresult[1]);
|
1423 |
+
$this->setVersion($aversion[0]);
|
1424 |
+
} else {
|
1425 |
+
$this->setVersion(self::VERSION_UNKNOWN);
|
1426 |
+
}
|
1427 |
+
$this->setBrowser(self::BROWSER_SILK);
|
1428 |
+
return true;
|
1429 |
+
}
|
1430 |
+
return false;
|
1431 |
+
}
|
1432 |
+
|
1433 |
+
protected function checkBrowserIframely()
|
1434 |
+
{
|
1435 |
+
if (stripos($this->_agent, 'Iframely') !== false) {
|
1436 |
+
$aresult = explode('/', stristr($this->_agent, 'Iframely'));
|
1437 |
+
if (isset($aresult[1])) {
|
1438 |
+
$aversion = explode(' ', $aresult[1]);
|
1439 |
+
$this->setVersion($aversion[0]);
|
1440 |
+
} else {
|
1441 |
+
$this->setVersion(self::VERSION_UNKNOWN);
|
1442 |
+
}
|
1443 |
+
$this->setBrowser(self::BROWSER_I_FRAME);
|
1444 |
+
return true;
|
1445 |
+
}
|
1446 |
+
return false;
|
1447 |
+
}
|
1448 |
+
|
1449 |
+
protected function checkBrowserCocoa()
|
1450 |
+
{
|
1451 |
+
if (stripos($this->_agent, 'CocoaRestClient') !== false) {
|
1452 |
+
$aresult = explode('/', stristr($this->_agent, 'CocoaRestClient'));
|
1453 |
+
if (isset($aresult[1])) {
|
1454 |
+
$aversion = explode(' ', $aresult[1]);
|
1455 |
+
$this->setVersion($aversion[0]);
|
1456 |
+
} else {
|
1457 |
+
$this->setVersion(self::VERSION_UNKNOWN);
|
1458 |
+
}
|
1459 |
+
$this->setBrowser(self::BROWSER_COCOA);
|
1460 |
+
return true;
|
1461 |
+
}
|
1462 |
+
return false;
|
1463 |
+
}
|
1464 |
+
|
1465 |
+
/**
|
1466 |
+
* Detect if URL is loaded from FacebookExternalHit
|
1467 |
+
* @return boolean True if it detects FacebookExternalHit otherwise false
|
1468 |
+
*/
|
1469 |
+
protected function checkFacebookExternalHit()
|
1470 |
+
{
|
1471 |
+
if (stristr($this->_agent, 'FacebookExternalHit')) {
|
1472 |
+
$this->setRobot(true);
|
1473 |
+
$this->setFacebook(true);
|
1474 |
+
return true;
|
1475 |
+
}
|
1476 |
+
return false;
|
1477 |
+
}
|
1478 |
+
|
1479 |
+
/**
|
1480 |
+
* Detect if URL is being loaded from internal Facebook browser
|
1481 |
+
* @return boolean True if it detects internal Facebook browser otherwise false
|
1482 |
+
*/
|
1483 |
+
protected function checkForFacebookIos()
|
1484 |
+
{
|
1485 |
+
if (stristr($this->_agent, 'FBIOS')) {
|
1486 |
+
$this->setFacebook(true);
|
1487 |
+
return true;
|
1488 |
+
}
|
1489 |
+
return false;
|
1490 |
+
}
|
1491 |
+
|
1492 |
+
/**
|
1493 |
+
* Detect Version for the Safari browser on iOS devices
|
1494 |
+
* @return boolean True if it detects the version correctly otherwise false
|
1495 |
+
*/
|
1496 |
+
protected function getSafariVersionOnIos()
|
1497 |
+
{
|
1498 |
+
$aresult = explode('/', stristr($this->_agent, 'Version'));
|
1499 |
+
if (isset($aresult[1])) {
|
1500 |
+
$aversion = explode(' ', $aresult[1]);
|
1501 |
+
$this->setVersion($aversion[0]);
|
1502 |
+
return true;
|
1503 |
+
}
|
1504 |
+
return false;
|
1505 |
+
}
|
1506 |
+
|
1507 |
+
/**
|
1508 |
+
* Detect Version for the Chrome browser on iOS devices
|
1509 |
+
* @return boolean True if it detects the version correctly otherwise false
|
1510 |
+
*/
|
1511 |
+
protected function getChromeVersionOnIos()
|
1512 |
+
{
|
1513 |
+
$aresult = explode('/', stristr($this->_agent, 'CriOS'));
|
1514 |
+
if (isset($aresult[1])) {
|
1515 |
+
$aversion = explode(' ', $aresult[1]);
|
1516 |
+
$this->setVersion($aversion[0]);
|
1517 |
+
$this->setBrowser(self::BROWSER_CHROME);
|
1518 |
+
return true;
|
1519 |
+
}
|
1520 |
+
return false;
|
1521 |
+
}
|
1522 |
+
|
1523 |
+
/**
|
1524 |
+
* Determine if the browser is iPhone or not (last updated 1.7)
|
1525 |
+
* @return boolean True if the browser is iPhone otherwise false
|
1526 |
+
*/
|
1527 |
+
protected function checkBrowseriPhone()
|
1528 |
+
{
|
1529 |
+
if (stripos($this->_agent, 'iPhone') !== false) {
|
1530 |
+
$this->setVersion(self::VERSION_UNKNOWN);
|
1531 |
+
$this->setBrowser(self::BROWSER_IPHONE);
|
1532 |
+
$this->getSafariVersionOnIos();
|
1533 |
+
$this->getChromeVersionOnIos();
|
1534 |
+
$this->checkForFacebookIos();
|
1535 |
+
$this->setMobile(true);
|
1536 |
+
return true;
|
1537 |
+
|
1538 |
+
}
|
1539 |
+
return false;
|
1540 |
+
}
|
1541 |
+
|
1542 |
+
/**
|
1543 |
+
* Determine if the browser is iPad or not (last updated 1.7)
|
1544 |
+
* @return boolean True if the browser is iPad otherwise false
|
1545 |
+
*/
|
1546 |
+
protected function checkBrowseriPad()
|
1547 |
+
{
|
1548 |
+
if (stripos($this->_agent, 'iPad') !== false) {
|
1549 |
+
$this->setVersion(self::VERSION_UNKNOWN);
|
1550 |
+
$this->setBrowser(self::BROWSER_IPAD);
|
1551 |
+
$this->getSafariVersionOnIos();
|
1552 |
+
$this->getChromeVersionOnIos();
|
1553 |
+
$this->checkForFacebookIos();
|
1554 |
+
$this->setTablet(true);
|
1555 |
+
return true;
|
1556 |
+
}
|
1557 |
+
return false;
|
1558 |
+
}
|
1559 |
+
|
1560 |
+
/**
|
1561 |
+
* Determine if the browser is iPod or not (last updated 1.7)
|
1562 |
+
* @return boolean True if the browser is iPod otherwise false
|
1563 |
+
*/
|
1564 |
+
protected function checkBrowseriPod()
|
1565 |
+
{
|
1566 |
+
if (stripos($this->_agent, 'iPod') !== false) {
|
1567 |
+
$this->setVersion(self::VERSION_UNKNOWN);
|
1568 |
+
$this->setBrowser(self::BROWSER_IPOD);
|
1569 |
+
$this->getSafariVersionOnIos();
|
1570 |
+
$this->getChromeVersionOnIos();
|
1571 |
+
$this->checkForFacebookIos();
|
1572 |
+
$this->setMobile(true);
|
1573 |
+
return true;
|
1574 |
+
}
|
1575 |
+
return false;
|
1576 |
+
}
|
1577 |
+
|
1578 |
+
/**
|
1579 |
+
* Determine if the browser is Android or not (last updated 1.7)
|
1580 |
+
* @return boolean True if the browser is Android otherwise false
|
1581 |
+
*/
|
1582 |
+
protected function checkBrowserAndroid()
|
1583 |
+
{
|
1584 |
+
if (stripos($this->_agent, 'Android') !== false) {
|
1585 |
+
$aresult = explode(' ', stristr($this->_agent, 'Android'));
|
1586 |
+
if (isset($aresult[1])) {
|
1587 |
+
$aversion = explode(' ', $aresult[1]);
|
1588 |
+
$this->setVersion($aversion[0]);
|
1589 |
+
} else {
|
1590 |
+
$this->setVersion(self::VERSION_UNKNOWN);
|
1591 |
+
}
|
1592 |
+
if (stripos($this->_agent, 'Mobile') !== false) {
|
1593 |
+
$this->setMobile(true);
|
1594 |
+
} else {
|
1595 |
+
$this->setTablet(true);
|
1596 |
+
}
|
1597 |
+
$this->setBrowser(self::BROWSER_ANDROID);
|
1598 |
+
return true;
|
1599 |
+
}
|
1600 |
+
return false;
|
1601 |
+
}
|
1602 |
+
|
1603 |
+
/**
|
1604 |
+
* Determine if the browser is Vivaldi
|
1605 |
+
* @return boolean True if the browser is Vivaldi otherwise false
|
1606 |
+
*/
|
1607 |
+
protected function checkBrowserVivaldi()
|
1608 |
+
{
|
1609 |
+
if (stripos($this->_agent, 'Vivaldi') !== false) {
|
1610 |
+
$aresult = explode('/', stristr($this->_agent, 'Vivaldi'));
|
1611 |
+
if (isset($aresult[1])) {
|
1612 |
+
$aversion = explode(' ', $aresult[1]);
|
1613 |
+
$this->setVersion($aversion[0]);
|
1614 |
+
$this->setBrowser(self::BROWSER_VIVALDI);
|
1615 |
+
return true;
|
1616 |
+
}
|
1617 |
+
}
|
1618 |
+
return false;
|
1619 |
+
}
|
1620 |
+
|
1621 |
+
/**
|
1622 |
+
* Determine if the browser is Yandex
|
1623 |
+
* @return boolean True if the browser is Yandex otherwise false
|
1624 |
+
*/
|
1625 |
+
protected function checkBrowserYandex()
|
1626 |
+
{
|
1627 |
+
if (stripos($this->_agent, 'YaBrowser') !== false) {
|
1628 |
+
$aresult = explode('/', stristr($this->_agent, 'YaBrowser'));
|
1629 |
+
if (isset($aresult[1])) {
|
1630 |
+
$aversion = explode(' ', $aresult[1]);
|
1631 |
+
$this->setVersion($aversion[0]);
|
1632 |
+
$this->setBrowser(self::BROWSER_YANDEX);
|
1633 |
+
|
1634 |
+
if (stripos($this->_agent, 'iPad') !== false) {
|
1635 |
+
$this->setTablet(true);
|
1636 |
+
} elseif (stripos($this->_agent, 'Mobile') !== false) {
|
1637 |
+
$this->setMobile(true);
|
1638 |
+
} elseif (stripos($this->_agent, 'Android') !== false) {
|
1639 |
+
$this->setTablet(true);
|
1640 |
+
}
|
1641 |
+
|
1642 |
+
return true;
|
1643 |
+
}
|
1644 |
+
}
|
1645 |
+
|
1646 |
+
return false;
|
1647 |
+
}
|
1648 |
+
|
1649 |
+
/**
|
1650 |
+
* Determine if the browser is a PlayStation
|
1651 |
+
* @return boolean True if the browser is PlayStation otherwise false
|
1652 |
+
*/
|
1653 |
+
protected function checkBrowserPlayStation()
|
1654 |
+
{
|
1655 |
+
if (stripos($this->_agent, 'PlayStation ') !== false) {
|
1656 |
+
$aresult = explode(' ', stristr($this->_agent, 'PlayStation '));
|
1657 |
+
$this->setBrowser(self::BROWSER_PLAYSTATION);
|
1658 |
+
if (isset($aresult[0])) {
|
1659 |
+
$aversion = explode(')', $aresult[2]);
|
1660 |
+
$this->setVersion($aversion[0]);
|
1661 |
+
if (stripos($this->_agent, 'Portable)') !== false || stripos($this->_agent, 'Vita') !== false) {
|
1662 |
+
$this->setMobile(true);
|
1663 |
+
}
|
1664 |
+
return true;
|
1665 |
+
}
|
1666 |
+
}
|
1667 |
+
return false;
|
1668 |
+
}
|
1669 |
+
|
1670 |
+
/**
|
1671 |
+
* Determine the user's platform (last updated 2.0)
|
1672 |
+
*/
|
1673 |
+
protected function checkPlatform()
|
1674 |
+
{
|
1675 |
+
if (stripos($this->_agent, 'windows') !== false) {
|
1676 |
+
$this->_platform = self::PLATFORM_WINDOWS;
|
1677 |
+
} else if (stripos($this->_agent, 'iPad') !== false) {
|
1678 |
+
$this->_platform = self::PLATFORM_IPAD;
|
1679 |
+
} else if (stripos($this->_agent, 'iPod') !== false) {
|
1680 |
+
$this->_platform = self::PLATFORM_IPOD;
|
1681 |
+
} else if (stripos($this->_agent, 'iPhone') !== false) {
|
1682 |
+
$this->_platform = self::PLATFORM_IPHONE;
|
1683 |
+
} elseif (stripos($this->_agent, 'mac') !== false) {
|
1684 |
+
$this->_platform = self::PLATFORM_APPLE;
|
1685 |
+
} elseif (stripos($this->_agent, 'android') !== false) {
|
1686 |
+
$this->_platform = self::PLATFORM_ANDROID;
|
1687 |
+
} elseif (stripos($this->_agent, 'Silk') !== false) {
|
1688 |
+
$this->_platform = self::PLATFORM_FIRE_OS;
|
1689 |
+
} elseif (stripos($this->_agent, 'linux') !== false && stripos($this->_agent, 'SMART-TV') !== false ) {
|
1690 |
+
$this->_platform = self::PLATFORM_LINUX .'/'.self::PLATFORM_SMART_TV;
|
1691 |
+
} elseif (stripos($this->_agent, 'linux') !== false) {
|
1692 |
+
$this->_platform = self::PLATFORM_LINUX;
|
1693 |
+
} else if (stripos($this->_agent, 'Nokia') !== false) {
|
1694 |
+
$this->_platform = self::PLATFORM_NOKIA;
|
1695 |
+
} else if (stripos($this->_agent, 'BlackBerry') !== false) {
|
1696 |
+
$this->_platform = self::PLATFORM_BLACKBERRY;
|
1697 |
+
} elseif (stripos($this->_agent, 'FreeBSD') !== false) {
|
1698 |
+
$this->_platform = self::PLATFORM_FREEBSD;
|
1699 |
+
} elseif (stripos($this->_agent, 'OpenBSD') !== false) {
|
1700 |
+
$this->_platform = self::PLATFORM_OPENBSD;
|
1701 |
+
} elseif (stripos($this->_agent, 'NetBSD') !== false) {
|
1702 |
+
$this->_platform = self::PLATFORM_NETBSD;
|
1703 |
+
} elseif (stripos($this->_agent, 'OpenSolaris') !== false) {
|
1704 |
+
$this->_platform = self::PLATFORM_OPENSOLARIS;
|
1705 |
+
} elseif (stripos($this->_agent, 'SunOS') !== false) {
|
1706 |
+
$this->_platform = self::PLATFORM_SUNOS;
|
1707 |
+
} elseif (stripos($this->_agent, 'OS\/2') !== false) {
|
1708 |
+
$this->_platform = self::PLATFORM_OS2;
|
1709 |
+
} elseif (stripos($this->_agent, 'BeOS') !== false) {
|
1710 |
+
$this->_platform = self::PLATFORM_BEOS;
|
1711 |
+
} elseif (stripos($this->_agent, 'win') !== false) {
|
1712 |
+
$this->_platform = self::PLATFORM_WINDOWS;
|
1713 |
+
} elseif (stripos($this->_agent, 'Playstation') !== false) {
|
1714 |
+
$this->_platform = self::PLATFORM_PLAYSTATION;
|
1715 |
+
} elseif (stripos($this->_agent, 'Roku') !== false) {
|
1716 |
+
$this->_platform = self::PLATFORM_ROKU;
|
1717 |
+
} elseif (stripos($this->_agent, 'iOS') !== false) {
|
1718 |
+
$this->_platform = self::PLATFORM_IPHONE . '/' . self::PLATFORM_IPAD;
|
1719 |
+
} elseif (stripos($this->_agent, 'tvOS') !== false) {
|
1720 |
+
$this->_platform = self::PLATFORM_APPLE_TV;
|
1721 |
+
} elseif (stripos($this->_agent, 'curl') !== false) {
|
1722 |
+
$this->_platform = self::PLATFORM_TERMINAL;
|
1723 |
+
} elseif (stripos($this->_agent, 'CrOS') !== false) {
|
1724 |
+
$this->_platform = self::PLATFORM_CHROME_OS;
|
1725 |
+
} elseif (stripos($this->_agent, 'okhttp') !== false) {
|
1726 |
+
$this->_platform = self::PLATFORM_JAVA_ANDROID;
|
1727 |
+
} elseif (stripos($this->_agent, 'PostmanRuntime') !== false) {
|
1728 |
+
$this->_platform = self::PLATFORM_POSTMAN;
|
1729 |
+
} elseif (stripos($this->_agent, 'Iframely') !== false) {
|
1730 |
+
$this->_platform = self::PLATFORM_I_FRAME;
|
1731 |
+
}
|
1732 |
+
}
|
1733 |
+
}
|
app/Services/ConditionAssesor.php
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services;
|
4 |
+
|
5 |
+
use FluentForm\Framework\Helpers\ArrayHelper;
|
6 |
+
|
7 |
+
class ConditionAssesor
|
8 |
+
{
|
9 |
+
public static function evaluate(&$field, &$inputs)
|
10 |
+
{
|
11 |
+
$conditionals = ArrayHelper::get($field, 'conditionals.status')
|
12 |
+
? ArrayHelper::get($field, 'conditionals.conditions')
|
13 |
+
: false;
|
14 |
+
|
15 |
+
$hasConditionMet = true;
|
16 |
+
|
17 |
+
if ($conditionals) {
|
18 |
+
$toMatch = ArrayHelper::get($field, 'conditionals.type');
|
19 |
+
|
20 |
+
foreach ($conditionals as $conditional) {
|
21 |
+
$hasConditionMet = static::assess($conditional, $inputs);
|
22 |
+
|
23 |
+
if ($toMatch === 'all' && ! $hasConditionMet) {
|
24 |
+
break;
|
25 |
+
}
|
26 |
+
}
|
27 |
+
}
|
28 |
+
|
29 |
+
return $hasConditionMet;
|
30 |
+
}
|
31 |
+
|
32 |
+
public static function assess(&$conditional, &$inputs)
|
33 |
+
{
|
34 |
+
if ($conditional['field']) {
|
35 |
+
$inputValue = ArrayHelper::get($inputs, $conditional['field']);
|
36 |
+
|
37 |
+
switch ($conditional['operator']) {
|
38 |
+
case '=':
|
39 |
+
return $inputValue === $conditional['value'];
|
40 |
+
break;
|
41 |
+
case '!=':
|
42 |
+
return $inputValue !== $conditional['value'];
|
43 |
+
break;
|
44 |
+
case '>':
|
45 |
+
return $inputValue > $conditional['value'];
|
46 |
+
break;
|
47 |
+
case '<':
|
48 |
+
return $inputValue > $conditional['value'];
|
49 |
+
break;
|
50 |
+
case '>=':
|
51 |
+
return $inputValue > $conditional['value'];
|
52 |
+
break;
|
53 |
+
case '<=':
|
54 |
+
return $inputValue > $conditional['value'];
|
55 |
+
break;
|
56 |
+
case 'startsWith':
|
57 |
+
return substr($inputValue, 0, strlen($conditional['value']))
|
58 |
+
=== $conditional['value'];
|
59 |
+
break;
|
60 |
+
case 'endsWith':
|
61 |
+
return substr($inputValue, -strlen($conditional['value']))
|
62 |
+
=== $conditional['value'];
|
63 |
+
break;
|
64 |
+
case 'contains':
|
65 |
+
return strpos($inputValue, $conditional['value']) !== false;
|
66 |
+
break;
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
return false;
|
71 |
+
}
|
72 |
+
}
|
app/Services/FormBuilder/Components.php
ADDED
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services\FormBuilder;
|
4 |
+
|
5 |
+
use Closure;
|
6 |
+
|
7 |
+
class Components implements \JsonSerializable
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* $items [Components list]
|
11 |
+
* @var array
|
12 |
+
*/
|
13 |
+
protected $items = array();
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Build the object instance
|
17 |
+
* @param array $items
|
18 |
+
*/
|
19 |
+
public function __construct(array $items)
|
20 |
+
{
|
21 |
+
$this->items = $items;
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Add a component into list [$items]
|
26 |
+
* @param string $name
|
27 |
+
* @param array $component
|
28 |
+
* @param string $group ['general'|'advanced']
|
29 |
+
* @return $this
|
30 |
+
*/
|
31 |
+
public function add($name, array $component, $group)
|
32 |
+
{
|
33 |
+
if (isset($this->items[$group])) {
|
34 |
+
$this->items[$group][$name] = $component;
|
35 |
+
}
|
36 |
+
|
37 |
+
return $this;
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Remove a component from the list [$items]
|
42 |
+
* @param string $name
|
43 |
+
* @param string $group ['general'|'advanced']
|
44 |
+
* @return $this
|
45 |
+
*/
|
46 |
+
public function remove($name, $group)
|
47 |
+
{
|
48 |
+
if (isset($this->items[$group])) {
|
49 |
+
unset($this->items[$group][$name]);
|
50 |
+
}
|
51 |
+
|
52 |
+
return $this;
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Modify an existing component
|
57 |
+
* @param string $name
|
58 |
+
* @param Closure $callback [to modify the component within]
|
59 |
+
* @param string $group
|
60 |
+
* @return $this
|
61 |
+
*/
|
62 |
+
public function update($name, Closure $callback, $group)
|
63 |
+
{
|
64 |
+
$element = $callback($this->items[$group][$name]);
|
65 |
+
$this->items[$group][$name] = $element;
|
66 |
+
return $this;
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Sort the components in list [$items]
|
71 |
+
* @param string $sortBy [key to sort by]
|
72 |
+
* @return $this
|
73 |
+
*/
|
74 |
+
public function sort($sortBy = 'index')
|
75 |
+
{
|
76 |
+
foreach ($this->items as $group => &$items) {
|
77 |
+
usort($items, function($a, $b) {
|
78 |
+
if (@$a['index'] == @$b['index']) {
|
79 |
+
return 0;
|
80 |
+
}
|
81 |
+
return @$a['index'] < @$b['index'] ? -1 : 1;
|
82 |
+
});
|
83 |
+
}
|
84 |
+
|
85 |
+
return $this;
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Return array [$items]
|
90 |
+
* @return array
|
91 |
+
*/
|
92 |
+
public function toArray()
|
93 |
+
{
|
94 |
+
return $this->items;
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Return array [$items]
|
99 |
+
* @return array
|
100 |
+
*/
|
101 |
+
public function jsonSerialize()
|
102 |
+
{
|
103 |
+
return $this->toArray();
|
104 |
+
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Getter to hook proxy call
|
108 |
+
* @return mixed
|
109 |
+
*/
|
110 |
+
public function __get($key)
|
111 |
+
{
|
112 |
+
if (in_array($key, ['general', 'advanced'])) {
|
113 |
+
return new GroupSetterProxy($this, $key);
|
114 |
+
}
|
115 |
+
}
|
116 |
+
}
|
app/Services/FormBuilder/Components/ActionHook.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services\FormBuilder\Components;
|
4 |
+
|
5 |
+
class ActionHook extends BaseComponent
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Compile and echo the html element
|
9 |
+
* @param array $data [element data]
|
10 |
+
* @param stdClass $form [Form Object]
|
11 |
+
* @return viod
|
12 |
+
*/
|
13 |
+
public function compile($data, $form)
|
14 |
+
{
|
15 |
+
$hasConditions = $this->hasConditions($data) ? 'has-conditions' : '';
|
16 |
+
|
17 |
+
$data['attributes']['class'] = trim(
|
18 |
+
$this->getDefaultContainerClass()
|
19 |
+
.' '. @$data['attributes']['class']
|
20 |
+
.' '. $hasConditions
|
21 |
+
);
|
22 |
+
|
23 |
+
$atts = $this->buildAttributes($data['attributes']);
|
24 |
+
|
25 |
+
echo "<div {$atts}>";
|
26 |
+
do_action($data['settings']['hook_name']);
|
27 |
+
echo"</div>";
|
28 |
+
}
|
29 |
+
}
|
app/Services/FormBuilder/Components/Address.php
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services\FormBuilder\Components;
|
4 |
+
|
5 |
+
class Address extends BaseComponent
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Wrapper class for address element
|
9 |
+
* @var string
|
10 |
+
*/
|
11 |
+
protected $wrapperClass = 'fluent-address';
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Compile and echo the html element
|
15 |
+
* @param array $data [element data]
|
16 |
+
* @param stdClass $form [Form Object]
|
17 |
+
* @return viod
|
18 |
+
*/
|
19 |
+
public function compile($data, $form)
|
20 |
+
{
|
21 |
+
$rootName = $data['attributes']['name'];
|
22 |
+
$hasConditions = $this->hasConditions($data) ? 'has-conditions' : '';
|
23 |
+
$data['attributes']['class'] .= ' ' . $this->wrapperClass . ' ' . $hasConditions;
|
24 |
+
$data['attributes']['class'] = trim($data['attributes']['class']);
|
25 |
+
$atts = $this->buildAttributes($data['attributes']);
|
26 |
+
echo "<div {$atts}>";
|
27 |
+
echo "<div class='ff-el-input--label'>";
|
28 |
+
echo "<label>{$data['settings']['label']}</label>";
|
29 |
+
echo "</div><div class='ff-el-input--content'>";
|
30 |
+
|
31 |
+
$visibleFields = array_chunk(array_filter($data['fields'], function($field) {
|
32 |
+
return $field['settings']['visible'];
|
33 |
+
}), 2);
|
34 |
+
|
35 |
+
foreach ($visibleFields as $chunked) {
|
36 |
+
echo "<div class='ff-t-container'>";
|
37 |
+
foreach ($chunked as $item) {
|
38 |
+
if($item['settings']['visible']) {
|
39 |
+
$itemName = $item['attributes']['name'];
|
40 |
+
$item['attributes']['name'] = $rootName.'['.$itemName.']';
|
41 |
+
$item = $this->app->applyFilters('before_render_item', $item, $form);
|
42 |
+
echo "<div class='ff-t-cell'>";
|
43 |
+
$this->app->doAction('render_item_'.$item['element'], $item, $form);
|
44 |
+
echo "</div>";
|
45 |
+
}
|
46 |
+
}
|
47 |
+
echo "</div>";
|
48 |
+
}
|
49 |
+
|
50 |
+
echo "</div>";
|
51 |
+
echo "</div>";
|
52 |
+
}
|
53 |
+
}
|
app/Services/FormBuilder/Components/BaseComponent.php
ADDED
@@ -0,0 +1,213 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services\FormBuilder\Components;
|
4 |
+
|
5 |
+
use FluentForm\App;
|
6 |
+
|
7 |
+
class BaseComponent
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* $app Application Instance
|
11 |
+
* @var Framework\Foundation\Application
|
12 |
+
*/
|
13 |
+
protected $app = null;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Construct the base component object
|
17 |
+
*/
|
18 |
+
public function __construct()
|
19 |
+
{
|
20 |
+
$this->app = App::make();
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Build unique ID concating form id and name attribute
|
25 |
+
* @param array $data $form
|
26 |
+
* @return string for id value
|
27 |
+
*/
|
28 |
+
protected function makeElementId($data, $form) {
|
29 |
+
if(isset($data['attributes']['name'])) {
|
30 |
+
return "ff_{$form->id}_{$data['attributes']['name']}";
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Build attributes for any html element
|
36 |
+
* @param array $attributes
|
37 |
+
* @return string [Compiled key='value' attributes]
|
38 |
+
*/
|
39 |
+
protected function buildAttributes($attributes, $form = null)
|
40 |
+
{
|
41 |
+
$atts = '';
|
42 |
+
foreach ($attributes as $key => $value) {
|
43 |
+
if($value) {
|
44 |
+
if($key == 'value') {
|
45 |
+
$value = apply_filters(
|
46 |
+
'fluentform_parse_default_value', $value, $form
|
47 |
+
);
|
48 |
+
}
|
49 |
+
|
50 |
+
$atts .= "{$key}='{$value}'";
|
51 |
+
}
|
52 |
+
}
|
53 |
+
return $atts;
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Extract value attribute from attribute list
|
58 |
+
* @param array &$element
|
59 |
+
* @return string
|
60 |
+
*/
|
61 |
+
protected function extractValueFromAttributes(&$element)
|
62 |
+
{
|
63 |
+
$value = $element['attributes']['value'];
|
64 |
+
unset($element['attributes']['value']);
|
65 |
+
return $value;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Determine if the given element has conditions bound
|
70 |
+
* @param array $element [Html element being compiled]
|
71 |
+
* @return boolean
|
72 |
+
*/
|
73 |
+
protected function hasConditions($element)
|
74 |
+
{
|
75 |
+
$conditionals = @$element['settings']['conditional_logics'];
|
76 |
+
return (@$conditionals['status'] && @$conditionals['conditions']);
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Generate a unique id for an element
|
81 |
+
* @param string $str [preix]
|
82 |
+
* @return string [Unique id]
|
83 |
+
*/
|
84 |
+
protected function getUniqueId($str)
|
85 |
+
{
|
86 |
+
return $str.'_'.md5(uniqid(mt_rand(), true));
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Get a default class for each form element wrapper
|
91 |
+
* @return string
|
92 |
+
*/
|
93 |
+
protected function getDefaultContainerClass()
|
94 |
+
{
|
95 |
+
return 'ff-el-group ';
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Get required class for form element wrapper
|
100 |
+
* @param array $rules [Validation rules]
|
101 |
+
* @return mixed
|
102 |
+
*/
|
103 |
+
protected function getRequiredClass($rules)
|
104 |
+
{
|
105 |
+
$required = $rules['required'];
|
106 |
+
if (isset($required)) {
|
107 |
+
return $required['value'] ? 'ff-el-is-required ' : '';
|
108 |
+
}
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Generate a label for any element
|
113 |
+
* @param array $data
|
114 |
+
* @return string [label Html element]
|
115 |
+
*/
|
116 |
+
protected function buildElementLabel($data) {
|
117 |
+
$markup = "<div class='%s'>
|
118 |
+
<label for='%s'>%s</label>
|
119 |
+
</div>";
|
120 |
+
|
121 |
+
$html = sprintf($markup,
|
122 |
+
trim('ff-el-input--label ' . $this->getRequiredClass($data['settings']['validation_rules'])),
|
123 |
+
$data['attributes']['id'],
|
124 |
+
$data['settings']['label']
|
125 |
+
);
|
126 |
+
return $html;
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Generate html/markup for any element
|
131 |
+
* @param string $elMarkup [Predifined partial markup]
|
132 |
+
* @param array $data
|
133 |
+
* @param StdClass $form [Form object]
|
134 |
+
* @return string [Compiled markup]
|
135 |
+
*/
|
136 |
+
protected function buildElementMarkup($elMarkup, $data, $form)
|
137 |
+
{
|
138 |
+
$hasConditions = $this->hasConditions($data) ? 'has-conditions ' : '';
|
139 |
+
$labelPlacementClass = isset($data['settings']['label_placement'])
|
140 |
+
? 'ff-el-form-' . $data['settings']['label_placement'] . ' '
|
141 |
+
: '';
|
142 |
+
$labelClass = trim(
|
143 |
+
'ff-el-input--label ' .
|
144 |
+
$this->getRequiredClass($data['settings']['validation_rules'])
|
145 |
+
);
|
146 |
+
$formGroupClass = trim(
|
147 |
+
$this->getDefaultContainerClass().
|
148 |
+
$labelPlacementClass.
|
149 |
+
$hasConditions.
|
150 |
+
@$data['settings']['container_class']
|
151 |
+
);
|
152 |
+
|
153 |
+
$labelHelpText = $inputHelpText = '';
|
154 |
+
if($form->settings['layout']['helpMessagePlacement'] == 'with_label') {
|
155 |
+
$labelHelpText = $this->getLabelHelpMessage($data);
|
156 |
+
} else {
|
157 |
+
$inputHelpText = $this->getInputHelpMessage($data);
|
158 |
+
}
|
159 |
+
|
160 |
+
$forStr = '';
|
161 |
+
if (isset($data['attributes']['id'])) {
|
162 |
+
$forStr = "for='{$data['attributes']['id']}'";
|
163 |
+
}
|
164 |
+
|
165 |
+
$labelMarkup = '';
|
166 |
+
if (!empty($data['settings']['label'])) {
|
167 |
+
$labelMarkup = "<div class='%s'><label %s>%s</label> {$labelHelpText}</div>";
|
168 |
+
}
|
169 |
+
|
170 |
+
$markup = "<div class='%s'>
|
171 |
+
{$labelMarkup}
|
172 |
+
<div class='ff-el-input--content'>
|
173 |
+
{$elMarkup}{$inputHelpText}
|
174 |
+
</div>
|
175 |
+
</div>";
|
176 |
+
|
177 |
+
$html = sprintf($markup,
|
178 |
+
$formGroupClass,
|
179 |
+
$labelClass,
|
180 |
+
$forStr,
|
181 |
+
@$data['settings']['label']
|
182 |
+
);
|
183 |
+
|
184 |
+
return $html;
|
185 |
+
}
|
186 |
+
|
187 |
+
/**
|
188 |
+
* Generate a help message for any element beside label
|
189 |
+
* @param array $data
|
190 |
+
* @return string [Html]
|
191 |
+
*/
|
192 |
+
protected function getLabelHelpMessage($data)
|
193 |
+
{
|
194 |
+
if(isset($data['settings']['help_message']) && $data['settings']['help_message'] != '') {
|
195 |
+
return "<div class='ff-el-tooltip' data-content='{$data['settings']['help_message']}'>
|
196 |
+
<i class='icon-info-circle'></i>
|
197 |
+
</div>";
|
198 |
+
}
|
199 |
+
}
|
200 |
+
|
201 |
+
/**
|
202 |
+
* Generate a help message for any element beside form element
|
203 |
+
* @param array $data
|
204 |
+
* @return string [Html]
|
205 |
+
*/
|
206 |
+
protected function getInputHelpMessage($data)
|
207 |
+
{
|
208 |
+
if (isset($data['settings']['help_message'])) {
|
209 |
+
return "<div class='ff-el-help-message'>{$data['settings']['help_message']}</div>";
|
210 |
+
}
|
211 |
+
return false;
|
212 |
+
}
|
213 |
+
}
|
app/Services/FormBuilder/Components/Checkable.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services\FormBuilder\Components;
|
4 |
+
|
5 |
+
class Checkable extends BaseComponent
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Compile and echo the html element
|
9 |
+
* @param array $data [element data]
|
10 |
+
* @param stdClass $form [Form Object]
|
11 |
+
* @return viod
|
12 |
+
*/
|
13 |
+
public function compile($data, $form)
|
14 |
+
{
|
15 |
+
$data['attributes']['class'] = trim(
|
16 |
+
'ff-el-form-check-input '.
|
17 |
+
@$data['attributes']['class']
|
18 |
+
);
|
19 |
+
|
20 |
+
if ($data['attributes']['type'] == 'checkbox') {
|
21 |
+
$data['attributes']['name'] = $data['attributes']['name'].'[]';
|
22 |
+
}
|
23 |
+
|
24 |
+
$defaultValues = (array) $this->extractValueFromAttributes($data);
|
25 |
+
|
26 |
+
$elMarkup = '';
|
27 |
+
foreach ($data['options'] as $value => $label) {
|
28 |
+
|
29 |
+
if(in_array($value, $defaultValues)) {
|
30 |
+
$data['attributes']['checked'] = true;
|
31 |
+
} else {
|
32 |
+
$data['attributes']['checked'] = false;
|
33 |
+
}
|
34 |
+
|
35 |
+
$atts = $this->buildAttributes($data['attributes']);
|
36 |
+
$id = $this->getUniqueid(str_replace(['[', ']'], ['', ''], $data['attributes']['name']));
|
37 |
+
$displayType = isset($data['settings']['display_type']) ? ' ff-el-form-check-'.$data['settings']['display_type'] : '';
|
38 |
+
|
39 |
+
$elMarkup .= "<div class='ff-el-form-check{$displayType}'>";
|
40 |
+
$elMarkup .= "<label class='ff-el-form-check-label' for={$id}><input {$atts} id={$id} value={$value}> {$label}</label>";
|
41 |
+
$elMarkup .= "</div>";
|
42 |
+
}
|
43 |
+
|
44 |
+
echo $this->buildElementMarkup($elMarkup, $data, $form);
|
45 |
+
}
|
46 |
+
}
|
app/Services/FormBuilder/Components/Container.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services\FormBuilder\Components;
|
4 |
+
|
5 |
+
class Container extends BaseComponent
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Max columns for container
|
9 |
+
* @var integer
|
10 |
+
*/
|
11 |
+
protected $maxColumns = 12;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Container column class
|
15 |
+
* @var string
|
16 |
+
*/
|
17 |
+
protected $columnClass = 'ff-t-cell';
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Container wrapper class
|
21 |
+
* @var string
|
22 |
+
*/
|
23 |
+
protected $wrapperClass = 'ff-t-container';
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Compile and echo the html element
|
27 |
+
* @param array $data [element data]
|
28 |
+
* @param stdClass $form [Form Object]
|
29 |
+
* @return viod
|
30 |
+
*/
|
31 |
+
public function compile($data, $form)
|
32 |
+
{
|
33 |
+
$columnClass = $this->columnClass;
|
34 |
+
echo "<div class='{$this->wrapperClass}'>";
|
35 |
+
if (isset($data['settings']['label'])) {
|
36 |
+
echo "<strong>{$data['settings']['label']}</strong>";
|
37 |
+
}
|
38 |
+
foreach ($data['columns'] as $column) {
|
39 |
+
echo "<div class='{$columnClass}'>";
|
40 |
+
foreach ($column['fields'] as $item) {
|
41 |
+
$item = $this->app->applyFilters('before_render_item', $item, $form);
|
42 |
+
$this->app->doAction('render_item_'.$item['element'], $item, $form);
|
43 |
+
}
|
44 |
+
echo "</div>";
|
45 |
+
}
|
46 |
+
echo "</div>";
|
47 |
+
}
|
48 |
+
}
|
app/Services/FormBuilder/Components/CustomHtml.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services\FormBuilder\Components;
|
4 |
+
|
5 |
+
class CustomHtml extends BaseComponent
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Compile and echo the html element
|
9 |
+
* @param array $data [element data]
|
10 |
+
* @param stdClass $form [Form Object]
|
11 |
+
* @return viod
|
12 |
+
*/
|
13 |
+
public function compile($data, $form)
|
14 |
+
{
|
15 |
+
$hasConditions = $this->hasConditions($data) ? 'has-conditions' : '';
|
16 |
+
$cls = trim($this->getDefaultContainerClass() .' '.$hasConditions);
|
17 |
+
echo "<div class='{$cls}'>{$data['settings']['html_codes']}</div>";
|
18 |
+
}
|
19 |
+
}
|
app/Services/FormBuilder/Components/DateTime.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services\FormBuilder\Components;
|
4 |
+
|
5 |
+
class DateTime extends BaseComponent
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Compile and echo the html element
|
9 |
+
* @param array $data [element data]
|
10 |
+
* @param stdClass $form [Form Object]
|
11 |
+
* @return viod
|
12 |
+
*/
|
13 |
+
public function compile($data, $form)
|
14 |
+
{
|
15 |
+
$this->enqueueStyleAndScripts();
|
16 |
+
|
17 |
+
$data['attributes']['class'] = trim(
|
18 |
+
'ff-el-form-control '. $data['attributes']['class']
|
19 |
+
);
|
20 |
+
$data['attributes']['id'] = $this->makeElementId($data, $form);
|
21 |
+
|
22 |
+
$elMarkup = "<input data-type-datepicker data-format='%s' %s>";
|
23 |
+
|
24 |
+
$elMarkup = sprintf(
|
25 |
+
$elMarkup,
|
26 |
+
$data['settings']['date_format'],
|
27 |
+
$this->buildAttributes($data['attributes'])
|
28 |
+
);
|
29 |
+
|
30 |
+
echo $this->buildElementMarkup($elMarkup, $data, $form);
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Enqueue style and script for datetime element
|
35 |
+
* @return void
|
36 |
+
*/
|
37 |
+
protected function enqueueStyleAndScripts()
|
38 |
+
{
|
39 |
+
// Style
|
40 |
+
wp_enqueue_style(
|
41 |
+
'jquery-datetimepicker',
|
42 |
+
$this->app->publicUrl('libs/jquery-datetimepicker/jquery.datetimepicker.min.css')
|
43 |
+
);
|
44 |
+
|
45 |
+
// Script
|
46 |
+
wp_enqueue_script(
|
47 |
+
'jquery-datetimepicker',
|
48 |
+
$this->app->publicUrl('libs/jquery-datetimepicker/jquery.datetimepicker.full.min.js'),
|
49 |
+
array('jquery'),
|
50 |
+
false,
|
51 |
+
true
|
52 |
+
);
|
53 |
+
}
|
54 |
+
}
|
app/Services/FormBuilder/Components/FormStep.php
ADDED
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services\FormBuilder\Components;
|
4 |
+
|
5 |
+
class FormStep extends BaseComponent
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Compile and echo step header
|
9 |
+
* @param array $data [element data]
|
10 |
+
* @param stdClass $form [Form Object]
|
11 |
+
* @return viod
|
12 |
+
*/
|
13 |
+
public function stepStart($data, $form)
|
14 |
+
{
|
15 |
+
if (!$data) return;
|
16 |
+
|
17 |
+
if ($data['settings']['progress_indicator'] == 'steps') {
|
18 |
+
$nav = "<ul class='ff-step-titles'><li><span>".implode('</span></li><li><span>', $data['settings']['step_titles'])."</span></li></ul>";
|
19 |
+
} elseif ($data['settings']['progress_indicator'] == 'progress-bar') {
|
20 |
+
$nav = "<div class='ff-el-progress-status'></div>
|
21 |
+
<div class='ff-el-progress'>
|
22 |
+
<div class='ff-el-progress-bar'><span></span></div>
|
23 |
+
</div>
|
24 |
+
<ul class='ff-el-progress-title'>
|
25 |
+
<li>".implode('</li><li>', $data['settings']['step_titles'])."</li>
|
26 |
+
</ul>";
|
27 |
+
} else {
|
28 |
+
$nav = '';
|
29 |
+
}
|
30 |
+
|
31 |
+
echo "<div class='ff-step-container'>";
|
32 |
+
if ($nav) {
|
33 |
+
echo "<div class='ff-step-header'>{$nav}</div>";
|
34 |
+
}
|
35 |
+
|
36 |
+
echo "<div class='ff-step-body'>";
|
37 |
+
$data['attributes']['class'] .= ' fluentform-step';
|
38 |
+
$data['attributes']['class'] = trim($data['attributes']['class']);
|
39 |
+
$atts = $this->buildAttributes($data['attributes']);
|
40 |
+
echo "<div {$atts}>";
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Compile and echo the html element
|
45 |
+
* @param array $data [element data]
|
46 |
+
* @param stdClass $form [Form Object]
|
47 |
+
* @return viod
|
48 |
+
*/
|
49 |
+
public function compile($data, $form)
|
50 |
+
{
|
51 |
+
echo $this->compileButtons($data['settings']);
|
52 |
+
$data['attributes']['class'] .= ' fluentform-step';
|
53 |
+
$atts = $this->buildAttributes($data['attributes']);
|
54 |
+
echo "</div><div {$atts}>";
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Compile and echo step footer
|
59 |
+
* @param array $data [element data]
|
60 |
+
* @param stdClass $form [Form Object]
|
61 |
+
* @return viod
|
62 |
+
*/
|
63 |
+
public function stepEnd($data, $form)
|
64 |
+
{
|
65 |
+
$btnPrev = $this->compileButtons($data['settings']);
|
66 |
+
echo "{$btnPrev}</div></div></div>";
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Compile next and prev buttons
|
71 |
+
* @param array $data [element data]
|
72 |
+
* @return viod
|
73 |
+
*/
|
74 |
+
protected function compileButtons($data)
|
75 |
+
{
|
76 |
+
$btnPrev = $btnNext = '';
|
77 |
+
$prev = isset($data['prev_btn']) ? $data['prev_btn'] : null;
|
78 |
+
$next = isset($data['next_btn']) ? $data['next_btn'] : null;
|
79 |
+
|
80 |
+
if ($prev) {
|
81 |
+
if ($prev['type'] == 'default') {
|
82 |
+
$btnPrev = "<button type='button' data-action='prev' class='ff-btn ff-btn-secondary'>".$prev['text']."</button>";
|
83 |
+
} else {
|
84 |
+
$btnPrev = "<img class='prev' src={$prev['url']}>";
|
85 |
+
}
|
86 |
+
}
|
87 |
+
|
88 |
+
if ($next) {
|
89 |
+
if ($next['type'] == 'default') {
|
90 |
+
$btnNext = "<button type='button' data-action='next' class='ff-float-right ff-btn ff-btn-secondary'>".$next['text']."</button>";
|
91 |
+
} else {
|
92 |
+
$btnNext = "<img class='next' src={$next['url']}>";
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
+
return "<div class='step-nav'>{$btnPrev}{$btnNext}</div>";
|
97 |
+
}
|
98 |
+
}
|
app/Services/FormBuilder/Components/Name.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services\FormBuilder\Components;
|
4 |
+
|
5 |
+
class Name extends BaseComponent
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Compile and echo the html element
|
9 |
+
* @param array $data [element data]
|
10 |
+
* @param stdClass $form [Form Object]
|
11 |
+
* @return viod
|
12 |
+
*/
|
13 |
+
public function compile($data, $form)
|
14 |
+
{
|
15 |
+
$rootName = $data['attributes']['name'];
|
16 |
+
$hasConditions = $this->hasConditions($data) ? 'has-conditions' : '';
|
17 |
+
@$data['attributes']['class'] .= $hasConditions;
|
18 |
+
$atts = $this->buildAttributes($data['attributes']);
|
19 |
+
|
20 |
+
echo "<div {$atts}>";
|
21 |
+
echo "<div class='ff-t-container'>";
|
22 |
+
|
23 |
+
foreach ($data['fields'] as $field) {
|
24 |
+
if($field['settings']['visible']) {
|
25 |
+
$fieldName = $field['attributes']['name'];
|
26 |
+
$field['attributes']['name'] = $rootName.'['.$fieldName.']';
|
27 |
+
@$field['attributes']['class'] = trim(
|
28 |
+
'ff-el-form-control '.
|
29 |
+
$field['attributes']['class']
|
30 |
+
);
|
31 |
+
$field['attributes']['id'] = $this->makeElementId($field, $form);
|
32 |
+
|
33 |
+
$elMarkup = "<input %s>";
|
34 |
+
$elMarkup = sprintf($elMarkup, $this->buildAttributes($field['attributes']));
|
35 |
+
|
36 |
+
$inputTextMarkup = $this->buildElementMarkup($elMarkup, $field, $form);
|
37 |
+
echo sprintf("<div class='%s'>{$inputTextMarkup}</div>",
|
38 |
+
'ff-t-cell'
|
39 |
+
);
|
40 |
+
}
|
41 |
+
}
|
42 |
+
echo"</div>";
|
43 |
+
echo"</div>";
|
44 |
+
}
|
45 |
+
}
|
app/Services/FormBuilder/Components/Recaptcha.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services\FormBuilder\Components;
|
4 |
+
|
5 |
+
class Recaptcha extends BaseComponent
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Compile and echo the html element
|
9 |
+
* @param array $data [element data]
|
10 |
+
* @param stdClass $form [Form Object]
|
11 |
+
* @return viod
|
12 |
+
*/
|
13 |
+
public function compile($data, $form)
|
14 |
+
{
|
15 |
+
wp_enqueue_script(
|
16 |
+
'recaptcha',
|
17 |
+
'https://www.google.com/recaptcha/api.js',
|
18 |
+
array(),
|
19 |
+
false,
|
20 |
+
true
|
21 |
+
);
|
22 |
+
|
23 |
+
$key = get_option('_fluentform_reCaptcha_details');
|
24 |
+
if($key && isset($key['siteKey'])) {
|
25 |
+
$siteKey = $key['siteKey'];
|
26 |
+
} else {
|
27 |
+
$siteKey = '';
|
28 |
+
}
|
29 |
+
$recaptchaBlock = "<div class='g-recaptcha' data-sitekey='{$siteKey}'></div>";
|
30 |
+
|
31 |
+
$label = '';
|
32 |
+
if (!empty($data['settings']['label'])) {
|
33 |
+
$label = "<div class='ff-el-input--label'><label>{$data['settings']['label']}</label></div>";
|
34 |
+
}
|
35 |
+
|
36 |
+
$el = "<div class='ff-el-input--content'><div name='g-recaptcha-response'>{$recaptchaBlock}</div></div>";
|
37 |
+
echo "<div class='ff-el-group'>{$label}{$el}</div>";
|
38 |
+
}
|
39 |
+
}
|
app/Services/FormBuilder/Components/Repeat.php
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services\FormBuilder\Components;
|
4 |
+
|
5 |
+
class Repeat extends BaseComponent
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Wrapper class for repeat element
|
9 |
+
* @var string
|
10 |
+
*/
|
11 |
+
protected $wrapperClass = 'ff-el-repeat';
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Compile and echo the html element
|
15 |
+
* @param array $data [element data]
|
16 |
+
* @param stdClass $form [Form Object]
|
17 |
+
* @return viod
|
18 |
+
*/
|
19 |
+
public function compile($data, $form)
|
20 |
+
{
|
21 |
+
$rootName = $data['attributes']['name'];
|
22 |
+
$elMarkup = "<div class='ff-el-repeat-content'>
|
23 |
+
<input %s>%s
|
24 |
+
</div>";
|
25 |
+
|
26 |
+
foreach ($data['fields'] as &$innerItem) {
|
27 |
+
$itemName = $innerItem['attributes']['name'];
|
28 |
+
$innerItem['attributes']['name'] = $rootName.'[]';
|
29 |
+
@$innerItem['attributes']['class'] = trim(
|
30 |
+
'ff-el-form-control '.
|
31 |
+
$innerItem['attributes']['class']
|
32 |
+
);
|
33 |
+
$elMarkup = sprintf(
|
34 |
+
$elMarkup,
|
35 |
+
$this->buildAttributes($innerItem['attributes']),
|
36 |
+
$this->getRepeater($data['element'])
|
37 |
+
);
|
38 |
+
|
39 |
+
echo $this->buildElementMarkup($elMarkup, $innerItem, $form);
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Compile repeater buttons
|
45 |
+
* @param string $el [element name]
|
46 |
+
* @return string
|
47 |
+
*/
|
48 |
+
protected function getRepeater($el)
|
49 |
+
{
|
50 |
+
if ($el == 'input_repeat') {
|
51 |
+
$div = '<div class="ff-el-repeat-buttons">';
|
52 |
+
$div .= '<span class="repeat-plus icon-plus-circle"></span>';
|
53 |
+
$div .= '<span class="first repeat-minus icon-minus-circle"></span></div>';
|
54 |
+
return $div;
|
55 |
+
}
|
56 |
+
return '';
|
57 |
+
}
|
58 |
+
}
|
app/Services/FormBuilder/Components/SectionBreak.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services\FormBuilder\Components;
|
4 |
+
|
5 |
+
class SectionBreak extends BaseComponent
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Compile and echo the html element
|
9 |
+
* @param array $data [element data]
|
10 |
+
* @param stdClass $form [Form Object]
|
11 |
+
* @return viod
|
12 |
+
*/
|
13 |
+
public function compile($data, $form)
|
14 |
+
{
|
15 |
+
$hasConditions = $this->hasConditions($data) ? 'has-conditions' : '';
|
16 |
+
$cls = trim($this->getDefaultContainerClass().' '.$hasConditions);
|
17 |
+
$data['attributes']['class'] = $cls .' '. $data['attributes']['class'];
|
18 |
+
$data['attributes']['class'] = trim($data['attributes']['class']);
|
19 |
+
$atts = $this->buildAttributes($data['attributes']);
|
20 |
+
echo "<div {$atts}>";
|
21 |
+
echo "<label>{$data['settings']['label']}</label>";
|
22 |
+
echo "<div>{$data['settings']['description']}</div>";
|
23 |
+
echo "</div>";
|
24 |
+
}
|
25 |
+
}
|
app/Services/FormBuilder/Components/Select.php
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services\FormBuilder\Components;
|
4 |
+
|
5 |
+
class Select extends BaseComponent
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Compile and echo the html element
|
9 |
+
* @param array $data [element data]
|
10 |
+
* @param stdClass $form [Form Object]
|
11 |
+
* @return viod
|
12 |
+
*/
|
13 |
+
public function compile($data, $form)
|
14 |
+
{
|
15 |
+
$data['attributes']['id'] = $this->makeElementId($data, $form);
|
16 |
+
|
17 |
+
if (@$data['attributes']['multiple']) {
|
18 |
+
$data['attributes']['name'] = $data['attributes']['name'].'[]';
|
19 |
+
}
|
20 |
+
|
21 |
+
$data['attributes']['class'] = trim('ff-el-form-control ' . $data['attributes']['class']);
|
22 |
+
|
23 |
+
$defaultValues = (array) $this->extractValueFromAttributes($data);
|
24 |
+
|
25 |
+
$elMarkup = "<select %s>%s</select>";
|
26 |
+
$elMarkup = sprintf(
|
27 |
+
$elMarkup,
|
28 |
+
$this->buildAttributes($data['attributes']),
|
29 |
+
$this->buildOptions($data['options'], $defaultValues)
|
30 |
+
);
|
31 |
+
|
32 |
+
echo $this->buildElementMarkup($elMarkup, $data, $form);
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Build options for select
|
37 |
+
* @param array $options
|
38 |
+
* @return string/html [compiled options]
|
39 |
+
*/
|
40 |
+
protected function buildOptions($options, $defaultValues)
|
41 |
+
{
|
42 |
+
$opts = '';
|
43 |
+
foreach ($options as $value => $label) {
|
44 |
+
if(in_array($value, $defaultValues)) {
|
45 |
+
$selected = 'selected';
|
46 |
+
} else {
|
47 |
+
$selected = '';
|
48 |
+
}
|
49 |
+
$opts .="<option value='{$value}' {$selected}>{$label}</option>";
|
50 |
+
}
|
51 |
+
return $opts;
|
52 |
+
}
|
53 |
+
}
|
app/Services/FormBuilder/Components/SelectCountry.php
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services\FormBuilder\Components;
|
4 |
+
|
5 |
+
use FluentForm\App;
|
6 |
+
|
7 |
+
class SelectCountry extends BaseComponent
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* Compile and echo the html element
|
11 |
+
* @param array $data [element data]
|
12 |
+
* @param stdClass $form [Form Object]
|
13 |
+
* @return viod
|
14 |
+
*/
|
15 |
+
public function compile($data, $form)
|
16 |
+
{
|
17 |
+
$data = $this->loadCountries($data);
|
18 |
+
$defaultValues = (array) $this->extractValueFromAttributes($data);
|
19 |
+
$data['attributes']['class'] = trim('ff-el-form-control ' . $data['attributes']['class']);
|
20 |
+
$data['attributes']['id'] = $this->makeElementId($data, $form);
|
21 |
+
|
22 |
+
$elMarkup = "<select %s>%s</select>";
|
23 |
+
$elMarkup = sprintf(
|
24 |
+
$elMarkup,
|
25 |
+
$this->buildAttributes($data['attributes']),
|
26 |
+
$this->buildOptions($data['options'], $defaultValues)
|
27 |
+
);
|
28 |
+
|
29 |
+
echo $this->buildElementMarkup($elMarkup, $data, $form);
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Load countt list from file
|
34 |
+
* @param array $data
|
35 |
+
* @return array
|
36 |
+
*/
|
37 |
+
protected function loadCountries($data)
|
38 |
+
{
|
39 |
+
$app = App::make();
|
40 |
+
$data['options'] = array();
|
41 |
+
$activeList = $data['settings']['country_list']['active_list'];
|
42 |
+
$countries = $app->load($app->appPath('Services/FormBuilder/CountryNames.php'));
|
43 |
+
|
44 |
+
if ($activeList == 'all') {
|
45 |
+
$data['options'] = $countries;
|
46 |
+
} elseif ($activeList == 'visible_list') {
|
47 |
+
foreach ($data['settings']['country_list'][$activeList] as $value) {
|
48 |
+
$data['options'][$value] = $countries[$value];
|
49 |
+
}
|
50 |
+
} elseif ($activeList == 'hidden_list') {
|
51 |
+
$data['options'] = $countries;
|
52 |
+
foreach ($data['settings']['country_list'][$activeList] as $value) {
|
53 |
+
unset($data['options'][$value]);
|
54 |
+
}
|
55 |
+
}
|
56 |
+
|
57 |
+
$data['options'] = array_merge(['' => 'None'], $data['options']);
|
58 |
+
|
59 |
+
return $data;
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Build options for country list/select
|
64 |
+
* @param array $options
|
65 |
+
* @return string/html [compiled options]
|
66 |
+
*/
|
67 |
+
protected function buildOptions($options, $defaultValues)
|
68 |
+
{
|
69 |
+
$opts = '';
|
70 |
+
foreach ($options as $value => $label) {
|
71 |
+
if(in_array($value, $defaultValues)) {
|
72 |
+
$selected = 'selected';
|
73 |
+
} else {
|
74 |
+
$selected = '';
|
75 |
+
}
|
76 |
+
$opts .="<option value='{$value}' {$selected}>{$label}</option>";
|
77 |
+
}
|
78 |
+
return $opts;
|
79 |
+
}
|
80 |
+
}
|
app/Services/FormBuilder/Components/Shortcode.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services\FormBuilder\Components;
|
4 |
+
|
5 |
+
class Shortcode extends BaseComponent
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Compile and echo the html element
|
9 |
+
* @param array $data [element data]
|
10 |
+
* @param stdClass $form [Form Object]
|
11 |
+
* @return viod
|
12 |
+
*/
|
13 |
+
public function compile($data, $form)
|
14 |
+
{
|
15 |
+
$hasConditions = $this->hasConditions($data) ? 'has-conditions' : '';
|
16 |
+
|
17 |
+
$data['attributes']['class'] = trim(
|
18 |
+
$this->getDefaultContainerClass()
|
19 |
+
.' '. @$data['attributes']['class']
|
20 |
+
.' '. $hasConditions
|
21 |
+
);
|
22 |
+
|
23 |
+
$atts = $this->buildAttributes($data['attributes']);
|
24 |
+
|
25 |
+
echo "<div {$atts}>".do_shortcode($data['settings']['shortcode'])."</div>";
|
26 |
+
}
|
27 |
+
}
|
app/Services/FormBuilder/Components/SubmitButton.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services\FormBuilder\Components;
|
4 |
+
|
5 |
+
class SubmitButton extends BaseComponent
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Compile and echo the html element
|
9 |
+
* @param array $data [element data]
|
10 |
+
* @param stdClass $form [Form Object]
|
11 |
+
* @return viod
|
12 |
+
*/
|
13 |
+
public function compile($data, $form)
|
14 |
+
{
|
15 |
+
$align = 'ff-text-'.$data['settings']['align'];
|
16 |
+
$data['attributes']['class'] = trim(
|
17 |
+
'ff-btn ff-btn-primary ' .
|
18 |
+
$data['attributes']['class']
|
19 |
+
);
|
20 |
+
$atts = $this->buildAttributes($data['attributes']);
|
21 |
+
$cls = trim($align.' '.$data['settings']['container_class']);
|
22 |
+
echo "<div class='{$cls}'>";
|
23 |
+
echo '<button '.$atts.'>'.$data['settings']['btn_text'].'</button>';
|
24 |
+
echo '</div>';
|
25 |
+
}
|
26 |
+
}
|
app/Services/FormBuilder/Components/TermsAndConditions.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services\FormBuilder\Components;
|
4 |
+
|
5 |
+
class TermsAndConditions extends BaseComponent
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Compile and echo the html element
|
9 |
+
* @param array $data [element data]
|
10 |
+
* @param stdClass $form [Form Object]
|
11 |
+
* @return viod
|
12 |
+
*/
|
13 |
+
public function compile($data, $form)
|
14 |
+
{
|
15 |
+
$hasConditions = $this->hasConditions($data) ? 'has-conditions' : '';
|
16 |
+
|
17 |
+
$cls = trim(
|
18 |
+
$this->getDefaultContainerClass()
|
19 |
+
.' '. @$data['settings']['container_class']
|
20 |
+
.' '. $hasConditions
|
21 |
+
);
|
22 |
+
|
23 |
+
$uniqueId = $this->getUniqueId($data['attributes']['name']);
|
24 |
+
|
25 |
+
$data['attributes']['id'] = $uniqueId;
|
26 |
+
$data['attributes']['class'] = trim(
|
27 |
+
'ff-el-form-check-input ' .
|
28 |
+
$data['attributes']['class']
|
29 |
+
);
|
30 |
+
|
31 |
+
$atts = $this->buildAttributes($data['attributes']);
|
32 |
+
|
33 |
+
echo "<div class='{$cls}'>";
|
34 |
+
echo "<div class='ff-el-form-check'>";
|
35 |
+
echo "<label class='ff-el-form-check-label' for={$uniqueId}>";
|
36 |
+
echo "<input {$atts}>{$data['settings']['tnc_html']}";
|
37 |
+
echo "</label>";
|
38 |
+
echo "</div>";
|
39 |
+
echo "</div>";
|
40 |
+
}
|
41 |
+
}
|
app/Services/FormBuilder/Components/Text.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services\FormBuilder\Components;
|
4 |
+
|
5 |
+
class Text extends BaseComponent
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Compile and echo the html element
|
9 |
+
* @param array $data [element data]
|
10 |
+
* @param stdClass $form [Form Object]
|
11 |
+
* @return viod
|
12 |
+
*/
|
13 |
+
public function compile($data, $form)
|
14 |
+
{
|
15 |
+
// For hidden input
|
16 |
+
if ($data['attributes']['type'] == 'hidden') {
|
17 |
+
echo "<input ".$this->buildAttributes($data['attributes'], $form).">";
|
18 |
+
return;
|
19 |
+
}
|
20 |
+
|
21 |
+
$data['attributes']['class'] = @trim('ff-el-form-control '. $data['attributes']['class']);
|
22 |
+
$data['attributes']['id'] = $this->makeElementId($data, $form);
|
23 |
+
|
24 |
+
$elMarkup = "<input %s>";
|
25 |
+
|
26 |
+
$elMarkup = sprintf($elMarkup, $this->buildAttributes($data['attributes'], $form));
|
27 |
+
|
28 |
+
echo $this->buildElementMarkup($elMarkup, $data, $form);
|
29 |
+
}
|
30 |
+
}
|
app/Services/FormBuilder/Components/TextArea.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services\FormBuilder\Components;
|
4 |
+
|
5 |
+
class TextArea extends BaseComponent
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Compile and echo the html element
|
9 |
+
* @param array $data [element data]
|
10 |
+
* @param stdClass $form [Form Object]
|
11 |
+
* @return viod
|
12 |
+
*/
|
13 |
+
public function compile($data, $form)
|
14 |
+
{
|
15 |
+
$textareaValue = $this->extractValueFromAttributes($data);
|
16 |
+
$textareaValue = apply_filters(
|
17 |
+
'fluentform_parse_default_value', $textareaValue, $form
|
18 |
+
);
|
19 |
+
|
20 |
+
$data['attributes']['class'] = trim('ff-el-form-control '. $data['attributes']['class']);
|
21 |
+
$data['attributes']['id'] = $this->makeElementId($data, $form);
|
22 |
+
|
23 |
+
$elMarkup = "<textarea %s>%s</textarea>";
|
24 |
+
|
25 |
+
$elMarkup = sprintf($elMarkup,
|
26 |
+
$this->buildAttributes($data['attributes']),
|
27 |
+
$textareaValue
|
28 |
+
);
|
29 |
+
|
30 |
+
echo $this->buildElementMarkup($elMarkup, $data, $form);
|
31 |
+
}
|
32 |
+
}
|
app/Services/FormBuilder/CountryNames.php
ADDED
@@ -0,0 +1,269 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Countries
|
4 |
+
*
|
5 |
+
* Returns an array of countries and codes.
|
6 |
+
*
|
7 |
+
* @author WooThemes
|
8 |
+
* @category i18n
|
9 |
+
* @package fluentform/i18n
|
10 |
+
* @version 2.5.0
|
11 |
+
*/
|
12 |
+
|
13 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
14 |
+
exit;
|
15 |
+
}
|
16 |
+
|
17 |
+
$country_names = array(
|
18 |
+
'AF' => __( 'Afghanistan', 'fluentform' ),
|
19 |
+
'AX' => __( 'Åland Islands', 'fluentform' ),
|
20 |
+
'AL' => __( 'Albania', 'fluentform' ),
|
21 |
+
'DZ' => __( 'Algeria', 'fluentform' ),
|
22 |
+
'AS' => __( 'American Samoa', 'fluentform' ),
|
23 |
+
'AD' => __( 'Andorra', 'fluentform' ),
|
24 |
+
'AO' => __( 'Angola', 'fluentform' ),
|
25 |
+
'AI' => __( 'Anguilla', 'fluentform' ),
|
26 |
+
'AQ' => __( 'Antarctica', 'fluentform' ),
|
27 |
+
'AG' => __( 'Antigua and Barbuda', 'fluentform' ),
|
28 |
+
'AR' => __( 'Argentina', 'fluentform' ),
|
29 |
+
'AM' => __( 'Armenia', 'fluentform' ),
|
30 |
+
'AW' => __( 'Aruba', 'fluentform' ),
|
31 |
+
'AU' => __( 'Australia', 'fluentform' ),
|
32 |
+
'AT' => __( 'Austria', 'fluentform' ),
|
33 |
+
'AZ' => __( 'Azerbaijan', 'fluentform' ),
|
34 |
+
'BS' => __( 'Bahamas', 'fluentform' ),
|
35 |
+
'BH' => __( 'Bahrain', 'fluentform' ),
|
36 |
+
'BD' => __( 'Bangladesh', 'fluentform' ),
|
37 |
+
'BB' => __( 'Barbados', 'fluentform' ),
|
38 |
+
'BY' => __( 'Belarus', 'fluentform' ),
|
39 |
+
'BE' => __( 'Belgium', 'fluentform' ),
|
40 |
+
'PW' => __( 'Belau', 'fluentform' ),
|
41 |
+
'BZ' => __( 'Belize', 'fluentform' ),
|
42 |
+
'BJ' => __( 'Benin', 'fluentform' ),
|
43 |
+
'BM' => __( 'Bermuda', 'fluentform' ),
|
44 |
+
'BT' => __( 'Bhutan', 'fluentform' ),
|
45 |
+
'BO' => __( 'Bolivia', 'fluentform' ),
|
46 |
+
'BQ' => __( 'Bonaire, Saint Eustatius and Saba', 'fluentform' ),
|
47 |
+
'BA' => __( 'Bosnia and Herzegovina', 'fluentform' ),
|
48 |
+
'BW' => __( 'Botswana', 'fluentform' ),
|
49 |
+
'BV' => __( 'Bouvet Island', 'fluentform' ),
|
50 |
+
'BR' => __( 'Brazil', 'fluentform' ),
|
51 |
+
'IO' => __( 'British Indian Ocean Territory', 'fluentform' ),
|
52 |
+
'VG' => __( 'British Virgin Islands', 'fluentform' ),
|
53 |
+
'BN' => __( 'Brunei', 'fluentform' ),
|
54 |
+
'BG' => __( 'Bulgaria', 'fluentform' ),
|
55 |
+
'BF' => __( 'Burkina Faso', 'fluentform' ),
|
56 |
+
'BI' => __( 'Burundi', 'fluentform' ),
|
57 |
+
'KH' => __( 'Cambodia', 'fluentform' ),
|
58 |
+
'CM' => __( 'Cameroon', 'fluentform' ),
|
59 |
+
'CA' => __( 'Canada', 'fluentform' ),
|
60 |
+
'CV' => __( 'Cape Verde', 'fluentform' ),
|
61 |
+
'KY' => __( 'Cayman Islands', 'fluentform' ),
|
62 |
+
'CF' => __( 'Central African Republic', 'fluentform' ),
|
63 |
+
'TD' => __( 'Chad', 'fluentform' ),
|
64 |
+
'CL' => __( 'Chile', 'fluentform' ),
|
65 |
+
'CN' => __( 'China', 'fluentform' ),
|
66 |
+
'CX' => __( 'Christmas Island', 'fluentform' ),
|
67 |
+
'CC' => __( 'Cocos (Keeling) Islands', 'fluentform' ),
|
68 |
+
'CO' => __( 'Colombia', 'fluentform' ),
|
69 |
+
'KM' => __( 'Comoros', 'fluentform' ),
|
70 |
+
'CG' => __( 'Congo (Brazzaville)', 'fluentform' ),
|
71 |
+
'CD' => __( 'Congo (Kinshasa)', 'fluentform' ),
|
72 |
+
'CK' => __( 'Cook Islands', 'fluentform' ),
|
73 |
+
'CR' => __( 'Costa Rica', 'fluentform' ),
|
74 |
+
'HR' => __( 'Croatia', 'fluentform' ),
|
75 |
+
'CU' => __( 'Cuba', 'fluentform' ),
|
76 |
+
'CW' => __( 'Curaçao', 'fluentform' ),
|
77 |
+
'CY' => __( 'Cyprus', 'fluentform' ),
|
78 |
+
'CZ' => __( 'Czech Republic', 'fluentform' ),
|
79 |
+
'DK' => __( 'Denmark', 'fluentform' ),
|
80 |
+
'DJ' => __( 'Djibouti', 'fluentform' ),
|
81 |
+
'DM' => __( 'Dominica', 'fluentform' ),
|
82 |
+
'DO' => __( 'Dominican Republic', 'fluentform' ),
|
83 |
+
'EC' => __( 'Ecuador', 'fluentform' ),
|
84 |
+
'EG' => __( 'Egypt', 'fluentform' ),
|
85 |
+
'SV' => __( 'El Salvador', 'fluentform' ),
|
86 |
+
'GQ' => __( 'Equatorial Guinea', 'fluentform' ),
|
87 |
+
'ER' => __( 'Eritrea', 'fluentform' ),
|
88 |
+
'EE' => __( 'Estonia', 'fluentform' ),
|
89 |
+
'ET' => __( 'Ethiopia', 'fluentform' ),
|
90 |
+
'FK' => __( 'Falkland Islands', 'fluentform' ),
|
91 |
+
'FO' => __( 'Faroe Islands', 'fluentform' ),
|
92 |
+
'FJ' => __( 'Fiji', 'fluentform' ),
|
93 |
+
'FI' => __( 'Finland', 'fluentform' ),
|
94 |
+
'FR' => __( 'France', 'fluentform' ),
|
95 |
+
'GF' => __( 'French Guiana', 'fluentform' ),
|
96 |
+
'PF' => __( 'French Polynesia', 'fluentform' ),
|
97 |
+
'TF' => __( 'French Southern Territories', 'fluentform' ),
|
98 |
+
'GA' => __( 'Gabon', 'fluentform' ),
|
99 |
+
'GM' => __( 'Gambia', 'fluentform' ),
|
100 |
+
'GE' => __( 'Georgia', 'fluentform' ),
|
101 |
+
'DE' => __( 'Germany', 'fluentform' ),
|
102 |
+
'GH' => __( 'Ghana', 'fluentform' ),
|
103 |
+
'GI' => __( 'Gibraltar', 'fluentform' ),
|
104 |
+
'GR' => __( 'Greece', 'fluentform' ),
|
105 |
+
'GL' => __( 'Greenland', 'fluentform' ),
|
106 |
+
'GD' => __( 'Grenada', 'fluentform' ),
|
107 |
+
'GP' => __( 'Guadeloupe', 'fluentform' ),
|
108 |
+
'GU' => __( 'Guam', 'fluentform' ),
|
109 |
+
'GT' => __( 'Guatemala', 'fluentform' ),
|
110 |
+
'GG' => __( 'Guernsey', 'fluentform' ),
|
111 |
+
'GN' => __( 'Guinea', 'fluentform' ),
|
112 |
+
'GW' => __( 'Guinea-Bissau', 'fluentform' ),
|
113 |
+
'GY' => __( 'Guyana', 'fluentform' ),
|
114 |
+
'HT' => __( 'Haiti', 'fluentform' ),
|
115 |
+
'HM' => __( 'Heard Island and McDonald Islands', 'fluentform' ),
|
116 |
+
'HN' => __( 'Honduras', 'fluentform' ),
|
117 |
+
'HK' => __( 'Hong Kong', 'fluentform' ),
|
118 |
+
'HU' => __( 'Hungary', 'fluentform' ),
|
119 |
+
'IS' => __( 'Iceland', 'fluentform' ),
|
120 |
+
'IN' => __( 'India', 'fluentform' ),
|
121 |
+
'ID' => __( 'Indonesia', 'fluentform' ),
|
122 |
+
'IR' => __( 'Iran', 'fluentform' ),
|
123 |
+
'IQ' => __( 'Iraq', 'fluentform' ),
|
124 |
+
'IE' => __( 'Ireland', 'fluentform' ),
|
125 |
+
'IM' => __( 'Isle of Man', 'fluentform' ),
|
126 |
+
'IL' => __( 'Israel', 'fluentform' ),
|
127 |
+
'IT' => __( 'Italy', 'fluentform' ),
|
128 |
+
'CI' => __( 'Ivory Coast', 'fluentform' ),
|
129 |
+
'JM' => __( 'Jamaica', 'fluentform' ),
|
130 |
+
'JP' => __( 'Japan', 'fluentform' ),
|
131 |
+
'JE' => __( 'Jersey', 'fluentform' ),
|
132 |
+
'JO' => __( 'Jordan', 'fluentform' ),
|
133 |
+
'KZ' => __( 'Kazakhstan', 'fluentform' ),
|
134 |
+
'KE' => __( 'Kenya', 'fluentform' ),
|
135 |
+
'KI' => __( 'Kiribati', 'fluentform' ),
|
136 |
+
'KW' => __( 'Kuwait', 'fluentform' ),
|
137 |
+
'KG' => __( 'Kyrgyzstan', 'fluentform' ),
|
138 |
+
'LA' => __( 'Laos', 'fluentform' ),
|
139 |
+
'LV' => __( 'Latvia', 'fluentform' ),
|
140 |
+
'LB' => __( 'Lebanon', 'fluentform' ),
|
141 |
+
'LS' => __( 'Lesotho', 'fluentform' ),
|
142 |
+
'LR' => __( 'Liberia', 'fluentform' ),
|
143 |
+
'LY' => __( 'Libya', 'fluentform' ),
|
144 |
+
'LI' => __( 'Liechtenstein', 'fluentform' ),
|
145 |
+
'LT' => __( 'Lithuania', 'fluentform' ),
|
146 |
+
'LU' => __( 'Luxembourg', 'fluentform' ),
|
147 |
+
'MO' => __( 'Macao S.A.R., China', 'fluentform' ),
|
148 |
+
'MK' => __( 'Macedonia', 'fluentform' ),
|
149 |
+
'MG' => __( 'Madagascar', 'fluentform' ),
|
150 |
+
'MW' => __( 'Malawi', 'fluentform' ),
|
151 |
+
'MY' => __( 'Malaysia', 'fluentform' ),
|
152 |
+
'MV' => __( 'Maldives', 'fluentform' ),
|
153 |
+
'ML' => __( 'Mali', 'fluentform' ),
|
154 |
+
'MT' => __( 'Malta', 'fluentform' ),
|
155 |
+
'MH' => __( 'Marshall Islands', 'fluentform' ),
|
156 |
+
'MQ' => __( 'Martinique', 'fluentform' ),
|
157 |
+
'MR' => __( 'Mauritania', 'fluentform' ),
|
158 |
+
'MU' => __( 'Mauritius', 'fluentform' ),
|
159 |
+
'YT' => __( 'Mayotte', 'fluentform' ),
|
160 |
+
'MX' => __( 'Mexico', 'fluentform' ),
|
161 |
+
'FM' => __( 'Micronesia', 'fluentform' ),
|
162 |
+
'MD' => __( 'Moldova', 'fluentform' ),
|
163 |
+
'MC' => __( 'Monaco', 'fluentform' ),
|
164 |
+
'MN' => __( 'Mongolia', 'fluentform' ),
|
165 |
+
'ME' => __( 'Montenegro', 'fluentform' ),
|
166 |
+
'MS' => __( 'Montserrat', 'fluentform' ),
|
167 |
+
'MA' => __( 'Morocco', 'fluentform' ),
|
168 |
+
'MZ' => __( 'Mozambique', 'fluentform' ),
|
169 |
+
'MM' => __( 'Myanmar', 'fluentform' ),
|
170 |
+
'NA' => __( 'Namibia', 'fluentform' ),
|
171 |
+
'NR' => __( 'Nauru', 'fluentform' ),
|
172 |
+
'NP' => __( 'Nepal', 'fluentform' ),
|
173 |
+
'NL' => __( 'Netherlands', 'fluentform' ),
|
174 |
+
'NC' => __( 'New Caledonia', 'fluentform' ),
|
175 |
+
'NZ' => __( 'New Zealand', 'fluentform' ),
|
176 |
+
'NI' => __( 'Nicaragua', 'fluentform' ),
|
177 |
+
'NE' => __( 'Niger', 'fluentform' ),
|
178 |
+
'NG' => __( 'Nigeria', 'fluentform' ),
|
179 |
+
'NU' => __( 'Niue', 'fluentform' ),
|
180 |
+
'NF' => __( 'Norfolk Island', 'fluentform' ),
|
181 |
+
'MP' => __( 'Northern Mariana Islands', 'fluentform' ),
|
182 |
+
'KP' => __( 'North Korea', 'fluentform' ),
|
183 |
+
'NO' => __( 'Norway', 'fluentform' ),
|
184 |
+
'OM' => __( 'Oman', 'fluentform' ),
|
185 |
+
'PK' => __( 'Pakistan', 'fluentform' ),
|
186 |
+
'PS' => __( 'Palestinian Territory', 'fluentform' ),
|
187 |
+
'PA' => __( 'Panama', 'fluentform' ),
|
188 |
+
'PG' => __( 'Papua New Guinea', 'fluentform' ),
|
189 |
+
'PY' => __( 'Paraguay', 'fluentform' ),
|
190 |
+
'PE' => __( 'Peru', 'fluentform' ),
|
191 |
+
'PH' => __( 'Philippines', 'fluentform' ),
|
192 |
+
'PN' => __( 'Pitcairn', 'fluentform' ),
|
193 |
+
'PL' => __( 'Poland', 'fluentform' ),
|
194 |
+
'PT' => __( 'Portugal', 'fluentform' ),
|
195 |
+
'PR' => __( 'Puerto Rico', 'fluentform' ),
|
196 |
+
'QA' => __( 'Qatar', 'fluentform' ),
|
197 |
+
'RE' => __( 'Reunion', 'fluentform' ),
|
198 |
+
'RO' => __( 'Romania', 'fluentform' ),
|
199 |
+
'RU' => __( 'Russia', 'fluentform' ),
|
200 |
+
'RW' => __( 'Rwanda', 'fluentform' ),
|
201 |
+
'BL' => __( 'Saint Barthélemy', 'fluentform' ),
|
202 |
+
'SH' => __( 'Saint Helena', 'fluentform' ),
|
203 |
+
'KN' => __( 'Saint Kitts and Nevis', 'fluentform' ),
|
204 |
+
'LC' => __( 'Saint Lucia', 'fluentform' ),
|
205 |
+
'MF' => __( 'Saint Martin (French part)', 'fluentform' ),
|
206 |
+
'SX' => __( 'Saint Martin (Dutch part)', 'fluentform' ),
|
207 |
+
'PM' => __( 'Saint Pierre and Miquelon', 'fluentform' ),
|
208 |
+
'VC' => __( 'Saint Vincent and the Grenadines', 'fluentform' ),
|
209 |
+
'SM' => __( 'San Marino', 'fluentform' ),
|
210 |
+
'ST' => __( 'São Tomé and Príncipe', 'fluentform' ),
|
211 |
+
'SA' => __( 'Saudi Arabia', 'fluentform' ),
|
212 |
+
'SN' => __( 'Senegal', 'fluentform' ),
|
213 |
+
'RS' => __( 'Serbia', 'fluentform' ),
|
214 |
+
'SC' => __( 'Seychelles', 'fluentform' ),
|
215 |
+
'SL' => __( 'Sierra Leone', 'fluentform' ),
|
216 |
+
'SG' => __( 'Singapore', 'fluentform' ),
|
217 |
+
'SK' => __( 'Slovakia', 'fluentform' ),
|
218 |
+
'SI' => __( 'Slovenia', 'fluentform' ),
|
219 |
+
'SB' => __( 'Solomon Islands', 'fluentform' ),
|
220 |
+
'SO' => __( 'Somalia', 'fluentform' ),
|
221 |
+
'ZA' => __( 'South Africa', 'fluentform' ),
|
222 |
+
'GS' => __( 'South Georgia/Sandwich Islands', 'fluentform' ),
|
223 |
+
'KR' => __( 'South Korea', 'fluentform' ),
|
224 |
+
'SS' => __( 'South Sudan', 'fluentform' ),
|
225 |
+
'ES' => __( 'Spain', 'fluentform' ),
|
226 |
+
'LK' => __( 'Sri Lanka', 'fluentform' ),
|
227 |
+
'SD' => __( 'Sudan', 'fluentform' ),
|
228 |
+
'SR' => __( 'Suriname', 'fluentform' ),
|
229 |
+
'SJ' => __( 'Svalbard and Jan Mayen', 'fluentform' ),
|
230 |
+
'SZ' => __( 'Swaziland', 'fluentform' ),
|
231 |
+
'SE' => __( 'Sweden', 'fluentform' ),
|
232 |
+
'CH' => __( 'Switzerland', 'fluentform' ),
|
233 |
+
'SY' => __( 'Syria', 'fluentform' ),
|
234 |
+
'TW' => __( 'Taiwan', 'fluentform' ),
|
235 |
+
'TJ' => __( 'Tajikistan', 'fluentform' ),
|
236 |
+
'TZ' => __( 'Tanzania', 'fluentform' ),
|
237 |
+
'TH' => __( 'Thailand', 'fluentform' ),
|
238 |
+
'TL' => __( 'Timor-Leste', 'fluentform' ),
|
239 |
+
'TG' => __( 'Togo', 'fluentform' ),
|
240 |
+
'TK' => __( 'Tokelau', 'fluentform' ),
|
241 |
+
'TO' => __( 'Tonga', 'fluentform' ),
|
242 |
+
'TT' => __( 'Trinidad and Tobago', 'fluentform' ),
|
243 |
+
'TN' => __( 'Tunisia', 'fluentform' ),
|
244 |
+
'TR' => __( 'Turkey', 'fluentform' ),
|
245 |
+
'TM' => __( 'Turkmenistan', 'fluentform' ),
|
246 |
+
'TC' => __( 'Turks and Caicos Islands', 'fluentform' ),
|
247 |
+
'TV' => __( 'Tuvalu', 'fluentform' ),
|
248 |
+
'UG' => __( 'Uganda', 'fluentform' ),
|
249 |
+
'UA' => __( 'Ukraine', 'fluentform' ),
|
250 |
+
'AE' => __( 'United Arab Emirates', 'fluentform' ),
|
251 |
+
'GB' => __( 'United Kingdom (UK)', 'fluentform' ),
|
252 |
+
'US' => __( 'United States (US)', 'fluentform' ),
|
253 |
+
'UM' => __( 'United States (US) Minor Outlying Islands', 'fluentform' ),
|
254 |
+
'VI' => __( 'United States (US) Virgin Islands', 'fluentform' ),
|
255 |
+
'UY' => __( 'Uruguay', 'fluentform' ),
|
256 |
+
'UZ' => __( 'Uzbekistan', 'fluentform' ),
|
257 |
+
'VU' => __( 'Vanuatu', 'fluentform' ),
|
258 |
+
'VA' => __( 'Vatican', 'fluentform' ),
|
259 |
+
'VE' => __( 'Venezuela', 'fluentform' ),
|
260 |
+
'VN' => __( 'Vietnam', 'fluentform' ),
|
261 |
+
'WF' => __( 'Wallis and Futuna', 'fluentform' ),
|
262 |
+
'EH' => __( 'Western Sahara', 'fluentform' ),
|
263 |
+
'WS' => __( 'Samoa', 'fluentform' ),
|
264 |
+
'YE' => __( 'Yemen', 'fluentform' ),
|
265 |
+
'ZM' => __( 'Zambia', 'fluentform' ),
|
266 |
+
'ZW' => __( 'Zimbabwe', 'fluentform' ),
|
267 |
+
);
|
268 |
+
|
269 |
+
return apply_filters( 'fluent_editor_countries', $country_names );
|
app/Services/FormBuilder/DefaultElements.php
ADDED
@@ -0,0 +1,1030 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
return array(
|
4 |
+
'general' => array (
|
5 |
+
'input_text' => array (
|
6 |
+
'index' => 1,
|
7 |
+
'element' => 'input_text',
|
8 |
+
'attributes' => array (
|
9 |
+
'type' => 'text',
|
10 |
+
'name' => 'input_text',
|
11 |
+
'value' => '',
|
12 |
+
'class' => '',
|
13 |
+
'placeholder' => '',
|
14 |
+
),
|
15 |
+
'settings' => array (
|
16 |
+
'container_class' => '',
|
17 |
+
'label' => 'Text Input',
|
18 |
+
'label_placement' => '',
|
19 |
+
'admin_field_label' => '',
|
20 |
+
'help_message' => '',
|
21 |
+
'validation_rules' => array (
|
22 |
+
'required' => array (
|
23 |
+
'value' => false,
|
24 |
+
'message' => 'This field is required',
|
25 |
+
),
|
26 |
+
),
|
27 |
+
'conditional_logics' => array (),
|
28 |
+
),
|
29 |
+
'editor_options' => array (
|
30 |
+
'title' => 'Text Input',
|
31 |
+
'icon_class' => 'icon-text-width',
|
32 |
+
'template' => 'inputText'
|
33 |
+
)
|
34 |
+
),
|
35 |
+
'input_name' => array (
|
36 |
+
'index' => 2,
|
37 |
+
'element' => 'input_name',
|
38 |
+
'attributes' => array (
|
39 |
+
'name' => 'names'
|
40 |
+
),
|
41 |
+
'settings' => array (
|
42 |
+
'container_class' => '',
|
43 |
+
'admin_field_label' => '',
|
44 |
+
'conditional_logics' => array (),
|
45 |
+
),
|
46 |
+
'fields' => array (
|
47 |
+
'first_name' => array (
|
48 |
+
'element' => 'input_text',
|
49 |
+
'attributes' => array (
|
50 |
+
'type' => 'text',
|
51 |
+
'name' => 'first_name',
|
52 |
+
'value' => '',
|
53 |
+
'id' => '',
|
54 |
+
'class' => '',
|
55 |
+
'placeholder' => '',
|
56 |
+
),
|
57 |
+
'settings' => array (
|
58 |
+
'container_class' => '',
|
59 |
+
'label' => 'First Name',
|
60 |
+
'help_message' => '',
|
61 |
+
'visible' => true,
|
62 |
+
'validation_rules' => array (
|
63 |
+
'required' => array (
|
64 |
+
'value' => false,
|
65 |
+
'message' => 'This field is required',
|
66 |
+
),
|
67 |
+
),
|
68 |
+
'conditional_logics' => array (),
|
69 |
+
),
|
70 |
+
'editor_options' => array (
|
71 |
+
'template' => 'inputText'
|
72 |
+
),
|
73 |
+
),
|
74 |
+
'middle_name' => array (
|
75 |
+
'element' => 'input_text',
|
76 |
+
'attributes' => array (
|
77 |
+
'type' => 'text',
|
78 |
+
'name' => 'middle_name',
|
79 |
+
'value' => '',
|
80 |
+
'id' => '',
|
81 |
+
'class' => '',
|
82 |
+
'placeholder' => '',
|
83 |
+
'required' => false,
|
84 |
+
),
|
85 |
+
'settings' => array (
|
86 |
+
'container_class' => '',
|
87 |
+
'label' => 'Middle Name',
|
88 |
+
'help_message' => '',
|
89 |
+
'error_message' => '',
|
90 |
+
'visible' => false,
|
91 |
+
'validation_rules' => array (
|
92 |
+
'required' => array (
|
93 |
+
'value' => false,
|
94 |
+
'message' => 'This field is required',
|
95 |
+
),
|
96 |
+
),
|
97 |
+
'conditional_logics' => array (),
|
98 |
+
),
|
99 |
+
'editor_options' => array (
|
100 |
+
'template' => 'inputText'
|
101 |
+
),
|
102 |
+
),
|
103 |
+
'last_name' => array (
|
104 |
+
'element' => 'input_text',
|
105 |
+
'attributes' => array (
|
106 |
+
'type' => 'text',
|
107 |
+
'name' => 'last_name',
|
108 |
+
'value' => '',
|
109 |
+
'id' => '',
|
110 |
+
'class' => '',
|
111 |
+
'placeholder' => '',
|
112 |
+
'required' => false,
|
113 |
+
),
|
114 |
+
'settings' => array (
|
115 |
+
'container_class' => '',
|
116 |
+
'label' => 'Last Name',
|
117 |
+
'help_message' => '',
|
118 |
+
'error_message' => '',
|
119 |
+
'visible' => true,
|
120 |
+
'validation_rules' => array (
|
121 |
+
'required' => array (
|
122 |
+
'value' => false,
|
123 |
+
'message' => 'This field is required',
|
124 |
+
),
|
125 |
+
),
|
126 |
+
'conditional_logics' => array (),
|
127 |
+
),
|
128 |
+
'editor_options' => array (
|
129 |
+
'template' => 'inputText'
|
130 |
+
),
|
131 |
+
),
|
132 |
+
),
|
133 |
+
'editor_options' => array (
|
134 |
+
'title' => 'Name Fields',
|
135 |
+
'element' => 'name-fields',
|
136 |
+
'icon_class' => 'icon-user',
|
137 |
+
'template' => 'nameFields'
|
138 |
+
),
|
139 |
+
),
|
140 |
+
'textarea' => array (
|
141 |
+
'index' => 2,
|
142 |
+
'element' => 'textarea',
|
143 |
+
'attributes' => array (
|
144 |
+
'name' => 'description',
|
145 |
+
'value' => '',
|
146 |
+
'id' => '',
|
147 |
+
'class' => '',
|
148 |
+
'placeholder' => '',
|
149 |
+
'rows' => 4,
|
150 |
+
'cols' => 2,
|
151 |
+
),
|
152 |
+
'settings' => array (
|
153 |
+
'container_class' => '',
|
154 |
+
'label' => 'Description',
|
155 |
+
'label_placement' => '',
|
156 |
+
'help_message' => '',
|
157 |
+
'validation_rules' => array (
|
158 |
+
'required' => array (
|
159 |
+
'value' => false,
|
160 |
+
'message' => 'This field is required',
|
161 |
+
),
|
162 |
+
),
|
163 |
+
'conditional_logics' => array ()
|
164 |
+
),
|
165 |
+
'editor_options' => array (
|
166 |
+
'title' => 'Textarea',
|
167 |
+
'icon_class' => 'icon-paragraph',
|
168 |
+
'template' => 'inputTextarea'
|
169 |
+
),
|
170 |
+
),
|
171 |
+
'select' => array (
|
172 |
+
'index' => 3,
|
173 |
+
'element' => 'select',
|
174 |
+
'attributes' => array (
|
175 |
+
'name' => 'dropdown',
|
176 |
+
'value' => '',
|
177 |
+
'id' => '',
|
178 |
+
'class' => '',
|
179 |
+
'placeholder' => '- Select -',
|
180 |
+
),
|
181 |
+
'settings' => array (
|
182 |
+
'container_class' => '',
|
183 |
+
'label' => 'Dropdown',
|
184 |
+
'label_placement' => '',
|
185 |
+
'help_message' => '',
|
186 |
+
'validation_rules' => array (
|
187 |
+
'required' => array (
|
188 |
+
'value' => false,
|
189 |
+
'message' => 'This field is required',
|
190 |
+
),
|
191 |
+
),
|
192 |
+
'conditional_logics' =>array (),
|
193 |
+
),
|
194 |
+
'options' => array (
|
195 |
+
'option_1' => 'Option 1',
|
196 |
+
'option_2' => 'Option 2',
|
197 |
+
),
|
198 |
+
'editor_options' => array (
|
199 |
+
'title' => 'Dropdown',
|
200 |
+
'icon_class' => 'icon-caret-square-o-down',
|
201 |
+
'element' => 'select',
|
202 |
+
'template' => 'select'
|
203 |
+
)
|
204 |
+
),
|
205 |
+
'multi_select' => array (
|
206 |
+
'index' => 4,
|
207 |
+
'element' => 'select',
|
208 |
+
'attributes' => array (
|
209 |
+
'name' => 'skills',
|
210 |
+
'value' => array (),
|
211 |
+
'id' => '',
|
212 |
+
'class' => '',
|
213 |
+
'multiple' => true,
|
214 |
+
'placeholder' => '- Select -',
|
215 |
+
),
|
216 |
+
'settings' => array (
|
217 |
+
'container_class' => '',
|
218 |
+
'label' => 'Multiselect',
|
219 |
+
'label_placement' => '',
|
220 |
+
'help_message' => '',
|
221 |
+
'validation_rules' => array (
|
222 |
+
'required' => array (
|
223 |
+
'value' => false,
|
224 |
+
'message' => 'This field is required',
|
225 |
+
),
|
226 |
+
),
|
227 |
+
'conditional_logics' => array (),
|
228 |
+
),
|
229 |
+
'options' => array (
|
230 |
+
'option_1' => 'Option 1',
|
231 |
+
'option_2' => 'Option 2',
|
232 |
+
),
|
233 |
+
'editor_options' => array (
|
234 |
+
'title' => 'Multiselect',
|
235 |
+
'icon_class' => 'icon-list-ul',
|
236 |
+
'element' => 'select',
|
237 |
+
'template' => 'select'
|
238 |
+
)
|
239 |
+
),
|
240 |
+
'input_radio' => array (
|
241 |
+
'index' => 5,
|
242 |
+
'element' => 'input_radio',
|
243 |
+
'attributes' => array (
|
244 |
+
'type' => 'radio',
|
245 |
+
'name' => 'input_radio',
|
246 |
+
'value' => '',
|
247 |
+
),
|
248 |
+
'settings' => array (
|
249 |
+
'container_class' => '',
|
250 |
+
'label' => 'Radio Field',
|
251 |
+
'label_placement' => '',
|
252 |
+
'display_type' => '',
|
253 |
+
'help_message' => '',
|
254 |
+
'validation_rules' => array (
|
255 |
+
'required' => array (
|
256 |
+
'value' => false,
|
257 |
+
'message' => 'This field is required',
|
258 |
+
),
|
259 |
+
),
|
260 |
+
'conditional_logics' => array (),
|
261 |
+
),
|
262 |
+
'options' => array (
|
263 |
+
'yes' => 'Yes',
|
264 |
+
'no' => 'No',
|
265 |
+
),
|
266 |
+
'editor_options' => array (
|
267 |
+
'title' => 'Radio',
|
268 |
+
'icon_class' => 'icon-dot-circle-o',
|
269 |
+
'element' => 'input-radio',
|
270 |
+
'template' => 'inputRadio'
|
271 |
+
),
|
272 |
+
),
|
273 |
+
'input_checkbox' => array (
|
274 |
+
'index' => 6,
|
275 |
+
'element' => 'input_checkbox',
|
276 |
+
'attributes' => array (
|
277 |
+
'type' => 'checkbox',
|
278 |
+
'name' => 'checkbox',
|
279 |
+
'value' => array (),
|
280 |
+
),
|
281 |
+
'settings' => array (
|
282 |
+
'container_class' => '',
|
283 |
+
'label' => 'Checkbox Field',
|
284 |
+
'label_placement' => '',
|
285 |
+
'display_type' => '',
|
286 |
+
'help_message' => '',
|
287 |
+
'validation_rules' => array (
|
288 |
+
'required' => array (
|
289 |
+
'value' => false,
|
290 |
+
'message' => 'This field is required',
|
291 |
+
),
|
292 |
+
),
|
293 |
+
'conditional_logics' => array (),
|
294 |
+
),
|
295 |
+
'options' => array (
|
296 |
+
'item_1' => 'Item 1',
|
297 |
+
'item_2' => 'Item 2',
|
298 |
+
'item_3' => 'Item 3'
|
299 |
+
),
|
300 |
+
'editor_options' => array (
|
301 |
+
'title' => 'Checkbox',
|
302 |
+
'icon_class' => 'icon-check-square-o',
|
303 |
+
'template' => 'inputCheckbox'
|
304 |
+
),
|
305 |
+
),
|
306 |
+
'input_email' => array (
|
307 |
+
'index' => 7,
|
308 |
+
'element' => 'input_email',
|
309 |
+
'attributes' => array (
|
310 |
+
'type' => 'email',
|
311 |
+
'name' => 'email',
|
312 |
+
'value' => '',
|
313 |
+
'id' => '',
|
314 |
+
'class' => '',
|
315 |
+
'placeholder' => '',
|
316 |
+
),
|
317 |
+
'settings' => array (
|
318 |
+
'container_class' => '',
|
319 |
+
'label' => 'Email',
|
320 |
+
'label_placement' => '',
|
321 |
+
'help_message' => '',
|
322 |
+
'validation_rules' => array (
|
323 |
+
'required' => array (
|
324 |
+
'value' => false,
|
325 |
+
'message' => 'This field is required',
|
326 |
+
),
|
327 |
+
'email' => array (
|
328 |
+
'value' => true,
|
329 |
+
'message' => 'This field must contain a valid email',
|
330 |
+
),
|
331 |
+
),
|
332 |
+
'conditional_logics' => array (),
|
333 |
+
),
|
334 |
+
'editor_options' => array (
|
335 |
+
'title' => 'Email',
|
336 |
+
'icon_class' => 'icon-envelope-o',
|
337 |
+
'template' => 'inputText'
|
338 |
+
),
|
339 |
+
),
|
340 |
+
'input_url' => array (
|
341 |
+
'index' => 8,
|
342 |
+
'element' => 'input_url',
|
343 |
+
'attributes' => array (
|
344 |
+
'type' => 'url',
|
345 |
+
'name' => 'url',
|
346 |
+
'value' => '',
|
347 |
+
'id' => '',
|
348 |
+
'class' => '',
|
349 |
+
'placeholder' => '',
|
350 |
+
),
|
351 |
+
'settings' => array (
|
352 |
+
'container_class' => '',
|
353 |
+
'label' => 'URL Field',
|
354 |
+
'label_placement' => '',
|
355 |
+
'help_message' => '',
|
356 |
+
'validation_rules' => array (
|
357 |
+
'required' => array (
|
358 |
+
'value' => false,
|
359 |
+
'message' => 'This field is required',
|
360 |
+
),
|
361 |
+
'url' => array (
|
362 |
+
'value' => true,
|
363 |
+
'message' => 'This field must contain a valid url',
|
364 |
+
),
|
365 |
+
),
|
366 |
+
'conditional_logics' => array (),
|
367 |
+
),
|
368 |
+
'editor_options' => array (
|
369 |
+
'title' => 'URL',
|
370 |
+
'icon_class' => 'icon-link',
|
371 |
+
'template' => 'inputText'
|
372 |
+
)
|
373 |
+
),
|
374 |
+
'input_password' => array (
|
375 |
+
'index' => 9,
|
376 |
+
'element' => 'input_password',
|
377 |
+
'attributes' => array (
|
378 |
+
'type' => 'password',
|
379 |
+
'name' => 'password',
|
380 |
+
'value' => '',
|
381 |
+
'id' => '',
|
382 |
+
'class' => '',
|
383 |
+
'placeholder' => '',
|
384 |
+
),
|
385 |
+
'settings' => array (
|
386 |
+
'container_class' => '',
|
387 |
+
'label' => 'Password',
|
388 |
+
'label_placement' => '',
|
389 |
+
'help_message' => '',
|
390 |
+
'validation_rules' => array (
|
391 |
+
'required' => array (
|
392 |
+
'value' => false,
|
393 |
+
'message' => 'This field is required',
|
394 |
+
),
|
395 |
+
),
|
396 |
+
'conditional_logics' => array (),
|
397 |
+
),
|
398 |
+
'editor_options' => array (
|
399 |
+
'title' => 'Password',
|
400 |
+
'icon_class' => 'icon-lock',
|
401 |
+
'template' => 'inputText'
|
402 |
+
),
|
403 |
+
),
|
404 |
+
'input_image' => array (
|
405 |
+
'index' => 10,
|
406 |
+
'element' => 'input_file',
|
407 |
+
'attributes' => array (
|
408 |
+
'type' => 'file',
|
409 |
+
'name' => 'image-upload',
|
410 |
+
'value' => '',
|
411 |
+
'id' => '',
|
412 |
+
'class' => '',
|
413 |
+
'accept' => 'image/*',
|
414 |
+
),
|
415 |
+
'settings' => array (
|
416 |
+
'container_class' => '',
|
417 |
+
'label' => 'Image Upload',
|
418 |
+
'label_placement' => '',
|
419 |
+
'btn_text' => 'Choose File',
|
420 |
+
'help_message' => '',
|
421 |
+
'validation_rules' => array (
|
422 |
+
'required' => array (
|
423 |
+
'value' => false,
|
424 |
+
'message' => 'This field is required',
|
425 |
+
),
|
426 |
+
'max_file_size' => array (
|
427 |
+
'value' => 1024,
|
428 |
+
'message' => 'Max file size limit'
|
429 |
+
),
|
430 |
+
'max_file_count' => array (
|
431 |
+
'value' => 1,
|
432 |
+
'message' => 'Max file count'
|
433 |
+
),
|
434 |
+
),
|
435 |
+
'conditional_logics' => array (),
|
436 |
+
),
|
437 |
+
'editor_options' => array (
|
438 |
+
'title' => 'Image Upload',
|
439 |
+
'icon_class' => 'icon-picture-o',
|
440 |
+
'template' => 'inputFile'
|
441 |
+
),
|
442 |
+
),
|
443 |
+
'input_date' => array (
|
444 |
+
'index' => 11,
|
445 |
+
'element' => 'input_date',
|
446 |
+
'attributes' => array (
|
447 |
+
'type' => 'text',
|
448 |
+
'name' => 'datetime',
|
449 |
+
'value' => '',
|
450 |
+
'id' => '',
|
451 |
+
'class' => '',
|
452 |
+
'placeholder' => '',
|
453 |
+
),
|
454 |
+
'settings' => array (
|
455 |
+
'container_class' => '',
|
456 |
+
'label' => 'Date / Time',
|
457 |
+
'label_placement' => '',
|
458 |
+
'date_format' => 'd/m/Y',
|
459 |
+
'help_message' => '',
|
460 |
+
'is_time_enabled' => true,
|
461 |
+
'validation_rules' => array (
|
462 |
+
'required' => array (
|
463 |
+
'value' => false,
|
464 |
+
'message' => 'This field is required',
|
465 |
+
)
|
466 |
+
),
|
467 |
+
'conditional_logics' => array (),
|
468 |
+
),
|
469 |
+
'editor_options' => array (
|
470 |
+
'title' => 'Date / Time',
|
471 |
+
'icon_class' => 'icon-calendar-o',
|
472 |
+
'template' => 'inputText'
|
473 |
+
),
|
474 |
+
),
|
475 |
+
'input_file' => array (
|
476 |
+
'index' => 12,
|
477 |
+
'element' => 'input_file',
|
478 |
+
'attributes' => array (
|
479 |
+
'type' => 'file',
|
480 |
+
'name' => 'file-upload',
|
481 |
+
'value' => '',
|
482 |
+
'id' => '',
|
483 |
+
'class' => '',
|
484 |
+
),
|
485 |
+
'settings' => array (
|
486 |
+
'container_class' => '',
|
487 |
+
'label' => 'File Upload',
|
488 |
+
'label_placement' => '',
|
489 |
+
'btn_text' => 'Choose File',
|
490 |
+
'help_message' => '',
|
491 |
+
'validation_rules' => array (
|
492 |
+
'required' => array (
|
493 |
+
'value' => false,
|
494 |
+
'message' => 'This field is required',
|
495 |
+
),
|
496 |
+
'max_file_size' => array (
|
497 |
+
'value' => 1024,
|
498 |
+
'message' => 'Max file size limit'
|
499 |
+
),
|
500 |
+
'max_file_count' => array (
|
501 |
+
'value' => 1,
|
502 |
+
'message' => 'Max file count'
|
503 |
+
),
|
504 |
+
'allowed_file_types' => array (
|
505 |
+
'value' => array('pdf'),
|
506 |
+
'message' => 'allowed_file_types'
|
507 |
+
)
|
508 |
+
),
|
509 |
+
'conditional_logics' => array (),
|
510 |
+
),
|
511 |
+
'editor_options' => array (
|
512 |
+
'title' => 'File Upload',
|
513 |
+
'icon_class' => 'icon-upload',
|
514 |
+
'template' => 'inputFile'
|
515 |
+
),
|
516 |
+
),
|
517 |
+
'select_country' => array (
|
518 |
+
'index' => 13,
|
519 |
+
'element' => 'select_country',
|
520 |
+
'attributes' => array (
|
521 |
+
'name' => 'country-list',
|
522 |
+
'value' => '',
|
523 |
+
'id' => '',
|
524 |
+
'class' => '',
|
525 |
+
'placeholder' => '',
|
526 |
+
),
|
527 |
+
'settings' => array (
|
528 |
+
'container_class' => '',
|
529 |
+
'label' => 'Country List',
|
530 |
+
'label_placement' => '',
|
531 |
+
'help_message' => '',
|
532 |
+
'validation_rules' => array (
|
533 |
+
'required' => array (
|
534 |
+
'value' => false,
|
535 |
+
'message' => 'This field is required',
|
536 |
+
),
|
537 |
+
),
|
538 |
+
'country_list' => array (
|
539 |
+
'active_list' => 'all',
|
540 |
+
'visible_list' => array (),
|
541 |
+
'hidden_list' => array (),
|
542 |
+
),
|
543 |
+
'conditional_logics' => array (),
|
544 |
+
),
|
545 |
+
'options' => array (
|
546 |
+
'BD' => 'Bangladesh',
|
547 |
+
'US' => 'United States of America',
|
548 |
+
),
|
549 |
+
'editor_options' => array (
|
550 |
+
'title' => 'Country List',
|
551 |
+
'element' => 'country-list',
|
552 |
+
'icon_class' => 'icon-globe',
|
553 |
+
'template' => 'selectCountry'
|
554 |
+
),
|
555 |
+
),
|
556 |
+
'input_number' => array (
|
557 |
+
'index' => 14,
|
558 |
+
'element' => 'input_number',
|
559 |
+
'attributes' => array (
|
560 |
+
'type' => 'number',
|
561 |
+
'name' => 'numeric-field',
|
562 |
+
'value' => '',
|
563 |
+
'id' => '',
|
564 |
+
'class' => '',
|
565 |
+
'placeholder' => '',
|
566 |
+
),
|
567 |
+
'settings' => array (
|
568 |
+
'container_class' => '',
|
569 |
+
'label' => 'Numeric Field',
|
570 |
+
'label_placement' => '',
|
571 |
+
'help_message' => '',
|
572 |
+
'validation_rules' => array (
|
573 |
+
'required' => array (
|
574 |
+
'value' => false,
|
575 |
+
'message' => 'This field is required',
|
576 |
+
),
|
577 |
+
'numeric' => array (
|
578 |
+
'value' => true,
|
579 |
+
'message' => 'This field must contain numeric value',
|
580 |
+
),
|
581 |
+
'min' => array (
|
582 |
+
'value' => '',
|
583 |
+
'message' => 'Minimum value is ',
|
584 |
+
),
|
585 |
+
'max' => array (
|
586 |
+
'value' => '',
|
587 |
+
'message' => 'Maximum value is ',
|
588 |
+
),
|
589 |
+
),
|
590 |
+
'conditional_logics' => array (),
|
591 |
+
),
|
592 |
+
'editor_options' => array (
|
593 |
+
'title' => 'Numeric Field',
|
594 |
+
'icon_class' => 'icon-slack',
|
595 |
+
'template' => 'inputText'
|
596 |
+
),
|
597 |
+
),
|
598 |
+
'input_repeat' => array (
|
599 |
+
'index' => 15,
|
600 |
+
'element' => 'input_repeat',
|
601 |
+
'attributes' => array (
|
602 |
+
'name' => 'input_repeat'
|
603 |
+
),
|
604 |
+
'settings' => array (
|
605 |
+
'container_class' => '',
|
606 |
+
'conditional_logics' => array (),
|
607 |
+
),
|
608 |
+
'fields' => array (
|
609 |
+
'input_text' => array (
|
610 |
+
'element' => 'input_text',
|
611 |
+
'attributes' => array (
|
612 |
+
'type' => 'text',
|
613 |
+
'name' => 'input_repeat_1',
|
614 |
+
'value' => '',
|
615 |
+
'placeholder' => '',
|
616 |
+
),
|
617 |
+
'settings' => array (
|
618 |
+
'label' => 'Repeat Field',
|
619 |
+
'help_message' => '',
|
620 |
+
'validation_rules' => array (
|
621 |
+
'required' => array (
|
622 |
+
'value' => false,
|
623 |
+
'message' => 'This field is required',
|
624 |
+
),
|
625 |
+
),
|
626 |
+
),
|
627 |
+
'editor_options' => array (),
|
628 |
+
)
|
629 |
+
),
|
630 |
+
'editor_options' => array (
|
631 |
+
'title' => 'Repeat Field',
|
632 |
+
'icon_class' => 'icon-text-width',
|
633 |
+
'template' => 'repeatFields'
|
634 |
+
),
|
635 |
+
),
|
636 |
+
'address' => array (
|
637 |
+
'index' => 16,
|
638 |
+
'element' => 'address',
|
639 |
+
'attributes' => array (
|
640 |
+
'id' => '',
|
641 |
+
'class' => '',
|
642 |
+
'name' => 'address1',
|
643 |
+
'type' => 'custom-address'
|
644 |
+
),
|
645 |
+
'settings' => array (
|
646 |
+
'label' => 'Address',
|
647 |
+
'conditional_logics' => array (),
|
648 |
+
),
|
649 |
+
'fields' => array (
|
650 |
+
'address_line_1' => array (
|
651 |
+
'element' => 'input_text',
|
652 |
+
'attributes' => array (
|
653 |
+
'type' => 'text',
|
654 |
+
'name' => 'address_line_1',
|
655 |
+
'value' => '',
|
656 |
+
'id' => '',
|
657 |
+
'class' => '',
|
658 |
+
'placeholder' => '',
|
659 |
+
),
|
660 |
+
'settings' => array (
|
661 |
+
'container_class' => '',
|
662 |
+
'label' => 'Address Line 1',
|
663 |
+
'help_message' => '',
|
664 |
+
'visible' => true,
|
665 |
+
'validation_rules' => array (
|
666 |
+
'required' => array (
|
667 |
+
'value' => false,
|
668 |
+
'message' => 'This field is required',
|
669 |
+
),
|
670 |
+
),
|
671 |
+
'conditional_logics' => array (),
|
672 |
+
),
|
673 |
+
'editor_options' => array (
|
674 |
+
'template' => 'inputText'
|
675 |
+
),
|
676 |
+
),
|
677 |
+
'address_line_2' => array (
|
678 |
+
'element' => 'input_text',
|
679 |
+
'attributes' => array (
|
680 |
+
'type' => 'text',
|
681 |
+
'name' => 'address_line_2',
|
682 |
+
'value' => '',
|
683 |
+
'id' => '',
|
684 |
+
'class' => '',
|
685 |
+
'placeholder' => '',
|
686 |
+
),
|
687 |
+
'settings' => array (
|
688 |
+
'container_class' => '',
|
689 |
+
'label' => 'Address Line 2',
|
690 |
+
'help_message' => '',
|
691 |
+
'visible' => true,
|
692 |
+
'validation_rules' => array (
|
693 |
+
'required' => array (
|
694 |
+
'value' => false,
|
695 |
+
'message' => 'This field is required',
|
696 |
+
),
|
697 |
+
),
|
698 |
+
'conditional_logics' => array (),
|
699 |
+
),
|
700 |
+
'editor_options' => array (
|
701 |
+
'template' => 'inputText'
|
702 |
+
),
|
703 |
+
),
|
704 |
+
'city' => array (
|
705 |
+
'element' => 'input_text',
|
706 |
+
'attributes' => array (
|
707 |
+
'type' => 'text',
|
708 |
+
'name' => 'city',
|
709 |
+
'value' => '',
|
710 |
+
'id' => '',
|
711 |
+
'class' => '',
|
712 |
+
'placeholder' => '',
|
713 |
+
),
|
714 |
+
'settings' => array (
|
715 |
+
'container_class' => '',
|
716 |
+
'label' => 'City',
|
717 |
+
'help_message' => '',
|
718 |
+
'error_message' => '',
|
719 |
+
'visible' => true,
|
720 |
+
'validation_rules' => array (
|
721 |
+
'required' => array (
|
722 |
+
'value' => false,
|
723 |
+
'message' => 'This field is required',
|
724 |
+
),
|
725 |
+
),
|
726 |
+
'conditional_logics' => array (),
|
727 |
+
),
|
728 |
+
'editor_options' => array (
|
729 |
+
'template' => 'inputText'
|
730 |
+
),
|
731 |
+
),
|
732 |
+
'state' => array (
|
733 |
+
'element' => 'input_text',
|
734 |
+
'attributes' => array (
|
735 |
+
'type' => 'text',
|
736 |
+
'name' => 'state',
|
737 |
+
'value' => '',
|
738 |
+
'id' => '',
|
739 |
+
'class' => '',
|
740 |
+
'placeholder' => '',
|
741 |
+
),
|
742 |
+
'settings' => array (
|
743 |
+
'container_class' => '',
|
744 |
+
'label' => 'State',
|
745 |
+
'help_message' => '',
|
746 |
+
'error_message' => '',
|
747 |
+
'visible' => true,
|
748 |
+
'validation_rules' => array (
|
749 |
+
'required' => array (
|
750 |
+
'value' => false,
|
751 |
+
'message' => 'This field is required',
|
752 |
+
),
|
753 |
+
),
|
754 |
+
'conditional_logics' => array (),
|
755 |
+
),
|
756 |
+
'editor_options' => array (
|
757 |
+
'template' => 'inputText'
|
758 |
+
),
|
759 |
+
),
|
760 |
+
'zip' => array (
|
761 |
+
'element' => 'input_text',
|
762 |
+
'attributes' => array (
|
763 |
+
'type' => 'text',
|
764 |
+
'name' => 'zip',
|
765 |
+
'value' => '',
|
766 |
+
'id' => '',
|
767 |
+
'class' => '',
|
768 |
+
'placeholder' => '',
|
769 |
+
'required' => false,
|
770 |
+
),
|
771 |
+
'settings' => array (
|
772 |
+
'container_class' => '',
|
773 |
+
'label' => 'Zip Code',
|
774 |
+
'help_message' => '',
|
775 |
+
'error_message' => '',
|
776 |
+
'visible' => true,
|
777 |
+
'validation_rules' => array (
|
778 |
+
'required' => array (
|
779 |
+
'value' => false,
|
780 |
+
'message' => 'This field is required',
|
781 |
+
),
|
782 |
+
),
|
783 |
+
'conditional_logics' => array (),
|
784 |
+
),
|
785 |
+
'editor_options' => array (
|
786 |
+
'template' => 'inputText'
|
787 |
+
),
|
788 |
+
),
|
789 |
+
'country' => array (
|
790 |
+
'element' => 'select_country',
|
791 |
+
'attributes' => array (
|
792 |
+
'name' => 'country',
|
793 |
+
'value' => '',
|
794 |
+
'id' => '',
|
795 |
+
'class' => '',
|
796 |
+
'placeholder' => '',
|
797 |
+
'required' => false,
|
798 |
+
),
|
799 |
+
'settings' => array (
|
800 |
+
'container_class' => '',
|
801 |
+
'label' => 'Country',
|
802 |
+
'help_message' => '',
|
803 |
+
'error_message' => '',
|
804 |
+
'visible' => true,
|
805 |
+
'validation_rules' => array (
|
806 |
+
'required' => array (
|
807 |
+
'value' => false,
|
808 |
+
'message' => 'This field is required',
|
809 |
+
),
|
810 |
+
),
|
811 |
+
'country_list' => array (
|
812 |
+
'active_list' => 'all',
|
813 |
+
'visible_list' => array (),
|
814 |
+
'hidden_list' => array (),
|
815 |
+
),
|
816 |
+
'conditional_logics' => array (),
|
817 |
+
),
|
818 |
+
'options' => array (
|
819 |
+
'bangladesh' => 'Bangladesh',
|
820 |
+
'usa' => 'US of America',
|
821 |
+
),
|
822 |
+
'editor_options' => array (
|
823 |
+
'title' => 'Country List',
|
824 |
+
'element' => 'country-list',
|
825 |
+
'icon_class' => 'icon-text-width',
|
826 |
+
'template' => 'selectCountry'
|
827 |
+
),
|
828 |
+
),
|
829 |
+
),
|
830 |
+
'editor_options' => array (
|
831 |
+
'title' => 'Address Fields',
|
832 |
+
'element' => 'address-fields',
|
833 |
+
'icon_class' => 'icon-credit-card',
|
834 |
+
'template' => 'addressFields'
|
835 |
+
),
|
836 |
+
)
|
837 |
+
),
|
838 |
+
'advanced' => array(
|
839 |
+
'input_hidden' => array (
|
840 |
+
'index' => 0,
|
841 |
+
'element' => 'input_hidden',
|
842 |
+
'attributes' => array (
|
843 |
+
'type' => 'hidden',
|
844 |
+
'name' => 'hidden',
|
845 |
+
'value' => '',
|
846 |
+
),
|
847 |
+
'settings' => array (
|
848 |
+
'validation_rules' => array (
|
849 |
+
'required' => array (
|
850 |
+
'value' => false,
|
851 |
+
'message' => 'This field is required',
|
852 |
+
),
|
853 |
+
),
|
854 |
+
'conditional_logics' => array (),
|
855 |
+
),
|
856 |
+
'editor_options' => array (
|
857 |
+
'title' => 'Hidden Field',
|
858 |
+
'icon_class' => 'icon-eye-slash',
|
859 |
+
'template' => 'inputHidden',
|
860 |
+
),
|
861 |
+
),
|
862 |
+
'section_break' => array(
|
863 |
+
'index' => 1,
|
864 |
+
'element' => 'section_break',
|
865 |
+
'attributes' => array(
|
866 |
+
'id' => '',
|
867 |
+
'class' => '',
|
868 |
+
),
|
869 |
+
'settings' => array(
|
870 |
+
'label' => 'Section Break',
|
871 |
+
'description' => 'Some description about this section',
|
872 |
+
'align' => 'left',
|
873 |
+
'conditional_logics' => array(),
|
874 |
+
),
|
875 |
+
'editor_options' => array(
|
876 |
+
'title' => 'Section Break',
|
877 |
+
'icon_class' => 'icon-puzzle-piece',
|
878 |
+
'template' => 'sectionBreak',
|
879 |
+
),
|
880 |
+
),
|
881 |
+
'recaptcha' => array(
|
882 |
+
'index' => 2,
|
883 |
+
'element' => 'recaptcha',
|
884 |
+
'attributes' => array('name' => 'recaptcha'),
|
885 |
+
'settings' => array(
|
886 |
+
'label' => '',
|
887 |
+
'label_placement' => '',
|
888 |
+
'validation_rules' => array(),
|
889 |
+
),
|
890 |
+
'editor_options' => array(
|
891 |
+
'title' => 'reCaptcha',
|
892 |
+
'icon_class' => 'icon-qrcode',
|
893 |
+
'why_disabled_modal' => 'recaptcha',
|
894 |
+
'template' => 'recaptcha',
|
895 |
+
),
|
896 |
+
),
|
897 |
+
'custom_html' => array(
|
898 |
+
'index' => 3,
|
899 |
+
'element' => 'custom_html',
|
900 |
+
'attributes' => array(),
|
901 |
+
'settings' => array(
|
902 |
+
'html_codes' => '<p>Some description about this section</p>',
|
903 |
+
'conditional_logics' => array()
|
904 |
+
),
|
905 |
+
'editor_options' => array(
|
906 |
+
'title' => 'Custom HTML',
|
907 |
+
'icon_class' => 'icon-code',
|
908 |
+
'template' => 'customHTML',
|
909 |
+
)
|
910 |
+
),
|
911 |
+
'shortcode' => array(
|
912 |
+
'index' => 4,
|
913 |
+
'element' => 'shortcode',
|
914 |
+
'attributes' => array(
|
915 |
+
'id' => '',
|
916 |
+
'class' => ''
|
917 |
+
),
|
918 |
+
'settings' => array(
|
919 |
+
'shortcode' => '[your_shortcode=56]',
|
920 |
+
'conditional_logics' => array(),
|
921 |
+
),
|
922 |
+
'editor_options' => array(
|
923 |
+
'title' => 'Shortcode',
|
924 |
+
'icon_class' => 'icon-certificate',
|
925 |
+
'template' => 'shortcode',
|
926 |
+
)
|
927 |
+
),
|
928 |
+
'terms_and_condition' => array(
|
929 |
+
'index' => 5,
|
930 |
+
'element' => 'terms_and_condition',
|
931 |
+
'attributes' => array(
|
932 |
+
'type' => 'checkbox',
|
933 |
+
'name' => 'terms-n-condition',
|
934 |
+
'value' => false,
|
935 |
+
'class' => '',
|
936 |
+
),
|
937 |
+
'settings' => array(
|
938 |
+
'tnc_html' => 'I have read and agree to the <a href="#">Terms and Conditions</a> and <a href="#">Privacy Policy</a>',
|
939 |
+
'has_checkbox' => true,
|
940 |
+
'container_class' => '',
|
941 |
+
'validation_rules' => array (
|
942 |
+
'required' => array (
|
943 |
+
'value' => false,
|
944 |
+
'message' => 'This field is required',
|
945 |
+
),
|
946 |
+
),
|
947 |
+
'conditional_logics' => array(),
|
948 |
+
),
|
949 |
+
'editor_options' => array(
|
950 |
+
'title' => 'Terms & Conditions',
|
951 |
+
'icon_class' => 'icon-check-square-o',
|
952 |
+
'template' => 'termsCheckbox'
|
953 |
+
),
|
954 |
+
),
|
955 |
+
'action_hook' => array(
|
956 |
+
'index' => 6,
|
957 |
+
'element' => 'action_hook',
|
958 |
+
'attributes' => array(
|
959 |
+
'id' => '',
|
960 |
+
'class' => ''
|
961 |
+
),
|
962 |
+
'settings' => array(
|
963 |
+
'hook_name' => 'YOUR_CUSTOM_HOOK_NAME',
|
964 |
+
'conditional_logics' => array(),
|
965 |
+
),
|
966 |
+
'editor_options' => array(
|
967 |
+
'title' => 'Action Hook',
|
968 |
+
'icon_class' => 'icon-paragraph',
|
969 |
+
'template' => 'actionHook'
|
970 |
+
)
|
971 |
+
),
|
972 |
+
'form_step' => array(
|
973 |
+
'index' => 7,
|
974 |
+
'element' => 'form_step',
|
975 |
+
'attributes' => [
|
976 |
+
'id' => '',
|
977 |
+
'class' => '',
|
978 |
+
],
|
979 |
+
'settings' => [
|
980 |
+
'prev_btn' => [
|
981 |
+
'type' => 'default',
|
982 |
+
'text' => 'Previous',
|
983 |
+
'img_url' => '',
|
984 |
+
],
|
985 |
+
'next_btn' => [
|
986 |
+
'type' => 'default',
|
987 |
+
'text' => 'Next',
|
988 |
+
'img_url' => '',
|
989 |
+
],
|
990 |
+
],
|
991 |
+
'editor_options' => [
|
992 |
+
'title' => 'Form Step',
|
993 |
+
'icon_class' => 'icon-step-forward',
|
994 |
+
'template' => 'formStep',
|
995 |
+
],
|
996 |
+
),
|
997 |
+
),
|
998 |
+
'container' => array(
|
999 |
+
'container_2_col' => array(
|
1000 |
+
'index' => 1,
|
1001 |
+
'element' => 'container',
|
1002 |
+
'attributes' => array(),
|
1003 |
+
'settings' => array(),
|
1004 |
+
'columns' => array(
|
1005 |
+
array( 'fields' => array() ),
|
1006 |
+
array( 'fields' => array() ),
|
1007 |
+
),
|
1008 |
+
'editor_options' =>
|
1009 |
+
array(
|
1010 |
+
'title' => 'Two Column Container',
|
1011 |
+
'icon_class' => 'icon-columns',
|
1012 |
+
),
|
1013 |
+
),
|
1014 |
+
'container_3_col' => array(
|
1015 |
+
'index' => 2,
|
1016 |
+
'element' => 'container',
|
1017 |
+
'attributes' => array(),
|
1018 |
+
'settings' => array(),
|
1019 |
+
'columns' => array(
|
1020 |
+
array( 'fields' => array() ),
|
1021 |
+
array( 'fields' => array() ),
|
1022 |
+
array( 'fields' => array() ),
|
1023 |
+
),
|
1024 |
+
'editor_options' => array(
|
1025 |
+
'title' => 'Three Column Container',
|
1026 |
+
'icon_class' => 'icon-columns',
|
1027 |
+
),
|
1028 |
+
)
|
1029 |
+
),
|
1030 |
+
);
|
app/Services/FormBuilder/EditorShortcodeParser.php
ADDED
@@ -0,0 +1,158 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services\FormBuilder;
|
4 |
+
|
5 |
+
use FluentForm\Request;
|
6 |
+
use FluentForm\App\Services\Browser\Browser;
|
7 |
+
|
8 |
+
class EditorShortcodeParser
|
9 |
+
{
|
10 |
+
/**
|
11 |
+
* Available dynamic short codes
|
12 |
+
* @var null
|
13 |
+
*/
|
14 |
+
private static $dynamicShortcodes = null;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* mappings of methods to parse the shortcode
|
18 |
+
* @var array
|
19 |
+
*/
|
20 |
+
private static $handlers = array(
|
21 |
+
'ip' => 'parseIp',
|
22 |
+
'date.m/d/Y' => 'parseDate',
|
23 |
+
'date.d/m/Y' => 'parseDate',
|
24 |
+
|
25 |
+
'embed_post.ID' => 'parsePostProperties',
|
26 |
+
'embed_post.post_title' => 'parsePostProperties',
|
27 |
+
'embed_post.permalink' => 'parsePostProperties',
|
28 |
+
|
29 |
+
'user.ID' => 'parseUserProperties',
|
30 |
+
'user.display_name' => 'parseUserProperties',
|
31 |
+
'user.first_name' => 'parseUserProperties',
|
32 |
+
'user.last_name' => 'parseUserProperties',
|
33 |
+
'user.user_email' => 'parseUserProperties',
|
34 |
+
'user.user_login' => 'parseUserProperties',
|
35 |
+
|
36 |
+
'browser.name' => 'parseBrowserProperties',
|
37 |
+
'browser.platform' => 'parseBrowserProperties',
|
38 |
+
);
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Filter dynamic shortcodes in input value
|
42 |
+
* @param string $value
|
43 |
+
* @return string
|
44 |
+
*/
|
45 |
+
public static function filter($value, $form)
|
46 |
+
{
|
47 |
+
if (is_null(static::$dynamicShortcodes)) {
|
48 |
+
static::$dynamicShortcodes = fluentFormEditorShortCodes();
|
49 |
+
}
|
50 |
+
|
51 |
+
$filteredValue = '';
|
52 |
+
foreach (static::parseValue($value) as $handler) {
|
53 |
+
if (isset(static::$handlers[$handler])) {
|
54 |
+
$filteredValue .= call_user_func_array(
|
55 |
+
array(__CLASS__, static::$handlers[$handler]), ['{'.$handler.'}', $form]
|
56 |
+
);
|
57 |
+
} else {
|
58 |
+
$filteredValue .= $handler;
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
return $filteredValue ? $filteredValue : $value;
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Parse the curly braced shortcode into array
|
67 |
+
* @param string $value
|
68 |
+
* @return mixed
|
69 |
+
*/
|
70 |
+
private static function parseValue($value)
|
71 |
+
{
|
72 |
+
if(!is_array($value)) {
|
73 |
+
return preg_split(
|
74 |
+
'/{(.*?)}/', $value, null, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY
|
75 |
+
);
|
76 |
+
}
|
77 |
+
|
78 |
+
return $value;
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Declare all parsers and must be [private] static methods
|
83 |
+
*/
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Parse loggedin user properties
|
87 |
+
* @param string $value
|
88 |
+
* @return string
|
89 |
+
*/
|
90 |
+
private static function parseUserProperties($value, $form = null)
|
91 |
+
{
|
92 |
+
if ($user = wp_get_current_user()) {
|
93 |
+
$prop = substr(str_replace(['{', '}'], '', $value), 5);
|
94 |
+
return $user->{$prop};
|
95 |
+
}
|
96 |
+
|
97 |
+
return $value;
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Parse loggedin user properties
|
102 |
+
* @param string $value
|
103 |
+
* @return string
|
104 |
+
*/
|
105 |
+
private static function parsePostProperties($value, $form = null)
|
106 |
+
{
|
107 |
+
global $post;
|
108 |
+
if ($post) {
|
109 |
+
$prop = substr(str_replace(['{', '}'], '', $value), 11);
|
110 |
+
if ($prop == 'permalink') {
|
111 |
+
return get_permalink(get_post()->ID);
|
112 |
+
}
|
113 |
+
return $post->{$prop};
|
114 |
+
}
|
115 |
+
|
116 |
+
return $value;
|
117 |
+
}
|
118 |
+
|
119 |
+
/**
|
120 |
+
* Parse browser/user-agent properties
|
121 |
+
* @param string $value
|
122 |
+
* @return string
|
123 |
+
*/
|
124 |
+
private static function parseBrowserProperties($value, $form = null)
|
125 |
+
{
|
126 |
+
$browser = new Browser;
|
127 |
+
if ($value == '{browser.name}') {
|
128 |
+
return $browser->getBrowser();
|
129 |
+
} elseif ($value == '{browser.platform}') {
|
130 |
+
return $browser->getPlatform();
|
131 |
+
}
|
132 |
+
|
133 |
+
return $value;
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* Parse ip shortcode
|
138 |
+
* @param string $value
|
139 |
+
* @return string
|
140 |
+
*/
|
141 |
+
private static function parseIp($value, $form = null)
|
142 |
+
{
|
143 |
+
$ip = Request::getIp();
|
144 |
+
return $ip ? $ip : $value;
|
145 |
+
}
|
146 |
+
|
147 |
+
/**
|
148 |
+
* Parse date shortcode
|
149 |
+
* @param string $value
|
150 |
+
* @return string
|
151 |
+
*/
|
152 |
+
private static function parseDate($value, $form = null)
|
153 |
+
{
|
154 |
+
$format = substr(str_replace(['}', '{'], '', $value), 5);
|
155 |
+
$date = date($format);
|
156 |
+
return $date ? $date : $value;
|
157 |
+
}
|
158 |
+
}
|
app/Services/FormBuilder/FormBuilder.php
ADDED
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services\FormBuilder;
|
4 |
+
|
5 |
+
class FormBuilder
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* The Applivcation instance
|
9 |
+
* @var Framework\Foundation\Application
|
10 |
+
*/
|
11 |
+
protected $app = null;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Conditional logic for elements
|
15 |
+
* @var array
|
16 |
+
*/
|
17 |
+
public $conditions = array();
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Validation rules for elements
|
21 |
+
* @var array
|
22 |
+
*/
|
23 |
+
public $validationRules = array();
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Construct the form builder instance
|
27 |
+
* @param Framework\Foundation\Application $app
|
28 |
+
*/
|
29 |
+
public function __construct($app)
|
30 |
+
{
|
31 |
+
$this->app = $app;
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Render the form
|
36 |
+
* @param StdClass $form [Form entry from database]
|
37 |
+
* @return mixed
|
38 |
+
*/
|
39 |
+
public function build($form)
|
40 |
+
{
|
41 |
+
$labelPlacement = $form->settings['layout']['labelPlacement'];
|
42 |
+
ob_start();
|
43 |
+
echo "<div class='fluentform'>";
|
44 |
+
echo "<form data-form_id={$form->id} id=fluentform_{$form->id} class='frm-fluent-form ff-el-form-{$labelPlacement}'>";
|
45 |
+
echo "<input type='hidden' name='__fluent_form_embded_post_id' value='".get_the_ID()."' />";
|
46 |
+
|
47 |
+
wp_nonce_field('fluentform-submit-form', '_fluentform_'.$form->id.'_fluentformnonce', true, true);
|
48 |
+
|
49 |
+
if (isset($form->fields['stepsWrapper']) && $form->fields['stepsWrapper']) {
|
50 |
+
$this->app->doAction('render_item_step_start', $form->fields['stepsWrapper']['stepStart'], $form);
|
51 |
+
}
|
52 |
+
|
53 |
+
foreach ($form->fields['fields'] as $item) {
|
54 |
+
$item = $this->app->applyFilters('before_render_item', $item, $form);
|
55 |
+
$this->app->doAction('render_item_'.$item['element'], $item, $form);
|
56 |
+
|
57 |
+
$this->extractValidationRules($item);
|
58 |
+
|
59 |
+
$this->extractConditionalLogic($item);
|
60 |
+
}
|
61 |
+
|
62 |
+
if (isset($form->fields['stepsWrapper']) && $form->fields['stepsWrapper']) {
|
63 |
+
$this->app->doAction('render_item_step_end', $form->fields['stepsWrapper']['stepEnd'], $form);
|
64 |
+
}
|
65 |
+
|
66 |
+
$this->app->doAction('render_item_submit_button', $form->fields['submitButton'], $form);
|
67 |
+
echo "</form><div id='fluentform_".$form->id."_errors'></div></div>";
|
68 |
+
|
69 |
+
return ob_get_clean();
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Recursively extract validation rules from a given element
|
74 |
+
* @param array $item
|
75 |
+
* @return void
|
76 |
+
*/
|
77 |
+
protected function extractValidationRules($item)
|
78 |
+
{
|
79 |
+
if (isset($item['columns'])) {
|
80 |
+
foreach ($item['columns'] as $column) {
|
81 |
+
foreach ($column['fields'] as $field) {
|
82 |
+
$this->extractValidationRules($field);
|
83 |
+
}
|
84 |
+
}
|
85 |
+
} elseif (isset($item['fields'])) {
|
86 |
+
$rootName = $item['attributes']['name'];
|
87 |
+
foreach ($item['fields'] as $key => $innerItem) {
|
88 |
+
if ($item['element'] == 'address' || $item['element'] == 'input_name') {
|
89 |
+
$itemName = $innerItem['attributes']['name'];
|
90 |
+
$innerItem['attributes']['name'] = $rootName.'['.$itemName.']';
|
91 |
+
} else {
|
92 |
+
$innerItem['attributes']['name'] = $rootName;
|
93 |
+
}
|
94 |
+
$this->extractValidationRule($innerItem);
|
95 |
+
}
|
96 |
+
} else {
|
97 |
+
$this->extractValidationRule($item);
|
98 |
+
}
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Extract validation rules from a given element
|
103 |
+
* @param array $item
|
104 |
+
* @return void
|
105 |
+
*/
|
106 |
+
protected function extractValidationRule($item)
|
107 |
+
{
|
108 |
+
if (isset($item['settings']['validation_rules'])) {
|
109 |
+
$this->validationRules[
|
110 |
+
$item['attributes']['name']
|
111 |
+
] = $item['settings']['validation_rules'];
|
112 |
+
}
|
113 |
+
}
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Extract conditipnal logic from a given element
|
117 |
+
* @param array $item
|
118 |
+
* @return void
|
119 |
+
*/
|
120 |
+
protected function extractConditionalLogic($item)
|
121 |
+
{
|
122 |
+
// If container like element, then recurse
|
123 |
+
if (isset($item['columns'])) {
|
124 |
+
foreach ($item['columns'] as $column) {
|
125 |
+
foreach ($column['fields'] as $field) {
|
126 |
+
$this->extractConditionalLogic($field);
|
127 |
+
}
|
128 |
+
}
|
129 |
+
}
|
130 |
+
elseif (isset($item['settings']['conditional_logics'])) {
|
131 |
+
$conditionals = $item['settings']['conditional_logics'];
|
132 |
+
if (isset($conditionals['status'])) {
|
133 |
+
if ($conditionals['status'] && $conditionals['conditions']) {
|
134 |
+
$this->conditions[
|
135 |
+
$item['attributes']['name']
|
136 |
+
] = $item['settings']['conditional_logics'];
|
137 |
+
}
|
138 |
+
}
|
139 |
+
}
|
140 |
+
}
|
141 |
+
}
|
app/Services/FormBuilder/GroupSetterProxy.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services\FormBuilder;
|
4 |
+
|
5 |
+
class GroupSetterProxy
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Element group
|
9 |
+
* @var string
|
10 |
+
*/
|
11 |
+
protected $group = null;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* FluentForm\App\Services\FormBuilder\Components
|
15 |
+
* @var object
|
16 |
+
*/
|
17 |
+
protected $collection = null;
|
18 |
+
|
19 |
+
public function __construct($collection, $group)
|
20 |
+
{
|
21 |
+
$this->group = $group;
|
22 |
+
$this->collection = $collection;
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Dynamic call method
|
27 |
+
* @param string $method
|
28 |
+
* @param array $params
|
29 |
+
* @return FluentForm\App\Services\FormBuilder\Components
|
30 |
+
*/
|
31 |
+
public function __call($method, $params)
|
32 |
+
{
|
33 |
+
call_user_func_array([
|
34 |
+
$this->collection, $method
|
35 |
+
], array_merge($params, [$this->group]));
|
36 |
+
|
37 |
+
return $this->collection;
|
38 |
+
}
|
39 |
+
}
|
app/Services/FormBuilder/Notifications/EmailNotification.php
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services\FormBuilder\Notifications;
|
4 |
+
|
5 |
+
use FluentForm\App\Services\FormParser;
|
6 |
+
use FluentForm\App\Services\FormResponseParser;
|
7 |
+
use FluentForm\Framework\Foundation\Application;
|
8 |
+
|
9 |
+
class EmailNotification
|
10 |
+
{
|
11 |
+
/**
|
12 |
+
* FluentForm\Framework\Foundation\Application
|
13 |
+
* @var $app
|
14 |
+
*/
|
15 |
+
protected $app = null;
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Biuld the instance of this class
|
19 |
+
* @param FluentForm\Framework\Foundation\Application $app
|
20 |
+
* @return $this
|
21 |
+
*/
|
22 |
+
public function __construct(Application $app)
|
23 |
+
{
|
24 |
+
$this->app = $app;
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Send the email notification
|
29 |
+
* @param array $notification [Notification settings from form meta]
|
30 |
+
* @param array $submittedData [User submitted form data]
|
31 |
+
* @param StdClass $form [The form object from database]
|
32 |
+
* @return bool
|
33 |
+
*/
|
34 |
+
public function notify($notification, $submittedData, $form)
|
35 |
+
{
|
36 |
+
$headers = array(
|
37 |
+
"From: {$notification['fromName']} <{$notification['fromEmail']}>",
|
38 |
+
"Reply-To: <{$notification['replyTo']}>",
|
39 |
+
"Content-Type: text/html; charset=UTF-8"
|
40 |
+
);
|
41 |
+
|
42 |
+
// $formMeta = $this->getFormInputsAndLabels($form);
|
43 |
+
// $submission = FormResponseParser::transformSubmission(
|
44 |
+
// $submittedData, $formMeta['inputs'], $form->id
|
45 |
+
// );
|
46 |
+
// dd($submission);
|
47 |
+
|
48 |
+
return wp_mail(
|
49 |
+
$notification['sendTo']['email'],
|
50 |
+
$notification['subject'],
|
51 |
+
$notification['message'],
|
52 |
+
$headers
|
53 |
+
);
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* @param $formId
|
58 |
+
* @todo: Implement Caching mechanism so we don't have to parse these things for every request
|
59 |
+
* @return array
|
60 |
+
*/
|
61 |
+
private function getFormInputsAndLabels($form) {
|
62 |
+
$formParser = new FormParser($form);
|
63 |
+
$formInputs = $formParser->getInputs();
|
64 |
+
$inputLabels = $formParser->getAdminLabels($formInputs);
|
65 |
+
return [
|
66 |
+
'inputs' => $formInputs,
|
67 |
+
'labels' => $inputLabels
|
68 |
+
];
|
69 |
+
}
|
70 |
+
}
|
app/Services/FormParser.php
ADDED
@@ -0,0 +1,325 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services;
|
4 |
+
|
5 |
+
use FluentForm\Framework\Helpers\ArrayHelper;
|
6 |
+
|
7 |
+
class FormParser
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* @var \stdClass $form
|
11 |
+
*/
|
12 |
+
protected $form;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* @var array $inputTypes
|
16 |
+
*/
|
17 |
+
protected $inputTypes;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* @var array flattened inputs.
|
21 |
+
*/
|
22 |
+
protected $inputs;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Form Parser constructor.
|
26 |
+
*
|
27 |
+
* @param \stdClass $form
|
28 |
+
*/
|
29 |
+
public function __construct($form)
|
30 |
+
{
|
31 |
+
$this->form = $form;
|
32 |
+
|
33 |
+
// Firing an event so that others can hook into it and add other input types.
|
34 |
+
$this->inputTypes = apply_filters('fluentform_form_input_fields', [
|
35 |
+
'input_text',
|
36 |
+
'input_name',
|
37 |
+
'textarea',
|
38 |
+
'select',
|
39 |
+
'input_radio',
|
40 |
+
'input_checkbox',
|
41 |
+
'input_email',
|
42 |
+
'input_url',
|
43 |
+
'input_password',
|
44 |
+
'input_file',
|
45 |
+
'input_date',
|
46 |
+
'select_country',
|
47 |
+
'input_number',
|
48 |
+
'input_repeat',
|
49 |
+
'address',
|
50 |
+
'terms_and_condition'
|
51 |
+
]);
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Get form fields.
|
56 |
+
*
|
57 |
+
* @return array
|
58 |
+
*/
|
59 |
+
public function getFields($asArray = false)
|
60 |
+
{
|
61 |
+
$fields = $this->form->form_fields;
|
62 |
+
if(!$fields)
|
63 |
+
return ($asArray) ? array() : false;
|
64 |
+
|
65 |
+
return json_decode($fields, $asArray)['fields'];
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Get flatten form inputs. Flatten implies that all
|
70 |
+
* of the form fields will be in a simple array.
|
71 |
+
*
|
72 |
+
* @return array
|
73 |
+
*/
|
74 |
+
public function getInputs($with = [])
|
75 |
+
{
|
76 |
+
$fields = $this->getFields(true);
|
77 |
+
$inputs = [];
|
78 |
+
|
79 |
+
$with = $with ?: ['admin_label', 'element', 'options', 'attributes'];
|
80 |
+
|
81 |
+
$this->inputs = $this->extractor($fields, $inputs, $with);
|
82 |
+
|
83 |
+
return $this->inputs;
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Extract form fields recursively.
|
88 |
+
*
|
89 |
+
* @param array $fields
|
90 |
+
* @param array $inputs
|
91 |
+
*
|
92 |
+
* @return array
|
93 |
+
*/
|
94 |
+
public function extractor($fields = [], &$inputs = [], $with = [])
|
95 |
+
{
|
96 |
+
foreach ($fields as $field) {
|
97 |
+
|
98 |
+
// If the field is a Container (collection of other fields)
|
99 |
+
// then we will recursively call this function to resolve.
|
100 |
+
if ($field['element'] === 'container') {
|
101 |
+
foreach ($field['columns'] as $item) {
|
102 |
+
$this->extractor($item['fields'], $inputs, $with);
|
103 |
+
}
|
104 |
+
}
|
105 |
+
|
106 |
+
// Now the field is supposed to be a flat field.
|
107 |
+
// We can extract the desired keys as we want.
|
108 |
+
else {
|
109 |
+
if (in_array($field['element'], $this->inputTypes)) {
|
110 |
+
|
111 |
+
$response = [];
|
112 |
+
|
113 |
+
if (in_array('admin_label', $with)) {
|
114 |
+
$adminLabel = ArrayHelper::get($field, 'settings.admin_field_label')
|
115 |
+
?: ArrayHelper::get($field, 'settings.label');
|
116 |
+
|
117 |
+
if(!$adminLabel)
|
118 |
+
$adminLabel = $field['element'];
|
119 |
+
$response['admin_label'] = $adminLabel;
|
120 |
+
|
121 |
+
}
|
122 |
+
|
123 |
+
$response['element'] = $field['element'];
|
124 |
+
|
125 |
+
if (in_array('options', $with)) {
|
126 |
+
$response['options'] = ArrayHelper::get($field, 'options', []);
|
127 |
+
}
|
128 |
+
|
129 |
+
if (in_array('attributes', $with)) {
|
130 |
+
$response['attributes'] = ArrayHelper::get($field, 'attributes');
|
131 |
+
}
|
132 |
+
|
133 |
+
if (in_array('rules', $with)) {
|
134 |
+
// There are some rubbish structured fields that needs special
|
135 |
+
// attention. Take it muthafucka, hell with you, dhishooom
|
136 |
+
if (in_array($field['element'], ['input_name', 'input_repeat', 'address'])) {
|
137 |
+
foreach ($field['fields'] as $customField) {
|
138 |
+
$key = $field['attributes']['name'].'['.$customField['attributes']['name'].']';
|
139 |
+
|
140 |
+
// We have to directly push the rules to the $inputs.
|
141 |
+
$inputs[$key]['rules'] = ArrayHelper::get($customField, 'settings.validation_rules');
|
142 |
+
$inputs[$key]['conditionals'] = ArrayHelper::get($customField,
|
143 |
+
'settings.conditional_logics');
|
144 |
+
$inputs[$key]['element'] = $customField['element'];
|
145 |
+
}
|
146 |
+
} else {
|
147 |
+
// otherwise push the rules to the temporary $response.
|
148 |
+
$response['rules'] = ArrayHelper::get($field, 'settings.validation_rules');
|
149 |
+
$response['conditionals'] = ArrayHelper::get($field, 'settings.conditional_logics');
|
150 |
+
}
|
151 |
+
}
|
152 |
+
|
153 |
+
if (! in_array($field['element'], ['input_name', 'input_repeat', 'address'])) {
|
154 |
+
$inputs[$field['attributes']['name']] = $response;
|
155 |
+
}
|
156 |
+
}
|
157 |
+
}
|
158 |
+
}
|
159 |
+
|
160 |
+
return $inputs;
|
161 |
+
}
|
162 |
+
|
163 |
+
|
164 |
+
|
165 |
+
/**
|
166 |
+
* Get flatten form inputs. Flatten implies that all
|
167 |
+
* of the form fields will be in a simple array.
|
168 |
+
* @todo: We may need to refactor this
|
169 |
+
* @return array
|
170 |
+
*/
|
171 |
+
public function getEntryInputs($with = array('admin_label'))
|
172 |
+
{
|
173 |
+
$fields = $this->getFields(true);
|
174 |
+
$inputs = [];
|
175 |
+
|
176 |
+
$this->inputs = $this->entryExtractor($fields, $inputs, $with);
|
177 |
+
|
178 |
+
return $this->inputs;
|
179 |
+
}
|
180 |
+
|
181 |
+
/**
|
182 |
+
* Extract form fields recursively.
|
183 |
+
* @todo: We may need to refactor this
|
184 |
+
*
|
185 |
+
* @param array $fields
|
186 |
+
* @param array $inputs
|
187 |
+
*
|
188 |
+
* @return array
|
189 |
+
*/
|
190 |
+
public function entryExtractor($fields = [], &$inputs = [], $with = [])
|
191 |
+
{
|
192 |
+
foreach ($fields as $field) {
|
193 |
+
|
194 |
+
// If the field is a Container (collection of other fields)
|
195 |
+
// then we will recursively call this function to resolve.
|
196 |
+
if ($field['element'] === 'container') {
|
197 |
+
foreach ($field['columns'] as $item) {
|
198 |
+
$this->entryExtractor($item['fields'], $inputs, $with);
|
199 |
+
}
|
200 |
+
}
|
201 |
+
|
202 |
+
// Now the field is supposed to be a flat field.
|
203 |
+
// We can extract the desired keys as we want.
|
204 |
+
else {
|
205 |
+
if (in_array($field['element'], $this->inputTypes)) {
|
206 |
+
$response = [];
|
207 |
+
$adminLabel = ArrayHelper::get($field, 'settings.admin_field_label')
|
208 |
+
?: ArrayHelper::get($field, 'settings.label');
|
209 |
+
|
210 |
+
if(!$adminLabel)
|
211 |
+
$adminLabel = $field['element'];
|
212 |
+
|
213 |
+
$response['admin_label'] = $adminLabel;
|
214 |
+
|
215 |
+
if (in_array('attributes', $with)) {
|
216 |
+
$response['attributes'] = ArrayHelper::get($field, 'attributes');
|
217 |
+
}
|
218 |
+
|
219 |
+
$response['element'] = $field['element'];
|
220 |
+
$inputs[$field['attributes']['name']] = $response;
|
221 |
+
}
|
222 |
+
}
|
223 |
+
}
|
224 |
+
|
225 |
+
return $inputs;
|
226 |
+
}
|
227 |
+
|
228 |
+
|
229 |
+
/**
|
230 |
+
* Get admin labels of the form fields.
|
231 |
+
*
|
232 |
+
* @param array $fields
|
233 |
+
*
|
234 |
+
* @return array
|
235 |
+
*/
|
236 |
+
public function getAdminLabels($fields = [])
|
237 |
+
{
|
238 |
+
$fields = $fields ?: $this->getInputs(['admin_label']);
|
239 |
+
|
240 |
+
$labels = [];
|
241 |
+
|
242 |
+
foreach ($fields as $key => $field) {
|
243 |
+
$labels[$key] = $field['admin_label'];
|
244 |
+
}
|
245 |
+
|
246 |
+
return $labels;
|
247 |
+
}
|
248 |
+
|
249 |
+
/**
|
250 |
+
* Get admin labels of the form fields.
|
251 |
+
*
|
252 |
+
* @param array $fields
|
253 |
+
*
|
254 |
+
* @return array
|
255 |
+
*/
|
256 |
+
public function getValidations($inputs, $fields = [])
|
257 |
+
{
|
258 |
+
$fields = $fields ?: $this->getInputs(['rules']);
|
259 |
+
|
260 |
+
$rules = [];
|
261 |
+
|
262 |
+
$messages = [];
|
263 |
+
|
264 |
+
foreach ($fields as $fieldName => $field) {
|
265 |
+
$applicable = ConditionAssesor::evaluate($field, $inputs);
|
266 |
+
|
267 |
+
if ($applicable) {
|
268 |
+
foreach ($field['rules'] as $ruleName => $rule) {
|
269 |
+
if ($rule['value']) {
|
270 |
+
$logic = $ruleName.':'.$rule['value'];
|
271 |
+
|
272 |
+
// if there is already a rule for this field we need to
|
273 |
+
// concat current rule to it. else assign current rule.
|
274 |
+
$rules[$fieldName] = isset($rules[$fieldName]) ? $rules[$fieldName].'|'.$logic : $logic;
|
275 |
+
|
276 |
+
$messages[$fieldName.'.'.$ruleName] = $rule['message'];
|
277 |
+
}
|
278 |
+
}
|
279 |
+
}
|
280 |
+
}
|
281 |
+
|
282 |
+
return [$rules, $messages];
|
283 |
+
}
|
284 |
+
|
285 |
+
/**
|
286 |
+
* Determine whether the form has an element.
|
287 |
+
*
|
288 |
+
* @param $name
|
289 |
+
*
|
290 |
+
* @return bool
|
291 |
+
*/
|
292 |
+
public function hasElement($name)
|
293 |
+
{
|
294 |
+
$this->inputTypes = [$name];
|
295 |
+
|
296 |
+
return array_key_exists($name, $this->getInputs(['element']));
|
297 |
+
}
|
298 |
+
|
299 |
+
/**
|
300 |
+
* Determine whether the form has any required fields.
|
301 |
+
*
|
302 |
+
* @param array $fields
|
303 |
+
*
|
304 |
+
* @return bool
|
305 |
+
*/
|
306 |
+
public function hasRequiredFields($fields = [])
|
307 |
+
{
|
308 |
+
// $fields can be user provided when called this method or,
|
309 |
+
// the current object could have already parsed fields or,
|
310 |
+
// we should parse the form and use the processed result.
|
311 |
+
$fields = $fields ?: $this->inputs ?: $this->getInputs(['rules']);
|
312 |
+
|
313 |
+
$exist = false;
|
314 |
+
|
315 |
+
foreach ($fields as $field) {
|
316 |
+
$exist = ArrayHelper::get($field, 'rules.required.value');
|
317 |
+
|
318 |
+
if ($exist) {
|
319 |
+
break;
|
320 |
+
}
|
321 |
+
}
|
322 |
+
|
323 |
+
return (boolean) $exist;
|
324 |
+
}
|
325 |
+
}
|
app/Services/FormResponseParser.php
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services;
|
4 |
+
|
5 |
+
class FormResponseParser
|
6 |
+
{
|
7 |
+
public static function transformResponse($response, $fields, $formId)
|
8 |
+
{
|
9 |
+
$trans = [];
|
10 |
+
foreach ($fields as $field_key => $field) {
|
11 |
+
if (isset($response->$field_key)) {
|
12 |
+
$value = apply_filters('fluentform_response_render_'.$field['element'], $response->$field_key, $field,
|
13 |
+
$formId);
|
14 |
+
|
15 |
+
if (is_array($value) || is_object($value)) {
|
16 |
+
$value = (array) $value;
|
17 |
+
|
18 |
+
$value = implode(', ', array_filter(array_values($value)));
|
19 |
+
}
|
20 |
+
|
21 |
+
$trans[$field_key] = $value;
|
22 |
+
} else {
|
23 |
+
$trans[$field_key] = null;
|
24 |
+
}
|
25 |
+
}
|
26 |
+
return $trans;
|
27 |
+
}
|
28 |
+
|
29 |
+
public static function transformSubmissions($submissions, $fields, $formId)
|
30 |
+
{
|
31 |
+
foreach ($submissions as $submission) {
|
32 |
+
$response = json_decode($submission->response);
|
33 |
+
$submission->user_inputs = self::transformResponse($response, $fields, $formId);
|
34 |
+
}
|
35 |
+
return $submissions;
|
36 |
+
}
|
37 |
+
|
38 |
+
public static function transformSubmission($submission, $fields, $formId)
|
39 |
+
{
|
40 |
+
$response = json_decode($submission->response);
|
41 |
+
$submission->user_inputs = self::transformResponse($response, $fields, $formId);
|
42 |
+
return $submission;
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Transform the select field response.
|
47 |
+
*
|
48 |
+
* @param string|null $response
|
49 |
+
*
|
50 |
+
* @return string|null $response
|
51 |
+
*/
|
52 |
+
public static function transformSelectField($response = null)
|
53 |
+
{
|
54 |
+
if ($response) {
|
55 |
+
if (is_array($response)) {
|
56 |
+
$response = implode(', ', $response);
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
return $response;
|
61 |
+
}
|
62 |
+
|
63 |
+
public static function transformNameField($response = null) {
|
64 |
+
if(!$response)
|
65 |
+
return;
|
66 |
+
if (is_array($response) || is_object($response)) {
|
67 |
+
$response = implode(' ', (Array) $response);
|
68 |
+
}
|
69 |
+
return $response;
|
70 |
+
}
|
71 |
+
}
|
app/Services/Integrations/MailChimp.php
ADDED
@@ -0,0 +1,441 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php namespace FluentForm\App\Services\Integrations;
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Super-simple, minimum abstraction MailChimp API v3 wrapper
|
5 |
+
* MailChimp API v3: http://developer.mailchimp.com
|
6 |
+
* This wrapper: https://github.com/drewm/mailchimp-api
|
7 |
+
*
|
8 |
+
* @author Drew McLellan <drew.mclellan@gmail.com>
|
9 |
+
* @version 2.4
|
10 |
+
*/
|
11 |
+
class MailChimp
|
12 |
+
{
|
13 |
+
private $api_key;
|
14 |
+
private $api_endpoint = 'https://<dc>.api.mailchimp.com/3.0';
|
15 |
+
|
16 |
+
const TIMEOUT = 10;
|
17 |
+
|
18 |
+
/* SSL Verification
|
19 |
+
Read before disabling:
|
20 |
+
http://snippets.webaware.com.au/howto/stop-turning-off-curlopt_ssl_verifypeer-and-fix-your-php-config/
|
21 |
+
*/
|
22 |
+
public $verify_ssl = true;
|
23 |
+
|
24 |
+
private $request_successful = false;
|
25 |
+
private $last_error = '';
|
26 |
+
private $last_response = array();
|
27 |
+
private $last_request = array();
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Create a new instance
|
31 |
+
* @param string $api_key Your MailChimp API key
|
32 |
+
* @param string $api_endpoint Optional custom API endpoint
|
33 |
+
* @throws \Exception
|
34 |
+
*/
|
35 |
+
public function __construct($api_key, $api_endpoint = null)
|
36 |
+
{
|
37 |
+
$this->api_key = $api_key;
|
38 |
+
|
39 |
+
if ($api_endpoint === null) {
|
40 |
+
if (strpos($this->api_key, '-') === false) {
|
41 |
+
throw new \Exception("Invalid MailChimp API key `{$api_key}` supplied.");
|
42 |
+
}
|
43 |
+
list(, $data_center) = explode('-', $this->api_key);
|
44 |
+
$this->api_endpoint = str_replace('<dc>', $data_center, $this->api_endpoint);
|
45 |
+
} else {
|
46 |
+
$this->api_endpoint = $api_endpoint;
|
47 |
+
}
|
48 |
+
|
49 |
+
$this->last_response = array('headers' => null, 'body' => null);
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* @return string The url to the API endpoint
|
54 |
+
*/
|
55 |
+
public function getApiEndpoint()
|
56 |
+
{
|
57 |
+
return $this->api_endpoint;
|
58 |
+
}
|
59 |
+
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Convert an email address into a 'subscriber hash' for identifying the subscriber in a method URL
|
63 |
+
* @param string $email The subscriber's email address
|
64 |
+
* @return string Hashed version of the input
|
65 |
+
*/
|
66 |
+
public function subscriberHash($email)
|
67 |
+
{
|
68 |
+
return md5(strtolower($email));
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Was the last request successful?
|
73 |
+
* @return bool True for success, false for failure
|
74 |
+
*/
|
75 |
+
public function success()
|
76 |
+
{
|
77 |
+
return $this->request_successful;
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Get the last error returned by either the network transport, or by the API.
|
82 |
+
* If something didn't work, this should contain the string describing the problem.
|
83 |
+
* @return string|false describing the error
|
84 |
+
*/
|
85 |
+
public function getLastError()
|
86 |
+
{
|
87 |
+
return $this->last_error ?: false;
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Get an array containing the HTTP headers and the body of the API response.
|
92 |
+
* @return array Assoc array with keys 'headers' and 'body'
|
93 |
+
*/
|
94 |
+
public function getLastResponse()
|
95 |
+
{
|
96 |
+
return $this->last_response;
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Get an array containing the HTTP headers and the body of the API request.
|
101 |
+
* @return array Assoc array
|
102 |
+
*/
|
103 |
+
public function getLastRequest()
|
104 |
+
{
|
105 |
+
return $this->last_request;
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Make an HTTP DELETE request - for deleting data
|
110 |
+
* @param string $method URL of the API request method
|
111 |
+
* @param array $args Assoc array of arguments (if any)
|
112 |
+
* @param int $timeout Timeout limit for request in seconds
|
113 |
+
* @return array|false Assoc array of API response, decoded from JSON
|
114 |
+
*/
|
115 |
+
public function delete($method, $args = array(), $timeout = self::TIMEOUT)
|
116 |
+
{
|
117 |
+
return $this->makeRequest('delete', $method, $args, $timeout);
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Make an HTTP GET request - for retrieving data
|
122 |
+
* @param string $method URL of the API request method
|
123 |
+
* @param array $args Assoc array of arguments (usually your data)
|
124 |
+
* @param int $timeout Timeout limit for request in seconds
|
125 |
+
* @return array|false Assoc array of API response, decoded from JSON
|
126 |
+
*/
|
127 |
+
public function get($method, $args = array(), $timeout = self::TIMEOUT)
|
128 |
+
{
|
129 |
+
return $this->makeRequest('get', $method, $args, $timeout);
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Make an HTTP PATCH request - for performing partial updates
|
134 |
+
* @param string $method URL of the API request method
|
135 |
+
* @param array $args Assoc array of arguments (usually your data)
|
136 |
+
* @param int $timeout Timeout limit for request in seconds
|
137 |
+
* @return array|false Assoc array of API response, decoded from JSON
|
138 |
+
*/
|
139 |
+
public function patch($method, $args = array(), $timeout = self::TIMEOUT)
|
140 |
+
{
|
141 |
+
return $this->makeRequest('patch', $method, $args, $timeout);
|
142 |
+
}
|
143 |
+
|
144 |
+
/**
|
145 |
+
* Make an HTTP POST request - for creating and updating items
|
146 |
+
* @param string $method URL of the API request method
|
147 |
+
* @param array $args Assoc array of arguments (usually your data)
|
148 |
+
* @param int $timeout Timeout limit for request in seconds
|
149 |
+
* @return array|false Assoc array of API response, decoded from JSON
|
150 |
+
*/
|
151 |
+
public function post($method, $args = array(), $timeout = self::TIMEOUT)
|
152 |
+
{
|
153 |
+
return $this->makeRequest('post', $method, $args, $timeout);
|
154 |
+
}
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Make an HTTP PUT request - for creating new items
|
158 |
+
* @param string $method URL of the API request method
|
159 |
+
* @param array $args Assoc array of arguments (usually your data)
|
160 |
+
* @param int $timeout Timeout limit for request in seconds
|
161 |
+
* @return array|false Assoc array of API response, decoded from JSON
|
162 |
+
*/
|
163 |
+
public function put($method, $args = array(), $timeout = self::TIMEOUT)
|
164 |
+
{
|
165 |
+
return $this->makeRequest('put', $method, $args, $timeout);
|
166 |
+
}
|
167 |
+
|
168 |
+
/**
|
169 |
+
* Performs the underlying HTTP request. Not very exciting.
|
170 |
+
* @param string $http_verb The HTTP verb to use: get, post, put, patch, delete
|
171 |
+
* @param string $method The API method to be called
|
172 |
+
* @param array $args Assoc array of parameters to be passed
|
173 |
+
* @param int $timeout
|
174 |
+
* @return array|false Assoc array of decoded result
|
175 |
+
* @throws \Exception
|
176 |
+
*/
|
177 |
+
private function makeRequest($http_verb, $method, $args = array(), $timeout = self::TIMEOUT)
|
178 |
+
{
|
179 |
+
if (!function_exists('curl_init') || !function_exists('curl_setopt')) {
|
180 |
+
throw new \Exception("cURL support is required, but can't be found.");
|
181 |
+
}
|
182 |
+
|
183 |
+
$url = $this->api_endpoint . '/' . $method;
|
184 |
+
|
185 |
+
$response = $this->prepareStateForRequest($http_verb, $method, $url, $timeout);
|
186 |
+
|
187 |
+
$httpHeader = array(
|
188 |
+
'Accept: application/vnd.api+json',
|
189 |
+
'Content-Type: application/vnd.api+json',
|
190 |
+
'Authorization: apikey ' . $this->api_key
|
191 |
+
);
|
192 |
+
|
193 |
+
if (isset($args["language"])) {
|
194 |
+
$httpHeader[] = "Accept-Language: " . $args["language"];
|
195 |
+
}
|
196 |
+
|
197 |
+
$ch = curl_init();
|
198 |
+
curl_setopt($ch, CURLOPT_URL, $url);
|
199 |
+
curl_setopt($ch, CURLOPT_HTTPHEADER, $httpHeader);
|
200 |
+
curl_setopt($ch, CURLOPT_USERAGENT, 'DrewM/MailChimp-API/3.0 (github.com/drewm/mailchimp-api)');
|
201 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
202 |
+
curl_setopt($ch, CURLOPT_VERBOSE, true);
|
203 |
+
curl_setopt($ch, CURLOPT_HEADER, true);
|
204 |
+
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
|
205 |
+
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->verify_ssl);
|
206 |
+
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
|
207 |
+
curl_setopt($ch, CURLOPT_ENCODING, '');
|
208 |
+
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
|
209 |
+
|
210 |
+
switch ($http_verb) {
|
211 |
+
case 'post':
|
212 |
+
curl_setopt($ch, CURLOPT_POST, true);
|
213 |
+
$this->attachRequestPayload($ch, $args);
|
214 |
+
break;
|
215 |
+
|
216 |
+
case 'get':
|
217 |
+
$query = http_build_query($args, '', '&');
|
218 |
+
curl_setopt($ch, CURLOPT_URL, $url . '?' . $query);
|
219 |
+
break;
|
220 |
+
|
221 |
+
case 'delete':
|
222 |
+
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
|
223 |
+
break;
|
224 |
+
|
225 |
+
case 'patch':
|
226 |
+
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
|
227 |
+
$this->attachRequestPayload($ch, $args);
|
228 |
+
break;
|
229 |
+
|
230 |
+
case 'put':
|
231 |
+
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
|
232 |
+
$this->attachRequestPayload($ch, $args);
|
233 |
+
break;
|
234 |
+
}
|
235 |
+
|
236 |
+
$responseContent = curl_exec($ch);
|
237 |
+
$response['headers'] = curl_getinfo($ch);
|
238 |
+
$response = $this->setResponseState($response, $responseContent, $ch);
|
239 |
+
$formattedResponse = $this->formatResponse($response);
|
240 |
+
|
241 |
+
curl_close($ch);
|
242 |
+
|
243 |
+
$this->determineSuccess($response, $formattedResponse, $timeout);
|
244 |
+
|
245 |
+
return $formattedResponse;
|
246 |
+
}
|
247 |
+
|
248 |
+
/**
|
249 |
+
* @param string $http_verb
|
250 |
+
* @param string $method
|
251 |
+
* @param string $url
|
252 |
+
* @param integer $timeout
|
253 |
+
*/
|
254 |
+
private function prepareStateForRequest($http_verb, $method, $url, $timeout)
|
255 |
+
{
|
256 |
+
$this->last_error = '';
|
257 |
+
|
258 |
+
$this->request_successful = false;
|
259 |
+
|
260 |
+
$this->last_response = array(
|
261 |
+
'headers' => null, // array of details from curl_getinfo()
|
262 |
+
'httpHeaders' => null, // array of HTTP headers
|
263 |
+
'body' => null // content of the response
|
264 |
+
);
|
265 |
+
|
266 |
+
$this->last_request = array(
|
267 |
+
'method' => $http_verb,
|
268 |
+
'path' => $method,
|
269 |
+
'url' => $url,
|
270 |
+
'body' => '',
|
271 |
+
'timeout' => $timeout,
|
272 |
+
);
|
273 |
+
|
274 |
+
return $this->last_response;
|
275 |
+
}
|
276 |
+
|
277 |
+
/**
|
278 |
+
* Get the HTTP headers as an array of header-name => header-value pairs.
|
279 |
+
*
|
280 |
+
* The "Link" header is parsed into an associative array based on the
|
281 |
+
* rel names it contains. The original value is available under
|
282 |
+
* the "_raw" key.
|
283 |
+
*
|
284 |
+
* @param string $headersAsString
|
285 |
+
* @return array
|
286 |
+
*/
|
287 |
+
private function getHeadersAsArray($headersAsString)
|
288 |
+
{
|
289 |
+
$headers = array();
|
290 |
+
|
291 |
+
foreach (explode("\r\n", $headersAsString) as $i => $line) {
|
292 |
+
if ($i === 0) { // HTTP code
|
293 |
+
continue;
|
294 |
+
}
|
295 |
+
|
296 |
+
$line = trim($line);
|
297 |
+
if (empty($line)) {
|
298 |
+
continue;
|
299 |
+
}
|
300 |
+
|
301 |
+
list($key, $value) = explode(': ', $line);
|
302 |
+
|
303 |
+
if ($key == 'Link') {
|
304 |
+
$value = array_merge(
|
305 |
+
array('_raw' => $value),
|
306 |
+
$this->getLinkHeaderAsArray($value)
|
307 |
+
);
|
308 |
+
}
|
309 |
+
|
310 |
+
$headers[$key] = $value;
|
311 |
+
}
|
312 |
+
|
313 |
+
return $headers;
|
314 |
+
}
|
315 |
+
|
316 |
+
/**
|
317 |
+
* Extract all rel => URL pairs from the provided Link header value
|
318 |
+
*
|
319 |
+
* Mailchimp only implements the URI reference and relation type from
|
320 |
+
* RFC 5988, so the value of the header is something like this:
|
321 |
+
*
|
322 |
+
* 'https://us13.api.mailchimp.com/schema/3.0/Lists/Instance.json; rel="describedBy", <https://us13.admin.mailchimp.com/lists/members/?id=XXXX>; rel="dashboard"'
|
323 |
+
*
|
324 |
+
* @param string $linkHeaderAsString
|
325 |
+
* @return array
|
326 |
+
*/
|
327 |
+
private function getLinkHeaderAsArray($linkHeaderAsString)
|
328 |
+
{
|
329 |
+
$urls = array();
|
330 |
+
|
331 |
+
if (preg_match_all('/<(.*?)>\s*;\s*rel="(.*?)"\s*/', $linkHeaderAsString, $matches)) {
|
332 |
+
foreach ($matches[2] as $i => $relName) {
|
333 |
+
$urls[$relName] = $matches[1][$i];
|
334 |
+
}
|
335 |
+
}
|
336 |
+
|
337 |
+
return $urls;
|
338 |
+
}
|
339 |
+
|
340 |
+
/**
|
341 |
+
* Encode the data and attach it to the request
|
342 |
+
* @param resource $ch cURL session handle, used by reference
|
343 |
+
* @param array $data Assoc array of data to attach
|
344 |
+
*/
|
345 |
+
private function attachRequestPayload(&$ch, $data)
|
346 |
+
{
|
347 |
+
$encoded = json_encode($data);
|
348 |
+
$this->last_request['body'] = $encoded;
|
349 |
+
curl_setopt($ch, CURLOPT_POSTFIELDS, $encoded);
|
350 |
+
}
|
351 |
+
|
352 |
+
/**
|
353 |
+
* Decode the response and format any error messages for debugging
|
354 |
+
* @param array $response The response from the curl request
|
355 |
+
* @return array|false The JSON decoded into an array
|
356 |
+
*/
|
357 |
+
private function formatResponse($response)
|
358 |
+
{
|
359 |
+
$this->last_response = $response;
|
360 |
+
|
361 |
+
if (!empty($response['body'])) {
|
362 |
+
return json_decode($response['body'], true);
|
363 |
+
}
|
364 |
+
|
365 |
+
return false;
|
366 |
+
}
|
367 |
+
|
368 |
+
/**
|
369 |
+
* Do post-request formatting and setting state from the response
|
370 |
+
* @param array $response The response from the curl request
|
371 |
+
* @param string $responseContent The body of the response from the curl request
|
372 |
+
* * @return array The modified response
|
373 |
+
*/
|
374 |
+
private function setResponseState($response, $responseContent, $ch)
|
375 |
+
{
|
376 |
+
if ($responseContent === false) {
|
377 |
+
$this->last_error = curl_error($ch);
|
378 |
+
} else {
|
379 |
+
|
380 |
+
$headerSize = $response['headers']['header_size'];
|
381 |
+
|
382 |
+
$response['httpHeaders'] = $this->getHeadersAsArray(substr($responseContent, 0, $headerSize));
|
383 |
+
$response['body'] = substr($responseContent, $headerSize);
|
384 |
+
|
385 |
+
if (isset($response['headers']['request_header'])) {
|
386 |
+
$this->last_request['headers'] = $response['headers']['request_header'];
|
387 |
+
}
|
388 |
+
}
|
389 |
+
|
390 |
+
return $response;
|
391 |
+
}
|
392 |
+
|
393 |
+
/**
|
394 |
+
* Check if the response was successful or a failure. If it failed, store the error.
|
395 |
+
* @param array $response The response from the curl request
|
396 |
+
* @param array|false $formattedResponse The response body payload from the curl request
|
397 |
+
* @param int $timeout The timeout supplied to the curl request.
|
398 |
+
* @return bool If the request was successful
|
399 |
+
*/
|
400 |
+
private function determineSuccess($response, $formattedResponse, $timeout)
|
401 |
+
{
|
402 |
+
$status = $this->findHTTPStatus($response, $formattedResponse);
|
403 |
+
|
404 |
+
if ($status >= 200 && $status <= 299) {
|
405 |
+
$this->request_successful = true;
|
406 |
+
return true;
|
407 |
+
}
|
408 |
+
|
409 |
+
if (isset($formattedResponse['detail'])) {
|
410 |
+
$this->last_error = sprintf('%d: %s', $formattedResponse['status'], $formattedResponse['detail']);
|
411 |
+
return false;
|
412 |
+
}
|
413 |
+
|
414 |
+
if( $timeout > 0 && $response['headers'] && $response['headers']['total_time'] >= $timeout ) {
|
415 |
+
$this->last_error = sprintf('Request timed out after %f seconds.', $response['headers']['total_time'] );
|
416 |
+
return false;
|
417 |
+
}
|
418 |
+
|
419 |
+
$this->last_error = 'Unknown error, call getLastResponse() to find out what happened.';
|
420 |
+
return false;
|
421 |
+
}
|
422 |
+
|
423 |
+
/**
|
424 |
+
* Find the HTTP status code from the headers or API response body
|
425 |
+
* @param array $response The response from the curl request
|
426 |
+
* @param array|false $formattedResponse The response body payload from the curl request
|
427 |
+
* @return int HTTP status code
|
428 |
+
*/
|
429 |
+
private function findHTTPStatus($response, $formattedResponse)
|
430 |
+
{
|
431 |
+
if (!empty($response['headers']) && isset($response['headers']['http_code'])) {
|
432 |
+
return (int) $response['headers']['http_code'];
|
433 |
+
}
|
434 |
+
|
435 |
+
if (!empty($response['body']) && isset($formattedResponse['status'])) {
|
436 |
+
return (int) $formattedResponse['status'];
|
437 |
+
}
|
438 |
+
|
439 |
+
return 418;
|
440 |
+
}
|
441 |
+
}
|
app/Services/Providers/MailChimp.php
ADDED
@@ -0,0 +1,148 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services\Providers;
|
4 |
+
|
5 |
+
class MailChimp
|
6 |
+
{
|
7 |
+
private $apiKey;
|
8 |
+
|
9 |
+
private $dataCenter;
|
10 |
+
|
11 |
+
public function __construct($apiKey = '')
|
12 |
+
{
|
13 |
+
$this->apiKey = $apiKey;
|
14 |
+
|
15 |
+
$this->setDataCenter();
|
16 |
+
|
17 |
+
$this->processRequest();
|
18 |
+
}
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Set data center by parsing the API key.
|
22 |
+
*/
|
23 |
+
private function setDataCenter()
|
24 |
+
{
|
25 |
+
if (! $this->apiKey) {
|
26 |
+
return;
|
27 |
+
}
|
28 |
+
|
29 |
+
$explodedKey = explode('-', $this->apiKey);
|
30 |
+
|
31 |
+
$this->dataCenter = isset($explodedKey[1]) ? $explodedKey[1] : 'us1';
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* @param string $path
|
36 |
+
* @param array $data
|
37 |
+
* @param string $method
|
38 |
+
* @param null $return_key
|
39 |
+
*
|
40 |
+
* @return array|mixed|object
|
41 |
+
* @throws \Exception
|
42 |
+
*/
|
43 |
+
private function processRequest($path = '', $data = array(), $method = 'GET', $return_key = null)
|
44 |
+
{
|
45 |
+
if (! $this->apiKey) {
|
46 |
+
throw new \Exception('API key must be defined to process an API request.');
|
47 |
+
}
|
48 |
+
|
49 |
+
$requestUrl = 'https://'.$this->dataCenter.'.api.mailchimp.com/3.0/'.$path;
|
50 |
+
|
51 |
+
// Add request URL parameters if needed.
|
52 |
+
if ('GET' === $method && ! empty($data)) {
|
53 |
+
$requestUrl = add_query_arg($data, $requestUrl);
|
54 |
+
}
|
55 |
+
|
56 |
+
dd($requestUrl, 'req_url');
|
57 |
+
|
58 |
+
// Build base request arguments.
|
59 |
+
$args = array(
|
60 |
+
'method' => $method,
|
61 |
+
'headers' => array(
|
62 |
+
'Accept' => 'application/json',
|
63 |
+
'Authorization' => 'Basic '.base64_encode(':'.$this->api_key),
|
64 |
+
'Content-Type' => 'application/json',
|
65 |
+
),
|
66 |
+
/**
|
67 |
+
* Filters if SSL verification should occur.
|
68 |
+
*
|
69 |
+
* @param bool false If the SSL certificate should be verified. Defalts to false.
|
70 |
+
*
|
71 |
+
* @return bool
|
72 |
+
*/
|
73 |
+
'sslverify' => apply_filters('https_local_ssl_verify', false),
|
74 |
+
/**
|
75 |
+
* Sets the HTTP timeout, in seconds, for the request.
|
76 |
+
*
|
77 |
+
* @param int 30 The timeout limit, in seconds. Defalts to 30.
|
78 |
+
*
|
79 |
+
* @return int
|
80 |
+
*/
|
81 |
+
'timeout' => apply_filters('http_request_timeout', 30),
|
82 |
+
);
|
83 |
+
|
84 |
+
// Add data to arguments if needed.
|
85 |
+
if ('GET' !== $method) {
|
86 |
+
$args['body'] = json_encode($data);
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Filters the MailChimp request arguments.
|
91 |
+
*
|
92 |
+
* @param array $args The request arguments sent to MailChimp.
|
93 |
+
* @param string $path The request path.
|
94 |
+
*
|
95 |
+
* @return array
|
96 |
+
*/
|
97 |
+
$args = apply_filters('gform_mailchimp_request_args', $args, $path);
|
98 |
+
|
99 |
+
// Get request response.
|
100 |
+
$response = wp_remote_request($requestUrl, $args);
|
101 |
+
|
102 |
+
// If request was not successful, throw exception.
|
103 |
+
if (is_wp_error($response)) {
|
104 |
+
throw new GF_MailChimp_Exception($response->get_error_message());
|
105 |
+
}
|
106 |
+
|
107 |
+
// Decode response body.
|
108 |
+
$response['body'] = json_decode($response['body'], true);
|
109 |
+
|
110 |
+
// Get the response code.
|
111 |
+
$response_code = wp_remote_retrieve_response_code($response);
|
112 |
+
|
113 |
+
if ($response_code != 200) {
|
114 |
+
|
115 |
+
// If status code is set, throw exception.
|
116 |
+
if (isset($response['body']['status']) && isset($response['body']['title'])) {
|
117 |
+
|
118 |
+
// Initialize exception.
|
119 |
+
$exception = new GF_MailChimp_Exception($response['body']['title'], $response['body']['status']);
|
120 |
+
|
121 |
+
// Add detail.
|
122 |
+
$exception->setDetail($response['body']['detail']);
|
123 |
+
|
124 |
+
// Add errors if available.
|
125 |
+
if (isset($response['body']['errors'])) {
|
126 |
+
$exception->setErrors($response['body']['errors']);
|
127 |
+
}
|
128 |
+
|
129 |
+
throw $exception;
|
130 |
+
|
131 |
+
}
|
132 |
+
|
133 |
+
throw new GF_MailChimp_Exception(wp_remote_retrieve_response_message($response), $response_code);
|
134 |
+
|
135 |
+
}
|
136 |
+
|
137 |
+
// Remove links from response.
|
138 |
+
unset($response['body']['_links']);
|
139 |
+
|
140 |
+
// If a return key is defined and array item exists, return it.
|
141 |
+
if (! empty($return_key) && isset($response['body'][$return_key])) {
|
142 |
+
return $response['body'][$return_key];
|
143 |
+
}
|
144 |
+
|
145 |
+
return $response['body'];
|
146 |
+
|
147 |
+
}
|
148 |
+
}
|
app/Services/Slack.php
ADDED
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\App\Services;
|
4 |
+
|
5 |
+
use FluentForm\Framework\Helpers\ArrayHelper;
|
6 |
+
|
7 |
+
class Slack
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* The slack integration settings of the form.
|
11 |
+
*
|
12 |
+
* @var array $settings
|
13 |
+
*/
|
14 |
+
protected $settings = [];
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Determine whether the slack notification should be sent or not.
|
18 |
+
*
|
19 |
+
* @param $formId
|
20 |
+
*
|
21 |
+
* @return boolean
|
22 |
+
*/
|
23 |
+
public function shouldApply($formId)
|
24 |
+
{
|
25 |
+
$this->settings = wpFluent()->table('fluentform_form_meta')
|
26 |
+
->where('form_id', $formId)
|
27 |
+
->where('meta_key', 'slack')
|
28 |
+
->first();
|
29 |
+
|
30 |
+
$this->settings = $this->settings ? json_decode($this->settings->value, true) : [];
|
31 |
+
|
32 |
+
return ArrayHelper::get($this->settings, 'enabled', false);
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Handle slack notifier.
|
37 |
+
*
|
38 |
+
* @param $submissionId
|
39 |
+
* @param $formData
|
40 |
+
* @param $form
|
41 |
+
*/
|
42 |
+
public function handle($submissionId, $formData, $form)
|
43 |
+
{
|
44 |
+
if ($this->shouldApply($form->id)) {
|
45 |
+
$formParser = (new FormParser($form));
|
46 |
+
|
47 |
+
$inputs = $formParser->getEntryInputs();
|
48 |
+
|
49 |
+
$labels = $formParser->getAdminLabels($inputs);
|
50 |
+
|
51 |
+
$formData = FormResponseParser::transformResponse((object) $formData, $inputs, $form->id);
|
52 |
+
|
53 |
+
$title = __("New submission on ".$form->title, 'fluentform');
|
54 |
+
|
55 |
+
$fields = [];
|
56 |
+
|
57 |
+
foreach ($formData as $attribute => $value) {
|
58 |
+
$value = str_replace('&', '&', $value);
|
59 |
+
$value = str_replace('<', '<', $value);
|
60 |
+
$value = str_replace('>', ">", $value);
|
61 |
+
|
62 |
+
$fields[] = [
|
63 |
+
'title' => $labels[$attribute],
|
64 |
+
'value' => $value,
|
65 |
+
'short' => false
|
66 |
+
];
|
67 |
+
}
|
68 |
+
|
69 |
+
$slackHook = ArrayHelper::get($this->settings, 'webhook');
|
70 |
+
|
71 |
+
$titleLink = admin_url('admin.php?page=fluent_forms&form_id='
|
72 |
+
.$form->id
|
73 |
+
.'&route=entries#/entries/'
|
74 |
+
.$submissionId
|
75 |
+
);
|
76 |
+
|
77 |
+
$body = [
|
78 |
+
'payload' => json_encode([
|
79 |
+
'attachments' => [
|
80 |
+
[
|
81 |
+
'color' => '#0078ff',
|
82 |
+
'fallback' => $title,
|
83 |
+
'title' => $title,
|
84 |
+
'title_link' => $titleLink,
|
85 |
+
'fields' => $fields,
|
86 |
+
'footer' => 'fluentform',
|
87 |
+
'ts' => current_time('timestamp')
|
88 |
+
]
|
89 |
+
]
|
90 |
+
])
|
91 |
+
];
|
92 |
+
|
93 |
+
wp_remote_post($slackHook, [
|
94 |
+
'method' => 'POST',
|
95 |
+
'timeout' => 30,
|
96 |
+
'redirection' => 5,
|
97 |
+
'httpversion' => '1.0',
|
98 |
+
'blocking' => false,
|
99 |
+
'headers' => [],
|
100 |
+
'body' => $body,
|
101 |
+
'cookies' => []
|
102 |
+
]);
|
103 |
+
}
|
104 |
+
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Invoke slack notifier.
|
108 |
+
*
|
109 |
+
* @param $submissionId
|
110 |
+
* @param $formData
|
111 |
+
* @param $form
|
112 |
+
*/
|
113 |
+
public static function notify($submissionId, $formData, $form)
|
114 |
+
{
|
115 |
+
(new static)->handle($submissionId, $formData, $form);
|
116 |
+
}
|
117 |
+
}
|
app/Services/csv/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
The MIT License (MIT)
|
2 |
+
|
3 |
+
Copyright (c) 2013-2015 ignace nyamagana butera
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6 |
+
this software and associated documentation files (the "Software"), to deal in
|
7 |
+
the Software without restriction, including without limitation the rights to
|
8 |
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9 |
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
10 |
+
subject to the following conditions:
|
11 |
+
|
12 |
+
The above copyright notice and this permission notice shall be included in all
|
13 |
+
copies or substantial portions of the Software.
|
14 |
+
|
15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17 |
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18 |
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19 |
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20 |
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
app/Services/csv/autoload.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
spl_autoload_register(function ($class) {
|
4 |
+
|
5 |
+
$prefix = 'League\Csv\\';
|
6 |
+
|
7 |
+
if (0 !== strpos($class, $prefix)) {
|
8 |
+
return;
|
9 |
+
}
|
10 |
+
|
11 |
+
$file = __DIR__
|
12 |
+
.DIRECTORY_SEPARATOR
|
13 |
+
.'src'
|
14 |
+
.DIRECTORY_SEPARATOR
|
15 |
+
.str_replace('\\', DIRECTORY_SEPARATOR, substr($class, strlen($prefix)))
|
16 |
+
.'.php';
|
17 |
+
|
18 |
+
if (! is_readable($file)) {
|
19 |
+
return;
|
20 |
+
}
|
21 |
+
|
22 |
+
require $file;
|
23 |
+
});
|
app/Services/csv/composer.json
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "league/csv",
|
3 |
+
"type": "library",
|
4 |
+
"description" : "Csv data manipulation made easy in PHP",
|
5 |
+
"keywords": ["csv", "import", "export", "read", "write", "filter"],
|
6 |
+
"license": "MIT",
|
7 |
+
"homepage" : "http://csv.thephpleague.com",
|
8 |
+
"authors": [
|
9 |
+
{
|
10 |
+
"name" : "Ignace Nyamagana Butera",
|
11 |
+
"email" : "nyamsprod@gmail.com",
|
12 |
+
"homepage" : "https://github.com/nyamsprod/",
|
13 |
+
"role" : "Developer"
|
14 |
+
}
|
15 |
+
],
|
16 |
+
"support": {
|
17 |
+
"forum": "https://groups.google.com/forum/#!forum/thephpleague",
|
18 |
+
"issues": "https://github.com/thephpleague/csv/issues"
|
19 |
+
},
|
20 |
+
"require": {
|
21 |
+
"php" : ">=5.5.0",
|
22 |
+
"ext-mbstring" : "*"
|
23 |
+
},
|
24 |
+
"require-dev": {
|
25 |
+
"phpunit/phpunit" : "^4.0",
|
26 |
+
"friendsofphp/php-cs-fixer": "^1.9"
|
27 |
+
},
|
28 |
+
"autoload": {
|
29 |
+
"psr-4": {
|
30 |
+
"League\\Csv\\": "src"
|
31 |
+
}
|
32 |
+
},
|
33 |
+
"autoload-dev": {
|
34 |
+
"psr-4": {
|
35 |
+
"League\\Csv\\Test\\": "test",
|
36 |
+
"lib\\": "examples\\lib"
|
37 |
+
}
|
38 |
+
},
|
39 |
+
"scripts": {
|
40 |
+
"test": "phpunit --coverage-text; php-cs-fixer fix -v --diff --dry-run;",
|
41 |
+
"phpunit": "phpunit --coverage-text",
|
42 |
+
"phpcs": "php-cs-fixer fix -v --diff --dry-run;"
|
43 |
+
},
|
44 |
+
"extra": {
|
45 |
+
"branch-alias": {
|
46 |
+
"dev-master": "8.2-dev"
|
47 |
+
}
|
48 |
+
}
|
49 |
+
}
|
app/Services/csv/src/AbstractCsv.php
ADDED
@@ -0,0 +1,273 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file is part of the League.csv library
|
4 |
+
*
|
5 |
+
* @license http://opensource.org/licenses/MIT
|
6 |
+
* @link https://github.com/thephpleague/csv/
|
7 |
+
* @version 8.2.2
|
8 |
+
* @package League.csv
|
9 |
+
*
|
10 |
+
* For the full copyright and license information, please view the LICENSE
|
11 |
+
* file that was distributed with this source code.
|
12 |
+
*/
|
13 |
+
namespace League\Csv;
|
14 |
+
|
15 |
+
use InvalidArgumentException;
|
16 |
+
use IteratorAggregate;
|
17 |
+
use JsonSerializable;
|
18 |
+
use League\Csv\Config\Controls;
|
19 |
+
use League\Csv\Config\Output;
|
20 |
+
use League\Csv\Modifier\QueryFilter;
|
21 |
+
use League\Csv\Modifier\StreamFilter;
|
22 |
+
use League\Csv\Modifier\StreamIterator;
|
23 |
+
use SplFileInfo;
|
24 |
+
use SplFileObject;
|
25 |
+
use SplTempFileObject;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* An abstract class to enable basic CSV manipulation
|
29 |
+
*
|
30 |
+
* @package League.csv
|
31 |
+
* @since 4.0.0
|
32 |
+
*
|
33 |
+
*/
|
34 |
+
abstract class AbstractCsv implements JsonSerializable, IteratorAggregate
|
35 |
+
{
|
36 |
+
use Controls;
|
37 |
+
|
38 |
+
use Output;
|
39 |
+
|
40 |
+
use QueryFilter;
|
41 |
+
|
42 |
+
use StreamFilter;
|
43 |
+
|
44 |
+
/**
|
45 |
+
* UTF-8 BOM sequence
|
46 |
+
*/
|
47 |
+
const BOM_UTF8 = "\xEF\xBB\xBF";
|
48 |
+
|
49 |
+
/**
|
50 |
+
* UTF-16 BE BOM sequence
|
51 |
+
*/
|
52 |
+
const BOM_UTF16_BE = "\xFE\xFF";
|
53 |
+
|
54 |
+
/**
|
55 |
+
* UTF-16 LE BOM sequence
|
56 |
+
*/
|
57 |
+
const BOM_UTF16_LE = "\xFF\xFE";
|
58 |
+
|
59 |
+
/**
|
60 |
+
* UTF-32 BE BOM sequence
|
61 |
+
*/
|
62 |
+
const BOM_UTF32_BE = "\x00\x00\xFE\xFF";
|
63 |
+
|
64 |
+
/**
|
65 |
+
* UTF-32 LE BOM sequence
|
66 |
+
*/
|
67 |
+
const BOM_UTF32_LE = "\xFF\xFE\x00\x00";
|
68 |
+
|
69 |
+
/**
|
70 |
+
* The path
|
71 |
+
*
|
72 |
+
* can be a StreamIterator object, a SplFileObject object or the string path to a file
|
73 |
+
*
|
74 |
+
* @var StreamIterator|SplFileObject|string
|
75 |
+
*/
|
76 |
+
protected $path;
|
77 |
+
|
78 |
+
/**
|
79 |
+
* The file open mode flag
|
80 |
+
*
|
81 |
+
* @var string
|
82 |
+
*/
|
83 |
+
protected $open_mode;
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Creates a new instance
|
87 |
+
*
|
88 |
+
* The path must be an SplFileInfo object
|
89 |
+
* an object that implements the `__toString` method
|
90 |
+
* a path to a file
|
91 |
+
*
|
92 |
+
* @param StreamIterator|SplFileObject|string $path The file path
|
93 |
+
* @param string $open_mode The file open mode flag
|
94 |
+
*/
|
95 |
+
protected function __construct($path, $open_mode = 'r+')
|
96 |
+
{
|
97 |
+
$this->open_mode = strtolower($open_mode);
|
98 |
+
$this->path = $path;
|
99 |
+
$this->initStreamFilter($this->path);
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* The destructor
|
104 |
+
*/
|
105 |
+
public function __destruct()
|
106 |
+
{
|
107 |
+
$this->path = null;
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Return a new {@link AbstractCsv} from a SplFileObject
|
112 |
+
*
|
113 |
+
* @param SplFileObject $file
|
114 |
+
*
|
115 |
+
* @return static
|
116 |
+
*/
|
117 |
+
public static function createFromFileObject(SplFileObject $file)
|
118 |
+
{
|
119 |
+
$csv = new static($file);
|
120 |
+
$controls = $file->getCsvControl();
|
121 |
+
$csv->setDelimiter($controls[0]);
|
122 |
+
$csv->setEnclosure($controls[1]);
|
123 |
+
if (isset($controls[2])) {
|
124 |
+
$csv->setEscape($controls[2]);
|
125 |
+
}
|
126 |
+
|
127 |
+
return $csv;
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Return a new {@link AbstractCsv} from a PHP resource stream or a StreamIterator
|
132 |
+
*
|
133 |
+
* @param resource $stream
|
134 |
+
*
|
135 |
+
* @return static
|
136 |
+
*/
|
137 |
+
public static function createFromStream($stream)
|
138 |
+
{
|
139 |
+
return new static(new StreamIterator($stream));
|
140 |
+
}
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Return a new {@link AbstractCsv} from a string
|
144 |
+
*
|
145 |
+
* The string must be an object that implements the `__toString` method,
|
146 |
+
* or a string
|
147 |
+
*
|
148 |
+
* @param string $str the string
|
149 |
+
*
|
150 |
+
* @return static
|
151 |
+
*/
|
152 |
+
public static function createFromString($str)
|
153 |
+
{
|
154 |
+
$file = new SplTempFileObject();
|
155 |
+
$file->fwrite(static::validateString($str));
|
156 |
+
|
157 |
+
return new static($file);
|
158 |
+
}
|
159 |
+
|
160 |
+
/**
|
161 |
+
* validate a string
|
162 |
+
*
|
163 |
+
* @param mixed $str the value to evaluate as a string
|
164 |
+
*
|
165 |
+
* @throws InvalidArgumentException if the submitted data can not be converted to string
|
166 |
+
*
|
167 |
+
* @return string
|
168 |
+
*/
|
169 |
+
protected static function validateString($str)
|
170 |
+
{
|
171 |
+
if (is_string($str) || (is_object($str) && method_exists($str, '__toString'))) {
|
172 |
+
return (string) $str;
|
173 |
+
}
|
174 |
+
throw new InvalidArgumentException('Expected data must be a string or stringable');
|
175 |
+
}
|
176 |
+
|
177 |
+
/**
|
178 |
+
* Return a new {@link AbstractCsv} from a file path
|
179 |
+
*
|
180 |
+
* @param mixed $path file path
|
181 |
+
* @param string $open_mode the file open mode flag
|
182 |
+
*
|
183 |
+
* @throws InvalidArgumentException If $path is a SplTempFileObject object
|
184 |
+
*
|
185 |
+
* @return static
|
186 |
+
*/
|
187 |
+
public static function createFromPath($path, $open_mode = 'r+')
|
188 |
+
{
|
189 |
+
if ($path instanceof SplTempFileObject) {
|
190 |
+
throw new InvalidArgumentException('an `SplTempFileObject` object does not contain a valid path');
|
191 |
+
}
|
192 |
+
|
193 |
+
if ($path instanceof SplFileInfo) {
|
194 |
+
$path = $path->getPath().'/'.$path->getBasename();
|
195 |
+
}
|
196 |
+
|
197 |
+
return new static(static::validateString($path), $open_mode);
|
198 |
+
}
|
199 |
+
|
200 |
+
/**
|
201 |
+
* Return a new {@link AbstractCsv} instance from another {@link AbstractCsv} object
|
202 |
+
*
|
203 |
+
* @param string $class the class to be instantiated
|
204 |
+
* @param string $open_mode the file open mode flag
|
205 |
+
*
|
206 |
+
* @return static
|
207 |
+
*/
|
208 |
+
protected function newInstance($class, $open_mode)
|
209 |
+
{
|
210 |
+
$csv = new $class($this->path, $open_mode);
|
211 |
+
$csv->delimiter = $this->delimiter;
|
212 |
+
$csv->enclosure = $this->enclosure;
|
213 |
+
$csv->escape = $this->escape;
|
214 |
+
$csv->input_encoding = $this->input_encoding;
|
215 |
+
$csv->input_bom = $this->input_bom;
|
216 |
+
$csv->output_bom = $this->output_bom;
|
217 |
+
$csv->newline = $this->newline;
|
218 |
+
|
219 |
+
return $csv;
|
220 |
+
}
|
221 |
+
|
222 |
+
/**
|
223 |
+
* Return a new {@link Writer} instance from a {@link AbstractCsv} object
|
224 |
+
*
|
225 |
+
* @param string $open_mode the file open mode flag
|
226 |
+
*
|
227 |
+
* @return Writer
|
228 |
+
*/
|
229 |
+
public function newWriter($open_mode = 'r+')
|
230 |
+
{
|
231 |
+
return $this->newInstance(Writer::class, $open_mode);
|
232 |
+
}
|
233 |
+
|
234 |
+
/**
|
235 |
+
* Return a new {@link Reader} instance from a {@link AbstractCsv} object
|
236 |
+
*
|
237 |
+
* @param string $open_mode the file open mode flag
|
238 |
+
*
|
239 |
+
* @return Reader
|
240 |
+
*/
|
241 |
+
public function newReader($open_mode = 'r+')
|
242 |
+
{
|
243 |
+
return $this->newInstance(Reader::class, $open_mode);
|
244 |
+
}
|
245 |
+
|
246 |
+
/**
|
247 |
+
* Returns the inner CSV Document Iterator object
|
248 |
+
*
|
249 |
+
* @return StreamIterator|SplFileObject
|
250 |
+
*/
|
251 |
+
public function getIterator()
|
252 |
+
{
|
253 |
+
$iterator = $this->setIterator();
|
254 |
+
$iterator->setCsvControl($this->delimiter, $this->enclosure, $this->escape);
|
255 |
+
$iterator->setFlags(SplFileObject::READ_CSV | SplFileObject::READ_AHEAD | SplFileObject::SKIP_EMPTY);
|
256 |
+
|
257 |
+
return $iterator;
|
258 |
+
}
|
259 |
+
|
260 |
+
/**
|
261 |
+
* Set the Inner Iterator
|
262 |
+
*
|
263 |
+
* @return StreamIterator|SplFileObject
|
264 |
+
*/
|
265 |
+
protected function setIterator()
|
266 |
+
{
|
267 |
+
if ($this->path instanceof StreamIterator || $this->path instanceof SplFileObject) {
|
268 |
+
return $this->path;
|
269 |
+
}
|
270 |
+
|
271 |
+
return new SplFileObject($this->getStreamFilterPath(), $this->open_mode);
|
272 |
+
}
|
273 |
+
}
|
app/Services/csv/src/Config/Controls.php
ADDED
@@ -0,0 +1,235 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file is part of the League.csv library
|
4 |
+
*
|
5 |
+
* @license http://opensource.org/licenses/MIT
|
6 |
+
* @link https://github.com/thephpleague/csv/
|
7 |
+
* @version 8.2.2
|
8 |
+
* @package League.csv
|
9 |
+
*
|
10 |
+
* For the full copyright and license information, please view the LICENSE
|
11 |
+
* file that was distributed with this source code.
|
12 |
+
*/
|
13 |
+
namespace League\Csv\Config;
|
14 |
+
|
15 |
+
use CallbackFilterIterator;
|
16 |
+
use InvalidArgumentException;
|
17 |
+
use LimitIterator;
|
18 |
+
use SplFileObject;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* A trait to configure and check CSV file and content
|
22 |
+
*
|
23 |
+
* @package League.csv
|
24 |
+
* @since 6.0.0
|
25 |
+
*
|
26 |
+
*/
|
27 |
+
trait Controls
|
28 |
+
{
|
29 |
+
/**
|
30 |
+
* the field delimiter (one character only)
|
31 |
+
*
|
32 |
+
* @var string
|
33 |
+
*/
|
34 |
+
protected $delimiter = ',';
|
35 |
+
|
36 |
+
/**
|
37 |
+
* the field enclosure character (one character only)
|
38 |
+
*
|
39 |
+
* @var string
|
40 |
+
*/
|
41 |
+
protected $enclosure = '"';
|
42 |
+
|
43 |
+
/**
|
44 |
+
* the field escape character (one character only)
|
45 |
+
*
|
46 |
+
* @var string
|
47 |
+
*/
|
48 |
+
protected $escape = '\\';
|
49 |
+
|
50 |
+
/**
|
51 |
+
* newline character
|
52 |
+
*
|
53 |
+
* @var string
|
54 |
+
*/
|
55 |
+
protected $newline = "\n";
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Sets the field delimiter
|
59 |
+
*
|
60 |
+
* @param string $delimiter
|
61 |
+
*
|
62 |
+
* @throws InvalidArgumentException If $delimiter is not a single character
|
63 |
+
*
|
64 |
+
* @return $this
|
65 |
+
*/
|
66 |
+
public function setDelimiter($delimiter)
|
67 |
+
{
|
68 |
+
if (!$this->isValidCsvControls($delimiter)) {
|
69 |
+
throw new InvalidArgumentException('The delimiter must be a single character');
|
70 |
+
}
|
71 |
+
$this->delimiter = $delimiter;
|
72 |
+
|
73 |
+
return $this;
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Tell whether the submitted string is a valid CSV Control character
|
78 |
+
*
|
79 |
+
* @param string $str The submitted string
|
80 |
+
*
|
81 |
+
* @return bool
|
82 |
+
*/
|
83 |
+
protected function isValidCsvControls($str)
|
84 |
+
{
|
85 |
+
return 1 == mb_strlen($str);
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Returns the current field delimiter
|
90 |
+
*
|
91 |
+
* @return string
|
92 |
+
*/
|
93 |
+
public function getDelimiter()
|
94 |
+
{
|
95 |
+
return $this->delimiter;
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Detect Delimiters occurences in the CSV
|
100 |
+
*
|
101 |
+
* Returns a associative array where each key represents
|
102 |
+
* a valid delimiter and each value the number of occurences
|
103 |
+
*
|
104 |
+
* @param string[] $delimiters the delimiters to consider
|
105 |
+
* @param int $nb_rows Detection is made using $nb_rows of the CSV
|
106 |
+
*
|
107 |
+
* @return array
|
108 |
+
*/
|
109 |
+
public function fetchDelimitersOccurrence(array $delimiters, $nb_rows = 1)
|
110 |
+
{
|
111 |
+
$nb_rows = $this->validateInteger($nb_rows, 1, 'The number of rows to consider must be a valid positive integer');
|
112 |
+
$filter_row = function ($row) {
|
113 |
+
return is_array($row) && count($row) > 1;
|
114 |
+
};
|
115 |
+
$delimiters = array_unique(array_filter($delimiters, [$this, 'isValidCsvControls']));
|
116 |
+
$csv = $this->getIterator();
|
117 |
+
$res = [];
|
118 |
+
foreach ($delimiters as $delim) {
|
119 |
+
$csv->setCsvControl($delim, $this->enclosure, $this->escape);
|
120 |
+
$iterator = new CallbackFilterIterator(new LimitIterator($csv, 0, $nb_rows), $filter_row);
|
121 |
+
$res[$delim] = count(iterator_to_array($iterator, false), COUNT_RECURSIVE);
|
122 |
+
}
|
123 |
+
arsort($res, SORT_NUMERIC);
|
124 |
+
|
125 |
+
return $res;
|
126 |
+
}
|
127 |
+
|
128 |
+
/**
|
129 |
+
* Validate an integer
|
130 |
+
*
|
131 |
+
* @param int $int
|
132 |
+
* @param int $minValue
|
133 |
+
* @param string $errorMessage
|
134 |
+
*
|
135 |
+
* @throws InvalidArgumentException If the value is invalid
|
136 |
+
*
|
137 |
+
* @return int
|
138 |
+
*/
|
139 |
+
protected function validateInteger($int, $minValue, $errorMessage)
|
140 |
+
{
|
141 |
+
if (false === ($int = filter_var($int, FILTER_VALIDATE_INT, ['options' => ['min_range' => $minValue]]))) {
|
142 |
+
throw new InvalidArgumentException($errorMessage);
|
143 |
+
}
|
144 |
+
return $int;
|
145 |
+
}
|
146 |
+
|
147 |
+
/**
|
148 |
+
* Returns the CSV Iterator
|
149 |
+
*
|
150 |
+
* @return SplFileObject
|
151 |
+
*/
|
152 |
+
abstract public function getIterator();
|
153 |
+
|
154 |
+
/**
|
155 |
+
* Sets the field enclosure
|
156 |
+
*
|
157 |
+
* @param string $enclosure
|
158 |
+
*
|
159 |
+
* @throws InvalidArgumentException If $enclosure is not a single character
|
160 |
+
*
|
161 |
+
* @return $this
|
162 |
+
*/
|
163 |
+
public function setEnclosure($enclosure)
|
164 |
+
{
|
165 |
+
if (!$this->isValidCsvControls($enclosure)) {
|
166 |
+
throw new InvalidArgumentException('The enclosure must be a single character');
|
167 |
+
}
|
168 |
+
$this->enclosure = $enclosure;
|
169 |
+
|
170 |
+
return $this;
|
171 |
+
}
|
172 |
+
|
173 |
+
/**
|
174 |
+
* Returns the current field enclosure
|
175 |
+
*
|
176 |
+
* @return string
|
177 |
+
*/
|
178 |
+
public function getEnclosure()
|
179 |
+
{
|
180 |
+
return $this->enclosure;
|
181 |
+
}
|
182 |
+
|
183 |
+
/**
|
184 |
+
* Sets the field escape character
|
185 |
+
*
|
186 |
+
* @param string $escape
|
187 |
+
*
|
188 |
+
* @throws InvalidArgumentException If $escape is not a single character
|
189 |
+
*
|
190 |
+
* @return $this
|
191 |
+
*/
|
192 |
+
public function setEscape($escape)
|
193 |
+
{
|
194 |
+
if (!$this->isValidCsvControls($escape)) {
|
195 |
+
throw new InvalidArgumentException('The escape character must be a single character');
|
196 |
+
}
|
197 |
+
$this->escape = $escape;
|
198 |
+
|
199 |
+
return $this;
|
200 |
+
}
|
201 |
+
|
202 |
+
/**
|
203 |
+
* Returns the current field escape character
|
204 |
+
*
|
205 |
+
* @return string
|
206 |
+
*/
|
207 |
+
public function getEscape()
|
208 |
+
{
|
209 |
+
return $this->escape;
|
210 |
+
}
|
211 |
+
|
212 |
+
/**
|
213 |
+
* Sets the newline sequence characters
|
214 |
+
*
|
215 |
+
* @param string $newline
|
216 |
+
*
|
217 |
+
* @return static
|
218 |
+
*/
|
219 |
+
public function setNewline($newline)
|
220 |
+
{
|
221 |
+
$this->newline = (string) $newline;
|
222 |
+
|
223 |
+
return $this;
|
224 |
+
}
|
225 |
+
|
226 |
+
/**
|
227 |
+
* Returns the current newline sequence characters
|
228 |
+
*
|
229 |
+
* @return string
|
230 |
+
*/
|
231 |
+
public function getNewline()
|
232 |
+
{
|
233 |
+
return $this->newline;
|
234 |
+
}
|
235 |
+
}
|
app/Services/csv/src/Config/Output.php
ADDED
@@ -0,0 +1,309 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file is part of the League.csv library
|
4 |
+
*
|
5 |
+
* @license http://opensource.org/licenses/MIT
|
6 |
+
* @link https://github.com/thephpleague/csv/
|
7 |
+
* @version 8.2.2
|
8 |
+
* @package League.csv
|
9 |
+
*
|
10 |
+
* For the full copyright and license information, please view the LICENSE
|
11 |
+
* file that was distributed with this source code.
|
12 |
+
*/
|
13 |
+
namespace League\Csv\Config;
|
14 |
+
|
15 |
+
use DomDocument;
|
16 |
+
use InvalidArgumentException;
|
17 |
+
use Iterator;
|
18 |
+
use League\Csv\AbstractCsv;
|
19 |
+
use League\Csv\Modifier\MapIterator;
|
20 |
+
use SplFileObject;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* A trait to output CSV
|
24 |
+
*
|
25 |
+
* @package League.csv
|
26 |
+
* @since 6.3.0
|
27 |
+
*
|
28 |
+
*/
|
29 |
+
trait Output
|
30 |
+
{
|
31 |
+
/**
|
32 |
+
* Charset Encoding for the CSV
|
33 |
+
*
|
34 |
+
* @var string
|
35 |
+
*/
|
36 |
+
protected $input_encoding = 'UTF-8';
|
37 |
+
|
38 |
+
/**
|
39 |
+
* The Input file BOM character
|
40 |
+
* @var string
|
41 |
+
*/
|
42 |
+
protected $input_bom;
|
43 |
+
|
44 |
+
/**
|
45 |
+
* The Output file BOM character
|
46 |
+
* @var string
|
47 |
+
*/
|
48 |
+
protected $output_bom = '';
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Sets the CSV encoding charset
|
52 |
+
*
|
53 |
+
* @param string $str
|
54 |
+
*
|
55 |
+
* @return static
|
56 |
+
*/
|
57 |
+
public function setInputEncoding($str)
|
58 |
+
{
|
59 |
+
$str = str_replace('_', '-', $str);
|
60 |
+
$str = filter_var($str, FILTER_SANITIZE_STRING, ['flags' => FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH]);
|
61 |
+
if (empty($str)) {
|
62 |
+
throw new InvalidArgumentException('you should use a valid charset');
|
63 |
+
}
|
64 |
+
$this->input_encoding = strtoupper($str);
|
65 |
+
|
66 |
+
return $this;
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Sets the CSV encoding charset
|
71 |
+
*
|
72 |
+
* DEPRECATION WARNING! This method will be removed in the next major point release
|
73 |
+
*
|
74 |
+
* @deprecated deprecated since version 8.1
|
75 |
+
*
|
76 |
+
* @param string $str
|
77 |
+
*
|
78 |
+
* @return static
|
79 |
+
*/
|
80 |
+
public function setEncodingFrom($str)
|
81 |
+
{
|
82 |
+
return $this->setInputEncoding($str);
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Gets the source CSV encoding charset
|
87 |
+
*
|
88 |
+
* @return string
|
89 |
+
*/
|
90 |
+
public function getInputEncoding()
|
91 |
+
{
|
92 |
+
return $this->input_encoding;
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Gets the source CSV encoding charset
|
97 |
+
*
|
98 |
+
* DEPRECATION WARNING! This method will be removed in the next major point release
|
99 |
+
*
|
100 |
+
* @deprecated deprecated since version 8.1
|
101 |
+
*
|
102 |
+
* @return string
|
103 |
+
*/
|
104 |
+
public function getEncodingFrom()
|
105 |
+
{
|
106 |
+
return $this->getInputEncoding();
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Sets the BOM sequence to prepend the CSV on output
|
111 |
+
*
|
112 |
+
* @param string $str The BOM sequence
|
113 |
+
*
|
114 |
+
* @return static
|
115 |
+
*/
|
116 |
+
public function setOutputBOM($str)
|
117 |
+
{
|
118 |
+
if (empty($str)) {
|
119 |
+
$this->output_bom = '';
|
120 |
+
|
121 |
+
return $this;
|
122 |
+
}
|
123 |
+
|
124 |
+
$this->output_bom = (string) $str;
|
125 |
+
|
126 |
+
return $this;
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Returns the BOM sequence in use on Output methods
|
131 |
+
*
|
132 |
+
* @return string
|
133 |
+
*/
|
134 |
+
public function getOutputBOM()
|
135 |
+
{
|
136 |
+
return $this->output_bom;
|
137 |
+
}
|
138 |
+
|
139 |
+
/**
|
140 |
+
* Returns the BOM sequence of the given CSV
|
141 |
+
*
|
142 |
+
* @return string
|
143 |
+
*/
|
144 |
+
public function getInputBOM()
|
145 |
+
{
|
146 |
+
if (null === $this->input_bom) {
|
147 |
+
$bom = [
|
148 |
+
AbstractCsv::BOM_UTF32_BE, AbstractCsv::BOM_UTF32_LE,
|
149 |
+
AbstractCsv::BOM_UTF16_BE, AbstractCsv::BOM_UTF16_LE, AbstractCsv::BOM_UTF8,
|
150 |
+
];
|
151 |
+
$csv = $this->getIterator();
|
152 |
+
$csv->setFlags(SplFileObject::READ_CSV);
|
153 |
+
$csv->rewind();
|
154 |
+
$line = $csv->fgets();
|
155 |
+
$res = array_filter($bom, function ($sequence) use ($line) {
|
156 |
+
return strpos($line, $sequence) === 0;
|
157 |
+
});
|
158 |
+
|
159 |
+
$this->input_bom = (string) array_shift($res);
|
160 |
+
}
|
161 |
+
|
162 |
+
return $this->input_bom;
|
163 |
+
}
|
164 |
+
|
165 |
+
/**
|
166 |
+
* @inheritdoc
|
167 |
+
*/
|
168 |
+
abstract public function getIterator();
|
169 |
+
|
170 |
+
/**
|
171 |
+
* Outputs all data on the CSV file
|
172 |
+
*
|
173 |
+
* @param string $filename CSV downloaded name if present adds extra headers
|
174 |
+
*
|
175 |
+
* @return int Returns the number of characters read from the handle
|
176 |
+
* and passed through to the output.
|
177 |
+
*/
|
178 |
+
public function output($filename = null)
|
179 |
+
{
|
180 |
+
if (null !== $filename) {
|
181 |
+
$filename = filter_var($filename, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW);
|
182 |
+
header('Content-Type: text/csv');
|
183 |
+
header('Content-Transfer-Encoding: binary');
|
184 |
+
header("Content-Disposition: attachment; filename=\"$filename\"");
|
185 |
+
}
|
186 |
+
|
187 |
+
return $this->fpassthru();
|
188 |
+
}
|
189 |
+
|
190 |
+
/**
|
191 |
+
* Outputs all data from the CSV
|
192 |
+
*
|
193 |
+
* @return int Returns the number of characters read from the handle
|
194 |
+
* and passed through to the output.
|
195 |
+
*/
|
196 |
+
protected function fpassthru()
|
197 |
+
{
|
198 |
+
$bom = '';
|
199 |
+
$input_bom = $this->getInputBOM();
|
200 |
+
if ($this->output_bom && $input_bom != $this->output_bom) {
|
201 |
+
$bom = $this->output_bom;
|
202 |
+
}
|
203 |
+
$csv = $this->getIterator();
|
204 |
+
$csv->setFlags(SplFileObject::READ_CSV);
|
205 |
+
$csv->rewind();
|
206 |
+
if (!empty($bom)) {
|
207 |
+
$csv->fseek(mb_strlen($input_bom));
|
208 |
+
}
|
209 |
+
echo $bom;
|
210 |
+
$res = $csv->fpassthru();
|
211 |
+
|
212 |
+
return $res + strlen($bom);
|
213 |
+
}
|
214 |
+
|
215 |
+
/**
|
216 |
+
* Retrieves the CSV content
|
217 |
+
*
|
218 |
+
* @return string
|
219 |
+
*/
|
220 |
+
public function __toString()
|
221 |
+
{
|
222 |
+
ob_start();
|
223 |
+
$this->fpassthru();
|
224 |
+
|
225 |
+
return ob_get_clean();
|
226 |
+
}
|
227 |
+
|
228 |
+
/**
|
229 |
+
* @inheritdoc
|
230 |
+
*/
|
231 |
+
public function jsonSerialize()
|
232 |
+
{
|
233 |
+
return iterator_to_array($this->convertToUtf8($this->getQueryIterator()), false);
|
234 |
+
}
|
235 |
+
|
236 |
+
/**
|
237 |
+
* Returns the CSV Iterator
|
238 |
+
*
|
239 |
+
* @return Iterator
|
240 |
+
*/
|
241 |
+
abstract protected function getQueryIterator();
|
242 |
+
|
243 |
+
/**
|
244 |
+
* Convert Csv file into UTF-8
|
245 |
+
*
|
246 |
+
* @param Iterator $iterator
|
247 |
+
*
|
248 |
+
* @return Iterator
|
249 |
+
*/
|
250 |
+
protected function convertToUtf8(Iterator $iterator)
|
251 |
+
{
|
252 |
+
if (stripos($this->input_encoding, 'UTF-8') !== false) {
|
253 |
+
return $iterator;
|
254 |
+
}
|
255 |
+
|
256 |
+
$convert_cell = function ($value) {
|
257 |
+
return mb_convert_encoding($value, 'UTF-8', $this->input_encoding);
|
258 |
+
};
|
259 |
+
|
260 |
+
$convert_row = function (array $row) use ($convert_cell) {
|
261 |
+
return array_map($convert_cell, $row);
|
262 |
+
};
|
263 |
+
|
264 |
+
return new MapIterator($iterator, $convert_row);
|
265 |
+
}
|
266 |
+
|
267 |
+
/**
|
268 |
+
* Returns a HTML table representation of the CSV Table
|
269 |
+
*
|
270 |
+
* @param string $class_attr optional classname
|
271 |
+
*
|
272 |
+
* @return string
|
273 |
+
*/
|
274 |
+
public function toHTML($class_attr = 'table-csv-data')
|
275 |
+
{
|
276 |
+
$doc = $this->toXML('table', 'tr', 'td');
|
277 |
+
$doc->documentElement->setAttribute('class', $class_attr);
|
278 |
+
|
279 |
+
return $doc->saveHTML($doc->documentElement);
|
280 |
+
}
|
281 |
+
|
282 |
+
/**
|
283 |
+
* Transforms a CSV into a XML
|
284 |
+
*
|
285 |
+
* @param string $root_name XML root node name
|
286 |
+
* @param string $row_name XML row node name
|
287 |
+
* @param string $cell_name XML cell node name
|
288 |
+
*
|
289 |
+
* @return DomDocument
|
290 |
+
*/
|
291 |
+
public function toXML($root_name = 'csv', $row_name = 'row', $cell_name = 'cell')
|
292 |
+
{
|
293 |
+
$doc = new DomDocument('1.0', 'UTF-8');
|
294 |
+
$root = $doc->createElement($root_name);
|
295 |
+
foreach ($this->convertToUtf8($this->getQueryIterator()) as $row) {
|
296 |
+
$rowElement = $doc->createElement($row_name);
|
297 |
+
array_walk($row, function ($value) use (&$rowElement, $doc, $cell_name) {
|
298 |
+
$content = $doc->createTextNode($value);
|
299 |
+
$cell = $doc->createElement($cell_name);
|
300 |
+
$cell->appendChild($content);
|
301 |
+
$rowElement->appendChild($cell);
|
302 |
+
});
|
303 |
+
$root->appendChild($rowElement);
|
304 |
+
}
|
305 |
+
$doc->appendChild($root);
|
306 |
+
|
307 |
+
return $doc;
|
308 |
+
}
|
309 |
+
}
|
app/Services/csv/src/Exception/InvalidRowException.php
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file is part of the League.csv library
|
4 |
+
*
|
5 |
+
* @license http://opensource.org/licenses/MIT
|
6 |
+
* @link https://github.com/thephpleague/csv/
|
7 |
+
* @version 8.2.2
|
8 |
+
* @package League.csv
|
9 |
+
*
|
10 |
+
* For the full copyright and license information, please view the LICENSE
|
11 |
+
* file that was distributed with this source code.
|
12 |
+
*/
|
13 |
+
namespace League\Csv\Exception;
|
14 |
+
|
15 |
+
use InvalidArgumentException;
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Thrown when a data is not validated prior to insertion
|
19 |
+
*
|
20 |
+
* @package League.csv
|
21 |
+
* @since 7.0.0
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
class InvalidRowException extends InvalidArgumentException
|
25 |
+
{
|
26 |
+
/**
|
27 |
+
* Validator which did not validated the data
|
28 |
+
* @var string
|
29 |
+
*/
|
30 |
+
private $name;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Validator Data which caused the error
|
34 |
+
* @var array
|
35 |
+
*/
|
36 |
+
private $data;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* New Instance
|
40 |
+
*
|
41 |
+
* @param string $name validator name
|
42 |
+
* @param array $data invalid data
|
43 |
+
* @param string $message exception message
|
44 |
+
*/
|
45 |
+
public function __construct($name, array $data = [], $message = '')
|
46 |
+
{
|
47 |
+
parent::__construct($message);
|
48 |
+
$this->name = $name;
|
49 |
+
$this->data = $data;
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* return the validator name
|
54 |
+
*
|
55 |
+
* @return string
|
56 |
+
*/
|
57 |
+
public function getName()
|
58 |
+
{
|
59 |
+
return $this->name;
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* return the invalid data submitted
|
64 |
+
*
|
65 |
+
* @return array
|
66 |
+
*/
|
67 |
+
public function getData()
|
68 |
+
{
|
69 |
+
return $this->data;
|
70 |
+
}
|
71 |
+
}
|
app/Services/csv/src/Modifier/MapIterator.php
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file is part of the League.csv library
|
4 |
+
*
|
5 |
+
* @license http://opensource.org/licenses/MIT
|
6 |
+
* @link https://github.com/thephpleague/csv/
|
7 |
+
* @version 8.2.2
|
8 |
+
* @package League.csv
|
9 |
+
*
|
10 |
+
* For the full copyright and license information, please view the LICENSE
|
11 |
+
* file that was distributed with this source code.
|
12 |
+
*/
|
13 |
+
namespace League\Csv\Modifier;
|
14 |
+
|
15 |
+
use Iterator;
|
16 |
+
use IteratorIterator;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* A simple MapIterator
|
20 |
+
*
|
21 |
+
* @package League.csv
|
22 |
+
* @since 3.3.0
|
23 |
+
* @internal used internally to modify CSV content
|
24 |
+
*
|
25 |
+
*/
|
26 |
+
class MapIterator extends IteratorIterator
|
27 |
+
{
|
28 |
+
/**
|
29 |
+
* The function to be apply on all InnerIterator element
|
30 |
+
*
|
31 |
+
* @var callable
|
32 |
+
*/
|
33 |
+
private $callable;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* The Constructor
|
37 |
+
*
|
38 |
+
* @param Iterator $iterator
|
39 |
+
* @param callable $callable
|
40 |
+
*/
|
41 |
+
public function __construct(Iterator $iterator, callable $callable)
|
42 |
+
{
|
43 |
+
parent::__construct($iterator);
|
44 |
+
$this->callable = $callable;
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Get the value of the current element
|
49 |
+
*/
|
50 |
+
public function current()
|
51 |
+
{
|
52 |
+
$iterator = $this->getInnerIterator();
|
53 |
+
|
54 |
+
return call_user_func($this->callable, $iterator->current(), $iterator->key(), $iterator);
|
55 |
+
}
|
56 |
+
}
|
app/Services/csv/src/Modifier/QueryFilter.php
ADDED
@@ -0,0 +1,298 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file is part of the League.csv library
|
4 |
+
*
|
5 |
+
* @license http://opensource.org/licenses/MIT
|
6 |
+
* @link https://github.com/thephpleague/csv/
|
7 |
+
* @version 8.2.2
|
8 |
+
* @package League.csv
|
9 |
+
*
|
10 |
+
* For the full copyright and license information, please view the LICENSE
|
11 |
+
* file that was distributed with this source code.
|
12 |
+
*/
|
13 |
+
namespace League\Csv\Modifier;
|
14 |
+
|
15 |
+
use ArrayIterator;
|
16 |
+
use CallbackFilterIterator;
|
17 |
+
use Iterator;
|
18 |
+
use LimitIterator;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* A Trait to Query rows against a SplFileObject
|
22 |
+
*
|
23 |
+
* @package League.csv
|
24 |
+
* @since 4.2.1
|
25 |
+
*
|
26 |
+
*/
|
27 |
+
trait QueryFilter
|
28 |
+
{
|
29 |
+
/**
|
30 |
+
* Callables to filter the iterator
|
31 |
+
*
|
32 |
+
* @var callable[]
|
33 |
+
*/
|
34 |
+
protected $iterator_filters = [];
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Callables to sort the iterator
|
38 |
+
*
|
39 |
+
* @var callable[]
|
40 |
+
*/
|
41 |
+
protected $iterator_sort_by = [];
|
42 |
+
|
43 |
+
/**
|
44 |
+
* iterator Offset
|
45 |
+
*
|
46 |
+
* @var int
|
47 |
+
*/
|
48 |
+
protected $iterator_offset = 0;
|
49 |
+
|
50 |
+
/**
|
51 |
+
* iterator maximum length
|
52 |
+
*
|
53 |
+
* @var int
|
54 |
+
*/
|
55 |
+
protected $iterator_limit = -1;
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Stripping BOM status
|
59 |
+
*
|
60 |
+
* @var boolean
|
61 |
+
*/
|
62 |
+
protected $strip_bom = false;
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Stripping BOM setter
|
66 |
+
*
|
67 |
+
* @param bool $status
|
68 |
+
*
|
69 |
+
* @return $this
|
70 |
+
*/
|
71 |
+
public function stripBom($status)
|
72 |
+
{
|
73 |
+
$this->strip_bom = (bool) $status;
|
74 |
+
|
75 |
+
return $this;
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* @inheritdoc
|
80 |
+
*/
|
81 |
+
abstract public function getInputBOM();
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Set LimitIterator Offset
|
85 |
+
*
|
86 |
+
* @param $offset
|
87 |
+
*
|
88 |
+
* @return $this
|
89 |
+
*/
|
90 |
+
public function setOffset($offset = 0)
|
91 |
+
{
|
92 |
+
$this->iterator_offset = $this->validateInteger($offset, 0, 'the offset must be a positive integer or 0');
|
93 |
+
|
94 |
+
return $this;
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* @inheritdoc
|
99 |
+
*/
|
100 |
+
abstract protected function validateInteger($int, $minValue, $errorMessage);
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Set LimitIterator Count
|
104 |
+
*
|
105 |
+
* @param int $limit
|
106 |
+
*
|
107 |
+
* @return $this
|
108 |
+
*/
|
109 |
+
public function setLimit($limit = -1)
|
110 |
+
{
|
111 |
+
$this->iterator_limit = $this->validateInteger($limit, -1, 'the limit must an integer greater or equals to -1');
|
112 |
+
|
113 |
+
return $this;
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Set an Iterator sorting callable function
|
118 |
+
*
|
119 |
+
* @param callable $callable
|
120 |
+
*
|
121 |
+
* @return $this
|
122 |
+
*/
|
123 |
+
public function addSortBy(callable $callable)
|
124 |
+
{
|
125 |
+
$this->iterator_sort_by[] = $callable;
|
126 |
+
|
127 |
+
return $this;
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Set the Iterator filter method
|
132 |
+
*
|
133 |
+
* @param callable $callable
|
134 |
+
*
|
135 |
+
* @return $this
|
136 |
+
*/
|
137 |
+
public function addFilter(callable $callable)
|
138 |
+
{
|
139 |
+
$this->iterator_filters[] = $callable;
|
140 |
+
|
141 |
+
return $this;
|
142 |
+
}
|
143 |
+
|
144 |
+
/**
|
145 |
+
* @inheritdoc
|
146 |
+
*/
|
147 |
+
abstract public function getEnclosure();
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Returns the CSV Iterator
|
151 |
+
*
|
152 |
+
* @return Iterator
|
153 |
+
*/
|
154 |
+
protected function getQueryIterator()
|
155 |
+
{
|
156 |
+
$normalizedCsv = function ($row) {
|
157 |
+
return is_array($row) && $row != [null];
|
158 |
+
};
|
159 |
+
array_unshift($this->iterator_filters, $normalizedCsv);
|
160 |
+
$iterator = $this->getIterator();
|
161 |
+
$iterator = $this->applyBomStripping($iterator);
|
162 |
+
$iterator = $this->applyIteratorFilter($iterator);
|
163 |
+
$iterator = $this->applyIteratorSortBy($iterator);
|
164 |
+
$iterator = $this->applyIteratorInterval($iterator);
|
165 |
+
|
166 |
+
return $iterator;
|
167 |
+
}
|
168 |
+
|
169 |
+
/**
|
170 |
+
* @inheritdoc
|
171 |
+
*/
|
172 |
+
abstract public function getIterator();
|
173 |
+
|
174 |
+
/**
|
175 |
+
* Remove the BOM sequence from the CSV
|
176 |
+
*
|
177 |
+
* @param Iterator $iterator
|
178 |
+
*
|
179 |
+
* @return Iterator
|
180 |
+
*/
|
181 |
+
protected function applyBomStripping(Iterator $iterator)
|
182 |
+
{
|
183 |
+
if (!$this->strip_bom) {
|
184 |
+
return $iterator;
|
185 |
+
}
|
186 |
+
|
187 |
+
if (!$this->isBomStrippable()) {
|
188 |
+
$this->strip_bom = false;
|
189 |
+
|
190 |
+
return $iterator;
|
191 |
+
}
|
192 |
+
|
193 |
+
$this->strip_bom = false;
|
194 |
+
|
195 |
+
return $this->getStripBomIterator($iterator);
|
196 |
+
}
|
197 |
+
|
198 |
+
/**
|
199 |
+
* Tell whether we can strip or not the leading BOM sequence
|
200 |
+
*
|
201 |
+
* @return bool
|
202 |
+
*/
|
203 |
+
protected function isBomStrippable()
|
204 |
+
{
|
205 |
+
return !empty($this->getInputBOM()) && $this->strip_bom;
|
206 |
+
}
|
207 |
+
|
208 |
+
/**
|
209 |
+
* Return the Iterator without the BOM sequence
|
210 |
+
*
|
211 |
+
* @param Iterator $iterator
|
212 |
+
*
|
213 |
+
* @return Iterator
|
214 |
+
*/
|
215 |
+
protected function getStripBomIterator(Iterator $iterator)
|
216 |
+
{
|
217 |
+
$bom_length = mb_strlen($this->getInputBOM());
|
218 |
+
$enclosure = $this->getEnclosure();
|
219 |
+
$strip_bom = function ($row, $index) use ($bom_length, $enclosure) {
|
220 |
+
if (0 != $index) {
|
221 |
+
return $row;
|
222 |
+
}
|
223 |
+
|
224 |
+
$row[0] = mb_substr($row[0], $bom_length);
|
225 |
+
if (mb_substr($row[0], 0, 1) === $enclosure && mb_substr($row[0], -1, 1) === $enclosure) {
|
226 |
+
$row[0] = mb_substr($row[0], 1, -1);
|
227 |
+
}
|
228 |
+
|
229 |
+
return $row;
|
230 |
+
};
|
231 |
+
|
232 |
+
return new MapIterator($iterator, $strip_bom);
|
233 |
+
}
|
234 |
+
|
235 |
+
/**
|
236 |
+
* Filter the Iterator
|
237 |
+
*
|
238 |
+
* @param Iterator $iterator
|
239 |
+
*
|
240 |
+
* @return Iterator
|
241 |
+
*/
|
242 |
+
protected function applyIteratorFilter(Iterator $iterator)
|
243 |
+
{
|
244 |
+
$reducer = function ($iterator, $callable) {
|
245 |
+
return new CallbackFilterIterator($iterator, $callable);
|
246 |
+
};
|
247 |
+
$iterator = array_reduce($this->iterator_filters, $reducer, $iterator);
|
248 |
+
$this->iterator_filters = [];
|
249 |
+
|
250 |
+
return $iterator;
|
251 |
+
}
|
252 |
+
|
253 |
+
/**
|
254 |
+
* Sort the Iterator
|
255 |
+
*
|
256 |
+
* @param Iterator $iterator
|
257 |
+
*
|
258 |
+
* @return Iterator
|
259 |
+
*/
|
260 |
+
protected function applyIteratorSortBy(Iterator $iterator)
|
261 |
+
{
|
262 |
+
if (!$this->iterator_sort_by) {
|
263 |
+
return $iterator;
|
264 |
+
}
|
265 |
+
|
266 |
+
$obj = new ArrayIterator(iterator_to_array($iterator));
|
267 |
+
$obj->uasort(function ($row_a, $row_b) {
|
268 |
+
$res = 0;
|
269 |
+
foreach ($this->iterator_sort_by as $compare) {
|
270 |
+
if (0 !== ($res = call_user_func($compare, $row_a, $row_b))) {
|
271 |
+
break;
|
272 |
+
}
|
273 |
+
}
|
274 |
+
|
275 |
+
return $res;
|
276 |
+
});
|
277 |
+
$this->iterator_sort_by = [];
|
278 |
+
|
279 |
+
return $obj;
|
280 |
+
}
|
281 |
+
|
282 |
+
/**
|
283 |
+
* Sort the Iterator
|
284 |
+
*
|
285 |
+
* @param Iterator $iterator
|
286 |
+
*
|
287 |
+
* @return Iterator
|
288 |
+
*/
|
289 |
+
protected function applyIteratorInterval(Iterator $iterator)
|
290 |
+
{
|
291 |
+
$offset = $this->iterator_offset;
|
292 |
+
$limit = $this->iterator_limit;
|
293 |
+
$this->iterator_limit = -1;
|
294 |
+
$this->iterator_offset = 0;
|
295 |
+
|
296 |
+
return new LimitIterator($iterator, $offset, $limit);
|
297 |
+
}
|
298 |
+
}
|
app/Services/csv/src/Modifier/RowFilter.php
ADDED
@@ -0,0 +1,187 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file is part of the League.csv library
|
4 |
+
*
|
5 |
+
* @license http://opensource.org/licenses/MIT
|
6 |
+
* @link https://github.com/thephpleague/csv/
|
7 |
+
* @version 8.2.2
|
8 |
+
* @package League.csv
|
9 |
+
*
|
10 |
+
* For the full copyright and license information, please view the LICENSE
|
11 |
+
* file that was distributed with this source code.
|
12 |
+
*/
|
13 |
+
namespace League\Csv\Modifier;
|
14 |
+
|
15 |
+
use League\Csv\Exception\InvalidRowException;
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Trait to format and validate the row before insertion
|
19 |
+
*
|
20 |
+
* @package League.csv
|
21 |
+
* @since 7.0.0
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
trait RowFilter
|
25 |
+
{
|
26 |
+
/**
|
27 |
+
* Callables to validate the row before insertion
|
28 |
+
*
|
29 |
+
* @var callable[]
|
30 |
+
*/
|
31 |
+
protected $validators = [];
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Callables to format the row before insertion
|
35 |
+
*
|
36 |
+
* @var callable[]
|
37 |
+
*/
|
38 |
+
protected $formatters = [];
|
39 |
+
|
40 |
+
/**
|
41 |
+
* add a formatter to the collection
|
42 |
+
*
|
43 |
+
* @param callable $callable
|
44 |
+
*
|
45 |
+
* @return $this
|
46 |
+
*/
|
47 |
+
public function addFormatter(callable $callable)
|
48 |
+
{
|
49 |
+
$this->formatters[] = $callable;
|
50 |
+
|
51 |
+
return $this;
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Remove a formatter from the collection
|
56 |
+
*
|
57 |
+
* @param callable $callable
|
58 |
+
*
|
59 |
+
* @return $this
|
60 |
+
*/
|
61 |
+
public function removeFormatter(callable $callable)
|
62 |
+
{
|
63 |
+
$res = array_search($callable, $this->formatters, true);
|
64 |
+
unset($this->formatters[$res]);
|
65 |
+
|
66 |
+
return $this;
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Detect if the formatter is already registered
|
71 |
+
*
|
72 |
+
* @param callable $callable
|
73 |
+
*
|
74 |
+
* @return bool
|
75 |
+
*/
|
76 |
+
public function hasFormatter(callable $callable)
|
77 |
+
{
|
78 |
+
return false !== array_search($callable, $this->formatters, true);
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Remove all registered formatter
|
83 |
+
*
|
84 |
+
* @return $this
|
85 |
+
*/
|
86 |
+
public function clearFormatters()
|
87 |
+
{
|
88 |
+
$this->formatters = [];
|
89 |
+
|
90 |
+
return $this;
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* add a Validator to the collection
|
95 |
+
*
|
96 |
+
* @param callable $callable
|
97 |
+
* @param string $name the rule name
|
98 |
+
*
|
99 |
+
* @return $this
|
100 |
+
*/
|
101 |
+
public function addValidator(callable $callable, $name)
|
102 |
+
{
|
103 |
+
$name = $this->validateString($name);
|
104 |
+
|
105 |
+
$this->validators[$name] = $callable;
|
106 |
+
|
107 |
+
return $this;
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* @inheritdoc
|
112 |
+
*/
|
113 |
+
abstract protected function validateString($str);
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Remove a validator from the collection
|
117 |
+
*
|
118 |
+
* @param string $name the validator name
|
119 |
+
*
|
120 |
+
* @return $this
|
121 |
+
*/
|
122 |
+
public function removeValidator($name)
|
123 |
+
{
|
124 |
+
$name = $this->validateString($name);
|
125 |
+
unset($this->validators[$name]);
|
126 |
+
|
127 |
+
return $this;
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Detect if a validator is already registered
|
132 |
+
*
|
133 |
+
* @param string $name the validator name
|
134 |
+
*
|
135 |
+
* @return bool
|
136 |
+
*/
|
137 |
+
public function hasValidator($name)
|
138 |
+
{
|
139 |
+
$name = $this->validateString($name);
|
140 |
+
|
141 |
+
return isset($this->validators[$name]);
|
142 |
+
}
|
143 |
+
|
144 |
+
/**
|
145 |
+
* Remove all registered validators
|
146 |
+
*
|
147 |
+
* @return $this
|
148 |
+
*/
|
149 |
+
public function clearValidators()
|
150 |
+
{
|
151 |
+
$this->validators = [];
|
152 |
+
|
153 |
+
return $this;
|
154 |
+
}
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Format the given row
|
158 |
+
*
|
159 |
+
* @param array $row
|
160 |
+
*
|
161 |
+
* @return array
|
162 |
+
*/
|
163 |
+
protected function formatRow(array $row)
|
164 |
+
{
|
165 |
+
foreach ($this->formatters as $formatter) {
|
166 |
+
$row = call_user_func($formatter, $row);
|
167 |
+
}
|
168 |
+
|
169 |
+
return $row;
|
170 |
+
}
|
171 |
+
|
172 |
+
/**
|
173 |
+
* Validate a row
|
174 |
+
*
|
175 |
+
* @param array $row
|
176 |
+
*
|
177 |
+
* @throws InvalidRowException If the validation failed
|
178 |
+
*/
|
179 |
+
protected function validateRow(array $row)
|
180 |
+
{
|
181 |
+
foreach ($this->validators as $name => $validator) {
|
182 |
+
if (true !== call_user_func($validator, $row)) {
|
183 |
+
throw new InvalidRowException($name, $row, 'row validation failed');
|
184 |
+
}
|
185 |
+
}
|
186 |
+
}
|
187 |
+
}
|
app/Services/csv/src/Modifier/StreamFilter.php
ADDED
@@ -0,0 +1,299 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file is part of the League.csv library
|
4 |
+
*
|
5 |
+
* @license http://opensource.org/licenses/MIT
|
6 |
+
* @link https://github.com/thephpleague/csv/
|
7 |
+
* @version 8.2.2
|
8 |
+
* @package League.csv
|
9 |
+
*
|
10 |
+
* For the full copyright and license information, please view the LICENSE
|
11 |
+
* file that was distributed with this source code.
|
12 |
+
*/
|
13 |
+
namespace League\Csv\Modifier;
|
14 |
+
|
15 |
+
use LogicException;
|
16 |
+
use OutOfBoundsException;
|
17 |
+
use SplFileObject;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* A Trait to ease PHP Stream Filters manipulation
|
21 |
+
* with a SplFileObject
|
22 |
+
*
|
23 |
+
* @package League.csv
|
24 |
+
* @since 6.0.0
|
25 |
+
*
|
26 |
+
*/
|
27 |
+
trait StreamFilter
|
28 |
+
{
|
29 |
+
/**
|
30 |
+
* collection of stream filters
|
31 |
+
*
|
32 |
+
* @var array
|
33 |
+
*/
|
34 |
+
protected $stream_filters = [];
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Stream filtering mode to apply on all filters
|
38 |
+
*
|
39 |
+
* @var int
|
40 |
+
*/
|
41 |
+
protected $stream_filter_mode = STREAM_FILTER_ALL;
|
42 |
+
|
43 |
+
/**
|
44 |
+
*the real path
|
45 |
+
*
|
46 |
+
* @var string the real path to the file
|
47 |
+
*
|
48 |
+
*/
|
49 |
+
protected $stream_uri;
|
50 |
+
|
51 |
+
/**
|
52 |
+
* PHP Stream Filter Regex
|
53 |
+
*
|
54 |
+
* @var string
|
55 |
+
*/
|
56 |
+
protected $stream_regex = ',^
|
57 |
+
php://filter/
|
58 |
+
(?P<mode>:?read=|write=)? # The resource open mode
|
59 |
+
(?P<filters>.*?) # The resource registered filters
|
60 |
+
/resource=(?P<resource>.*) # The resource path
|
61 |
+
$,ix';
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Internal path setter
|
65 |
+
*
|
66 |
+
* The path must be an SplFileInfo object
|
67 |
+
* an object that implements the `__toString` method
|
68 |
+
* a path to a file
|
69 |
+
*
|
70 |
+
* @param StreamIterator|SplFileObject|string $path The file path
|
71 |
+
*/
|
72 |
+
protected function initStreamFilter($path)
|
73 |
+
{
|
74 |
+
$this->stream_filters = [];
|
75 |
+
if (!is_string($path)) {
|
76 |
+
$this->stream_uri = null;
|
77 |
+
|
78 |
+
return;
|
79 |
+
}
|
80 |
+
|
81 |
+
if (!preg_match($this->stream_regex, $path, $matches)) {
|
82 |
+
$this->stream_uri = $path;
|
83 |
+
|
84 |
+
return;
|
85 |
+
}
|
86 |
+
$this->stream_uri = $matches['resource'];
|
87 |
+
$this->stream_filters = array_map('urldecode', explode('|', $matches['filters']));
|
88 |
+
$this->stream_filter_mode = $this->fetchStreamModeAsInt($matches['mode']);
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Get the stream mode
|
93 |
+
*
|
94 |
+
* @param string $mode
|
95 |
+
*
|
96 |
+
* @return int
|
97 |
+
*/
|
98 |
+
protected function fetchStreamModeAsInt($mode)
|
99 |
+
{
|
100 |
+
$mode = strtolower($mode);
|
101 |
+
$mode = rtrim($mode, '=');
|
102 |
+
if ('write' == $mode) {
|
103 |
+
return STREAM_FILTER_WRITE;
|
104 |
+
}
|
105 |
+
|
106 |
+
if ('read' == $mode) {
|
107 |
+
return STREAM_FILTER_READ;
|
108 |
+
}
|
109 |
+
|
110 |
+
return STREAM_FILTER_ALL;
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Check if the trait methods can be used
|
115 |
+
*
|
116 |
+
* @throws LogicException If the API can not be use
|
117 |
+
*/
|
118 |
+
protected function assertStreamable()
|
119 |
+
{
|
120 |
+
if (!is_string($this->stream_uri)) {
|
121 |
+
throw new LogicException('The stream filter API can not be used');
|
122 |
+
}
|
123 |
+
}
|
124 |
+
|
125 |
+
/**
|
126 |
+
* Tells whether the stream filter capabilities can be used
|
127 |
+
*
|
128 |
+
* @return bool
|
129 |
+
*/
|
130 |
+
public function isActiveStreamFilter()
|
131 |
+
{
|
132 |
+
return is_string($this->stream_uri);
|
133 |
+
}
|
134 |
+
|
135 |
+
/**
|
136 |
+
* stream filter mode Setter
|
137 |
+
*
|
138 |
+
* Set the new Stream Filter mode and remove all
|
139 |
+
* previously attached stream filters
|
140 |
+
*
|
141 |
+
* @param int $mode
|
142 |
+
*
|
143 |
+
* @throws OutOfBoundsException If the mode is invalid
|
144 |
+
*
|
145 |
+
* @return $this
|
146 |
+
*/
|
147 |
+
public function setStreamFilterMode($mode)
|
148 |
+
{
|
149 |
+
$this->assertStreamable();
|
150 |
+
if (!in_array($mode, [STREAM_FILTER_ALL, STREAM_FILTER_READ, STREAM_FILTER_WRITE])) {
|
151 |
+
throw new OutOfBoundsException('the $mode should be a valid `STREAM_FILTER_*` constant');
|
152 |
+
}
|
153 |
+
|
154 |
+
$this->stream_filter_mode = $mode;
|
155 |
+
$this->stream_filters = [];
|
156 |
+
|
157 |
+
return $this;
|
158 |
+
}
|
159 |
+
|
160 |
+
/**
|
161 |
+
* stream filter mode getter
|
162 |
+
*
|
163 |
+
* @return int
|
164 |
+
*/
|
165 |
+
public function getStreamFilterMode()
|
166 |
+
{
|
167 |
+
$this->assertStreamable();
|
168 |
+
|
169 |
+
return $this->stream_filter_mode;
|
170 |
+
}
|
171 |
+
|
172 |
+
/**
|
173 |
+
* append a stream filter
|
174 |
+
*
|
175 |
+
* @param string $filter_name a string or an object that implements the '__toString' method
|
176 |
+
*
|
177 |
+
* @return $this
|
178 |
+
*/
|
179 |
+
public function appendStreamFilter($filter_name)
|
180 |
+
{
|
181 |
+
$this->assertStreamable();
|
182 |
+
$this->stream_filters[] = $this->sanitizeStreamFilter($filter_name);
|
183 |
+
|
184 |
+
return $this;
|
185 |
+
}
|
186 |
+
|
187 |
+
/**
|
188 |
+
* prepend a stream filter
|
189 |
+
*
|
190 |
+
* @param string $filter_name a string or an object that implements the '__toString' method
|
191 |
+
*
|
192 |
+
* @return $this
|
193 |
+
*/
|
194 |
+
public function prependStreamFilter($filter_name)
|
195 |
+
{
|
196 |
+
$this->assertStreamable();
|
197 |
+
array_unshift($this->stream_filters, $this->sanitizeStreamFilter($filter_name));
|
198 |
+
|
199 |
+
return $this;
|
200 |
+
}
|
201 |
+
|
202 |
+
/**
|
203 |
+
* Sanitize the stream filter name
|
204 |
+
*
|
205 |
+
* @param string $filter_name the stream filter name
|
206 |
+
*
|
207 |
+
* @return string
|
208 |
+
*/
|
209 |
+
protected function sanitizeStreamFilter($filter_name)
|
210 |
+
{
|
211 |
+
return urldecode($this->validateString($filter_name));
|
212 |
+
}
|
213 |
+
|
214 |
+
/**
|
215 |
+
* @inheritdoc
|
216 |
+
*/
|
217 |
+
abstract public function validateString($str);
|
218 |
+
|
219 |
+
/**
|
220 |
+
* Detect if the stream filter is already present
|
221 |
+
*
|
222 |
+
* @param string $filter_name
|
223 |
+
*
|
224 |
+
* @return bool
|
225 |
+
*/
|
226 |
+
public function hasStreamFilter($filter_name)
|
227 |
+
{
|
228 |
+
$this->assertStreamable();
|
229 |
+
|
230 |
+
return false !== array_search(urldecode($filter_name), $this->stream_filters, true);
|
231 |
+
}
|
232 |
+
|
233 |
+
/**
|
234 |
+
* Remove a filter from the collection
|
235 |
+
*
|
236 |
+
* @param string $filter_name
|
237 |
+
*
|
238 |
+
* @return $this
|
239 |
+
*/
|
240 |
+
public function removeStreamFilter($filter_name)
|
241 |
+
{
|
242 |
+
$this->assertStreamable();
|
243 |
+
$res = array_search(urldecode($filter_name), $this->stream_filters, true);
|
244 |
+
if (false !== $res) {
|
245 |
+
unset($this->stream_filters[$res]);
|
246 |
+
}
|
247 |
+
|
248 |
+
return $this;
|
249 |
+
}
|
250 |
+
|
251 |
+
/**
|
252 |
+
* Remove all registered stream filter
|
253 |
+
*
|
254 |
+
* @return $this
|
255 |
+
*/
|
256 |
+
public function clearStreamFilter()
|
257 |
+
{
|
258 |
+
$this->assertStreamable();
|
259 |
+
$this->stream_filters = [];
|
260 |
+
|
261 |
+
return $this;
|
262 |
+
}
|
263 |
+
|
264 |
+
/**
|
265 |
+
* Return the filter path
|
266 |
+
*
|
267 |
+
* @return string
|
268 |
+
*/
|
269 |
+
protected function getStreamFilterPath()
|
270 |
+
{
|
271 |
+
$this->assertStreamable();
|
272 |
+
if (!$this->stream_filters) {
|
273 |
+
return $this->stream_uri;
|
274 |
+
}
|
275 |
+
|
276 |
+
return 'php://filter/'
|
277 |
+
.$this->getStreamFilterPrefix()
|
278 |
+
.implode('|', array_map('urlencode', $this->stream_filters))
|
279 |
+
.'/resource='.$this->stream_uri;
|
280 |
+
}
|
281 |
+
|
282 |
+
/**
|
283 |
+
* Return PHP stream filter prefix
|
284 |
+
*
|
285 |
+
* @return string
|
286 |
+
*/
|
287 |
+
protected function getStreamFilterPrefix()
|
288 |
+
{
|
289 |
+
if (STREAM_FILTER_READ == $this->stream_filter_mode) {
|
290 |
+
return 'read=';
|
291 |
+
}
|
292 |
+
|
293 |
+
if (STREAM_FILTER_WRITE == $this->stream_filter_mode) {
|
294 |
+
return 'write=';
|
295 |
+
}
|
296 |
+
|
297 |
+
return '';
|
298 |
+
}
|
299 |
+
}
|
app/Services/csv/src/Modifier/StreamIterator.php
ADDED
@@ -0,0 +1,334 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file is part of the League.csv library
|
4 |
+
*
|
5 |
+
* @license http://opensource.org/licenses/MIT
|
6 |
+
* @link https://github.com/thephpleague/csv/
|
7 |
+
* @version 8.2.2
|
8 |
+
* @package League.csv
|
9 |
+
*
|
10 |
+
* For the full copyright and license information, please view the LICENSE
|
11 |
+
* file that was distributed with this source code.
|
12 |
+
*/
|
13 |
+
namespace League\Csv\Modifier;
|
14 |
+
|
15 |
+
use InvalidArgumentException;
|
16 |
+
use Iterator;
|
17 |
+
use SplFileObject;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* A Stream Iterator
|
21 |
+
*
|
22 |
+
* @package League.csv
|
23 |
+
* @since 8.2.0
|
24 |
+
* @internal used internally to iterate over a stream resource
|
25 |
+
*
|
26 |
+
*/
|
27 |
+
class StreamIterator implements Iterator
|
28 |
+
{
|
29 |
+
/**
|
30 |
+
* Stream pointer
|
31 |
+
*
|
32 |
+
* @var resource
|
33 |
+
*/
|
34 |
+
protected $stream;
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Current iterator value
|
38 |
+
*
|
39 |
+
* @var mixed
|
40 |
+
*/
|
41 |
+
protected $current_line;
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Current iterator key
|
45 |
+
*
|
46 |
+
* @var int
|
47 |
+
*/
|
48 |
+
protected $current_line_number;
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Flags for the StreamIterator
|
52 |
+
*
|
53 |
+
* @var int
|
54 |
+
*/
|
55 |
+
protected $flags = 0;
|
56 |
+
|
57 |
+
/**
|
58 |
+
* the field delimiter (one character only)
|
59 |
+
*
|
60 |
+
* @var string
|
61 |
+
*/
|
62 |
+
protected $delimiter = ',';
|
63 |
+
|
64 |
+
/**
|
65 |
+
* the field enclosure character (one character only)
|
66 |
+
*
|
67 |
+
* @var string
|
68 |
+
*/
|
69 |
+
protected $enclosure = '"';
|
70 |
+
|
71 |
+
/**
|
72 |
+
* the field escape character (one character only)
|
73 |
+
*
|
74 |
+
* @var string
|
75 |
+
*/
|
76 |
+
protected $escape = '\\';
|
77 |
+
|
78 |
+
/**
|
79 |
+
* New instance
|
80 |
+
*
|
81 |
+
* @param resource $stream stream type resource
|
82 |
+
*/
|
83 |
+
public function __construct($stream)
|
84 |
+
{
|
85 |
+
if (!is_resource($stream) || 'stream' !== get_resource_type($stream)) {
|
86 |
+
throw new InvalidArgumentException(sprintf(
|
87 |
+
'Expected resource to be a stream, received %s instead',
|
88 |
+
is_object($stream) ? get_class($stream) : gettype($stream)
|
89 |
+
));
|
90 |
+
}
|
91 |
+
|
92 |
+
$data = stream_get_meta_data($stream);
|
93 |
+
if (!$data['seekable']) {
|
94 |
+
throw new InvalidArgumentException('The stream must be seekable');
|
95 |
+
}
|
96 |
+
|
97 |
+
$this->stream = $stream;
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Set CSV control
|
102 |
+
*
|
103 |
+
* @see http://php.net/manual/en/splfileobject.setcsvcontrol.php
|
104 |
+
*
|
105 |
+
* @param string $delimiter
|
106 |
+
* @param string $enclosure
|
107 |
+
* @param string $escape
|
108 |
+
*/
|
109 |
+
public function setCsvControl($delimiter = ',', $enclosure = '"', $escape = '\\')
|
110 |
+
{
|
111 |
+
$this->delimiter = $this->filterControl($delimiter, 'delimiter');
|
112 |
+
$this->enclosure = $this->filterControl($enclosure, 'enclosure');
|
113 |
+
$this->escape = $this->filterControl($escape, 'escape');
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Filter Csv control character
|
118 |
+
*
|
119 |
+
* @param string $char Csv control character
|
120 |
+
* @param string $type Csv control character type
|
121 |
+
*
|
122 |
+
* @throws InvalidArgumentException If the Csv control character is not one character only.
|
123 |
+
*
|
124 |
+
* @return string
|
125 |
+
*/
|
126 |
+
private function filterControl($char, $type)
|
127 |
+
{
|
128 |
+
if (1 == strlen($char)) {
|
129 |
+
return $char;
|
130 |
+
}
|
131 |
+
|
132 |
+
throw new InvalidArgumentException(sprintf('The %s character must be a single character', $type));
|
133 |
+
}
|
134 |
+
|
135 |
+
/**
|
136 |
+
* Set Flags
|
137 |
+
*
|
138 |
+
* @see http://php.net/manual/en/splfileobject.setflags.php
|
139 |
+
*
|
140 |
+
* @param int $flags
|
141 |
+
*/
|
142 |
+
public function setFlags($flags)
|
143 |
+
{
|
144 |
+
if (false === filter_var($flags, FILTER_VALIDATE_INT, ['options' => ['min_range' => 0]])) {
|
145 |
+
throw new InvalidArgumentException('The flags must be a positive integer');
|
146 |
+
}
|
147 |
+
|
148 |
+
$this->flags = $flags;
|
149 |
+
}
|
150 |
+
|
151 |
+
/**
|
152 |
+
* Write a field array as a CSV line
|
153 |
+
*
|
154 |
+
* @see http://php.net/manual/en/splfileobject.fputcsv.php
|
155 |
+
*
|
156 |
+
* @param array $fields
|
157 |
+
* @param string $delimiter
|
158 |
+
* @param string $enclosure
|
159 |
+
* @param string $escape
|
160 |
+
*
|
161 |
+
* @return int
|
162 |
+
*/
|
163 |
+
public function fputcsv(array $fields, $delimiter = ',', $enclosure = '"', $escape = '\\')
|
164 |
+
{
|
165 |
+
return fputcsv(
|
166 |
+
$this->stream,
|
167 |
+
$fields,
|
168 |
+
$this->filterControl($delimiter, 'delimiter'),
|
169 |
+
$this->filterControl($enclosure, 'enclosure'),
|
170 |
+
$this->filterControl($escape, 'escape')
|
171 |
+
);
|
172 |
+
}
|
173 |
+
|
174 |
+
/**
|
175 |
+
* Retrieves the current line of the file.
|
176 |
+
*
|
177 |
+
* @return mixed
|
178 |
+
*/
|
179 |
+
public function current()
|
180 |
+
{
|
181 |
+
if (false !== $this->current_line) {
|
182 |
+
return $this->current_line;
|
183 |
+
}
|
184 |
+
|
185 |
+
if (($this->flags & SplFileObject::READ_CSV) == SplFileObject::READ_CSV) {
|
186 |
+
$this->current_line = $this->getCurrentRecord();
|
187 |
+
|
188 |
+
return $this->current_line;
|
189 |
+
}
|
190 |
+
|
191 |
+
$this->current_line = $this->getCurrentLine();
|
192 |
+
|
193 |
+
return $this->current_line;
|
194 |
+
}
|
195 |
+
|
196 |
+
/**
|
197 |
+
* Retrieves the current line as a CSV Record
|
198 |
+
*
|
199 |
+
* @return array
|
200 |
+
*/
|
201 |
+
protected function getCurrentRecord()
|
202 |
+
{
|
203 |
+
do {
|
204 |
+
$ret = fgetcsv($this->stream, 0, $this->delimiter, $this->enclosure, $this->escape);
|
205 |
+
} while ($this->flags & SplFileObject::SKIP_EMPTY && $ret !== false && $ret[0] === null);
|
206 |
+
|
207 |
+
return $ret;
|
208 |
+
}
|
209 |
+
|
210 |
+
/**
|
211 |
+
* Retrieves the current line as a string
|
212 |
+
*
|
213 |
+
* @return string
|
214 |
+
*/
|
215 |
+
protected function getCurrentLine()
|
216 |
+
{
|
217 |
+
do {
|
218 |
+
$line = fgets($this->stream);
|
219 |
+
} while ($this->flags & SplFileObject::SKIP_EMPTY && $line !== false && rtrim($line, "\r\n") !== '');
|
220 |
+
|
221 |
+
return $line;
|
222 |
+
}
|
223 |
+
|
224 |
+
/**
|
225 |
+
* Get line number
|
226 |
+
*
|
227 |
+
* @return int
|
228 |
+
*/
|
229 |
+
public function key()
|
230 |
+
{
|
231 |
+
return $this->current_line_number;
|
232 |
+
}
|
233 |
+
|
234 |
+
/**
|
235 |
+
* Read next line
|
236 |
+
*/
|
237 |
+
public function next()
|
238 |
+
{
|
239 |
+
$this->current_line = false;
|
240 |
+
$this->current_line_number++;
|
241 |
+
}
|
242 |
+
|
243 |
+
/**
|
244 |
+
* Rewind the file to the first line
|
245 |
+
*/
|
246 |
+
public function rewind()
|
247 |
+
{
|
248 |
+
rewind($this->stream);
|
249 |
+
$this->current_line_number = 0;
|
250 |
+
$this->current_line = false;
|
251 |
+
if ($this->flags & SplFileObject::READ_AHEAD) {
|
252 |
+
$this->current();
|
253 |
+
}
|
254 |
+
}
|
255 |
+
|
256 |
+
/**
|
257 |
+
* Not at EOF
|
258 |
+
*
|
259 |
+
* @return bool
|
260 |
+
*/
|
261 |
+
public function valid()
|
262 |
+
{
|
263 |
+
if ($this->flags & SplFileObject::READ_AHEAD) {
|
264 |
+
return $this->current() !== false;
|
265 |
+
}
|
266 |
+
|
267 |
+
return !feof($this->stream);
|
268 |
+
}
|
269 |
+
|
270 |
+
/**
|
271 |
+
* Gets line from file
|
272 |
+
*
|
273 |
+
* @see http://php.net/manual/en/splfileobject.fgets.php
|
274 |
+
*
|
275 |
+
* @return string
|
276 |
+
*/
|
277 |
+
public function fgets()
|
278 |
+
{
|
279 |
+
if (false !== $this->current_line) {
|
280 |
+
$this->next();
|
281 |
+
}
|
282 |
+
return $this->current_line = $this->getCurrentLine();
|
283 |
+
}
|
284 |
+
|
285 |
+
/**
|
286 |
+
* Output all remaining data on a file pointer
|
287 |
+
*
|
288 |
+
* @see http://php.net/manual/en/splfileobject.fpatssthru.php
|
289 |
+
*
|
290 |
+
* @return int
|
291 |
+
*/
|
292 |
+
public function fpassthru()
|
293 |
+
{
|
294 |
+
return fpassthru($this->stream);
|
295 |
+
}
|
296 |
+
|
297 |
+
/**
|
298 |
+
* Seek to a position
|
299 |
+
*
|
300 |
+
* @see http://php.net/manual/en/splfileobject.fseek.php
|
301 |
+
*
|
302 |
+
* @param int $offset
|
303 |
+
* @param int $whence
|
304 |
+
*
|
305 |
+
* @return int
|
306 |
+
*/
|
307 |
+
public function fseek($offset, $whence = SEEK_SET)
|
308 |
+
{
|
309 |
+
return fseek($this->stream, $offset, $whence);
|
310 |
+
}
|
311 |
+
|
312 |
+
/**
|
313 |
+
* Write to stream
|
314 |
+
*
|
315 |
+
* @see http://php.net/manual/en/splfileobject.fwrite.php
|
316 |
+
*
|
317 |
+
* @param string $str
|
318 |
+
* @param int $length
|
319 |
+
*
|
320 |
+
* @return int
|
321 |
+
*/
|
322 |
+
public function fwrite($str, $length = 0)
|
323 |
+
{
|
324 |
+
return fwrite($this->stream, $str, $length);
|
325 |
+
}
|
326 |
+
|
327 |
+
/**
|
328 |
+
* close the file pointer
|
329 |
+
*/
|
330 |
+
public function __destruct()
|
331 |
+
{
|
332 |
+
$this->stream = null;
|
333 |
+
}
|
334 |
+
}
|
app/Services/csv/src/Plugin/ColumnConsistencyValidator.php
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file is part of the League.csv library
|
4 |
+
*
|
5 |
+
* @license http://opensource.org/licenses/MIT
|
6 |
+
* @link https://github.com/thephpleague/csv/
|
7 |
+
* @version 8.2.2
|
8 |
+
* @package League.csv
|
9 |
+
*
|
10 |
+
* For the full copyright and license information, please view the LICENSE
|
11 |
+
* file that was distributed with this source code.
|
12 |
+
*/
|
13 |
+
namespace League\Csv\Plugin;
|
14 |
+
|
15 |
+
use InvalidArgumentException;
|
16 |
+
|
17 |
+
/**
|
18 |
+
* A class to manage column consistency on data insertion into a CSV
|
19 |
+
*
|
20 |
+
* @package League.csv
|
21 |
+
* @since 7.0.0
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
class ColumnConsistencyValidator
|
25 |
+
{
|
26 |
+
/**
|
27 |
+
* The number of column per row
|
28 |
+
*
|
29 |
+
* @var int
|
30 |
+
*/
|
31 |
+
private $columns_count = -1;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* should the class detect the column count based the inserted row
|
35 |
+
*
|
36 |
+
* @var bool
|
37 |
+
*/
|
38 |
+
private $detect_columns_count = false;
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Set Inserted row column count
|
42 |
+
*
|
43 |
+
* @param int $value
|
44 |
+
*
|
45 |
+
* @throws InvalidArgumentException If $value is lesser than -1
|
46 |
+
*
|
47 |
+
*/
|
48 |
+
public function setColumnsCount($value)
|
49 |
+
{
|
50 |
+
if (false === filter_var($value, FILTER_VALIDATE_INT, ['options' => ['min_range' => -1]])) {
|
51 |
+
throw new InvalidArgumentException('the column count must an integer greater or equals to -1');
|
52 |
+
}
|
53 |
+
$this->detect_columns_count = false;
|
54 |
+
$this->columns_count = $value;
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Column count getter
|
59 |
+
*
|
60 |
+
* @return int
|
61 |
+
*/
|
62 |
+
public function getColumnsCount()
|
63 |
+
{
|
64 |
+
return $this->columns_count;
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* The method will set the $columns_count property according to the next inserted row
|
69 |
+
* and therefore will also validate the next line whatever length it has no matter
|
70 |
+
* the current $columns_count property value.
|
71 |
+
*
|
72 |
+
*/
|
73 |
+
public function autodetectColumnsCount()
|
74 |
+
{
|
75 |
+
$this->detect_columns_count = true;
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Is the submitted row valid
|
80 |
+
*
|
81 |
+
* @param array $row
|
82 |
+
*
|
83 |
+
* @return bool
|
84 |
+
*/
|
85 |
+
public function __invoke(array $row)
|
86 |
+
{
|
87 |
+
if ($this->detect_columns_count) {
|
88 |
+
$this->columns_count = count($row);
|
89 |
+
$this->detect_columns_count = false;
|
90 |
+
|
91 |
+
return true;
|
92 |
+
}
|
93 |
+
|
94 |
+
if (-1 == $this->columns_count) {
|
95 |
+
return true;
|
96 |
+
}
|
97 |
+
|
98 |
+
return count($row) === $this->columns_count;
|
99 |
+
}
|
100 |
+
}
|
app/Services/csv/src/Plugin/ForbiddenNullValuesValidator.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file is part of the League.csv library
|
4 |
+
*
|
5 |
+
* @license http://opensource.org/licenses/MIT
|
6 |
+
* @link https://github.com/thephpleague/csv/
|
7 |
+
* @version 8.2.2
|
8 |
+
* @package League.csv
|
9 |
+
*
|
10 |
+
* For the full copyright and license information, please view the LICENSE
|
11 |
+
* file that was distributed with this source code.
|
12 |
+
*/
|
13 |
+
namespace League\Csv\Plugin;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* A class to validate null value handling on data insertion into a CSV
|
17 |
+
*
|
18 |
+
* @package League.csv
|
19 |
+
* @since 7.0.0
|
20 |
+
*
|
21 |
+
*/
|
22 |
+
class ForbiddenNullValuesValidator
|
23 |
+
{
|
24 |
+
/**
|
25 |
+
* Is the submitted row valid
|
26 |
+
*
|
27 |
+
* @param array $row
|
28 |
+
*
|
29 |
+
* @return bool
|
30 |
+
*/
|
31 |
+
public function __invoke(array $row)
|
32 |
+
{
|
33 |
+
$res = array_filter($row, function ($value) {
|
34 |
+
return null === $value;
|
35 |
+
});
|
36 |
+
|
37 |
+
return !$res;
|
38 |
+
}
|
39 |
+
}
|
app/Services/csv/src/Plugin/SkipNullValuesFormatter.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file is part of the League.csv library
|
4 |
+
*
|
5 |
+
* @license http://opensource.org/licenses/MIT
|
6 |
+
* @link https://github.com/thephpleague/csv/
|
7 |
+
* @version 8.2.2
|
8 |
+
* @package League.csv
|
9 |
+
*
|
10 |
+
* For the full copyright and license information, please view the LICENSE
|
11 |
+
* file that was distributed with this source code.
|
12 |
+
*/
|
13 |
+
namespace League\Csv\Plugin;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* A class to remove null value from data before insertion into a CSV
|
17 |
+
*
|
18 |
+
* @package League.csv
|
19 |
+
* @since 7.0.0
|
20 |
+
*
|
21 |
+
*/
|
22 |
+
class SkipNullValuesFormatter
|
23 |
+
{
|
24 |
+
/**
|
25 |
+
* remove null value form the submitted array
|
26 |
+
*
|
27 |
+
* @param array $row
|
28 |
+
*
|
29 |
+
* @return array
|
30 |
+
*/
|
31 |
+
public function __invoke(array $row)
|
32 |
+
{
|
33 |
+
return array_filter($row, function ($value) {
|
34 |
+
return null !== $value;
|
35 |
+
});
|
36 |
+
}
|
37 |
+
}
|
app/Services/csv/src/Reader.php
ADDED
@@ -0,0 +1,339 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file is part of the League.csv library
|
4 |
+
*
|
5 |
+
* @license http://opensource.org/licenses/MIT
|
6 |
+
* @link https://github.com/thephpleague/csv/
|
7 |
+
* @version 8.2.2
|
8 |
+
* @package League.csv
|
9 |
+
*
|
10 |
+
* For the full copyright and license information, please view the LICENSE
|
11 |
+
* file that was distributed with this source code.
|
12 |
+
*/
|
13 |
+
namespace League\Csv;
|
14 |
+
|
15 |
+
use Generator;
|
16 |
+
use InvalidArgumentException;
|
17 |
+
use Iterator;
|
18 |
+
use League\Csv\Modifier\MapIterator;
|
19 |
+
use LimitIterator;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* A class to manage extracting and filtering a CSV
|
23 |
+
*
|
24 |
+
* @package League.csv
|
25 |
+
* @since 3.0.0
|
26 |
+
*
|
27 |
+
*/
|
28 |
+
class Reader extends AbstractCsv
|
29 |
+
{
|
30 |
+
/**
|
31 |
+
* @inheritdoc
|
32 |
+
*/
|
33 |
+
protected $stream_filter_mode = STREAM_FILTER_READ;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Returns a sequential array of all CSV lines
|
37 |
+
*
|
38 |
+
* The callable function will be applied to each Iterator item
|
39 |
+
*
|
40 |
+
* @param callable|null $callable a callable function
|
41 |
+
*
|
42 |
+
* @return array
|
43 |
+
*/
|
44 |
+
public function fetchAll(callable $callable = null)
|
45 |
+
{
|
46 |
+
return iterator_to_array($this->applyCallable($this->getQueryIterator(), $callable), false);
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Fetch the next row from a result set
|
51 |
+
*
|
52 |
+
* @param callable|null $callable a callable function to be applied to each Iterator item
|
53 |
+
*
|
54 |
+
* @return Iterator
|
55 |
+
*/
|
56 |
+
public function fetch(callable $callable = null)
|
57 |
+
{
|
58 |
+
return $this->applyCallable($this->getQueryIterator(), $callable);
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Apply The callable function
|
63 |
+
*
|
64 |
+
* @param Iterator $iterator
|
65 |
+
* @param callable|null $callable
|
66 |
+
*
|
67 |
+
* @return Iterator
|
68 |
+
*/
|
69 |
+
protected function applyCallable(Iterator $iterator, callable $callable = null)
|
70 |
+
{
|
71 |
+
if (null !== $callable) {
|
72 |
+
return new MapIterator($iterator, $callable);
|
73 |
+
}
|
74 |
+
|
75 |
+
return $iterator;
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Applies a callback function on the CSV
|
80 |
+
*
|
81 |
+
* The callback function must return TRUE in order to continue
|
82 |
+
* iterating over the iterator.
|
83 |
+
*
|
84 |
+
* @param callable $callable a callable function to apply to each selected CSV rows
|
85 |
+
*
|
86 |
+
* @return int the iteration count
|
87 |
+
*/
|
88 |
+
public function each(callable $callable)
|
89 |
+
{
|
90 |
+
$index = 0;
|
91 |
+
$iterator = $this->getQueryIterator();
|
92 |
+
$iterator->rewind();
|
93 |
+
while ($iterator->valid() && true === call_user_func(
|
94 |
+
$callable,
|
95 |
+
$iterator->current(),
|
96 |
+
$iterator->key(),
|
97 |
+
$iterator
|
98 |
+
)) {
|
99 |
+
++$index;
|
100 |
+
$iterator->next();
|
101 |
+
}
|
102 |
+
|
103 |
+
return $index;
|
104 |
+
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Returns a single row from the CSV
|
108 |
+
*
|
109 |
+
* By default if no offset is provided the first row of the CSV is selected
|
110 |
+
*
|
111 |
+
* @param int $offset the CSV row offset
|
112 |
+
*
|
113 |
+
* @return array
|
114 |
+
*/
|
115 |
+
public function fetchOne($offset = 0)
|
116 |
+
{
|
117 |
+
$this->setOffset($offset);
|
118 |
+
$this->setLimit(1);
|
119 |
+
$iterator = $this->getQueryIterator();
|
120 |
+
$iterator->rewind();
|
121 |
+
|
122 |
+
return (array) $iterator->current();
|
123 |
+
}
|
124 |
+
|
125 |
+
/**
|
126 |
+
* Returns the next value from a single CSV column
|
127 |
+
*
|
128 |
+
* The callable function will be applied to each value to be return
|
129 |
+
*
|
130 |
+
* By default if no column index is provided the first column of the CSV is selected
|
131 |
+
*
|
132 |
+
* @param int $column_index CSV column index
|
133 |
+
* @param callable|null $callable A callable to be applied to each of the value to be returned.
|
134 |
+
*
|
135 |
+
* @return Iterator
|
136 |
+
*/
|
137 |
+
public function fetchColumn($column_index = 0, callable $callable = null)
|
138 |
+
{
|
139 |
+
$column_index = $this->validateInteger($column_index, 0, 'the column index must be a positive integer or 0');
|
140 |
+
|
141 |
+
$filter_column = function ($row) use ($column_index) {
|
142 |
+
return isset($row[$column_index]);
|
143 |
+
};
|
144 |
+
|
145 |
+
$select_column = function ($row) use ($column_index) {
|
146 |
+
return $row[$column_index];
|
147 |
+
};
|
148 |
+
|
149 |
+
$this->addFilter($filter_column);
|
150 |
+
|
151 |
+
return $this->applyCallable(new MapIterator($this->getQueryIterator(), $select_column), $callable);
|
152 |
+
}
|
153 |
+
|
154 |
+
/**
|
155 |
+
* Retrieve CSV data as pairs
|
156 |
+
*
|
157 |
+
* DEPRECATION WARNING! This method will be removed in the next major point release
|
158 |
+
*
|
159 |
+
* @deprecated deprecated since version 8.2
|
160 |
+
* @see Reader::fetchPairs
|
161 |
+
*
|
162 |
+
* Fetches an associative array of all rows as key-value pairs (first
|
163 |
+
* column is the key, second column is the value).
|
164 |
+
*
|
165 |
+
* By default if no column index is provided:
|
166 |
+
* - the first CSV column is used to provide the keys
|
167 |
+
* - the second CSV column is used to provide the value
|
168 |
+
*
|
169 |
+
* If the value from the column key index is duplicated its corresponding value will
|
170 |
+
* be overwritten
|
171 |
+
*
|
172 |
+
* @param int $offset_index The column index to serve as offset
|
173 |
+
* @param int $value_index The column index to serve as value
|
174 |
+
* @param callable|null $callable A callable to be applied to each of the rows to be returned.
|
175 |
+
*
|
176 |
+
* @return array
|
177 |
+
*/
|
178 |
+
public function fetchPairsWithoutDuplicates($offset_index = 0, $value_index = 1, callable $callable = null)
|
179 |
+
{
|
180 |
+
return iterator_to_array($this->fetchPairs($offset_index, $value_index, $callable), true);
|
181 |
+
}
|
182 |
+
|
183 |
+
/**
|
184 |
+
* Fetches the next key-value pairs from a result set (first
|
185 |
+
* column is the key, second column is the value).
|
186 |
+
*
|
187 |
+
* By default if no column index is provided:
|
188 |
+
* - the first CSV column is used to provide the keys
|
189 |
+
* - the second CSV column is used to provide the value
|
190 |
+
*
|
191 |
+
* @param int $offset_index The column index to serve as offset
|
192 |
+
* @param int $value_index The column index to serve as value
|
193 |
+
* @param callable|null $callable A callable to be applied to each of the rows to be returned.
|
194 |
+
*
|
195 |
+
* @return Generator
|
196 |
+
*/
|
197 |
+
public function fetchPairs($offset_index = 0, $value_index = 1, callable $callable = null)
|
198 |
+
{
|
199 |
+
$offset_index = $this->validateInteger($offset_index, 0, 'the offset column index must be a positive integer or 0');
|
200 |
+
$value_index = $this->validateInteger($value_index, 0, 'the value column index must be a positive integer or 0');
|
201 |
+
$filter_pairs = function ($row) use ($offset_index) {
|
202 |
+
return isset($row[$offset_index]);
|
203 |
+
};
|
204 |
+
$select_pairs = function ($row) use ($offset_index, $value_index) {
|
205 |
+
return [
|
206 |
+
$row[$offset_index],
|
207 |
+
isset($row[$value_index]) ? $row[$value_index] : null,
|
208 |
+
];
|
209 |
+
};
|
210 |
+
|
211 |
+
$this->addFilter($filter_pairs);
|
212 |
+
$iterator = $this->applyCallable(new MapIterator($this->getQueryIterator(), $select_pairs), $callable);
|
213 |
+
foreach ($iterator as $row) {
|
214 |
+
yield $row[0] => $row[1];
|
215 |
+
}
|
216 |
+
}
|
217 |
+
|
218 |
+
/**
|
219 |
+
* Fetch the next row from a result set
|
220 |
+
*
|
221 |
+
* The rows are presented as associated arrays
|
222 |
+
* The callable function will be applied to each row
|
223 |
+
*
|
224 |
+
* @param int|array $offset_or_keys the name for each key member OR the row Index to be
|
225 |
+
* used as the associated named keys
|
226 |
+
*
|
227 |
+
* @param callable $callable A callable to be applied to each of the rows to be returned.
|
228 |
+
*
|
229 |
+
* @throws InvalidArgumentException If the submitted keys are invalid
|
230 |
+
*
|
231 |
+
* @return Iterator
|
232 |
+
*/
|
233 |
+
public function fetchAssoc($offset_or_keys = 0, callable $callable = null)
|
234 |
+
{
|
235 |
+
$keys = $this->getAssocKeys($offset_or_keys);
|
236 |
+
$keys_count = count($keys);
|
237 |
+
$combine_array = function (array $row) use ($keys, $keys_count) {
|
238 |
+
if ($keys_count != count($row)) {
|
239 |
+
$row = array_slice(array_pad($row, $keys_count, null), 0, $keys_count);
|
240 |
+
}
|
241 |
+
|
242 |
+
return array_combine($keys, $row);
|
243 |
+
};
|
244 |
+
|
245 |
+
return $this->applyCallable(new MapIterator($this->getQueryIterator(), $combine_array), $callable);
|
246 |
+
}
|
247 |
+
|
248 |
+
/**
|
249 |
+
* Selects the array to be used as key for the fetchAssoc method
|
250 |
+
*
|
251 |
+
* @param int|array $offset_or_keys the assoc key OR the row Index to be used
|
252 |
+
* as the key index
|
253 |
+
*
|
254 |
+
* @throws InvalidArgumentException If the row index and/or the resulting array is invalid
|
255 |
+
*
|
256 |
+
* @return array
|
257 |
+
*/
|
258 |
+
protected function getAssocKeys($offset_or_keys)
|
259 |
+
{
|
260 |
+
if (is_array($offset_or_keys)) {
|
261 |
+
return $this->validateKeys($offset_or_keys);
|
262 |
+
}
|
263 |
+
|
264 |
+
$offset_or_keys = $this->validateInteger(
|
265 |
+
$offset_or_keys,
|
266 |
+
0,
|
267 |
+
'the row index must be a positive integer, 0 or a non empty array'
|
268 |
+
);
|
269 |
+
$keys = $this->validateKeys($this->getRow($offset_or_keys));
|
270 |
+
$filterOutRow = function ($row, $rowIndex) use ($offset_or_keys) {
|
271 |
+
return $rowIndex != $offset_or_keys;
|
272 |
+
};
|
273 |
+
$this->addFilter($filterOutRow);
|
274 |
+
|
275 |
+
return $keys;
|
276 |
+
}
|
277 |
+
|
278 |
+
/**
|
279 |
+
* Validates the array to be used by the fetchAssoc method
|
280 |
+
*
|
281 |
+
* @param array $keys
|
282 |
+
*
|
283 |
+
* @throws InvalidArgumentException If the submitted array fails the assertion
|
284 |
+
*
|
285 |
+
* @return array
|
286 |
+
*/
|
287 |
+
protected function validateKeys(array $keys)
|
288 |
+
{
|
289 |
+
if (empty($keys) || $keys !== array_unique(array_filter($keys, [$this, 'isValidKey']))) {
|
290 |
+
throw new InvalidArgumentException('Use a flat array with unique string values');
|
291 |
+
}
|
292 |
+
|
293 |
+
return $keys;
|
294 |
+
}
|
295 |
+
|
296 |
+
/**
|
297 |
+
* Returns whether the submitted value can be used as string
|
298 |
+
*
|
299 |
+
* @param mixed $value
|
300 |
+
*
|
301 |
+
* @return bool
|
302 |
+
*/
|
303 |
+
protected function isValidKey($value)
|
304 |
+
{
|
305 |
+
return is_scalar($value) || (is_object($value) && method_exists($value, '__toString'));
|
306 |
+
}
|
307 |
+
|
308 |
+
/**
|
309 |
+
* Returns a single row from the CSV without filtering
|
310 |
+
*
|
311 |
+
* @param int $offset
|
312 |
+
*
|
313 |
+
* @throws InvalidArgumentException If the $offset is not valid or the row does not exist
|
314 |
+
*
|
315 |
+
* @return array
|
316 |
+
*/
|
317 |
+
protected function getRow($offset)
|
318 |
+
{
|
319 |
+
$fileObj = $this->getIterator();
|
320 |
+
$iterator = new LimitIterator($fileObj, $offset, 1);
|
321 |
+
$iterator->rewind();
|
322 |
+
$row = $iterator->current();
|
323 |
+
if (empty($row)) {
|
324 |
+
throw new InvalidArgumentException('the specified row does not exist or is empty');
|
325 |
+
}
|
326 |
+
|
327 |
+
if (0 !== $offset || !$this->isBomStrippable()) {
|
328 |
+
return $row;
|
329 |
+
}
|
330 |
+
|
331 |
+
$bom_length = mb_strlen($this->getInputBOM());
|
332 |
+
$row[0] = mb_substr($row[0], $bom_length);
|
333 |
+
if ($this->enclosure == mb_substr($row[0], 0, 1) && $this->enclosure == mb_substr($row[0], -1, 1)) {
|
334 |
+
$row[0] = mb_substr($row[0], 1, -1);
|
335 |
+
}
|
336 |
+
|
337 |
+
return $row;
|
338 |
+
}
|
339 |
+
}
|
app/Services/csv/src/Writer.php
ADDED
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This file is part of the League.csv library
|
4 |
+
*
|
5 |
+
* @license http://opensource.org/licenses/MIT
|
6 |
+
* @link https://github.com/thephpleague/csv/
|
7 |
+
* @version 8.2.2
|
8 |
+
* @package League.csv
|
9 |
+
*
|
10 |
+
* For the full copyright and license information, please view the LICENSE
|
11 |
+
* file that was distributed with this source code.
|
12 |
+
*/
|
13 |
+
namespace League\Csv;
|
14 |
+
|
15 |
+
use InvalidArgumentException;
|
16 |
+
use League\Csv\Modifier\RowFilter;
|
17 |
+
use League\Csv\Modifier\StreamIterator;
|
18 |
+
use ReflectionMethod;
|
19 |
+
use RuntimeException;
|
20 |
+
use SplFileObject;
|
21 |
+
use Traversable;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* A class to manage data insertion into a CSV
|
25 |
+
*
|
26 |
+
* @package League.csv
|
27 |
+
* @since 4.0.0
|
28 |
+
*
|
29 |
+
*/
|
30 |
+
class Writer extends AbstractCsv
|
31 |
+
{
|
32 |
+
use RowFilter;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* @inheritdoc
|
36 |
+
*/
|
37 |
+
protected $stream_filter_mode = STREAM_FILTER_WRITE;
|
38 |
+
|
39 |
+
/**
|
40 |
+
* The CSV object holder
|
41 |
+
*
|
42 |
+
* @var SplFileObject|StreamIterator
|
43 |
+
*/
|
44 |
+
protected $csv;
|
45 |
+
|
46 |
+
/**
|
47 |
+
* fputcsv method from SplFileObject or StreamIterator
|
48 |
+
*
|
49 |
+
* @var ReflectionMethod
|
50 |
+
*/
|
51 |
+
protected $fputcsv;
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Nb parameters for SplFileObject::fputcsv method
|
55 |
+
*
|
56 |
+
* @var integer
|
57 |
+
*/
|
58 |
+
protected $fputcsv_param_count;
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Adds multiple lines to the CSV document
|
62 |
+
*
|
63 |
+
* a simple wrapper method around insertOne
|
64 |
+
*
|
65 |
+
* @param Traversable|array $rows a multidimensional array or a Traversable object
|
66 |
+
*
|
67 |
+
* @throws InvalidArgumentException If the given rows format is invalid
|
68 |
+
*
|
69 |
+
* @return static
|
70 |
+
*/
|
71 |
+
public function insertAll($rows)
|
72 |
+
{
|
73 |
+
if (!is_array($rows) && !$rows instanceof Traversable) {
|
74 |
+
throw new InvalidArgumentException(
|
75 |
+
'the provided data must be an array OR a `Traversable` object'
|
76 |
+
);
|
77 |
+
}
|
78 |
+
|
79 |
+
foreach ($rows as $row) {
|
80 |
+
$this->insertOne($row);
|
81 |
+
}
|
82 |
+
|
83 |
+
return $this;
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Adds a single line to a CSV document
|
88 |
+
*
|
89 |
+
* @param string[]|string $row a string, an array or an object implementing to '__toString' method
|
90 |
+
*
|
91 |
+
* @return static
|
92 |
+
*/
|
93 |
+
public function insertOne($row)
|
94 |
+
{
|
95 |
+
if (!is_array($row)) {
|
96 |
+
$row = str_getcsv($row, $this->delimiter, $this->enclosure, $this->escape);
|
97 |
+
}
|
98 |
+
$row = $this->formatRow($row);
|
99 |
+
$this->validateRow($row);
|
100 |
+
$this->addRow($row);
|
101 |
+
|
102 |
+
return $this;
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Add new record to the CSV document
|
107 |
+
*
|
108 |
+
* @param array $row record to add
|
109 |
+
*/
|
110 |
+
protected function addRow(array $row)
|
111 |
+
{
|
112 |
+
$this->initCsv();
|
113 |
+
if (!$this->fputcsv->invokeArgs($this->csv, $this->getFputcsvParameters($row))) {
|
114 |
+
throw new RuntimeException('Unable to write record to the CSV document.');
|
115 |
+
}
|
116 |
+
|
117 |
+
if ("\n" !== $this->newline) {
|
118 |
+
$this->csv->fseek(-1, SEEK_CUR);
|
119 |
+
$this->csv->fwrite($this->newline, strlen($this->newline));
|
120 |
+
}
|
121 |
+
}
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Initialize the CSV object and settings
|
125 |
+
*/
|
126 |
+
protected function initCsv()
|
127 |
+
{
|
128 |
+
if (null !== $this->csv) {
|
129 |
+
return;
|
130 |
+
}
|
131 |
+
|
132 |
+
$this->csv = $this->getIterator();
|
133 |
+
$this->fputcsv = new ReflectionMethod(get_class($this->csv), 'fputcsv');
|
134 |
+
$this->fputcsv_param_count = $this->fputcsv->getNumberOfParameters();
|
135 |
+
}
|
136 |
+
|
137 |
+
/**
|
138 |
+
* returns the parameters for SplFileObject::fputcsv
|
139 |
+
*
|
140 |
+
* @param array $fields The fields to be add
|
141 |
+
*
|
142 |
+
* @return array
|
143 |
+
*/
|
144 |
+
protected function getFputcsvParameters(array $fields)
|
145 |
+
{
|
146 |
+
$parameters = [$fields, $this->delimiter, $this->enclosure];
|
147 |
+
if (4 == $this->fputcsv_param_count) {
|
148 |
+
$parameters[] = $this->escape;
|
149 |
+
}
|
150 |
+
|
151 |
+
return $parameters;
|
152 |
+
}
|
153 |
+
|
154 |
+
/**
|
155 |
+
* {@inheritdoc}
|
156 |
+
*/
|
157 |
+
public function isActiveStreamFilter()
|
158 |
+
{
|
159 |
+
return parent::isActiveStreamFilter() && null === $this->csv;
|
160 |
+
}
|
161 |
+
|
162 |
+
/**
|
163 |
+
* {@inheritdoc}
|
164 |
+
*/
|
165 |
+
public function __destruct()
|
166 |
+
{
|
167 |
+
$this->csv = null;
|
168 |
+
parent::__destruct();
|
169 |
+
}
|
170 |
+
}
|
app/Services/fluentvalidator/autoload.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
spl_autoload_register(function ($class) {
|
4 |
+
|
5 |
+
$namespace = 'FluentValidator';
|
6 |
+
|
7 |
+
if (substr($class, 0, strlen($namespace)) !== $namespace) {
|
8 |
+
return;
|
9 |
+
}
|
10 |
+
|
11 |
+
$className = str_replace(
|
12 |
+
array('\\', $namespace, strtolower($namespace)),
|
13 |
+
array('/', 'src', ''),
|
14 |
+
$class
|
15 |
+
);
|
16 |
+
|
17 |
+
$basePath = plugin_dir_path(__FILE__);
|
18 |
+
|
19 |
+
$file = $basePath.trim($className, '/').'.php';
|
20 |
+
|
21 |
+
if (is_readable($file)) {
|
22 |
+
include $file;
|
23 |
+
}
|
24 |
+
});
|
app/Services/fluentvalidator/fluentvalidator.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php defined('ABSPATH') or die;
|
2 |
+
|
3 |
+
/*
|
4 |
+
Plugin Name: Fluent Validator
|
5 |
+
Description: Fluent Validator WordPress Plugin to validate data.
|
6 |
+
Version: 1.0.0
|
7 |
+
Author:
|
8 |
+
Author URI:
|
9 |
+
Plugin URI:
|
10 |
+
License: GPLv2 or later
|
11 |
+
Text Domain: fluentvalidator
|
12 |
+
Domain Path: /resources/languages
|
13 |
+
*/
|
14 |
+
require 'autoload.php';
|
15 |
+
|
16 |
+
if (! function_exists('fluentValidator')) {
|
17 |
+
function fluentValidator($data = [], $rules = [], $messages = [])
|
18 |
+
{
|
19 |
+
return (new \FluentValidator\Validator($data, $rules, $messages));
|
20 |
+
}
|
21 |
+
}
|
app/Services/fluentvalidator/src/Arr.php
ADDED
@@ -0,0 +1,169 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentValidator;
|
4 |
+
|
5 |
+
use Closure;
|
6 |
+
use ArrayAccess;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Class Arr: Taken from Illuminate\Support\Arr (Laravel Framework)
|
10 |
+
*
|
11 |
+
* @package FluentValidator
|
12 |
+
*/
|
13 |
+
class Arr
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* Check if an item or items exist in an array using "dot" notation.
|
17 |
+
*
|
18 |
+
* @param \ArrayAccess|array $array
|
19 |
+
* @param string|array $keys
|
20 |
+
*
|
21 |
+
* @return bool
|
22 |
+
*/
|
23 |
+
public static function has($array, $keys)
|
24 |
+
{
|
25 |
+
if (is_null($keys)) {
|
26 |
+
return false;
|
27 |
+
}
|
28 |
+
|
29 |
+
$keys = (array) $keys;
|
30 |
+
|
31 |
+
if (! $array) {
|
32 |
+
return false;
|
33 |
+
}
|
34 |
+
|
35 |
+
if ($keys === []) {
|
36 |
+
return false;
|
37 |
+
}
|
38 |
+
|
39 |
+
foreach ($keys as $key) {
|
40 |
+
$subKeyArray = $array;
|
41 |
+
|
42 |
+
if (static::exists($array, $key)) {
|
43 |
+
continue;
|
44 |
+
}
|
45 |
+
|
46 |
+
foreach (explode('.', $key) as $segment) {
|
47 |
+
if (static::accessible($subKeyArray) && static::exists($subKeyArray, $segment)) {
|
48 |
+
$subKeyArray = $subKeyArray[$segment];
|
49 |
+
} else {
|
50 |
+
return false;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
return true;
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Get an item from an array using "dot" notation.
|
60 |
+
*
|
61 |
+
* @param \ArrayAccess|array $array
|
62 |
+
* @param string $key
|
63 |
+
* @param mixed $default
|
64 |
+
*
|
65 |
+
* @return mixed
|
66 |
+
*/
|
67 |
+
public static function get($array, $key, $default = null)
|
68 |
+
{
|
69 |
+
if (! static::accessible($array)) {
|
70 |
+
return static::value($default);
|
71 |
+
}
|
72 |
+
|
73 |
+
if (is_null($key)) {
|
74 |
+
return $array;
|
75 |
+
}
|
76 |
+
|
77 |
+
if (static::exists($array, $key)) {
|
78 |
+
return $array[$key];
|
79 |
+
}
|
80 |
+
|
81 |
+
foreach (explode('.', $key) as $segment) {
|
82 |
+
if (static::accessible($array) && static::exists($array, $segment)) {
|
83 |
+
$array = $array[$segment];
|
84 |
+
} else {
|
85 |
+
return static::value($default);
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
return $array;
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Set an array item to a given value using "dot" notation.
|
94 |
+
*
|
95 |
+
* If no key is given to the method, the entire array will be replaced.
|
96 |
+
*
|
97 |
+
* @param array $array
|
98 |
+
* @param string $key
|
99 |
+
* @param mixed $value
|
100 |
+
*
|
101 |
+
* @return array
|
102 |
+
*/
|
103 |
+
public static function set(&$array, $key, $value)
|
104 |
+
{
|
105 |
+
if (is_null($key)) {
|
106 |
+
return $array = $value;
|
107 |
+
}
|
108 |
+
|
109 |
+
$keys = explode('.', $key);
|
110 |
+
|
111 |
+
while (count($keys) > 1) {
|
112 |
+
$key = array_shift($keys);
|
113 |
+
|
114 |
+
// If the key doesn't exist at this depth, we will just create an empty array
|
115 |
+
// to hold the next value, allowing us to create the arrays to hold final
|
116 |
+
// values at the correct depth. Then we'll keep digging into the array.
|
117 |
+
if (! isset($array[$key]) || ! is_array($array[$key])) {
|
118 |
+
$array[$key] = [];
|
119 |
+
}
|
120 |
+
|
121 |
+
$array = &$array[$key];
|
122 |
+
}
|
123 |
+
|
124 |
+
$array[array_shift($keys)] = $value;
|
125 |
+
|
126 |
+
return $array;
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Determine whether the given value is array accessible.
|
131 |
+
*
|
132 |
+
* @param mixed $value
|
133 |
+
*
|
134 |
+
* @return bool
|
135 |
+
*/
|
136 |
+
public static function accessible($value)
|
137 |
+
{
|
138 |
+
return is_array($value) || $value instanceof ArrayAccess;
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Determine if the given key exists in the provided array.
|
143 |
+
*
|
144 |
+
* @param \ArrayAccess|array $array
|
145 |
+
* @param string|int $key
|
146 |
+
*
|
147 |
+
* @return bool
|
148 |
+
*/
|
149 |
+
public static function exists($array, $key)
|
150 |
+
{
|
151 |
+
if ($array instanceof ArrayAccess) {
|
152 |
+
return $array->offsetExists($key);
|
153 |
+
}
|
154 |
+
|
155 |
+
return array_key_exists($key, $array);
|
156 |
+
}
|
157 |
+
|
158 |
+
/**
|
159 |
+
* Return the default value of the given value.
|
160 |
+
*
|
161 |
+
* @param mixed $value
|
162 |
+
*
|
163 |
+
* @return mixed
|
164 |
+
*/
|
165 |
+
public static function value($value)
|
166 |
+
{
|
167 |
+
return $value instanceof Closure ? $value() : $value;
|
168 |
+
}
|
169 |
+
}
|
app/Services/fluentvalidator/src/MessageBag.php
ADDED
@@ -0,0 +1,220 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentValidator;
|
4 |
+
|
5 |
+
trait MessageBag
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* The default message bag.
|
9 |
+
*
|
10 |
+
* @var array
|
11 |
+
*/
|
12 |
+
protected $bag = [
|
13 |
+
'email' => 'The :attribute must be a valid email address.',
|
14 |
+
'max' => [
|
15 |
+
'numeric' => 'The :attribute may not be greater than :max.',
|
16 |
+
'file' => 'The :attribute may not be greater than :max kilobytes.',
|
17 |
+
'string' => 'The :attribute may not be greater than :max characters.',
|
18 |
+
'array' => 'The :attribute may not have more than :max items.',
|
19 |
+
],
|
20 |
+
'min' => [
|
21 |
+
'numeric' => 'The :attribute must be at least :min.',
|
22 |
+
'file' => 'The :attribute must be at least :min kilobytes.',
|
23 |
+
'string' => 'The :attribute must be at least :min characters.',
|
24 |
+
'array' => 'The :attribute must have at least :min items.',
|
25 |
+
],
|
26 |
+
'numeric' => 'The :attribute must be a number.',
|
27 |
+
'required' => 'The :attribute field is required.',
|
28 |
+
'required_if' => 'The :attribute field is required when :other is :value.',
|
29 |
+
'same' => 'The :attribute and :other must match.',
|
30 |
+
'size' => [
|
31 |
+
'numeric' => 'The :attribute must be :size.',
|
32 |
+
'file' => 'The :attribute must be :size kilobytes.',
|
33 |
+
'string' => 'The :attribute must be :size characters.',
|
34 |
+
'array' => 'The :attribute must contain :size items.',
|
35 |
+
],
|
36 |
+
'url' => 'The :attribute format is invalid.',
|
37 |
+
];
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Generate a validation error message.
|
41 |
+
*
|
42 |
+
* @param $attribute
|
43 |
+
* @param $rule
|
44 |
+
* @param $parameters
|
45 |
+
*
|
46 |
+
* @return mixed
|
47 |
+
*/
|
48 |
+
protected function generate($attribute, $rule, $parameters)
|
49 |
+
{
|
50 |
+
$method = 'replace'.str_replace(' ', '', ucwords(str_replace(['-', '_'], ' ', $rule)));
|
51 |
+
|
52 |
+
return $this->$method($attribute, $parameters);
|
53 |
+
}
|
54 |
+
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Get the replacement text of the error message.
|
58 |
+
*
|
59 |
+
* @param $customMessagesKey
|
60 |
+
* @param $bagAccessor
|
61 |
+
*
|
62 |
+
* @return string
|
63 |
+
*/
|
64 |
+
protected function getReplacementText($customMessagesKey, $bagAccessor)
|
65 |
+
{
|
66 |
+
return isset($this->customMessages[$customMessagesKey])
|
67 |
+
? $this->customMessages[$customMessagesKey]
|
68 |
+
: Arr::get($this->bag, $bagAccessor, '');
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Make bag accessor key.
|
73 |
+
*
|
74 |
+
* @param $attribute
|
75 |
+
* @param $rule
|
76 |
+
*
|
77 |
+
* @return string
|
78 |
+
*/
|
79 |
+
protected function makeBagKey($attribute, $rule)
|
80 |
+
{
|
81 |
+
$type = $this->deduceType($this->getValue($attribute));
|
82 |
+
|
83 |
+
return $rule.'.'.$type;
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Replace all place-holders for the required rule.
|
88 |
+
*
|
89 |
+
* @param $attribute
|
90 |
+
* @param $parameters
|
91 |
+
*
|
92 |
+
* @return string
|
93 |
+
*/
|
94 |
+
protected function replaceRequired($attribute, $parameters)
|
95 |
+
{
|
96 |
+
$text = $this->getReplacementText($attribute.'.required', 'required');
|
97 |
+
|
98 |
+
return str_replace(':attribute', $attribute, $text);
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Replace all place-holders for the required if rule.
|
103 |
+
*
|
104 |
+
* @param $attribute
|
105 |
+
* @param $parameters
|
106 |
+
*
|
107 |
+
* @return string
|
108 |
+
*/
|
109 |
+
protected function replaceRequiredIf($attribute, $parameters)
|
110 |
+
{
|
111 |
+
$text = $this->getReplacementText($attribute.'.required_if', 'required_if');
|
112 |
+
|
113 |
+
return str_replace([':attribute', ':other', ':value'], [$attribute, $parameters[0], $parameters[1]], $text);
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Replace all place-holders for the email rule.
|
118 |
+
*
|
119 |
+
* @param $attribute
|
120 |
+
* @param $parameters
|
121 |
+
*
|
122 |
+
* @return string
|
123 |
+
*/
|
124 |
+
protected function replaceEmail($attribute, $parameters)
|
125 |
+
{
|
126 |
+
$text = $this->getReplacementText($attribute.'.email', 'email');
|
127 |
+
|
128 |
+
return str_replace(':attribute', $attribute, $text);
|
129 |
+
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Replace all place-holders for the size rule.
|
133 |
+
*
|
134 |
+
* @param $attribute
|
135 |
+
* @param $parameters
|
136 |
+
*
|
137 |
+
* @return string
|
138 |
+
*/
|
139 |
+
protected function replaceSize($attribute, $parameters)
|
140 |
+
{
|
141 |
+
$text = $this->getReplacementText($attribute.'.size', $this->makeBagKey($attribute, 'size'));
|
142 |
+
|
143 |
+
return str_replace([':attribute', ':size'], [$attribute, $parameters[0]], $text);
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Replace all place-holders for the min rule.
|
148 |
+
*
|
149 |
+
* @param $attribute
|
150 |
+
* @param $parameters
|
151 |
+
*
|
152 |
+
* @return string
|
153 |
+
*/
|
154 |
+
protected function replaceMin($attribute, $parameters)
|
155 |
+
{
|
156 |
+
$text = $this->getReplacementText($attribute.'.min', $this->makeBagKey($attribute, 'min'));
|
157 |
+
|
158 |
+
return str_replace([':attribute', ':min'], [$attribute, $parameters[0]], $text);
|
159 |
+
}
|
160 |
+
|
161 |
+
/**
|
162 |
+
* Replace all place-holders for the max rule.
|
163 |
+
*
|
164 |
+
* @param $attribute
|
165 |
+
* @param $parameters
|
166 |
+
*
|
167 |
+
* @return string
|
168 |
+
*/
|
169 |
+
protected function replaceMax($attribute, $parameters)
|
170 |
+
{
|
171 |
+
$text = $this->getReplacementText($attribute.'.max', $this->makeBagKey($attribute, 'max'));
|
172 |
+
|
173 |
+
return str_replace([':attribute', ':max'], [$attribute, $parameters[0]], $text);
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* Replace all place-holders for the min rule.
|
178 |
+
*
|
179 |
+
* @param $attribute
|
180 |
+
* @param $parameters
|
181 |
+
*
|
182 |
+
* @return string
|
183 |
+
*/
|
184 |
+
protected function replaceSame($attribute, $parameters)
|
185 |
+
{
|
186 |
+
$text = $this->getReplacementText($attribute.'.same', 'same');
|
187 |
+
|
188 |
+
return str_replace([':attribute', ':other'], [$attribute, $parameters[0]], $text);
|
189 |
+
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* Replace all place-holders for the url rule.
|
193 |
+
*
|
194 |
+
* @param $attribute
|
195 |
+
* @param $parameters
|
196 |
+
*
|
197 |
+
* @return string
|
198 |
+
*/
|
199 |
+
protected function replaceUrl($attribute, $parameters)
|
200 |
+
{
|
201 |
+
$text = $this->getReplacementText($attribute.'.url', 'url');
|
202 |
+
|
203 |
+
return str_replace(':attribute', $attribute, $text);
|
204 |
+
}
|
205 |
+
|
206 |
+
/**
|
207 |
+
* Replace all place-holders for the numeric rule.
|
208 |
+
*
|
209 |
+
* @param $attribute
|
210 |
+
* @param $parameters
|
211 |
+
*
|
212 |
+
* @return string
|
213 |
+
*/
|
214 |
+
protected function replaceNumeric($attribute, $parameters)
|
215 |
+
{
|
216 |
+
$text = $this->getReplacementText($attribute.'.numeric', 'numeric');
|
217 |
+
|
218 |
+
return str_replace(':attribute', $attribute, $text);
|
219 |
+
}
|
220 |
+
}
|
app/Services/fluentvalidator/src/ValidatesAttributes.php
ADDED
@@ -0,0 +1,261 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentValidator;
|
4 |
+
|
5 |
+
use Countable;
|
6 |
+
use InvalidArgumentException;
|
7 |
+
|
8 |
+
trait ValidatesAttributes
|
9 |
+
{
|
10 |
+
/**
|
11 |
+
* Require a certain number of parameters to be present.
|
12 |
+
*
|
13 |
+
* @param int $count
|
14 |
+
* @param array $parameters
|
15 |
+
* @param string $rule
|
16 |
+
*
|
17 |
+
* @return void
|
18 |
+
*
|
19 |
+
* @throws \InvalidArgumentException
|
20 |
+
*/
|
21 |
+
protected function requireParameterCount($count, $parameters, $rule)
|
22 |
+
{
|
23 |
+
if (count($parameters) < $count) {
|
24 |
+
throw new InvalidArgumentException("Validation rule $rule requires at least $count parameters.");
|
25 |
+
}
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Get the size of an attribute.
|
30 |
+
*
|
31 |
+
* @param string $attribute
|
32 |
+
* @param mixed $value
|
33 |
+
*
|
34 |
+
* @return mixed
|
35 |
+
*/
|
36 |
+
protected function getSize($attribute, $value)
|
37 |
+
{
|
38 |
+
// This method will determine if the attribute is a number, string, or file and
|
39 |
+
// return the proper size accordingly. If it is a number, then number itself
|
40 |
+
// is the size. If it is a file, we take kilobytes, and for a string the
|
41 |
+
// entire length of the string will be considered the attribute size.
|
42 |
+
$type = $this->deduceType($value);
|
43 |
+
|
44 |
+
switch ($type) {
|
45 |
+
case 'numeric':
|
46 |
+
return $value;
|
47 |
+
case 'array':
|
48 |
+
return count($value);
|
49 |
+
default:
|
50 |
+
return mb_strlen($value);
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Deduce the value type of an attribute.
|
56 |
+
*
|
57 |
+
* @param $value
|
58 |
+
*
|
59 |
+
* @return string
|
60 |
+
*/
|
61 |
+
protected function deduceType($value)
|
62 |
+
{
|
63 |
+
if (is_numeric($value)) {
|
64 |
+
return 'numeric';
|
65 |
+
} elseif (is_array($value)) {
|
66 |
+
return 'array';
|
67 |
+
} // elseif (determine if its file)
|
68 |
+
|
69 |
+
return 'string';
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Convert the given values to boolean if they are string "true" / "false".
|
74 |
+
*
|
75 |
+
* @param array $values
|
76 |
+
*
|
77 |
+
* @return array
|
78 |
+
*/
|
79 |
+
protected function convertValuesToBoolean($values)
|
80 |
+
{
|
81 |
+
return array_map(function ($value) {
|
82 |
+
if ($value === 'true') {
|
83 |
+
return true;
|
84 |
+
} elseif ($value === 'false') {
|
85 |
+
return false;
|
86 |
+
}
|
87 |
+
|
88 |
+
return $value;
|
89 |
+
}, $values);
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Validate that a required attribute exists.
|
94 |
+
*
|
95 |
+
* @param string $attribute
|
96 |
+
* @param mixed $value
|
97 |
+
*
|
98 |
+
* @return bool
|
99 |
+
*/
|
100 |
+
protected function validateRequired($attribute, $value)
|
101 |
+
{
|
102 |
+
if (is_null($value)) {
|
103 |
+
return false;
|
104 |
+
} elseif (is_string($value) && trim($value) === '') {
|
105 |
+
return false;
|
106 |
+
} elseif ((is_array($value) || $value instanceof Countable) && count($value) < 1) {
|
107 |
+
return false;
|
108 |
+
}
|
109 |
+
|
110 |
+
// todo:: handle file upload value.
|
111 |
+
|
112 |
+
return true;
|
113 |
+
}
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Validate that an attribute exists when another attribute has a given value.
|
117 |
+
*
|
118 |
+
* @param string $attribute
|
119 |
+
* @param mixed $value
|
120 |
+
* @param mixed $parameters
|
121 |
+
*
|
122 |
+
* @return bool
|
123 |
+
*/
|
124 |
+
protected function validateRequiredIf($attribute, $value, $parameters)
|
125 |
+
{
|
126 |
+
$this->requireParameterCount(2, $parameters, 'required_if');
|
127 |
+
|
128 |
+
$other = Arr::get($this->data, $parameters[0]);
|
129 |
+
|
130 |
+
$values = array_slice($parameters, 1);
|
131 |
+
|
132 |
+
if (is_bool($other)) {
|
133 |
+
$values = $this->convertValuesToBoolean($values);
|
134 |
+
}
|
135 |
+
|
136 |
+
if (in_array($other, $values)) {
|
137 |
+
return $this->validateRequired($attribute, $value);
|
138 |
+
}
|
139 |
+
|
140 |
+
return true;
|
141 |
+
}
|
142 |
+
|
143 |
+
/**
|
144 |
+
* Validate that an attribute is a valid e-mail address.
|
145 |
+
*
|
146 |
+
* @param string $attribute
|
147 |
+
* @param mixed $value
|
148 |
+
*
|
149 |
+
* @return bool
|
150 |
+
*/
|
151 |
+
protected function validateEmail($attribute, $value)
|
152 |
+
{
|
153 |
+
if (! $value) {
|
154 |
+
return ! $this->hasRequired($attribute);
|
155 |
+
}
|
156 |
+
|
157 |
+
return ! ! is_email($value);
|
158 |
+
}
|
159 |
+
|
160 |
+
/**
|
161 |
+
* Validate the size of an attribute.
|
162 |
+
*
|
163 |
+
* @param string $attribute
|
164 |
+
* @param mixed $value
|
165 |
+
* @param array $parameters
|
166 |
+
*
|
167 |
+
* @return bool
|
168 |
+
*/
|
169 |
+
protected function validateSize($attribute, $value, $parameters)
|
170 |
+
{
|
171 |
+
$this->requireParameterCount(1, $parameters, 'size');
|
172 |
+
|
173 |
+
return $this->getSize($attribute, $value) == $parameters[0];
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* Validate the size of an attribute is greater than a minimum value.
|
178 |
+
*
|
179 |
+
* @param string $attribute
|
180 |
+
* @param mixed $value
|
181 |
+
* @param array $parameters
|
182 |
+
*
|
183 |
+
* @return bool
|
184 |
+
*/
|
185 |
+
protected function validateMin($attribute, $value, $parameters)
|
186 |
+
{
|
187 |
+
$this->requireParameterCount(1, $parameters, 'min');
|
188 |
+
|
189 |
+
return $this->getSize($attribute, $value) >= $parameters[0];
|
190 |
+
}
|
191 |
+
|
192 |
+
/**
|
193 |
+
* Validate the size of an attribute is less than a maximum value.
|
194 |
+
*
|
195 |
+
* @param string $attribute
|
196 |
+
* @param mixed $value
|
197 |
+
* @param array $parameters
|
198 |
+
*
|
199 |
+
* @return bool
|
200 |
+
*/
|
201 |
+
protected function validateMax($attribute, $value, $parameters)
|
202 |
+
{
|
203 |
+
$this->requireParameterCount(1, $parameters, 'max');
|
204 |
+
|
205 |
+
// todo:: handle uploaded file's scene.
|
206 |
+
|
207 |
+
return $this->getSize($attribute, $value) <= $parameters[0];
|
208 |
+
}
|
209 |
+
|
210 |
+
/**
|
211 |
+
* Validate that two attributes match.
|
212 |
+
*
|
213 |
+
* @param string $attribute
|
214 |
+
* @param mixed $value
|
215 |
+
* @param array $parameters
|
216 |
+
*
|
217 |
+
* @return bool
|
218 |
+
*/
|
219 |
+
protected function validateSame($attribute, $value, $parameters)
|
220 |
+
{
|
221 |
+
$this->requireParameterCount(1, $parameters, 'same');
|
222 |
+
|
223 |
+
$other = @$this->data[$parameters[0]];
|
224 |
+
|
225 |
+
return $value === $other;
|
226 |
+
}
|
227 |
+
|
228 |
+
/**
|
229 |
+
* Validate that an attribute is a valid URL.
|
230 |
+
*
|
231 |
+
* @param string $attribute
|
232 |
+
* @param mixed $value
|
233 |
+
*
|
234 |
+
* @return bool
|
235 |
+
*/
|
236 |
+
protected function validateUrl($attribute, $value)
|
237 |
+
{
|
238 |
+
if (! $value) {
|
239 |
+
return ! $this->hasRequired($attribute);
|
240 |
+
}
|
241 |
+
|
242 |
+
return (bool) wp_http_validate_url($value);
|
243 |
+
}
|
244 |
+
|
245 |
+
/**
|
246 |
+
* Validate that an attribute is numeric.
|
247 |
+
*
|
248 |
+
* @param string $attribute
|
249 |
+
* @param mixed $value
|
250 |
+
*
|
251 |
+
* @return bool
|
252 |
+
*/
|
253 |
+
protected function validateNumeric($attribute, $value)
|
254 |
+
{
|
255 |
+
if (! $value) {
|
256 |
+
return ! $this->hasRequired($attribute);
|
257 |
+
}
|
258 |
+
|
259 |
+
return is_numeric($value);
|
260 |
+
}
|
261 |
+
}
|
app/Services/fluentvalidator/src/ValidationRuleParser.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentValidator;
|
4 |
+
|
5 |
+
class ValidationRuleParser
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Parse the human-friendly rules into a full rules array for the validator.
|
9 |
+
*
|
10 |
+
* @param $rules
|
11 |
+
*
|
12 |
+
* @return array
|
13 |
+
*/
|
14 |
+
public static function explode($rules)
|
15 |
+
{
|
16 |
+
foreach ($rules as $attribute => $rule) {
|
17 |
+
$rules[$attribute] = explode('|', $rule);
|
18 |
+
}
|
19 |
+
|
20 |
+
return $rules;
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Extract the rule name and parameters from a rule.
|
25 |
+
*
|
26 |
+
* @param $rule
|
27 |
+
*
|
28 |
+
* @return array
|
29 |
+
*/
|
30 |
+
public static function parse($rule)
|
31 |
+
{
|
32 |
+
$parameters = [];
|
33 |
+
|
34 |
+
if (strpos($rule, ':') !== false) {
|
35 |
+
list($rule, $parameter) = explode(':', $rule, 2);
|
36 |
+
|
37 |
+
$parameters = str_getcsv($parameter);
|
38 |
+
}
|
39 |
+
|
40 |
+
return [trim($rule), $parameters];
|
41 |
+
}
|
42 |
+
}
|
app/Services/fluentvalidator/src/Validator.php
ADDED
@@ -0,0 +1,238 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentValidator;
|
4 |
+
|
5 |
+
class Validator
|
6 |
+
{
|
7 |
+
use ValidatesAttributes, MessageBag;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* The data under validation.
|
11 |
+
*
|
12 |
+
* @var array
|
13 |
+
*/
|
14 |
+
protected $data;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* The rules to be applied to the data.
|
18 |
+
*
|
19 |
+
* @var array
|
20 |
+
*/
|
21 |
+
protected $rules = [];
|
22 |
+
|
23 |
+
/**
|
24 |
+
* All of the error messages.
|
25 |
+
*
|
26 |
+
* @var array
|
27 |
+
*/
|
28 |
+
protected $messages;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* All of the user provided messages.
|
32 |
+
*
|
33 |
+
* @var array
|
34 |
+
*/
|
35 |
+
protected $customMessages = [];
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Create a new Validator instance.
|
39 |
+
*
|
40 |
+
* @param array $data
|
41 |
+
* @param array $rules
|
42 |
+
* @param array $messages
|
43 |
+
*
|
44 |
+
* @return void
|
45 |
+
*/
|
46 |
+
public function __construct(array $data = [], array $rules = [], array $messages = [])
|
47 |
+
{
|
48 |
+
$this->data = $data;
|
49 |
+
|
50 |
+
$this->setRules($rules);
|
51 |
+
|
52 |
+
$this->customMessages = $messages;
|
53 |
+
|
54 |
+
$this->messages = [];
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Create a new Validator instance.
|
59 |
+
*
|
60 |
+
* @param array $data
|
61 |
+
* @param array $rules
|
62 |
+
* @param array $messages
|
63 |
+
*
|
64 |
+
* @return \FluentValidator\Validator
|
65 |
+
*/
|
66 |
+
public static function make(array $data = [], array $rules = [], array $messages = [])
|
67 |
+
{
|
68 |
+
return new static($data, $rules, $messages);
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Set the validation rules.
|
73 |
+
*
|
74 |
+
* @param array $rules
|
75 |
+
*
|
76 |
+
* @return $this
|
77 |
+
*/
|
78 |
+
protected function setRules(array $rules = [])
|
79 |
+
{
|
80 |
+
$this->rules = array_merge_recursive($this->rules, ValidationRuleParser::explode($rules));
|
81 |
+
|
82 |
+
return $this;
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Validate the data against the provided rules.
|
87 |
+
*
|
88 |
+
* @return $this
|
89 |
+
*/
|
90 |
+
public function validate()
|
91 |
+
{
|
92 |
+
foreach ($this->rules as $attribute => $rules) {
|
93 |
+
foreach ($rules as $rule) {
|
94 |
+
$this->validateAttribute($attribute, $rule);
|
95 |
+
}
|
96 |
+
}
|
97 |
+
|
98 |
+
return $this;
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Validate each of the attribute of the data.
|
103 |
+
*
|
104 |
+
* @param $attribute
|
105 |
+
* @param $rule
|
106 |
+
*
|
107 |
+
* @return void
|
108 |
+
*/
|
109 |
+
protected function validateAttribute($attribute, $rule)
|
110 |
+
{
|
111 |
+
list($rule, $parameters) = ValidationRuleParser::parse($rule);
|
112 |
+
|
113 |
+
$value = $this->getValue($attribute);
|
114 |
+
|
115 |
+
$method = 'validate'.str_replace(' ', '', ucwords(str_replace(['-', '_'], ' ', $rule)));
|
116 |
+
|
117 |
+
if ($this->shouldValidate($method, $attribute, $value)
|
118 |
+
&& ! $this->$method($attribute, $value, $parameters)
|
119 |
+
) {
|
120 |
+
$this->addFailure($attribute, $rule, $parameters);
|
121 |
+
}
|
122 |
+
}
|
123 |
+
|
124 |
+
/**
|
125 |
+
* Access the data by attribute name.
|
126 |
+
*
|
127 |
+
* @param $attribute
|
128 |
+
*
|
129 |
+
* @return mixed
|
130 |
+
*/
|
131 |
+
protected function getValue($attribute)
|
132 |
+
{
|
133 |
+
$attribute = str_replace(['[', ']'], ['.', ''], $attribute);
|
134 |
+
|
135 |
+
return Arr::get($this->data, $attribute);
|
136 |
+
}
|
137 |
+
|
138 |
+
/**
|
139 |
+
* Add error message upon validation failed of an attribute.
|
140 |
+
*
|
141 |
+
* @param $attribute
|
142 |
+
* @param $rule
|
143 |
+
* @param $parameters
|
144 |
+
*
|
145 |
+
* @return void
|
146 |
+
*/
|
147 |
+
protected function addFailure($attribute, $rule, $parameters)
|
148 |
+
{
|
149 |
+
$this->messages[$attribute][$rule] = $this->generate($attribute, $rule, $parameters);
|
150 |
+
}
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Get all of the validation error messages.
|
154 |
+
*
|
155 |
+
* @return array
|
156 |
+
*/
|
157 |
+
public function errors()
|
158 |
+
{
|
159 |
+
return $this->messages;
|
160 |
+
}
|
161 |
+
|
162 |
+
/**
|
163 |
+
* Determine if the data passes the validation rules.
|
164 |
+
*
|
165 |
+
* @return bool
|
166 |
+
*/
|
167 |
+
public function passes()
|
168 |
+
{
|
169 |
+
return ! $this->fails();
|
170 |
+
}
|
171 |
+
|
172 |
+
/**
|
173 |
+
* Determine if the data fails the validation rules.
|
174 |
+
*
|
175 |
+
* @return bool
|
176 |
+
*/
|
177 |
+
public function fails()
|
178 |
+
{
|
179 |
+
return (bool) count($this->messages);
|
180 |
+
}
|
181 |
+
|
182 |
+
/**
|
183 |
+
* Add conditions to a given field based on a Closure.
|
184 |
+
*
|
185 |
+
* @param string|array $attribute
|
186 |
+
* @param string|array $rules
|
187 |
+
* @param callable $callback
|
188 |
+
*
|
189 |
+
* @return $this
|
190 |
+
*/
|
191 |
+
public function sometimes($attribute, $rules, callable $callback)
|
192 |
+
{
|
193 |
+
$payload = $this->data;
|
194 |
+
|
195 |
+
if (call_user_func($callback, $payload)) {
|
196 |
+
foreach ((array) $attribute as $key) {
|
197 |
+
$this->setRules([$key => $rules]);
|
198 |
+
}
|
199 |
+
}
|
200 |
+
|
201 |
+
return $this;
|
202 |
+
}
|
203 |
+
|
204 |
+
/**
|
205 |
+
* Determine if the attribute has a required rule.
|
206 |
+
*
|
207 |
+
* @param $attribute
|
208 |
+
*
|
209 |
+
* @return bool
|
210 |
+
*/
|
211 |
+
public function hasRequired($attribute)
|
212 |
+
{
|
213 |
+
foreach ($this->rules[$attribute] as $rule) {
|
214 |
+
if (strpos($rule, 'required') !== false) {
|
215 |
+
return true;
|
216 |
+
break;
|
217 |
+
}
|
218 |
+
}
|
219 |
+
|
220 |
+
return false;
|
221 |
+
}
|
222 |
+
|
223 |
+
/**
|
224 |
+
* Determine if the attribute should be validated.
|
225 |
+
*
|
226 |
+
* @param $method
|
227 |
+
* @param $attribute
|
228 |
+
* @param $value
|
229 |
+
*
|
230 |
+
* @return bool
|
231 |
+
*/
|
232 |
+
public function shouldValidate($method, $attribute, $value)
|
233 |
+
{
|
234 |
+
$hasMethod = method_exists($this, $method);
|
235 |
+
|
236 |
+
return $hasMethod && ($value || $this->hasRequired($attribute));
|
237 |
+
}
|
238 |
+
}
|
app/Services/wpfluent/autoload.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// Autoload Service Container.
|
4 |
+
require 'libs/viocon/autoload.php';
|
5 |
+
|
6 |
+
spl_autoload_register(function ($class) {
|
7 |
+
|
8 |
+
$namespace = 'WpFluent';
|
9 |
+
|
10 |
+
if (substr($class, 0, strlen($namespace)) !== $namespace) {
|
11 |
+
return;
|
12 |
+
}
|
13 |
+
|
14 |
+
$className = str_replace(
|
15 |
+
array('\\', $namespace, strtolower($namespace)),
|
16 |
+
array('/', 'src', ''),
|
17 |
+
$class
|
18 |
+
);
|
19 |
+
|
20 |
+
$basePath = plugin_dir_path(__FILE__);
|
21 |
+
|
22 |
+
$file = $basePath.trim($className, '/').'.php';
|
23 |
+
|
24 |
+
if (is_readable($file)) {
|
25 |
+
include $file;
|
26 |
+
}
|
27 |
+
});
|
app/Services/wpfluent/libs/viocon/autoload.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
spl_autoload_register(function ($class) {
|
4 |
+
|
5 |
+
$namespace = 'Viocon';
|
6 |
+
|
7 |
+
if (substr($class, 0, strlen($namespace)) !== $namespace) {
|
8 |
+
return;
|
9 |
+
}
|
10 |
+
|
11 |
+
$classPath = str_replace(
|
12 |
+
array('\\', $namespace, strtolower($namespace)),
|
13 |
+
array('/', 'src/Viocon', ''),
|
14 |
+
$class
|
15 |
+
);
|
16 |
+
|
17 |
+
$basePath = plugin_dir_path(__FILE__);
|
18 |
+
|
19 |
+
$file = $basePath.trim($classPath, '/').'.php';
|
20 |
+
|
21 |
+
if (is_readable($file)) {
|
22 |
+
include $file;
|
23 |
+
}
|
24 |
+
});
|
app/Services/wpfluent/libs/viocon/src/Viocon/AliasFacade.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php namespace Viocon;
|
2 |
+
|
3 |
+
/**
|
4 |
+
* This class gives the ability to access non-static methods statically
|
5 |
+
*
|
6 |
+
* Class AliasFacade
|
7 |
+
*
|
8 |
+
* @package Viocon
|
9 |
+
*/
|
10 |
+
class AliasFacade {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @var Container
|
14 |
+
*/
|
15 |
+
protected static $vioconInstance;
|
16 |
+
|
17 |
+
/**
|
18 |
+
* @param $method
|
19 |
+
* @param $args
|
20 |
+
*
|
21 |
+
* @return mixed
|
22 |
+
*/
|
23 |
+
public static function __callStatic($method, $args)
|
24 |
+
{
|
25 |
+
if(!static::$vioconInstance) {
|
26 |
+
static::$vioconInstance = new Container();
|
27 |
+
}
|
28 |
+
|
29 |
+
return call_user_func_array(array(static::$vioconInstance, $method), $args);
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* @param Container $instance
|
34 |
+
*/
|
35 |
+
public static function setVioconInstance(Container $instance)
|
36 |
+
{
|
37 |
+
static::$vioconInstance = $instance;
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* @return \Viocon\Container $instance
|
42 |
+
*/
|
43 |
+
public static function getVioconInstance()
|
44 |
+
{
|
45 |
+
return static::$vioconInstance;
|
46 |
+
}
|
47 |
+
}
|
app/Services/wpfluent/libs/viocon/src/Viocon/Container.php
ADDED
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php namespace Viocon;
|
2 |
+
|
3 |
+
class Container
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* @var array
|
7 |
+
*/
|
8 |
+
public $registry = array();
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Singleton instances
|
12 |
+
*
|
13 |
+
* @var array
|
14 |
+
*/
|
15 |
+
public $singletons = array();
|
16 |
+
|
17 |
+
public function __construct($alias = null)
|
18 |
+
{
|
19 |
+
if ($alias) {
|
20 |
+
AliasFacade::setVioconInstance($this);
|
21 |
+
class_alias('\\Viocon\\AliasFacade', $alias);
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Register an object with a key
|
27 |
+
*
|
28 |
+
* @param string $key
|
29 |
+
* @param mixed $object
|
30 |
+
* @param bool $singleton
|
31 |
+
*
|
32 |
+
* @return void
|
33 |
+
*/
|
34 |
+
public function set($key, $object, $singleton = false)
|
35 |
+
{
|
36 |
+
$this->registry[$key] = compact('object', 'singleton');
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* If we have a registry for the given key
|
41 |
+
*
|
42 |
+
* @param string $key
|
43 |
+
*
|
44 |
+
* @return bool
|
45 |
+
*/
|
46 |
+
public function has($key)
|
47 |
+
{
|
48 |
+
return array_key_exists($key, $this->registry);
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Register as singleton.
|
53 |
+
*
|
54 |
+
* @param string $key
|
55 |
+
* @param mixed $object
|
56 |
+
*
|
57 |
+
* @return void
|
58 |
+
*/
|
59 |
+
public function singleton($key, $object)
|
60 |
+
{
|
61 |
+
$this->set($key, $object, true);
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Register or replace an instance as a singleton.
|
66 |
+
* Useful for replacing with Mocked instance
|
67 |
+
*
|
68 |
+
* @param string $key
|
69 |
+
* @param mixed $instance
|
70 |
+
*
|
71 |
+
* @return void
|
72 |
+
*/
|
73 |
+
public function setInstance($key, $instance)
|
74 |
+
{
|
75 |
+
$this->singletons[$key] = $instance;
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Build from the given key.
|
80 |
+
* If there is a class registered with Container::set() then it's instance
|
81 |
+
* will be returned. If a closure is registered, a closure's return value
|
82 |
+
* will be returned. If nothing is registered then it will try to build an
|
83 |
+
* instance with new $key(...).
|
84 |
+
*
|
85 |
+
* $parameters will be passed to closure or class constructor.
|
86 |
+
*
|
87 |
+
*
|
88 |
+
* @param string $key
|
89 |
+
* @param array $parameters
|
90 |
+
*
|
91 |
+
* @return mixed
|
92 |
+
*/
|
93 |
+
public function build($key, $parameters = array())
|
94 |
+
{
|
95 |
+
// If we have a singleton instance registered the just return it
|
96 |
+
if (array_key_exists($key, $this->singletons)) {
|
97 |
+
return $this->singletons[$key];
|
98 |
+
}
|
99 |
+
|
100 |
+
// If we don't have a registered object with the key then assume user
|
101 |
+
// is trying to build a class with the given key/name
|
102 |
+
|
103 |
+
if (!array_key_exists($key, $this->registry)) {
|
104 |
+
$object = $key;
|
105 |
+
} else {
|
106 |
+
$object = $this->registry[$key]['object'];
|
107 |
+
}
|
108 |
+
|
109 |
+
|
110 |
+
$instance = $this->instanciate($object, $parameters);
|
111 |
+
|
112 |
+
// If the key is registered as a singleton, we can save the instance as singleton
|
113 |
+
// for later use
|
114 |
+
if (isset($this->registry[$key]['singleton']) && $this->registry[$key]['singleton'] === true) {
|
115 |
+
$this->singletons[$key] = $instance;
|
116 |
+
}
|
117 |
+
|
118 |
+
return $instance;
|
119 |
+
}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Instantiate an instance of the given type.
|
123 |
+
*
|
124 |
+
* @param string $key
|
125 |
+
* @param array $parameters
|
126 |
+
*
|
127 |
+
* @throws \Exception
|
128 |
+
* @return mixed
|
129 |
+
*/
|
130 |
+
protected function instanciate($key, $parameters = null)
|
131 |
+
{
|
132 |
+
|
133 |
+
if ($key instanceof \Closure) {
|
134 |
+
return call_user_func_array($key, $parameters);
|
135 |
+
}
|
136 |
+
|
137 |
+
$reflection = new \ReflectionClass($key);
|
138 |
+
return $reflection->newInstanceArgs($parameters);
|
139 |
+
}
|
140 |
+
}
|
app/Services/wpfluent/libs/viocon/src/Viocon/VioconException.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php namespace Viocon;
|
2 |
+
|
3 |
+
|
4 |
+
class VioconException extends \Exception
|
5 |
+
{
|
6 |
+
|
7 |
+
}
|
app/Services/wpfluent/src/AliasFacade.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php namespace WpFluent;
|
2 |
+
|
3 |
+
use WpFluent\QueryBuilder\QueryBuilderHandler;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* This class gives the ability to access non-static methods statically
|
7 |
+
*
|
8 |
+
* Class AliasFacade
|
9 |
+
*
|
10 |
+
* @package WpFluent
|
11 |
+
*/
|
12 |
+
class AliasFacade
|
13 |
+
{
|
14 |
+
|
15 |
+
/**
|
16 |
+
* @var QueryBuilderHandler
|
17 |
+
*/
|
18 |
+
protected static $queryBuilderInstance;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @param $method
|
22 |
+
* @param $args
|
23 |
+
*
|
24 |
+
* @return mixed
|
25 |
+
*/
|
26 |
+
public static function __callStatic($method, $args)
|
27 |
+
{
|
28 |
+
if (!static::$queryBuilderInstance) {
|
29 |
+
static::$queryBuilderInstance = new QueryBuilderHandler();
|
30 |
+
}
|
31 |
+
|
32 |
+
// Call the non-static method from the class instance
|
33 |
+
return call_user_func_array(array(static::$queryBuilderInstance, $method), $args);
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* @param QueryBuilderHandler $queryBuilderInstance
|
38 |
+
*/
|
39 |
+
public static function setQueryBuilderInstance($queryBuilderInstance)
|
40 |
+
{
|
41 |
+
static::$queryBuilderInstance = $queryBuilderInstance;
|
42 |
+
}
|
43 |
+
}
|
app/Services/wpfluent/src/Connection.php
ADDED
@@ -0,0 +1,186 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php namespace WpFluent;
|
2 |
+
|
3 |
+
use Viocon\Container;
|
4 |
+
|
5 |
+
class Connection
|
6 |
+
{
|
7 |
+
|
8 |
+
/**
|
9 |
+
* @var Container
|
10 |
+
*/
|
11 |
+
protected $container;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* @var string
|
15 |
+
*/
|
16 |
+
protected $adapter;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* @var array
|
20 |
+
*/
|
21 |
+
protected $adapterConfig;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* @var \wpdb $wpdb
|
25 |
+
*/
|
26 |
+
protected $dbInstance;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* @var \wpdb $wpdb
|
30 |
+
*/
|
31 |
+
protected $wpdb;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @var Connection
|
35 |
+
*/
|
36 |
+
protected static $storedConnection;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* @var EventHandler
|
40 |
+
*/
|
41 |
+
protected $eventHandler;
|
42 |
+
|
43 |
+
/**
|
44 |
+
* @param $wpdb
|
45 |
+
* @param array $adapterConfig
|
46 |
+
* @param null|string $alias
|
47 |
+
* @param null|Container $container
|
48 |
+
*/
|
49 |
+
public function __construct($wpdb, array $config = array(), $alias = null, Container $container = null)
|
50 |
+
{
|
51 |
+
$container = $container ? : new Container();
|
52 |
+
|
53 |
+
$this->container = $container;
|
54 |
+
|
55 |
+
$this->wpdb = $wpdb;
|
56 |
+
|
57 |
+
$this->setAdapter()->setAdapterConfig($config)->connect();
|
58 |
+
|
59 |
+
// Create event dependency
|
60 |
+
$this->eventHandler = $this->container->build('\\WpFluent\\EventHandler');
|
61 |
+
|
62 |
+
if ($alias) {
|
63 |
+
$this->createAlias($alias);
|
64 |
+
}
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Create an easily accessible query builder alias
|
69 |
+
*
|
70 |
+
* @param $alias
|
71 |
+
*/
|
72 |
+
public function createAlias($alias)
|
73 |
+
{
|
74 |
+
class_alias('WpFluent\\AliasFacade', $alias);
|
75 |
+
|
76 |
+
$builder = $this->container->build('\\WpFluent\\QueryBuilder\\QueryBuilderHandler', array($this));
|
77 |
+
|
78 |
+
AliasFacade::setQueryBuilderInstance($builder);
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Returns an instance of Query Builder
|
83 |
+
*/
|
84 |
+
public function getQueryBuilder()
|
85 |
+
{
|
86 |
+
return $this->container->build('\\WpFluent\\QueryBuilder\\QueryBuilderHandler', array($this));
|
87 |
+
}
|
88 |
+
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Create the connection adapter
|
92 |
+
*/
|
93 |
+
protected function connect()
|
94 |
+
{
|
95 |
+
$this->setDbInstance($this->wpdb);
|
96 |
+
|
97 |
+
// Preserve the first database connection with a static property
|
98 |
+
if (! static::$storedConnection) {
|
99 |
+
static::$storedConnection = $this;
|
100 |
+
}
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* @param $db
|
105 |
+
*
|
106 |
+
* @return $this
|
107 |
+
*/
|
108 |
+
public function setDbInstance($db)
|
109 |
+
{
|
110 |
+
$this->dbInstance = $db;
|
111 |
+
|
112 |
+
return $this;
|
113 |
+
}
|
114 |
+
|
115 |
+
/**
|
116 |
+
* @return \wpdb
|
117 |
+
*/
|
118 |
+
public function getDbInstance()
|
119 |
+
{
|
120 |
+
return $this->dbInstance;
|
121 |
+
}
|
122 |
+
|
123 |
+
/**
|
124 |
+
* @param $adapter
|
125 |
+
*
|
126 |
+
* @return $this
|
127 |
+
*/
|
128 |
+
public function setAdapter($adapter = 'mysql')
|
129 |
+
{
|
130 |
+
$this->adapter = $adapter;
|
131 |
+
|
132 |
+
return $this;
|
133 |
+
}
|
134 |
+
|
135 |
+
/**
|
136 |
+
* @return string
|
137 |
+
*/
|
138 |
+
public function getAdapter()
|
139 |
+
{
|
140 |
+
return $this->adapter;
|
141 |
+
}
|
142 |
+
|
143 |
+
/**
|
144 |
+
* @param array $adapterConfig
|
145 |
+
*
|
146 |
+
* @return $this
|
147 |
+
*/
|
148 |
+
public function setAdapterConfig(array $adapterConfig)
|
149 |
+
{
|
150 |
+
$this->adapterConfig = $adapterConfig;
|
151 |
+
|
152 |
+
return $this;
|
153 |
+
}
|
154 |
+
|
155 |
+
/**
|
156 |
+
* @return array
|
157 |
+
*/
|
158 |
+
public function getAdapterConfig()
|
159 |
+
{
|
160 |
+
return $this->adapterConfig;
|
161 |
+
}
|
162 |
+
|
163 |
+
/**
|
164 |
+
* @return Container
|
165 |
+
*/
|
166 |
+
public function getContainer()
|
167 |
+
{
|
168 |
+
return $this->container;
|
169 |
+
}
|
170 |
+
|
171 |
+
/**
|
172 |
+
* @return EventHandler
|
173 |
+
*/
|
174 |
+
public function getEventHandler()
|
175 |
+
{
|
176 |
+
return $this->eventHandler;
|
177 |
+
}
|
178 |
+
|
179 |
+
/**
|
180 |
+
* @return Connection
|
181 |
+
*/
|
182 |
+
public static function getStoredConnection()
|
183 |
+
{
|
184 |
+
return static::$storedConnection;
|
185 |
+
}
|
186 |
+
}
|
app/Services/wpfluent/src/EventHandler.php
ADDED
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php namespace WpFluent;
|
2 |
+
|
3 |
+
use WpFluent\QueryBuilder\QueryBuilderHandler;
|
4 |
+
use WpFluent\QueryBuilder\Raw;
|
5 |
+
|
6 |
+
class EventHandler
|
7 |
+
{
|
8 |
+
/**
|
9 |
+
* @var array
|
10 |
+
*/
|
11 |
+
protected $events = array();
|
12 |
+
|
13 |
+
/**
|
14 |
+
* @var array
|
15 |
+
*/
|
16 |
+
protected $firedEvents = array();
|
17 |
+
|
18 |
+
/**
|
19 |
+
* @return array
|
20 |
+
*/
|
21 |
+
public function getEvents()
|
22 |
+
{
|
23 |
+
return $this->events;
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* @param $event
|
28 |
+
* @param $table
|
29 |
+
*
|
30 |
+
* @return callable|null
|
31 |
+
*/
|
32 |
+
public function getEvent($event, $table = ':any')
|
33 |
+
{
|
34 |
+
if ($table instanceof Raw) {
|
35 |
+
return null;
|
36 |
+
}
|
37 |
+
return isset($this->events[$table][$event]) ? $this->events[$table][$event] : null;
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* @param $event
|
42 |
+
* @param string $table
|
43 |
+
* @param callable $action
|
44 |
+
*
|
45 |
+
* @return void
|
46 |
+
*/
|
47 |
+
public function registerEvent($event, $table, \Closure $action)
|
48 |
+
{
|
49 |
+
$table = $table ?: ':any';
|
50 |
+
|
51 |
+
$this->events[$table][$event] = $action;
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* @param $event
|
56 |
+
* @param string $table
|
57 |
+
*
|
58 |
+
* @return void
|
59 |
+
*/
|
60 |
+
public function removeEvent($event, $table = ':any')
|
61 |
+
{
|
62 |
+
unset($this->events[$table][$event]);
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* @param QueryBuilderHandler $queryBuilder
|
67 |
+
* @param $event
|
68 |
+
* @return mixed
|
69 |
+
*/
|
70 |
+
public function fireEvents($queryBuilder, $event)
|
71 |
+
{
|
72 |
+
$statements = $queryBuilder->getStatements();
|
73 |
+
$tables = isset($statements['tables']) ? $statements['tables'] : array();
|
74 |
+
|
75 |
+
// Events added with :any will be fired in case of any table,
|
76 |
+
// we are adding :any as a fake table at the beginning.
|
77 |
+
array_unshift($tables, ':any');
|
78 |
+
|
79 |
+
// Fire all events
|
80 |
+
foreach ($tables as $table) {
|
81 |
+
// Fire before events for :any table
|
82 |
+
if ($action = $this->getEvent($event, $table)) {
|
83 |
+
// Make an event id, with event type and table
|
84 |
+
$eventId = $event . $table;
|
85 |
+
|
86 |
+
// Fire event
|
87 |
+
$handlerParams = func_get_args();
|
88 |
+
unset($handlerParams[1]); // we do not need $event
|
89 |
+
// Add to fired list
|
90 |
+
$this->firedEvents[] = $eventId;
|
91 |
+
$result = call_user_func_array($action, $handlerParams);
|
92 |
+
if (!is_null($result)) {
|
93 |
+
return $result;
|
94 |
+
};
|
95 |
+
}
|
96 |
+
}
|
97 |
+
}
|
98 |
+
}
|
app/Services/wpfluent/src/Exception.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php namespace WpFluent;
|
2 |
+
|
3 |
+
class Exception extends \Exception
|
4 |
+
{
|
5 |
+
|
6 |
+
}
|
app/Services/wpfluent/src/QueryBuilder/Adapters/BaseAdapter.php
ADDED
@@ -0,0 +1,545 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php namespace WpFluent\QueryBuilder\Adapters;
|
2 |
+
|
3 |
+
use WpFluent\Connection;
|
4 |
+
use WpFluent\Exception;
|
5 |
+
use WpFluent\QueryBuilder\Raw;
|
6 |
+
|
7 |
+
abstract class BaseAdapter
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* @var \WpFluent\Connection
|
11 |
+
*/
|
12 |
+
protected $connection;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* @var \Viocon\Container
|
16 |
+
*/
|
17 |
+
protected $container;
|
18 |
+
|
19 |
+
public function __construct(Connection $connection)
|
20 |
+
{
|
21 |
+
$this->connection = $connection;
|
22 |
+
$this->container = $this->connection->getContainer();
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Build select query string and bindings
|
27 |
+
*
|
28 |
+
* @param $statements
|
29 |
+
*
|
30 |
+
* @throws Exception
|
31 |
+
* @return array
|
32 |
+
*/
|
33 |
+
public function select($statements)
|
34 |
+
{
|
35 |
+
if (! array_key_exists('tables', $statements)) {
|
36 |
+
throw new Exception('No table specified.', 3);
|
37 |
+
} elseif (! array_key_exists('selects', $statements)) {
|
38 |
+
$statements['selects'][] = '*';
|
39 |
+
}
|
40 |
+
|
41 |
+
// From
|
42 |
+
$tables = $this->arrayStr($statements['tables'], ', ');
|
43 |
+
// Select
|
44 |
+
$selects = $this->arrayStr($statements['selects'], ', ');
|
45 |
+
|
46 |
+
|
47 |
+
// Wheres
|
48 |
+
list($whereCriteria, $whereBindings) = $this->buildCriteriaWithType($statements, 'wheres', 'WHERE');
|
49 |
+
// Group bys
|
50 |
+
$groupBys = '';
|
51 |
+
if (isset($statements['groupBys']) && $groupBys = $this->arrayStr($statements['groupBys'], ', ')) {
|
52 |
+
$groupBys = 'GROUP BY ' . $groupBys;
|
53 |
+
}
|
54 |
+
|
55 |
+
// Order bys
|
56 |
+
$orderBys = '';
|
57 |
+
if (isset($statements['orderBys']) && is_array($statements['orderBys'])) {
|
58 |
+
foreach ($statements['orderBys'] as $orderBy) {
|
59 |
+
$orderBys .= $this->wrapSanitizer($orderBy['field']) . ' ' . $orderBy['type'] . ', ';
|
60 |
+
}
|
61 |
+
|
62 |
+
if ($orderBys = trim($orderBys, ', ')) {
|
63 |
+
$orderBys = 'ORDER BY ' . $orderBys;
|
64 |
+
}
|
65 |
+
}
|
66 |
+
|
67 |
+
// Limit and offset
|
68 |
+
$limit = isset($statements['limit']) ? 'LIMIT ' . $statements['limit'] : '';
|
69 |
+
$offset = isset($statements['offset']) ? 'OFFSET ' . $statements['offset'] : '';
|
70 |
+
|
71 |
+
// Having
|
72 |
+
list($havingCriteria, $havingBindings) = $this->buildCriteriaWithType($statements, 'havings', 'HAVING');
|
73 |
+
|
74 |
+
// Joins
|
75 |
+
$joinString = $this->buildJoin($statements);
|
76 |
+
|
77 |
+
$sqlArray = array(
|
78 |
+
'SELECT' . (isset($statements['distinct']) ? ' DISTINCT' : ''),
|
79 |
+
$selects,
|
80 |
+
'FROM',
|
81 |
+
$tables,
|
82 |
+
$joinString,
|
83 |
+
$whereCriteria,
|
84 |
+
$groupBys,
|
85 |
+
$havingCriteria,
|
86 |
+
$orderBys,
|
87 |
+
$limit,
|
88 |
+
$offset
|
89 |
+
);
|
90 |
+
|
91 |
+
$sql = $this->concatenateQuery($sqlArray);
|
92 |
+
|
93 |
+
$bindings = array_merge(
|
94 |
+
$whereBindings,
|
95 |
+
$havingBindings
|
96 |
+
);
|
97 |
+
|
98 |
+
return compact('sql', 'bindings');
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Build just criteria part of the query
|
103 |
+
*
|
104 |
+
* @param $statements
|
105 |
+
* @param bool $bindValues
|
106 |
+
*
|
107 |
+
* @return array
|
108 |
+
*/
|
109 |
+
public function criteriaOnly($statements, $bindValues = true)
|
110 |
+
{
|
111 |
+
$sql = $bindings = array();
|
112 |
+
|
113 |
+
if (! isset($statements['criteria'])) {
|
114 |
+
return compact('sql', 'bindings');
|
115 |
+
}
|
116 |
+
|
117 |
+
list($sql, $bindings) = $this->buildCriteria($statements['criteria'], $bindValues);
|
118 |
+
|
119 |
+
return compact('sql', 'bindings');
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Build a generic insert/ignore/replace query
|
124 |
+
*
|
125 |
+
* @param $statements
|
126 |
+
* @param array $data
|
127 |
+
*
|
128 |
+
* @return array
|
129 |
+
* @throws Exception
|
130 |
+
*/
|
131 |
+
private function doInsert($statements, array $data, $type)
|
132 |
+
{
|
133 |
+
if (! isset($statements['tables'])) {
|
134 |
+
throw new Exception('No table specified', 3);
|
135 |
+
}
|
136 |
+
|
137 |
+
$table = end($statements['tables']);
|
138 |
+
|
139 |
+
$bindings = $keys = $values = array();
|
140 |
+
|
141 |
+
foreach ($data as $key => $value) {
|
142 |
+
$keys[] = $key;
|
143 |
+
if ($value instanceof Raw) {
|
144 |
+
$values[] = (string) $value;
|
145 |
+
} else {
|
146 |
+
$values[] = '?';
|
147 |
+
$bindings[] = $value;
|
148 |
+
}
|
149 |
+
}
|
150 |
+
|
151 |
+
$sqlArray = array(
|
152 |
+
$type . ' INTO',
|
153 |
+
$this->wrapSanitizer($table),
|
154 |
+
'(' . $this->arrayStr($keys, ',') . ')',
|
155 |
+
'VALUES',
|
156 |
+
'(' . $this->arrayStr($values, ',', false) . ')',
|
157 |
+
);
|
158 |
+
|
159 |
+
if (isset($statements['onduplicate'])) {
|
160 |
+
if (count($statements['onduplicate']) < 1) {
|
161 |
+
throw new Exception('No data given.', 4);
|
162 |
+
}
|
163 |
+
list($updateStatement, $updateBindings) = $this->getUpdateStatement($statements['onduplicate']);
|
164 |
+
$sqlArray[] = 'ON DUPLICATE KEY UPDATE ' . $updateStatement;
|
165 |
+
$bindings = array_merge($bindings, $updateBindings);
|
166 |
+
}
|
167 |
+
|
168 |
+
$sql = $this->concatenateQuery($sqlArray);
|
169 |
+
|
170 |
+
return compact('sql', 'bindings');
|
171 |
+
}
|
172 |
+
|
173 |
+
/**
|
174 |
+
* Build Insert query
|
175 |
+
*
|
176 |
+
* @param $statements
|
177 |
+
* @param array $data
|
178 |
+
*
|
179 |
+
* @return array
|
180 |
+
* @throws Exception
|
181 |
+
*/
|
182 |
+
public function insert($statements, array $data)
|
183 |
+
{
|
184 |
+
return $this->doInsert($statements, $data, 'INSERT');
|
185 |
+
}
|
186 |
+
|
187 |
+
/**
|
188 |
+
* Build Insert Ignore query
|
189 |
+
*
|
190 |
+
* @param $statements
|
191 |
+
* @param array $data
|
192 |
+
*
|
193 |
+
* @return array
|
194 |
+
* @throws Exception
|
195 |
+
*/
|
196 |
+
public function insertIgnore($statements, array $data)
|
197 |
+
{
|
198 |
+
return $this->doInsert($statements, $data, 'INSERT IGNORE');
|
199 |
+
}
|
200 |
+
|
201 |
+
/**
|
202 |
+
* Build Insert Ignore query
|
203 |
+
*
|
204 |
+
* @param $statements
|
205 |
+
* @param array $data
|
206 |
+
*
|
207 |
+
* @return array
|
208 |
+
* @throws Exception
|
209 |
+
*/
|
210 |
+
public function replace($statements, array $data)
|
211 |
+
{
|
212 |
+
return $this->doInsert($statements, $data, 'REPLACE');
|
213 |
+
}
|
214 |
+
|
215 |
+
/**
|
216 |
+
* Build fields assignment part of SET ... or ON DUBLICATE KEY UPDATE ... statements
|
217 |
+
*
|
218 |
+
* @param array $data
|
219 |
+
*
|
220 |
+
* @return array
|
221 |
+
*/
|
222 |
+
private function getUpdateStatement($data)
|
223 |
+
{
|
224 |
+
$bindings = array();
|
225 |
+
$statement = '';
|
226 |
+
|
227 |
+
foreach ($data as $key => $value) {
|
228 |
+
if ($value instanceof Raw) {
|
229 |
+
$statement .= $this->wrapSanitizer($key) . '=' . $value . ',';
|
230 |
+
} else {
|
231 |
+
$statement .= $this->wrapSanitizer($key) . '=?,';
|
232 |
+
$bindings[] = $value;
|
233 |
+
}
|
234 |
+
}
|
235 |
+
|
236 |
+
$statement = trim($statement, ',');
|
237 |
+
|
238 |
+
return array($statement, $bindings);
|
239 |
+
}
|
240 |
+
|
241 |
+
/**
|
242 |
+
* Build update query
|
243 |
+
*
|
244 |
+
* @param $statements
|
245 |
+
* @param array $data
|
246 |
+
*
|
247 |
+
* @return array
|
248 |
+
* @throws Exception
|
249 |
+
*/
|
250 |
+
public function update($statements, array $data)
|
251 |
+
{
|
252 |
+
if (! isset($statements['tables'])) {
|
253 |
+
throw new Exception('No table specified', 3);
|
254 |
+
} elseif (count($data) < 1) {
|
255 |
+
throw new Exception('No data given.', 4);
|
256 |
+
}
|
257 |
+
|
258 |
+
$table = end($statements['tables']);
|
259 |
+
|
260 |
+
// Update statement
|
261 |
+
list($updateStatement, $bindings) = $this->getUpdateStatement($data);
|
262 |
+
|
263 |
+
// Wheres
|
264 |
+
list($whereCriteria, $whereBindings) = $this->buildCriteriaWithType($statements, 'wheres', 'WHERE');
|
265 |
+
|
266 |
+
// Limit
|
267 |
+
$limit = isset($statements['limit']) ? 'LIMIT ' . $statements['limit'] : '';
|
268 |
+
|
269 |
+
$sqlArray = array(
|
270 |
+
'UPDATE',
|
271 |
+
$this->wrapSanitizer($table),
|
272 |
+
'SET ' . $updateStatement,
|
273 |
+
$whereCriteria,
|
274 |
+
$limit
|
275 |
+
);
|
276 |
+
|
277 |
+
$sql = $this->concatenateQuery($sqlArray);
|
278 |
+
|
279 |
+
$bindings = array_merge($bindings, $whereBindings);
|
280 |
+
|
281 |
+
return compact('sql', 'bindings');
|
282 |
+
}
|
283 |
+
|
284 |
+
/**
|
285 |
+
* Build delete query
|
286 |
+
*
|
287 |
+
* @param $statements
|
288 |
+
*
|
289 |
+
* @return array
|
290 |
+
* @throws Exception
|
291 |
+
*/
|
292 |
+
public function delete($statements)
|
293 |
+
{
|
294 |
+
if (! isset($statements['tables'])) {
|
295 |
+
throw new Exception('No table specified', 3);
|
296 |
+
}
|
297 |
+
|
298 |
+
$table = end($statements['tables']);
|
299 |
+
|
300 |
+
// Wheres
|
301 |
+
list($whereCriteria, $whereBindings) = $this->buildCriteriaWithType($statements, 'wheres', 'WHERE');
|
302 |
+
|
303 |
+
// Limit
|
304 |
+
$limit = isset($statements['limit']) ? 'LIMIT ' . $statements['limit'] : '';
|
305 |
+
|
306 |
+
$sqlArray = array('DELETE FROM', $this->wrapSanitizer($table), $whereCriteria);
|
307 |
+
$sql = $this->concatenateQuery($sqlArray);
|
308 |
+
$bindings = $whereBindings;
|
309 |
+
|
310 |
+
return compact('sql', 'bindings');
|
311 |
+
}
|
312 |
+
|
313 |
+
/**
|
314 |
+
* Array concatenating method, like implode.
|
315 |
+
* But it does wrap sanitizer and trims last glue
|
316 |
+
*
|
317 |
+
* @param array $pieces
|
318 |
+
* @param $glue
|
319 |
+
* @param bool $wrapSanitizer
|
320 |
+
*
|
321 |
+
* @return string
|
322 |
+
*/
|
323 |
+
protected function arrayStr(array $pieces, $glue, $wrapSanitizer = true)
|
324 |
+
{
|
325 |
+
$str = '';
|
326 |
+
|
327 |
+
foreach ($pieces as $key => $piece) {
|
328 |
+
if ($wrapSanitizer) {
|
329 |
+
$piece = $this->wrapSanitizer($piece);
|
330 |
+
}
|
331 |
+
|
332 |
+
if (! is_int($key)) {
|
333 |
+
$piece = ($wrapSanitizer ? $this->wrapSanitizer($key) : $key) . ' AS ' . $piece;
|
334 |
+
}
|
335 |
+
|
336 |
+
$str .= $piece . $glue;
|
337 |
+
}
|
338 |
+
|
339 |
+
return trim($str, $glue);
|
340 |
+
}
|
341 |
+
|
342 |
+
/**
|
343 |
+
* Join different part of queries with a space.
|
344 |
+
*
|
345 |
+
* @param array $pieces
|
346 |
+
*
|
347 |
+
* @return string
|
348 |
+
*/
|
349 |
+
protected function concatenateQuery(array $pieces)
|
350 |
+
{
|
351 |
+
$str = '';
|
352 |
+
|
353 |
+
foreach ($pieces as $piece) {
|
354 |
+
$str = trim($str) . ' ' . trim($piece);
|
355 |
+
}
|
356 |
+
|
357 |
+
return trim($str);
|
358 |
+
}
|
359 |
+
|
360 |
+
/**
|
361 |
+
* Build generic criteria string and bindings from statements, like "a = b and c = ?"
|
362 |
+
*
|
363 |
+
* @param $statements
|
364 |
+
* @param bool $bindValues
|
365 |
+
*
|
366 |
+
* @return array
|
367 |
+
*/
|
368 |
+
protected function buildCriteria($statements, $bindValues = true)
|
369 |
+
{
|
370 |
+
$criteria = '';
|
371 |
+
$bindings = array();
|
372 |
+
|
373 |
+
foreach ($statements as $statement) {
|
374 |
+
$key = $this->wrapSanitizer($statement['key']);
|
375 |
+
$value = $statement['value'];
|
376 |
+
|
377 |
+
if (is_null($value) && $key instanceof \Closure) {
|
378 |
+
// We have a closure, a nested criteria
|
379 |
+
|
380 |
+
// Build a new NestedCriteria class, keep it by reference so any changes made
|
381 |
+
// in the closure should reflect here
|
382 |
+
$nestedCriteria = $this->container->build(
|
383 |
+
'\\WpFluent\\QueryBuilder\\NestedCriteria',
|
384 |
+
array($this->connection)
|
385 |
+
);
|
386 |
+
|
387 |
+
$nestedCriteria = & $nestedCriteria;
|
388 |
+
// Call the closure with our new nestedCriteria object
|
389 |
+
$key($nestedCriteria);
|
390 |
+
// Get the criteria only query from the nestedCriteria object
|
391 |
+
$queryObject = $nestedCriteria->getQuery('criteriaOnly', true);
|
392 |
+
// Merge the bindings we get from nestedCriteria object
|
393 |
+
$bindings = array_merge($bindings, $queryObject->getBindings());
|
394 |
+
// Append the sql we get from the nestedCriteria object
|
395 |
+
$criteria .= $statement['joiner'] . ' (' . $queryObject->getSql() . ') ';
|
396 |
+
} elseif (is_array($value)) {
|
397 |
+
// where_in or between like query
|
398 |
+
$criteria .= $statement['joiner'] . ' ' . $key . ' ' . $statement['operator'];
|
399 |
+
|
400 |
+
switch ($statement['operator']) {
|
401 |
+
case 'BETWEEN':
|
402 |
+
$bindings = array_merge($bindings, $statement['value']);
|
403 |
+
$criteria .= ' ? AND ? ';
|
404 |
+
break;
|
405 |
+
default:
|
406 |
+
$valuePlaceholder = '';
|
407 |
+
foreach ($statement['value'] as $subValue) {
|
408 |
+
$valuePlaceholder .= '?, ';
|
409 |
+
$bindings[] = $subValue;
|
410 |
+
}
|
411 |
+
|
412 |
+
$valuePlaceholder = trim($valuePlaceholder, ', ');
|
413 |
+
$criteria .= ' (' . $valuePlaceholder . ') ';
|
414 |
+
break;
|
415 |
+
}
|
416 |
+
} elseif ($value instanceof Raw) {
|
417 |
+
$criteria .= "{$statement['joiner']} {$key} {$statement['operator']} $value ";
|
418 |
+
} else {
|
419 |
+
// Usual where like criteria
|
420 |
+
|
421 |
+
if (! $bindValues) {
|
422 |
+
// Specially for joins
|
423 |
+
|
424 |
+
// We are not binding values, lets sanitize then
|
425 |
+
$value = $this->wrapSanitizer($value);
|
426 |
+
$criteria .= $statement['joiner'] . ' ' . $key . ' ' . $statement['operator'] . ' ' . $value . ' ';
|
427 |
+
} elseif ($statement['key'] instanceof Raw) {
|
428 |
+
$criteria .= $statement['joiner'] . ' ' . $key . ' ';
|
429 |
+
$bindings = array_merge($bindings, $statement['key']->getBindings());
|
430 |
+
} else {
|
431 |
+
// For wheres
|
432 |
+
|
433 |
+
$valuePlaceholder = '?';
|
434 |
+
$bindings[] = $value;
|
435 |
+
$criteria .= $statement['joiner'] . ' ' . $key . ' ' . $statement['operator'] . ' '
|
436 |
+
. $valuePlaceholder . ' ';
|
437 |
+
}
|
438 |
+
}
|
439 |
+
}
|
440 |
+
|
441 |
+
// Clear all white spaces, and, or from beginning and white spaces from ending
|
442 |
+
$criteria = preg_replace('/^(\s?AND ?|\s?OR ?)|\s$/i', '', $criteria);
|
443 |
+
|
444 |
+
return array($criteria, $bindings);
|
445 |
+
}
|
446 |
+
|
447 |
+
/**
|
448 |
+
* Wrap values with adapter's sanitizer like, '`'
|
449 |
+
*
|
450 |
+
* @param $value
|
451 |
+
*
|
452 |
+
* @return string
|
453 |
+
*/
|
454 |
+
public function wrapSanitizer($value)
|
455 |
+
{
|
456 |
+
// Its a raw query, just cast as string, object has __toString()
|
457 |
+
if ($value instanceof Raw) {
|
458 |
+
return (string) $value;
|
459 |
+
} elseif ($value instanceof \Closure) {
|
460 |
+
return $value;
|
461 |
+
}
|
462 |
+
|
463 |
+
// Separate our table and fields which are joined with a ".",
|
464 |
+
// like my_table.id
|
465 |
+
$valueArr = explode('.', $value, 2);
|
466 |
+
|
467 |
+
foreach ($valueArr as $key => $subValue) {
|
468 |
+
// Don't wrap if we have *, which is not a usual field
|
469 |
+
$valueArr[$key] = trim($subValue) == '*' ? $subValue : $this->sanitizer . $subValue . $this->sanitizer;
|
470 |
+
}
|
471 |
+
|
472 |
+
// Join these back with "." and return
|
473 |
+
return implode('.', $valueArr);
|
474 |
+
}
|
475 |
+
|
476 |
+
/**
|
477 |
+
* Build criteria string and binding with various types added, like WHERE and Having
|
478 |
+
*
|
479 |
+
* @param $statements
|
480 |
+
* @param $key
|
481 |
+
* @param $type
|
482 |
+
* @param bool $bindValues
|
483 |
+
*
|
484 |
+
* @return array
|
485 |
+
*/
|
486 |
+
protected function buildCriteriaWithType($statements, $key, $type, $bindValues = true)
|
487 |
+
{
|
488 |
+
$criteria = '';
|
489 |
+
$bindings = array();
|
490 |
+
|
491 |
+
if (isset($statements[$key])) {
|
492 |
+
// Get the generic/adapter agnostic criteria string from parent
|
493 |
+
list($criteria, $bindings) = $this->buildCriteria($statements[$key], $bindValues);
|
494 |
+
|
495 |
+
if ($criteria) {
|
496 |
+
$criteria = $type . ' ' . $criteria;
|
497 |
+
}
|
498 |
+
}
|
499 |
+
|
500 |
+
return array($criteria, $bindings);
|
501 |
+
}
|
502 |
+
|
503 |
+
/**
|
504 |
+
* Build join string
|
505 |
+
*
|
506 |
+
* @param $statements
|
507 |
+
*
|
508 |
+
* @return array|string
|
509 |
+
*/
|
510 |
+
protected function buildJoin($statements)
|
511 |
+
{
|
512 |
+
$sql = '';
|
513 |
+
|
514 |
+
if (! array_key_exists('joins', $statements) || ! is_array($statements['joins'])) {
|
515 |
+
return $sql;
|
516 |
+
}
|
517 |
+
|
518 |
+
foreach ($statements['joins'] as $joinArr) {
|
519 |
+
if (is_array($joinArr['table'])) {
|
520 |
+
$mainTable = $joinArr['table'][0];
|
521 |
+
$aliasTable = $joinArr['table'][1];
|
522 |
+
$table = $this->wrapSanitizer($mainTable) . ' AS ' . $this->wrapSanitizer($aliasTable);
|
523 |
+
} else {
|
524 |
+
$table = $joinArr['table'] instanceof Raw ?
|
525 |
+
(string) $joinArr['table'] :
|
526 |
+
$this->wrapSanitizer($joinArr['table']);
|
527 |
+
}
|
528 |
+
|
529 |
+
$joinBuilder = $joinArr['joinBuilder'];
|
530 |
+
|
531 |
+
$sqlArr = array(
|
532 |
+
$sql,
|
533 |
+
strtoupper($joinArr['type']),
|
534 |
+
'JOIN',
|
535 |
+
$table,
|
536 |
+
'ON',
|
537 |
+
$joinBuilder->getQuery('criteriaOnly', false)->getSql()
|
538 |
+
);
|
539 |
+
|
540 |
+
$sql = $this->concatenateQuery($sqlArr);
|
541 |
+
}
|
542 |
+
|
543 |
+
return $sql;
|
544 |
+
}
|
545 |
+
}
|
app/Services/wpfluent/src/QueryBuilder/Adapters/Mysql.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php namespace WpFluent\QueryBuilder\Adapters;
|
2 |
+
|
3 |
+
class Mysql extends BaseAdapter
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* @var string
|
7 |
+
*/
|
8 |
+
protected $sanitizer = '`';
|
9 |
+
}
|
app/Services/wpfluent/src/QueryBuilder/JoinBuilder.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php namespace WpFluent\QueryBuilder;
|
2 |
+
|
3 |
+
class JoinBuilder extends QueryBuilderHandler
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* @param $key
|
7 |
+
* @param $operator
|
8 |
+
* @param $value
|
9 |
+
*
|
10 |
+
* @return $this
|
11 |
+
*/
|
12 |
+
public function on($key, $operator, $value)
|
13 |
+
{
|
14 |
+
return $this->joinHandler($key, $operator, $value, 'AND');
|
15 |
+
}
|
16 |
+
|
17 |
+
/**
|
18 |
+
* @param $key
|
19 |
+
* @param $operator
|
20 |
+
* @param $value
|
21 |
+
*
|
22 |
+
* @return $this
|
23 |
+
*/
|
24 |
+
public function orOn($key, $operator, $value)
|
25 |
+
{
|
26 |
+
return $this->joinHandler($key, $operator, $value, 'OR');
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* @param $key
|
31 |
+
* @param null $operator
|
32 |
+
* @param null $value
|
33 |
+
* @param string $joiner
|
34 |
+
*
|
35 |
+
* @return $this
|
36 |
+
*/
|
37 |
+
protected function joinHandler($key, $operator = null, $value = null, $joiner = 'AND')
|
38 |
+
{
|
39 |
+
$key = $this->addTablePrefix($key);
|
40 |
+
$value = $this->addTablePrefix($value);
|
41 |
+
$this->statements['criteria'][] = compact('key', 'operator', 'value', 'joiner');
|
42 |
+
|
43 |
+
return $this;
|
44 |
+
}
|
45 |
+
}
|
app/Services/wpfluent/src/QueryBuilder/NestedCriteria.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php namespace WpFluent\QueryBuilder;
|
2 |
+
|
3 |
+
class NestedCriteria extends QueryBuilderHandler
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* @param $key
|
7 |
+
* @param null $operator
|
8 |
+
* @param null $value
|
9 |
+
* @param string $joiner
|
10 |
+
*
|
11 |
+
* @return $this
|
12 |
+
*/
|
13 |
+
protected function whereHandler($key, $operator = null, $value = null, $joiner = 'AND')
|
14 |
+
{
|
15 |
+
$key = $this->addTablePrefix($key);
|
16 |
+
$this->statements['criteria'][] = compact('key', 'operator', 'value', 'joiner');
|
17 |
+
|
18 |
+
return $this;
|
19 |
+
}
|
20 |
+
}
|
app/Services/wpfluent/src/QueryBuilder/QueryBuilderHandler.php
ADDED
@@ -0,0 +1,1135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php namespace WpFluent\QueryBuilder;
|
2 |
+
|
3 |
+
use WpFluent\Connection;
|
4 |
+
use WpFluent\Exception;
|
5 |
+
|
6 |
+
class QueryBuilderHandler
|
7 |
+
{
|
8 |
+
|
9 |
+
/**
|
10 |
+
* @var \Viocon\Container
|
11 |
+
*/
|
12 |
+
protected $container;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* @var Connection
|
16 |
+
*/
|
17 |
+
protected $connection;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* @var array
|
21 |
+
*/
|
22 |
+
protected $statements = array();
|
23 |
+
|
24 |
+
/**
|
25 |
+
* @var \wpdb
|
26 |
+
*/
|
27 |
+
protected $db;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* @var null|string
|
31 |
+
*/
|
32 |
+
protected $dbStatement = null;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* @var null|string
|
36 |
+
*/
|
37 |
+
protected $tablePrefix = null;
|
38 |
+
|
39 |
+
/**
|
40 |
+
* @var \WpFluent\QueryBuilder\Adapters\BaseAdapter
|
41 |
+
*/
|
42 |
+
protected $adapterInstance;
|
43 |
+
|
44 |
+
/**
|
45 |
+
* The PDO fetch parameters to use
|
46 |
+
*
|
47 |
+
* @var array
|
48 |
+
*/
|
49 |
+
protected $fetchParameters = array(\PDO::FETCH_OBJ);
|
50 |
+
|
51 |
+
/**
|
52 |
+
* @param null|\WpFluent\Connection $connection
|
53 |
+
*
|
54 |
+
* @throws \WpFluent\Exception
|
55 |
+
*/
|
56 |
+
public function __construct(Connection $connection = null)
|
57 |
+
{
|
58 |
+
if (is_null($connection)) {
|
59 |
+
if (! $connection = Connection::getStoredConnection()) {
|
60 |
+
throw new Exception('No database connection found.', 1);
|
61 |
+
}
|
62 |
+
}
|
63 |
+
|
64 |
+
$this->connection = $connection;
|
65 |
+
$this->container = $this->connection->getContainer();
|
66 |
+
$this->db = $this->connection->getDbInstance();
|
67 |
+
$this->adapter = $this->connection->getAdapter();
|
68 |
+
$this->adapterConfig = $this->connection->getAdapterConfig();
|
69 |
+
|
70 |
+
if (isset($this->adapterConfig['prefix'])) {
|
71 |
+
$this->tablePrefix = $this->adapterConfig['prefix'];
|
72 |
+
}
|
73 |
+
|
74 |
+
// Query builder adapter instance
|
75 |
+
$this->adapterInstance = $this->container->build(
|
76 |
+
'\\WpFluent\\QueryBuilder\\Adapters\\' . ucfirst($this->adapter),
|
77 |
+
array($this->connection)
|
78 |
+
);
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Set the fetch mode
|
83 |
+
*
|
84 |
+
* @param $mode
|
85 |
+
* @return $this
|
86 |
+
*/
|
87 |
+
public function setFetchMode($mode)
|
88 |
+
{
|
89 |
+
$this->fetchParameters = func_get_args();
|
90 |
+
|
91 |
+
return $this;
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Fetch query results as object of specified type
|
96 |
+
*
|
97 |
+
* @param $className
|
98 |
+
* @param array $constructorArgs
|
99 |
+
* @return QueryBuilderHandler
|
100 |
+
*/
|
101 |
+
public function asObject($className, $constructorArgs = array())
|
102 |
+
{
|
103 |
+
var_dump('need to implement this'); die();
|
104 |
+
|
105 |
+
return $this->setFetchMode(\PDO::FETCH_CLASS, $className, $constructorArgs);
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* @param null|\WpFluent\Connection $connection
|
110 |
+
*
|
111 |
+
* @return static
|
112 |
+
*/
|
113 |
+
public function newQuery(Connection $connection = null)
|
114 |
+
{
|
115 |
+
if (is_null($connection)) {
|
116 |
+
$connection = $this->connection;
|
117 |
+
}
|
118 |
+
|
119 |
+
return new static($connection);
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* @param $sql
|
124 |
+
* @param array $bindings
|
125 |
+
*
|
126 |
+
* @return $this
|
127 |
+
*/
|
128 |
+
public function query($sql, $bindings = array())
|
129 |
+
{
|
130 |
+
$this->dbStatement = $this->container->build(
|
131 |
+
'\\WpFluent\\QueryBuilder\\QueryObject',
|
132 |
+
array($sql, $bindings)
|
133 |
+
)->getRawSql();
|
134 |
+
|
135 |
+
return $this;
|
136 |
+
}
|
137 |
+
|
138 |
+
/**
|
139 |
+
* @param $rawSql
|
140 |
+
*
|
141 |
+
* @return float execution time
|
142 |
+
*/
|
143 |
+
public function statement($rawSql)
|
144 |
+
{
|
145 |
+
$start = microtime(true);
|
146 |
+
|
147 |
+
$this->db->query($rawSql);
|
148 |
+
|
149 |
+
return microtime(true) - $start;
|
150 |
+
}
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Get all rows
|
154 |
+
*
|
155 |
+
* @return array|object|null
|
156 |
+
* @throws \WpFluent\Exception
|
157 |
+
*/
|
158 |
+
public function get()
|
159 |
+
{
|
160 |
+
$eventResult = $this->fireEvents('before-select');
|
161 |
+
|
162 |
+
if (! is_null($eventResult)) {
|
163 |
+
return $eventResult;
|
164 |
+
};
|
165 |
+
|
166 |
+
if (is_null($this->dbStatement)) {
|
167 |
+
$queryObject = $this->getQuery('select');
|
168 |
+
|
169 |
+
$this->dbStatement = $queryObject->getRawSql();
|
170 |
+
}
|
171 |
+
|
172 |
+
$start = microtime(true);
|
173 |
+
$result = $this->db->get_results($this->dbStatement);
|
174 |
+
$executionTime = microtime(true) - $start;
|
175 |
+
$this->dbStatement = null;
|
176 |
+
$this->fireEvents('after-select', $result, $executionTime);
|
177 |
+
|
178 |
+
return $result;
|
179 |
+
}
|
180 |
+
|
181 |
+
/**
|
182 |
+
* Get first row
|
183 |
+
*
|
184 |
+
* @return \stdClass|null
|
185 |
+
*/
|
186 |
+
public function first()
|
187 |
+
{
|
188 |
+
$this->limit(1);
|
189 |
+
$result = $this->get();
|
190 |
+
|
191 |
+
return empty($result) ? null : $result[0];
|
192 |
+
}
|
193 |
+
|
194 |
+
/**
|
195 |
+
* @param $value
|
196 |
+
* @param string $fieldName
|
197 |
+
*
|
198 |
+
* @return null|\stdClass
|
199 |
+
*/
|
200 |
+
public function findAll($fieldName, $value)
|
201 |
+
{
|
202 |
+
$this->where($fieldName, '=', $value);
|
203 |
+
|
204 |
+
return $this->get();
|
205 |
+
}
|
206 |
+
|
207 |
+
/**
|
208 |
+
* @param $value
|
209 |
+
* @param string $fieldName
|
210 |
+
*
|
211 |
+
* @return null|\stdClass
|
212 |
+
*/
|
213 |
+
public function find($value, $fieldName = 'id')
|
214 |
+
{
|
215 |
+
$this->where($fieldName, '=', $value);
|
216 |
+
|
217 |
+
return $this->first();
|
218 |
+
}
|
219 |
+
|
220 |
+
/**
|
221 |
+
* Get count of rows
|
222 |
+
*
|
223 |
+
* @return int
|
224 |
+
*/
|
225 |
+
public function count()
|
226 |
+
{
|
227 |
+
// Get the current statements
|
228 |
+
$originalStatements = $this->statements;
|
229 |
+
|
230 |
+
unset($this->statements['orderBys']);
|
231 |
+
unset($this->statements['limit']);
|
232 |
+
unset($this->statements['offset']);
|
233 |
+
|
234 |
+
$count = $this->aggregate('count');
|
235 |
+
$this->statements = $originalStatements;
|
236 |
+
|
237 |
+
return $count;
|
238 |
+
}
|
239 |
+
|
240 |
+
/**
|
241 |
+
* @param $type
|
242 |
+
*
|
243 |
+
* @return int
|
244 |
+
*/
|
245 |
+
protected function aggregate($type)
|
246 |
+
{
|
247 |
+
// Get the current selects
|
248 |
+
$mainSelects = isset($this->statements['selects']) ? $this->statements['selects'] : null;
|
249 |
+
// Replace select with a scalar value like `count`
|
250 |
+
$this->statements['selects'] = array($this->raw($type . '(*) as field'));
|
251 |
+
$row = $this->get();
|
252 |
+
|
253 |
+
// Set the select as it was
|
254 |
+
if ($mainSelects) {
|
255 |
+
$this->statements['selects'] = $mainSelects;
|
256 |
+
} else {
|
257 |
+
unset($this->statements['selects']);
|
258 |
+
}
|
259 |
+
|
260 |
+
if (($count = count($row)) > 1) {
|
261 |
+
return $count;
|
262 |
+
} else {
|
263 |
+
$item = (array) $row[0];
|
264 |
+
|
265 |
+
return (int) $item['field'];
|
266 |
+
}
|
267 |
+
}
|
268 |
+
|
269 |
+
/**
|
270 |
+
* @param string $type
|
271 |
+
* @param array $dataToBePassed
|
272 |
+
*
|
273 |
+
* @return mixed
|
274 |
+
* @throws Exception
|
275 |
+
*/
|
276 |
+
public function getQuery($type = 'select', $dataToBePassed = array())
|
277 |
+
{
|
278 |
+
$allowedTypes = array('select', 'insert', 'insertignore', 'replace', 'delete', 'update', 'criteriaonly');
|
279 |
+
|
280 |
+
if (! in_array(strtolower($type), $allowedTypes)) {
|
281 |
+
throw new Exception($type . ' is not a known type.', 2);
|
282 |
+
}
|
283 |
+
|
284 |
+
$queryArr = $this->adapterInstance->$type($this->statements, $dataToBePassed);
|
285 |
+
|
286 |
+
return $this->container->build(
|
287 |
+
'\\WpFluent\\QueryBuilder\\QueryObject',
|
288 |
+
array($queryArr['sql'], $queryArr['bindings'])
|
289 |
+
);
|
290 |
+
}
|
291 |
+
|
292 |
+
/**
|
293 |
+
* @param QueryBuilderHandler $queryBuilder
|
294 |
+
* @param null $alias
|
295 |
+
*
|
296 |
+
* @return Raw
|
297 |
+
*/
|
298 |
+
public function subQuery(QueryBuilderHandler $queryBuilder, $alias = null)
|
299 |
+
{
|
300 |
+
$sql = '(' . $queryBuilder->getQuery()->getRawSql() . ')';
|
301 |
+
|
302 |
+
if ($alias) {
|
303 |
+
$sql = $sql . ' as ' . $alias;
|
304 |
+
}
|
305 |
+
|
306 |
+
return $queryBuilder->raw($sql);
|
307 |
+
}
|
308 |
+
|
309 |
+
/**
|
310 |
+
* @param $data
|
311 |
+
*
|
312 |
+
* @return array|string
|
313 |
+
* @throws \WpFluent\Exception
|
314 |
+
*/
|
315 |
+
private function doInsert($data, $type)
|
316 |
+
{
|
317 |
+
$eventResult = $this->fireEvents('before-insert');
|
318 |
+
|
319 |
+
if (! is_null($eventResult)) {
|
320 |
+
return $eventResult;
|
321 |
+
}
|
322 |
+
|
323 |
+
// If first value is not an array
|
324 |
+
// Its not a batch insert
|
325 |
+
if (! is_array(current($data))) {
|
326 |
+
$start = microtime(true);
|
327 |
+
|
328 |
+
$queryObject = $this->getQuery($type, $data);
|
329 |
+
|
330 |
+
$executionTime = $this->statement($queryObject->getRawSql());
|
331 |
+
|
332 |
+
$return = $this->db->insert_id;
|
333 |
+
} else {
|
334 |
+
// Its a batch insert
|
335 |
+
$executionTime = 0;
|
336 |
+
$return = array();
|
337 |
+
foreach ($data as $subData) {
|
338 |
+
$start = microtime(true);
|
339 |
+
|
340 |
+
$queryObject = $this->getQuery($type, $subData);
|
341 |
+
|
342 |
+
$executionTime = $this->statement($queryObject->getRawSql());
|
343 |
+
|
344 |
+
$return[] = $this->db->insert_id;
|
345 |
+
}
|
346 |
+
}
|
347 |
+
|
348 |
+
$this->fireEvents('after-insert', $return, $executionTime);
|
349 |
+
|
350 |
+
return $return;
|
351 |
+
}
|
352 |
+
|
353 |
+
/**
|
354 |
+
* @param $data
|
355 |
+
*
|
356 |
+
* @return array|string
|
357 |
+
*/
|
358 |
+
public function insert($data)
|
359 |
+
{
|
360 |
+
return $this->doInsert($data, 'insert');
|
361 |
+
}
|
362 |
+
|
363 |
+
/**
|
364 |
+
* @param $data
|
365 |
+
*
|
366 |
+
* @return array|string
|
367 |
+
*/
|
368 |
+
public function insertIgnore($data)
|
369 |
+
{
|
370 |
+
return $this->doInsert($data, 'insertignore');
|
371 |
+
}
|
372 |
+
|
373 |
+
/**
|
374 |
+
* @param $data
|
375 |
+
*
|
376 |
+
* @return array|string
|
377 |
+
*/
|
378 |
+
public function replace($data)
|
379 |
+
{
|
380 |
+
return $this->doInsert($data, 'replace');
|
381 |
+
}
|
382 |
+
|
383 |
+
/**
|
384 |
+
* @param $data
|
385 |
+
*
|
386 |
+
* @throws \WpFluent\Exception
|
387 |
+
*/
|
388 |
+
public function update($data)
|
389 |
+
{
|
390 |
+
$eventResult = $this->fireEvents('before-update');
|
391 |
+
|
392 |
+
if (! is_null($eventResult)) {
|
393 |
+
return $eventResult;
|
394 |
+
}
|
395 |
+
|
396 |
+
$queryObject = $this->getQuery('update', $data);
|
397 |
+
|
398 |
+
$executionTime = $this->statement($queryObject->getRawSql());
|
399 |
+
|
400 |
+
$this->fireEvents('after-update', $queryObject, $executionTime);
|
401 |
+
}
|
402 |
+
|
403 |
+
/**
|
404 |
+
* @param $data
|
405 |
+
*
|
406 |
+
* @return array|string
|
407 |
+
*/
|
408 |
+
public function updateOrInsert($data)
|
409 |
+
{
|
410 |
+
if ($this->first()) {
|
411 |
+
return $this->update($data);
|
412 |
+
} else {
|
413 |
+
return $this->insert($data);
|
414 |
+
}
|
415 |
+
}
|
416 |
+
|
417 |
+
/**
|
418 |
+
* @param $data
|
419 |
+
*
|
420 |
+
* @return $this
|
421 |
+
*/
|
422 |
+
public function onDuplicateKeyUpdate($data)
|
423 |
+
{
|
424 |
+
$this->addStatement('onduplicate', $data);
|
425 |
+
|
426 |
+
return $this;
|
427 |
+
}
|
428 |
+
|
429 |
+
/**
|
430 |
+
* @return mixed
|
431 |
+
* @throws \WpFluent\Exception
|
432 |
+
*/
|
433 |
+
public function delete()
|
434 |
+
{
|
435 |
+
$eventResult = $this->fireEvents('before-delete');
|
436 |
+
|
437 |
+
if (! is_null($eventResult)) {
|
438 |
+
return $eventResult;
|
439 |
+
}
|
440 |
+
|
441 |
+
$queryObject = $this->getQuery('delete');
|
442 |
+
|
443 |
+
$executionTime = $this->statement($queryObject->getRawSql());
|
444 |
+
|
445 |
+
$this->fireEvents('after-delete', $queryObject, $executionTime);
|
446 |
+
}
|
447 |
+
|
448 |
+
/**
|
449 |
+
* @param string|array $tables Single table or multiple tables
|
450 |
+
* as an array or as multiple parameters
|
451 |
+
*
|
452 |
+
* @return static
|
453 |
+
*/
|
454 |
+
public function table($tables)
|
455 |
+
{
|
456 |
+
if (! is_array($tables)) {
|
457 |
+
// because a single table is converted to an array anyways,
|
458 |
+
// this makes sense.
|
459 |
+
$tables = func_get_args();
|
460 |
+
}
|
461 |
+
|
462 |
+
$instance = new static($this->connection);
|
463 |
+
$tables = $this->addTablePrefix($tables, false);
|
464 |
+
$instance->addStatement('tables', $tables);
|
465 |
+
|
466 |
+
return $instance;
|
467 |
+
}
|
468 |
+
|
469 |
+
/**
|
470 |
+
* @param $tables
|
471 |
+
*
|
472 |
+
* @return $this
|
473 |
+
*/
|
474 |
+
public function from($tables)
|
475 |
+
{
|
476 |
+
if (! is_array($tables)) {
|
477 |
+
$tables = func_get_args();
|
478 |
+
}
|
479 |
+
|
480 |
+
$tables = $this->addTablePrefix($tables, false);
|
481 |
+
$this->addStatement('tables', $tables);
|
482 |
+
|
483 |
+
return $this;
|
484 |
+
}
|
485 |
+
|
486 |
+
/**
|
487 |
+
* @param $fields
|
488 |
+
*
|
489 |
+
* @return $this
|
490 |
+
*/
|
491 |
+
public function select($fields)
|
492 |
+
{
|
493 |
+
if (! is_array($fields)) {
|
494 |
+
$fields = func_get_args();
|
495 |
+
}
|
496 |
+
|
497 |
+
$fields = $this->addTablePrefix($fields);
|
498 |
+
$this->addStatement('selects', $fields);
|
499 |
+
|
500 |
+
return $this;
|
501 |
+
}
|
502 |
+
|
503 |
+
/**
|
504 |
+
* @param $fields
|
505 |
+
*
|
506 |
+
* @return $this
|
507 |
+
*/
|
508 |
+
public function selectDistinct($fields)
|
509 |
+
{
|
510 |
+
$this->select($fields);
|
511 |
+
$this->addStatement('distinct', true);
|
512 |
+
|
513 |
+
return $this;
|
514 |
+
}
|
515 |
+
|
516 |
+
/**
|
517 |
+
* @param $field
|
518 |
+
*
|
519 |
+
* @return $this
|
520 |
+
*/
|
521 |
+
public function groupBy($field)
|
522 |
+
{
|
523 |
+
$field = $this->addTablePrefix($field);
|
524 |
+
$this->addStatement('groupBys', $field);
|
525 |
+
|
526 |
+
return $this;
|
527 |
+
}
|
528 |
+
|
529 |
+
/**
|
530 |
+
* @param $fields
|
531 |
+
* @param string $defaultDirection
|
532 |
+
*
|
533 |
+
* @return $this
|
534 |
+
*/
|
535 |
+
public function orderBy($fields, $defaultDirection = 'ASC')
|
536 |
+
{
|
537 |
+
if (! is_array($fields)) {
|
538 |
+
$fields = array($fields);
|
539 |
+
}
|
540 |
+
|
541 |
+
foreach ($fields as $key => $value) {
|
542 |
+
$field = $key;
|
543 |
+
$type = $value;
|
544 |
+
|
545 |
+
if (is_int($key)) {
|
546 |
+
$field = $value;
|
547 |
+
$type = $defaultDirection;
|
548 |
+
}
|
549 |
+
|
550 |
+
if (!$field instanceof Raw) {
|
551 |
+
$field = $this->addTablePrefix($field);
|
552 |
+
}
|
553 |
+
|
554 |
+
$this->statements['orderBys'][] = compact('field', 'type');
|
555 |
+
}
|
556 |
+
|
557 |
+
return $this;
|
558 |
+
}
|
559 |
+
|
560 |
+
/**
|
561 |
+
* @param $limit
|
562 |
+
*
|
563 |
+
* @return $this
|
564 |
+
*/
|
565 |
+
public function limit($limit)
|
566 |
+
{
|
567 |
+
$this->statements['limit'] = $limit;
|
568 |
+
|
569 |
+
return $this;
|
570 |
+
}
|
571 |
+
|
572 |
+
/**
|
573 |
+
* @param $offset
|
574 |
+
*
|
575 |
+
* @return $this
|
576 |
+
*/
|
577 |
+
public function offset($offset)
|
578 |
+
{
|
579 |
+
$this->statements['offset'] = $offset;
|
580 |
+
|
581 |
+
return $this;
|
582 |
+
}
|
583 |
+
|
584 |
+
/**
|
585 |
+
* @param $key
|
586 |
+
* @param $operator
|
587 |
+
* @param $value
|
588 |
+
* @param string $joiner
|
589 |
+
*
|
590 |
+
* @return $this
|
591 |
+
*/
|
592 |
+
public function having($key, $operator, $value, $joiner = 'AND')
|
593 |
+
{
|
594 |
+
$key = $this->addTablePrefix($key);
|
595 |
+
$this->statements['havings'][] = compact('key', 'operator', 'value', 'joiner');
|
596 |
+
|
597 |
+
return $this;
|
598 |
+
}
|
599 |
+
|
600 |
+
/**
|
601 |
+
* @param $key
|
602 |
+
* @param $operator
|
603 |
+
* @param $value
|
604 |
+
*
|
605 |
+
* @return $this
|
606 |
+
*/
|
607 |
+
public function orHaving($key, $operator, $value)
|
608 |
+
{
|
609 |
+
return $this->having($key, $operator, $value, 'OR');
|
610 |
+
}
|
611 |
+
|
612 |
+
/**
|
613 |
+
* @param $key
|
614 |
+
* @param $operator
|
615 |
+
* @param $value
|
616 |
+
*
|
617 |
+
* @return $this
|
618 |
+
*/
|
619 |
+
public function where($key, $operator = null, $value = null)
|
620 |
+
{
|
621 |
+
// If two params are given then assume operator is =
|
622 |
+
if (func_num_args() == 2) {
|
623 |
+
$value = $operator;
|
624 |
+
$operator = '=';
|
625 |
+
}
|
626 |
+
|
627 |
+
return $this->whereHandler($key, $operator, $value);
|
628 |
+
}
|
629 |
+
|
630 |
+
/**
|
631 |
+
* @param $key
|
632 |
+
* @param $operator
|
633 |
+
* @param $value
|
634 |
+
*
|
635 |
+
* @return $this
|
636 |
+
*/
|
637 |
+
public function orWhere($key, $operator = null, $value = null)
|
638 |
+
{
|
639 |
+
// If two params are given then assume operator is =
|
640 |
+
if (func_num_args() == 2) {
|
641 |
+
$value = $operator;
|
642 |
+
$operator = '=';
|
643 |
+
}
|
644 |
+
|
645 |
+
return $this->whereHandler($key, $operator, $value, 'OR');
|
646 |
+
}
|
647 |
+
|
648 |
+
/**
|
649 |
+
* @param $key
|
650 |
+
* @param $operator
|
651 |
+
* @param $value
|
652 |
+
*
|
653 |
+
* @return $this
|
654 |
+
*/
|
655 |
+
public function whereNot($key, $operator = null, $value = null)
|
656 |
+
{
|
657 |
+
// If two params are given then assume operator is =
|
658 |
+
if (func_num_args() == 2) {
|
659 |
+
$value = $operator;
|
660 |
+
$operator = '=';
|
661 |
+
}
|
662 |
+
|
663 |
+
return $this->whereHandler($key, $operator, $value, 'AND NOT');
|
664 |
+
}
|
665 |
+
|
666 |
+
/**
|
667 |
+
* @param $key
|
668 |
+
* @param $operator
|
669 |
+
* @param $value
|
670 |
+
*
|
671 |
+
* @return $this
|
672 |
+
*/
|
673 |
+
public function orWhereNot($key, $operator = null, $value = null)
|
674 |
+
{
|
675 |
+
// If two params are given then assume operator is =
|
676 |
+
if (func_num_args() == 2) {
|
677 |
+
$value = $operator;
|
678 |
+
$operator = '=';
|
679 |
+
}
|
680 |
+
|
681 |
+
return $this->whereHandler($key, $operator, $value, 'OR NOT');
|
682 |
+
}
|
683 |
+
|
684 |
+
/**
|
685 |
+
* @param $key
|
686 |
+
* @param array $values
|
687 |
+
*
|
688 |
+
* @return $this
|
689 |
+
*/
|
690 |
+
public function whereIn($key, $values)
|
691 |
+
{
|
692 |
+
return $this->whereHandler($key, 'IN', $values, 'AND');
|
693 |
+
}
|
694 |
+
|
695 |
+
/**
|
696 |
+
* @param $key
|
697 |
+
* @param array $values
|
698 |
+
*
|
699 |
+
* @return $this
|
700 |
+
*/
|
701 |
+
public function whereNotIn($key, $values)
|
702 |
+
{
|
703 |
+
return $this->whereHandler($key, 'NOT IN', $values, 'AND');
|
704 |
+
}
|
705 |
+
|
706 |
+
/**
|
707 |
+
* @param $key
|
708 |
+
* @param array $values
|
709 |
+
*
|
710 |
+
* @return $this
|
711 |
+
*/
|
712 |
+
public function orWhereIn($key, $values)
|
713 |
+
{
|
714 |
+
return $this->whereHandler($key, 'IN', $values, 'OR');
|
715 |
+
}
|
716 |
+
|
717 |
+
/**
|
718 |
+
* @param $key
|
719 |
+
* @param array $values
|
720 |
+
*
|
721 |
+
* @return $this
|
722 |
+
*/
|
723 |
+
public function orWhereNotIn($key, $values)
|
724 |
+
{
|
725 |
+
return $this->whereHandler($key, 'NOT IN', $values, 'OR');
|
726 |
+
}
|
727 |
+
|
728 |
+
/**
|
729 |
+
* @param $key
|
730 |
+
* @param $valueFrom
|
731 |
+
* @param $valueTo
|
732 |
+
*
|
733 |
+
* @return $this
|
734 |
+
*/
|
735 |
+
public function whereBetween($key, $valueFrom, $valueTo)
|
736 |
+
{
|
737 |
+
return $this->whereHandler($key, 'BETWEEN', array($valueFrom, $valueTo), 'AND');
|
738 |
+
}
|
739 |
+
|
740 |
+
/**
|
741 |
+
* @param $key
|
742 |
+
* @param $valueFrom
|
743 |
+
* @param $valueTo
|
744 |
+
*
|
745 |
+
* @return $this
|
746 |
+
*/
|
747 |
+
public function orWhereBetween($key, $valueFrom, $valueTo)
|
748 |
+
{
|
749 |
+
return $this->whereHandler($key, 'BETWEEN', array($valueFrom, $valueTo), 'OR');
|
750 |
+
}
|
751 |
+
|
752 |
+
/**
|
753 |
+
* @param $key
|
754 |
+
* @return QueryBuilderHandler
|
755 |
+
*/
|
756 |
+
public function whereNull($key)
|
757 |
+
{
|
758 |
+
return $this->whereNullHandler($key);
|
759 |
+
}
|
760 |
+
|
761 |
+
/**
|
762 |
+
* @param $key
|
763 |
+
* @return QueryBuilderHandler
|
764 |
+
*/
|
765 |
+
public function whereNotNull($key)
|
766 |
+
{
|
767 |
+
return $this->whereNullHandler($key, 'NOT');
|
768 |
+
}
|
769 |
+
|
770 |
+
/**
|
771 |
+
* @param $key
|
772 |
+
* @return QueryBuilderHandler
|
773 |
+
*/
|
774 |
+
public function orWhereNull($key)
|
775 |
+
{
|
776 |
+
return $this->whereNullHandler($key, '', 'or');
|
777 |
+
}
|
778 |
+
|
779 |
+
/**
|
780 |
+
* @param $key
|
781 |
+
* @return QueryBuilderHandler
|
782 |
+
*/
|
783 |
+
public function orWhereNotNull($key)
|
784 |
+
{
|
785 |
+
return $this->whereNullHandler($key, 'NOT', 'or');
|
786 |
+
}
|
787 |
+
|
788 |
+
protected function whereNullHandler($key, $prefix = '', $operator = '')
|
789 |
+
{
|
790 |
+
$key = $this->adapterInstance->wrapSanitizer($this->addTablePrefix($key));
|
791 |
+
|
792 |
+
return $this->{$operator . 'Where'}($this->raw("{$key} IS {$prefix} NULL"));
|
793 |
+
}
|
794 |
+
|
795 |
+
/**
|
796 |
+
* @param $table
|
797 |
+
* @param $key
|
798 |
+
* @param $operator
|
799 |
+
* @param $value
|
800 |
+
* @param string $type
|
801 |
+
*
|
802 |
+
* @return $this
|
803 |
+
*/
|
804 |
+
public function join($table, $key, $operator = null, $value = null, $type = 'inner')
|
805 |
+
{
|
806 |
+
if (! $key instanceof \Closure) {
|
807 |
+
$key = function ($joinBuilder) use ($key, $operator, $value) {
|
808 |
+
$joinBuilder->on($key, $operator, $value);
|
809 |
+
};
|
810 |
+
}
|
811 |
+
|
812 |
+
// Build a new JoinBuilder class, keep it by reference so any changes made
|
813 |
+
// in the closure should reflect here
|
814 |
+
$joinBuilder = $this->container->build('\\WpFluent\\QueryBuilder\\JoinBuilder', array($this->connection));
|
815 |
+
$joinBuilder = & $joinBuilder;
|
816 |
+
// Call the closure with our new joinBuilder object
|
817 |
+
$key($joinBuilder);
|
818 |
+
$table = $this->addTablePrefix($table, false);
|
819 |
+
// Get the criteria only query from the joinBuilder object
|
820 |
+
$this->statements['joins'][] = compact('type', 'table', 'joinBuilder');
|
821 |
+
|
822 |
+
return $this;
|
823 |
+
}
|
824 |
+
|
825 |
+
/**
|
826 |
+
* Runs a transaction
|
827 |
+
*
|
828 |
+
* @param $callback
|
829 |
+
*
|
830 |
+
* @return $this
|
831 |
+
*/
|
832 |
+
public function transaction(\Closure $callback)
|
833 |
+
{
|
834 |
+
try {
|
835 |
+
// Begin the PDO transaction
|
836 |
+
$this->db->query('START TRANSACTION');
|
837 |
+
|
838 |
+
// Get the Transaction class
|
839 |
+
$transaction = $this->container->build(
|
840 |
+
'\\WpFluent\\QueryBuilder\\Transaction',
|
841 |
+
array($this->connection)
|
842 |
+
);
|
843 |
+
|
844 |
+
// Call closure
|
845 |
+
$callback($transaction);
|
846 |
+
|
847 |
+
// If no errors have been thrown or the transaction wasn't completed within
|
848 |
+
// the closure, commit the changes
|
849 |
+
$this->db->query('COMMIT');
|
850 |
+
|
851 |
+
return $this;
|
852 |
+
} catch (TransactionHaltException $e) {
|
853 |
+
// Commit or rollback behavior has been handled in the closure, so exit
|
854 |
+
return $this;
|
855 |
+
} catch (\Exception $e) {
|
856 |
+
// something happened, rollback changes
|
857 |
+
$this->db->query('ROLLBACK');
|
858 |
+
|
859 |
+
return $this;
|
860 |
+
}
|
861 |
+
}
|
862 |
+
|
863 |
+
/**
|
864 |
+
* @param $table
|
865 |
+
* @param $key
|
866 |
+
* @param null $operator
|
867 |
+
* @param null $value
|
868 |
+
*
|
869 |
+
* @return $this
|
870 |
+
*/
|
871 |
+
public function leftJoin($table, $key, $operator = null, $value = null)
|
872 |
+
{
|
873 |
+
return $this->join($table, $key, $operator, $value, 'left');
|
874 |
+
}
|
875 |
+
|
876 |
+
/**
|
877 |
+
* @param $table
|
878 |
+
* @param $key
|
879 |
+
* @param null $operator
|
880 |
+
* @param null $value
|
881 |
+
*
|
882 |
+
* @return $this
|
883 |
+
*/
|
884 |
+
public function rightJoin($table, $key, $operator = null, $value = null)
|
885 |
+
{
|
886 |
+
return $this->join($table, $key, $operator, $value, 'right');
|
887 |
+
}
|
888 |
+
|
889 |
+
/**
|
890 |
+
* @param $table
|
891 |
+
* @param $key
|
892 |
+
* @param null $operator
|
893 |
+
* @param null $value
|
894 |
+
*
|
895 |
+
* @return $this
|
896 |
+
*/
|
897 |
+
public function innerJoin($table, $key, $operator = null, $value = null)
|
898 |
+
{
|
899 |
+
return $this->join($table, $key, $operator, $value, 'inner');
|
900 |
+
}
|
901 |
+
|
902 |
+
/**
|
903 |
+
* Add a raw query
|
904 |
+
*
|
905 |
+
* @param $value
|
906 |
+
* @param $bindings
|
907 |
+
*
|
908 |
+
* @return mixed
|
909 |
+
*/
|
910 |
+
public function raw($value, $bindings = array())
|
911 |
+
{
|
912 |
+
return $this->container->build('\\WpFluent\\QueryBuilder\\Raw', array($value, $bindings));
|
913 |
+
}
|
914 |
+
|
915 |
+
/**
|
916 |
+
* Return db instance
|
917 |
+
*
|
918 |
+
* @return \wpdb
|
919 |
+
*/
|
920 |
+
public function db()
|
921 |
+
{
|
922 |
+
return $this->db;
|
923 |
+
}
|
924 |
+
|
925 |
+
/**
|
926 |
+
* @param Connection $connection
|
927 |
+
*
|
928 |
+
* @return $this
|
929 |
+
*/
|
930 |
+
public function setConnection(Connection $connection)
|
931 |
+
{
|
932 |
+
$this->connection = $connection;
|
933 |
+
|
934 |
+
return $this;
|
935 |
+
}
|
936 |
+
|
937 |
+
/**
|
938 |
+
* @return Connection
|
939 |
+
*/
|
940 |
+
public function getConnection()
|
941 |
+
{
|
942 |
+
return $this->connection;
|
943 |
+
}
|
944 |
+
|
945 |
+
/**
|
946 |
+
* @param $key
|
947 |
+
* @param $operator
|
948 |
+
* @param $value
|
949 |
+
* @param string $joiner
|
950 |
+
*
|
951 |
+
* @return $this
|
952 |
+
*/
|
953 |
+
protected function whereHandler($key, $operator = null, $value = null, $joiner = 'AND')
|
954 |
+
{
|
955 |
+
$key = $this->addTablePrefix($key);
|
956 |
+
$this->statements['wheres'][] = compact('key', 'operator', 'value', 'joiner');
|
957 |
+
|
958 |
+
return $this;
|
959 |
+
}
|
960 |
+
|
961 |
+
/**
|
962 |
+
* Add table prefix (if given) on given string.
|
963 |
+
*
|
964 |
+
* @param $values
|
965 |
+
* @param bool $tableFieldMix If we have mixes of field and table names with a "."
|
966 |
+
*
|
967 |
+
* @return array|mixed
|
968 |
+
*/
|
969 |
+
public function addTablePrefix($values, $tableFieldMix = true)
|
970 |
+
{
|
971 |
+
if (is_null($this->tablePrefix)) {
|
972 |
+
return $values;
|
973 |
+
}
|
974 |
+
|
975 |
+
// $value will be an array and we will add prefix to all table names
|
976 |
+
|
977 |
+
// If supplied value is not an array then make it one
|
978 |
+
$single = false;
|
979 |
+
|
980 |
+
if (! is_array($values)) {
|
981 |
+
$values = array($values);
|
982 |
+
// We had single value, so should return a single value
|
983 |
+
$single = true;
|
984 |
+
}
|
985 |
+
|
986 |
+
$return = array();
|
987 |
+
|
988 |
+
foreach ($values as $key => $value) {
|
989 |
+
// It's a raw query, just add it to our return array and continue next
|
990 |
+
if ($value instanceof Raw || $value instanceof \Closure) {
|
991 |
+
$return[$key] = $value;
|
992 |
+
continue;
|
993 |
+
}
|
994 |
+
|
995 |
+
// If key is not integer, it is likely a alias mapping,
|
996 |
+
// so we need to change prefix target
|
997 |
+
$target = &$value;
|
998 |
+
if (! is_int($key)) {
|
999 |
+
$target = &$key;
|
1000 |
+
}
|
1001 |
+
|
1002 |
+
if (! $tableFieldMix || ($tableFieldMix && strpos($target, '.') !== false)) {
|
1003 |
+
$target = $this->tablePrefix . $target;
|
1004 |
+
}
|
1005 |
+
|
1006 |
+
$return[$key] = $value;
|
1007 |
+
}
|
1008 |
+
|
1009 |
+
// If we had single value then we should return a single value (end value of the array)
|
1010 |
+
return $single ? end($return) : $return;
|
1011 |
+
}
|
1012 |
+
|
1013 |
+
/**
|
1014 |
+
* @param $key
|
1015 |
+
* @param $value
|
1016 |
+
*/
|
1017 |
+
protected function addStatement($key, $value)
|
1018 |
+
{
|
1019 |
+
if (! is_array($value)) {
|
1020 |
+
$value = array($value);
|
1021 |
+
}
|
1022 |
+
|
1023 |
+
if (! array_key_exists($key, $this->statements)) {
|
1024 |
+
$this->statements[$key] = $value;
|
1025 |
+
} else {
|
1026 |
+
$this->statements[$key] = array_merge($this->statements[$key], $value);
|
1027 |
+
}
|
1028 |
+
}
|
1029 |
+
|
1030 |
+
/**
|
1031 |
+
* @param $event
|
1032 |
+
* @param $table
|
1033 |
+
*
|
1034 |
+
* @return callable|null
|
1035 |
+
*/
|
1036 |
+
public function getEvent($event, $table = ':any')
|
1037 |
+
{
|
1038 |
+
return $this->connection->getEventHandler()->getEvent($event, $table);
|
1039 |
+
}
|
1040 |
+
|
1041 |
+
/**
|
1042 |
+
* @param $event
|
1043 |
+
* @param string $table
|
1044 |
+
* @param callable $action
|
1045 |
+
*
|
1046 |
+
* @return void
|
1047 |
+
*/
|
1048 |
+
public function registerEvent($event, $table, \Closure $action)
|
1049 |
+
{
|
1050 |
+
$table = $table ?: ':any';
|
1051 |
+
|
1052 |
+
if ($table != ':any') {
|
1053 |
+
$table = $this->addTablePrefix($table, false);
|
1054 |
+
}
|
1055 |
+
|
1056 |
+
$this->connection->getEventHandler()->registerEvent($event, $table, $action);
|
1057 |
+
}
|
1058 |
+
|
1059 |
+
/**
|
1060 |
+
* @param $event
|
1061 |
+
* @param string $table
|
1062 |
+
*
|
1063 |
+
* @return void
|
1064 |
+
*/
|
1065 |
+
public function removeEvent($event, $table = ':any')
|
1066 |
+
{
|
1067 |
+
if ($table != ':any') {
|
1068 |
+
$table = $this->addTablePrefix($table, false);
|
1069 |
+
}
|
1070 |
+
|
1071 |
+
$this->connection->getEventHandler()->removeEvent($event, $table);
|
1072 |
+
}
|
1073 |
+
|
1074 |
+
/**
|
1075 |
+
* @param $event
|
1076 |
+
* @return mixed
|
1077 |
+
*/
|
1078 |
+
public function fireEvents($event)
|
1079 |
+
{
|
1080 |
+
$params = func_get_args();
|
1081 |
+
array_unshift($params, $this);
|
1082 |
+
|
1083 |
+
return call_user_func_array(
|
1084 |
+
array($this->connection->getEventHandler(), 'fireEvents'),
|
1085 |
+
$params
|
1086 |
+
);
|
1087 |
+
}
|
1088 |
+
|
1089 |
+
/**
|
1090 |
+
* @return array
|
1091 |
+
*/
|
1092 |
+
public function getStatements()
|
1093 |
+
{
|
1094 |
+
return $this->statements;
|
1095 |
+
}
|
1096 |
+
|
1097 |
+
/**
|
1098 |
+
* Get the paginated rows.
|
1099 |
+
*
|
1100 |
+
* @param null $perPage
|
1101 |
+
* @param array $columns
|
1102 |
+
*
|
1103 |
+
* @return array
|
1104 |
+
*/
|
1105 |
+
public function paginate($perPage = null, $columns = array('*'))
|
1106 |
+
{
|
1107 |
+
$currentPage = intval($_GET['page']) ?: 1;
|
1108 |
+
|
1109 |
+
$perPage = $perPage ?: intval($_REQUEST['per_page']) ?: 15;
|
1110 |
+
|
1111 |
+
$skip = $perPage * ($currentPage - 1);
|
1112 |
+
|
1113 |
+
$data = (array) $this->select($columns)->limit($perPage)->offset($skip)->get();
|
1114 |
+
|
1115 |
+
$dataCount = count($data);
|
1116 |
+
|
1117 |
+
$from = $dataCount > 0 ? ($currentPage - 1) * $perPage + 1 : null;
|
1118 |
+
|
1119 |
+
$to = $dataCount > 0 ? $from + $dataCount - 1 : null;
|
1120 |
+
|
1121 |
+
$total = $this->count();
|
1122 |
+
|
1123 |
+
$lastPage = (int) ceil($total / $perPage);
|
1124 |
+
|
1125 |
+
return array(
|
1126 |
+
'current_page' => $currentPage,
|
1127 |
+
'per_page' => $perPage,
|
1128 |
+
'from' => $from,
|
1129 |
+
'to' => $to,
|
1130 |
+
'last_page' => $lastPage,
|
1131 |
+
'total' => $total,
|
1132 |
+
'data' => $data,
|
1133 |
+
);
|
1134 |
+
}
|
1135 |
+
}
|
app/Services/wpfluent/src/QueryBuilder/QueryObject.php
ADDED
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WpFluent\QueryBuilder;
|
4 |
+
|
5 |
+
class QueryObject
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* @var string
|
9 |
+
*/
|
10 |
+
protected $sql;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @var \wpdb
|
14 |
+
*/
|
15 |
+
protected $db;
|
16 |
+
|
17 |
+
/**
|
18 |
+
* @var array
|
19 |
+
*/
|
20 |
+
protected $bindings = array();
|
21 |
+
|
22 |
+
public function __construct($sql, array $bindings)
|
23 |
+
{
|
24 |
+
$this->sql = (string) $sql;
|
25 |
+
|
26 |
+
$this->bindings = $bindings;
|
27 |
+
|
28 |
+
global $wpdb;
|
29 |
+
|
30 |
+
$this->db = $wpdb;
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @return string
|
35 |
+
*/
|
36 |
+
public function getSql()
|
37 |
+
{
|
38 |
+
return $this->sql;
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* @return array
|
43 |
+
*/
|
44 |
+
public function getBindings()
|
45 |
+
{
|
46 |
+
return $this->bindings;
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Get the raw/bound sql
|
51 |
+
*
|
52 |
+
* @return string
|
53 |
+
*/
|
54 |
+
public function getRawSql()
|
55 |
+
{
|
56 |
+
return $this->interpolateQuery($this->sql, $this->bindings);
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Replaces any parameter placeholders in a query with the value of that
|
61 |
+
* parameter. Useful for debugging. Assumes anonymous parameters from
|
62 |
+
* $params are are in the same order as specified in $query
|
63 |
+
*
|
64 |
+
* Reference: http://stackoverflow.com/a/1376838/656489
|
65 |
+
*
|
66 |
+
* @param string $query The sql query with parameter placeholders
|
67 |
+
* @param array $params The array of substitution parameters
|
68 |
+
*
|
69 |
+
* @return string The interpolated query
|
70 |
+
*/
|
71 |
+
protected function interpolateQuery($query, $params)
|
72 |
+
{
|
73 |
+
$keys = $placeHolders = [];
|
74 |
+
|
75 |
+
foreach ($params as $key => $value) {
|
76 |
+
if (is_string($key)) {
|
77 |
+
$keys[] = '/:' . $key . '/';
|
78 |
+
} else {
|
79 |
+
$keys[] = '/[?]/';
|
80 |
+
}
|
81 |
+
|
82 |
+
$placeHolders[] = $this->getPlaceHolder($value);
|
83 |
+
}
|
84 |
+
|
85 |
+
$query = preg_replace($keys, $placeHolders, $query, 1, $count);
|
86 |
+
|
87 |
+
return $params ? $this->db->prepare($query, $params) : $query;
|
88 |
+
}
|
89 |
+
|
90 |
+
private function getPlaceHolder($value)
|
91 |
+
{
|
92 |
+
$placeHolder = '%s';
|
93 |
+
|
94 |
+
if (is_int($value)) {
|
95 |
+
$placeHolder = '%d';
|
96 |
+
} elseif (is_float($value)) {
|
97 |
+
$placeHolder = '%f';
|
98 |
+
}
|
99 |
+
|
100 |
+
return $placeHolder;
|
101 |
+
}
|
102 |
+
}
|
app/Services/wpfluent/src/QueryBuilder/Raw.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php namespace WpFluent\QueryBuilder;
|
2 |
+
|
3 |
+
class Raw
|
4 |
+
{
|
5 |
+
|
6 |
+
/**
|
7 |
+
* @var string
|
8 |
+
*/
|
9 |
+
protected $value;
|
10 |
+
|
11 |
+
/**
|
12 |
+
* @var array
|
13 |
+
*/
|
14 |
+
protected $bindings;
|
15 |
+
|
16 |
+
public function __construct($value, $bindings = array())
|
17 |
+
{
|
18 |
+
$this->value = (string)$value;
|
19 |
+
$this->bindings = (array)$bindings;
|
20 |
+
}
|
21 |
+
|
22 |
+
public function getBindings()
|
23 |
+
{
|
24 |
+
return $this->bindings;
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* @return string
|
29 |
+
*/
|
30 |
+
public function __toString()
|
31 |
+
{
|
32 |
+
return (string) $this->value;
|
33 |
+
}
|
34 |
+
}
|
app/Services/wpfluent/src/QueryBuilder/Transaction.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WpFluent\QueryBuilder;
|
4 |
+
|
5 |
+
class Transaction extends QueryBuilderHandler
|
6 |
+
{
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Commit the database changes
|
10 |
+
*/
|
11 |
+
public function commit()
|
12 |
+
{
|
13 |
+
$this->db->query('COMMIT');
|
14 |
+
|
15 |
+
throw new TransactionHaltException();
|
16 |
+
}
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Rollback the database changes
|
20 |
+
*/
|
21 |
+
public function rollback()
|
22 |
+
{
|
23 |
+
$this->db->query('ROLLBACK');
|
24 |
+
|
25 |
+
throw new TransactionHaltException();
|
26 |
+
}
|
27 |
+
}
|
app/Services/wpfluent/src/QueryBuilder/TransactionHaltException.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WpFluent\QueryBuilder;
|
4 |
+
|
5 |
+
class TransactionHaltException extends \Exception
|
6 |
+
{
|
7 |
+
}
|
app/Services/wpfluent/wpfluent.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php defined('ABSPATH') or die;
|
2 |
+
|
3 |
+
/*
|
4 |
+
Plugin Name: Wp Fluent
|
5 |
+
Description: Wp Fluent WordPress Plugin
|
6 |
+
Version: 1.0.0
|
7 |
+
Author:
|
8 |
+
Author URI:
|
9 |
+
Plugin URI:
|
10 |
+
License: GPLv2 or later
|
11 |
+
Text Domain: wpfluent
|
12 |
+
Domain Path: /resources/languages
|
13 |
+
*/
|
14 |
+
|
15 |
+
// Autoload plugin.
|
16 |
+
require 'autoload.php';
|
17 |
+
|
18 |
+
if (! function_exists('wpFluent')) {
|
19 |
+
/**
|
20 |
+
* @return \WpFluent\QueryBuilder\QueryBuilderHandler
|
21 |
+
*/
|
22 |
+
function wpFluent()
|
23 |
+
{
|
24 |
+
static $wpFluent;
|
25 |
+
|
26 |
+
if (! $wpFluent) {
|
27 |
+
global $wpdb;
|
28 |
+
|
29 |
+
$connection = new WpFluent\Connection($wpdb, ['prefix' => $wpdb->prefix]);
|
30 |
+
|
31 |
+
$wpFluent = new \WpFluent\QueryBuilder\QueryBuilderHandler($connection);
|
32 |
+
}
|
33 |
+
|
34 |
+
return $wpFluent;
|
35 |
+
}
|
36 |
+
}
|
app/index.php
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// silence is golden
|
config/app.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
return array(
|
4 |
+
'env' => 'production',
|
5 |
+
'providers' => array(
|
6 |
+
'core' => array(
|
7 |
+
'FluentForm\Framework\Foundation\AppProvider',
|
8 |
+
'FluentForm\Framework\Config\ConfigProvider',
|
9 |
+
'FluentForm\Framework\Request\RequestProvider',
|
10 |
+
'FluentForm\Framework\View\ViewProvider',
|
11 |
+
),
|
12 |
+
|
13 |
+
'plugin' => array(
|
14 |
+
'common' => array(
|
15 |
+
'FluentForm\App\Providers\CommonProvider',
|
16 |
+
'FluentForm\App\Providers\FormBuilderProvider',
|
17 |
+
'FluentForm\App\Providers\WpFluentProvider',
|
18 |
+
),
|
19 |
+
|
20 |
+
'backend' => array(
|
21 |
+
'FluentForm\App\Providers\BackendProvider',
|
22 |
+
'FluentForm\App\Providers\MenuProvider',
|
23 |
+
'FluentForm\App\Providers\FluentValidatorProvider',
|
24 |
+
'FluentForm\App\Providers\CsvProvider',
|
25 |
+
),
|
26 |
+
|
27 |
+
'frontend' => array(
|
28 |
+
'FluentForm\App\Providers\FrontendProvider',
|
29 |
+
),
|
30 |
+
),
|
31 |
+
),
|
32 |
+
);
|
config/fluentform.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
return array(
|
4 |
+
'db_version' => '1.0',
|
5 |
+
|
6 |
+
'db_tables' => array(
|
7 |
+
'forms' => 'fluentform_forms',
|
8 |
+
'form_meta' => 'fluentform_form_meta',
|
9 |
+
'submissions' => 'fluentform_submissions',
|
10 |
+
'submission_meta' => 'fluentform_submission_meta',
|
11 |
+
'transactions' => 'fluentform_transactions'
|
12 |
+
),
|
13 |
+
|
14 |
+
'components' => array(
|
15 |
+
'general' => array(
|
16 |
+
'input_text' => array(
|
17 |
+
'index' => 2,
|
18 |
+
'element' => 'input_text'
|
19 |
+
),
|
20 |
+
'input_textarea' => array(
|
21 |
+
'index' => 1,
|
22 |
+
'element' => 'input_textarea'
|
23 |
+
)
|
24 |
+
),
|
25 |
+
'advanced' => array(
|
26 |
+
'advanced_input_text' => array(
|
27 |
+
'index' => 2,
|
28 |
+
'element' => 'input_text'
|
29 |
+
),
|
30 |
+
'advanced_input_textarea' => array(
|
31 |
+
'index' => 1,
|
32 |
+
'element' => 'input_textarea'
|
33 |
+
)
|
34 |
+
),
|
35 |
+
),
|
36 |
+
);
|
config/index.php
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// silence is golden
|
fluentform.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: FluentForm
|
4 |
+
Description: The most advanced drag and drop form builder plugin for WordPress.
|
5 |
+
Version: 1.1.1
|
6 |
+
Author: WPFluentForm
|
7 |
+
Author URI: https://wpfluentform.com
|
8 |
+
Plugin URI: https://wpfluentform.com/
|
9 |
+
License: GPLv2 or later
|
10 |
+
Text Domain: fluentform
|
11 |
+
Domain Path: /resources/languages
|
12 |
+
*/
|
13 |
+
|
14 |
+
defined('ABSPATH') or die;
|
15 |
+
|
16 |
+
include "framework/Foundation/Bootstrap.php";
|
17 |
+
|
18 |
+
use FluentForm\Framework\Foundation\Bootstrap;
|
19 |
+
|
20 |
+
Bootstrap::run(__FILE__);
|
framework/Config/Config.php
ADDED
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\Framework\Config;
|
4 |
+
|
5 |
+
use FluentForm\Framework\Helpers\ArrayHelper;
|
6 |
+
|
7 |
+
class Config implements \ArrayAccess
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* All array items from all files from /config directory
|
11 |
+
* @var array
|
12 |
+
*/
|
13 |
+
protected $repository = array();
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Initiate the instance
|
17 |
+
* @param array $repository
|
18 |
+
*/
|
19 |
+
public function __construct($repository = array())
|
20 |
+
{
|
21 |
+
$this->repository = $repository;
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Determine if the given configuration value exists.
|
26 |
+
*
|
27 |
+
* @param string $key
|
28 |
+
* @return bool
|
29 |
+
*/
|
30 |
+
public function has($key)
|
31 |
+
{
|
32 |
+
return ArrayHelper::has($this->repository, $key);
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Get all of the configuration items for the application.
|
37 |
+
*
|
38 |
+
* @return array
|
39 |
+
*/
|
40 |
+
public function all()
|
41 |
+
{
|
42 |
+
return $this->repository;
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Get the specified configuration value.
|
47 |
+
*
|
48 |
+
* @param array|string $key
|
49 |
+
* @param mixed $default
|
50 |
+
* @return mixed
|
51 |
+
*/
|
52 |
+
public function get($key = null, $default = null)
|
53 |
+
{
|
54 |
+
return ArrayHelper::get($this->repository, $key, $default);
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Set a given configuration value.
|
59 |
+
*
|
60 |
+
* @param array|string $key
|
61 |
+
* @param mixed $value
|
62 |
+
* @return void
|
63 |
+
*/
|
64 |
+
public function set($key, $value)
|
65 |
+
{
|
66 |
+
$keys = is_array($key) ? $key : [$key => $value];
|
67 |
+
|
68 |
+
foreach ($keys as $key => $value) {
|
69 |
+
return ArrayHelper::set($this->repository, $key, $value);
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Dynamic Getter
|
75 |
+
* @param string $key
|
76 |
+
* @return mixed
|
77 |
+
*/
|
78 |
+
public function __get($key = null)
|
79 |
+
{
|
80 |
+
return $this->get($key);
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Dynamic Setter
|
85 |
+
* @param string $key
|
86 |
+
* @param mixed $key
|
87 |
+
* @return void
|
88 |
+
*/
|
89 |
+
public function __set($key, $value)
|
90 |
+
{
|
91 |
+
return $this->set($key, $value);
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Determine if the given item exists.
|
96 |
+
*
|
97 |
+
* @param string $key
|
98 |
+
* @return bool
|
99 |
+
*/
|
100 |
+
public function offsetExists($key)
|
101 |
+
{
|
102 |
+
return $this->has($key);
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Get an item.
|
107 |
+
*
|
108 |
+
* @param string $key
|
109 |
+
* @return mixed
|
110 |
+
*/
|
111 |
+
public function offsetGet($key)
|
112 |
+
{
|
113 |
+
return $this->get($key);
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Set an item.
|
118 |
+
*
|
119 |
+
* @param string $key
|
120 |
+
* @param mixed $value
|
121 |
+
* @return void
|
122 |
+
*/
|
123 |
+
public function offsetSet($key, $value)
|
124 |
+
{
|
125 |
+
$this->set($key, $value);
|
126 |
+
}
|
127 |
+
|
128 |
+
/**
|
129 |
+
* Unset an item.
|
130 |
+
*
|
131 |
+
* @param string $key
|
132 |
+
* @return void
|
133 |
+
*/
|
134 |
+
public function offsetUnset($key)
|
135 |
+
{
|
136 |
+
$this->set($key, null);
|
137 |
+
}
|
138 |
+
}
|
framework/Config/ConfigProvider.php
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\Framework\Config;
|
4 |
+
|
5 |
+
use RecursiveIteratorIterator;
|
6 |
+
use RecursiveDirectoryIterator;
|
7 |
+
use FluentForm\Framework\Foundation\Provider;
|
8 |
+
|
9 |
+
class ConfigProvider extends Provider
|
10 |
+
{
|
11 |
+
/**
|
12 |
+
* The provider booting method to boot this provider
|
13 |
+
* @return void
|
14 |
+
*/
|
15 |
+
public function booting()
|
16 |
+
{
|
17 |
+
$config = new Config(array('app' => $this->app->getAppConfig()));
|
18 |
+
|
19 |
+
$this->app->bindInstance(
|
20 |
+
'config', $config, 'Config', 'FluentForm\Framework\Config\Config'
|
21 |
+
);
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* The provider booted method to be called after booting
|
26 |
+
* @return void
|
27 |
+
*/
|
28 |
+
public function booted()
|
29 |
+
{
|
30 |
+
$this->loadConfig();
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Loads all configuration files from config directory
|
35 |
+
* @return void
|
36 |
+
*/
|
37 |
+
public function loadConfig()
|
38 |
+
{
|
39 |
+
$files = [];
|
40 |
+
$configPath = $this->app->configPath();
|
41 |
+
$itr = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(
|
42 |
+
$configPath, RecursiveDirectoryIterator::SKIP_DOTS
|
43 |
+
));
|
44 |
+
|
45 |
+
foreach($itr as $file) {
|
46 |
+
if (pathinfo($file, PATHINFO_EXTENSION) == "php" && $file->getFileName() != 'app.php') {
|
47 |
+
$fileRealPath = $file->getRealPath();
|
48 |
+
$directory = $this->getDirectory($file, $configPath);
|
49 |
+
$this->app->config->set($directory.basename($fileRealPath, '.php'), include $fileRealPath);
|
50 |
+
}
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Get nested directory names joined by a "."
|
56 |
+
* @param string $file [A config file]
|
57 |
+
* @param string $configPath
|
58 |
+
* @return string
|
59 |
+
*/
|
60 |
+
protected function getDirectory($file, $configPath)
|
61 |
+
{
|
62 |
+
$ds = DIRECTORY_SEPARATOR;
|
63 |
+
|
64 |
+
if ($directory = trim(str_replace(trim($configPath, '/'), '', $file->getPath()), $ds)) {
|
65 |
+
$directory = str_replace($ds, '.', $directory).'.';
|
66 |
+
}
|
67 |
+
|
68 |
+
return $directory;
|
69 |
+
}
|
70 |
+
}
|
framework/Exception/ExceptionHandler.php
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\Framework\Exception;
|
4 |
+
|
5 |
+
class ExceptionHandler
|
6 |
+
{
|
7 |
+
const APPEND_TO_LOG_FILE = 3;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* framework\App\Application
|
11 |
+
* @var Object
|
12 |
+
*/
|
13 |
+
protected $app = null;
|
14 |
+
|
15 |
+
public function __construct($app)
|
16 |
+
{
|
17 |
+
$this->app = $app;
|
18 |
+
$this->registerHandlers();
|
19 |
+
}
|
20 |
+
|
21 |
+
public function registerHandlers()
|
22 |
+
{
|
23 |
+
error_reporting(-1);
|
24 |
+
set_error_handler([$this, 'handleError']);
|
25 |
+
set_exception_handler([$this, 'handleException']);
|
26 |
+
register_shutdown_function([$this, 'handleShutdown']);
|
27 |
+
}
|
28 |
+
|
29 |
+
public function handleError($severity, $message, $file = '', $line = 0)
|
30 |
+
{
|
31 |
+
if (error_reporting() & $severity) {
|
32 |
+
throw new \ErrorException($message, 0, $severity, $file, $line);
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
36 |
+
public function handleException($e)
|
37 |
+
{
|
38 |
+
try {
|
39 |
+
$this->report($e);
|
40 |
+
$this->render($e);
|
41 |
+
} catch (\Exception $e) {
|
42 |
+
die($e->getMessage().' : '.$e->getFile().' ('.$e->getLine().')');
|
43 |
+
}
|
44 |
+
}
|
45 |
+
|
46 |
+
public function handleShutdown()
|
47 |
+
{
|
48 |
+
if (!is_null($error = error_get_last()) && $this->isFatal($error['type'])) {
|
49 |
+
$this->handleException(new \ErrorException(
|
50 |
+
$error['message'], 0, $error['type'], $error['file'], $error['line']
|
51 |
+
));
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
public function report($e)
|
56 |
+
{
|
57 |
+
$logDir = $this->app->storagePath('logs');
|
58 |
+
if (!is_readable($logDir)) {
|
59 |
+
mkdir($logDir, 0777);
|
60 |
+
}
|
61 |
+
|
62 |
+
error_log(
|
63 |
+
'['.date('Y-m-d H:i:s').'] '.(string) $e,
|
64 |
+
self::APPEND_TO_LOG_FILE,
|
65 |
+
$logDir.'/error.log'
|
66 |
+
);
|
67 |
+
}
|
68 |
+
|
69 |
+
public function render($e)
|
70 |
+
{
|
71 |
+
echo get_class($e) .' : '. $e->getMessage() . ' in ' . $e->getFile() . ' (' . $e->getLine() . ')';
|
72 |
+
echo '<br><pre>' . str_replace("\n", '<br>', $e->getTraceAsString()) . '</pre>';
|
73 |
+
}
|
74 |
+
|
75 |
+
protected function isFatal($type)
|
76 |
+
{
|
77 |
+
return in_array($type, [E_COMPILE_ERROR, E_CORE_ERROR, E_ERROR, E_PARSE]);
|
78 |
+
}
|
79 |
+
}
|
framework/Exception/UnResolveableEntityException.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\Framework\Exception;
|
4 |
+
|
5 |
+
class UnResolveableEntityException extends \Exception
|
6 |
+
{
|
7 |
+
// ...
|
8 |
+
}
|
framework/Foundation/AppFacade.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\Framework\Foundation;
|
4 |
+
|
5 |
+
Abstract class AppFacade
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* $instance Application
|
9 |
+
* @var FluentForm\Framework\Foundation\Application
|
10 |
+
*/
|
11 |
+
static $instance = null;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Sets the app instance from Application
|
15 |
+
* @param FluentForm\Framework\Foundation\Application $instance
|
16 |
+
*/
|
17 |
+
public static function setApplication($instance)
|
18 |
+
{
|
19 |
+
static::$instance = $instance;
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Get the app instance stored earlier during the bootstrap
|
24 |
+
* @param FluentForm\Framework\Foundation\Application $instance
|
25 |
+
*/
|
26 |
+
public static function getApplication()
|
27 |
+
{
|
28 |
+
return static::$instance;
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Resolve the aliased class dynamically
|
33 |
+
* @param string $method
|
34 |
+
* @param string $params
|
35 |
+
* @return mixed
|
36 |
+
*/
|
37 |
+
public static function __callStatic($method, $params)
|
38 |
+
{
|
39 |
+
return call_user_func_array([
|
40 |
+
static::$instance->make(static::$key), $method
|
41 |
+
], $params);
|
42 |
+
}
|
43 |
+
}
|
framework/Foundation/AppProvider.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\Framework\Foundation;
|
4 |
+
|
5 |
+
use FluentForm\Framework\Foundation\Provider;
|
6 |
+
|
7 |
+
class AppProvider extends Provider
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* The provider booting method to boot this provider
|
11 |
+
* @return void
|
12 |
+
*/
|
13 |
+
public function booting()
|
14 |
+
{
|
15 |
+
$this->app->bind(
|
16 |
+
'app', $this->app, 'App', 'FluentForm\Framework\Foundation\Application'
|
17 |
+
);
|
18 |
+
}
|
19 |
+
|
20 |
+
/**
|
21 |
+
* The provider booted method to be called after booting
|
22 |
+
* @return void
|
23 |
+
*/
|
24 |
+
public function booted()
|
25 |
+
{
|
26 |
+
// Framework is booted and ready
|
27 |
+
$this->app->booted(function($app) {
|
28 |
+
$app->load($app->appPath('Global/Common.php'));
|
29 |
+
$app->bootstrapWith($app->getCommonProviders());
|
30 |
+
});
|
31 |
+
|
32 |
+
// Application is booted and ready
|
33 |
+
$this->app->ready(function($app) {
|
34 |
+
$app->load($app->appPath('Hooks/Common.php'));
|
35 |
+
if ($app->isUserOnAdminArea()) {
|
36 |
+
$app->load($app->appPath('Hooks/Backend.php'));
|
37 |
+
} else {
|
38 |
+
$app->load($app->appPath('Hooks/Frontend.php'));
|
39 |
+
}
|
40 |
+
$app->load($app->appPath('Hooks/Ajax.php'));
|
41 |
+
});
|
42 |
+
}
|
43 |
+
}
|
framework/Foundation/Application.php
ADDED
@@ -0,0 +1,251 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* This file is part of the Glue WordPress plugin framework.
|
5 |
+
*
|
6 |
+
* @package Glue
|
7 |
+
* @link https://github.com/wpglue
|
8 |
+
* @author Sheikh Heera <heera.sheikh77@gmail.com>
|
9 |
+
* @license https://github.com/wpglue/framework/blob/master/LICENSE
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace FluentForm\Framework\Foundation;
|
13 |
+
|
14 |
+
use FluentForm\Framework\Exception\ExceptionHandler;
|
15 |
+
|
16 |
+
class Application extends Container
|
17 |
+
{
|
18 |
+
use PathsAndUrlsTrait, SetGetAttributesTrait, FacadeLoaderTrait, HelpersTrait;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Framework Version
|
22 |
+
*/
|
23 |
+
const VERSION = '1.0.0';
|
24 |
+
|
25 |
+
/**
|
26 |
+
* $baseFile root plugin file path
|
27 |
+
* @var string
|
28 |
+
*/
|
29 |
+
protected $baseFile = null;
|
30 |
+
|
31 |
+
/**
|
32 |
+
* The app config (/config/app.php)
|
33 |
+
* @var array
|
34 |
+
*/
|
35 |
+
protected $appConfig = null;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Callbacks for framework's booted event
|
39 |
+
* @var array
|
40 |
+
*/
|
41 |
+
protected $engineBootedCallbacks = array();
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Callbacks for framework's ready event
|
45 |
+
* @var array
|
46 |
+
*/
|
47 |
+
protected $pluginReadyCallbacks = array();
|
48 |
+
|
49 |
+
/**
|
50 |
+
* A flag to register the dynamic facade loader once
|
51 |
+
* @var boolean
|
52 |
+
*/
|
53 |
+
protected $isFacadeLoaderRegistered = false;
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Get application version
|
57 |
+
* @return string
|
58 |
+
*/
|
59 |
+
public function version()
|
60 |
+
{
|
61 |
+
return self::VERSION;
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Init the application
|
66 |
+
* @param string $baseFile (root plugin file path)
|
67 |
+
* @param array $appConfig (/config/app.php)
|
68 |
+
*/
|
69 |
+
public function __construct($baseFile, $appConfig)
|
70 |
+
{
|
71 |
+
$this->baseFile = $baseFile;
|
72 |
+
$this->appConfig = $appConfig;
|
73 |
+
$this->bootstrapApplication();
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Bootup the application
|
78 |
+
* @param string $baseFile (root plugin file path)
|
79 |
+
* @param array $appConfig (/config/app.php)
|
80 |
+
* @return void
|
81 |
+
*/
|
82 |
+
protected function bootstrapApplication()
|
83 |
+
{
|
84 |
+
$this->setAppBaseBindings();
|
85 |
+
$this->setExceptionHandler();
|
86 |
+
$this->loadApplicationTextDomain();
|
87 |
+
$this->bootstrapWith($this->getEngineProviders());
|
88 |
+
$this->fireCallbacks($this->engineBootedCallbacks);
|
89 |
+
$this->bootstrapWith($this->getPluginProviders());
|
90 |
+
$this->fireCallbacks($this->pluginReadyCallbacks);
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Register application base bindings
|
95 |
+
* @return void
|
96 |
+
*/
|
97 |
+
protected function setAppBaseBindings()
|
98 |
+
{
|
99 |
+
$this->bindAppInstance();
|
100 |
+
$this->registerAppPaths();
|
101 |
+
$this->registerAppUrls();
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* Bind application instance
|
106 |
+
* @return void
|
107 |
+
*/
|
108 |
+
protected function bindAppInstance()
|
109 |
+
{
|
110 |
+
AppFacade::setApplication($this);
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Set Application paths
|
115 |
+
* @return void
|
116 |
+
*/
|
117 |
+
protected function registerAppPaths()
|
118 |
+
{
|
119 |
+
$path = plugin_dir_path($this->baseFile);
|
120 |
+
$this->bindInstance('path', $path);
|
121 |
+
$this->bindInstance('path.app', $path.'app/');
|
122 |
+
$this->bindInstance('path.config', $path.'config/');
|
123 |
+
$this->bindInstance('path.public', $path.'public/');
|
124 |
+
$this->bindInstance('path.framework', $path.'framework/');
|
125 |
+
$this->bindInstance('path.resource', $path.'resources/');
|
126 |
+
$this->bindInstance('path.storage', $path.'storage/');
|
127 |
+
$this->bindInstance('path.asset', $path.'resources/assets/');
|
128 |
+
$this->bindInstance('path.language', $path.'resources/languages/');
|
129 |
+
$this->bindInstance('path.view', $path.'resources/views/');
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Set Application urls
|
134 |
+
* @return void
|
135 |
+
*/
|
136 |
+
protected function registerAppUrls()
|
137 |
+
{
|
138 |
+
$url = plugin_dir_url($this->baseFile);
|
139 |
+
$this->bindInstance('url', $url);
|
140 |
+
$this->bindInstance('url.public', $url.'public/');
|
141 |
+
$this->bindInstance('url.resource', $url.'resources/');
|
142 |
+
$this->bindInstance('url.asset', $url.'resources/assets/');
|
143 |
+
}
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Set Application Exception Handler
|
147 |
+
* @return void
|
148 |
+
*/
|
149 |
+
protected function setExceptionHandler()
|
150 |
+
{
|
151 |
+
if (defined('WP_DEBUG') && WP_DEBUG && $this->getEnv() == 'dev') {
|
152 |
+
return new ExceptionHandler($this);
|
153 |
+
}
|
154 |
+
}
|
155 |
+
|
156 |
+
/**
|
157 |
+
* load languages path for i18n pot files
|
158 |
+
* @return bool
|
159 |
+
*/
|
160 |
+
protected function loadApplicationTextDomain()
|
161 |
+
{
|
162 |
+
return load_plugin_textdomain(
|
163 |
+
$this->getTextDomain(), false, $this->languagePath()
|
164 |
+
);
|
165 |
+
}
|
166 |
+
|
167 |
+
/**
|
168 |
+
* Boot application with providers
|
169 |
+
* @param array $providers
|
170 |
+
* @return void
|
171 |
+
*/
|
172 |
+
public function bootstrapWith(array $providers)
|
173 |
+
{
|
174 |
+
$instances = [];
|
175 |
+
|
176 |
+
foreach ($providers as $provider) {
|
177 |
+
$instances[] = $instance = new $provider($this);
|
178 |
+
$instance->booting();
|
179 |
+
}
|
180 |
+
|
181 |
+
if (!$this->isFacadeLoaderRegistered) {
|
182 |
+
$this->registerAppFacadeLoader();
|
183 |
+
}
|
184 |
+
|
185 |
+
foreach ($instances as $object) {
|
186 |
+
$object->booted();
|
187 |
+
}
|
188 |
+
}
|
189 |
+
|
190 |
+
/**
|
191 |
+
* Get engine/core providers
|
192 |
+
* @return array
|
193 |
+
*/
|
194 |
+
public function getEngineProviders()
|
195 |
+
{
|
196 |
+
return $this->getProviders('core');
|
197 |
+
}
|
198 |
+
|
199 |
+
/**
|
200 |
+
* Get plugin providers (Common)
|
201 |
+
* @return array
|
202 |
+
*/
|
203 |
+
public function getCommonProviders()
|
204 |
+
{
|
205 |
+
return $this->getProviders('plugin')['common'];
|
206 |
+
}
|
207 |
+
|
208 |
+
/**
|
209 |
+
* Get plugin providers (Backend|Frontend)
|
210 |
+
* @return array
|
211 |
+
*/
|
212 |
+
public function getPluginProviders()
|
213 |
+
{
|
214 |
+
if ($this->isUserOnAdminArea()) {
|
215 |
+
return $this->getProviders('plugin')['backend'];
|
216 |
+
} else {
|
217 |
+
return $this->getProviders('plugin')['frontend'];
|
218 |
+
}
|
219 |
+
}
|
220 |
+
|
221 |
+
/**
|
222 |
+
* Register booted events
|
223 |
+
* @param mixed $callback
|
224 |
+
* @return void
|
225 |
+
*/
|
226 |
+
public function booted($callback)
|
227 |
+
{
|
228 |
+
$this->engineBootedCallbacks[] = $this->parseHandler($callback);
|
229 |
+
}
|
230 |
+
/**
|
231 |
+
* Register ready events
|
232 |
+
* @param mixed $callback
|
233 |
+
* @return void
|
234 |
+
*/
|
235 |
+
public function ready($callback)
|
236 |
+
{
|
237 |
+
$this->pluginReadyCallbacks[] = $this->parseHandler($callback);
|
238 |
+
}
|
239 |
+
|
240 |
+
/**
|
241 |
+
* Fire application event's handlers
|
242 |
+
* @param array $callbacks
|
243 |
+
* @return void
|
244 |
+
*/
|
245 |
+
public function fireCallbacks(array $callbacks)
|
246 |
+
{
|
247 |
+
foreach ($callbacks as $callback) {
|
248 |
+
call_user_func_array($callback, [$this]);
|
249 |
+
}
|
250 |
+
}
|
251 |
+
}
|
framework/Foundation/Bootstrap.php
ADDED
@@ -0,0 +1,204 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\Framework\Foundation;
|
4 |
+
|
5 |
+
use FluentForm\App\Modules\Activator;
|
6 |
+
use FluentForm\App\Modules\Deactivator;
|
7 |
+
use FluentForm\Framework\Foundation\Application;
|
8 |
+
|
9 |
+
class Bootstrap
|
10 |
+
{
|
11 |
+
/**
|
12 |
+
* The main plugin file path
|
13 |
+
* @var strring
|
14 |
+
*/
|
15 |
+
protected static $file = null;
|
16 |
+
|
17 |
+
/**
|
18 |
+
* The base dir path of the plugin
|
19 |
+
* @var strring
|
20 |
+
*/
|
21 |
+
protected static $basePath = null;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* The app config (/config/app.php)
|
25 |
+
* @var strring
|
26 |
+
*/
|
27 |
+
protected static $config = array();
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Conveniently start the framework
|
31 |
+
* @param string $file
|
32 |
+
* @return $ */
|
33 |
+
public static function run($file)
|
34 |
+
{
|
35 |
+
static::init($file);
|
36 |
+
static::registerHooks();
|
37 |
+
static::registerAutoLoader();
|
38 |
+
static::registerApplication();
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Initialize the framework
|
43 |
+
* @param string $file [the main plugin file path]
|
44 |
+
* @return void
|
45 |
+
*/
|
46 |
+
public static function init($file)
|
47 |
+
{
|
48 |
+
static::$file = $file;
|
49 |
+
|
50 |
+
static::$basePath = plugin_dir_path($file);
|
51 |
+
|
52 |
+
if (file_exists($activator = static::$basePath.'app/Modules/Activator.php')) {
|
53 |
+
include_once $activator;
|
54 |
+
}
|
55 |
+
|
56 |
+
if (file_exists($deactivator = static::$basePath.'app/Modules/Deactivator.php')) {
|
57 |
+
include_once $deactivator;
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Register activation/deactivation hooks
|
63 |
+
* @return void
|
64 |
+
*/
|
65 |
+
public static function registerHooks()
|
66 |
+
{
|
67 |
+
static::registerActivationHook();
|
68 |
+
static::registerDeactivationHook();
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Register activation hook
|
73 |
+
* @return bool
|
74 |
+
*/
|
75 |
+
public static function registerActivationHook()
|
76 |
+
{
|
77 |
+
return register_activation_hook(
|
78 |
+
static::$file, array(__CLASS__, 'activate')
|
79 |
+
);
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Register deactivation hook
|
84 |
+
* @return bool
|
85 |
+
*/
|
86 |
+
public static function registerDeactivationHook()
|
87 |
+
{
|
88 |
+
return register_deactivation_hook(
|
89 |
+
static::$file, array(__CLASS__, 'deactivate')
|
90 |
+
);
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Validate and activate the plugin
|
95 |
+
* @return void
|
96 |
+
*/
|
97 |
+
public static function activate()
|
98 |
+
{
|
99 |
+
static::validatePlugin();
|
100 |
+
if (class_exists('FluentForm\App\Modules\Activator')) {
|
101 |
+
(new Activator)->handleActivation(static::$file);
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Deactivate the plugin
|
107 |
+
* @return void
|
108 |
+
*/
|
109 |
+
public static function deactivate()
|
110 |
+
{
|
111 |
+
// Framework specific implementation if necessary...
|
112 |
+
if (class_exists('FluentForm\App\Modules\Deactivator')) {
|
113 |
+
(new Deactivator)->handleDeactivation(static::$file);
|
114 |
+
}
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Validate the plugin by checking all rquired files/settings
|
119 |
+
* @return void
|
120 |
+
*/
|
121 |
+
public static function validatePlugin()
|
122 |
+
{
|
123 |
+
if(!file_exists($glueJson = static::$basePath.'glue.json')) {
|
124 |
+
die('The [glue.json] file is missing from "'.$basePath.'" directory.');
|
125 |
+
}
|
126 |
+
|
127 |
+
static::$config = json_decode(file_get_contents($glueJson), true);
|
128 |
+
|
129 |
+
$configPath = static::$basePath.'config';
|
130 |
+
|
131 |
+
if(!file_exists($file = $configPath.'/app.php')) {
|
132 |
+
die('The [config.php] file is missing from "'.$configPath.'" directory.');
|
133 |
+
}
|
134 |
+
|
135 |
+
static::$config = array_merge(include $file, static::$config);
|
136 |
+
|
137 |
+
if (!($autoload = @static::$config['autoload'])) {
|
138 |
+
die('The [autoload] key is not specified or invalid in "'.$glueJson.'" file.');
|
139 |
+
}
|
140 |
+
|
141 |
+
if (!($namespace = @$autoload['namespace'])) {
|
142 |
+
die('The [namespace] key is not specified or invalid in "'.$glueJson.'" file.');
|
143 |
+
}
|
144 |
+
|
145 |
+
$namespaceMapping = @$autoload['mapping'];
|
146 |
+
|
147 |
+
if (!($namespaceMapping || empty((array) $namespaceMapping))) {
|
148 |
+
die('The [mapping] key is not specified or invalid in "'.$glueJson.'" file.');
|
149 |
+
}
|
150 |
+
}
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Register the autoloader
|
154 |
+
* @return void
|
155 |
+
*/
|
156 |
+
public static function registerAutoLoader()
|
157 |
+
{
|
158 |
+
if (!static::$config) {
|
159 |
+
static::$config = json_decode(file_get_contents(static::$basePath.'glue.json'), true);
|
160 |
+
static::$config = array_merge(include static::$basePath.'config/app.php', static::$config);
|
161 |
+
}
|
162 |
+
|
163 |
+
spl_autoload_register([__CLASS__, 'loader']);
|
164 |
+
}
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Framework's custom autoloader
|
168 |
+
* @param string $class
|
169 |
+
* @return mixed
|
170 |
+
*/
|
171 |
+
public static function loader($class)
|
172 |
+
{
|
173 |
+
$namespace = static::$config['autoload']['namespace'];
|
174 |
+
|
175 |
+
if(substr($class, 0, strlen($namespace)) !== $namespace) {
|
176 |
+
return false;
|
177 |
+
}
|
178 |
+
|
179 |
+
foreach (static::$config['autoload']['mapping'] as $key => $value) {
|
180 |
+
$className = str_replace(
|
181 |
+
array('\\', $key, $namespace),
|
182 |
+
array('/', $value, ''),
|
183 |
+
$class
|
184 |
+
);
|
185 |
+
|
186 |
+
$file = static::$basePath.trim($className, '/').'.php';
|
187 |
+
|
188 |
+
if (is_readable($file)) {
|
189 |
+
return include $file;
|
190 |
+
}
|
191 |
+
}
|
192 |
+
}
|
193 |
+
|
194 |
+
/**
|
195 |
+
* Register "plugins_loaded" hook to run the plugin
|
196 |
+
* @return void
|
197 |
+
*/
|
198 |
+
public static function registerApplication()
|
199 |
+
{
|
200 |
+
add_action('plugins_loaded', function() {
|
201 |
+
return new Application(static::$file, static::$config);
|
202 |
+
});
|
203 |
+
}
|
204 |
+
}
|
framework/Foundation/Container.php
ADDED
@@ -0,0 +1,316 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\Framework\Foundation;
|
4 |
+
|
5 |
+
use Closure;
|
6 |
+
use Exception;
|
7 |
+
use ArrayAccess;
|
8 |
+
use ReflectionClass;
|
9 |
+
use ReflectionParameter;
|
10 |
+
use FluentForm\Framework\Exception\UnResolveableEntityException;
|
11 |
+
|
12 |
+
class Container implements ArrayAccess
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* $container The service container
|
16 |
+
* @var array
|
17 |
+
*/
|
18 |
+
protected static $container = array(
|
19 |
+
'facades' => array(),
|
20 |
+
'aliases' => array(),
|
21 |
+
'resolved' => array(),
|
22 |
+
'bindings' => array(),
|
23 |
+
'singletons' => array(),
|
24 |
+
);
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Bind an instance into service container
|
28 |
+
* @param string $key identifier
|
29 |
+
* @param mixed $concrete
|
30 |
+
* @param string $facade [optional facade]
|
31 |
+
* @param string $alias [optional alias]
|
32 |
+
* @return void
|
33 |
+
*/
|
34 |
+
public function bind($key, $concrete = null, $facade = null, $alias = null, $shared = false)
|
35 |
+
{
|
36 |
+
$concrete = is_null($concrete) ? $key : $concrete;
|
37 |
+
|
38 |
+
if (!$shared) {
|
39 |
+
static::$container['bindings'][$key] = $concrete;
|
40 |
+
} else {
|
41 |
+
static::$container['singletons'][$key] = $concrete;
|
42 |
+
}
|
43 |
+
|
44 |
+
if ($facade) {
|
45 |
+
$this->facade($key, $facade);
|
46 |
+
}
|
47 |
+
|
48 |
+
if ($alias) {
|
49 |
+
$this->alias($key, $alias);
|
50 |
+
}
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Bind a singleton instance into service container
|
55 |
+
* @param string $key identifier
|
56 |
+
* @param mixed $concrete
|
57 |
+
* @param string $facade [optional facade]
|
58 |
+
* @param string $alias [optional alias]
|
59 |
+
* @return void
|
60 |
+
*/
|
61 |
+
public function bindSingleton($key, $concrete = null, $facade = null, $alias = null)
|
62 |
+
{
|
63 |
+
$this->bind($key, $concrete, $facade, $alias, true);
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Bind a singleton instance into service container
|
68 |
+
* @param string $key identifier
|
69 |
+
* @param mixed $concrete
|
70 |
+
* @param string $facade [optional facade]
|
71 |
+
* @param string $alias [optional alias]
|
72 |
+
* @return void
|
73 |
+
*/
|
74 |
+
public function bindInstance($key, $concrete, $facade = null, $alias = null)
|
75 |
+
{
|
76 |
+
$this->bind($key, function($app) use ($concrete) {
|
77 |
+
return $concrete;
|
78 |
+
}, $facade, $alias, true);
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Register a facade for a registered instance
|
83 |
+
* @param string $key
|
84 |
+
* @param string $facade
|
85 |
+
* @return string
|
86 |
+
*/
|
87 |
+
public function facade($key, $facade)
|
88 |
+
{
|
89 |
+
static::$container['facades'][$facade] = $key;
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Register an alias for a registered instance
|
94 |
+
* @param string $key
|
95 |
+
* @param string $alias
|
96 |
+
* @return string
|
97 |
+
*/
|
98 |
+
public function alias($key, $aliases)
|
99 |
+
{
|
100 |
+
foreach ((array) $aliases as $alias) {
|
101 |
+
static::$container['aliases'][$alias] = $key;
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Resolve an instance from container
|
107 |
+
* @param string $key
|
108 |
+
* @return mixed
|
109 |
+
* @throws \FluentForm\Framework\Exception\UnResolveableEntityException
|
110 |
+
*/
|
111 |
+
public function make($key = null, array $params = [])
|
112 |
+
{
|
113 |
+
if (is_null($key)) {
|
114 |
+
return AppFacade::getApplication();
|
115 |
+
}
|
116 |
+
|
117 |
+
$key = $this->getAlias($key);
|
118 |
+
|
119 |
+
if (isset(static::$container['resolved'][$key])) {
|
120 |
+
return static::$container['resolved'][$key];
|
121 |
+
}
|
122 |
+
|
123 |
+
if (isset(static::$container['singletons'][$key])) {
|
124 |
+
return static::$container['resolved'][$key] = $this->resolve(
|
125 |
+
static::$container['singletons'][$key], $params
|
126 |
+
);
|
127 |
+
}
|
128 |
+
|
129 |
+
if (isset(static::$container['bindings'][$key])) {
|
130 |
+
return $this->resolve(static::$container['bindings'][$key], $params);
|
131 |
+
}
|
132 |
+
|
133 |
+
if ($this->classExists($key)) {
|
134 |
+
return $this->resolve($key, $params);
|
135 |
+
}
|
136 |
+
|
137 |
+
throw new UnResolveableEntityException(
|
138 |
+
'The service ['.$key.'] doesn\'t exist.'
|
139 |
+
);
|
140 |
+
}
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Resolve an item from the container
|
144 |
+
* @param mixed $value
|
145 |
+
* @return mixed
|
146 |
+
*/
|
147 |
+
protected function resolve($value, $params = [])
|
148 |
+
{
|
149 |
+
if ($value instanceof Closure) {
|
150 |
+
return $value($this, $params);
|
151 |
+
}
|
152 |
+
|
153 |
+
return $this->build($value, $params);
|
154 |
+
}
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Build a concrete class with all dependencies
|
158 |
+
* @param string $value FQN class name
|
159 |
+
* @return mixed resolved instance
|
160 |
+
*/
|
161 |
+
protected function build($value, $params = [])
|
162 |
+
{
|
163 |
+
if (is_object($value)) return $value;
|
164 |
+
|
165 |
+
$reflector = new ReflectionClass($value);
|
166 |
+
|
167 |
+
if (!$reflector->isInstantiable()) {
|
168 |
+
throw new UnResolveableEntityException(
|
169 |
+
"The [$value] is not instantiable."
|
170 |
+
);
|
171 |
+
}
|
172 |
+
|
173 |
+
if (!$constructor = $reflector->getConstructor()) {
|
174 |
+
return new $value;
|
175 |
+
}
|
176 |
+
|
177 |
+
$dependencies = $params ? $params : $this->resolveDependencies(
|
178 |
+
$constructor->getParameters()
|
179 |
+
);
|
180 |
+
|
181 |
+
return $reflector->newInstanceArgs($dependencies);
|
182 |
+
}
|
183 |
+
|
184 |
+
/**
|
185 |
+
* Resolve all dependencies of a single class
|
186 |
+
* @param array $dependencies Constructor Parameters
|
187 |
+
* @return array An array of all the resolved dependencies of one class
|
188 |
+
*/
|
189 |
+
protected function resolveDependencies(array $dependencies)
|
190 |
+
{
|
191 |
+
$results = [];
|
192 |
+
foreach ($dependencies as $dependency) {
|
193 |
+
$results[] = $this->resolveClass($dependency);
|
194 |
+
}
|
195 |
+
return $results;
|
196 |
+
}
|
197 |
+
|
198 |
+
/**
|
199 |
+
* Resolves a single class instance
|
200 |
+
* @param ReflectionParameter $parameter
|
201 |
+
* @return mixed
|
202 |
+
* @throws Exception
|
203 |
+
*/
|
204 |
+
protected function resolveClass(ReflectionParameter $parameter)
|
205 |
+
{
|
206 |
+
try {
|
207 |
+
return $this->make($parameter->getClass()->name);
|
208 |
+
}
|
209 |
+
catch (Exception $exception) {
|
210 |
+
if ($parameter->isOptional()) {
|
211 |
+
return $parameter->getDefaultValue();
|
212 |
+
} elseif (!$parameter->getClass()) {
|
213 |
+
$name = $parameter->getName();
|
214 |
+
$cls = $parameter->getDeclaringClass();
|
215 |
+
throw new UnResolveableEntityException(
|
216 |
+
"The [".$cls->name."] is not instantiable, $".$name." is required."
|
217 |
+
);
|
218 |
+
}
|
219 |
+
throw $exception;
|
220 |
+
}
|
221 |
+
}
|
222 |
+
|
223 |
+
/**
|
224 |
+
* Get the alias for a key if available.
|
225 |
+
* @param string $key
|
226 |
+
* @return string
|
227 |
+
*/
|
228 |
+
public function getAlias($key)
|
229 |
+
{
|
230 |
+
if (isset(static::$container['aliases'][$key])) {
|
231 |
+
return static::$container['aliases'][$key];
|
232 |
+
}
|
233 |
+
|
234 |
+
return $key;
|
235 |
+
}
|
236 |
+
|
237 |
+
/**
|
238 |
+
* Check if a given class/interface exists
|
239 |
+
* @param string $key
|
240 |
+
* @return bool
|
241 |
+
*/
|
242 |
+
protected function classExists($key)
|
243 |
+
{
|
244 |
+
return is_string($key) && (class_exists($key) || interface_exists($key));
|
245 |
+
}
|
246 |
+
|
247 |
+
/**
|
248 |
+
* Check if an item exists at a given offset
|
249 |
+
* @param string $offset
|
250 |
+
* @return bool
|
251 |
+
*/
|
252 |
+
public function bound($offset)
|
253 |
+
{
|
254 |
+
return isset(static::$container['resolved'][$offset]) ||
|
255 |
+
isset(static::$container['bindings'][$offset]) ||
|
256 |
+
isset(static::$container['singletons'][$offset]);
|
257 |
+
}
|
258 |
+
|
259 |
+
/**
|
260 |
+
* Check if an item exists at a given offset
|
261 |
+
* @param string $offset
|
262 |
+
* @return bool
|
263 |
+
*/
|
264 |
+
public function has($offset)
|
265 |
+
{
|
266 |
+
return $this->bound($offset);
|
267 |
+
}
|
268 |
+
|
269 |
+
/**
|
270 |
+
* Check if an item exists at a given offset
|
271 |
+
* @param string $offset
|
272 |
+
* @return bool
|
273 |
+
*/
|
274 |
+
public function offsetExists($offset)
|
275 |
+
{
|
276 |
+
return $this->bound($offset);
|
277 |
+
}
|
278 |
+
|
279 |
+
/**
|
280 |
+
* Get the value from given offset
|
281 |
+
* @param string $offset
|
282 |
+
* @param mixed $value
|
283 |
+
* @return void
|
284 |
+
*/
|
285 |
+
public function offsetGet($offset)
|
286 |
+
{
|
287 |
+
return $this->make($offset);
|
288 |
+
}
|
289 |
+
|
290 |
+
/**
|
291 |
+
* Set the value at a given offset
|
292 |
+
* @param string $offset
|
293 |
+
* @param mixed $value
|
294 |
+
* @return void
|
295 |
+
*/
|
296 |
+
public function offsetSet($offset, $value)
|
297 |
+
{
|
298 |
+
static::$container['singletons'][$offset] = function() use ($value) {
|
299 |
+
return $value;
|
300 |
+
};
|
301 |
+
}
|
302 |
+
|
303 |
+
/**
|
304 |
+
* Unset the value at a given offset
|
305 |
+
* @param string $offset
|
306 |
+
* @return void
|
307 |
+
*/
|
308 |
+
public function offsetUnset($offset)
|
309 |
+
{
|
310 |
+
unset(
|
311 |
+
static::$container['resolved'][$offset],
|
312 |
+
static::$container['bindings'][$offset],
|
313 |
+
static::$container['singletons'][$offset]
|
314 |
+
);
|
315 |
+
}
|
316 |
+
}
|
framework/Foundation/Facade.stub
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace DummyNamespace;
|
4 |
+
|
5 |
+
use FluentForm\Framework\Foundation\AppFacade;
|
6 |
+
|
7 |
+
class DummyClass extends AppFacade
|
8 |
+
{
|
9 |
+
static $key = 'DummyKey';
|
10 |
+
}
|
framework/Foundation/FacadeLoaderTrait.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\Framework\Foundation;
|
4 |
+
|
5 |
+
trait FacadeLoaderTrait
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Register facade/alias loader
|
9 |
+
* @return void
|
10 |
+
*/
|
11 |
+
protected function registerAppFacadeLoader()
|
12 |
+
{
|
13 |
+
$this->isFacadeLoaderRegistered = true;
|
14 |
+
spl_autoload_register([$this, 'aliasLoader'], true, false);
|
15 |
+
}
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Facad/Alias loader
|
19 |
+
* @param [type] $class [description]
|
20 |
+
* @return [type] [description]
|
21 |
+
*/
|
22 |
+
protected function aliasLoader($class)
|
23 |
+
{
|
24 |
+
$namespace = $this->getNamespace();
|
25 |
+
if ($namespace == substr($class, 0, strlen($namespace))) {
|
26 |
+
$parts = explode('\\', $class);
|
27 |
+
if (count($parts) == 2) {
|
28 |
+
if (array_key_exists($parts[1], static::$container['facades'])) {
|
29 |
+
$containerKey = static::$container['facades'][$facade = $parts[1]];
|
30 |
+
$path = $this->storagePath().'framework/facades/';
|
31 |
+
if (!file_exists($file = $path.$facade.'.php')) {
|
32 |
+
if (!file_exists($path)) {
|
33 |
+
mkdir($path, 0777, true);
|
34 |
+
}
|
35 |
+
file_put_contents($file, $this->getFileData($facade, $containerKey));
|
36 |
+
}
|
37 |
+
include $file;
|
38 |
+
}
|
39 |
+
}
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Retrieve facade file content
|
45 |
+
* @param string $alias
|
46 |
+
* @param string $key
|
47 |
+
* @return string
|
48 |
+
*/
|
49 |
+
protected function getFileData($alias, $key)
|
50 |
+
{
|
51 |
+
return str_replace(
|
52 |
+
['DummyNamespace', 'DummyClass', 'DummyKey'],
|
53 |
+
[$this->getNamespace(), $alias, $key],
|
54 |
+
file_get_contents($this->frameworkPath().'Foundation/Facade.stub')
|
55 |
+
);
|
56 |
+
}
|
57 |
+
}
|
framework/Foundation/HelpersTrait.php
ADDED
@@ -0,0 +1,331 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\Framework\Foundation;
|
4 |
+
|
5 |
+
trait HelpersTrait
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Load a file using include_once
|
9 |
+
* @return boolean
|
10 |
+
*/
|
11 |
+
public function load($file)
|
12 |
+
{
|
13 |
+
$app = $this;
|
14 |
+
return include $file;
|
15 |
+
}
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Checks if the user is on wp-admin area (visiting backend)
|
19 |
+
* (It doesn't check whether user is authenticated ro not)
|
20 |
+
* @return boolean
|
21 |
+
*/
|
22 |
+
public function isUserOnAdminArea()
|
23 |
+
{
|
24 |
+
return is_admin();
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Application's callbacks parser
|
29 |
+
* @param mixed $args
|
30 |
+
* @return mixed
|
31 |
+
*/
|
32 |
+
public function parseHandler($args)
|
33 |
+
{
|
34 |
+
$args = is_array($args) ? $args : func_get_args();
|
35 |
+
|
36 |
+
if (is_callable($args[0])) {
|
37 |
+
return $args[0];
|
38 |
+
} elseif (is_string($args[0])) {
|
39 |
+
if (strpos($args[0], '@')) {
|
40 |
+
list($class, $method) = explode('@', $args[0]);
|
41 |
+
$instance = $this->make($class);
|
42 |
+
return [$instance, $method];
|
43 |
+
} elseif (strpos($args[0], '::')) {
|
44 |
+
list($class, $method) = explode('::', $args[0]);
|
45 |
+
return [$class, $method];
|
46 |
+
} elseif (isset($args[1]) && is_string($args[1])) {
|
47 |
+
return $args;
|
48 |
+
}
|
49 |
+
} else {
|
50 |
+
return $args;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Make a unique key/hook with the application slug prefix
|
56 |
+
* @param string $tag
|
57 |
+
* @param string $prefix [optional prefix instead of app slug]
|
58 |
+
* @return string
|
59 |
+
*/
|
60 |
+
public function makeKey($tag, $prefix = null)
|
61 |
+
{
|
62 |
+
return ($prefix ? $prefix : $this->getSlug()).'_'.$tag;
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Add/Register an ajax action
|
67 |
+
* @param string $tag [action name]
|
68 |
+
* @param mixed $handler
|
69 |
+
* @param integer $priority [optional]
|
70 |
+
* @param string $scope [specify the scope of the ajax action|internal use]
|
71 |
+
* @return Framework\Foundation\HookReference
|
72 |
+
*/
|
73 |
+
private function addAjaxAction($tag, $handler, $priority = 10, $scope)
|
74 |
+
{
|
75 |
+
if ($scope == 'admin') {
|
76 |
+
add_action(
|
77 |
+
'wp_ajax_'.$tag,
|
78 |
+
$ref = $this->parseHandler($handler),
|
79 |
+
$priority
|
80 |
+
);
|
81 |
+
}
|
82 |
+
|
83 |
+
if ($scope == 'public') {
|
84 |
+
add_action(
|
85 |
+
'wp_ajax_nopriv_'.$tag,
|
86 |
+
$ref = $this->parseHandler($handler),
|
87 |
+
$priority
|
88 |
+
);
|
89 |
+
}
|
90 |
+
|
91 |
+
return new HookReference($this, $ref, $tag);
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Add an ajax action for authenticated user
|
96 |
+
* @param string $tag [action name]
|
97 |
+
* @param mixed $handler
|
98 |
+
* @param integer $priority [optional]
|
99 |
+
* @return mixed [a reference to the handler to remove the action later]
|
100 |
+
*/
|
101 |
+
public function addAdminAjaxAction($tag, $handler, $priority = 10)
|
102 |
+
{
|
103 |
+
return $this->addAjaxAction($tag, $handler, $priority, 'admin');
|
104 |
+
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Add an ajax action for unauthenticated user
|
108 |
+
* @param string $tag [action name]
|
109 |
+
* @param mixed $handler
|
110 |
+
* @param integer $priority [optional]
|
111 |
+
* @return mixed [a reference to the handler to remove the action later]
|
112 |
+
*/
|
113 |
+
public function addPublicAjaxAction($tag, $handler, $priority = 10)
|
114 |
+
{
|
115 |
+
return $this->addAjaxAction($tag, $handler, $priority, 'public');
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Remove/Unregister a registered ajax action
|
120 |
+
* @param string $tag [action name]
|
121 |
+
* @param mixed $handler [previously stored reference when added the action]
|
122 |
+
* @param integer $priority [optional]
|
123 |
+
* @param string $scope [specify the scope of the ajax action|internal use]
|
124 |
+
* @return mixed [a reference to the handler to remove the action later]
|
125 |
+
*/
|
126 |
+
private function removeAjaxAction($tag, $handler, $priority = 10, $scope)
|
127 |
+
{
|
128 |
+
if ($scope == 'admin') {
|
129 |
+
return remove_action(
|
130 |
+
'wp_ajax_'.$tag,
|
131 |
+
$this->parseHandler($handler),
|
132 |
+
$priority
|
133 |
+
);
|
134 |
+
}
|
135 |
+
|
136 |
+
if ($scope == 'public') {
|
137 |
+
return remove_action(
|
138 |
+
'wp_ajax_no_priv_'.$tag,
|
139 |
+
$this->parseHandler($handler),
|
140 |
+
$priority
|
141 |
+
);
|
142 |
+
}
|
143 |
+
}
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Remove an ajax action for authenticated user
|
147 |
+
* @param string $tag [action name]
|
148 |
+
* @param mixed $handler [previously stored reference when added the action]
|
149 |
+
* @param integer $priority [optional]
|
150 |
+
* @return bool [true on success or false on failure]
|
151 |
+
*/
|
152 |
+
public function removeAdminAjaxAction($tag, $handler, $priority = 10)
|
153 |
+
{
|
154 |
+
return $this->removeAjaxAction($tag, $handler, $priority, 'admin');
|
155 |
+
}
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Remove an ajax action for unauthenticated user
|
159 |
+
* @param string $tag [action name]
|
160 |
+
* @param mixed $handler [previously stored reference when added the action]
|
161 |
+
* @param integer $priority [optional]
|
162 |
+
* @return bool [true on success or false on failure]
|
163 |
+
*/
|
164 |
+
public function removePublicAjaxAction($tag, $handler, $priority = 10)
|
165 |
+
{
|
166 |
+
return $this->removeAjaxAction($tag, $handler, $priority, 'public');
|
167 |
+
}
|
168 |
+
|
169 |
+
|
170 |
+
/**
|
171 |
+
* Add WordPress Filter
|
172 |
+
* @param string $tag
|
173 |
+
* @param mixed $handler
|
174 |
+
* @param integer $priority
|
175 |
+
* @param integer $acceptedArgs
|
176 |
+
* @return Framework\Foundation\HookReference
|
177 |
+
*/
|
178 |
+
public function addfilter($tag, $handler, $priority = 10, $acceptedArgs = 1)
|
179 |
+
{
|
180 |
+
add_filter(
|
181 |
+
$tag,
|
182 |
+
$ref = $this->parseHandler($handler),
|
183 |
+
$priority,
|
184 |
+
$acceptedArgs
|
185 |
+
);
|
186 |
+
|
187 |
+
return new HookReference($this, $ref, $tag);
|
188 |
+
}
|
189 |
+
|
190 |
+
/**
|
191 |
+
* Remove WordPress Filter.
|
192 |
+
* @param string $tag
|
193 |
+
* @param mixed $handler
|
194 |
+
* @param integer $priority
|
195 |
+
* @return true
|
196 |
+
*/
|
197 |
+
public function removeFilter($tag, $handler, $priority = 10)
|
198 |
+
{
|
199 |
+
return remove_filter(
|
200 |
+
$tag,
|
201 |
+
$this->parseHandler($handler),
|
202 |
+
$priority
|
203 |
+
);
|
204 |
+
}
|
205 |
+
|
206 |
+
/**
|
207 |
+
* Remove WordPress' All Filters.
|
208 |
+
* @param string $tag
|
209 |
+
* @param boolean $priority
|
210 |
+
* @return bool
|
211 |
+
*/
|
212 |
+
public function removeFilters($tag, $priority = false)
|
213 |
+
{
|
214 |
+
return remove_all_filters($tag, $priority);
|
215 |
+
}
|
216 |
+
|
217 |
+
/**
|
218 |
+
* Apply WordPress Filter.
|
219 |
+
* @return mixed [filtered content]
|
220 |
+
*/
|
221 |
+
public function applyFilters()
|
222 |
+
{
|
223 |
+
return call_user_func_array('apply_filters', func_get_args());
|
224 |
+
}
|
225 |
+
|
226 |
+
/**
|
227 |
+
* Add WordPress Action
|
228 |
+
* @param string $tag
|
229 |
+
* @param mixed $handler
|
230 |
+
* @param integer $priority
|
231 |
+
* @param integer $acceptedArgs
|
232 |
+
* @return Framework\Foundation\HookReference
|
233 |
+
*/
|
234 |
+
public function addAction($tag, $handler, $priority = 10, $acceptedArgs = 1)
|
235 |
+
{
|
236 |
+
add_action(
|
237 |
+
$tag,
|
238 |
+
$ref = $this->parseHandler($handler),
|
239 |
+
$priority,
|
240 |
+
$acceptedArgs
|
241 |
+
);
|
242 |
+
|
243 |
+
return new HookReference($this, $ref, $tag);
|
244 |
+
}
|
245 |
+
|
246 |
+
/**
|
247 |
+
* Remove WordPress' Action.
|
248 |
+
* @param string $tag
|
249 |
+
* @param boolean $priority
|
250 |
+
* @return bool
|
251 |
+
*/
|
252 |
+
public function removeAction($tag, $handler, $priority = 10)
|
253 |
+
{
|
254 |
+
return remove_action(
|
255 |
+
$tag,
|
256 |
+
$this->parseHandler($handler),
|
257 |
+
$priority
|
258 |
+
);
|
259 |
+
}
|
260 |
+
|
261 |
+
/**
|
262 |
+
* Remove WordPress' All Actions.
|
263 |
+
* @param string $tag
|
264 |
+
* @param boolean $priority
|
265 |
+
* @return bool
|
266 |
+
*/
|
267 |
+
public function removeActions($tag, $priority = false)
|
268 |
+
{
|
269 |
+
return remove_all_actions($tag, $priority);
|
270 |
+
}
|
271 |
+
|
272 |
+
/**
|
273 |
+
* Do WordPress Action.
|
274 |
+
* @return void
|
275 |
+
*/
|
276 |
+
public function doAction()
|
277 |
+
{
|
278 |
+
call_user_func_array('do_action', func_get_args());
|
279 |
+
}
|
280 |
+
|
281 |
+
/**
|
282 |
+
* Add WordPress Short Code.
|
283 |
+
* @param string $tag
|
284 |
+
* @param mixed $handler
|
285 |
+
*/
|
286 |
+
public function addShortCode($tag, $handler)
|
287 |
+
{
|
288 |
+
add_shortcode(
|
289 |
+
$tag,
|
290 |
+
$this->parseHandler($handler)
|
291 |
+
);
|
292 |
+
}
|
293 |
+
|
294 |
+
/**
|
295 |
+
* Remove WordPress Short Code.
|
296 |
+
* @param string $content
|
297 |
+
* @param bool $ignoreHtml
|
298 |
+
*/
|
299 |
+
public function removeShortCode($tag)
|
300 |
+
{
|
301 |
+
remove_shortcode($tag);
|
302 |
+
}
|
303 |
+
|
304 |
+
/**
|
305 |
+
* Do WordPress Short Code.
|
306 |
+
* @param string $content
|
307 |
+
* @param bool $ignoreHtml
|
308 |
+
*/
|
309 |
+
public function doShortCode($tag, $atts, $content = null, $ignoreHtml = false)
|
310 |
+
{
|
311 |
+
return do_shortcode(
|
312 |
+
$this->formatShortCode($tag, $atts, $content), $ignoreHtml
|
313 |
+
);
|
314 |
+
}
|
315 |
+
|
316 |
+
/**
|
317 |
+
* Format the short content (make shortcode content string)
|
318 |
+
* @param string $tag
|
319 |
+
* @param array $atts
|
320 |
+
* @param string $content
|
321 |
+
* @return string
|
322 |
+
*/
|
323 |
+
public function formatShortCode($tag, $atts, $content = null)
|
324 |
+
{
|
325 |
+
$str = '';
|
326 |
+
foreach ($atts as $key => $value) {
|
327 |
+
$str .= " {$key}={$value}";
|
328 |
+
}
|
329 |
+
return "[{$tag}{$str}]{$content}[/{$tag}]";
|
330 |
+
}
|
331 |
+
}
|
framework/Foundation/HookReference.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\Framework\Foundation;
|
4 |
+
|
5 |
+
class HookReference
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* $ref reference for any hook
|
9 |
+
* @var null
|
10 |
+
*/
|
11 |
+
private $ref = null;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* construct the instance
|
15 |
+
* @param Application $app
|
16 |
+
* @param reference $ref
|
17 |
+
* @param string $key
|
18 |
+
*/
|
19 |
+
public function __construct(Application $app, $ref, $key = null)
|
20 |
+
{
|
21 |
+
$this->app = $app;
|
22 |
+
$this->ref = $ref;
|
23 |
+
$this->key = $key;
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Save the hook's handler reference
|
28 |
+
* @param string $key
|
29 |
+
* @return reference
|
30 |
+
*/
|
31 |
+
public function saveReference($key = null)
|
32 |
+
{
|
33 |
+
// TODO: Add exception
|
34 |
+
$this->app->bindInstance($key ? $key : $this->key, $this->ref);
|
35 |
+
|
36 |
+
return $this->ref;
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Get the reference
|
41 |
+
* @return reference
|
42 |
+
*/
|
43 |
+
public function reference()
|
44 |
+
{
|
45 |
+
return $this->ref;
|
46 |
+
}
|
47 |
+
}
|
framework/Foundation/PathsAndUrlsTrait.php
ADDED
@@ -0,0 +1,155 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\Framework\Foundation;
|
4 |
+
|
5 |
+
trait PathsAndUrlsTrait
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Get plugin's main file path
|
9 |
+
* @return string [plugin file path]
|
10 |
+
*/
|
11 |
+
public function baseFile()
|
12 |
+
{
|
13 |
+
return $this->baseFile;
|
14 |
+
}
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Get plugin's root path
|
18 |
+
* @param string $path
|
19 |
+
* @return string
|
20 |
+
*/
|
21 |
+
public function path($path = '')
|
22 |
+
{
|
23 |
+
return $this['path'].ltrim($path, '/');
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Get plugin's /app path
|
28 |
+
* @param string $path
|
29 |
+
* @return string
|
30 |
+
*/
|
31 |
+
public function appPath($path = '')
|
32 |
+
{
|
33 |
+
return $this['path.app'].ltrim($path, '/');
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Get plugin's /config path
|
38 |
+
* @param string $path
|
39 |
+
* @return string
|
40 |
+
*/
|
41 |
+
public function configPath($path = '')
|
42 |
+
{
|
43 |
+
return $this['path.config'].ltrim($path, '/');
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Get plugin's /framework path
|
48 |
+
* @param string $path
|
49 |
+
* @return string
|
50 |
+
*/
|
51 |
+
public function frameworkPath($path = '')
|
52 |
+
{
|
53 |
+
return $this['path.framework'].ltrim($path, '/');
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Get plugin's /resources path
|
58 |
+
* @param string $path
|
59 |
+
* @return string
|
60 |
+
*/
|
61 |
+
public function resourcePath($path = '')
|
62 |
+
{
|
63 |
+
return $this['path.resource'].ltrim($path, '/');
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Get plugin's /resources/languages path
|
68 |
+
* @param string $path
|
69 |
+
* @return string
|
70 |
+
*/
|
71 |
+
public function languagePath($path = '')
|
72 |
+
{
|
73 |
+
return $this['path.language'].ltrim($path, '/');
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Get plugin's /storage path
|
78 |
+
* @param string $path
|
79 |
+
* @return string
|
80 |
+
*/
|
81 |
+
public function storagePath($path = '')
|
82 |
+
{
|
83 |
+
return $this['path.storage'].ltrim($path, '/');
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Get plugin's /resources/views path
|
88 |
+
* @param string $path
|
89 |
+
* @return string
|
90 |
+
*/
|
91 |
+
public function viewPath($path = '')
|
92 |
+
{
|
93 |
+
return $this['path.view'].ltrim($path, '/');
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Get plugin's /resources/assets path
|
98 |
+
* @param string $path
|
99 |
+
* @return string
|
100 |
+
*/
|
101 |
+
public function assetPath($path = '')
|
102 |
+
{
|
103 |
+
return $this['path.asset'].ltrim($path, '/');
|
104 |
+
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Get plugin's /public path
|
108 |
+
* @param string $path
|
109 |
+
* @return string
|
110 |
+
*/
|
111 |
+
public function publicPath($path = '')
|
112 |
+
{
|
113 |
+
return $this['path.public'].ltrim($path, '/');
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Get plugin's root url
|
118 |
+
* @param string $url
|
119 |
+
* @return string
|
120 |
+
*/
|
121 |
+
public function url($url = '')
|
122 |
+
{
|
123 |
+
return $this['url'].ltrim($url, '/');
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Get plugin's /public url
|
128 |
+
* @param string $url
|
129 |
+
* @return string
|
130 |
+
*/
|
131 |
+
public function publicUrl($url = '')
|
132 |
+
{
|
133 |
+
return $this['url.public'].ltrim($url, '/');
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* Get plugin's /resources url
|
138 |
+
* @param string $url
|
139 |
+
* @return string
|
140 |
+
*/
|
141 |
+
public function resourceUrl($url = '')
|
142 |
+
{
|
143 |
+
return $this['url.resource'].ltrim($url, '/');
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Get plugin's /resources/assets url
|
148 |
+
* @param string $url
|
149 |
+
* @return string
|
150 |
+
*/
|
151 |
+
public function assetUrl($url = '')
|
152 |
+
{
|
153 |
+
return $this['url.asset'].ltrim($url, '/');
|
154 |
+
}
|
155 |
+
}
|
framework/Foundation/Provider.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\Framework\Foundation;
|
4 |
+
|
5 |
+
abstract class Provider
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* $app \Framework\Foundation\Application
|
9 |
+
* @var null
|
10 |
+
*/
|
11 |
+
protected $app = null;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Build the instance
|
15 |
+
* @param \Framework\Foundation\Application $app
|
16 |
+
*/
|
17 |
+
public function __construct(Application $app)
|
18 |
+
{
|
19 |
+
$this->app = $app;
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Booted method for any provider
|
24 |
+
* @return void
|
25 |
+
*/
|
26 |
+
public function booted()
|
27 |
+
{
|
28 |
+
// ...
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Abstract booting method for provider
|
33 |
+
* @return void
|
34 |
+
*/
|
35 |
+
public abstract function booting();
|
36 |
+
}
|
framework/Foundation/SetGetAttributesTrait.php
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\Framework\Foundation;
|
4 |
+
|
5 |
+
trait SetGetAttributesTrait
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Dynamic getter for application
|
9 |
+
* @param string $key
|
10 |
+
* @return mixed
|
11 |
+
*/
|
12 |
+
public function __get($key)
|
13 |
+
{
|
14 |
+
return $this->make($key);
|
15 |
+
}
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Dynamic setter for application
|
19 |
+
* @param string $key
|
20 |
+
* @param mixed $value
|
21 |
+
*/
|
22 |
+
public function __set($key, $value)
|
23 |
+
{
|
24 |
+
$this[$key] = $value;
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Getter for retrieving plugin's base file path
|
29 |
+
* @return string
|
30 |
+
*/
|
31 |
+
public function getBaseFile()
|
32 |
+
{
|
33 |
+
return $this->baseFile;
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Get application's main config
|
38 |
+
* @return array
|
39 |
+
*/
|
40 |
+
public function getAppConfig()
|
41 |
+
{
|
42 |
+
return $this->appConfig;
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Get application's providers
|
47 |
+
* @param string $type [core|plugin]
|
48 |
+
* @return array
|
49 |
+
*/
|
50 |
+
public function getProviders($type = null)
|
51 |
+
{
|
52 |
+
$providers = $this->getAppConfig()['providers'];
|
53 |
+
|
54 |
+
return $type ? $providers[$type] : $providers;
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Get plugin name
|
59 |
+
* @return string
|
60 |
+
*/
|
61 |
+
public function getName()
|
62 |
+
{
|
63 |
+
return $this->getAppConfig()['plugin_name'];
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Get plugin slug
|
68 |
+
* @return string
|
69 |
+
*/
|
70 |
+
public function getSlug()
|
71 |
+
{
|
72 |
+
return $this->appConfig['plugin_slug'];
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Get plugin version
|
77 |
+
* @return string
|
78 |
+
*/
|
79 |
+
public function getVersion()
|
80 |
+
{
|
81 |
+
return $this->appConfig['plugin_version'];
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Get plugin root namespace
|
86 |
+
* @return string
|
87 |
+
*/
|
88 |
+
public function getNamespace()
|
89 |
+
{
|
90 |
+
return $this->getAppConfig()['autoload']['namespace'];
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Get plugin text domain
|
95 |
+
* @return string
|
96 |
+
*/
|
97 |
+
public function getTextDomain()
|
98 |
+
{
|
99 |
+
return $this->appConfig['plugin_text_domain']
|
100 |
+
? $this->appConfig['plugin_text_domain']
|
101 |
+
: $this->appConfig['plugin_slug'];
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* Get application evironment
|
106 |
+
* @return string
|
107 |
+
*/
|
108 |
+
public function getEnv()
|
109 |
+
{
|
110 |
+
if (isset($this->getAppConfig()['env'])) {
|
111 |
+
return $this->getAppConfig()['env'];
|
112 |
+
}
|
113 |
+
}
|
114 |
+
}
|
framework/Helpers/ArrayHelper.php
ADDED
@@ -0,0 +1,162 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\Framework\Helpers;
|
4 |
+
|
5 |
+
use Closure;
|
6 |
+
use ArrayAccess;
|
7 |
+
|
8 |
+
class ArrayHelper
|
9 |
+
{
|
10 |
+
/**
|
11 |
+
* Taken from Illuminate\Support\Arr (Laravel Framework)
|
12 |
+
*/
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Check if an item or items exist in an array using "dot" notation.
|
16 |
+
*
|
17 |
+
* @param \ArrayAccess|array $array
|
18 |
+
* @param string|array $keys
|
19 |
+
* @return bool
|
20 |
+
*/
|
21 |
+
public static function has($array, $keys)
|
22 |
+
{
|
23 |
+
if (is_null($keys)) {
|
24 |
+
return false;
|
25 |
+
}
|
26 |
+
|
27 |
+
$keys = (array) $keys;
|
28 |
+
|
29 |
+
if (! $array) {
|
30 |
+
return false;
|
31 |
+
}
|
32 |
+
|
33 |
+
if ($keys === []) {
|
34 |
+
return false;
|
35 |
+
}
|
36 |
+
|
37 |
+
foreach ($keys as $key) {
|
38 |
+
$subKeyArray = $array;
|
39 |
+
|
40 |
+
if (static::exists($array, $key)) {
|
41 |
+
continue;
|
42 |
+
}
|
43 |
+
|
44 |
+
foreach (explode('.', $key) as $segment) {
|
45 |
+
if (static::accessible($subKeyArray) && static::exists($subKeyArray, $segment)) {
|
46 |
+
$subKeyArray = $subKeyArray[$segment];
|
47 |
+
} else {
|
48 |
+
return false;
|
49 |
+
}
|
50 |
+
}
|
51 |
+
}
|
52 |
+
|
53 |
+
return true;
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Get an item from an array using "dot" notation.
|
58 |
+
*
|
59 |
+
* @param \ArrayAccess|array $array
|
60 |
+
* @param string $key
|
61 |
+
* @param mixed $default
|
62 |
+
* @return mixed
|
63 |
+
*/
|
64 |
+
public static function get($array, $key, $default = null)
|
65 |
+
{
|
66 |
+
if (! static::accessible($array)) {
|
67 |
+
return static::value($default);
|
68 |
+
}
|
69 |
+
|
70 |
+
if (is_null($key)) {
|
71 |
+
return $array;
|
72 |
+
}
|
73 |
+
|
74 |
+
if (static::exists($array, $key)) {
|
75 |
+
return $array[$key];
|
76 |
+
}
|
77 |
+
|
78 |
+
foreach (explode('.', $key) as $segment) {
|
79 |
+
if (static::accessible($array) && static::exists($array, $segment)) {
|
80 |
+
$array = $array[$segment];
|
81 |
+
} else {
|
82 |
+
return static::value($default);
|
83 |
+
}
|
84 |
+
}
|
85 |
+
|
86 |
+
return $array;
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Set an array item to a given value using "dot" notation.
|
91 |
+
*
|
92 |
+
* If no key is given to the method, the entire array will be replaced.
|
93 |
+
*
|
94 |
+
* @param array $array
|
95 |
+
* @param string $key
|
96 |
+
* @param mixed $value
|
97 |
+
* @return array
|
98 |
+
*/
|
99 |
+
public static function set(&$array, $key, $value)
|
100 |
+
{
|
101 |
+
if (is_null($key)) {
|
102 |
+
return $array = $value;
|
103 |
+
}
|
104 |
+
|
105 |
+
$keys = explode('.', $key);
|
106 |
+
|
107 |
+
while (count($keys) > 1) {
|
108 |
+
$key = array_shift($keys);
|
109 |
+
|
110 |
+
// If the key doesn't exist at this depth, we will just create an empty array
|
111 |
+
// to hold the next value, allowing us to create the arrays to hold final
|
112 |
+
// values at the correct depth. Then we'll keep digging into the array.
|
113 |
+
if (! isset($array[$key]) || ! is_array($array[$key])) {
|
114 |
+
$array[$key] = [];
|
115 |
+
}
|
116 |
+
|
117 |
+
$array = &$array[$key];
|
118 |
+
}
|
119 |
+
|
120 |
+
$array[array_shift($keys)] = $value;
|
121 |
+
|
122 |
+
return $array;
|
123 |
+
}
|
124 |
+
|
125 |
+
/**
|
126 |
+
* Determine whether the given value is array accessible.
|
127 |
+
*
|
128 |
+
* @param mixed $value
|
129 |
+
* @return bool
|
130 |
+
*/
|
131 |
+
public static function accessible($value)
|
132 |
+
{
|
133 |
+
return is_array($value) || $value instanceof ArrayAccess;
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* Determine if the given key exists in the provided array.
|
138 |
+
*
|
139 |
+
* @param \ArrayAccess|array $array
|
140 |
+
* @param string|int $key
|
141 |
+
* @return bool
|
142 |
+
*/
|
143 |
+
public static function exists($array, $key)
|
144 |
+
{
|
145 |
+
if ($array instanceof ArrayAccess) {
|
146 |
+
return $array->offsetExists($key);
|
147 |
+
}
|
148 |
+
|
149 |
+
return array_key_exists($key, $array);
|
150 |
+
}
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Return the default value of the given value.
|
154 |
+
*
|
155 |
+
* @param mixed $value
|
156 |
+
* @return mixed
|
157 |
+
*/
|
158 |
+
public static function value($value)
|
159 |
+
{
|
160 |
+
return $value instanceof Closure ? $value() : $value;
|
161 |
+
}
|
162 |
+
}
|
framework/Request/Request.php
ADDED
@@ -0,0 +1,216 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\Framework\Request;
|
4 |
+
|
5 |
+
use FluentForm\Framework\Foundation\Application;
|
6 |
+
|
7 |
+
class Request
|
8 |
+
{
|
9 |
+
protected $app = null;
|
10 |
+
protected $headers = array();
|
11 |
+
protected $server = array();
|
12 |
+
protected $cookie = array();
|
13 |
+
protected $json = array();
|
14 |
+
protected $get = array();
|
15 |
+
protected $post = array();
|
16 |
+
protected $request = array();
|
17 |
+
|
18 |
+
public function __construct($app, $get, $post)
|
19 |
+
{
|
20 |
+
$this->app = $app;
|
21 |
+
$this->server = $_SERVER;
|
22 |
+
$this->cookie = $_COOKIE;
|
23 |
+
$this->request = array_merge(
|
24 |
+
$this->get = $this->clean($get),
|
25 |
+
$this->post = $this->clean($post)
|
26 |
+
);
|
27 |
+
}
|
28 |
+
|
29 |
+
public function clean($request)
|
30 |
+
{
|
31 |
+
$clean = [];
|
32 |
+
foreach ($request as $key => $value) {
|
33 |
+
$key = trim(strip_tags(stripslashes($key)));
|
34 |
+
$clean[$key] = is_array($value) ? $this->clean($value) : $this->trimAndStrip($value);
|
35 |
+
}
|
36 |
+
return $clean;
|
37 |
+
}
|
38 |
+
|
39 |
+
public function trimAndStrip($value)
|
40 |
+
{
|
41 |
+
return trim(stripslashes($value));
|
42 |
+
}
|
43 |
+
|
44 |
+
public function set($key, $value)
|
45 |
+
{
|
46 |
+
$this->request[$key] = $value;
|
47 |
+
return $this;
|
48 |
+
}
|
49 |
+
|
50 |
+
public function all()
|
51 |
+
{
|
52 |
+
return $this->get();
|
53 |
+
}
|
54 |
+
|
55 |
+
public function get($key = null, $default = null)
|
56 |
+
{
|
57 |
+
if (!$key) {
|
58 |
+
return $this->request;
|
59 |
+
} else {
|
60 |
+
return isset($this->request[$key]) ? $this->request[$key] : $default;
|
61 |
+
}
|
62 |
+
}
|
63 |
+
|
64 |
+
public function query($key = null)
|
65 |
+
{
|
66 |
+
return $key ? $this->get[$key] : $this->get;
|
67 |
+
}
|
68 |
+
|
69 |
+
public function post($key = null)
|
70 |
+
{
|
71 |
+
return $key ? $this->post[$key] : $this->post;
|
72 |
+
}
|
73 |
+
|
74 |
+
public function only($args)
|
75 |
+
{
|
76 |
+
$values = [];
|
77 |
+
$keys = is_array($args) ? $args : func_get_args();
|
78 |
+
foreach ($keys as $key) {
|
79 |
+
$values[$key] = @$this->request[$key];
|
80 |
+
}
|
81 |
+
return $values;
|
82 |
+
}
|
83 |
+
|
84 |
+
public function except($args)
|
85 |
+
{
|
86 |
+
$values = [];
|
87 |
+
$keys = is_array($args) ? $args : func_get_args();
|
88 |
+
foreach ($this->request as $key => $value) {
|
89 |
+
if (!in_array($key, $keys)) {
|
90 |
+
$values[$key] = $this->request[$key];
|
91 |
+
}
|
92 |
+
}
|
93 |
+
return $values;
|
94 |
+
}
|
95 |
+
|
96 |
+
public function merge(array $data = [])
|
97 |
+
{
|
98 |
+
$this->request = array_merge($this->request, $data);
|
99 |
+
return $this;
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Get user ip address
|
104 |
+
* @return string
|
105 |
+
*/
|
106 |
+
public function getIp()
|
107 |
+
{
|
108 |
+
if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {
|
109 |
+
$ip = $this->server('HTTP_CLIENT_IP');
|
110 |
+
} elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
|
111 |
+
$ip = $this->server('HTTP_X_FORWARDED_FOR');
|
112 |
+
} else {
|
113 |
+
$ip = $this->server('REMOTE_ADDR');
|
114 |
+
}
|
115 |
+
|
116 |
+
return $ip;
|
117 |
+
}
|
118 |
+
|
119 |
+
public function server($key = null)
|
120 |
+
{
|
121 |
+
return $key ? $this->server[$key] : $this->server;
|
122 |
+
}
|
123 |
+
|
124 |
+
public function header($key = null)
|
125 |
+
{
|
126 |
+
if (!$this->headers) {
|
127 |
+
$this->headers = $this->setHeaders();
|
128 |
+
}
|
129 |
+
|
130 |
+
return $key ? $this->headers[$key] : $this->headers;
|
131 |
+
}
|
132 |
+
|
133 |
+
public function cookie($key = null)
|
134 |
+
{
|
135 |
+
return $key ? $this->cookie[$key] : $this->cookie;
|
136 |
+
}
|
137 |
+
|
138 |
+
/**
|
139 |
+
* Taken and modified from Symfony
|
140 |
+
*/
|
141 |
+
public function setHeaders()
|
142 |
+
{
|
143 |
+
$headers = array();
|
144 |
+
$parameters = $this->server;
|
145 |
+
$contentHeaders = array('CONTENT_LENGTH' => true, 'CONTENT_MD5' => true, 'CONTENT_TYPE' => true);
|
146 |
+
foreach ($parameters as $key => $value) {
|
147 |
+
if (0 === strpos($key, 'HTTP_')) {
|
148 |
+
$headers[substr($key, 5)] = $value;
|
149 |
+
}
|
150 |
+
// CONTENT_* are not prefixed with HTTP_
|
151 |
+
elseif (isset($contentHeaders[$key])) {
|
152 |
+
$headers[$key] = $value;
|
153 |
+
}
|
154 |
+
}
|
155 |
+
|
156 |
+
if (isset($parameters['PHP_AUTH_USER'])) {
|
157 |
+
$headers['PHP_AUTH_USER'] = $parameters['PHP_AUTH_USER'];
|
158 |
+
$headers['PHP_AUTH_PW'] = isset($parameters['PHP_AUTH_PW']) ? $parameters['PHP_AUTH_PW'] : '';
|
159 |
+
} else {
|
160 |
+
/*
|
161 |
+
* php-cgi under Apache does not pass HTTP Basic user/pass to PHP by default
|
162 |
+
* For this workaround to work, add these lines to your .htaccess file:
|
163 |
+
* RewriteCond %{HTTP:Authorization} ^(.+)$
|
164 |
+
* RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
165 |
+
*
|
166 |
+
* A sample .htaccess file:
|
167 |
+
* RewriteEngine On
|
168 |
+
* RewriteCond %{HTTP:Authorization} ^(.+)$
|
169 |
+
* RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
170 |
+
* RewriteCond %{REQUEST_FILENAME} !-f
|
171 |
+
* RewriteRule ^(.*)$ app.php [QSA,L]
|
172 |
+
*/
|
173 |
+
|
174 |
+
$authorizationHeader = null;
|
175 |
+
if (isset($parameters['HTTP_AUTHORIZATION'])) {
|
176 |
+
$authorizationHeader = $parameters['HTTP_AUTHORIZATION'];
|
177 |
+
} elseif (isset($parameters['REDIRECT_HTTP_AUTHORIZATION'])) {
|
178 |
+
$authorizationHeader = $parameters['REDIRECT_HTTP_AUTHORIZATION'];
|
179 |
+
}
|
180 |
+
|
181 |
+
if (null !== $authorizationHeader) {
|
182 |
+
if (0 === stripos($authorizationHeader, 'basic ')) {
|
183 |
+
// Decode AUTHORIZATION header into PHP_AUTH_USER and PHP_AUTH_PW when authorization header is basic
|
184 |
+
$exploded = explode(':', base64_decode(substr($authorizationHeader, 6)), 2);
|
185 |
+
if (count($exploded) == 2) {
|
186 |
+
list($headers['PHP_AUTH_USER'], $headers['PHP_AUTH_PW']) = $exploded;
|
187 |
+
}
|
188 |
+
} elseif (empty($parameters['PHP_AUTH_DIGEST']) && (0 === stripos($authorizationHeader, 'digest '))) {
|
189 |
+
// In some circumstances PHP_AUTH_DIGEST needs to be set
|
190 |
+
$headers['PHP_AUTH_DIGEST'] = $authorizationHeader;
|
191 |
+
$parameters['PHP_AUTH_DIGEST'] = $authorizationHeader;
|
192 |
+
} elseif (0 === stripos($authorizationHeader, 'bearer ')) {
|
193 |
+
/*
|
194 |
+
* XXX: Since there is no PHP_AUTH_BEARER in PHP predefined variables,
|
195 |
+
* I'll just set $headers['AUTHORIZATION'] here.
|
196 |
+
* http://php.net/manual/en/reserved.variables.server.php
|
197 |
+
*/
|
198 |
+
$headers['AUTHORIZATION'] = $authorizationHeader;
|
199 |
+
}
|
200 |
+
}
|
201 |
+
}
|
202 |
+
|
203 |
+
if (isset($headers['AUTHORIZATION'])) {
|
204 |
+
return $headers;
|
205 |
+
}
|
206 |
+
|
207 |
+
// PHP_AUTH_USER/PHP_AUTH_PW
|
208 |
+
if (isset($headers['PHP_AUTH_USER'])) {
|
209 |
+
$headers['AUTHORIZATION'] = 'Basic '.base64_encode($headers['PHP_AUTH_USER'].':'.$headers['PHP_AUTH_PW']);
|
210 |
+
} elseif (isset($headers['PHP_AUTH_DIGEST'])) {
|
211 |
+
$headers['AUTHORIZATION'] = $headers['PHP_AUTH_DIGEST'];
|
212 |
+
}
|
213 |
+
|
214 |
+
return $headers;
|
215 |
+
}
|
216 |
+
}
|
framework/Request/RequestProvider.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\Framework\Request;
|
4 |
+
|
5 |
+
use FluentForm\Framework\Foundation\Provider;
|
6 |
+
|
7 |
+
class RequestProvider extends Provider
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* The provider booting method to boot this provider
|
11 |
+
* @return void
|
12 |
+
*/
|
13 |
+
public function booting()
|
14 |
+
{
|
15 |
+
$this->app->bindSingleton('request', function($app) {
|
16 |
+
return new Request($app, $_GET, $_POST);
|
17 |
+
}, 'Request', 'FluentForm\Framework\Request\Request');
|
18 |
+
}
|
19 |
+
}
|
framework/View/View.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\Framework\View;
|
4 |
+
|
5 |
+
class View
|
6 |
+
{
|
7 |
+
protected $app = null;
|
8 |
+
|
9 |
+
public function __construct($app)
|
10 |
+
{
|
11 |
+
$this->app = $app;
|
12 |
+
}
|
13 |
+
|
14 |
+
public function make($path, $data = [])
|
15 |
+
{
|
16 |
+
$path = str_replace('.', DIRECTORY_SEPARATOR, $path);
|
17 |
+
$file = $this->app->viewPath($path).'.php';
|
18 |
+
if (file_exists($file)) {
|
19 |
+
ob_start();
|
20 |
+
extract($data);
|
21 |
+
include $file;
|
22 |
+
return ob_get_clean();
|
23 |
+
}
|
24 |
+
|
25 |
+
throw new \InvalidArgumentException("The view file [$file] doesn't exists!");
|
26 |
+
}
|
27 |
+
|
28 |
+
public function render($path, $data = [])
|
29 |
+
{
|
30 |
+
echo $this->make($path, $data);
|
31 |
+
}
|
32 |
+
}
|
framework/View/ViewProvider.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FluentForm\Framework\View;
|
4 |
+
|
5 |
+
use FluentForm\Framework\Foundation\Provider;
|
6 |
+
|
7 |
+
class ViewProvider extends Provider
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* The provider booting method to boot this provider
|
11 |
+
* @return void
|
12 |
+
*/
|
13 |
+
public function booting()
|
14 |
+
{
|
15 |
+
$this->app->bind('view', function($app) {
|
16 |
+
return new View($app);
|
17 |
+
}, 'View', 'FluentForm\Framework\View\View');
|
18 |
+
}
|
19 |
+
}
|
framework/index.php
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// silence is golden
|
glue.json
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"plugin_name": "FluentForm",
|
3 |
+
"plugin_slug": "fluentform",
|
4 |
+
"plugin_text_domain": "fluentform",
|
5 |
+
"plugin_version": "1.1.0",
|
6 |
+
"plugin_description": "The most advanced drag and drop form builder plugin for WordPress",
|
7 |
+
"plugin_uri": "https://wpfluentform.com",
|
8 |
+
"plugin_license": "GPLv2 or later",
|
9 |
+
"author_name": "WPFluentForm Team",
|
10 |
+
"author_email": "support@wpfluentform.com",
|
11 |
+
"author_uri": "https://wpfluentform.com",
|
12 |
+
"autoload": {
|
13 |
+
"namespace": "FluentForm",
|
14 |
+
"mapping": {
|
15 |
+
"App": "app",
|
16 |
+
"Framework": "framework"
|
17 |
+
}
|
18 |
+
}
|
19 |
+
}
|
index.php
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// silence is golden
|
public/css/fluent-all-forms.css
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
@font-face{font-family:element-icons;src:url(../fonts/element-icons.woff?2fad952a20fbbcfd1bf2ebb210dccf7a) format("woff"),url(../fonts/element-icons.ttf?6f0a76321d30f3c8120915e57f7bd77e) format("truetype");font-weight:400;font-style:normal}[class*=" el-icon-"],[class^=el-icon-]{font-family:element-icons!important;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;vertical-align:baseline;display:inline-block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.el-icon-upload:before{content:"\E60D"}.el-icon-error:before{content:"\E62C"}.el-icon-success:before{content:"\E62D"}.el-icon-warning:before{content:"\E62E"}.el-icon-sort-down:before{content:"\E630"}.el-icon-sort-up:before{content:"\E631"}.el-icon-arrow-left:before{content:"\E600"}.el-icon-circle-plus:before{content:"\E601"}.el-icon-circle-plus-outline:before{content:"\E602"}.el-icon-arrow-down:before{content:"\E603"}.el-icon-arrow-right:before{content:"\E604"}.el-icon-arrow-up:before{content:"\E605"}.el-icon-back:before{content:"\E606"}.el-icon-circle-close:before{content:"\E607"}.el-icon-date:before{content:"\E608"}.el-icon-circle-close-outline:before{content:"\E609"}.el-icon-caret-left:before{content:"\E60A"}.el-icon-caret-bottom:before{content:"\E60B"}.el-icon-caret-top:before{content:"\E60C"}.el-icon-caret-right:before{content:"\E60E"}.el-icon-close:before{content:"\E60F"}.el-icon-d-arrow-left:before{content:"\E610"}.el-icon-check:before{content:"\E611"}.el-icon-delete:before{content:"\E612"}.el-icon-d-arrow-right:before{content:"\E613"}.el-icon-document:before{content:"\E614"}.el-icon-d-caret:before{content:"\E615"}.el-icon-edit-outline:before{content:"\E616"}.el-icon-download:before{content:"\E617"}.el-icon-goods:before{content:"\E618"}.el-icon-search:before{content:"\E619"}.el-icon-info:before{content:"\E61A"}.el-icon-message:before{content:"\E61B"}.el-icon-edit:before{content:"\E61C"}.el-icon-location:before{content:"\E61D"}.el-icon-loading:before{content:"\E61E"}.el-icon-location-outline:before{content:"\E61F"}.el-icon-menu:before{content:"\E620"}.el-icon-minus:before{content:"\E621"}.el-icon-bell:before{content:"\E622"}.el-icon-mobile-phone:before{content:"\E624"}.el-icon-news:before{content:"\E625"}.el-icon-more:before{content:"\E646"}.el-icon-more-outline:before{content:"\E626"}.el-icon-phone:before{content:"\E627"}.el-icon-phone-outline:before{content:"\E628"}.el-icon-picture:before{content:"\E629"}.el-icon-picture-outline:before{content:"\E62A"}.el-icon-plus:before{content:"\E62B"}.el-icon-printer:before{content:"\E62F"}.el-icon-rank:before{content:"\E632"}.el-icon-refresh:before{content:"\E633"}.el-icon-question:before{content:"\E634"}.el-icon-remove:before{content:"\E635"}.el-icon-share:before{content:"\E636"}.el-icon-star-on:before{content:"\E637"}.el-icon-setting:before{content:"\E638"}.el-icon-circle-check:before{content:"\E639"}.el-icon-service:before{content:"\E63A"}.el-icon-sold-out:before{content:"\E63B"}.el-icon-remove-outline:before{content:"\E63C"}.el-icon-star-off:before{content:"\E63D"}.el-icon-circle-check-outline:before{content:"\E63E"}.el-icon-tickets:before{content:"\E63F"}.el-icon-sort:before{content:"\E640"}.el-icon-zoom-in:before{content:"\E641"}.el-icon-time:before{content:"\E642"}.el-icon-view:before{content:"\E643"}.el-icon-upload2:before{content:"\E644"}.el-icon-zoom-out:before{content:"\E645"}.el-icon-loading{-webkit-animation:rotating 2s linear infinite;animation:rotating 2s linear infinite}.el-icon--right{margin-left:5px}.el-icon--left{margin-right:5px}@-webkit-keyframes rotating{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes rotating{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.ff_all_forms .pull-right{float:right}.ff_all_forms .form_navigation{margin-bottom:20px}
|
2 |
+
/*# sourceMappingURL=fluent-all-forms.css.map*/
|
public/css/fluent-all-forms.css.map
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"version":3,"file":"/css/fluent-all-forms.css","sources":[],"mappings":"","sourceRoot":""}
|
public/css/fluent-forms-admin-sass.css
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:inherit;font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}[hidden],template{display:none}@font-face{font-family:element-icons;src:url(../fonts/element-icons.woff?2fad952a20fbbcfd1bf2ebb210dccf7a) format("woff"),url(../fonts/element-icons.ttf?6f0a76321d30f3c8120915e57f7bd77e) format("truetype");font-weight:400;font-style:normal}[class*=" el-icon-"],[class^=el-icon-]{font-family:element-icons!important;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;vertical-align:baseline;display:inline-block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.el-icon-upload:before{content:"\E60D"}.el-icon-error:before{content:"\E62C"}.el-icon-success:before{content:"\E62D"}.el-icon-warning:before{content:"\E62E"}.el-icon-sort-down:before{content:"\E630"}.el-icon-sort-up:before{content:"\E631"}.el-icon-arrow-left:before{content:"\E600"}.el-icon-circle-plus:before{content:"\E601"}.el-icon-circle-plus-outline:before{content:"\E602"}.el-icon-arrow-down:before{content:"\E603"}.el-icon-arrow-right:before{content:"\E604"}.el-icon-arrow-up:before{content:"\E605"}.el-icon-back:before{content:"\E606"}.el-icon-circle-close:before{content:"\E607"}.el-icon-date:before{content:"\E608"}.el-icon-circle-close-outline:before{content:"\E609"}.el-icon-caret-left:before{content:"\E60A"}.el-icon-caret-bottom:before{content:"\E60B"}.el-icon-caret-top:before{content:"\E60C"}.el-icon-caret-right:before{content:"\E60E"}.el-icon-close:before{content:"\E60F"}.el-icon-d-arrow-left:before{content:"\E610"}.el-icon-check:before{content:"\E611"}.el-icon-delete:before{content:"\E612"}.el-icon-d-arrow-right:before{content:"\E613"}.el-icon-document:before{content:"\E614"}.el-icon-d-caret:before{content:"\E615"}.el-icon-edit-outline:before{content:"\E616"}.el-icon-download:before{content:"\E617"}.el-icon-goods:before{content:"\E618"}.el-icon-search:before{content:"\E619"}.el-icon-info:before{content:"\E61A"}.el-icon-message:before{content:"\E61B"}.el-icon-edit:before{content:"\E61C"}.el-icon-location:before{content:"\E61D"}.el-icon-loading:before{content:"\E61E"}.el-icon-location-outline:before{content:"\E61F"}.el-icon-menu:before{content:"\E620"}.el-icon-minus:before{content:"\E621"}.el-icon-bell:before{content:"\E622"}.el-icon-mobile-phone:before{content:"\E624"}.el-icon-news:before{content:"\E625"}.el-icon-more:before{content:"\E646"}.el-icon-more-outline:before{content:"\E626"}.el-icon-phone:before{content:"\E627"}.el-icon-phone-outline:before{content:"\E628"}.el-icon-picture:before{content:"\E629"}.el-icon-picture-outline:before{content:"\E62A"}.el-icon-plus:before{content:"\E62B"}.el-icon-printer:before{content:"\E62F"}.el-icon-rank:before{content:"\E632"}.el-icon-refresh:before{content:"\E633"}.el-icon-question:before{content:"\E634"}.el-icon-remove:before{content:"\E635"}.el-icon-share:before{content:"\E636"}.el-icon-star-on:before{content:"\E637"}.el-icon-setting:before{content:"\E638"}.el-icon-circle-check:before{content:"\E639"}.el-icon-service:before{content:"\E63A"}.el-icon-sold-out:before{content:"\E63B"}.el-icon-remove-outline:before{content:"\E63C"}.el-icon-star-off:before{content:"\E63D"}.el-icon-circle-check-outline:before{content:"\E63E"}.el-icon-tickets:before{content:"\E63F"}.el-icon-sort:before{content:"\E640"}.el-icon-zoom-in:before{content:"\E641"}.el-icon-time:before{content:"\E642"}.el-icon-view:before{content:"\E643"}.el-icon-upload2:before{content:"\E644"}.el-icon-zoom-out:before{content:"\E645"}.el-icon-loading{-webkit-animation:rotating 2s linear infinite;animation:rotating 2s linear infinite}.el-icon--right{margin-left:5px}.el-icon--left{margin-right:5px}@-webkit-keyframes rotating{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes rotating{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@font-face{font-family:fluentform;src:url(../fonts/fluentform.eot?c6ad32560530b158258da8bee31bc80a);src:url(../fonts/fluentform.eot?c6ad32560530b158258da8bee31bc80a?#iefix) format("embedded-opentype"),url(../fonts/fluentform.woff?7753d2a8d140e45383ed24de75172d05) format("woff"),url(../fonts/fluentform.ttf?2379f7856878026a221b7ee7a7c5509b) format("truetype"),url(../fonts/fluentform.svg?6c683e8865864125f103bf269ead2784#fluentform) format("svg");font-weight:400;font-style:normal}[data-icon]:before{content:attr(data-icon)}[class*=" icon-"]:before,[class^=icon-]:before,[data-icon]:before{font-family:fluentform!important;font-style:normal!important;font-weight:400!important;font-variant:normal!important;text-transform:none!important;speak:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-trash-o:before{content:"\E000"}.icon-pencil:before{content:"\E001"}.icon-clone:before{content:"\E002"}.icon-arrows:before{content:"\E003"}.icon-user:before{content:"\E004"}.icon-text-width:before{content:"\E005"}.icon-unlock-alt:before{content:"\E006"}.icon-paragraph:before{content:"\E007"}.icon-columns:before{content:"\E008"}.icon-plus-circle:before{content:"\E009"}.icon-minus-circle:before{content:"\E00A"}.icon-link:before{content:"\E00B"}.icon-envelope-o:before{content:"\E00C"}.icon-caret-square-o-down:before{content:"\E00D"}.icon-list-ul:before{content:"\E00E"}.icon-dot-circle-o:before{content:"\E00F"}.icon-check-square-o:before{content:"\E010"}.icon-eye-slash:before{content:"\E011"}.icon-picture-o:before{content:"\E012"}.icon-calendar-o:before{content:"\E013"}.icon-upload:before{content:"\E014"}.icon-globe:before{content:"\E015"}.icon-pound:before{content:"\E016"}.icon-map-marker:before{content:"\E017"}.icon-credit-card:before{content:"\E018"}.icon-step-forward:before{content:"\E019"}.icon-code:before{content:"\E01A"}.icon-html5:before{content:"\E01B"}.icon-qrcode:before{content:"\E01C"}.icon-certificate:before{content:"\E01D"}.icon-star-half-o:before{content:"\E01E"}.icon-eye:before{content:"\E01F"}.icon-save:before{content:"\E020"}.icon-puzzle-piece:before{content:"\E021"}.icon-slack:before{content:"\E022"}.icon-trash:before{content:"\E023"}.icon-lock:before{content:"\E024"}.icon-chevron-down:before{content:"\E025"}.icon-chevron-up:before{content:"\E026"}.icon-chevron-right:before{content:"\E027"}.icon-chevron-left:before{content:"\E028"}.icon-circle-o:before{content:"\E029"}.icon-cog:before{content:"\E02A"}.icon-info:before{content:"\E02C"}.icon-info-circle:before{content:"\E02B"}p{margin-top:0;margin-bottom:10px}.icon{font:normal normal normal 14px/1 ultimateform;display:inline-block}.mr15{margin-right:15px}.mb15{margin-bottom:15px}.pull-left{float:left!important}.pull-right{float:right!important}.text-left{text-align:left}.text-center{text-align:center}.el-icon-clickable{cursor:pointer}.help-text{margin:0;font-style:italic;font-size:.9em}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:500;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-block{width:100%}.clearfix:after,.clearfix:before,.form-editor:after,.form-editor:before{display:table;content:" "}.clearfix:after,.form-editor:after{clear:both}.form-editor *{-webkit-box-sizing:border-box;box-sizing:border-box}.form-editor--body,.form-editor--sidebar{float:left}.form-editor--body{width:calc(100% - 350px);padding-right:15px}.form-editor--sidebar{width:350px}.ultimate-nav-menu{background-color:#fff;border-radius:4px}.ultimate-nav-menu>ul{margin:0}.ultimate-nav-menu>ul>li{display:inline-block;margin:0;font-weight:600}.ultimate-nav-menu>ul>li+li{margin-left:-4px}.ultimate-nav-menu>ul>li a{padding:10px;display:block;text-decoration:none;color:#23282d}.ultimate-nav-menu>ul>li a:hover{background-color:#337ab7;color:#fff}.ultimate-nav-menu>ul>li:first-of-type a{border-radius:4px 0 0 4px}.ultimate-nav-menu>ul>li.active a{background-color:#337ab7;color:#fff}.nav-tabs{border:1px solid #eee;border-radius:8px}.nav-tabs *{-webkit-box-sizing:border-box;box-sizing:border-box}.nav-tab-list{border-radius:8px 8px 0 0;margin:0}.nav-tab-list li{border-bottom:1px solid #eee;display:inline-block;margin-bottom:0;text-align:center;background-color:#f5f5f5}.nav-tab-list li+li{margin-left:-4x;border-left:1px solid #eee}.nav-tab-list li:hover{background-color:#e8e8e8}.nav-tab-list li.active{background-color:#fff;border-bottom-color:#fff}.nav-tab-list li a{color:#000;display:block;padding:12px;font-weight:600;text-decoration:none}.nav-tab-list li a:focus{-webkit-box-shadow:none;box-shadow:none}.toggle-fields-options{overflow:hidden}.toggle-fields-options li{width:50%;float:left}.nav-tab-items{background-color:#fff;padding:0 15px;border-radius:0 0 8px 8px}.vddl-draggable,.vddl-list{position:relative}.vddl-dragging{opacity:1}.vddl-dragging-source{display:none}.select{min-width:200px}.new-elements .btn-element{border:1px solid #909399;height:30px;border-radius:3px;background-color:#f9f9f9;display:block;color:#5d6066;cursor:move;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-webkit-transition:all .05s;transition:all .05s}.new-elements .btn-element:active:not([draggable=false]){-webkit-box-shadow:inset 0 2px 7px -4px rgba(0,0,0,.5);box-shadow:inset 0 2px 7px -4px rgba(0,0,0,.5);-webkit-transform:translateY(1px);transform:translateY(1px)}.new-elements .btn-element .icon{color:#fff;vertical-align:middle;padding:0 6px;margin-right:5px;line-height:30px;background-color:#909399}.new-elements .btn-element[draggable=false]{opacity:.5;cursor:pointer}.mtb15{margin-top:15px;margin-bottom:15px}.text-right{text-align:right}.container,footer{max-width:980px;min-width:730px;margin:0 auto}.help-text{margin-bottom:0}.demo-content{width:100%}.vddl-list__handle div.vddl-nodrag{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vddl-list__handle input[type=radio]{margin-right:0}.vddl-list__handle .nodrag div{margin-right:6px}.vddl-list__handle .nodrag div:last-of-type{margin-right:0}.vddl-list__handle .handle{cursor:move;width:25px;height:16px;background:url(../images/handle.png?36c8d5868cb842bd222959270ccba3f5) 50% no-repeat;background-size:20px 20px}.vddl-draggable .el-form-item{margin-bottom:5px}.tooltip-icon{color:#828f96;vertical-align:middle!important}.option-fields-section--title{padding:8px 15px;margin:0 -15px;font-size:13px;font-weight:600;border-bottom:1px solid #e3e3e3;cursor:pointer;overflow:hidden;position:relative}.option-fields-section--title:after{content:"\E025";position:absolute;right:15px;font-family:fluentform;vertical-align:middle}.option-fields-section--title.active:after{content:"\E026"}.option-fields-section--icon{float:right;vertical-align:middle;margin-top:3px}.option-fields-section--content{max-height:1050vh;margin-top:10px;margin-left:-15px;margin-right:-15px;padding:0 15px;border-bottom:1px solid #e3e3e3}.option-fields-section--content:last-child{border:0}.slide-fade-enter-active,.slide-fade-leave-active{-webkit-transition:all .6s;transition:all .6s;overflow:hidden}.slide-fade-enter,.slide-fade-leave-to{opacity:.2;max-height:0;-webkit-transform:translateY(-11px);transform:translateY(-11px)}.panel{border-radius:8px;border:1px solid #ebebeb;overflow:hidden;margin-bottom:15px}.panel__heading{background:#f5f5f5;border-bottom:1px solid #ebebeb;height:42px}.panel__heading .form-name-editable{margin:0;float:left;font-size:14px;padding:4px 8px;margin:8px 0 8px 8px;max-width:250px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border-radius:2px}.panel__heading .form-name-editable:hover{background-color:#fff;cursor:pointer}.panel__heading .copy-form-shortcode{float:left;padding:4px 8px;margin:8px 0 8px 8px;background-color:#909399;color:#fff;cursor:pointer;border-radius:2px}.panel__heading--btn{padding:3px}.panel__heading .form-inline{padding:5px;float:left}.panel__body{background:#fff;padding:10px 0}.panel__body p{font-size:14px;line-height:20px;color:#666}.panel__body--list{background:#fff}.panel__body--item,.panel__body .panel__placeholder{width:100%;min-height:70px;padding:10px;background:#fff;-webkit-box-sizing:border-box;box-sizing:border-box}.panel__body--item.no-padding-left{padding-left:0}.panel__body--item:last-child{border-bottom:none}.panel__body--item{position:relative}.panel__body--item.selected{background-color:rgba(255,228,87,.35)}.panel__body--item:hover>.item-actions-wrapper{opacity:1;visibility:visible}.panel .panel__placeholder{background:#f5f5f5}.panel.panel--info .panel__body,.panel>.panel__body{padding:15px}.el-fluid{width:100%!important}.label-block{display:inline-block;margin-bottom:10px;line-height:1;font-weight:500}.form-group{margin-bottom:15px}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-box-shadow .15s ease-in-out}textarea.form-control{height:auto}label.is-required:before{content:"* ";color:red}.el-checkbox-horizontal,.el-radio-horizontal{display:inline-block}.el-checkbox-horizontal .el-checkbox,.el-checkbox-horizontal .el-radio,.el-radio-horizontal .el-checkbox,.el-radio-horizontal .el-radio{display:block;white-space:normal;margin-left:23px;margin-bottom:7px}.el-checkbox-horizontal .el-checkbox+.el-checkbox,.el-checkbox-horizontal .el-checkbox+.el-radio,.el-checkbox-horizontal .el-radio+.el-checkbox,.el-checkbox-horizontal .el-radio+.el-radio,.el-radio-horizontal .el-checkbox+.el-checkbox,.el-radio-horizontal .el-checkbox+.el-radio,.el-radio-horizontal .el-radio+.el-checkbox,.el-radio-horizontal .el-radio+.el-radio{margin-left:23px}.el-checkbox-horizontal .el-checkbox__input,.el-checkbox-horizontal .el-radio__input,.el-radio-horizontal .el-checkbox__input,.el-radio-horizontal .el-radio__input{margin-left:-23px}.form-inline{display:inline-block}.form-inline .el-input{width:auto}.v-form-item{margin-bottom:15px}.v-form-item:last-of-type{margin-bottom:0}.v-form-item label{margin-top:9px;display:inline-block}.settings-page{background-color:#fff}.settings-body{padding:15px}.el-text-primary{color:#20a0ff}.el-text-info{color:#58b7ff}.el-text-success{color:#13ce66}.el-text-warning{color:#f7ba2a}.el-text-danger{color:#ff4949}.el-notification__content{text-align:left}.action-buttons .el-button+.el-button{margin-left:0}.el-box-card{-webkit-box-shadow:none;box-shadow:none}.el-box-footer,.el-box-header{background-color:#edf1f6;padding:15px}.el-box-body{padding:15px}.el-form-item__force-inline.el-form-item__label{float:left;padding:11px 12px 11px 0}.el-form-item .el-form-item{margin-bottom:10px}.el-form-item__content .line{text-align:center}.el-basic-collapse{border:0;margin-bottom:15px}.el-basic-collapse .el-collapse-item__header{padding-left:0;display:inline-block;border:0}.el-basic-collapse .el-collapse-item__wrap{border:0}.el-basic-collapse .el-collapse-item__content{padding:0;background-color:#fff}.el-collapse-settings{margin-bottom:15px}.el-collapse-settings .el-collapse-item__header{background:#f1f1f1;padding-left:20px}.el-collapse-settings .el-collapse-item__content{padding-bottom:0;margin-top:15px}.el-collapse-settings [class*=" el-icon-"],.el-collapse-settings [class^=el-icon-]{line-height:48px}.el-popover{text-align:left}.option-fields-section--content .el-form-item{margin-bottom:10px}.option-fields-section--content .el-form-item__label{padding-bottom:5px;font-size:13px;line-height:1}.option-fields-section--content .el-input__inner{height:30px;padding:0 8px}.el-dropdown-list{border:0;margin:5px 0;-webkit-box-shadow:none;box-shadow:none;padding:0;z-index:10;position:static;min-width:auto;max-height:220px;overflow-y:scroll}.el-dropdown-list .el-dropdown-menu__item{line-height:18px;padding:4px 10px}.el-form-nested.el-form--label-left .el-form-item__label{float:left;padding:10px 5px 10px 0}.el-message{top:40px}.el-button{text-decoration:none}.vddl-list .el-form-item__label{line-height:1}.list-group{margin:0}.list-group>li.title{background:#ddd;padding:5px 10px}.list-group li{line-height:1.5;margin-bottom:6px}.list-group li>ul{padding-left:10px;padding-right:10px}.flex-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.flex-container .flex-col{-webkit-box-flex:1;-ms-flex:1 100%;flex:1 100%;padding-left:10px;padding-right:10px}.flex-container .flex-col:first-child{padding-left:0}.flex-container .flex-col:last-child{padding-right:0}.hidden-field-item{background-color:#f5f5f5;margin-bottom:10px}#resize-sidebar{position:absolute;top:0;bottom:0;left:-15px;width:15px;cursor:col-resize}#resize-sidebar:before{content:url(../images/resize.png?f8d52106453298dd96a6d2050c144501);position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);left:-4px;width:15px}#resize-sidebar:after{content:" ";border-left:1px solid #bebebe;position:absolute;left:7px;top:0;bottom:0}.form-step__wrapper.form-step__wrapper{background:#f5f5f5;border:1px solid #f0f0f0;padding:10px}.form-step__start{border-radius:3px 3px 0 0;margin-bottom:10px;border-radius:0 0 3px 3px}.step-start{margin-left:-10px;margin-right:-10px}.step-start__indicator{text-align:center;position:relative;padding:5px 0}.step-start__indicator strong{font-size:14px;font-weight:600;color:#000;background:#f5f5f5;padding:3px 10px;position:relative;z-index:2}.step-start__indicator hr{position:absolute;top:7px;left:10px;right:10px;border:0;z-index:1;border-top:1px solid #e3e3e3}.vddl-list{padding-left:0;min-height:70px}.vddl-placeholder{width:100%;min-height:70px;border:1px dashed #cfcfcf;background:#f5f5f5}.empty-dropzone{height:70px;border:1px dashed #cfcfcf}.empty-dropzone.vddl-dragover{border-color:transparent;height:auto}.field-option-settings .section-heading{font-size:15px;margin-top:0;border-bottom:1px solid #f5f5f5;margin-bottom:1rem;padding-bottom:8px}.item-actions-wrapper{top:0;opacity:0;z-index:3;position:absolute;-webkit-transition:all .3s;transition:all .3s;visibility:hidden}.item-actions{background-color:#000}.item-actions .icon{color:#fff;cursor:pointer;padding:7px 5px}.item-actions .icon:hover{background-color:#42b983}.hover-action-top-right{top:-12px;right:15px}.hover-action-middle{left:0;width:100%;height:100%;border:1px dashed red;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;background-color:rgba(255,228,87,.35)}.hover-action-middle,.item-container{display:-webkit-box;display:-ms-flexbox;display:flex}.item-container{border:1px dashed #dcdbdb}.item-container .col{-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;border-right:1px dashed #dcdbdb;-ms-flex-preferred-size:0;flex-basis:0}.item-container .col:last-of-type{border-right:0}.ff-el-form-left .el-form-item__label,.ff-el-form-right .el-form-item__label{padding-right:10px;float:left;width:120px;line-height:40px;padding-bottom:0}.ff-el-form-left .el-form-item__content,.ff-el-form-right .el-form-item__content{margin-left:120px}.ff-el-form-top .el-form-item__label{text-align:left;padding-bottom:10px;float:none;display:inline-block;line-height:1}.ff-el-form-top .el-form-item__content{margin-left:auto!important}.ff-el-form-left .el-form-item__label{text-align:left}.ff-el-form-right .el-form-item__label{text-align:right}.entry_navs a{text-decoration:none;padding:2px 5px}.entry_navs a.active{background:#20a0ff;color:#fff}
|
2 |
+
/*# sourceMappingURL=fluent-forms-admin-sass.css.map*/
|
public/css/fluent-forms-admin-sass.css.map
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"version":3,"file":"/css/fluent-forms-admin-sass.css","sources":[],"mappings":"","sourceRoot":""}
|
public/css/fluent-forms-admin.css
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
.v-row{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.v-row>[class*=v-col--]{-webkit-box-sizing:border-box;box-sizing:border-box}.v-row .v-col--auto{width:100%}.v-row .v-col--100{width:100%;width:calc((100% - 15px*0) / 1)}.v-row.v-row--no-gutter .v-col--100{width:100%}.v-row .v-col--95{width:95%;width:calc((100% - 15px*0.05263157894736836) / 1.0526315789473684)}.v-row.v-row--no-gutter .v-col--95{width:95%}.v-row .v-col--90{width:90%;width:calc((100% - 15px*0.11111111111111116) / 1.1111111111111112)}.v-row.v-row--no-gutter .v-col--90{width:90%}.v-row .v-col--85{width:85%;width:calc((100% - 15px*0.17647058823529416) / 1.1764705882352942)}.v-row.v-row--no-gutter .v-col--85{width:85%}.v-row .v-col--80{width:80%;width:calc((100% - 15px*0.25) / 1.25)}.v-row.v-row--no-gutter .v-col--80{width:80%}.v-row .v-col--75{width:75%;width:calc((100% - 15px*0.33333333333333326) / 1.3333333333333333)}.v-row.v-row--no-gutter .v-col--75{width:75%}.v-row .v-col--70{width:70%;width:calc((100% - 15px*0.4285714285714286) / 1.4285714285714286)}.v-row.v-row--no-gutter .v-col--70{width:70%}.v-row .v-col--66{width:66.66666666666666%;width:calc((100% - 15px*0.5000000000000002) / 1.5000000000000002)}.v-row.v-row--no-gutter .v-col--66{width:66.66666666666666%}.v-row .v-col--65{width:65%;width:calc((100% - 15px*0.5384615384615385) / 1.5384615384615385)}.v-row.v-row--no-gutter .v-col--65{width:65%}.v-row .v-col--60{width:60%;width:calc((100% - 15px*0.6666666666666667) / 1.6666666666666667)}.v-row.v-row--no-gutter .v-col--60{width:60%}.v-row .v-col--55{width:55%;width:calc((100% - 15px*0.8181818181818181) / 1.8181818181818181)}.v-row.v-row--no-gutter .v-col--55{width:55%}.v-row .v-col--50{width:50%;width:calc((100% - 15px*1) / 2)}.v-row.v-row--no-gutter .v-col--50{width:50%}.v-row .v-col--45{width:45%;width:calc((100% - 15px*1.2222222222222223) / 2.2222222222222223)}.v-row.v-row--no-gutter .v-col--45{width:45%}.v-row .v-col--40{width:40%;width:calc((100% - 15px*1.5) / 2.5)}.v-row.v-row--no-gutter .v-col--40{width:40%}.v-row .v-col--35{width:35%;width:calc((100% - 15px*1.8571428571428572) / 2.857142857142857)}.v-row.v-row--no-gutter .v-col--35{width:35%}.v-row .v-col--33{width:33.333333333333336%;width:calc((100% - 15px*2) / 3)}.v-row.v-row--no-gutter .v-col--33{width:33.333333333333336%}.v-row .v-col--30{width:30%;width:calc((100% - 15px*2.3333333333333335) / 3.3333333333333335)}.v-row.v-row--no-gutter .v-col--30{width:30%}.v-row .v-col--25{width:25%;width:calc((100% - 15px*3) / 4)}.v-row.v-row--no-gutter .v-col--25{width:25%}.v-row .v-col--20{width:20%;width:calc((100% - 15px*4) / 5)}.v-row.v-row--no-gutter .v-col--20{width:20%}.v-row .v-col--15{width:15%;width:calc((100% - 15px*5.666666666666667) / 6.666666666666667)}.v-row.v-row--no-gutter .v-col--15{width:15%}.v-row .v-col--10{width:10%;width:calc((100% - 15px*9) / 10)}.v-row.v-row--no-gutter .v-col--10{width:10%}.v-row .v-col--5{width:5%;width:calc((100% - 15px*19) / 20)}.v-row.v-row--no-gutter .v-col--5{width:5%}.v-row .v-col--auto:last-child,.v-row .v-col--auto:last-child~.v-col--auto{width:100%;width:calc((100% - 15px*0) / 1)}.v-row.v-row--no-gutter .v-col--auto:last-child,.v-row.v-row--no-gutter .v-col--auto:last-child~.v-col--auto{width:100%}.v-row .v-col--auto:nth-last-child(2),.v-row .v-col--auto:nth-last-child(2)~.v-col--auto{width:50%;width:calc((100% - 15px*1) / 2)}.v-row.v-row--no-gutter .v-col--auto:nth-last-child(2),.v-row.v-row--no-gutter .v-col--auto:nth-last-child(2)~.v-col--auto{width:50%}.v-row .v-col--auto:nth-last-child(3),.v-row .v-col--auto:nth-last-child(3)~.v-col--auto{width:33.33333333%;width:calc((100% - 15px*2) / 3)}.v-row.v-row--no-gutter .v-col--auto:nth-last-child(3),.v-row.v-row--no-gutter .v-col--auto:nth-last-child(3)~.v-col--auto{width:33.33333333%}.v-row .v-col--auto:nth-last-child(4),.v-row .v-col--auto:nth-last-child(4)~.v-col--auto{width:25%;width:calc((100% - 15px*3) / 4)}.v-row.v-row--no-gutter .v-col--auto:nth-last-child(4),.v-row.v-row--no-gutter .v-col--auto:nth-last-child(4)~.v-col--auto{width:25%}.v-row .v-col--auto:nth-last-child(5),.v-row .v-col--auto:nth-last-child(5)~.v-col--auto{width:20%;width:calc((100% - 15px*4) / 5)}.v-row.v-row--no-gutter .v-col--auto:nth-last-child(5),.v-row.v-row--no-gutter .v-col--auto:nth-last-child(5)~.v-col--auto{width:20%}.v-row .v-col--auto:nth-last-child(6),.v-row .v-col--auto:nth-last-child(6)~.v-col--auto{width:16.66666667%;width:calc((100% - 15px*5) / 6)}.v-row.v-row--no-gutter .v-col--auto:nth-last-child(6),.v-row.v-row--no-gutter .v-col--auto:nth-last-child(6)~.v-col--auto{width:16.66666667%}.v-row .v-col--auto:nth-last-child(7),.v-row .v-col--auto:nth-last-child(7)~.v-col--auto{width:14.28571429%;width:calc((100% - 15px*6) / 7)}.v-row.v-row--no-gutter .v-col--auto:nth-last-child(7),.v-row.v-row--no-gutter .v-col--auto:nth-last-child(7)~.v-col--auto{width:14.28571429%}.v-row .v-col--auto:nth-last-child(8),.v-row .v-col--auto:nth-last-child(8)~.v-col--auto{width:12.5%;width:calc((100% - 15px*7) / 8)}.v-row.v-row--no-gutter .v-col--auto:nth-last-child(8),.v-row.v-row--no-gutter .v-col--auto:nth-last-child(8)~.v-col--auto{width:12.5%}.v-row .v-col--auto:nth-last-child(9),.v-row .v-col--auto:nth-last-child(9)~.v-col--auto{width:11.11111111%;width:calc((100% - 15px*8) / 9)}.v-row.v-row--no-gutter .v-col--auto:nth-last-child(9),.v-row.v-row--no-gutter .v-col--auto:nth-last-child(9)~.v-col--auto{width:11.11111111%}.v-row .v-col--auto:nth-last-child(10),.v-row .v-col--auto:nth-last-child(10)~.v-col--auto{width:10%;width:calc((100% - 15px*9) / 10)}.v-row.v-row--no-gutter .v-col--auto:nth-last-child(10),.v-row.v-row--no-gutter .v-col--auto:nth-last-child(10)~.v-col--auto{width:10%}.v-row .v-col--auto:nth-last-child(11),.v-row .v-col--auto:nth-last-child(11)~.v-col--auto{width:9.09090909%;width:calc((100% - 15px*10) / 11)}.v-row.v-row--no-gutter .v-col--auto:nth-last-child(11),.v-row.v-row--no-gutter .v-col--auto:nth-last-child(11)~.v-col--auto{width:9.09090909%}.v-row .v-col--auto:nth-last-child(12),.v-row .v-col--auto:nth-last-child(12)~.v-col--auto{width:8.33333333%;width:calc((100% - 15px*11) / 12)}.v-row.v-row--no-gutter .v-col--auto:nth-last-child(12),.v-row.v-row--no-gutter .v-col--auto:nth-last-child(12)~.v-col--auto{width:8.33333333%}.v-row .v-col--auto:nth-last-child(13),.v-row .v-col--auto:nth-last-child(13)~.v-col--auto{width:7.69230769%;width:calc((100% - 15px*12) / 13)}.v-row.v-row--no-gutter .v-col--auto:nth-last-child(13),.v-row.v-row--no-gutter .v-col--auto:nth-last-child(13)~.v-col--auto{width:7.69230769%}.v-row .v-col--auto:nth-last-child(14),.v-row .v-col--auto:nth-last-child(14)~.v-col--auto{width:7.14285714%;width:calc((100% - 15px*13) / 14)}.v-row.v-row--no-gutter .v-col--auto:nth-last-child(14),.v-row.v-row--no-gutter .v-col--auto:nth-last-child(14)~.v-col--auto{width:7.14285714%}.v-row .v-col--auto:nth-last-child(15),.v-row .v-col--auto:nth-last-child(15)~.v-col--auto{width:6.66666667%;width:calc((100% - 15px*14) / 15)}.v-row.v-row--no-gutter .v-col--auto:nth-last-child(15),.v-row.v-row--no-gutter .v-col--auto:nth-last-child(15)~.v-col--auto{width:6.66666667%}.v-row .v-col--auto:nth-last-child(16),.v-row .v-col--auto:nth-last-child(16)~.v-col--auto{width:6.25%;width:calc((100% - 15px*15) / 16)}.v-row.v-row--no-gutter .v-col--auto:nth-last-child(16),.v-row.v-row--no-gutter .v-col--auto:nth-last-child(16)~.v-col--auto{width:6.25%}.v-row .v-col--auto:nth-last-child(17),.v-row .v-col--auto:nth-last-child(17)~.v-col--auto{width:5.88235294%;width:calc((100% - 15px*16) / 17)}.v-row.v-row--no-gutter .v-col--auto:nth-last-child(17),.v-row.v-row--no-gutter .v-col--auto:nth-last-child(17)~.v-col--auto{width:5.88235294%}.v-row .v-col--auto:nth-last-child(18),.v-row .v-col--auto:nth-last-child(18)~.v-col--auto{width:5.55555556%;width:calc((100% - 15px*17) / 18)}.v-row.v-row--no-gutter .v-col--auto:nth-last-child(18),.v-row.v-row--no-gutter .v-col--auto:nth-last-child(18)~.v-col--auto{width:5.55555556%}.v-row .v-col--auto:nth-last-child(19),.v-row .v-col--auto:nth-last-child(19)~.v-col--auto{width:5.26315789%;width:calc((100% - 15px*18) / 19)}.v-row.v-row--no-gutter .v-col--auto:nth-last-child(19),.v-row.v-row--no-gutter .v-col--auto:nth-last-child(19)~.v-col--auto{width:5.26315789%}.v-row .v-col--auto:nth-last-child(20),.v-row .v-col--auto:nth-last-child(20)~.v-col--auto{width:5%;width:calc((100% - 15px*19) / 20)}.v-row.v-row--no-gutter .v-col--auto:nth-last-child(20),.v-row.v-row--no-gutter .v-col--auto:nth-last-child(20)~.v-col--auto{width:5%}.v-row .v-col--auto:nth-last-child(21),.v-row .v-col--auto:nth-last-child(21)~.v-col--auto{width:4.76190476%;width:calc((100% - 15px*20) / 21)}.v-row.v-row--no-gutter .v-col--auto:nth-last-child(21),.v-row.v-row--no-gutter .v-col--auto:nth-last-child(21)~.v-col--auto{width:4.76190476%}
|
2 |
+
/*# sourceMappingURL=fluent-forms-admin.css.map*/
|
public/css/fluent-forms-admin.css.map
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"version":3,"file":"/css/fluent-forms-admin.css","sources":[],"mappings":"","sourceRoot":""}
|
public/css/fluent-forms-public.css
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
@font-face{font-family:fluentform;src:url(../fonts/fluentform.eot?c6ad32560530b158258da8bee31bc80a);src:url(../fonts/fluentform.eot?c6ad32560530b158258da8bee31bc80a?#iefix) format("embedded-opentype"),url(../fonts/fluentform.woff?7753d2a8d140e45383ed24de75172d05) format("woff"),url(../fonts/fluentform.ttf?2379f7856878026a221b7ee7a7c5509b) format("truetype"),url(../fonts/fluentform.svg?6c683e8865864125f103bf269ead2784#fluentform) format("svg");font-weight:400;font-style:normal}[data-icon]:before{content:attr(data-icon)}[class*=" icon-"]:before,[class^=icon-]:before,[data-icon]:before{font-family:fluentform!important;font-style:normal!important;font-weight:400!important;font-variant:normal!important;text-transform:none!important;speak:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-trash-o:before{content:"\E000"}.icon-pencil:before{content:"\E001"}.icon-clone:before{content:"\E002"}.icon-arrows:before{content:"\E003"}.icon-user:before{content:"\E004"}.icon-text-width:before{content:"\E005"}.icon-unlock-alt:before{content:"\E006"}.icon-paragraph:before{content:"\E007"}.icon-columns:before{content:"\E008"}.icon-plus-circle:before{content:"\E009"}.icon-minus-circle:before{content:"\E00A"}.icon-link:before{content:"\E00B"}.icon-envelope-o:before{content:"\E00C"}.icon-caret-square-o-down:before{content:"\E00D"}.icon-list-ul:before{content:"\E00E"}.icon-dot-circle-o:before{content:"\E00F"}.icon-check-square-o:before{content:"\E010"}.icon-eye-slash:before{content:"\E011"}.icon-picture-o:before{content:"\E012"}.icon-calendar-o:before{content:"\E013"}.icon-upload:before{content:"\E014"}.icon-globe:before{content:"\E015"}.icon-pound:before{content:"\E016"}.icon-map-marker:before{content:"\E017"}.icon-credit-card:before{content:"\E018"}.icon-step-forward:before{content:"\E019"}.icon-code:before{content:"\E01A"}.icon-html5:before{content:"\E01B"}.icon-qrcode:before{content:"\E01C"}.icon-certificate:before{content:"\E01D"}.icon-star-half-o:before{content:"\E01E"}.icon-eye:before{content:"\E01F"}.icon-save:before{content:"\E020"}.icon-puzzle-piece:before{content:"\E021"}.icon-slack:before{content:"\E022"}.icon-trash:before{content:"\E023"}.icon-lock:before{content:"\E024"}.icon-chevron-down:before{content:"\E025"}.icon-chevron-up:before{content:"\E026"}.icon-chevron-right:before{content:"\E027"}.icon-chevron-left:before{content:"\E028"}.icon-circle-o:before{content:"\E029"}.icon-cog:before{content:"\E02A"}.icon-info:before{content:"\E02C"}.icon-info-circle:before{content:"\E02B"}label{font-weight:400}[class*=" icon-"],[class^=icon-]{display:inline-block;font:normal normal normal 14px/1 fluentform;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:middle}.clearfix:after,.clearfix:before,.ff-el-group:after,.ff-el-group:before,.ff-step-body:after,.ff-step-body:before{display:table;content:" "}.clearfix:after,.ff-el-group:after,.ff-step-body:after{clear:both}.text-danger{color:#f56c6c}.fluentform *{-webkit-box-sizing:border-box;box-sizing:border-box}@media (min-width:768px){.ff-t-container{display:table;width:100%;table-layout:fixed}.ff-t-cell{display:table-cell;padding:0 15px}.ff-t-cell:first-of-type{padding-left:0}.ff-t-cell:last-of-type{padding-right:0}}.ff-el-group{margin-bottom:20px}.ff-el-group.ff-el-form-top .ff-el-input--label{text-align:left;float:none;display:inline-block;margin-bottom:5px}.ff-el-group.ff-el-form-top .ff-el-input--content{margin-left:auto}@media (min-width:481px){.ff-el-group.ff-el-form-left .ff-el-input--label{text-align:left}}@media (min-width:481px){.ff-el-group.ff-el-form-right .ff-el-input--label{text-align:right}}.ff-el-input--label{display:inline-block;margin-bottom:5px;position:relative}.ff-el-input--label.ff-el-is-required label:before{content:"* ";color:#f56c6c;margin-right:3px}.ff-el-input--label label{margin-bottom:0;display:inline-block;font-weight:600}.ff-el-form-check{position:relative;display:block;margin-bottom:8px}.ff-el-form-check:last-of-type{margin-bottom:0}.ff-el-form-check-inline{display:inline-block;margin-right:20px;margin-bottom:0}.ff-el-form-check-inline .ff-el-form-check-label{vertical-align:middle}.ff-el-form-check-label{display:inline-block;padding-left:20px;margin-bottom:0}.ff-el-form-check-input{position:absolute;margin-top:4px;margin-left:-20px}.ff-el-repeat-content{display:table;width:100%;margin-bottom:15px}.ff-el-repeat-content .ff-el-form-control,.ff-el-repeat-content .ff-el-repeat-buttons{display:table-cell;vertical-align:middle}.ff-el-repeat-content .ff-el-repeat-buttons{text-align:right}.ff-el-repeat-buttons{width:40px}.ff-el-repeat-buttons [class*=" icon-"],.ff-el-repeat-buttons [class^=icon-]{margin-left:3px;cursor:pointer}@media (min-width:481px){.ff-el-form-left .ff-el-input--label,.ff-el-form-right .ff-el-input--label{float:left;width:180px;margin-bottom:0;padding:10px 15px 0 0}.ff-el-form-left .ff-el-input--content,.ff-el-form-right .ff-el-input--content{margin-left:180px}.ff-el-form-left .ff-t-container .ff-el-input--label,.ff-el-form-right .ff-t-container .ff-el-input--label{float:none;width:auto;margin-bottom:5px}.ff-el-form-left .ff-t-container .ff-el-input--content,.ff-el-form-right .ff-t-container .ff-el-input--content{margin-left:auto}}.ff-el-form-right .ff-el-input--label{text-align:right}.ff-el-is-error .text-danger{font-size:14px}.ff-el-is-error .ff-el-form-control{border-color:#f56c6c}.ff-el-tooltip{display:inline-block;position:relative;z-index:2;cursor:pointer;color:#595959;margin-left:2px}.ff-el-tooltip:after,.ff-el-tooltip:before{visibility:hidden;opacity:0;pointer-events:none}.ff-el-tooltip:before{position:absolute;bottom:100%;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);margin-bottom:5px;padding:7px;width:200px;width:-moz-max-content;width:max-content;width:-webkit-max-content;border-radius:3px;background-color:#000;color:#fff;content:attr(data-content);text-align:center;font-size:12px;line-height:1.2}.ff-el-tooltip:after{position:absolute;bottom:100%;left:50%;margin-left:-5px;width:0;border-top:5px solid #000;border-right:5px solid transparent;border-left:5px solid transparent;content:" ";font-size:0;line-height:0}.ff-el-tooltip:hover:after,.ff-el-tooltip:hover:before{visibility:visible;opacity:1}.ff-el-help-message{font-style:italic;font-size:.9rem;color:#595959}.ff-el-progress{height:1.3rem;overflow:hidden;font-size:.75rem;background-color:#e9ecef;border-radius:.25rem}.ff-el-progress-bar{background-color:#007bff;height:inherit;width:0;-webkit-transition:width .3s;transition:width .3s;color:#fff;text-align:right}.ff-el-progress-bar span{display:inline-block;padding:.15rem}.ff-el-progress-status{font-size:.9rem;margin-bottom:5px}.ff-el-progress-title{margin:8px 0 0;list-style-type:none;display:inline-block;padding-left:15px;padding-right:15px;font-weight:600;border-bottom:2px solid #000}.ff-el-progress-title li{display:none}.ff-text-left{text-align:left}.ff-text-center{text-align:center}.ff-text-right{text-align:right}.ff-float-right{float:right}.ff-step-container{overflow:hidden}.ff-step-header{margin-bottom:20px}.ff-step-titles{margin-bottom:0;list-style-type:none;background-color:#eee;overflow:hidden}.ff-step-titles>li{display:inline-block;padding:12px 7px 12px 22px;font-weight:600;position:relative}.ff-step-titles>li:before{z-index:2;right:-13px;background-color:#eee}.ff-step-titles>li:after,.ff-step-titles>li:before{content:" ";position:absolute;top:7px;width:48px;height:34px;-webkit-transform:rotate(67.5deg) skewX(45deg);transform:rotate(67.5deg) skewX(45deg)}.ff-step-titles>li:after{z-index:1;right:-16px;background-color:#fff}.ff-step-titles>li span{position:relative;z-index:1003}.ff-step-titles>li.active,.ff-step-titles>li.active:before{background-color:#999}.ff-step-body{margin-bottom:15px;position:relative;left:0;top:0}.fluentform-step{float:left;height:1px;overflow:hidden}.fluentform-step.active{height:auto}.step-nav .next{float:right}.fluentform .has-conditions{display:none}
|
2 |
+
/*# sourceMappingURL=fluent-forms-public.css.map*/
|
public/css/fluent-forms-public.css.map
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"version":3,"file":"/css/fluent-forms-public.css","sources":[],"mappings":"","sourceRoot":""}
|
public/css/fluentform-public-default.css
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
.ff-btn{display:inline-block;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid transparent;padding:6px 12px;font-size:16px;line-height:1.5;border-radius:4px;-webkit-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-box-shadow .15s ease-in-out}.ff-btn:focus,.ff-btn:hover{outline:0;text-decoration:none;-webkit-box-shadow:0 0 0 2px rgba(0,123,255,.25);box-shadow:0 0 0 2px rgba(0,123,255,.25)}.ff-btn.disabled,.ff-btn:disabled{opacity:.65}.ff-btn-primary{color:#fff;background-color:#007bff;border-color:#007bff}.ff-btn-primary:focus,.ff-btn-primary:hover{color:#fff;background-color:#0069d9;border-color:#0062cc}.ff-btn-primary:focus{-webkit-box-shadow:0 0 0 2px rgba(0,123,255,.5);box-shadow:0 0 0 2px rgba(0,123,255,.5)}.ff-btn-secondary{color:#fff;background-color:#868e96;border-color:#868e96}.ff-btn-secondary:focus,.ff-btn-secondary:hover{color:#fff;background-color:#727b84;border-color:#6c757d}.ff-btn-secondary:focus{-webkit-box-shadow:0 0 0 3px hsla(210,7%,56%,.5);box-shadow:0 0 0 3px hsla(210,7%,56%,.5)}.ff-btn-lg{padding:8px 16px;font-size:18px;line-height:1.5;border-radius:6px}.ff-btn-sm{padding:4px 8px;font-size:13px;line-height:1.5;border-radius:3px}.ff-btn-block{display:block;width:100%}.ff-btn-block+.ff-el-btn-block{margin-top:8px}.ff-el-form-control{display:block;width:100%;padding:6px 12px;font-size:16px;line-height:1.5;color:#495057;background-color:#fff;background-image:none;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;-webkit-transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-box-shadow .15s ease-in-out}.ff-el-form-control:focus{color:#495057;background-color:#fff;border-color:#80bdff;outline:none;-webkit-box-shadow:0 0 0 3px rgba(0,123,255,.25);box-shadow:0 0 0 3px rgba(0,123,255,.25)}.ff-el-form-control::-webkit-input-placeholder{color:#868e96;opacity:1}.ff-el-form-control:-ms-input-placeholder,.ff-el-form-control::-ms-input-placeholder{color:#868e96;opacity:1}.ff-el-form-control::placeholder{color:#868e96;opacity:1}.ff-el-form-control:disabled,.ff-el-form-control[readonly]{background-color:#e9ecef;opacity:1}select.ff-el-form-control:not([size]):not([multiple]){height:38px}
|
2 |
+
/*# sourceMappingURL=fluentform-public-default.css.map*/
|
public/css/fluentform-public-default.css.map
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"version":3,"file":"/css/fluentform-public-default.css","sources":[],"mappings":"","sourceRoot":""}
|
public/css/settings_global.css
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
@font-face{font-family:element-icons;src:url(../fonts/element-icons.woff?2fad952a20fbbcfd1bf2ebb210dccf7a) format("woff"),url(../fonts/element-icons.ttf?6f0a76321d30f3c8120915e57f7bd77e) format("truetype");font-weight:400;font-style:normal}[class*=" el-icon-"],[class^=el-icon-]{font-family:element-icons!important;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;vertical-align:baseline;display:inline-block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.el-icon-upload:before{content:"\E60D"}.el-icon-error:before{content:"\E62C"}.el-icon-success:before{content:"\E62D"}.el-icon-warning:before{content:"\E62E"}.el-icon-sort-down:before{content:"\E630"}.el-icon-sort-up:before{content:"\E631"}.el-icon-arrow-left:before{content:"\E600"}.el-icon-circle-plus:before{content:"\E601"}.el-icon-circle-plus-outline:before{content:"\E602"}.el-icon-arrow-down:before{content:"\E603"}.el-icon-arrow-right:before{content:"\E604"}.el-icon-arrow-up:before{content:"\E605"}.el-icon-back:before{content:"\E606"}.el-icon-circle-close:before{content:"\E607"}.el-icon-date:before{content:"\E608"}.el-icon-circle-close-outline:before{content:"\E609"}.el-icon-caret-left:before{content:"\E60A"}.el-icon-caret-bottom:before{content:"\E60B"}.el-icon-caret-top:before{content:"\E60C"}.el-icon-caret-right:before{content:"\E60E"}.el-icon-close:before{content:"\E60F"}.el-icon-d-arrow-left:before{content:"\E610"}.el-icon-check:before{content:"\E611"}.el-icon-delete:before{content:"\E612"}.el-icon-d-arrow-right:before{content:"\E613"}.el-icon-document:before{content:"\E614"}.el-icon-d-caret:before{content:"\E615"}.el-icon-edit-outline:before{content:"\E616"}.el-icon-download:before{content:"\E617"}.el-icon-goods:before{content:"\E618"}.el-icon-search:before{content:"\E619"}.el-icon-info:before{content:"\E61A"}.el-icon-message:before{content:"\E61B"}.el-icon-edit:before{content:"\E61C"}.el-icon-location:before{content:"\E61D"}.el-icon-loading:before{content:"\E61E"}.el-icon-location-outline:before{content:"\E61F"}.el-icon-menu:before{content:"\E620"}.el-icon-minus:before{content:"\E621"}.el-icon-bell:before{content:"\E622"}.el-icon-mobile-phone:before{content:"\E624"}.el-icon-news:before{content:"\E625"}.el-icon-more:before{content:"\E646"}.el-icon-more-outline:before{content:"\E626"}.el-icon-phone:before{content:"\E627"}.el-icon-phone-outline:before{content:"\E628"}.el-icon-picture:before{content:"\E629"}.el-icon-picture-outline:before{content:"\E62A"}.el-icon-plus:before{content:"\E62B"}.el-icon-printer:before{content:"\E62F"}.el-icon-rank:before{content:"\E632"}.el-icon-refresh:before{content:"\E633"}.el-icon-question:before{content:"\E634"}.el-icon-remove:before{content:"\E635"}.el-icon-share:before{content:"\E636"}.el-icon-star-on:before{content:"\E637"}.el-icon-setting:before{content:"\E638"}.el-icon-circle-check:before{content:"\E639"}.el-icon-service:before{content:"\E63A"}.el-icon-sold-out:before{content:"\E63B"}.el-icon-remove-outline:before{content:"\E63C"}.el-icon-star-off:before{content:"\E63D"}.el-icon-circle-check-outline:before{content:"\E63E"}.el-icon-tickets:before{content:"\E63F"}.el-icon-sort:before{content:"\E640"}.el-icon-zoom-in:before{content:"\E641"}.el-icon-time:before{content:"\E642"}.el-icon-view:before{content:"\E643"}.el-icon-upload2:before{content:"\E644"}.el-icon-zoom-out:before{content:"\E645"}.el-icon-loading{-webkit-animation:rotating 2s linear infinite;animation:rotating 2s linear infinite}.el-icon--right{margin-left:5px}.el-icon--left{margin-right:5px}@-webkit-keyframes rotating{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes rotating{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.el-text-primary{color:#20a0ff}.el-text-info{color:#58b7ff}.el-text-success{color:#13ce66}.el-text-warning{color:#f7ba2a}.el-text-danger{color:#ff4949}.el-button{text-decoration:none}.clearfix:after,.clearfix:before,.form-editor:after,.form-editor:before{display:table;content:" "}.clearfix:after,.form-editor:after{clear:both}.mr15{margin-right:15px}.mb15{margin-bottom:15px}.pull-left{float:left!important}.pull-right{float:right!important}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.icon-clickable{cursor:pointer}.help-text{margin:0;font-style:italic;font-size:.9em}.ff_settings_wrapper{background:red;display:table;width:100%;min-height:550px;-webkit-box-shadow:0 0 4px 1px rgba(0,0,0,.08);box-shadow:0 0 4px 1px rgba(0,0,0,.08);border-radius:3px}.ff_settings_wrapper .ff_settings_sidebar{display:table-cell;background:#f5f5f5;width:220px;padding:0;vertical-align:top}.ff_settings_wrapper .ff_settings_sidebar ul.ff_settings_list{padding:0;margin:0;list-style:none}.ff_settings_wrapper .ff_settings_sidebar ul.ff_settings_list li{margin:0}.ff_settings_wrapper .ff_settings_sidebar ul.ff_settings_list li a{padding:12px 10px;display:block;text-decoration:none;font-weight:700;color:#898989}.ff_settings_wrapper .ff_settings_sidebar ul.ff_settings_list li a:hover{background:#fff;color:#000}.ff_settings_wrapper .ff_settings_sidebar ul.ff_settings_list li a:active,.ff_settings_wrapper .ff_settings_sidebar ul.ff_settings_list li a:focus{outline:none;border:none;-webkit-box-shadow:none;box-shadow:none}.ff_settings_wrapper .ff_settings_sidebar ul.ff_settings_list li.active a{background:#fff;color:#000}.ff_settings_wrapper .ff_settings_container{display:table-cell;background:#fff;padding:15px 35px}.ff_settings_wrapper .pull-right{float:right}.ff_settings_wrapper .setting_header{border-bottom:1px solid #e0dbdb;margin-bottom:15px}.ff_settings_wrapper .form_item{margin-bottom:10px}.ff_settings_wrapper .form_item>label{font-size:15px;line-height:30px;display:block;margin-bottom:5px;font-weight:500}.ff_form_wrap .ff_form_name{display:inline-block;padding:10px;background:#0a0a0a;color:#fff;text-overflow:ellipsis;max-width:160px;white-space:nowrap;float:left;overflow-x:hidden}.ff_form_wrap .form_internal_menu{background:#fff;margin-bottom:10px}.ff_form_wrap .form_internal_menu ul.ff_setting_menu{display:inline-block;list-style:none;margin:0;padding:0}.ff_form_wrap .form_internal_menu ul.ff_setting_menu li{list-style:none;display:inline-block;margin-bottom:0}.ff_form_wrap .form_internal_menu ul.ff_setting_menu li a{padding:10px 15px;display:block;text-decoration:none}.ff_form_wrap .form_internal_menu ul.ff_setting_menu li.active a{margin-bottom:-2px;border-bottom:2px solid #73adff;font-weight:700}.conditional-items{padding-left:15px;border-left:1px dotted #dcdfe6;overflow:hidden;background-color:#fff;padding-right:1px}.slide-down-enter-active{-webkit-transition:all .8s;transition:all .8s;max-height:100vh}.slide-down-leave-active{-webkit-transition:all .3s;transition:all .3s;max-height:100vh}.slide-down-enter,.slide-down-leave-to{max-height:0}.fade-enter-active,.fade-leave-active{-webkit-transition:opacity .25s ease-out;transition:opacity .25s ease-out}.fade-enter,.fade-leave-to{opacity:0}.flip-enter-active{-webkit-transition:all .2s cubic-bezier(.55,.085,.68,.53);transition:all .2s cubic-bezier(.55,.085,.68,.53)}.flip-leave-active{-webkit-transition:all .25s cubic-bezier(.25,.46,.45,.94);transition:all .25s cubic-bezier(.25,.46,.45,.94)}.flip-enter,.flip-leave-to{-webkit-transform:scaleY(0) translateZ(0);transform:scaleY(0) translateZ(0);opacity:0}.ff_form_wrap{margin:10px 20px 0 2px}
|
2 |
+
/*# sourceMappingURL=settings_global.css.map*/
|
public/css/settings_global.css.map
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"version":3,"file":"/css/settings_global.css","sources":[],"mappings":"","sourceRoot":""}
|
public/fonts/element-icons.ttf
ADDED
Binary file
|
public/fonts/element-icons.woff
ADDED
Binary file
|
public/fonts/fluentform.eot
ADDED
Binary file
|
public/fonts/fluentform.svg
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" standalone="no"?>
|
2 |
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
3 |
+
<svg xmlns="http://www.w3.org/2000/svg">
|
4 |
+
<metadata>Generated by Fontastic.me</metadata>
|
5 |
+
<defs>
|
6 |
+
<font id="fluentform" horiz-adv-x="512">
|
7 |
+
<font-face font-family="fluentform" units-per-em="512" ascent="480" descent="-32"/>
|
8 |
+
<missing-glyph horiz-adv-x="512" />
|
9 |
+
|
10 |
+
<glyph glyph-name="trash-o" unicode="" d="M201 302l0-165c0-3-1-5-2-6-2-2-4-3-7-3l-18 0c-3 0-5 1-7 3-2 1-2 3-2 6l0 165c0 2 0 5 2 6 2 2 4 3 7 3l18 0c3 0 5-1 7-3 1-1 2-4 2-6z m73 0l0-165c0-3-1-5-2-6-2-2-4-3-7-3l-18 0c-3 0-5 1-7 3-1 1-2 3-2 6l0 165c0 2 1 5 2 6 2 2 4 3 7 3l18 0c3 0 5-1 7-3 1-1 2-4 2-6z m73 0l0-165c0-3 0-5-2-6-2-2-4-3-7-3l-18 0c-3 0-5 1-7 3-1 1-2 3-2 6l0 165c0 2 1 5 2 6 2 2 4 3 7 3l18 0c3 0 5-1 7-3 2-1 2-4 2-6z m37-207l0 271-256 0 0-271c0-4 1-8 2-12 1-3 3-6 4-7 2-2 3-3 3-3l238 0c0 0 1 1 3 3 1 1 3 4 4 7 1 4 2 8 2 12z m-192 307l128 0-14 34c-1 1-3 2-5 3l-90 0c-2-1-4-2-5-3z m265-9l0-18c0-3-1-5-2-7-2-1-4-2-7-2l-27 0 0-271c0-16-5-30-14-41-9-12-20-17-32-17l-238 0c-12 0-23 5-32 16-9 11-14 25-14 41l0 272-27 0c-3 0-5 1-7 2-1 2-2 4-2 7l0 18c0 3 1 5 2 7 2 1 4 2 7 2l88 0 20 48c3 7 8 13 16 18 7 5 15 7 22 7l92 0c7 0 15-2 22-7 8-5 13-11 16-18l20-48 88 0c3 0 5-1 7-2 1-2 2-4 2-7z"/>
|
11 |
+
<glyph glyph-name="pencil" unicode="" d="M140 73l26 26-67 67-26-26 0-30 37 0 0-37z m150 265c0 4-2 7-7 7-1 0-3-1-4-2l-155-155c-2-2-2-3-2-5 0-4 2-6 6-6 2 0 4 0 5 2l155 154c1 2 2 3 2 5z m-16 55l119-119-238-237-118 0 0 118z m195-27c0-10-3-19-10-26l-48-47-118 118 47 48c7 7 15 10 26 10 10 0 18-3 26-10l67-67c7-8 10-16 10-26z"/>
|
12 |
+
<glyph glyph-name="clone" unicode="" d="M475 46l0 311c0 2 0 4-2 6-2 2-4 3-7 3l-311 0c-2 0-4-1-6-3-2-2-3-4-3-6l0-311c0-3 1-5 3-7 2-2 4-2 6-2l311 0c3 0 5 0 7 2 2 2 2 4 2 7z m37 311l0-311c0-13-4-24-13-33-9-9-20-13-33-13l-311 0c-12 0-23 4-32 13-9 9-13 20-13 33l0 311c0 12 4 23 13 32 9 9 20 13 32 13l311 0c13 0 24-4 33-13 9-9 13-20 13-32z m-110 109l0-45-36 0 0 45c0 3-1 5-3 7-2 2-4 2-6 2l-311 0c-3 0-5 0-7-2-2-2-2-4-2-7l0-311c0-2 0-4 2-6 2-2 4-3 7-3l45 0 0-36-45 0c-13 0-24 4-33 13-9 9-13 20-13 32l0 311c0 13 4 24 13 33 9 9 20 13 33 13l311 0c12 0 23-4 32-13 9-9 13-20 13-33z"/>
|
13 |
+
<glyph glyph-name="arrows" unicode="" d="M512 256c0-5-2-9-5-13l-74-73c-3-4-7-5-12-5-5 0-10 1-13 5-4 4-6 8-6 13l0 36-109 0 0-109 36 0c5 0 9-2 13-6 4-3 5-8 5-13 0-5-1-9-5-12l-73-74c-4-3-8-5-13-5-5 0-9 2-13 5l-73 74c-4 3-5 7-5 12 0 5 1 10 5 13 4 4 8 6 13 6l36 0 0 109-109 0 0-36c0-5-2-9-6-13-3-4-8-5-13-5-5 0-9 1-12 5l-74 73c-3 4-5 8-5 13 0 5 2 9 5 13l74 73c3 4 7 5 12 5 5 0 10-1 13-5 4-4 6-8 6-13l0-36 109 0 0 109-36 0c-5 0-9 2-13 6-4 3-5 8-5 13 0 5 1 9 5 12l73 74c4 3 8 5 13 5 5 0 9-2 13-5l73-74c4-3 5-7 5-12 0-5-1-10-5-13-4-4-8-6-13-6l-36 0 0-109 109 0 0 36c0 5 2 9 6 13 3 4 8 5 13 5 5 0 9-1 12-5l74-73c3-4 5-8 5-13z"/>
|
14 |
+
<glyph glyph-name="user" unicode="" d="M457 111c0-23-7-41-21-55-14-13-32-19-55-19l-250 0c-23 0-41 6-55 19-14 14-21 32-21 55 0 10 0 20 1 29 1 10 2 20 4 31 2 11 4 22 7 31 3 10 8 19 13 28 5 9 11 17 17 23 7 7 15 12 25 16 9 3 20 5 32 5 1 0 5-2 12-6 6-4 13-9 21-14 8-5 18-9 31-13 13-4 25-6 38-6 13 0 25 2 38 6 13 4 23 8 31 13 8 5 15 10 21 14 7 4 11 6 12 6 12 0 23-2 32-5 10-4 18-9 25-16 6-6 12-14 17-23 5-9 10-18 13-28 3-9 5-20 7-31 2-11 3-21 4-31 1-9 1-19 1-29z m-91 255c0-31-11-56-32-78-22-21-48-32-78-32-30 0-56 11-78 32-21 22-32 47-32 78 0 30 11 56 32 77 22 22 48 32 78 32 30 0 56-10 78-32 21-21 32-47 32-77z"/>
|
15 |
+
<glyph glyph-name="text-width" unicode="" d="M60 475l15-8c2-1 23-1 60-1 9 0 21 0 38 1 17 0 29 0 38 0 13 0 37 0 70 0 34 1 63 1 87 1 25-1 48-1 71-2 6 0 11 3 16 9l12 0c1 0 2 0 4 0 2 0 3 0 4 0 0-21 0-53 0-96 0-15 0-25-1-31-7-3-14-4-19-5-5 8-10 20-16 36 0 2-1 7-3 14-2 7-3 14-4 21-2 7-2 10-2 10-2 3-5 5-8 6-1 0-7 0-19 0-6 0-14 0-26 1-12 0-22 0-30 0-7 0-16 0-27-1-10 0-19-1-27-2-2-15-3-28-2-39l0-43 0 15c0-11 0-25 0-44 0-19 0-36 1-52 0-15 0-30 0-43 0-3-1-10-1-21 0-10 0-19 0-26 0-7 2-13 4-20 7-4 19-8 35-12 16-4 27-7 34-10 1-8 2-13 2-15 0-2-1-5-1-8l-10 0c-14-1-35 0-62 2-27 2-47 3-59 3-10 0-24-1-43-3-20-1-34-2-44-2 0 9-1 14-1 15l0 2c4 5 9 9 18 12 8 3 18 6 28 9 10 2 18 5 22 7 2 3 3 11 4 22 0 11 1 24 1 41 1 17 1 32 1 44 0 13 0 28 0 44-1 17-1 25-1 26 0 1 0 3 0 6-1 3-1 5-1 6 0 2 0 6 0 13 0 7 0 14 0 21 0 7 0 14 0 22 0 7 0 14-1 19 0 5-1 8-2 9-2 2-17 3-46 3-8 0-23-1-46-3-24-3-37-5-40-7-3-3-7-10-10-21-2-11-5-22-9-32-3-10-7-15-12-15-8 5-13 9-16 12l0 110z m351-366c2 0 6-2 12-6 6-3 11-7 16-12 6-4 11-8 17-14 6-5 10-8 11-8 5-4 7-9 7-14 0-5-2-10-7-14-1-1-5-4-11-9-6-5-11-10-17-14-5-4-10-8-16-12-6-3-10-5-12-5-3 0-5 1-6 3-1 2-2 5-3 8 0 3-1 7-1 10 0 3 1 6 1 9 0 3 0 5 0 6l-292 0c0-1 0-3 0-6 0-3 1-6 1-9 0-3-1-7-1-10-1-3-2-6-3-8-1-2-3-3-6-3-2 0-6 2-12 5-6 4-11 8-16 12-6 4-11 9-17 14-6 5-10 8-11 9-5 4-7 9-7 14 0 5 2 10 7 14 1 0 5 3 11 8 6 6 11 10 17 14 5 5 10 9 16 12 6 4 10 6 12 6 3 0 5-1 6-3 1-2 2-5 3-8 0-4 1-7 1-10 0-3-1-6-1-9 0-4 0-5 0-6l292 0c0 1 0 2 0 6 0 3-1 6-1 9 0 3 1 6 1 10 1 3 2 6 3 8 1 2 3 3 6 3z"/>
|
16 |
+
<glyph glyph-name="unlock-alt" unicode="" d="M393 293c8 0 14-3 20-8 5-6 8-12 8-20l0-164c0-8-3-15-8-20-6-5-12-8-20-8l-274 0c-8 0-14 3-20 8-5 5-8 12-8 20l0 164c0 8 3 14 8 20 6 5 12 8 20 8l9 0 0 91c0 35 13 65 38 90 25 25 55 38 90 38 35 0 65-13 90-38 25-25 38-55 38-90 0-5-2-9-5-13-4-3-8-5-13-5l-19 0c-5 0-9 2-12 5-4 4-6 8-6 13 0 20-7 37-21 52-15 14-32 21-52 21-20 0-37-7-52-21-14-15-21-32-21-52l0-91z"/>
|
17 |
+
<glyph glyph-name="paragraph" unicode="" d="M438 458l0-21c0-5-1-11-5-17-4-6-8-9-12-9-10 0-15-1-16-1-5-1-8-4-9-9 0-2-1-8-1-18l0-329c0-5-1-9-5-12-3-4-7-5-12-5l-31 0c-5 0-9 1-12 5-4 3-5 7-5 12l0 348-41 0 0-348c0-5-2-9-5-12-3-4-8-5-13-5l-30 0c-5 0-10 1-13 5-3 3-5 7-5 12l0 142c-28 2-51 8-70 17-24 11-42 28-55 51-12 22-18 47-18 74 0 31 8 59 25 81 17 23 37 38 60 46 21 7 61 10 119 10l137 0c5 0 9-1 12-5 4-3 5-7 5-12z"/>
|
18 |
+
<glyph glyph-name="columns" unicode="" d="M64 73l174 0 0 329-183 0 0-320c0-2 1-4 3-6 1-2 4-3 6-3z m393 9l0 320-183 0 0-329 174 0c2 0 5 1 6 3 2 2 3 4 3 6z m37 348l0-348c0-12-5-23-14-32-9-9-19-13-32-13l-384 0c-13 0-23 4-32 13-9 9-14 20-14 32l0 348c0 12 5 23 14 32 9 9 19 13 32 13l384 0c13 0 23-4 32-13 9-9 14-20 14-32z"/>
|
19 |
+
<glyph glyph-name="plus-circle" unicode="" d="M384 238l0 36c0 5-2 10-5 13-4 4-8 6-13 6l-73 0 0 73c0 5-2 9-6 13-3 3-8 5-13 5l-36 0c-5 0-10-2-13-5-4-4-6-8-6-13l0-73-73 0c-5 0-9-2-13-6-3-3-5-8-5-13l0-36c0-5 2-10 5-13 4-4 8-6 13-6l73 0 0-73c0-5 2-9 6-13 3-3 8-5 13-5l36 0c5 0 10 2 13 5 4 4 6 8 6 13l0 73 73 0c5 0 9 2 13 6 3 3 5 8 5 13z m91 18c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
|
20 |
+
<glyph glyph-name="minus-circle" unicode="" d="M384 238l0 36c0 5-2 10-5 13-4 4-8 6-13 6l-220 0c-5 0-9-2-13-6-3-3-5-8-5-13l0-36c0-5 2-10 5-13 4-4 8-6 13-6l220 0c5 0 9 2 13 6 3 3 5 8 5 13z m91 18c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
|
21 |
+
<glyph glyph-name="link" unicode="" d="M434 165c0 7-2 14-8 19l-59 59c-5 6-12 8-20 8-8 0-14-3-20-9 0 0 2-2 5-5 3-3 5-5 6-6 1-1 3-3 5-6 2-2 3-4 3-7 1-2 1-5 1-8 0-7-2-14-8-19-5-5-11-8-19-8-3 0-5 0-8 1-2 1-5 2-7 4-3 1-4 3-6 4-1 1-3 3-6 6-3 3-4 5-5 5-6-5-9-12-9-20 0-8 2-15 8-20l58-59c6-5 12-8 20-8 7 0 14 3 19 8l42 41c6 6 8 12 8 20z m-201 201c0 8-2 14-8 19l-58 60c-6 5-12 8-20 8-7 0-14-3-19-8l-42-42c-6-5-8-12-8-19 0-8 2-14 8-19l59-60c5-5 12-8 20-8 8 0 14 3 20 9 0 1-2 3-5 6-3 3-5 5-6 6-1 1-3 3-5 5-2 3-3 5-3 7-1 3-1 5-1 8 0 8 2 14 8 20 5 5 11 8 19 8 3 0 5-1 8-1 2-1 5-2 7-4 3-2 4-3 6-4 1-1 3-3 6-6 3-3 4-5 5-6 6 6 9 13 9 21z m256-201c0-23-8-43-24-58l-42-42c-16-16-35-24-58-24-23 0-43 8-58 24l-59 60c-16 15-24 35-24 58 0 23 8 43 25 59l-25 25c-16-16-36-25-59-25-23 0-43 8-59 24l-59 60c-16 16-24 35-24 58 0 23 8 42 24 58l42 42c16 16 35 23 58 23 23 0 43-8 58-24l59-59c16-16 24-35 24-58 0-23-8-43-25-60l25-25c16 17 36 25 59 25 23 0 43-8 59-24l59-59c16-16 24-36 24-58z"/>
|
22 |
+
<glyph glyph-name="envelope-o" unicode="" d="M475 82l0 220c-6-7-12-13-19-19-51-39-92-72-122-97-10-8-18-14-24-19-6-4-14-9-24-14-11-4-21-7-30-7l0 0c-9 0-19 3-30 7-10 5-18 10-24 14-6 5-14 11-24 19-30 25-71 58-122 97-7 6-13 12-19 19l0-220c0-2 0-4 2-6 2-2 4-3 7-3l420 0c3 0 5 1 7 3 2 2 2 4 2 6z m0 301l0 7 0 3-1 4-1 2-3 3-4 0-420 0c-3 0-5-1-7-2-2-2-2-4-2-7 0-32 14-59 42-81 36-29 75-59 114-91 1-1 5-3 10-8 6-5 10-8 13-11 4-2 8-5 13-9 5-3 10-6 14-8 5-1 9-2 13-2l0 0c4 0 8 1 13 2 4 2 9 5 14 8 5 4 9 7 13 9 3 3 7 6 13 11 5 5 9 7 10 8 39 32 78 62 114 91 11 8 20 19 29 33 9 14 13 26 13 38z m37 10l0-311c0-12-4-23-13-32-9-9-20-13-33-13l-420 0c-13 0-24 4-33 13-9 9-13 20-13 32l0 311c0 13 4 23 13 32 9 9 20 14 33 14l420 0c13 0 24-5 33-14 9-9 13-19 13-32z"/>
|
23 |
+
<glyph glyph-name="caret-square-o-down" unicode="" d="M364 319c3-7 3-13-2-19l-91-128c-4-5-9-7-15-7-6 0-11 2-15 7l-91 128c-5 6-5 12-2 19 4 7 9 10 17 10l182 0c8 0 13-3 17-10z m38-200l0 274c0 3-1 5-2 7-2 1-4 2-7 2l-274 0c-3 0-5-1-7-2-1-2-2-4-2-7l0-274c0-3 1-5 2-7 2-1 4-2 7-2l274 0c3 0 5 1 7 2 1 2 2 4 2 7z m73 274l0-274c0-23-8-42-24-58-16-16-35-24-58-24l-274 0c-23 0-42 8-58 24-16 16-24 35-24 58l0 274c0 23 8 42 24 58 16 16 35 24 58 24l274 0c23 0 42-8 58-24 16-16 24-35 24-58z"/>
|
24 |
+
<glyph glyph-name="list-ul" unicode="" d="M110 110c0-16-6-28-16-39-11-11-24-16-39-16-15 0-28 5-39 16-11 11-16 23-16 39 0 15 5 28 16 39 11 10 24 16 39 16 15 0 28-6 39-16 10-11 16-24 16-39z m0 146c0-15-6-28-16-39-11-11-24-16-39-16-15 0-28 5-39 16-11 11-16 24-16 39 0 15 5 28 16 39 11 11 24 16 39 16 15 0 28-5 39-16 10-11 16-24 16-39z m402-119l0-55c0-2-1-4-3-6-2-2-4-3-6-3l-348 0c-2 0-4 1-6 3-2 2-3 4-3 6l0 55c0 3 1 5 3 7 2 1 4 2 6 2l348 0c2 0 4-1 6-2 2-2 3-4 3-7z m-402 265c0-15-6-28-16-39-11-10-24-16-39-16-15 0-28 6-39 16-11 11-16 24-16 39 0 16 5 28 16 39 11 11 24 16 39 16 15 0 28-5 39-16 10-11 16-23 16-39z m402-119l0-54c0-3-1-5-3-7-2-2-4-3-6-3l-348 0c-2 0-4 1-6 3-2 2-3 4-3 7l0 54c0 3 1 5 3 7 2 2 4 3 6 3l348 0c2 0 4-1 6-3 2-2 3-4 3-7z m0 147l0-55c0-3-1-5-3-7-2-1-4-2-6-2l-348 0c-2 0-4 1-6 2-2 2-3 4-3 7l0 55c0 2 1 4 3 6 2 2 4 3 6 3l348 0c2 0 4-1 6-3 2-2 3-4 3-6z"/>
|
25 |
+
<glyph glyph-name="dot-circle-o" unicode="" d="M329 256c0-20-7-37-21-52-15-14-32-21-52-21-20 0-37 7-52 21-14 15-21 32-21 52 0 20 7 37 21 52 15 14 32 21 52 21 20 0 37-7 52-21 14-15 21-32 21-52z m-73 155c-28 0-54-7-78-20-24-14-43-33-57-57-13-24-20-50-20-78 0-28 7-54 20-78 14-24 33-43 57-57 24-13 50-20 78-20 28 0 54 7 78 20 24 14 43 33 57 57 13 24 20 50 20 78 0 28-7 54-20 78-14 24-33 43-57 57-24 13-50 20-78 20z m219-155c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
|
26 |
+
<glyph glyph-name="check-square-o" unicode="" d="M421 246l0-91c0-22-8-42-25-58-16-16-35-24-58-24l-237 0c-23 0-42 8-59 24-16 16-24 36-24 58l0 238c0 23 8 42 24 58 17 16 36 24 59 24l237 0c12 0 23-2 34-7 3-1 4-3 5-6 0-4 0-6-3-9l-14-14c-2-1-4-2-6-2-1 0-2 0-3 0-4 1-9 2-13 2l-237 0c-13 0-24-5-33-14-9-9-13-19-13-32l0-238c0-12 4-23 13-32 9-9 20-13 33-13l237 0c13 0 24 4 33 13 9 9 13 20 13 32l0 73c0 2 1 5 3 6l18 19c2 1 4 2 6 2 2 0 3 0 4 0 4-2 6-5 6-9z m66 140l-233-233c-5-4-10-6-16-6-7 0-12 2-17 6l-122 123c-5 5-7 10-7 17 0 6 2 11 7 16l31 31c5 5 10 7 16 7 7 0 12-2 17-7l75-75 185 185c4 5 10 7 16 7 6 0 12-2 16-7l32-31c4-5 6-10 6-17 0-6-2-11-6-16z"/>
|
27 |
+
<glyph glyph-name="eye-slash" unicode="" d="M159 131l22 40c-17 12-30 27-39 45-9 19-14 38-14 58 0 23 6 45 17 65-43-23-79-56-108-101 31-49 72-85 122-107z m111 216c0 4-2 7-4 10-3 3-6 4-10 4-24 0-44-8-61-25-17-17-26-38-26-62 0-4 1-7 4-9 3-3 6-4 10-4 4 0 7 1 10 4 2 2 4 5 4 9 0 17 5 31 17 42 12 12 26 18 42 18 4 0 7 1 10 4 2 2 4 6 4 9z m103 55c0-1 0-2 0-3-20-35-50-89-90-161-40-72-70-126-90-162l-14-26c-2-3-5-4-8-4-2 0-15 6-38 20-3 2-5 4-5 8 0 2 4 10 13 25-28 12-53 28-76 49-23 21-43 44-59 70-4 6-6 12-6 20 0 7 2 14 6 19 29 45 65 81 108 106 44 26 91 39 142 39 17 0 34-1 51-5l16 28c2 3 4 5 8 5 1 0 3-1 5-2 2-1 5-3 9-4 3-2 6-4 9-6 3-1 6-3 9-5 3-2 5-3 6-3 3-2 4-5 4-8z m11-128c0-26-8-50-23-72-15-22-35-38-59-47l80 143c1-8 2-16 2-24z m128-36c0-7-2-14-6-20-7-12-18-26-31-41-28-33-62-59-99-77-38-18-78-27-120-27l21 38c41 3 78 16 112 39 35 23 63 52 86 88-21 34-48 62-80 84l18 32c18-12 35-27 52-44 17-17 30-34 41-53 4-6 6-13 6-19z"/>
|
28 |
+
<glyph glyph-name="picture-o" unicode="" d="M165 347c0-15-6-28-16-38-11-11-24-16-39-16-16 0-28 5-39 16-11 10-16 23-16 38 0 16 5 29 16 39 11 11 23 16 39 16 15 0 28-5 39-16 10-10 16-23 16-39z m292-109l0-128-402 0 0 55 91 91 46-46 146 147z m28 201l-458 0c-2 0-4-1-6-3-2-2-3-4-3-6l0-348c0-2 1-4 3-6 2-2 4-3 6-3l458 0c2 0 4 1 6 3 2 2 3 4 3 6l0 348c0 2-1 4-3 6-2 2-4 3-6 3z m45-9l0-348c0-12-4-23-13-32-9-9-20-13-32-13l-458 0c-12 0-23 4-32 13-9 9-13 20-13 32l0 348c0 12 4 23 13 32 9 9 20 13 32 13l458 0c12 0 23-4 32-13 9-9 13-20 13-32z"/>
|
29 |
+
<glyph glyph-name="calendar-o" unicode="" d="M55 37l402 0 0 292-402 0z m110 347l0 82c0 3-1 5-3 7-2 2-4 2-7 2l-18 0c-3 0-5 0-6-2-2-2-3-4-3-7l0-82c0-3 1-5 3-7 1-1 3-2 6-2l18 0c3 0 5 1 7 2 2 2 3 4 3 7z m219 0l0 82c0 3-1 5-3 7-1 2-3 2-6 2l-18 0c-3 0-5 0-7-2-2-2-3-4-3-7l0-82c0-3 1-5 3-7 2-1 4-2 7-2l18 0c3 0 5 1 6 2 2 2 3 4 3 7z m110 18l0-365c0-10-4-19-11-26-7-7-16-11-26-11l-402 0c-10 0-19 4-26 11-7 7-11 16-11 26l0 365c0 10 4 19 11 26 7 7 16 11 26 11l36 0 0 27c0 13 5 24 14 33 9 9 20 13 32 13l18 0c13 0 24-4 33-13 9-9 13-20 13-33l0-27 110 0 0 27c0 13 4 24 13 33 9 9 20 13 33 13l18 0c12 0 23-4 32-13 9-9 14-20 14-33l0-27 36 0c10 0 19-4 26-11 7-7 11-16 11-26z"/>
|
30 |
+
<glyph glyph-name="upload" unicode="" d="M384 91c0 5-2 10-5 13-4 4-8 6-13 6-5 0-10-2-13-6-4-3-6-8-6-13 0-5 2-9 6-12 3-4 8-6 13-6 5 0 9 2 13 6 3 3 5 7 5 12z m73 0c0 5-2 10-5 13-4 4-8 6-13 6-5 0-9-2-13-6-4-3-5-8-5-13 0-5 1-9 5-12 4-4 8-6 13-6 5 0 9 2 13 6 3 3 5 7 5 12z m37 64l0-91c0-8-3-14-8-19-6-6-12-8-20-8l-420 0c-8 0-14 2-20 8-5 5-8 11-8 19l0 91c0 8 3 15 8 20 6 5 12 8 20 8l122 0c4-11 10-20 20-26 9-7 20-11 31-11l74 0c11 0 22 4 31 11 10 6 16 15 20 26l122 0c8 0 14-3 20-8 5-5 8-12 8-20z m-93 186c-3-8-9-12-17-12l-73 0 0-128c0-5-2-9-6-13-3-3-7-5-12-5l-74 0c-5 0-9 2-12 5-4 4-6 8-6 13l0 128-73 0c-8 0-14 4-17 12-3 7-2 14 4 19l128 128c4 4 8 6 13 6 5 0 9-2 13-6l128-128c6-5 7-12 4-19z"/>
|
31 |
+
<glyph glyph-name="globe" unicode="" d="M256 475c40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110 0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29z m78-148c0-1-1-2-2-3-2-2-3-3-4-3 0 0 1 1 1 2 0 1 1 2 1 3 1 1 1 2 1 2 2 1 4 2 7 4 2 1 7 2 15 3 6 2 11 1 14-3 0 1 1 2 3 4 2 2 3 3 4 3 1 1 2 1 4 2 3 0 4 1 5 2l0 6c-2 0-4 1-5 2-1 2-2 4-2 6 0 0 0-1-1-2 0 1-1 2-2 2-1 0-2 0-3 0-1-1-2-1-3 0-1 0-3 1-4 2-1 1-2 2-2 4-1 3-1 4-1 5-1 1-2 2-3 3-1 1-2 2-3 3 0 0 0 1 0 1-1 1-1 2-1 2-1 1-1 1-1 2-1 0-1 0-2 0-1 0-1 0-2-1-1-1-1-2-2-3-1-1-1-1-1-1-1 0-2 0-2 0-1 0-1 0-1 0-1 0-1-1-2-1 0 0-1-1-1-1-1 0-2-1-3-1-1 0-1 0-2 0 3 1 3 2 0 3-2 0-4 1-5 1 2 0 3 1 2 3 0 2-1 3-2 4l1 0c0 1-1 2-2 2-2 1-3 2-5 3-2 1-3 1-4 2-1 1-5 1-10 2-5 1-8 1-9 0-1-1-1-2-1-3 0 0 0-2 1-4 1-1 1-3 1-3 0-1 0-3-2-4-1-1-2-2-2-3 0-2 2-3 4-5 3-1 4-3 3-6 0-1-2-3-4-4-3-2-4-3-5-4-1-1-1-3 0-5 0-2 1-4 3-5 0 0 0-1 0-1 0 0 0-1-1-1 0-1-1-1-1-1-1-1-2-1-2-1l-1-1c-2-1-4 0-6 2-2 2-3 4-4 7-1 5-3 8-4 9-5 1-8 1-9-1-1 3-5 5-11 8-5 2-11 2-17 1 1 0 1 2 0 4-1 3-3 4-5 4 0 1 1 3 1 5 0 2 0 3 0 4 1 2 2 4 3 6 1 0 1 1 2 3 2 1 2 2 3 3 1 2 1 2 2 2 6-1 11 0 14 3 1 1 2 3 3 5 1 2 2 4 3 5 2 1 3 2 4 2 1-1 2-1 4-2 2-1 3-1 4-1 3-1 5 0 5 3 0 2-1 4-2 5 2 0 2 2 1 5-1 2-2 2-3 3-2 1-5 0-7-2-2 0-2-1 0-2 0 0-1-1-3-3-1-2-3-4-4-5-2-1-3-1-5 2 0 0-1 1-1 3-1 3-2 4-3 4-2 0-3-1-5-4 1 2 0 3-3 4-3 2-5 2-7 3 4 2 3 4-2 7-1 1-3 2-6 2-2 0-4 0-5-1-1-2-2-3-2-4 0-1 0-1 1-2 1-1 2-1 3-2 1 0 2 0 4-1 1 0 2 0 2-1 3-1 4-3 2-4 0 0-1 0-2-1-1 0-2 0-3-1-1 0-2-1-2-1-1-1-1-2 0-4 1-2 0-3-1-4-1 1-1 3-2 5-1 2-2 4-2 5 1-2-1-3-7-2l-3 0c-1 0-2 0-5 0-2-1-4-1-6-1-1 1-2 1-3 3-1 1-1 3 0 5 0 1 0 1 1 1-1 1-2 1-3 3-2 1-3 2-3 2-9-3-18-7-27-12 1 0 2 0 3 1 1 0 2 1 4 2 2 0 2 1 3 1 6 3 10 3 12 2l1 2c3-3 5-6 6-8-1 1-4 1-9 1-3-1-5-3-6-4 1-2 2-4 2-5-1 1-2 2-4 3-1 1-3 2-4 3-1 1-3 1-4 2-3 0-5-1-6-1-28-15-51-36-68-63 2-1 3-2 4-2 1-1 1-1 1-3 0-2 1-3 1-3 0-1 1 0 3 1 2-2 2-4 1-6 0 0 5-2 13-7 3-4 5-6 6-6 0-3-1-4-3-6 0 1-1 2-3 3-1 1-2 2-2 1-1-1-1-3 0-5 1-3 2-4 3-4-1 0-2-1-3-4 0-3-1-7-1-10 0-4 0-6 0-7l1 0c-1-3 0-6 1-10 2-5 4-6 6-6-2 0 0-5 6-12 1-2 2-3 2-3 1 0 2-1 4-2 2-1 3-2 4-3 1-1 2-2 3-3 1-1 2-3 3-6 1-3 2-6 4-7-1-1 0-3 3-6 2-2 3-4 3-6-1 0-1 0-1 0 0-1-1-1-1-1 1-1 2-2 5-4 2-1 3-2 4-3 0-1 0-2 1-3 0-2 0-3 0-3 1-1 2-1 3-1 0 4-2 10-7 18-3 4-5 7-5 8-1 1-1 2-2 4 0 2 0 4-1 5 1 0 1-1 2-1 1 0 1 0 2-1 1 0 2-1 2-1 1 0 1-1 1-1-1-1 0-3 1-5 1-2 2-4 3-5 1-2 3-3 5-6 2-2 3-3 3-3 1-1 3-3 4-6 2-2 2-4 0-4 2 0 4-1 6-3 2-1 4-3 5-5 1-2 2-4 2-8 1-3 1-5 2-7 0-1 1-2 2-3 1-2 2-3 4-3l4-2 4-2c1-1 3-2 5-3 3-2 5-3 6-4 2 0 4-1 5-1 1 0 2 0 4 1 2 0 3 1 4 1 3 0 5-1 8-4 3-4 5-6 6-6 7-4 12-5 16-4-1 0 0 0 0-2 0-1 1-2 2-4 1-2 2-3 3-4 1-1 1-2 1-3 1-1 3-2 6-4 2-2 4-3 5-4 1 0 2 1 2 2-1-1 0-3 2-5 2-3 3-4 5-3 3 0 4 3 4 9-6-3-11-1-14 5 0 0 0 1-1 2 0 0-1 1-1 2 0 1-1 2-1 2 0 1 0 2 0 3 0 0 1 0 2 0 1 0 2 1 3 1 0 1 0 2-1 4-1 2-1 3-1 4 0 1-1 3-3 5-2 3-3 4-4 5-1-2-2-3-4-3-2 1-4 1-5 3 0 0 0-1 0-2-1 0-1-1-1-1-2 0-4 0-4 0 0 0 0 2 1 5 0 3 0 5 1 6 0 1 0 2 1 4 1 1 2 3 2 4 1 1 1 2 2 3 0 2-1 2-2 3-1 1-2 1-5 1-3 0-6-2-7-6 0 0-1-1-1-3 0-1-1-2-1-3-1-1-2-2-3-2-1-1-4-1-7-1-3 0-5 1-7 2-2 1-4 4-6 8-2 4-3 8-3 11 0 1 0 4 1 7 0 3 1 6 1 7 0 2-1 4-2 7 1 1 2 2 3 3 1 1 2 2 3 3 0 0 0 0 1 0 0 1 1 1 1 0 1 0 1 0 1 1 1 0 1 1 1 2 0 0 0 0-1 0-1 1-1 1-1 1 1 0 4 0 8 1 4 1 7 0 8-1 3-2 5-2 6 1 0 0 0 1-1 3 0 1 0 2 0 3 1-5 4-6 9-2 0-1 2-1 4-2 2 0 4 0 5-1 1 0 1-1 2-2 1 0 1-1 2-1 0 0 0 0 1 0 1 1 1 1 2 2 2-3 3-5 4-7 2-7 4-12 5-12 2-1 3-1 3-1 1 0 2 1 2 3 0 1 0 3 0 4 0 1-1 2-1 3l0 3 0 5 0 2c-3 1-5 2-6 4 0 1 0 3 1 5 1 2 2 3 4 5 0 0 1 1 2 1 2 1 3 1 5 2 1 1 3 2 3 2 4 4 6 7 5 10 1 0 2 1 3 3 0 0-1 0-2 1 0 0-1 1-2 1 0 1-1 1-1 1 2 1 2 2 1 4 1 1 1 2 2 3 0 2 1 3 2 3 2-2 4-2 6 0 1 1 1 3 0 4 1 2 3 3 6 3 3 1 5 2 5 3 2 0 2 0 3 1 0 0 0 1 0 3 0 2 0 3 1 3 0 1 2 2 4 3 2 1 3 1 4 1l5 4c0 0 0 1 0 1 3-1 6 0 8 3 2 2 2 4-1 6 0 1 0 2-1 2-1 1-3 1-4 2 0 0 1 0 3 0 1 0 2 0 3 0 3 2 2 4-2 5-3 1-7 0-12-3z m-46-251c39 7 72 25 100 54-1 1-2 1-4 1-1 1-3 1-3 1-4 2-6 2-7 3 0 1 0 2-1 3 0 1-1 2-2 3-1 0-2 1-4 2-1 1-2 2-3 2 0 1-1 1-2 2-1 1-1 1-2 1 0 1-1 1-2 2-1 0-2 0-2 0-1 0-2 0-3 0l-1 0c-1 0-1-1-2-1 0 0-1-1-1-1-1 0-1 0-1-1 0 0 0 0 0 0-4 3-8 5-11 6-1 0-2 1-3 1-1 1-2 2-3 2-1 1-2 1-3 1-1 0-2-1-3-2-1-1-1-3-2-4 0-2 0-4 0-4-1 1-1 2 0 5 1 2 1 4 0 5 0 1-1 2-3 1-1 0-2 0-3-1-1 0-2-1-3-2-2-1-2-2-3-2 0 0-1-1-2-2-2-1-2-1-3-2 0-1-1-2-1-3-1-2-1-3-2-3 0 0-1 1-3 1-2 1-3 1-3 2 1-2 1-5 1-10 1-5 1-8 2-11 1-6 0-10-4-14-5-4-8-8-8-11-1-4 0-7 3-7 0-2 0-4-2-6-1-3-2-5-2-6 0-2 0-3 1-5z"/>
|
32 |
+
<glyph glyph-name="pound" unicode="" d="M125 160l-93 0 0 54 101 0 13 84-99 0 0 54 107 0 22 128 64 0-22-128 106 0 22 128 63 0-22-128 93 0 0-54-102 0-12-84 99 0 0-54-106 0-23-128-63 0 22 128-107 0-21-128-64 0z m84 138l-12-84 106 0 12 84-106 0z"/>
|
33 |
+
<glyph glyph-name="map-marker" unicode="" d="M329 329c0 20-7 38-21 52-15 14-32 21-52 21-20 0-37-7-52-21-14-14-21-32-21-52 0-20 7-37 21-52 15-14 32-21 52-21 20 0 37 7 52 21 14 15 21 32 21 52z m73 0c0-21-3-38-9-51l-104-221c-3-6-8-11-14-15-6-4-12-5-19-5-7 0-13 1-19 5-6 4-11 9-14 15l-104 221c-6 13-9 30-9 51 0 41 14 75 43 104 28 28 63 42 103 42 40 0 75-14 103-42 29-29 43-63 43-104z"/>
|
34 |
+
<glyph glyph-name="credit-card" unicode="" d="M469 461c12 0 22-4 30-13 9-8 13-18 13-30l0-324c0-12-4-22-13-30-8-9-18-13-30-13l-426 0c-12 0-22 4-30 13-9 8-13 18-13 30l0 324c0 12 4 22 13 30 8 9 18 13 30 13z m-426-34c-3 0-5-1-6-3-2-2-3-4-3-6l0-60 444 0 0 60c0 2-1 4-3 6-1 2-3 3-6 3z m426-342c3 0 5 1 6 3 2 2 3 4 3 6l0 162-444 0 0-162c0-2 1-4 3-6 1-2 3-3 6-3z m-401 34l0 35 69 0 0-35z m103 0l0 35 102 0 0-35z"/>
|
35 |
+
<glyph glyph-name="step-forward" unicode="" d="M123 40c-4-3-7-5-10-3-2 1-3 4-3 9l0 420c0 5 1 8 3 9 3 2 6 0 10-3l202-203c2-2 3-3 4-6l0 194c0 5 2 9 6 13 3 4 7 5 12 5l37 0c5 0 9-1 13-5 3-4 5-8 5-13l0-402c0-5-2-9-5-13-4-4-8-5-13-5l-37 0c-5 0-9 1-12 5-4 4-6 8-6 13l0 194c-1-2-2-4-4-6z"/>
|
36 |
+
<glyph glyph-name="code" unicode="" d="M158 112l-14-14c-2-2-4-3-7-3-2 0-5 1-6 3l-134 133c-1 2-2 4-2 7 0 2 1 4 2 6l134 133c1 2 4 3 6 3 3 0 5-1 7-3l14-14c2-2 3-4 3-6 0-3-1-5-3-7l-112-112 112-113c2-1 3-4 3-6 0-3-1-5-3-7z m169 305l-107-369c0-2-2-4-4-5-2-2-5-2-7-1l-18 5c-2 1-4 2-5 4-1 2-2 5-1 7l107 369c0 3 2 4 4 6 2 1 5 1 7 0l18-4c2-1 4-3 5-5 1-2 2-4 1-7z m188-186l-134-133c-1-2-4-3-6-3-3 0-5 1-7 3l-14 14c-2 2-3 4-3 7 0 2 1 5 3 6l112 113-112 112c-2 2-3 4-3 7 0 2 1 4 3 6l14 14c2 2 4 3 7 3 2 0 5-1 6-3l134-133c1-2 2-4 2-6 0-3-1-5-2-7z"/>
|
37 |
+
<glyph glyph-name="html5" unicode="" d="M378 341l4 50-252 0 13-152 175 0-6-65-57-15-56 15-3 40-50 0 6-80 103-28 2 0 0 0 102 28 14 156-184 0-4 51z m-323 134l402 0-36-410-166-47-164 47z"/>
|
38 |
+
<glyph glyph-name="qrcode" unicode="" d="M165 183l0-37-37 0 0 37z m0 219l0-36-37 0 0 36z m219 0l0-36-37 0 0 36z m-293-292l110 0 0 109-110 0z m0 219l110 0 0 110-110 0z m220 0l110 0 0 110-110 0z m-73-73l0-183-183 0 0 183z m146-146l0-37-37 0 0 37z m73 0l0-37-36 0 0 37z m0 146l0-110-110 0 0 37-36 0 0-110-37 0 0 183 110 0 0-37 37 0 0 37z m-219 219l0-182-183 0 0 182z m219 0l0-182-183 0 0 182z"/>
|
39 |
+
<glyph glyph-name="certificate" unicode="" d="M430 256l39-39c6-5 8-12 6-20-2-7-7-12-15-14l-54-14 15-53c3-8 1-14-5-20-6-6-12-8-20-5l-53 15-14-54c-2-8-7-13-14-15-3 0-5 0-6 0-6 0-11 2-14 6l-39 39-39-39c-5-6-12-8-20-6-7 2-12 7-14 15l-14 54-53-15c-8-3-14-1-20 5-6 6-8 12-5 20l15 53-54 14c-8 2-13 7-15 14-2 8 0 15 6 20l39 39-39 39c-6 5-8 12-6 20 2 7 7 12 15 14l54 14-15 53c-3 8-1 14 5 20 6 6 12 8 20 5l53-15 14 54c2 8 7 13 14 15 8 2 15 0 20-6l39-40 39 40c5 6 12 8 20 6 7-2 12-7 14-15l14-54 53 15c8 3 14 1 20-5 6-6 8-12 5-20l-15-53 54-14c8-2 13-7 15-14 2-8 0-15-6-20z"/>
|
40 |
+
<glyph glyph-name="star-half-o" unicode="" d="M357 239l74 71-102 15-19 3-9 17-45 92 0-275 17-9 91-48-17 101-4 19z m129 74l-103-101 24-143c1-6 1-11-2-14-2-4-5-6-9-6-4 0-7 2-12 4l-128 67-128-67c-5-2-8-4-12-4-4 0-7 2-9 6-3 3-3 8-2 14l24 143-104 101c-6 7-8 12-6 17 2 6 7 9 15 10l144 21 64 130c4 8 8 12 14 12 5 0 10-4 14-12l64-130 144-21c8-1 13-4 15-10 2-5 0-10-7-17z"/>
|
41 |
+
<glyph glyph-name="eye" unicode="" d="M475 238c-29 45-65 78-108 101 11-20 17-42 17-65 0-35-13-65-38-90-25-25-55-38-90-38-35 0-65 13-90 38-25 25-38 55-38 90 0 23 6 45 17 65-43-23-79-56-108-101 25-39 57-70 95-94 38-23 79-34 124-34 45 0 86 11 124 34 38 24 70 55 95 94z m-205 109c0 4-2 7-4 10-3 3-6 4-10 4-24 0-44-8-61-25-17-17-26-38-26-62 0-4 1-7 4-9 3-3 6-4 10-4 4 0 7 1 10 4 2 2 4 5 4 9 0 17 5 31 17 42 12 12 26 18 42 18 4 0 7 1 10 4 2 2 4 6 4 9z m242-109c0-7-2-13-6-20-26-44-62-79-107-105-45-27-93-40-143-40-50 0-98 13-143 40-45 26-81 61-107 105-4 7-6 13-6 20 0 6 2 13 6 19 26 44 62 79 107 106 45 26 93 39 143 39 50 0 98-13 143-39 45-27 81-62 107-106 4-6 6-13 6-19z"/>
|
42 |
+
<glyph glyph-name="save" unicode="" d="M448 96l32 0 0-32-32 0z m-384 128l352 0 0-192-352 0z m64 288l256 0 0-160-256 0z m-128 0l0-512 512 0 0 448-64 64z m288-32l64 0 0-96-64 0z m-160-384l224 0 0-32-224 0z m0 64l160 0 0-32-160 0z"/>
|
43 |
+
<glyph glyph-name="puzzle-piece" unicode="" d="M494 198c0-15-5-28-13-38-8-11-20-16-35-16-8 0-15 2-22 5-7 4-13 7-17 11-5 4-10 8-16 11-7 3-14 5-21 5-21 0-31-12-31-35 0-8 1-19 4-33 3-15 5-26 5-33l0-2c-4 0-8 0-10 0-6 0-15-2-28-3-12-2-23-3-33-4-9-1-19-1-28-1-11 0-21 2-29 7-8 5-12 13-12 24 0 7 2 14 5 20 3 7 7 12 11 16 4 5 7 10 11 17 3 7 5 15 5 22 0 15-5 27-16 36-10 8-23 12-38 12-16 0-30-4-41-13-11-8-17-20-17-36 0-8 1-16 4-24 3-7 6-13 10-18 3-5 7-10 9-15 3-6 5-11 5-15 0-8-5-17-13-25-7-7-19-10-34-10-18 0-41 2-70 7-2 0-4 0-8 1-3 0-6 1-8 1l-3 1c0 0-1 0-1 0-1 0-1 0-1 0l0 293c1 0 2-1 5-1 3-1 6-1 10-2 4 0 6-1 6-1 29-4 52-7 70-7 15 0 27 4 34 10 8 9 13 17 13 26 0 4-2 9-5 14-2 6-6 11-9 15-4 5-7 11-10 19-3 7-4 15-4 24 0 15 6 27 17 36 11 9 25 13 41 13 15 0 28-4 38-13 11-8 16-20 16-35 0-8-2-15-5-22-4-7-7-13-11-17-4-4-8-10-11-16-3-7-5-13-5-20 0-11 4-19 12-24 8-5 18-8 29-8 13 0 30 2 52 4 22 3 37 5 46 5l0 0c0-1 0-2-1-5 0-3-1-6-1-10 0-4-1-6-1-6-5-29-7-52-7-70 0-15 3-27 10-34 9-8 17-13 26-13 4 0 9 2 14 5 5 2 10 6 15 9 5 4 11 7 19 10 7 3 15 4 23 4 16 0 28-6 37-17 8-11 13-25 13-41z"/>
|
44 |
+
<glyph glyph-name="slack" unicode="" d="M452 290c12 0 22-4 30-11 8-8 12-18 12-29 0-19-9-31-27-37l-49-17 16-48c1-4 2-8 2-13 0-12-4-21-12-30-8-8-18-12-29-12-9 0-17 3-24 8-8 5-13 12-16 20l-15 48-89-31 16-47c1-4 2-9 2-13 0-11-4-21-12-29-8-8-18-12-29-12-9 0-17 2-24 7-8 5-13 12-15 21l-16 46-44-15c-5-1-10-2-14-2-12 0-21 4-29 11-8 8-12 17-12 29 0 9 3 17 8 24 5 8 12 13 21 15l44 16-30 89-44-15c-5-2-10-3-14-3-12 0-21 4-29 12-8 8-12 17-12 29 0 9 3 17 8 24 5 7 12 12 21 15l44 15-15 46c-1 4-2 9-2 13 0 11 4 21 12 29 8 8 18 12 29 12 9 0 17-2 24-7 8-5 13-12 16-21l15-46 89 30-16 46c-1 5-2 9-2 14 0 11 4 21 12 29 8 8 18 12 29 12 9 0 17-3 24-8 8-5 13-12 16-20l15-46 46 15c4 2 8 2 12 2 12 0 22-4 30-11 8-8 12-17 12-28 0-9-3-17-9-24-5-7-12-11-21-14l-45-16 30-90 47 16c5 2 9 2 13 2z m-227-75l89 30-30 90-89-30z"/>
|
45 |
+
<glyph glyph-name="trash" unicode="" d="M201 119l0 201c0 3-1 5-2 7-2 1-4 2-7 2l-18 0c-3 0-5-1-7-2-2-2-2-4-2-7l0-201c0-3 0-5 2-7 2-1 4-2 7-2l18 0c3 0 5 1 7 2 1 2 2 4 2 7z m73 0l0 201c0 3-1 5-2 7-2 1-4 2-7 2l-18 0c-3 0-5-1-7-2-1-2-2-4-2-7l0-201c0-3 1-5 2-7 2-1 4-2 7-2l18 0c3 0 5 1 7 2 1 2 2 4 2 7z m73 0l0 201c0 3 0 5-2 7-2 1-4 2-7 2l-18 0c-3 0-5-1-7-2-1-2-2-4-2-7l0-201c0-3 1-5 2-7 2-1 4-2 7-2l18 0c3 0 5 1 7 2 2 2 2 4 2 7z m-155 283l128 0-14 34c-1 1-3 2-5 3l-90 0c-2-1-4-2-5-3z m265-9l0-18c0-3-1-5-2-7-2-1-4-2-7-2l-27 0 0-271c0-16-5-30-14-41-9-12-20-17-32-17l-238 0c-12 0-23 5-32 16-9 11-14 25-14 41l0 272-27 0c-3 0-5 1-7 2-1 2-2 4-2 7l0 18c0 3 1 5 2 7 2 1 4 2 7 2l88 0 20 48c3 7 8 13 16 18 7 5 15 7 22 7l92 0c7 0 15-2 22-7 8-5 13-11 16-18l20-48 88 0c3 0 5-1 7-2 1-2 2-4 2-7z"/>
|
46 |
+
<glyph glyph-name="lock" unicode="" d="M183 293l146 0 0 54c0 21-7 38-21 52-15 14-32 22-52 22-20 0-37-8-52-22-14-14-21-31-21-52z m238-28l0-164c0-8-3-15-8-20-6-5-12-8-20-8l-274 0c-8 0-14 3-20 8-5 5-8 12-8 20l0 164c0 8 3 14 8 20 6 5 12 8 20 8l9 0 0 54c0 35 13 66 38 91 25 25 55 37 90 37 35 0 65-12 90-37 25-25 38-56 38-91l0-54 9 0c8 0 14-3 20-8 5-6 8-12 8-20z"/>
|
47 |
+
<glyph glyph-name="chevron-down" unicode="" d="M481 281l-212-212c-4-3-8-5-13-5-5 0-9 2-13 5l-212 212c-3 4-5 8-5 13 0 5 2 10 5 13l48 47c3 4 7 6 12 6 5 0 10-2 13-6l152-151 152 151c3 4 8 6 13 6 5 0 9-2 12-6l48-47c3-3 5-8 5-13 0-5-2-9-5-13z"/>
|
48 |
+
<glyph glyph-name="chevron-up" unicode="" d="M481 132l-48-47c-3-4-7-6-12-6-5 0-10 2-13 6l-152 151-152-151c-3-4-8-6-13-6-5 0-9 2-12 6l-48 47c-3 3-5 8-5 13 0 5 2 9 5 13l212 211c4 4 8 6 13 6 5 0 9-2 13-6l212-211c3-4 5-8 5-13 0-5-2-10-5-13z"/>
|
49 |
+
<glyph glyph-name="chevron-right" unicode="" d="M389 261l-212-212c-3-3-7-5-12-5-5 0-10 2-13 5l-48 48c-3 3-5 8-5 13 0 5 2 9 5 13l152 151-152 152c-3 4-5 8-5 13 0 5 2 9 5 13l48 47c3 4 8 6 13 6 5 0 9-2 12-6l212-212c4-3 6-8 6-13 0-5-2-9-6-13z"/>
|
50 |
+
<glyph glyph-name="chevron-left" unicode="" d="M408 426l-152-152 152-151c3-4 5-8 5-13 0-5-2-10-5-13l-48-48c-3-3-8-5-13-5-5 0-9 2-12 5l-212 212c-4 4-6 8-6 13 0 5 2 10 6 13l212 212c3 4 7 6 12 6 5 0 10-2 13-6l48-47c3-4 5-8 5-13 0-5-2-9-5-13z"/>
|
51 |
+
<glyph glyph-name="circle-o" unicode="" d="M256 411c-28 0-54-7-78-20-24-14-43-33-57-57-13-24-20-50-20-78 0-28 7-54 20-78 14-24 33-43 57-57 24-13 50-20 78-20 28 0 54 7 78 20 24 14 43 33 57 57 13 24 20 50 20 78 0 28-7 54-20 78-14 24-33 43-57 57-24 13-50 20-78 20z m219-155c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
|
52 |
+
<glyph glyph-name="cog" unicode="" d="M329 256c0 20-7 37-21 52-15 14-32 21-52 21-20 0-37-7-52-21-14-15-21-32-21-52 0-20 7-37 21-52 15-14 32-21 52-21 20 0 37 7 52 21 14 15 21 32 21 52z m146 31l0-63c0-3 0-5-2-7-1-2-3-3-6-4l-52-8c-4-10-8-19-12-26 7-9 17-22 31-39 2-2 3-5 3-7 0-3-1-5-3-7-5-7-14-17-28-31-14-13-23-20-27-20-2 0-5 1-7 3l-40 31c-8-5-17-8-26-11-3-26-6-44-8-53-1-6-5-8-10-8l-64 0c-2 0-5 0-7 2-2 2-3 4-3 6l-8 53c-9 3-18 6-26 10l-40-30c-2-2-4-3-7-3-3 0-5 1-7 3-24 22-40 38-47 48-2 2-2 4-2 7 0 2 0 4 2 6 3 4 8 11 14 19 7 9 12 16 16 21-5 9-9 19-12 28l-52 8c-3 0-5 1-6 3-2 2-2 4-2 7l0 63c0 3 0 5 2 7 1 2 3 3 5 4l53 8c3 8 7 17 12 26-8 11-18 24-31 39-2 3-3 5-3 7 0 2 1 4 3 7 5 7 14 17 28 30 14 14 23 21 27 21 2 0 5-1 7-3l40-31c8 5 17 8 26 11 3 26 6 44 8 53 1 6 5 8 10 8l64 0c2 0 5 0 7-2 2-2 3-4 3-6l8-53c9-3 18-6 26-10l40 30c2 2 4 3 7 3 3 0 5-1 7-3 25-23 41-39 47-49 2-1 2-3 2-6 0-2 0-4-2-6-3-4-8-11-14-19-7-9-12-16-16-21 5-9 9-18 12-28l52-8c3 0 5-1 6-3 2-2 2-4 2-7z"/>
|
53 |
+
<glyph glyph-name="info" unicode="" d="M256 448c-106 0-192-86-192-192 0-106 86-192 192-192 106 0 192 86 192 192 0 106-86 192-192 192z m20-299c0-3-3-6-7-6l-26 0c-4 0-7 3-7 6l0 124c0 4 3 7 7 7l26 0c4 0 7-3 7-7z m-20 159c-13 0-23 10-23 23 0 13 10 23 23 23 13 0 23-10 23-23 0-13-10-23-23-23z"/>
|
54 |
+
<glyph glyph-name="info-circle" unicode="" d="M329 119l0 46c0 2-1 4-2 6-2 2-4 3-7 3l-27 0 0 146c0 3-1 5-3 7-2 1-4 2-7 2l-91 0c-3 0-5-1-7-2-1-2-2-4-2-7l0-46c0-2 1-5 2-6 2-2 4-3 7-3l27 0 0-91-27 0c-3 0-5-1-7-3-1-2-2-4-2-6l0-46c0-3 1-5 2-7 2-1 4-2 7-2l128 0c3 0 5 1 7 2 1 2 2 4 2 7z m-36 256l0 46c0 2-1 4-3 6-2 2-4 3-7 3l-54 0c-3 0-5-1-7-3-2-2-3-4-3-6l0-46c0-3 1-5 3-7 2-1 4-2 7-2l54 0c3 0 5 1 7 2 2 2 3 4 3 7z m182-119c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
|
55 |
+
</font></defs></svg>
|
public/fonts/fluentform.ttf
ADDED
Binary file
|
public/fonts/fluentform.woff
ADDED
Binary file
|
public/fonts/vendor/element-ui/lib/theme-chalk/element-icons.ttf
ADDED
Binary file
|
public/fonts/vendor/element-ui/lib/theme-chalk/element-icons.woff
ADDED
Binary file
|
public/images/handle.png
ADDED
Binary file
|
public/images/resize.png
ADDED
Binary file
|
public/img/icon_black_small.png
ADDED
Binary file
|
public/img/recaptcha-placeholder.png
ADDED
Binary file
|
public/js/fluent-all-forms-admin.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
!function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=495)}([function(e,t){function n(e,t){var n=e[1]||"",o=e[3];if(!o)return n;if(t&&"function"==typeof btoa){var r=function(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}(o),i=o.sources.map(function(e){return"/*# sourceURL="+o.sourceRoot+e+" */"});return[n].concat(i).concat([r]).join("\n")}return[n].join("\n")}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var o=n(t,e);return t[2]?"@media "+t[2]+"{"+o+"}":o}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var o={},r=0;r<this.length;r++){var i=this[r][0];"number"==typeof i&&(o[i]=!0)}for(r=0;r<e.length;r++){var s=e[r];"number"==typeof s[0]&&o[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="("+s[2]+") and ("+n+")"),t.push(s))}},t}},function(e,t,n){function o(e,t){for(var n=0;n<e.length;n++){var o=e[n],r=f[o.id];if(r){r.refs++;for(var i=0;i<r.parts.length;i++)r.parts[i](o.parts[i]);for(;i<o.parts.length;i++)r.parts.push(c(o.parts[i],t))}else{var s=[];for(i=0;i<o.parts.length;i++)s.push(c(o.parts[i],t));f[o.id]={id:o.id,refs:1,parts:s}}}}function r(e,t){for(var n=[],o={},r=0;r<e.length;r++){var i=e[r],s=t.base?i[0]+t.base:i[0],a={css:i[1],media:i[2],sourceMap:i[3]};o[s]?o[s].parts.push(a):n.push(o[s]={id:s,parts:[a]})}return n}function i(e,t){var n=d(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var o=v[v.length-1];if("top"===e.insertAt)o?o.nextSibling?n.insertBefore(t,o.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),v.push(t);else{if("bottom"!==e.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");n.appendChild(t)}}function s(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=v.indexOf(e);t>=0&&v.splice(t,1)}function a(e){var t=document.createElement("style");return e.attrs.type="text/css",l(t,e.attrs),i(e,t),t}function l(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function c(e,t){var n,o,r,c;if(t.transform&&e.css){if(!(c=t.transform(e.css)))return function(){};e.css=c}if(t.singleton){var f=m++;n=h||(h=a(t)),o=u.bind(null,n,f,!1),r=u.bind(null,n,f,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return e.attrs.type="text/css",e.attrs.rel="stylesheet",l(t,e.attrs),i(e,t),t}(t),o=function(e,t,n){var o=n.css,r=n.sourceMap,i=void 0===t.convertToAbsoluteUrls&&r;(t.convertToAbsoluteUrls||i)&&(o=g(o));r&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var s=new Blob([o],{type:"text/css"}),a=e.href;e.href=URL.createObjectURL(s),a&&URL.revokeObjectURL(a)}.bind(null,n,t),r=function(){s(n),n.href&&URL.revokeObjectURL(n.href)}):(n=a(t),o=function(e,t){var n=t.css,o=t.media;o&&e.setAttribute("media",o);if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),r=function(){s(n)});return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else r()}}function u(e,t,n,o){var r=n?"":o.css;if(e.styleSheet)e.styleSheet.cssText=b(t,r);else{var i=document.createTextNode(r),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(i,s[t]):e.appendChild(i)}}var f={},p=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}}(function(){return window&&document&&document.all&&!window.atob}),d=function(e){var t={};return function(e){return void 0===t[e]&&(t[e]=function(e){return document.querySelector(e)}.call(this,e)),t[e]}}(),h=null,m=0,v=[],g=n(58);e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||(t.singleton=p()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=r(e,t);return o(n,t),function(e){for(var i=[],s=0;s<n.length;s++){var a=n[s];(l=f[a.id]).refs--,i.push(l)}if(e){o(r(e,t),t)}for(s=0;s<i.length;s++){var l;if(0===(l=i[s]).refs){for(var c=0;c<l.parts.length;c++)l.parts[c]();delete f[l.id]}}}};var b=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},function(e,t,n){var o=n(84);"string"==typeof o&&(o=[[e.i,o,""]]);var r={};r.transform=void 0;n(1)(o,r);o.locals&&(e.exports=o.locals)},function(e,t){e.exports=function(e,t,n,o,r,i){var s,a=e=e||{},l=typeof e.default;"object"!==l&&"function"!==l||(s=e,a=e.default);var c="function"==typeof a?a.options:a;t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId=r);var u;if(i?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},c._ssrRegister=u):o&&(u=o),u){var f=c.functional,p=f?c.render:c.beforeCreate;f?(c._injectStyles=u,c.render=function(e,t){return u.call(t),p(e,t)}):c.beforeCreate=p?[].concat(p,u):[u]}return{esModule:s,exports:a,options:c}}},function(e,t,n){"use strict";(function(t,n){function o(e){return void 0===e||null===e}function r(e){return void 0!==e&&null!==e}function i(e){return!0===e}function s(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function a(e){return null!==e&&"object"==typeof e}function l(e){return"[object Object]"===Ln.call(e)}function c(e){return"[object RegExp]"===Ln.call(e)}function u(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function f(e){return null==e?"":"object"==typeof e?JSON.stringify(e,null,2):String(e)}function p(e){var t=parseFloat(e);return isNaN(t)?e:t}function d(e,t){for(var n=Object.create(null),o=e.split(","),r=0;r<o.length;r++)n[o[r]]=!0;return t?function(e){return n[e.toLowerCase()]}:function(e){return n[e]}}function h(e,t){if(e.length){var n=e.indexOf(t);if(n>-1)return e.splice(n,1)}}function m(e,t){return Bn.call(e,t)}function v(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}function g(e,t){function n(n){var o=arguments.length;return o?o>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n}function b(e,t){t=t||0;for(var n=e.length-t,o=new Array(n);n--;)o[n]=e[n+t];return o}function _(e,t){for(var n in t)e[n]=t[n];return e}function y(e){for(var t={},n=0;n<e.length;n++)e[n]&&_(t,e[n]);return t}function x(e,t,n){}function w(e,t){if(e===t)return!0;var n=a(e),o=a(t);if(!n||!o)return!n&&!o&&String(e)===String(t);try{var r=Array.isArray(e),i=Array.isArray(t);if(r&&i)return e.length===t.length&&e.every(function(e,n){return w(e,t[n])});if(r||i)return!1;var s=Object.keys(e),l=Object.keys(t);return s.length===l.length&&s.every(function(n){return w(e[n],t[n])})}catch(e){return!1}}function k(e,t){for(var n=0;n<e.length;n++)if(w(e[n],t))return n;return-1}function C(e){var t=!1;return function(){t||(t=!0,e.apply(this,arguments))}}function S(e){var t=(e+"").charCodeAt(0);return 36===t||95===t}function $(e,t,n,o){Object.defineProperty(e,t,{value:n,enumerable:!!o,writable:!0,configurable:!0})}function O(e){return"function"==typeof e&&/native code/.test(e.toString())}function E(e){return new ko(void 0,void 0,void 0,String(e))}function T(e,t){var n=e.componentOptions,o=new ko(e.tag,e.data,e.children,e.text,e.elm,e.context,n,e.asyncFactory);return o.ns=e.ns,o.isStatic=e.isStatic,o.key=e.key,o.isComment=e.isComment,o.fnContext=e.fnContext,o.fnOptions=e.fnOptions,o.fnScopeId=e.fnScopeId,o.isCloned=!0,t&&(e.children&&(o.children=M(e.children,!0)),n&&n.children&&(n.children=M(n.children,!0))),o}function M(e,t){for(var n=e.length,o=new Array(n),r=0;r<n;r++)o[r]=T(e[r],t);return o}function A(e,t,n){e.__proto__=t}function P(e,t,n){for(var o=0,r=n.length;o<r;o++){var i=n[o];$(e,i,t[i])}}function z(e,t){if(a(e)&&!(e instanceof ko)){var n;return m(e,"__ob__")&&e.__ob__ instanceof Mo?n=e.__ob__:To.shouldConvert&&!vo()&&(Array.isArray(e)||l(e))&&Object.isExtensible(e)&&!e._isVue&&(n=new Mo(e)),t&&n&&n.vmCount++,n}}function j(e,t,n,o,r){var i=new xo,s=Object.getOwnPropertyDescriptor(e,t);if(!s||!1!==s.configurable){var a=s&&s.get,l=s&&s.set,c=!r&&z(n);Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var t=a?a.call(e):n;return xo.target&&(i.depend(),c&&(c.dep.depend(),Array.isArray(t)&&N(t))),t},set:function(t){var o=a?a.call(e):n;t===o||t!=t&&o!=o||(l?l.call(e,t):n=t,c=!r&&z(t),i.notify())}})}}function F(e,t,n){if(Array.isArray(e)&&u(t))return e.length=Math.max(e.length,t),e.splice(t,1,n),n;if(t in e&&!(t in Object.prototype))return e[t]=n,n;var o=e.__ob__;return e._isVue||o&&o.vmCount?n:o?(j(o.value,t,n),o.dep.notify(),n):(e[t]=n,n)}function I(e,t){if(Array.isArray(e)&&u(t))e.splice(t,1);else{var n=e.__ob__;e._isVue||n&&n.vmCount||m(e,t)&&(delete e[t],n&&n.dep.notify())}}function N(e){for(var t=void 0,n=0,o=e.length;n<o;n++)(t=e[n])&&t.__ob__&&t.__ob__.dep.depend(),Array.isArray(t)&&N(t)}function L(e,t){if(!t)return e;for(var n,o,r,i=Object.keys(t),s=0;s<i.length;s++)o=e[n=i[s]],r=t[n],m(e,n)?l(o)&&l(r)&&L(o,r):F(e,n,r);return e}function R(e,t,n){return n?function(){var o="function"==typeof t?t.call(n,n):t,r="function"==typeof e?e.call(n,n):e;return o?L(o,r):r}:t?e?function(){return L("function"==typeof t?t.call(this,this):t,"function"==typeof e?e.call(this,this):e)}:t:e}function D(e,t){return t?e?e.concat(t):Array.isArray(t)?t:[t]:e}function B(e,t,n,o){var r=Object.create(e||null);return t?_(r,t):r}function q(e,t,n){function o(o){var r=Ao[o]||jo;c[o]=r(e[o],t[o],n,o)}"function"==typeof t&&(t=t.options),function(e,t){var n=e.props;if(n){var o,r,i={};if(Array.isArray(n))for(o=n.length;o--;)"string"==typeof(r=n[o])&&(i[Hn(r)]={type:null});else if(l(n))for(var s in n)r=n[s],i[Hn(s)]=l(r)?r:{type:r};e.props=i}}(t),function(e,t){var n=e.inject;if(n){var o=e.inject={};if(Array.isArray(n))for(var r=0;r<n.length;r++)o[n[r]]={from:n[r]};else if(l(n))for(var i in n){var s=n[i];o[i]=l(s)?_({from:i},s):{from:s}}}}(t),function(e){var t=e.directives;if(t)for(var n in t){var o=t[n];"function"==typeof o&&(t[n]={bind:o,update:o})}}(t);var r=t.extends;if(r&&(e=q(e,r,n)),t.mixins)for(var i=0,s=t.mixins.length;i<s;i++)e=q(e,t.mixins[i],n);var a,c={};for(a in e)o(a);for(a in t)m(e,a)||o(a);return c}function H(e,t,n,o){if("string"==typeof n){var r=e[t];if(m(r,n))return r[n];var i=Hn(n);if(m(r,i))return r[i];var s=Vn(i);if(m(r,s))return r[s];return r[n]||r[i]||r[s]}}function V(e,t,n,o){var r=t[e],i=!m(n,e),s=n[e];if(W(Boolean,r.type)&&(i&&!m(r,"default")?s=!1:W(String,r.type)||""!==s&&s!==Wn(e)||(s=!0)),void 0===s){s=function(e,t,n){if(!m(t,"default"))return;var o=t.default;0;if(e&&e.$options.propsData&&void 0===e.$options.propsData[n]&&void 0!==e._props[n])return e._props[n];return"function"==typeof o&&"Function"!==U(t.type)?o.call(e):o}(o,r,e);var a=To.shouldConvert;To.shouldConvert=!0,z(s),To.shouldConvert=a}return s}function U(e){var t=e&&e.toString().match(/^\s*function (\w+)/);return t?t[1]:""}function W(e,t){if(!Array.isArray(t))return U(t)===U(e);for(var n=0,o=t.length;n<o;n++)if(U(t[n])===U(e))return!0;return!1}function X(e,t,n){if(t)for(var o=t;o=o.$parent;){var r=o.$options.errorCaptured;if(r)for(var i=0;i<r.length;i++)try{if(!1===r[i].call(o,e,t,n))return}catch(e){J(e,o,"errorCaptured hook")}}J(e,t,n)}function J(e,t,n){if(Zn.errorHandler)try{return Zn.errorHandler.call(null,e,t,n)}catch(e){K(e,null,"config.errorHandler")}K(e,t,n)}function K(e,t,n){if(!to&&!no||"undefined"==typeof console)throw e;console.error(e)}function G(){Io=!1;var e=Fo.slice(0);Fo.length=0;for(var t=0;t<e.length;t++)e[t]()}function Y(e,t){var n;if(Fo.push(function(){if(e)try{e.call(t)}catch(e){X(e,t,"nextTick")}else n&&n(t)}),Io||(Io=!0,No?zo():Po()),!e&&"undefined"!=typeof Promise)return new Promise(function(e){n=e})}function Z(e){Q(e,qo),qo.clear()}function Q(e,t){var n,o,r=Array.isArray(e);if((r||a(e))&&!Object.isFrozen(e)){if(e.__ob__){var i=e.__ob__.dep.id;if(t.has(i))return;t.add(i)}if(r)for(n=e.length;n--;)Q(e[n],t);else for(n=(o=Object.keys(e)).length;n--;)Q(e[o[n]],t)}}function ee(e){function t(){var e=arguments,n=t.fns;if(!Array.isArray(n))return n.apply(null,arguments);for(var o=n.slice(),r=0;r<o.length;r++)o[r].apply(null,e)}return t.fns=e,t}function te(e,t,n,r,i){var s,a,l,c;for(s in e)a=e[s],l=t[s],c=Ho(s),o(a)||(o(l)?(o(a.fns)&&(a=e[s]=ee(a)),n(c.name,a,c.once,c.capture,c.passive,c.params)):a!==l&&(l.fns=a,e[s]=l));for(s in t)o(e[s])&&r((c=Ho(s)).name,t[s],c.capture)}function ne(e,t,n){function s(){n.apply(this,arguments),h(a.fns,s)}e instanceof ko&&(e=e.data.hook||(e.data.hook={}));var a,l=e[t];o(l)?a=ee([s]):r(l.fns)&&i(l.merged)?(a=l).fns.push(s):a=ee([l,s]),a.merged=!0,e[t]=a}function oe(e,t,n,o,i){if(r(t)){if(m(t,n))return e[n]=t[n],i||delete t[n],!0;if(m(t,o))return e[n]=t[o],i||delete t[o],!0}return!1}function re(e){return r(e)&&r(e.text)&&function(e){return!1===e}(e.isComment)}function ie(e,t){var n,a,l,c,u=[];for(n=0;n<e.length;n++)o(a=e[n])||"boolean"==typeof a||(c=u[l=u.length-1],Array.isArray(a)?a.length>0&&(re((a=ie(a,(t||"")+"_"+n))[0])&&re(c)&&(u[l]=E(c.text+a[0].text),a.shift()),u.push.apply(u,a)):s(a)?re(c)?u[l]=E(c.text+a):""!==a&&u.push(E(a)):re(a)&&re(c)?u[l]=E(c.text+a.text):(i(e._isVList)&&r(a.tag)&&o(a.key)&&r(t)&&(a.key="__vlist"+t+"_"+n+"__"),u.push(a)));return u}function se(e,t){return(e.__esModule||bo&&"Module"===e[Symbol.toStringTag])&&(e=e.default),a(e)?t.extend(e):e}function ae(e){return e.isComment&&e.asyncFactory}function le(e){if(Array.isArray(e))for(var t=0;t<e.length;t++){var n=e[t];if(r(n)&&(r(n.componentOptions)||ae(n)))return n}}function ce(e,t,n){n?Bo.$once(e,t):Bo.$on(e,t)}function ue(e,t){Bo.$off(e,t)}function fe(e,t,n){Bo=e,te(t,n||{},ce,ue),Bo=void 0}function pe(e,t){var n={};if(!e)return n;for(var o=0,r=e.length;o<r;o++){var i=e[o],s=i.data;if(s&&s.attrs&&s.attrs.slot&&delete s.attrs.slot,i.context!==t&&i.fnContext!==t||!s||null==s.slot)(n.default||(n.default=[])).push(i);else{var a=s.slot,l=n[a]||(n[a]=[]);"template"===i.tag?l.push.apply(l,i.children||[]):l.push(i)}}for(var c in n)n[c].every(de)&&delete n[c];return n}function de(e){return e.isComment&&!e.asyncFactory||" "===e.text}function he(e,t){t=t||{};for(var n=0;n<e.length;n++)Array.isArray(e[n])?he(e[n],t):t[e[n].key]=e[n].fn;return t}function me(e){for(;e&&(e=e.$parent);)if(e._inactive)return!0;return!1}function ve(e,t){if(t){if(e._directInactive=!1,me(e))return}else if(e._directInactive)return;if(e._inactive||null===e._inactive){e._inactive=!1;for(var n=0;n<e.$children.length;n++)ve(e.$children[n]);be(e,"activated")}}function ge(e,t){if(!(t&&(e._directInactive=!0,me(e))||e._inactive)){e._inactive=!0;for(var n=0;n<e.$children.length;n++)ge(e.$children[n]);be(e,"deactivated")}}function be(e,t){var n=e.$options[t];if(n)for(var o=0,r=n.length;o<r;o++)try{n[o].call(e)}catch(n){X(n,e,t+" hook")}e._hasHookEvent&&e.$emit("hook:"+t)}function _e(){Ko=!0;var e,t;for(Uo.sort(function(e,t){return e.id-t.id}),Go=0;Go<Uo.length;Go++)t=(e=Uo[Go]).id,Xo[t]=null,e.run();var n=Wo.slice(),o=Uo.slice();Go=Uo.length=Wo.length=0,Xo={},Jo=Ko=!1,function(e){for(var t=0;t<e.length;t++)e[t]._inactive=!0,ve(e[t],!0)}(n),function(e){var t=e.length;for(;t--;){var n=e[t],o=n.vm;o._watcher===n&&o._isMounted&&be(o,"updated")}}(o),go&&Zn.devtools&&go.emit("flush")}function ye(e,t,n){Qo.get=function(){return this[t][n]},Qo.set=function(e){this[t][n]=e},Object.defineProperty(e,n,Qo)}function xe(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},o=e._props={},r=e.$options._propKeys=[],i=!e.$parent;To.shouldConvert=i;var s=function(i){r.push(i);var s=V(i,t,n,e);j(o,i,s),i in e||ye(e,"_props",i)};for(var a in t)s(a);To.shouldConvert=!0}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]=null==t[n]?x:g(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;t=e._data="function"==typeof t?function(e,t){try{return e.call(t,t)}catch(e){return X(e,t,"data()"),{}}}(t,e):t||{},l(t)||(t={});var n=Object.keys(t),o=e.$options.props,r=(e.$options.methods,n.length);for(;r--;){var i=n[r];0,o&&m(o,i)||S(i)||ye(e,"_data",i)}z(t,!0)}(e):z(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),o=vo();for(var r in t){var i=t[r],s="function"==typeof i?i:i.get;0,o||(n[r]=new Zo(e,s||x,x,er)),r in e||we(e,r,i)}}(e,t.computed),t.watch&&t.watch!==uo&&function(e,t){for(var n in t){var o=t[n];if(Array.isArray(o))for(var r=0;r<o.length;r++)Ce(e,n,o[r]);else Ce(e,n,o)}}(e,t.watch)}function we(e,t,n){var o=!vo();"function"==typeof n?(Qo.get=o?ke(t):n,Qo.set=x):(Qo.get=n.get?o&&!1!==n.cache?ke(t):n.get:x,Qo.set=n.set?n.set:x),Object.defineProperty(e,t,Qo)}function ke(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),xo.target&&t.depend(),t.value}}function Ce(e,t,n,o){return l(n)&&(o=n,n=n.handler),"string"==typeof n&&(n=e[n]),e.$watch(t,n,o)}function Se(e,t){if(e){for(var n=Object.create(null),o=bo?Reflect.ownKeys(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}):Object.keys(e),r=0;r<o.length;r++){for(var i=o[r],s=e[i].from,a=t;a;){if(a._provided&&s in a._provided){n[i]=a._provided[s];break}a=a.$parent}if(!a)if("default"in e[i]){var l=e[i].default;n[i]="function"==typeof l?l.call(t):l}else 0}return n}}function $e(e,t){var n,o,i,s,l;if(Array.isArray(e)||"string"==typeof e)for(n=new Array(e.length),o=0,i=e.length;o<i;o++)n[o]=t(e[o],o);else if("number"==typeof e)for(n=new Array(e),o=0;o<e;o++)n[o]=t(o+1,o);else if(a(e))for(s=Object.keys(e),n=new Array(s.length),o=0,i=s.length;o<i;o++)l=s[o],n[o]=t(e[l],l,o);return r(n)&&(n._isVList=!0),n}function Oe(e,t,n,o){var r,i=this.$scopedSlots[e];if(i)n=n||{},o&&(n=_(_({},o),n)),r=i(n)||t;else{var s=this.$slots[e];s&&(s._rendered=!0),r=s||t}var a=n&&n.slot;return a?this.$createElement("template",{slot:a},r):r}function Ee(e){return H(this.$options,"filters",e)||Jn}function Te(e,t,n,o){var r=Zn.keyCodes[t]||n;return r?Array.isArray(r)?-1===r.indexOf(e):r!==e:o?Wn(o)!==t:void 0}function Me(e,t,n,o,r){if(n)if(a(n)){Array.isArray(n)&&(n=y(n));var i,s=function(s){if("class"===s||"style"===s||Dn(s))i=e;else{var a=e.attrs&&e.attrs.type;i=o||Zn.mustUseProp(t,a,s)?e.domProps||(e.domProps={}):e.attrs||(e.attrs={})}if(!(s in i)&&(i[s]=n[s],r)){(e.on||(e.on={}))["update:"+s]=function(e){n[s]=e}}};for(var l in n)s(l)}else;return e}function Ae(e,t){var n=this._staticTrees||(this._staticTrees=[]),o=n[e];return o&&!t?Array.isArray(o)?M(o):T(o):(o=n[e]=this.$options.staticRenderFns[e].call(this._renderProxy,null,this),ze(o,"__static__"+e,!1),o)}function Pe(e,t,n){return ze(e,"__once__"+t+(n?"_"+n:""),!0),e}function ze(e,t,n){if(Array.isArray(e))for(var o=0;o<e.length;o++)e[o]&&"string"!=typeof e[o]&&je(e[o],t+"_"+o,n);else je(e,t,n)}function je(e,t,n){e.isStatic=!0,e.key=t,e.isOnce=n}function Fe(e,t){if(t)if(l(t)){var n=e.on=e.on?_({},e.on):{};for(var o in t){var r=n[o],i=t[o];n[o]=r?[].concat(r,i):i}}else;return e}function Ie(e){e._o=Pe,e._n=p,e._s=f,e._l=$e,e._t=Oe,e._q=w,e._i=k,e._m=Ae,e._f=Ee,e._k=Te,e._b=Me,e._v=E,e._e=So,e._u=he,e._g=Fe}function Ne(e,t,n,o,r){var s=r.options;this.data=e,this.props=t,this.children=n,this.parent=o,this.listeners=e.on||Nn,this.injections=Se(s.inject,o),this.slots=function(){return pe(n,o)};var a=Object.create(o),l=i(s._compiled),c=!l;l&&(this.$options=s,this.$slots=this.slots(),this.$scopedSlots=e.scopedSlots||Nn),s._scopeId?this._c=function(e,t,n,r){var i=De(a,e,t,n,r,c);return i&&(i.fnScopeId=s._scopeId,i.fnContext=o),i}:this._c=function(e,t,n,o){return De(a,e,t,n,o,c)}}function Le(e,t){for(var n in t)e[Hn(n)]=t[n]}function Re(e,t,n,s,l){if(!o(e)){var c=n.$options._base;if(a(e)&&(e=c.extend(e)),"function"==typeof e){var u;if(o(e.cid)&&(u=e,void 0===(e=function(e,t,n){if(i(e.error)&&r(e.errorComp))return e.errorComp;if(r(e.resolved))return e.resolved;if(i(e.loading)&&r(e.loadingComp))return e.loadingComp;if(!r(e.contexts)){var s=e.contexts=[n],l=!0,c=function(){for(var e=0,t=s.length;e<t;e++)s[e].$forceUpdate()},u=C(function(n){e.resolved=se(n,t),l||c()}),f=C(function(t){r(e.errorComp)&&(e.error=!0,c())}),p=e(u,f);return a(p)&&("function"==typeof p.then?o(e.resolved)&&p.then(u,f):r(p.component)&&"function"==typeof p.component.then&&(p.component.then(u,f),r(p.error)&&(e.errorComp=se(p.error,t)),r(p.loading)&&(e.loadingComp=se(p.loading,t),0===p.delay?e.loading=!0:setTimeout(function(){o(e.resolved)&&o(e.error)&&(e.loading=!0,c())},p.delay||200)),r(p.timeout)&&setTimeout(function(){o(e.resolved)&&f(null)},p.timeout))),l=!1,e.loading?e.loadingComp:e.resolved}e.contexts.push(n)}(u,c,n))))return function(e,t,n,o,r){var i=So();return i.asyncFactory=e,i.asyncMeta={data:t,context:n,children:o,tag:r},i}(u,t,n,s,l);t=t||{},qe(e),r(t.model)&&function(e,t){var n=e.model&&e.model.prop||"value",o=e.model&&e.model.event||"input";(t.props||(t.props={}))[n]=t.model.value;var i=t.on||(t.on={});r(i[o])?i[o]=[t.model.callback].concat(i[o]):i[o]=t.model.callback}(e.options,t);var f=function(e,t,n){var i=t.options.props;if(!o(i)){var s={},a=e.attrs,l=e.props;if(r(a)||r(l))for(var c in i){var u=Wn(c);oe(s,l,c,u,!0)||oe(s,a,c,u,!1)}return s}}(t,e);if(i(e.options.functional))return function(e,t,n,o,i){var s=e.options,a={},l=s.props;if(r(l))for(var c in l)a[c]=V(c,l,t||Nn);else r(n.attrs)&&Le(a,n.attrs),r(n.props)&&Le(a,n.props);var u=new Ne(n,a,i,o,e),f=s.render.call(null,u._c,u);return f instanceof ko&&(f.fnContext=o,f.fnOptions=s,n.slot&&((f.data||(f.data={})).slot=n.slot)),f}(e,f,t,n,s);var p=t.on;if(t.on=t.nativeOn,i(e.options.abstract)){var d=t.slot;t={},d&&(t.slot=d)}!function(e){e.hook||(e.hook={});for(var t=0;t<nr.length;t++){var n=nr[t],o=e.hook[n],r=tr[n];e.hook[n]=o?function(e,t){return function(n,o,r,i){e(n,o,r,i),t(n,o,r,i)}}(r,o):r}}(t);var h=e.options.name||l;return new ko("vue-component-"+e.cid+(h?"-"+h:""),t,void 0,void 0,void 0,n,{Ctor:e,propsData:f,listeners:p,tag:l,children:s},u)}}}function De(e,t,n,o,a,l){return(Array.isArray(n)||s(n))&&(a=o,o=n,n=void 0),i(l)&&(a=rr),function(e,t,n,o,i){if(r(n)&&r(n.__ob__))return So();r(n)&&r(n.is)&&(t=n.is);if(!t)return So();0;Array.isArray(o)&&"function"==typeof o[0]&&((n=n||{}).scopedSlots={default:o[0]},o.length=0);i===rr?o=function(e){return s(e)?[E(e)]:Array.isArray(e)?ie(e):void 0}(o):i===or&&(o=function(e){for(var t=0;t<e.length;t++)if(Array.isArray(e[t]))return Array.prototype.concat.apply([],e);return e}(o));var a,l;if("string"==typeof t){var c;l=e.$vnode&&e.$vnode.ns||Zn.getTagNamespace(t),a=Zn.isReservedTag(t)?new ko(Zn.parsePlatformTagName(t),n,o,void 0,void 0,e):r(c=H(e.$options,"components",t))?Re(c,n,e,o,t):new ko(t,n,o,void 0,void 0,e)}else a=Re(t,n,e,o);return r(a)?(l&&Be(a,l),a):So()}(e,t,n,o,a)}function Be(e,t,n){if(e.ns=t,"foreignObject"===e.tag&&(t=void 0,n=!0),r(e.children))for(var s=0,a=e.children.length;s<a;s++){var l=e.children[s];r(l.tag)&&(o(l.ns)||i(n))&&Be(l,t,n)}}function qe(e){var t=e.options;if(e.super){var n=qe(e.super);if(n!==e.superOptions){e.superOptions=n;var o=function(e){var t,n=e.options,o=e.extendOptions,r=e.sealedOptions;for(var i in n)n[i]!==r[i]&&(t||(t={}),t[i]=function(e,t,n){if(Array.isArray(e)){var o=[];n=Array.isArray(n)?n:[n],t=Array.isArray(t)?t:[t];for(var r=0;r<e.length;r++)(t.indexOf(e[r])>=0||n.indexOf(e[r])<0)&&o.push(e[r]);return o}return e}(n[i],o[i],r[i]));return t}(e);o&&_(e.extendOptions,o),(t=e.options=q(n,e.extendOptions)).name&&(t.components[t.name]=e)}}return t}function He(e){this._init(e)}function Ve(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,o=n.cid,r=e._Ctor||(e._Ctor={});if(r[o])return r[o];var i=e.name||n.options.name;var s=function(e){this._init(e)};return s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.cid=t++,s.options=q(n.options,e),s.super=n,s.options.props&&function(e){var t=e.options.props;for(var n in t)ye(e.prototype,"_props",n)}(s),s.options.computed&&function(e){var t=e.options.computed;for(var n in t)we(e.prototype,n,t[n])}(s),s.extend=n.extend,s.mixin=n.mixin,s.use=n.use,Gn.forEach(function(e){s[e]=n[e]}),i&&(s.options.components[i]=s),s.superOptions=n.options,s.extendOptions=e,s.sealedOptions=_({},s.options),r[o]=s,s}}function Ue(e){return e&&(e.Ctor.options.name||e.tag)}function We(e,t){return Array.isArray(e)?e.indexOf(t)>-1:"string"==typeof e?e.split(",").indexOf(t)>-1:!!c(e)&&e.test(t)}function Xe(e,t){var n=e.cache,o=e.keys,r=e._vnode;for(var i in n){var s=n[i];if(s){var a=Ue(s.componentOptions);a&&!t(a)&&Je(n,i,o,r)}}}function Je(e,t,n,o){var r=e[t];!r||o&&r.tag===o.tag||r.componentInstance.$destroy(),e[t]=null,h(n,t)}function Ke(e){for(var t=e.data,n=e,o=e;r(o.componentInstance);)(o=o.componentInstance._vnode)&&o.data&&(t=Ge(o.data,t));for(;r(n=n.parent);)n&&n.data&&(t=Ge(t,n.data));return function(e,t){if(r(e)||r(t))return Ye(e,Ze(t));return""}(t.staticClass,t.class)}function Ge(e,t){return{staticClass:Ye(e.staticClass,t.staticClass),class:r(e.class)?[e.class,t.class]:t.class}}function Ye(e,t){return e?t?e+" "+t:e:t||""}function Ze(e){return Array.isArray(e)?function(e){for(var t,n="",o=0,i=e.length;o<i;o++)r(t=Ze(e[o]))&&""!==t&&(n&&(n+=" "),n+=t);return n}(e):a(e)?function(e){var t="";for(var n in e)e[n]&&(t&&(t+=" "),t+=n);return t}(e):"string"==typeof e?e:""}function Qe(e){return Or(e)?"svg":"math"===e?"math":void 0}function et(e){if("string"==typeof e){var t=document.querySelector(e);return t||document.createElement("div")}return e}function tt(e,t){var n=e.data.ref;if(n){var o=e.context,r=e.componentInstance||e.elm,i=o.$refs;t?Array.isArray(i[n])?h(i[n],r):i[n]===r&&(i[n]=void 0):e.data.refInFor?Array.isArray(i[n])?i[n].indexOf(r)<0&&i[n].push(r):i[n]=[r]:i[n]=r}}function nt(e,t){return e.key===t.key&&(e.tag===t.tag&&e.isComment===t.isComment&&r(e.data)===r(t.data)&&function(e,t){if("input"!==e.tag)return!0;var n,o=r(n=e.data)&&r(n=n.attrs)&&n.type,i=r(n=t.data)&&r(n=n.attrs)&&n.type;return o===i||Mr(o)&&Mr(i)}(e,t)||i(e.isAsyncPlaceholder)&&e.asyncFactory===t.asyncFactory&&o(t.asyncFactory.error))}function ot(e,t,n){var o,i,s={};for(o=t;o<=n;++o)r(i=e[o].key)&&(s[i]=o);return s}function rt(e,t){(e.data.directives||t.data.directives)&&function(e,t){var n,o,r,i=e===zr,s=t===zr,a=it(e.data.directives,e.context),l=it(t.data.directives,t.context),c=[],u=[];for(n in l)o=a[n],r=l[n],o?(r.oldValue=o.value,st(r,"update",t,e),r.def&&r.def.componentUpdated&&u.push(r)):(st(r,"bind",t,e),r.def&&r.def.inserted&&c.push(r));if(c.length){var f=function(){for(var n=0;n<c.length;n++)st(c[n],"inserted",t,e)};i?ne(t,"insert",f):f()}u.length&&ne(t,"postpatch",function(){for(var n=0;n<u.length;n++)st(u[n],"componentUpdated",t,e)});if(!i)for(n in a)l[n]||st(a[n],"unbind",e,e,s)}(e,t)}function it(e,t){var n=Object.create(null);if(!e)return n;var o,r;for(o=0;o<e.length;o++)(r=e[o]).modifiers||(r.modifiers=Ir),n[function(e){return e.rawName||e.name+"."+Object.keys(e.modifiers||{}).join(".")}(r)]=r,r.def=H(t.$options,"directives",r.name);return n}function st(e,t,n,o,r){var i=e.def&&e.def[t];if(i)try{i(n.elm,e,n,o,r)}catch(o){X(o,n.context,"directive "+e.name+" "+t+" hook")}}function at(e,t){var n=t.componentOptions;if(!(r(n)&&!1===n.Ctor.options.inheritAttrs||o(e.data.attrs)&&o(t.data.attrs))){var i,s,a=t.elm,l=e.data.attrs||{},c=t.data.attrs||{};r(c.__ob__)&&(c=t.data.attrs=_({},c));for(i in c)s=c[i],l[i]!==s&<(a,i,s);(io||ao)&&c.value!==l.value&<(a,"value",c.value);for(i in l)o(c[i])&&(wr(i)?a.removeAttributeNS(xr,kr(i)):_r(i)||a.removeAttribute(i))}}function lt(e,t,n){if(yr(t))Cr(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n));else if(_r(t))e.setAttribute(t,Cr(n)||"false"===n?"false":"true");else if(wr(t))Cr(n)?e.removeAttributeNS(xr,kr(t)):e.setAttributeNS(xr,t,n);else if(Cr(n))e.removeAttribute(t);else{if(io&&!so&&"TEXTAREA"===e.tagName&&"placeholder"===t&&!e.__ieph){var o=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",o)};e.addEventListener("input",o),e.__ieph=!0}e.setAttribute(t,n)}}function ct(e,t){var n=t.elm,i=t.data,s=e.data;if(!(o(i.staticClass)&&o(i.class)&&(o(s)||o(s.staticClass)&&o(s.class)))){var a=Ke(t),l=n._transitionClasses;r(l)&&(a=Ye(a,Ze(l))),a!==n._prevClass&&(n.setAttribute("class",a),n._prevClass=a)}}function ut(e){function t(){(s||(s=[])).push(e.slice(h,r).trim()),h=r+1}var n,o,r,i,s,a=!1,l=!1,c=!1,u=!1,f=0,p=0,d=0,h=0;for(r=0;r<e.length;r++)if(o=n,n=e.charCodeAt(r),a)39===n&&92!==o&&(a=!1);else if(l)34===n&&92!==o&&(l=!1);else if(c)96===n&&92!==o&&(c=!1);else if(u)47===n&&92!==o&&(u=!1);else if(124!==n||124===e.charCodeAt(r+1)||124===e.charCodeAt(r-1)||f||p||d){switch(n){case 34:l=!0;break;case 39:a=!0;break;case 96:c=!0;break;case 40:d++;break;case 41:d--;break;case 91:p++;break;case 93:p--;break;case 123:f++;break;case 125:f--}if(47===n){for(var m=r-1,v=void 0;m>=0&&" "===(v=e.charAt(m));m--);v&&Dr.test(v)||(u=!0)}}else void 0===i?(h=r+1,i=e.slice(0,r).trim()):t();if(void 0===i?i=e.slice(0,r).trim():0!==h&&t(),s)for(r=0;r<s.length;r++)i=function(e,t){var n=t.indexOf("(");if(n<0)return'_f("'+t+'")('+e+")";var o=t.slice(0,n),r=t.slice(n+1);return'_f("'+o+'")('+e+","+r}(i,s[r]);return i}function ft(e){console.error("[Vue compiler]: "+e)}function pt(e,t){return e?e.map(function(e){return e[t]}).filter(function(e){return e}):[]}function dt(e,t,n){(e.props||(e.props=[])).push({name:t,value:n}),e.plain=!1}function ht(e,t,n){(e.attrs||(e.attrs=[])).push({name:t,value:n}),e.plain=!1}function mt(e,t,n){e.attrsMap[t]=n,e.attrsList.push({name:t,value:n})}function vt(e,t,n,o,r,i){(e.directives||(e.directives=[])).push({name:t,rawName:n,value:o,arg:r,modifiers:i}),e.plain=!1}function gt(e,t,n,o,r,i){(o=o||Nn).capture&&(delete o.capture,t="!"+t),o.once&&(delete o.once,t="~"+t),o.passive&&(delete o.passive,t="&"+t),"click"===t&&(o.right?(t="contextmenu",delete o.right):o.middle&&(t="mouseup"));var s;o.native?(delete o.native,s=e.nativeEvents||(e.nativeEvents={})):s=e.events||(e.events={});var a={value:n};o!==Nn&&(a.modifiers=o);var l=s[t];Array.isArray(l)?r?l.unshift(a):l.push(a):s[t]=l?r?[a,l]:[l,a]:a,e.plain=!1}function bt(e,t,n){var o=_t(e,":"+t)||_t(e,"v-bind:"+t);if(null!=o)return ut(o);if(!1!==n){var r=_t(e,t);if(null!=r)return JSON.stringify(r)}}function _t(e,t,n){var o;if(null!=(o=e.attrsMap[t]))for(var r=e.attrsList,i=0,s=r.length;i<s;i++)if(r[i].name===t){r.splice(i,1);break}return n&&delete e.attrsMap[t],o}function yt(e,t,n){var o=n||{},r="$$v";o.trim&&(r="(typeof $$v === 'string'? $$v.trim(): $$v)"),o.number&&(r="_n("+r+")");var i=xt(t,r);e.model={value:"("+t+")",expression:'"'+t+'"',callback:"function ($$v) {"+i+"}"}}function xt(e,t){var n=function(e){if(lr=e.length,e.indexOf("[")<0||e.lastIndexOf("]")<lr-1)return(fr=e.lastIndexOf("."))>-1?{exp:e.slice(0,fr),key:'"'+e.slice(fr+1)+'"'}:{exp:e,key:null};cr=e,fr=pr=dr=0;for(;!kt();)Ct(ur=wt())?St(ur):91===ur&&function(e){var t=1;pr=fr;for(;!kt();)if(e=wt(),Ct(e))St(e);else if(91===e&&t++,93===e&&t--,0===t){dr=fr;break}}(ur);return{exp:e.slice(0,pr),key:e.slice(pr+1,dr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function wt(){return cr.charCodeAt(++fr)}function kt(){return fr>=lr}function Ct(e){return 34===e||39===e}function St(e){for(var t=e;!kt()&&(e=wt())!==t;);}function $t(e,t,n,o,r){t=function(e){return e._withTask||(e._withTask=function(){No=!0;var t=e.apply(null,arguments);return No=!1,t})}(t),n&&(t=function(e,t,n){var o=hr;return function r(){null!==e.apply(null,arguments)&&Ot(t,r,n,o)}}(t,e,o)),hr.addEventListener(e,t,fo?{capture:o,passive:r}:o)}function Ot(e,t,n,o){(o||hr).removeEventListener(e,t._withTask||t,n)}function Et(e,t){if(!o(e.data.on)||!o(t.data.on)){var n=t.data.on||{},i=e.data.on||{};hr=t.elm,function(e){if(r(e[Br])){var t=io?"change":"input";e[t]=[].concat(e[Br],e[t]||[]),delete e[Br]}r(e[qr])&&(e.change=[].concat(e[qr],e.change||[]),delete e[qr])}(n),te(n,i,$t,Ot,t.context),hr=void 0}}function Tt(e,t){if(!o(e.data.domProps)||!o(t.data.domProps)){var n,i,s=t.elm,a=e.data.domProps||{},l=t.data.domProps||{};r(l.__ob__)&&(l=t.data.domProps=_({},l));for(n in a)o(l[n])&&(s[n]="");for(n in l){if(i=l[n],"textContent"===n||"innerHTML"===n){if(t.children&&(t.children.length=0),i===a[n])continue;1===s.childNodes.length&&s.removeChild(s.childNodes[0])}if("value"===n){s._value=i;var c=o(i)?"":String(i);(function(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var n=e.value,o=e._vModifiers;if(r(o)){if(o.lazy)return!1;if(o.number)return p(n)!==p(t);if(o.trim)return n.trim()!==t.trim()}return n!==t}(e,t))})(s,c)&&(s.value=c)}else s[n]=i}}}function Mt(e){var t=At(e.style);return e.staticStyle?_(e.staticStyle,t):t}function At(e){return Array.isArray(e)?y(e):"string"==typeof e?Ur(e):e}function Pt(e,t){var n=t.data,i=e.data;if(!(o(n.staticStyle)&&o(n.style)&&o(i.staticStyle)&&o(i.style))){var s,a,l=t.elm,c=i.staticStyle,u=i.normalizedStyle||i.style||{},f=c||u,p=At(t.data.style)||{};t.data.normalizedStyle=r(p.__ob__)?_({},p):p;var d=function(e,t){var n,o={};if(t)for(var r=e;r.componentInstance;)(r=r.componentInstance._vnode)&&r.data&&(n=Mt(r.data))&&_(o,n);(n=Mt(e.data))&&_(o,n);for(var i=e;i=i.parent;)i.data&&(n=Mt(i.data))&&_(o,n);return o}(t,!0);for(a in f)o(d[a])&&Jr(l,a,"");for(a in d)(s=d[a])!==f[a]&&Jr(l,a,null==s?"":s)}}function zt(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(/\s+/).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function jt(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(/\s+/).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",o=" "+t+" ";n.indexOf(o)>=0;)n=n.replace(o," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function Ft(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&_(t,Zr(e.name||"v")),_(t,e),t}return"string"==typeof e?Zr(e):void 0}}function It(e){si(function(){si(e)})}function Nt(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),zt(e,t))}function Lt(e,t){e._transitionClasses&&h(e._transitionClasses,t),jt(e,t)}function Rt(e,t,n){var o=Dt(e,t),r=o.type,i=o.timeout,s=o.propCount;if(!r)return n();var a=r===ei?oi:ii,l=0,c=function(){e.removeEventListener(a,u),n()},u=function(t){t.target===e&&++l>=s&&c()};setTimeout(function(){l<s&&c()},i+1),e.addEventListener(a,u)}function Dt(e,t){var n,o=window.getComputedStyle(e),r=o[ni+"Delay"].split(", "),i=o[ni+"Duration"].split(", "),s=Bt(r,i),a=o[ri+"Delay"].split(", "),l=o[ri+"Duration"].split(", "),c=Bt(a,l),u=0,f=0;t===ei?s>0&&(n=ei,u=s,f=i.length):t===ti?c>0&&(n=ti,u=c,f=l.length):f=(n=(u=Math.max(s,c))>0?s>c?ei:ti:null)?n===ei?i.length:l.length:0;return{type:n,timeout:u,propCount:f,hasTransform:n===ei&&ai.test(o[ni+"Property"])}}function Bt(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max.apply(null,t.map(function(t,n){return qt(t)+qt(e[n])}))}function qt(e){return 1e3*Number(e.slice(0,-1))}function Ht(e,t){var n=e.elm;r(n._leaveCb)&&(n._leaveCb.cancelled=!0,n._leaveCb());var i=Ft(e.data.transition);if(!o(i)&&!r(n._enterCb)&&1===n.nodeType){for(var s=i.css,l=i.type,c=i.enterClass,u=i.enterToClass,f=i.enterActiveClass,d=i.appearClass,h=i.appearToClass,m=i.appearActiveClass,v=i.beforeEnter,g=i.enter,b=i.afterEnter,_=i.enterCancelled,y=i.beforeAppear,x=i.appear,w=i.afterAppear,k=i.appearCancelled,S=i.duration,$=Vo,O=Vo.$vnode;O&&O.parent;)$=(O=O.parent).context;var E=!$._isMounted||!e.isRootInsert;if(!E||x||""===x){var T=E&&d?d:c,M=E&&m?m:f,A=E&&h?h:u,P=E?y||v:v,z=E&&"function"==typeof x?x:g,j=E?w||b:b,F=E?k||_:_,I=p(a(S)?S.enter:S);0;var N=!1!==s&&!so,L=Wt(z),R=n._enterCb=C(function(){N&&(Lt(n,A),Lt(n,M)),R.cancelled?(N&&Lt(n,T),F&&F(n)):j&&j(n),n._enterCb=null});e.data.show||ne(e,"insert",function(){var t=n.parentNode,o=t&&t._pending&&t._pending[e.key];o&&o.tag===e.tag&&o.elm._leaveCb&&o.elm._leaveCb(),z&&z(n,R)}),P&&P(n),N&&(Nt(n,T),Nt(n,M),It(function(){Nt(n,A),Lt(n,T),R.cancelled||L||(Ut(I)?setTimeout(R,I):Rt(n,l,R))})),e.data.show&&(t&&t(),z&&z(n,R)),N||L||R()}}}function Vt(e,t){function n(){k.cancelled||(e.data.show||((i.parentNode._pending||(i.parentNode._pending={}))[e.key]=e),h&&h(i),y&&(Nt(i,u),Nt(i,d),It(function(){Nt(i,f),Lt(i,u),k.cancelled||x||(Ut(w)?setTimeout(k,w):Rt(i,c,k))})),m&&m(i,k),y||x||k())}var i=e.elm;r(i._enterCb)&&(i._enterCb.cancelled=!0,i._enterCb());var s=Ft(e.data.transition);if(o(s)||1!==i.nodeType)return t();if(!r(i._leaveCb)){var l=s.css,c=s.type,u=s.leaveClass,f=s.leaveToClass,d=s.leaveActiveClass,h=s.beforeLeave,m=s.leave,v=s.afterLeave,g=s.leaveCancelled,b=s.delayLeave,_=s.duration,y=!1!==l&&!so,x=Wt(m),w=p(a(_)?_.leave:_);0;var k=i._leaveCb=C(function(){i.parentNode&&i.parentNode._pending&&(i.parentNode._pending[e.key]=null),y&&(Lt(i,f),Lt(i,d)),k.cancelled?(y&&Lt(i,u),g&&g(i)):(t(),v&&v(i)),i._leaveCb=null});b?b(n):n()}}function Ut(e){return"number"==typeof e&&!isNaN(e)}function Wt(e){if(o(e))return!1;var t=e.fns;return r(t)?Wt(Array.isArray(t)?t[0]:t):(e._length||e.length)>1}function Xt(e,t){!0!==t.data.show&&Ht(t)}function Jt(e,t,n){Kt(e,t,n),(io||ao)&&setTimeout(function(){Kt(e,t,n)},0)}function Kt(e,t,n){var o=t.value,r=e.multiple;if(!r||Array.isArray(o)){for(var i,s,a=0,l=e.options.length;a<l;a++)if(s=e.options[a],r)i=k(o,Yt(s))>-1,s.selected!==i&&(s.selected=i);else if(w(Yt(s),o))return void(e.selectedIndex!==a&&(e.selectedIndex=a));r||(e.selectedIndex=-1)}}function Gt(e,t){return t.every(function(t){return!w(t,e)})}function Yt(e){return"_value"in e?e._value:e.value}function Zt(e){e.target.composing=!0}function Qt(e){e.target.composing&&(e.target.composing=!1,en(e.target,"input"))}function en(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function tn(e){return!e.componentInstance||e.data&&e.data.transition?e:tn(e.componentInstance._vnode)}function nn(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?nn(le(t.children)):e}function on(e){var t={},n=e.$options;for(var o in n.propsData)t[o]=e[o];var r=n._parentListeners;for(var i in r)t[Hn(i)]=r[i];return t}function rn(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}function sn(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function an(e){e.data.newPos=e.elm.getBoundingClientRect()}function ln(e){var t=e.data.pos,n=e.data.newPos,o=t.left-n.left,r=t.top-n.top;if(o||r){e.data.moved=!0;var i=e.elm.style;i.transform=i.WebkitTransform="translate("+o+"px,"+r+"px)",i.transitionDuration="0s"}}function cn(e,t){var n=t?bi(t):vi;if(n.test(e)){for(var o,r,i,s=[],a=[],l=n.lastIndex=0;o=n.exec(e);){(r=o.index)>l&&(a.push(i=e.slice(l,r)),s.push(JSON.stringify(i)));var c=ut(o[1].trim());s.push("_s("+c+")"),a.push({"@binding":c}),l=r+o[0].length}return l<e.length&&(a.push(i=e.slice(l)),s.push(JSON.stringify(i))),{expression:s.join("+"),tokens:a}}}function un(e,t){var n=t?Ki:Ji;return e.replace(n,function(e){return Xi[e]})}function fn(e,t){function n(t){u+=t,e=e.substring(t)}function o(e,n,o){var r,a;if(null==n&&(n=u),null==o&&(o=u),e&&(a=e.toLowerCase()),e)for(r=s.length-1;r>=0&&s[r].lowerCasedTag!==a;r--);else r=0;if(r>=0){for(var l=s.length-1;l>=r;l--)t.end&&t.end(s[l].tag,n,o);s.length=r,i=r&&s[r-1].tag}else"br"===a?t.start&&t.start(e,[],!0,n,o):"p"===a&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}for(var r,i,s=[],a=t.expectHTML,l=t.isUnaryTag||Xn,c=t.canBeLeftOpenTag||Xn,u=0;e;){if(r=e,i&&Ui(i)){var f=0,p=i.toLowerCase(),d=Wi[p]||(Wi[p]=new RegExp("([\\s\\S]*?)(</"+p+"[^>]*>)","i")),h=e.replace(d,function(e,n,o){return f=o.length,Ui(p)||"noscript"===p||(n=n.replace(/<!--([\s\S]*?)-->/g,"$1").replace(/<!\[CDATA\[([\s\S]*?)]]>/g,"$1")),Yi(p,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});u+=e.length-h.length,e=h,o(p,u-f,u)}else{var m=e.indexOf("<");if(0===m){if(Ai.test(e)){var v=e.indexOf("--\x3e");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v)),n(v+3);continue}}if(Pi.test(e)){var g=e.indexOf("]>");if(g>=0){n(g+2);continue}}var b=e.match(Mi);if(b){n(b[0].length);continue}var _=e.match(Ti);if(_){var y=u;n(_[0].length),o(_[1],y,u);continue}var x=function(){var t=e.match(Oi);if(t){var o={tagName:t[1],attrs:[],start:u};n(t[0].length);for(var r,i;!(r=e.match(Ei))&&(i=e.match(Si));)n(i[0].length),o.attrs.push(i);if(r)return o.unarySlash=r[1],n(r[0].length),o.end=u,o}}();if(x){!function(e){var n=e.tagName,r=e.unarySlash;a&&("p"===i&&Ci(n)&&o(i),c(n)&&i===n&&o(n));for(var u=l(n)||!!r,f=e.attrs.length,p=new Array(f),d=0;d<f;d++){var h=e.attrs[d];zi&&-1===h[0].indexOf('""')&&(""===h[3]&&delete h[3],""===h[4]&&delete h[4],""===h[5]&&delete h[5]);var m=h[3]||h[4]||h[5]||"",v="a"===n&&"href"===h[1]?t.shouldDecodeNewlinesForHref:t.shouldDecodeNewlines;p[d]={name:h[1],value:un(m,v)}}u||(s.push({tag:n,lowerCasedTag:n.toLowerCase(),attrs:p}),i=n),t.start&&t.start(n,p,u,e.start,e.end)}(x),Yi(i,e)&&n(1);continue}}var w=void 0,k=void 0,C=void 0;if(m>=0){for(k=e.slice(m);!(Ti.test(k)||Oi.test(k)||Ai.test(k)||Pi.test(k)||(C=k.indexOf("<",1))<0);)m+=C,k=e.slice(m);w=e.substring(0,m),n(m)}m<0&&(w=e,e=""),t.chars&&w&&t.chars(w)}if(e===r){t.chars&&t.chars(e);break}}o()}function pn(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:function(e){for(var t={},n=0,o=e.length;n<o;n++)t[e[n].name]=e[n].value;return t}(t),parent:n,children:[]}}function dn(e,t){function n(e){e.pre&&(a=!1),Ri(e.tag)&&(l=!1);for(var n=0;n<Li.length;n++)Li[n](e,t)}ji=t.warn||ft,Ri=t.isPreTag||Xn,Di=t.mustUseProp||Xn,Bi=t.getTagNamespace||Xn,Ii=pt(t.modules,"transformNode"),Ni=pt(t.modules,"preTransformNode"),Li=pt(t.modules,"postTransformNode"),Fi=t.delimiters;var o,r,i=[],s=!1!==t.preserveWhitespace,a=!1,l=!1;return fn(e,{warn:ji,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,start:function(e,s,c){function u(e){0}var f=r&&r.ns||Bi(e);io&&"svg"===f&&(s=function(e){for(var t=[],n=0;n<e.length;n++){var o=e[n];as.test(o.name)||(o.name=o.name.replace(ls,""),t.push(o))}return t}(s));var p=pn(e,s,r);f&&(p.ns=f),function(e){return"style"===e.tag||"script"===e.tag&&(!e.attrsMap.type||"text/javascript"===e.attrsMap.type)}(p)&&!vo()&&(p.forbidden=!0);for(var d=0;d<Ni.length;d++)p=Ni[d](p,t)||p;if(a||(!function(e){null!=_t(e,"v-pre")&&(e.pre=!0)}(p),p.pre&&(a=!0)),Ri(p.tag)&&(l=!0),a?function(e){var t=e.attrsList.length;if(t)for(var n=e.attrs=new Array(t),o=0;o<t;o++)n[o]={name:e.attrsList[o].name,value:JSON.stringify(e.attrsList[o].value)};else e.pre||(e.plain=!0)}(p):p.processed||(mn(p),function(e){var t=_t(e,"v-if");if(t)e.if=t,vn(e,{exp:t,block:e});else{null!=_t(e,"v-else")&&(e.else=!0);var n=_t(e,"v-else-if");n&&(e.elseif=n)}}(p),function(e){null!=_t(e,"v-once")&&(e.once=!0)}(p),hn(p,t)),o?i.length||o.if&&(p.elseif||p.else)&&(u(),vn(o,{exp:p.elseif,block:p})):(o=p,u()),r&&!p.forbidden)if(p.elseif||p.else)!function(e,t){var n=function(e){var t=e.length;for(;t--;){if(1===e[t].type)return e[t];e.pop()}}(t.children);n&&n.if&&vn(n,{exp:e.elseif,block:e})}(p,r);else if(p.slotScope){r.plain=!1;var h=p.slotTarget||'"default"';(r.scopedSlots||(r.scopedSlots={}))[h]=p}else r.children.push(p),p.parent=r;c?n(p):(r=p,i.push(p))},end:function(){var e=i[i.length-1],t=e.children[e.children.length-1];t&&3===t.type&&" "===t.text&&!l&&e.children.pop(),i.length-=1,r=i[i.length-1],n(e)},chars:function(e){if(r&&(!io||"textarea"!==r.tag||r.attrsMap.placeholder!==e)){var t=r.children;if(e=l||e.trim()?function(e){return"script"===e.tag||"style"===e.tag}(r)?e:ss(e):s&&t.length?" ":""){var n;!a&&" "!==e&&(n=cn(e,Fi))?t.push({type:2,expression:n.expression,tokens:n.tokens,text:e}):" "===e&&t.length&&" "===t[t.length-1].text||t.push({type:3,text:e})}}},comment:function(e){r.children.push({type:3,text:e,isComment:!0})}}),o}function hn(e,t){!function(e){var t=bt(e,"key");t&&(e.key=t)}(e),e.plain=!e.key&&!e.attrsList.length,function(e){var t=bt(e,"ref");t&&(e.ref=t,e.refInFor=function(e){var t=e;for(;t;){if(void 0!==t.for)return!0;t=t.parent}return!1}(e))}(e),function(e){if("slot"===e.tag)e.slotName=bt(e,"name");else{var t;"template"===e.tag?(t=_t(e,"scope"),e.slotScope=t||_t(e,"slot-scope")):(t=_t(e,"slot-scope"))&&(e.slotScope=t);var n=bt(e,"slot");n&&(e.slotTarget='""'===n?'"default"':n,"template"===e.tag||e.slotScope||ht(e,"slot",n))}}(e),function(e){var t;(t=bt(e,"is"))&&(e.component=t);null!=_t(e,"inline-template")&&(e.inlineTemplate=!0)}(e);for(var n=0;n<Ii.length;n++)e=Ii[n](e,t)||e;!function(e){var t,n,o,r,i,s,a,l=e.attrsList;for(t=0,n=l.length;t<n;t++)if(o=r=l[t].name,i=l[t].value,Qi.test(o))if(e.hasBindings=!0,(s=function(e){var t=e.match(is);if(t){var n={};return t.forEach(function(e){n[e.slice(1)]=!0}),n}}(o))&&(o=o.replace(is,"")),rs.test(o))o=o.replace(rs,""),i=ut(i),a=!1,s&&(s.prop&&(a=!0,"innerHtml"===(o=Hn(o))&&(o="innerHTML")),s.camel&&(o=Hn(o)),s.sync&>(e,"update:"+Hn(o),xt(i,"$event"))),a||!e.component&&Di(e.tag,e.attrsMap.type,o)?dt(e,o,i):ht(e,o,i);else if(Zi.test(o))o=o.replace(Zi,""),gt(e,o,i,s,!1);else{var c=(o=o.replace(Qi,"")).match(os),u=c&&c[1];u&&(o=o.slice(0,-(u.length+1))),vt(e,o,r,i,u,s)}else{ht(e,o,JSON.stringify(i)),!e.component&&"muted"===o&&Di(e.tag,e.attrsMap.type,o)&&dt(e,o,"true")}}(e)}function mn(e){var t;if(t=_t(e,"v-for")){var n=function(e){var t=e.match(es);if(!t)return;var n={};n.for=t[2].trim();var o=t[1].trim().replace(ns,""),r=o.match(ts);r?(n.alias=o.replace(ts,""),n.iterator1=r[1].trim(),r[2]&&(n.iterator2=r[2].trim())):n.alias=o;return n}(t);n&&_(e,n)}}function vn(e,t){e.ifConditions||(e.ifConditions=[]),e.ifConditions.push(t)}function gn(e){return pn(e.tag,e.attrsList.slice(),e.parent)}function bn(e){if(e.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||Rn(e.tag)||!Hi(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(qi)))}(e),1===e.type){if(!Hi(e.tag)&&"slot"!==e.tag&&null==e.attrsMap["inline-template"])return;for(var t=0,n=e.children.length;t<n;t++){var o=e.children[t];bn(o),o.static||(e.static=!1)}if(e.ifConditions)for(var r=1,i=e.ifConditions.length;r<i;r++){var s=e.ifConditions[r].block;bn(s),s.static||(e.static=!1)}}}function _n(e,t){if(1===e.type){if((e.static||e.once)&&(e.staticInFor=t),e.static&&e.children.length&&(1!==e.children.length||3!==e.children[0].type))return void(e.staticRoot=!0);if(e.staticRoot=!1,e.children)for(var n=0,o=e.children.length;n<o;n++)_n(e.children[n],t||!!e.for);if(e.ifConditions)for(var r=1,i=e.ifConditions.length;r<i;r++)_n(e.ifConditions[r].block,t)}}function yn(e,t,n){var o=t?"nativeOn:{":"on:{";for(var r in e)o+='"'+r+'":'+xn(r,e[r])+",";return o.slice(0,-1)+"}"}function xn(e,t){if(!t)return"function(){}";if(Array.isArray(t))return"["+t.map(function(t){return xn(e,t)}).join(",")+"]";var n=ds.test(t.value),o=ps.test(t.value);if(t.modifiers){var r="",i="",s=[];for(var a in t.modifiers)if(vs[a])i+=vs[a],hs[a]&&s.push(a);else if("exact"===a){var l=t.modifiers;i+=ms(["ctrl","shift","alt","meta"].filter(function(e){return!l[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else s.push(a);s.length&&(r+=function(e){return"if(!('button' in $event)&&"+e.map(wn).join("&&")+")return null;"}(s)),i&&(r+=i);return"function($event){"+r+(n?t.value+"($event)":o?"("+t.value+")($event)":t.value)+"}"}return n||o?t.value:"function($event){"+t.value+"}"}function wn(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=hs[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key)"}function kn(e,t){var n=new bs(t);return{render:"with(this){return "+(e?Cn(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function Cn(e,t){if(e.staticRoot&&!e.staticProcessed)return Sn(e,t);if(e.once&&!e.onceProcessed)return $n(e,t);if(e.for&&!e.forProcessed)return function(e,t,n,o){var r=e.for,i=e.alias,s=e.iterator1?","+e.iterator1:"",a=e.iterator2?","+e.iterator2:"";0;return e.forProcessed=!0,(o||"_l")+"(("+r+"),function("+i+s+a+"){return "+(n||Cn)(e,t)+"})"}(e,t);if(e.if&&!e.ifProcessed)return On(e,t);if("template"!==e.tag||e.slotTarget){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',o=An(e,t),r="_t("+n+(o?","+o:""),i=e.attrs&&"{"+e.attrs.map(function(e){return Hn(e.name)+":"+e.value}).join(",")+"}",s=e.attrsMap["v-bind"];!i&&!s||o||(r+=",null");i&&(r+=","+i);s&&(r+=(i?"":",null")+","+s);return r+")"}(e,t);var n;if(e.component)n=function(e,t,n){var o=t.inlineTemplate?null:An(t,n,!0);return"_c("+e+","+Tn(t,n)+(o?","+o:"")+")"}(e.component,e,t);else{var o=e.plain?void 0:Tn(e,t),r=e.inlineTemplate?null:An(e,t,!0);n="_c('"+e.tag+"'"+(o?","+o:"")+(r?","+r:"")+")"}for(var i=0;i<t.transforms.length;i++)n=t.transforms[i](e,n);return n}return An(e,t)||"void 0"}function Sn(e,t){return e.staticProcessed=!0,t.staticRenderFns.push("with(this){return "+Cn(e,t)+"}"),"_m("+(t.staticRenderFns.length-1)+(e.staticInFor?",true":"")+")"}function $n(e,t){if(e.onceProcessed=!0,e.if&&!e.ifProcessed)return On(e,t);if(e.staticInFor){for(var n="",o=e.parent;o;){if(o.for){n=o.key;break}o=o.parent}return n?"_o("+Cn(e,t)+","+t.onceId+++","+n+")":Cn(e,t)}return Sn(e,t)}function On(e,t,n,o){return e.ifProcessed=!0,En(e.ifConditions.slice(),t,n,o)}function En(e,t,n,o){function r(e){return n?n(e,t):e.once?$n(e,t):Cn(e,t)}if(!e.length)return o||"_e()";var i=e.shift();return i.exp?"("+i.exp+")?"+r(i.block)+":"+En(e,t,n,o):""+r(i.block)}function Tn(e,t){var n="{",o=function(e,t){var n=e.directives;if(!n)return;var o,r,i,s,a="directives:[",l=!1;for(o=0,r=n.length;o<r;o++){i=n[o],s=!0;var c=t.directives[i.name];c&&(s=!!c(e,i,t.warn)),s&&(l=!0,a+='{name:"'+i.name+'",rawName:"'+i.rawName+'"'+(i.value?",value:("+i.value+"),expression:"+JSON.stringify(i.value):"")+(i.arg?',arg:"'+i.arg+'"':"")+(i.modifiers?",modifiers:"+JSON.stringify(i.modifiers):"")+"},")}if(l)return a.slice(0,-1)+"]"}(e,t);o&&(n+=o+","),e.key&&(n+="key:"+e.key+","),e.ref&&(n+="ref:"+e.ref+","),e.refInFor&&(n+="refInFor:true,"),e.pre&&(n+="pre:true,"),e.component&&(n+='tag:"'+e.tag+'",');for(var r=0;r<t.dataGenFns.length;r++)n+=t.dataGenFns[r](e);if(e.attrs&&(n+="attrs:{"+zn(e.attrs)+"},"),e.props&&(n+="domProps:{"+zn(e.props)+"},"),e.events&&(n+=yn(e.events,!1,t.warn)+","),e.nativeEvents&&(n+=yn(e.nativeEvents,!0,t.warn)+","),e.slotTarget&&!e.slotScope&&(n+="slot:"+e.slotTarget+","),e.scopedSlots&&(n+=function(e,t){return"scopedSlots:_u(["+Object.keys(e).map(function(n){return Mn(n,e[n],t)}).join(",")+"])"}(e.scopedSlots,t)+","),e.model&&(n+="model:{value:"+e.model.value+",callback:"+e.model.callback+",expression:"+e.model.expression+"},"),e.inlineTemplate){var i=function(e,t){var n=e.children[0];0;if(1===n.type){var o=kn(n,t.options);return"inlineTemplate:{render:function(){"+o.render+"},staticRenderFns:["+o.staticRenderFns.map(function(e){return"function(){"+e+"}"}).join(",")+"]}"}}(e,t);i&&(n+=i+",")}return n=n.replace(/,$/,"")+"}",e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function Mn(e,t,n){if(t.for&&!t.forProcessed)return function(e,t,n){var o=t.for,r=t.alias,i=t.iterator1?","+t.iterator1:"",s=t.iterator2?","+t.iterator2:"";return t.forProcessed=!0,"_l(("+o+"),function("+r+i+s+"){return "+Mn(e,t,n)+"})"}(e,t,n);return"{key:"+e+",fn:"+("function("+String(t.slotScope)+"){return "+("template"===t.tag?t.if?t.if+"?"+(An(t,n)||"undefined")+":undefined":An(t,n)||"undefined":Cn(t,n))+"}")+"}"}function An(e,t,n,o,r){var i=e.children;if(i.length){var s=i[0];if(1===i.length&&s.for&&"template"!==s.tag&&"slot"!==s.tag)return(o||Cn)(s,t);var a=n?function(e,t){for(var n=0,o=0;o<e.length;o++){var r=e[o];if(1===r.type){if(Pn(r)||r.ifConditions&&r.ifConditions.some(function(e){return Pn(e.block)})){n=2;break}(t(r)||r.ifConditions&&r.ifConditions.some(function(e){return t(e.block)}))&&(n=1)}}return n}(i,t.maybeComponent):0,l=r||function(e,t){if(1===e.type)return Cn(e,t);return 3===e.type&&e.isComment?function(e){return"_e("+JSON.stringify(e.text)+")"}(e):function(e){return"_v("+(2===e.type?e.expression:jn(JSON.stringify(e.text)))+")"}(e)};return"["+i.map(function(e){return l(e,t)}).join(",")+"]"+(a?","+a:"")}}function Pn(e){return void 0!==e.for||"template"===e.tag||"slot"===e.tag}function zn(e){for(var t="",n=0;n<e.length;n++){var o=e[n];t+='"'+o.name+'":'+jn(o.value)+","}return t.slice(0,-1)}function jn(e){return e.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function Fn(e,t){try{return new Function(e)}catch(n){return t.push({err:n,code:e}),x}}function In(e){return Vi=Vi||document.createElement("div"),Vi.innerHTML=e?'<a href="\n"/>':'<div a="\n"/>',Vi.innerHTML.indexOf(" ")>0}var Nn=Object.freeze({}),Ln=Object.prototype.toString,Rn=d("slot,component",!0),Dn=d("key,ref,slot,slot-scope,is"),Bn=Object.prototype.hasOwnProperty,qn=/-(\w)/g,Hn=v(function(e){return e.replace(qn,function(e,t){return t?t.toUpperCase():""})}),Vn=v(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),Un=/\B([A-Z])/g,Wn=v(function(e){return e.replace(Un,"-$1").toLowerCase()}),Xn=function(e,t,n){return!1},Jn=function(e){return e},Kn="data-server-rendered",Gn=["component","directive","filter"],Yn=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured"],Zn={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:Xn,isReservedAttr:Xn,isUnknownElement:Xn,getTagNamespace:x,parsePlatformTagName:Jn,mustUseProp:Xn,_lifecycleHooks:Yn},Qn=/[^\w.$]/,eo="__proto__"in{},to="undefined"!=typeof window,no="undefined"!=typeof WXEnvironment&&!!WXEnvironment.platform,oo=no&&WXEnvironment.platform.toLowerCase(),ro=to&&window.navigator.userAgent.toLowerCase(),io=ro&&/msie|trident/.test(ro),so=ro&&ro.indexOf("msie 9.0")>0,ao=ro&&ro.indexOf("edge/")>0,lo=ro&&ro.indexOf("android")>0||"android"===oo,co=ro&&/iphone|ipad|ipod|ios/.test(ro)||"ios"===oo,uo=(ro&&/chrome\/\d+/.test(ro),{}.watch),fo=!1;if(to)try{var po={};Object.defineProperty(po,"passive",{get:function(){fo=!0}}),window.addEventListener("test-passive",null,po)}catch(e){}var ho,mo,vo=function(){return void 0===ho&&(ho=!to&&void 0!==t&&"server"===t.process.env.VUE_ENV),ho},go=to&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,bo="undefined"!=typeof Symbol&&O(Symbol)&&"undefined"!=typeof Reflect&&O(Reflect.ownKeys);mo="undefined"!=typeof Set&&O(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var _o=x,yo=0,xo=function(){this.id=yo++,this.subs=[]};xo.prototype.addSub=function(e){this.subs.push(e)},xo.prototype.removeSub=function(e){h(this.subs,e)},xo.prototype.depend=function(){xo.target&&xo.target.addDep(this)},xo.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t<n;t++)e[t].update()},xo.target=null;var wo=[],ko=function(e,t,n,o,r,i,s,a){this.tag=e,this.data=t,this.children=n,this.text=o,this.elm=r,this.ns=void 0,this.context=i,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=s,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=a,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1},Co={child:{configurable:!0}};Co.child.get=function(){return this.componentInstance},Object.defineProperties(ko.prototype,Co);var So=function(e){void 0===e&&(e="");var t=new ko;return t.text=e,t.isComment=!0,t},$o=Array.prototype,Oo=Object.create($o);["push","pop","shift","unshift","splice","sort","reverse"].forEach(function(e){var t=$o[e];$(Oo,e,function(){for(var n=[],o=arguments.length;o--;)n[o]=arguments[o];var r,i=t.apply(this,n),s=this.__ob__;switch(e){case"push":case"unshift":r=n;break;case"splice":r=n.slice(2)}return r&&s.observeArray(r),s.dep.notify(),i})});var Eo=Object.getOwnPropertyNames(Oo),To={shouldConvert:!0},Mo=function(e){if(this.value=e,this.dep=new xo,this.vmCount=0,$(e,"__ob__",this),Array.isArray(e)){(eo?A:P)(e,Oo,Eo),this.observeArray(e)}else this.walk(e)};Mo.prototype.walk=function(e){for(var t=Object.keys(e),n=0;n<t.length;n++)j(e,t[n],e[t[n]])},Mo.prototype.observeArray=function(e){for(var t=0,n=e.length;t<n;t++)z(e[t])};var Ao=Zn.optionMergeStrategies;Ao.data=function(e,t,n){return n?R(e,t,n):t&&"function"!=typeof t?e:R(e,t)},Yn.forEach(function(e){Ao[e]=D}),Gn.forEach(function(e){Ao[e+"s"]=B}),Ao.watch=function(e,t,n,o){if(e===uo&&(e=void 0),t===uo&&(t=void 0),!t)return Object.create(e||null);if(!e)return t;var r={};_(r,e);for(var i in t){var s=r[i],a=t[i];s&&!Array.isArray(s)&&(s=[s]),r[i]=s?s.concat(a):Array.isArray(a)?a:[a]}return r},Ao.props=Ao.methods=Ao.inject=Ao.computed=function(e,t,n,o){if(!e)return t;var r=Object.create(null);return _(r,e),t&&_(r,t),r},Ao.provide=R;var Po,zo,jo=function(e,t){return void 0===t?e:t},Fo=[],Io=!1,No=!1;if(void 0!==n&&O(n))zo=function(){n(G)};else if("undefined"==typeof MessageChannel||!O(MessageChannel)&&"[object MessageChannelConstructor]"!==MessageChannel.toString())zo=function(){setTimeout(G,0)};else{var Lo=new MessageChannel,Ro=Lo.port2;Lo.port1.onmessage=G,zo=function(){Ro.postMessage(1)}}if("undefined"!=typeof Promise&&O(Promise)){var Do=Promise.resolve();Po=function(){Do.then(G),co&&setTimeout(x)}}else Po=zo;var Bo,qo=new mo,Ho=v(function(e){var t="&"===e.charAt(0),n="~"===(e=t?e.slice(1):e).charAt(0),o="!"===(e=n?e.slice(1):e).charAt(0);return e=o?e.slice(1):e,{name:e,once:n,capture:o,passive:t}}),Vo=null,Uo=[],Wo=[],Xo={},Jo=!1,Ko=!1,Go=0,Yo=0,Zo=function(e,t,n,o,r){this.vm=e,r&&(e._watcher=this),e._watchers.push(this),o?(this.deep=!!o.deep,this.user=!!o.user,this.lazy=!!o.lazy,this.sync=!!o.sync):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++Yo,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new mo,this.newDepIds=new mo,this.expression="","function"==typeof t?this.getter=t:(this.getter=function(e){if(!Qn.test(e)){var t=e.split(".");return function(e){for(var n=0;n<t.length;n++){if(!e)return;e=e[t[n]]}return e}}}(t),this.getter||(this.getter=function(){})),this.value=this.lazy?void 0:this.get()};Zo.prototype.get=function(){!function(e){xo.target&&wo.push(xo.target),xo.target=e}(this);var e,t=this.vm;try{e=this.getter.call(t,t)}catch(e){if(!this.user)throw e;X(e,t,'getter for watcher "'+this.expression+'"')}finally{this.deep&&Z(e),xo.target=wo.pop(),this.cleanupDeps()}return e},Zo.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},Zo.prototype.cleanupDeps=function(){for(var e=this.deps.length;e--;){var t=this.deps[e];this.newDepIds.has(t.id)||t.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},Zo.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():function(e){var t=e.id;if(null==Xo[t]){if(Xo[t]=!0,Ko){for(var n=Uo.length-1;n>Go&&Uo[n].id>e.id;)n--;Uo.splice(n+1,0,e)}else Uo.push(e);Jo||(Jo=!0,Y(_e))}}(this)},Zo.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||a(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){X(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},Zo.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},Zo.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},Zo.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||h(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var Qo={enumerable:!0,configurable:!0,get:x,set:x},er={lazy:!0};Ie(Ne.prototype);var tr={init:function(e,t,n,o){if(!e.componentInstance||e.componentInstance._isDestroyed){(e.componentInstance=function(e,t,n,o){var i={_isComponent:!0,parent:t,_parentVnode:e,_parentElm:n||null,_refElm:o||null},s=e.data.inlineTemplate;return r(s)&&(i.render=s.render,i.staticRenderFns=s.staticRenderFns),new e.componentOptions.Ctor(i)}(e,Vo,n,o)).$mount(t?e.elm:void 0,t)}else if(e.data.keepAlive){var i=e;tr.prepatch(i,i)}},prepatch:function(e,t){var n=t.componentOptions;!function(e,t,n,o,r){var i=!!(r||e.$options._renderChildren||o.data.scopedSlots||e.$scopedSlots!==Nn);if(e.$options._parentVnode=o,e.$vnode=o,e._vnode&&(e._vnode.parent=o),e.$options._renderChildren=r,e.$attrs=o.data&&o.data.attrs||Nn,e.$listeners=n||Nn,t&&e.$options.props){To.shouldConvert=!1;for(var s=e._props,a=e.$options._propKeys||[],l=0;l<a.length;l++){var c=a[l];s[c]=V(c,e.$options.props,t,e)}To.shouldConvert=!0,e.$options.propsData=t}if(n){var u=e.$options._parentListeners;e.$options._parentListeners=n,fe(e,n,u)}i&&(e.$slots=pe(r,o.context),e.$forceUpdate())}(t.componentInstance=e.componentInstance,n.propsData,n.listeners,t,n.children)},insert:function(e){var t=e.context,n=e.componentInstance;n._isMounted||(n._isMounted=!0,be(n,"mounted")),e.data.keepAlive&&(t._isMounted?function(e){e._inactive=!1,Wo.push(e)}(n):ve(n,!0))},destroy:function(e){var t=e.componentInstance;t._isDestroyed||(e.data.keepAlive?ge(t,!0):t.$destroy())}},nr=Object.keys(tr),or=1,rr=2,ir=0;!function(e){e.prototype._init=function(e){this._uid=ir++,this._isVue=!0,e&&e._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),o=t._parentVnode;n.parent=t.parent,n._parentVnode=o,n._parentElm=t._parentElm,n._refElm=t._refElm;var r=o.componentOptions;n.propsData=r.propsData,n._parentListeners=r.listeners,n._renderChildren=r.children,n._componentTag=r.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(this,e):this.$options=q(qe(this.constructor),e||{},this),this._renderProxy=this,this._self=this,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(this),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&fe(e,t)}(this),function(e){e._vnode=null,e._staticTrees=null;var t=e.$options,n=e.$vnode=t._parentVnode,o=n&&n.context;e.$slots=pe(t._renderChildren,o),e.$scopedSlots=Nn,e._c=function(t,n,o,r){return De(e,t,n,o,r,!1)},e.$createElement=function(t,n,o,r){return De(e,t,n,o,r,!0)};var r=n&&n.data;j(e,"$attrs",r&&r.attrs||Nn,0,!0),j(e,"$listeners",t._parentListeners||Nn,0,!0)}(this),be(this,"beforeCreate"),function(e){var t=Se(e.$options.inject,e);t&&(To.shouldConvert=!1,Object.keys(t).forEach(function(n){j(e,n,t[n])}),To.shouldConvert=!0)}(this),xe(this),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(this),be(this,"created"),this.$options.el&&this.$mount(this.$options.el)}}(He),function(e){var t={};t.get=function(){return this._data};var n={};n.get=function(){return this._props},Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=F,e.prototype.$delete=I,e.prototype.$watch=function(e,t,n){if(l(t))return Ce(this,e,t,n);(n=n||{}).user=!0;var o=new Zo(this,e,t,n);return n.immediate&&t.call(this,o.value),function(){o.teardown()}}}(He),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){if(Array.isArray(e))for(var o=0,r=e.length;o<r;o++)this.$on(e[o],n);else(this._events[e]||(this._events[e]=[])).push(n),t.test(e)&&(this._hasHookEvent=!0);return this},e.prototype.$once=function(e,t){function n(){o.$off(e,n),t.apply(o,arguments)}var o=this;return n.fn=t,o.$on(e,n),o},e.prototype.$off=function(e,t){if(!arguments.length)return this._events=Object.create(null),this;if(Array.isArray(e)){for(var n=0,o=e.length;n<o;n++)this.$off(e[n],t);return this}var r=this._events[e];if(!r)return this;if(!t)return this._events[e]=null,this;if(t)for(var i,s=r.length;s--;)if((i=r[s])===t||i.fn===t){r.splice(s,1);break}return this},e.prototype.$emit=function(e){var t=this._events[e];if(t){t=t.length>1?b(t):t;for(var n=b(arguments,1),o=0,r=t.length;o<r;o++)try{t[o].apply(this,n)}catch(t){X(t,this,'event handler for "'+e+'"')}}return this}}(He),function(e){e.prototype._update=function(e,t){this._isMounted&&be(this,"beforeUpdate");var n=this.$el,o=this._vnode,r=Vo;Vo=this,this._vnode=e,o?this.$el=this.__patch__(o,e):(this.$el=this.__patch__(this.$el,e,t,!1,this.$options._parentElm,this.$options._refElm),this.$options._parentElm=this.$options._refElm=null),Vo=r,n&&(n.__vue__=null),this.$el&&(this.$el.__vue__=this),this.$vnode&&this.$parent&&this.$vnode===this.$parent._vnode&&(this.$parent.$el=this.$el)},e.prototype.$forceUpdate=function(){this._watcher&&this._watcher.update()},e.prototype.$destroy=function(){if(!this._isBeingDestroyed){be(this,"beforeDestroy"),this._isBeingDestroyed=!0;var e=this.$parent;!e||e._isBeingDestroyed||this.$options.abstract||h(e.$children,this),this._watcher&&this._watcher.teardown();for(var t=this._watchers.length;t--;)this._watchers[t].teardown();this._data.__ob__&&this._data.__ob__.vmCount--,this._isDestroyed=!0,this.__patch__(this._vnode,null),be(this,"destroyed"),this.$off(),this.$el&&(this.$el.__vue__=null),this.$vnode&&(this.$vnode.parent=null)}}}(He),function(e){Ie(e.prototype),e.prototype.$nextTick=function(e){return Y(e,this)},e.prototype._render=function(){var e=this.$options,t=e.render,n=e._parentVnode;if(this._isMounted)for(var o in this.$slots){var r=this.$slots[o];(r._rendered||r[0]&&r[0].elm)&&(this.$slots[o]=M(r,!0))}this.$scopedSlots=n&&n.data.scopedSlots||Nn,this.$vnode=n;var i;try{i=t.call(this._renderProxy,this.$createElement)}catch(e){X(e,this,"render"),i=this._vnode}return i instanceof ko||(i=So()),i.parent=n,i}}(He);var sr=[String,RegExp,Array],ar={KeepAlive:{name:"keep-alive",abstract:!0,props:{include:sr,exclude:sr,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)Je(this.cache,e,this.keys)},watch:{include:function(e){Xe(this,function(t){return We(e,t)})},exclude:function(e){Xe(this,function(t){return!We(e,t)})}},render:function(){var e=this.$slots.default,t=le(e),n=t&&t.componentOptions;if(n){var o=Ue(n),r=this.include,i=this.exclude;if(r&&(!o||!We(r,o))||i&&o&&We(i,o))return t;var s=this.cache,a=this.keys,l=null==t.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):t.key;s[l]?(t.componentInstance=s[l].componentInstance,h(a,l),a.push(l)):(s[l]=t,a.push(l),this.max&&a.length>parseInt(this.max)&&Je(s,a[0],a,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={};t.get=function(){return Zn},Object.defineProperty(e,"config",t),e.util={warn:_o,extend:_,mergeOptions:q,defineReactive:j},e.set=F,e.delete=I,e.nextTick=Y,e.options=Object.create(null),Gn.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,_(e.options.components,ar),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=b(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=q(this.options,e),this}}(e),Ve(e),function(e){Gn.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&l(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}(e)}(He),Object.defineProperty(He.prototype,"$isServer",{get:vo}),Object.defineProperty(He.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),He.version="2.5.13";var lr,cr,ur,fr,pr,dr,hr,mr,vr=d("style,class"),gr=d("input,textarea,option,select,progress"),br=function(e,t,n){return"value"===n&&gr(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},_r=d("contenteditable,draggable,spellcheck"),yr=d("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),xr="http://www.w3.org/1999/xlink",wr=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},kr=function(e){return wr(e)?e.slice(6,e.length):""},Cr=function(e){return null==e||!1===e},Sr={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},$r=d("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),Or=d("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),Er=function(e){return $r(e)||Or(e)},Tr=Object.create(null),Mr=d("text,number,password,search,email,tel,url"),Ar=Object.freeze({createElement:function(e,t){var n=document.createElement(e);return"select"!==e?n:(t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)},createElementNS:function(e,t){return document.createElementNS(Sr[e],t)},createTextNode:function(e){return document.createTextNode(e)},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,n){e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},appendChild:function(e,t){e.appendChild(t)},parentNode:function(e){return e.parentNode},nextSibling:function(e){return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},setAttribute:function(e,t,n){e.setAttribute(t,n)}}),Pr={create:function(e,t){tt(t)},update:function(e,t){e.data.ref!==t.data.ref&&(tt(e,!0),tt(t))},destroy:function(e){tt(e,!0)}},zr=new ko("",{},[]),jr=["create","activate","update","remove","destroy"],Fr={create:rt,update:rt,destroy:function(e){rt(e,zr)}},Ir=Object.create(null),Nr=[Pr,Fr],Lr={create:at,update:at},Rr={create:ct,update:ct},Dr=/[\w).+\-_$\]]/,Br="__r",qr="__c",Hr={create:Et,update:Et},Vr={create:Tt,update:Tt},Ur=v(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach(function(e){if(e){var o=e.split(n);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}),Wr=/^--/,Xr=/\s*!important$/,Jr=function(e,t,n){if(Wr.test(t))e.style.setProperty(t,n);else if(Xr.test(n))e.style.setProperty(t,n.replace(Xr,""),"important");else{var o=Gr(t);if(Array.isArray(n))for(var r=0,i=n.length;r<i;r++)e.style[o]=n[r];else e.style[o]=n}},Kr=["Webkit","Moz","ms"],Gr=v(function(e){if(mr=mr||document.createElement("div").style,"filter"!==(e=Hn(e))&&e in mr)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<Kr.length;n++){var o=Kr[n]+t;if(o in mr)return o}}),Yr={create:Pt,update:Pt},Zr=v(function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}}),Qr=to&&!so,ei="transition",ti="animation",ni="transition",oi="transitionend",ri="animation",ii="animationend";Qr&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(ni="WebkitTransition",oi="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(ri="WebkitAnimation",ii="webkitAnimationEnd"));var si=to?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()},ai=/\b(transform|all)(,|$)/,li=function(e){function t(e){var t=$.parentNode(e);r(t)&&$.removeChild(t,e)}function n(e,t,n,o,s){if(e.isRootInsert=!s,!function(e,t,n,o){var s=e.data;if(r(s)){var c=r(e.componentInstance)&&s.keepAlive;if(r(s=s.hook)&&r(s=s.init)&&s(e,!1,n,o),r(e.componentInstance))return a(e,t),i(c)&&function(e,t,n,o){for(var i,s=e;s.componentInstance;)if(s=s.componentInstance._vnode,r(i=s.data)&&r(i=i.transition)){for(i=0;i<C.activate.length;++i)C.activate[i](zr,s);t.push(s);break}l(n,e.elm,o)}(e,t,n,o),!0}}(e,t,n,o)){var u=e.data,d=e.children,h=e.tag;r(h)?(e.elm=e.ns?$.createElementNS(e.ns,h):$.createElement(h,e),p(e),c(e,d,t),r(u)&&f(e,t),l(n,e.elm,o)):i(e.isComment)?(e.elm=$.createComment(e.text),l(n,e.elm,o)):(e.elm=$.createTextNode(e.text),l(n,e.elm,o))}}function a(e,t){r(e.data.pendingInsert)&&(t.push.apply(t,e.data.pendingInsert),e.data.pendingInsert=null),e.elm=e.componentInstance.$el,u(e)?(f(e,t),p(e)):(tt(e),t.push(e))}function l(e,t,n){r(e)&&(r(n)?n.parentNode===e&&$.insertBefore(e,t,n):$.appendChild(e,t))}function c(e,t,o){if(Array.isArray(t))for(var r=0;r<t.length;++r)n(t[r],o,e.elm,null,!0);else s(e.text)&&$.appendChild(e.elm,$.createTextNode(String(e.text)))}function u(e){for(;e.componentInstance;)e=e.componentInstance._vnode;return r(e.tag)}function f(e,t){for(var n=0;n<C.create.length;++n)C.create[n](zr,e);r(w=e.data.hook)&&(r(w.create)&&w.create(zr,e),r(w.insert)&&t.push(e))}function p(e){var t;if(r(t=e.fnScopeId))$.setAttribute(e.elm,t,"");else for(var n=e;n;)r(t=n.context)&&r(t=t.$options._scopeId)&&$.setAttribute(e.elm,t,""),n=n.parent;r(t=Vo)&&t!==e.context&&t!==e.fnContext&&r(t=t.$options._scopeId)&&$.setAttribute(e.elm,t,"")}function h(e,t,o,r,i,s){for(;r<=i;++r)n(o[r],s,e,t)}function m(e){var t,n,o=e.data;if(r(o))for(r(t=o.hook)&&r(t=t.destroy)&&t(e),t=0;t<C.destroy.length;++t)C.destroy[t](e);if(r(t=e.children))for(n=0;n<e.children.length;++n)m(e.children[n])}function v(e,n,o,i){for(;o<=i;++o){var s=n[o];r(s)&&(r(s.tag)?(g(s),m(s)):t(s.elm))}}function g(e,n){if(r(n)||r(e.data)){var o,i=C.remove.length+1;for(r(n)?n.listeners+=i:n=function(e,n){function o(){0==--o.listeners&&t(e)}return o.listeners=n,o}(e.elm,i),r(o=e.componentInstance)&&r(o=o._vnode)&&r(o.data)&&g(o,n),o=0;o<C.remove.length;++o)C.remove[o](e,n);r(o=e.data.hook)&&r(o=o.remove)?o(e,n):n()}else t(e.elm)}function b(e,t,i,s,a){for(var l,c,u,f=0,p=0,d=t.length-1,m=t[0],g=t[d],b=i.length-1,y=i[0],x=i[b],w=!a;f<=d&&p<=b;)o(m)?m=t[++f]:o(g)?g=t[--d]:nt(m,y)?(_(m,y,s),m=t[++f],y=i[++p]):nt(g,x)?(_(g,x,s),g=t[--d],x=i[--b]):nt(m,x)?(_(m,x,s),w&&$.insertBefore(e,m.elm,$.nextSibling(g.elm)),m=t[++f],x=i[--b]):nt(g,y)?(_(g,y,s),w&&$.insertBefore(e,g.elm,m.elm),g=t[--d],y=i[++p]):(o(l)&&(l=ot(t,f,d)),o(c=r(y.key)?l[y.key]:function(e,t,n,o){for(var i=n;i<o;i++){var s=t[i];if(r(s)&&nt(e,s))return i}}(y,t,f,d))?n(y,s,e,m.elm):nt(u=t[c],y)?(_(u,y,s),t[c]=void 0,w&&$.insertBefore(e,u.elm,m.elm)):n(y,s,e,m.elm),y=i[++p]);f>d?h(e,o(i[b+1])?null:i[b+1].elm,i,p,b,s):p>b&&v(0,t,f,d)}function _(e,t,n,s){if(e!==t){var a=t.elm=e.elm;if(i(e.isAsyncPlaceholder))r(t.asyncFactory.resolved)?x(e.elm,t,n):t.isAsyncPlaceholder=!0;else if(i(t.isStatic)&&i(e.isStatic)&&t.key===e.key&&(i(t.isCloned)||i(t.isOnce)))t.componentInstance=e.componentInstance;else{var l,c=t.data;r(c)&&r(l=c.hook)&&r(l=l.prepatch)&&l(e,t);var f=e.children,p=t.children;if(r(c)&&u(t)){for(l=0;l<C.update.length;++l)C.update[l](e,t);r(l=c.hook)&&r(l=l.update)&&l(e,t)}o(t.text)?r(f)&&r(p)?f!==p&&b(a,f,p,n,s):r(p)?(r(e.text)&&$.setTextContent(a,""),h(a,null,p,0,p.length-1,n)):r(f)?v(0,f,0,f.length-1):r(e.text)&&$.setTextContent(a,""):e.text!==t.text&&$.setTextContent(a,t.text),r(c)&&r(l=c.hook)&&r(l=l.postpatch)&&l(e,t)}}}function y(e,t,n){if(i(n)&&r(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o<t.length;++o)t[o].data.hook.insert(t[o])}function x(e,t,n,o){var s,l=t.tag,u=t.data,p=t.children;if(o=o||u&&u.pre,t.elm=e,i(t.isComment)&&r(t.asyncFactory))return t.isAsyncPlaceholder=!0,!0;if(r(u)&&(r(s=u.hook)&&r(s=s.init)&&s(t,!0),r(s=t.componentInstance)))return a(t,n),!0;if(r(l)){if(r(p))if(e.hasChildNodes())if(r(s=u)&&r(s=s.domProps)&&r(s=s.innerHTML)){if(s!==e.innerHTML)return!1}else{for(var d=!0,h=e.firstChild,m=0;m<p.length;m++){if(!h||!x(h,p[m],n,o)){d=!1;break}h=h.nextSibling}if(!d||h)return!1}else c(t,p,n);if(r(u)){var v=!1;for(var g in u)if(!O(g)){v=!0,f(t,n);break}!v&&u.class&&Z(u.class)}}else e.data!==t.text&&(e.data=t.text);return!0}var w,k,C={},S=e.modules,$=e.nodeOps;for(w=0;w<jr.length;++w)for(C[jr[w]]=[],k=0;k<S.length;++k)r(S[k][jr[w]])&&C[jr[w]].push(S[k][jr[w]]);var O=d("attrs,class,staticClass,staticStyle,key");return function(e,t,s,a,l,c){if(!o(t)){var f=!1,p=[];if(o(e))f=!0,n(t,p,l,c);else{var d=r(e.nodeType);if(!d&&nt(e,t))_(e,t,p,a);else{if(d){if(1===e.nodeType&&e.hasAttribute(Kn)&&(e.removeAttribute(Kn),s=!0),i(s)&&x(e,t,p))return y(t,p,!0),e;e=function(e){return new ko($.tagName(e).toLowerCase(),{},[],void 0,e)}(e)}var h=e.elm,g=$.parentNode(h);if(n(t,p,h._leaveCb?null:g,$.nextSibling(h)),r(t.parent))for(var b=t.parent,w=u(t);b;){for(var k=0;k<C.destroy.length;++k)C.destroy[k](b);if(b.elm=t.elm,w){for(var S=0;S<C.create.length;++S)C.create[S](zr,b);var O=b.data.hook.insert;if(O.merged)for(var E=1;E<O.fns.length;E++)O.fns[E]()}else tt(b);b=b.parent}r(g)?v(0,[e],0,0):r(e.tag)&&m(e)}}return y(t,p,f),t.elm}r(e)&&m(e)}}({nodeOps:Ar,modules:[Lr,Rr,Hr,Vr,Yr,to?{create:Xt,activate:Xt,remove:function(e,t){!0!==e.data.show?Vt(e,t):t()}}:{}].concat(Nr)});so&&document.addEventListener("selectionchange",function(){var e=document.activeElement;e&&e.vmodel&&en(e,"input")});var ci={inserted:function(e,t,n,o){"select"===n.tag?(o.elm&&!o.elm._vOptions?ne(n,"postpatch",function(){ci.componentUpdated(e,t,n)}):Jt(e,t,n.context),e._vOptions=[].map.call(e.options,Yt)):("textarea"===n.tag||Mr(e.type))&&(e._vModifiers=t.modifiers,t.modifiers.lazy||(e.addEventListener("change",Qt),lo||(e.addEventListener("compositionstart",Zt),e.addEventListener("compositionend",Qt)),so&&(e.vmodel=!0)))},componentUpdated:function(e,t,n){if("select"===n.tag){Jt(e,t,n.context);var o=e._vOptions,r=e._vOptions=[].map.call(e.options,Yt);if(r.some(function(e,t){return!w(e,o[t])})){(e.multiple?t.value.some(function(e){return Gt(e,r)}):t.value!==t.oldValue&&Gt(t.value,r))&&en(e,"change")}}}},ui={model:ci,show:{bind:function(e,t,n){var o=t.value,r=(n=tn(n)).data&&n.data.transition,i=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;o&&r?(n.data.show=!0,Ht(n,function(){e.style.display=i})):e.style.display=o?i:"none"},update:function(e,t,n){var o=t.value;if(o!==t.oldValue){(n=tn(n)).data&&n.data.transition?(n.data.show=!0,o?Ht(n,function(){e.style.display=e.__vOriginalDisplay}):Vt(n,function(){e.style.display="none"})):e.style.display=o?e.__vOriginalDisplay:"none"}},unbind:function(e,t,n,o,r){r||(e.style.display=e.__vOriginalDisplay)}}},fi={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]},pi={name:"transition",props:fi,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(function(e){return e.tag||ae(e)})).length){0;var o=this.mode;0;var r=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return r;var i=nn(r);if(!i)return r;if(this._leaving)return rn(e,r);var a="__transition-"+this._uid+"-";i.key=null==i.key?i.isComment?a+"comment":a+i.tag:s(i.key)?0===String(i.key).indexOf(a)?i.key:a+i.key:i.key;var l=(i.data||(i.data={})).transition=on(this),c=this._vnode,u=nn(c);if(i.data.directives&&i.data.directives.some(function(e){return"show"===e.name})&&(i.data.show=!0),u&&u.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(i,u)&&!ae(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var f=u.data.transition=_({},l);if("out-in"===o)return this._leaving=!0,ne(f,"afterLeave",function(){t._leaving=!1,t.$forceUpdate()}),rn(e,r);if("in-out"===o){if(ae(i))return c;var p,d=function(){p()};ne(l,"afterEnter",d),ne(l,"enterCancelled",d),ne(f,"delayLeave",function(e){p=e})}}return r}}},di=_({tag:String,moveClass:String},fi);delete di.mode;var hi={Transition:pi,TransitionGroup:{props:di,render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),o=this.prevChildren=this.children,r=this.$slots.default||[],i=this.children=[],s=on(this),a=0;a<r.length;a++){var l=r[a];if(l.tag)if(null!=l.key&&0!==String(l.key).indexOf("__vlist"))i.push(l),n[l.key]=l,(l.data||(l.data={})).transition=s;else{}}if(o){for(var c=[],u=[],f=0;f<o.length;f++){var p=o[f];p.data.transition=s,p.data.pos=p.elm.getBoundingClientRect(),n[p.key]?c.push(p):u.push(p)}this.kept=e(t,null,c),this.removed=u}return e(t,null,i)},beforeUpdate:function(){this.__patch__(this._vnode,this.kept,!1,!0),this._vnode=this.kept},updated:function(){var e=this.prevChildren,t=this.moveClass||(this.name||"v")+"-move";e.length&&this.hasMove(e[0].elm,t)&&(e.forEach(sn),e.forEach(an),e.forEach(ln),this._reflow=document.body.offsetHeight,e.forEach(function(e){if(e.data.moved){var n=e.elm,o=n.style;Nt(n,t),o.transform=o.WebkitTransform=o.transitionDuration="",n.addEventListener(oi,n._moveCb=function e(o){o&&!/transform$/.test(o.propertyName)||(n.removeEventListener(oi,e),n._moveCb=null,Lt(n,t))})}}))},methods:{hasMove:function(e,t){if(!Qr)return!1;if(this._hasMove)return this._hasMove;var n=e.cloneNode();e._transitionClasses&&e._transitionClasses.forEach(function(e){jt(n,e)}),zt(n,t),n.style.display="none",this.$el.appendChild(n);var o=Dt(n);return this.$el.removeChild(n),this._hasMove=o.hasTransform}}}};He.config.mustUseProp=br,He.config.isReservedTag=Er,He.config.isReservedAttr=vr,He.config.getTagNamespace=Qe,He.config.isUnknownElement=function(e){if(!to)return!0;if(Er(e))return!1;if(e=e.toLowerCase(),null!=Tr[e])return Tr[e];var t=document.createElement(e);return e.indexOf("-")>-1?Tr[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Tr[e]=/HTMLUnknownElement/.test(t.toString())},_(He.options.directives,ui),_(He.options.components,hi),He.prototype.__patch__=to?li:x,He.prototype.$mount=function(e,t){return e=e&&to?et(e):void 0,function(e,t,n){e.$el=t,e.$options.render||(e.$options.render=So),be(e,"beforeMount");var o;return o=function(){e._update(e._render(),n)},new Zo(e,o,x,null,!0),n=!1,null==e.$vnode&&(e._isMounted=!0,be(e,"mounted")),e}(this,e,t)},He.nextTick(function(){Zn.devtools&&go&&go.emit("init",He)},0);var mi,vi=/\{\{((?:.|\n)+?)\}\}/g,gi=/[-.*+?^${}()|[\]\/\\]/g,bi=v(function(e){var t=e[0].replace(gi,"\\$&"),n=e[1].replace(gi,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")}),_i={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=_t(e,"class");n&&(e.staticClass=JSON.stringify(n));var o=bt(e,"class",!1);o&&(e.classBinding=o)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}},yi={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=_t(e,"style");n&&(e.staticStyle=JSON.stringify(Ur(n)));var o=bt(e,"style",!1);o&&(e.styleBinding=o)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},xi=function(e){return mi=mi||document.createElement("div"),mi.innerHTML=e,mi.textContent},wi=d("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),ki=d("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),Ci=d("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),Si=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,$i="((?:[a-zA-Z_][\\w\\-\\.]*\\:)?[a-zA-Z_][\\w\\-\\.]*)",Oi=new RegExp("^<"+$i),Ei=/^\s*(\/?)>/,Ti=new RegExp("^<\\/"+$i+"[^>]*>"),Mi=/^<!DOCTYPE [^>]+>/i,Ai=/^<!--/,Pi=/^<!\[/,zi=!1;"x".replace(/x(.)?/g,function(e,t){zi=""===t});var ji,Fi,Ii,Ni,Li,Ri,Di,Bi,qi,Hi,Vi,Ui=d("script,style,textarea",!0),Wi={},Xi={"<":"<",">":">",""":'"',"&":"&"," ":"\n","	":"\t"},Ji=/&(?:lt|gt|quot|amp);/g,Ki=/&(?:lt|gt|quot|amp|#10|#9);/g,Gi=d("pre,textarea",!0),Yi=function(e,t){return e&&Gi(e)&&"\n"===t[0]},Zi=/^@|^v-on:/,Qi=/^v-|^@|^:/,es=/(.*?)\s+(?:in|of)\s+(.*)/,ts=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,ns=/^\(|\)$/g,os=/:(.*)$/,rs=/^:|^v-bind:/,is=/\.[^.]+/g,ss=v(xi),as=/^xmlns:NS\d+/,ls=/^NS\d+:/,cs=[_i,yi,{preTransformNode:function(e,t){if("input"===e.tag){var n=e.attrsMap;if(n["v-model"]&&(n["v-bind:type"]||n[":type"])){var o=bt(e,"type"),r=_t(e,"v-if",!0),i=r?"&&("+r+")":"",s=null!=_t(e,"v-else",!0),a=_t(e,"v-else-if",!0),l=gn(e);mn(l),mt(l,"type","checkbox"),hn(l,t),l.processed=!0,l.if="("+o+")==='checkbox'"+i,vn(l,{exp:l.if,block:l});var c=gn(e);_t(c,"v-for",!0),mt(c,"type","radio"),hn(c,t),vn(l,{exp:"("+o+")==='radio'"+i,block:c});var u=gn(e);return _t(u,"v-for",!0),mt(u,":type",o),hn(u,t),vn(l,{exp:r,block:u}),s?l.else=!0:a&&(l.elseif=a),l}}}}],us={expectHTML:!0,modules:cs,directives:{model:function(e,t,n){n;var o=t.value,r=t.modifiers,i=e.tag,s=e.attrsMap.type;if(e.component)return yt(e,o,r),!1;if("select"===i)!function(e,t,n){var o='var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(n&&n.number?"_n(val)":"val")+"});";o=o+" "+xt(t,"$event.target.multiple ? $$selectedVal : $$selectedVal[0]"),gt(e,"change",o,null,!0)}(e,o,r);else if("input"===i&&"checkbox"===s)!function(e,t,n){var o=n&&n.number,r=bt(e,"value")||"null",i=bt(e,"true-value")||"true",s=bt(e,"false-value")||"false";dt(e,"checked","Array.isArray("+t+")?_i("+t+","+r+")>-1"+("true"===i?":("+t+")":":_q("+t+","+i+")")),gt(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+i+"):("+s+");if(Array.isArray($$a)){var $$v="+(o?"_n("+r+")":r)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+t+"=$$a.concat([$$v]))}else{$$i>-1&&("+t+"=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{"+xt(t,"$$c")+"}",null,!0)}(e,o,r);else if("input"===i&&"radio"===s)!function(e,t,n){var o=n&&n.number,r=bt(e,"value")||"null";dt(e,"checked","_q("+t+","+(r=o?"_n("+r+")":r)+")"),gt(e,"change",xt(t,r),null,!0)}(e,o,r);else if("input"===i||"textarea"===i)!function(e,t,n){var o=e.attrsMap.type,r=n||{},i=r.lazy,s=r.number,a=r.trim,l=!i&&"range"!==o,c=i?"change":"range"===o?Br:"input",u="$event.target.value";a&&(u="$event.target.value.trim()"),s&&(u="_n("+u+")");var f=xt(t,u);l&&(f="if($event.target.composing)return;"+f),dt(e,"value","("+t+")"),gt(e,c,f,null,!0),(a||s)&>(e,"blur","$forceUpdate()")}(e,o,r);else if(!Zn.isReservedTag(i))return yt(e,o,r),!1;return!0},text:function(e,t){t.value&&dt(e,"textContent","_s("+t.value+")")},html:function(e,t){t.value&&dt(e,"innerHTML","_s("+t.value+")")}},isPreTag:function(e){return"pre"===e},isUnaryTag:wi,mustUseProp:br,canBeLeftOpenTag:ki,isReservedTag:Er,getTagNamespace:Qe,staticKeys:function(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(",")}(cs)},fs=v(function(e){return d("type,tag,attrsList,attrsMap,plain,parent,children,attrs"+(e?","+e:""))}),ps=/^\s*([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/,ds=/^\s*[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?']|\[".*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*\s*$/,hs={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},ms=function(e){return"if("+e+")return null;"},vs={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:ms("$event.target !== $event.currentTarget"),ctrl:ms("!$event.ctrlKey"),shift:ms("!$event.shiftKey"),alt:ms("!$event.altKey"),meta:ms("!$event.metaKey"),left:ms("'button' in $event && $event.button !== 0"),middle:ms("'button' in $event && $event.button !== 1"),right:ms("'button' in $event && $event.button !== 2")},gs={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:x},bs=function(e){this.options=e,this.warn=e.warn||ft,this.transforms=pt(e.modules,"transformCode"),this.dataGenFns=pt(e.modules,"genData"),this.directives=_(_({},gs),e.directives);var t=e.isReservedTag||Xn;this.maybeComponent=function(e){return!t(e.tag)},this.onceId=0,this.staticRenderFns=[]},_s=(new RegExp("\\b"+"do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,super,throw,while,yield,delete,export,import,return,switch,default,extends,finally,continue,debugger,function,arguments".split(",").join("\\b|\\b")+"\\b"),new RegExp("\\b"+"delete,typeof,void".split(",").join("\\s*\\([^\\)]*\\)|\\b")+"\\s*\\([^\\)]*\\)"),function(e){return function(t){function n(n,o){var r=Object.create(t),i=[],s=[];if(r.warn=function(e,t){(t?s:i).push(e)},o){o.modules&&(r.modules=(t.modules||[]).concat(o.modules)),o.directives&&(r.directives=_(Object.create(t.directives||null),o.directives));for(var a in o)"modules"!==a&&"directives"!==a&&(r[a]=o[a])}var l=e(n,r);return l.errors=i,l.tips=s,l}return{compile:n,compileToFunctions:function(e){var t=Object.create(null);return function(n,o,r){(o=_({},o)).warn,delete o.warn;var i=o.delimiters?String(o.delimiters)+n:n;if(t[i])return t[i];var s=e(n,o),a={},l=[];return a.render=Fn(s.render,l),a.staticRenderFns=s.staticRenderFns.map(function(e){return Fn(e,l)}),t[i]=a}}(n)}}}(function(e,t){var n=dn(e.trim(),t);!1!==t.optimize&&function(e,t){e&&(qi=fs(t.staticKeys||""),Hi=t.isReservedTag||Xn,bn(e),_n(e,!1))}(n,t);var o=kn(n,t);return{ast:n,render:o.render,staticRenderFns:o.staticRenderFns}})(us).compileToFunctions),ys=!!to&&In(!1),xs=!!to&&In(!0),ws=v(function(e){var t=et(e);return t&&t.innerHTML}),ks=He.prototype.$mount;He.prototype.$mount=function(e,t){if((e=e&&et(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var o=n.template;if(o)if("string"==typeof o)"#"===o.charAt(0)&&(o=ws(o));else{if(!o.nodeType)return this;o=o.innerHTML}else e&&(o=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(o){0;var r=_s(o,{shouldDecodeNewlines:ys,shouldDecodeNewlinesForHref:xs,delimiters:n.delimiters,comments:n.comments},this),i=r.render,s=r.staticRenderFns;n.render=i,n.staticRenderFns=s}}return ks.call(this,e,t)},He.compile=_s,e.exports=He}).call(t,n(13),n(59).setImmediate)},function(e,t,n){"use strict";function o(e,t){for(var n in t)e[n]=t[n];return e}t.__esModule=!0,t.noop=function(){},t.hasOwn=function(e,t){return r.call(e,t)},t.toObject=function(e){for(var t={},n=0;n<e.length;n++)e[n]&&o(t,e[n]);return t},t.getPropByPath=function(e,t,n){for(var o=e,r=(t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split("."),i=0,s=r.length;i<s-1&&(o||n);++i){var a=r[i];if(!(a in o)){if(n)throw new Error("please transfer a valid prop path to form item!");break}o=o[a]}return{o:o,k:r[i],v:o?o[r[i]]:null}};var r=Object.prototype.hasOwnProperty;t.getValueByPath=function(e,t){for(var n=(t=t||"").split("."),o=e,r=null,i=0,s=n.length;i<s;i++){var a=n[i];if(!o)break;if(i===s-1){r=o[a];break}o=o[a]}return r},t.generateId=function(){return Math.floor(1e4*Math.random())},t.valueEquals=function(e,t){if(e===t)return!0;if(!(e instanceof Array))return!1;if(!(t instanceof Array))return!1;if(e.length!==t.length)return!1;for(var n=0;n!==e.length;++n)if(e[n]!==t[n])return!1;return!0}},function(e,t,n){"use strict";function o(e,t){if(!e||!t)return!1;if(-1!==t.indexOf(" "))throw new Error("className should not contain space.");return e.classList?e.classList.contains(t):(" "+e.className+" ").indexOf(" "+t+" ")>-1}function r(e,t,n){if(e&&t)if("object"===(void 0===t?"undefined":i(t)))for(var o in t)t.hasOwnProperty(o)&&r(e,o,t[o]);else"opacity"===(t=f(t))&&c<9?e.style.filter=isNaN(n)?"":"alpha(opacity="+100*n+")":e.style[t]=n}t.__esModule=!0,t.getStyle=t.once=t.off=t.on=void 0;var 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};t.hasClass=o,t.addClass=function(e,t){if(e){for(var n=e.className,r=(t||"").split(" "),i=0,s=r.length;i<s;i++){var a=r[i];a&&(e.classList?e.classList.add(a):o(e,a)||(n+=" "+a))}e.classList||(e.className=n)}},t.removeClass=function(e,t){if(e&&t){for(var n=t.split(" "),r=" "+e.className+" ",i=0,s=n.length;i<s;i++){var a=n[i];a&&(e.classList?e.classList.remove(a):o(e,a)&&(r=r.replace(" "+a+" "," ")))}e.classList||(e.className=u(r))}},t.setStyle=r;var s=function(e){return e&&e.__esModule?e:{default:e}}(n(4)).default.prototype.$isServer,a=/([\:\-\_]+(.))/g,l=/^moz([A-Z])/,c=s?0:Number(document.documentMode),u=function(e){return(e||"").replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")},f=function(e){return e.replace(a,function(e,t,n,o){return o?n.toUpperCase():n}).replace(l,"Moz$1")},p=t.on=!s&&document.addEventListener?function(e,t,n){e&&t&&n&&e.addEventListener(t,n,!1)}:function(e,t,n){e&&t&&n&&e.attachEvent("on"+t,n)},d=t.off=!s&&document.removeEventListener?function(e,t,n){e&&t&&e.removeEventListener(t,n,!1)}:function(e,t,n){e&&t&&e.detachEvent("on"+t,n)};t.once=function(e,t,n){p(e,t,function o(){n&&n.apply(this,arguments),d(e,t,o)})},t.getStyle=c<9?function(e,t){if(!s){if(!e||!t)return null;"float"===(t=f(t))&&(t="styleFloat");try{switch(t){case"opacity":try{return e.filters.item("alpha").opacity/100}catch(e){return 1}default:return e.style[t]||e.currentStyle?e.currentStyle[t]:null}}catch(n){return e.style[t]}}}:function(e,t){if(!s){if(!e||!t)return null;"float"===(t=f(t))&&(t="cssFloat");try{var n=document.defaultView.getComputedStyle(e,"");return e.style[t]||n?n[t]:null}catch(n){return e.style[t]}}}},function(e,t,n){"use strict";function o(e,t,n){this.$children.forEach(function(r){r.$options.componentName===e?r.$emit.apply(r,[t].concat(n)):o.apply(r,[e,t].concat([n]))})}t.__esModule=!0,t.default={methods:{dispatch:function(e,t,n){for(var o=this.$parent||this.$root,r=o.$options.componentName;o&&(!r||r!==e);)(o=o.$parent)&&(r=o.$options.componentName);o&&o.$emit.apply(o,[t].concat(n))},broadcast:function(e,t,n){o.call(this,e,t,n)}}}},function(e,t,n){function o(e){for(var t=0;t<e.length;t++){var n=e[t],o=c[n.id];if(o){o.refs++;for(var r=0;r<o.parts.length;r++)o.parts[r](n.parts[r]);for(;r<n.parts.length;r++)o.parts.push(i(n.parts[r]));o.parts.length>n.parts.length&&(o.parts.length=n.parts.length)}else{var s=[];for(r=0;r<n.parts.length;r++)s.push(i(n.parts[r]));c[n.id]={id:n.id,refs:1,parts:s}}}}function r(){var e=document.createElement("style");return e.type="text/css",u.appendChild(e),e}function i(e){var t,n,o=document.querySelector('style[data-vue-ssr-id~="'+e.id+'"]');if(o){if(d)return h;o.parentNode.removeChild(o)}if(m){var i=p++;o=f||(f=r()),t=s.bind(null,o,i,!1),n=s.bind(null,o,i,!0)}else o=r(),t=function(e,t){var n=t.css,o=t.media,r=t.sourceMap;o&&e.setAttribute("media",o);r&&(n+="\n/*# sourceURL="+r.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,o),n=function(){o.parentNode.removeChild(o)};return t(e),function(o){if(o){if(o.css===e.css&&o.media===e.media&&o.sourceMap===e.sourceMap)return;t(e=o)}else n()}}function s(e,t,n,o){var r=n?"":o.css;if(e.styleSheet)e.styleSheet.cssText=v(t,r);else{var i=document.createTextNode(r),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(i,s[t]):e.appendChild(i)}}var a="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!a)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var l=n(63),c={},u=a&&(document.head||document.getElementsByTagName("head")[0]),f=null,p=0,d=!1,h=function(){},m="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());e.exports=function(e,t,n){d=n;var r=l(e,t);return o(r),function(t){for(var n=[],i=0;i<r.length;i++){var s=r[i];(a=c[s.id]).refs--,n.push(a)}t?o(r=l(e,t)):r=[];for(i=0;i<n.length;i++){var a;if(0===(a=n[i]).refs){for(var u=0;u<a.parts.length;u++)a.parts[u]();delete c[a.id]}}}};var v=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){for(var t=1,n=arguments.length;t<n;t++){var o=arguments[t]||{};for(var r in o)if(o.hasOwnProperty(r)){var i=o[r];void 0!==i&&(e[r]=i)}}return e}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){"use strict";t.__esModule=!0;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(4)),r=n(19),i=o.default.prototype.$isServer?function(){}:n(93),s=function(e){return e.stopPropagation()};t.default={props:{placement:{type:String,default:"bottom"},boundariesPadding:{type:Number,default:5},reference:{},popper:{},offset:{default:0},value:Boolean,visibleArrow:Boolean,transition:String,appendToBody:{type:Boolean,default:!0},popperOptions:{type:Object,default:function(){return{gpuAcceleration:!1}}}},data:function(){return{showPopper:!1,currentPlacement:""}},watch:{value:{immediate:!0,handler:function(e){this.showPopper=e,this.$emit("input",e)}},showPopper:function(e){e?this.updatePopper():this.destroyPopper(),this.$emit("input",e)}},methods:{createPopper:function(){var e=this;if(!this.$isServer&&(this.currentPlacement=this.currentPlacement||this.placement,/^(top|bottom|left|right)(-start|-end)?$/g.test(this.currentPlacement))){var t=this.popperOptions,n=this.popperElm=this.popperElm||this.popper||this.$refs.popper,o=this.referenceElm=this.referenceElm||this.reference||this.$refs.reference;!o&&this.$slots.reference&&this.$slots.reference[0]&&(o=this.referenceElm=this.$slots.reference[0].elm),n&&o&&(this.visibleArrow&&this.appendArrow(n),this.appendToBody&&document.body.appendChild(this.popperElm),this.popperJS&&this.popperJS.destroy&&this.popperJS.destroy(),t.placement=this.currentPlacement,t.offset=this.offset,this.popperJS=new i(o,n,t),this.popperJS.onCreate(function(t){e.$emit("created",e),e.resetTransformOrigin(),e.$nextTick(e.updatePopper)}),"function"==typeof t.onUpdate&&this.popperJS.onUpdate(t.onUpdate),this.popperJS._popper.style.zIndex=r.PopupManager.nextZIndex(),this.popperElm.addEventListener("click",s))}},updatePopper:function(){this.popperJS?this.popperJS.update():this.createPopper()},doDestroy:function(){!this.showPopper&&this.popperJS&&(this.popperJS.destroy(),this.popperJS=null)},destroyPopper:function(){this.popperJS&&this.resetTransformOrigin()},resetTransformOrigin:function(){var e=this.popperJS._popper.getAttribute("x-placement").split("-")[0],t={top:"bottom",bottom:"top",left:"right",right:"left"}[e];this.popperJS._popper.style.transformOrigin=["top","bottom"].indexOf(e)>-1?"center "+t:t+" center"},appendArrow:function(e){var t=void 0;if(!this.appended){this.appended=!0;for(var n in e.attributes)if(/^_v-/.test(e.attributes[n].name)){t=e.attributes[n].name;break}var o=document.createElement("div");t&&o.setAttribute(t,""),o.setAttribute("x-arrow",""),o.className="popper__arrow",e.appendChild(o)}}},beforeDestroy:function(){this.doDestroy(),this.popperElm&&this.popperElm.parentNode===document.body&&(this.popperElm.removeEventListener("click",s),document.body.removeChild(this.popperElm))},deactivated:function(){this.$options.beforeDestroy[0].call(this)}}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var o=n(15),r=n(30);e.exports=n(16)?function(e,t,n){return o.f(e,t,r(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var o=n(29),r=n(67),i=n(40),s=Object.defineProperty;t.f=n(16)?Object.defineProperty:function(e,t,n){if(o(e),t=i(t,!0),o(n),r)try{return s(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){e.exports=!n(22)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){var o=n(70),r=n(41);e.exports=function(e){return o(r(e))}},function(e,t,n){var o=n(44)("wks"),r=n(32),i=n(9).Symbol,s="function"==typeof i;(e.exports=function(e){return o[e]||(o[e]=s&&i[e]||(s?i:r)("Symbol."+e))}).store=o},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.PopupManager=void 0;var r=o(n(4)),i=o(n(10)),s=o(n(86)),a=o(n(35)),l=n(6),c=1,u=[],f=void 0;t.default={props:{visible:{type:Boolean,default:!1},transition:{type:String,default:""},openDelay:{},closeDelay:{},zIndex:{},modal:{type:Boolean,default:!1},modalFade:{type:Boolean,default:!0},modalClass:{},modalAppendToBody:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!1},closeOnClickModal:{type:Boolean,default:!1}},created:function(){this.transition&&function(e){if(-1===u.indexOf(e)){var t=function(e){var t=e.__vue__;if(!t){var n=e.previousSibling;n.__vue__&&(t=n.__vue__)}return t};r.default.transition(e,{afterEnter:function(e){var n=t(e);n&&n.doAfterOpen&&n.doAfterOpen()},afterLeave:function(e){var n=t(e);n&&n.doAfterClose&&n.doAfterClose()}})}}(this.transition)},beforeMount:function(){this._popupId="popup-"+c++,s.default.register(this._popupId,this)},beforeDestroy:function(){s.default.deregister(this._popupId),s.default.closeModal(this._popupId),this.modal&&null!==this.bodyOverflow&&"hidden"!==this.bodyOverflow&&(document.body.style.overflow=this.bodyOverflow,document.body.style.paddingRight=this.bodyPaddingRight),this.bodyOverflow=null,this.bodyPaddingRight=null},data:function(){return{opened:!1,bodyOverflow:null,bodyPaddingRight:null,rendered:!1}},watch:{visible:function(e){var t=this;if(e){if(this._opening)return;this.rendered?this.open():(this.rendered=!0,r.default.nextTick(function(){t.open()}))}else this.close()}},methods:{open:function(e){var t=this;this.rendered||(this.rendered=!0);var n=(0,i.default)({},this.$props||this,e);this._closeTimer&&(clearTimeout(this._closeTimer),this._closeTimer=null),clearTimeout(this._openTimer);var o=Number(n.openDelay);o>0?this._openTimer=setTimeout(function(){t._openTimer=null,t.doOpen(n)},o):this.doOpen(n)},doOpen:function(e){if(!this.$isServer&&(!this.willOpen||this.willOpen())&&!this.opened){this._opening=!0;var t=function e(t){return 3===t.nodeType&&e(t=t.nextElementSibling||t.nextSibling),t}(this.$el),n=e.modal,o=e.zIndex;if(o&&(s.default.zIndex=o),n&&(this._closing&&(s.default.closeModal(this._popupId),this._closing=!1),s.default.openModal(this._popupId,s.default.nextZIndex(),this.modalAppendToBody?void 0:t,e.modalClass,e.modalFade),e.lockScroll)){this.bodyOverflow||(this.bodyPaddingRight=document.body.style.paddingRight,this.bodyOverflow=document.body.style.overflow),f=(0,a.default)();var r=document.documentElement.clientHeight<document.body.scrollHeight,i=(0,l.getStyle)(document.body,"overflowY");f>0&&(r||"scroll"===i)&&(document.body.style.paddingRight=f+"px"),document.body.style.overflow="hidden"}"static"===getComputedStyle(t).position&&(t.style.position="absolute"),t.style.zIndex=s.default.nextZIndex(),this.opened=!0,this.onOpen&&this.onOpen(),this.transition||this.doAfterOpen()}},doAfterOpen:function(){this._opening=!1},close:function(){var e=this;if(!this.willClose||this.willClose()){null!==this._openTimer&&(clearTimeout(this._openTimer),this._openTimer=null),clearTimeout(this._closeTimer);var t=Number(this.closeDelay);t>0?this._closeTimer=setTimeout(function(){e._closeTimer=null,e.doClose()},t):this.doClose()}},doClose:function(){var e=this;this._closing=!0,this.onClose&&this.onClose(),this.lockScroll&&setTimeout(function(){e.modal&&"hidden"!==e.bodyOverflow&&(document.body.style.overflow=e.bodyOverflow,document.body.style.paddingRight=e.bodyPaddingRight),e.bodyOverflow=null,e.bodyPaddingRight=null},200),this.opened=!1,this.transition||this.doAfterClose()},doAfterClose:function(){s.default.closeModal(this._popupId),this._closing=!1}}},t.PopupManager=s.default},,function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.i18n=t.use=t.t=void 0;var r=o(n(100)),i=o(n(4)),s=o(n(101)),a=(0,o(n(102)).default)(i.default),l=r.default,c=!1,u=function(){var e=Object.getPrototypeOf(this||i.default).$t;if("function"==typeof e&&i.default.locale)return c||(c=!0,i.default.locale(i.default.config.lang,(0,s.default)(l,i.default.locale(i.default.config.lang)||{},{clone:!0}))),e.apply(this,arguments)},f=t.t=function(e,t){var n=u.apply(this,arguments);if(null!==n&&void 0!==n)return n;for(var o=e.split("."),r=l,i=0,s=o.length;i<s;i++){if(n=r[o[i]],i===s-1)return a(n,t);if(!n)return"";r=n}return""},p=t.use=function(e){l=e||l},d=t.i18n=function(e){u=e||u};t.default={use:p,t:f,i18n:d}},function(e,t,n){"use strict";t.__esModule=!0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.isVNode=function(e){return"object"===(void 0===e?"undefined":o(e))&&(0,r.hasOwn)(e,"componentOptions")},t.getFirstComponentChild=function(e){return e&&e.filter(function(e){return e&&e.tag})[0]};var r=n(5)},function(e,t,n){"use strict";t.__esModule=!0,t.default={mounted:function(){return void 0},methods:{getMigratingConfig:function(){return{props:{},events:{}}}}}},function(e,t,n){var o=n(64);e.exports=function(e,t,n){return void 0===n?o(e,t,!1):o(e,n,!1!==t)}},function(e,t,n){e.exports=function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=111)}({0:function(e,t){e.exports=function(e,t,n,o,r,i){var s,a=e=e||{},l=typeof e.default;"object"!==l&&"function"!==l||(s=e,a=e.default);var c="function"==typeof a?a.options:a;t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId=r);var u;if(i?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},c._ssrRegister=u):o&&(u=o),u){var f=c.functional,p=f?c.render:c.beforeCreate;f?(c._injectStyles=u,c.render=function(e,t){return u.call(t),p(e,t)}):c.beforeCreate=p?[].concat(p,u):[u]}return{esModule:s,exports:a,options:c}}},1:function(e,t){e.exports=n(7)},111:function(e,t,n){e.exports=n(112)},112:function(e,t,n){"use strict";t.__esModule=!0;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(113));o.default.install=function(e){e.component(o.default.name,o.default)},t.default=o.default},113:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(114),r=n.n(o),i=n(116),s=n(0)(r.a,i.a,!1,null,null,null);t.default=s.exports},114:function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var r=o(n(1)),i=o(n(7)),s=o(n(115)),a=o(n(9));t.default={name:"ElInput",componentName:"ElInput",mixins:[r.default,i.default],inject:{elForm:{default:""},elFormItem:{default:""}},data:function(){return{currentValue:this.value,textareaCalcStyle:{},prefixOffset:null,suffixOffset:null,hovering:!1,focused:!1}},props:{value:[String,Number],placeholder:String,size:String,resize:String,name:String,form:String,id:String,maxlength:Number,minlength:Number,readonly:Boolean,autofocus:Boolean,disabled:Boolean,type:{type:String,default:"text"},autosize:{type:[Boolean,Object],default:!1},rows:{type:Number,default:2},autoComplete:{type:String,default:"off"},max:{},min:{},step:{},validateEvent:{type:Boolean,default:!0},suffixIcon:String,prefixIcon:String,label:String,clearable:{type:Boolean,default:!1},tabindex:String},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},validateState:function(){return this.elFormItem?this.elFormItem.validateState:""},needStatusIcon:function(){return!!this.elForm&&this.elForm.statusIcon},validateIcon:function(){return{validating:"el-icon-loading",success:"el-icon-circle-check",error:"el-icon-circle-close"}[this.validateState]},textareaStyle:function(){return(0,a.default)({},this.textareaCalcStyle,{resize:this.resize})},inputSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},isGroup:function(){return this.$slots.prepend||this.$slots.append},showClear:function(){return this.clearable&&""!==this.currentValue&&(this.focused||this.hovering)}},watch:{value:function(e,t){this.setCurrentValue(e)}},methods:{focus:function(){(this.$refs.input||this.$refs.textarea).focus()},getMigratingConfig:function(){return{props:{icon:"icon is removed, use suffix-icon / prefix-icon instead.","on-icon-click":"on-icon-click is removed."},events:{click:"click is removed."}}},handleBlur:function(e){this.focused=!1,this.$emit("blur",e),this.validateEvent&&this.dispatch("ElFormItem","el.form.blur",[this.currentValue])},inputSelect:function(){(this.$refs.input||this.$refs.textarea).select()},resizeTextarea:function(){if(!this.$isServer){var e=this.autosize;if("textarea"===this.type)if(e){var t=e.minRows,n=e.maxRows;this.textareaCalcStyle=(0,s.default)(this.$refs.textarea,t,n)}else this.textareaCalcStyle={minHeight:(0,s.default)(this.$refs.textarea).minHeight}}},handleFocus:function(e){this.focused=!0,this.$emit("focus",e)},handleInput:function(e){var t=e.target.value;this.$emit("input",t),this.setCurrentValue(t)},handleChange:function(e){this.$emit("change",e.target.value)},setCurrentValue:function(e){var t=this;e!==this.currentValue&&(this.$nextTick(function(e){t.resizeTextarea()}),this.currentValue=e,this.validateEvent&&this.dispatch("ElFormItem","el.form.change",[e]))},calcIconOffset:function(e){var t={suf:"append",pre:"prepend"}[e];if(this.$slots[t])return{transform:"translateX("+("suf"===e?"-":"")+this.$el.querySelector(".el-input-group__"+t).offsetWidth+"px)"}},clear:function(){this.$emit("input",""),this.$emit("change",""),this.setCurrentValue(""),this.focus()}},created:function(){this.$on("inputSelect",this.inputSelect)},mounted:function(){this.resizeTextarea(),this.isGroup&&(this.prefixOffset=this.calcIconOffset("pre"),this.suffixOffset=this.calcIconOffset("suf"))}}},115:function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;o||(o=document.createElement("textarea"),document.body.appendChild(o));var s=function(e){var t=window.getComputedStyle(e),n=t.getPropertyValue("box-sizing"),o=parseFloat(t.getPropertyValue("padding-bottom"))+parseFloat(t.getPropertyValue("padding-top")),r=parseFloat(t.getPropertyValue("border-bottom-width"))+parseFloat(t.getPropertyValue("border-top-width"));return{contextStyle:i.map(function(e){return e+":"+t.getPropertyValue(e)}).join(";"),paddingSize:o,borderSize:r,boxSizing:n}}(e),a=s.paddingSize,l=s.borderSize,c=s.boxSizing,u=s.contextStyle;o.setAttribute("style",u+";"+r),o.value=e.value||e.placeholder||"";var f=o.scrollHeight,p={};"border-box"===c?f+=l:"content-box"===c&&(f-=a),o.value="";var d=o.scrollHeight-a;if(null!==t){var h=d*t;"border-box"===c&&(h=h+a+l),f=Math.max(h,f),p.minHeight=h+"px"}if(null!==n){var m=d*n;"border-box"===c&&(m=m+a+l),f=Math.min(m,f)}return p.height=f+"px",o.parentNode&&o.parentNode.removeChild(o),o=null,p};var o=void 0,r="\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n",i=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"]},116:function(e,t,n){"use strict";var o={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:["textarea"===e.type?"el-textarea":"el-input",e.inputSize?"el-input--"+e.inputSize:"",{"is-disabled":e.disabled,"el-input-group":e.$slots.prepend||e.$slots.append,"el-input-group--append":e.$slots.append,"el-input-group--prepend":e.$slots.prepend,"el-input--prefix":e.$slots.prefix||e.prefixIcon,"el-input--suffix":e.$slots.suffix||e.suffixIcon}],on:{mouseenter:function(t){e.hovering=!0},mouseleave:function(t){e.hovering=!1}}},["textarea"!==e.type?[e.$slots.prepend?n("div",{staticClass:"el-input-group__prepend",attrs:{tabindex:"0"}},[e._t("prepend")],2):e._e(),"textarea"!==e.type?n("input",e._b({ref:"input",staticClass:"el-input__inner",attrs:{tabindex:e.tabindex,autocomplete:e.autoComplete,"aria-label":e.label},domProps:{value:e.currentValue},on:{input:e.handleInput,focus:e.handleFocus,blur:e.handleBlur,change:e.handleChange}},"input",e.$props,!1)):e._e(),e.$slots.prefix||e.prefixIcon?n("span",{staticClass:"el-input__prefix",style:e.prefixOffset},[e._t("prefix"),e.prefixIcon?n("i",{staticClass:"el-input__icon",class:e.prefixIcon}):e._e()],2):e._e(),e.$slots.suffix||e.suffixIcon||e.showClear||e.validateState&&e.needStatusIcon?n("span",{staticClass:"el-input__suffix",style:e.suffixOffset},[n("span",{staticClass:"el-input__suffix-inner"},[e.showClear?n("i",{staticClass:"el-input__icon el-icon-circle-close el-input__clear",on:{click:e.clear}}):[e._t("suffix"),e.suffixIcon?n("i",{staticClass:"el-input__icon",class:e.suffixIcon}):e._e()]],2),e.validateState?n("i",{staticClass:"el-input__icon",class:["el-input__validateIcon",e.validateIcon]}):e._e()]):e._e(),e.$slots.append?n("div",{staticClass:"el-input-group__append"},[e._t("append")],2):e._e()]:n("textarea",e._b({ref:"textarea",staticClass:"el-textarea__inner",style:e.textareaStyle,attrs:{tabindex:e.tabindex,"aria-label":e.label},domProps:{value:e.currentValue},on:{input:e.handleInput,focus:e.handleFocus,blur:e.handleBlur,change:e.handleChange}},"textarea",e.$props,!1))],2)},staticRenderFns:[]};t.a=o},7:function(e,t){e.exports=n(25)},9:function(e,t){e.exports=n(10)}})},function(e,t){var n=e.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(e,t,n){var o=n(21);e.exports=function(e){if(!o(e))throw TypeError(e+" is not an object!");return e}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var o=n(69),r=n(45);e.exports=Object.keys||function(e){return o(e,r)}},function(e,t){var n=0,o=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+o).toString(36))}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var r=o(n(129)),i=o(n(141)),s="function"==typeof i.default&&"symbol"==typeof r.default?function(e){return typeof e}:function(e){return e&&"function"==typeof i.default&&e.constructor===i.default&&e!==i.default.prototype?"symbol":typeof e};t.default="function"==typeof i.default&&"symbol"===s(r.default)?function(e){return void 0===e?"undefined":s(e)}:function(e){return e&&"function"==typeof i.default&&e.constructor===i.default&&e!==i.default.prototype?"symbol":void 0===e?"undefined":s(e)}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(){if(o.default.prototype.$isServer)return 0;if(void 0!==r)return r;var e=document.createElement("div");e.className="el-scrollbar__wrap",e.style.visibility="hidden",e.style.width="100px",e.style.position="absolute",e.style.top="-9999px",document.body.appendChild(e);var t=e.offsetWidth;e.style.overflow="scroll";var n=document.createElement("div");n.style.width="100%",e.appendChild(n);var i=n.offsetWidth;return e.parentNode.removeChild(e),r=t-i};var o=function(e){return e&&e.__esModule?e:{default:e}}(n(4)),r=void 0},function(e,t,n){"use strict";function o(e,t,n){return function(){var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!(n&&n.context&&o.target&&r.target)||e.contains(o.target)||e.contains(r.target)||e===o.target||n.context.popperElm&&(n.context.popperElm.contains(o.target)||n.context.popperElm.contains(r.target))||(t.expression&&e[a].methodName&&n.context[e[a].methodName]?n.context[e[a].methodName]():e[a].bindingFn&&e[a].bindingFn())}}t.__esModule=!0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(4)),i=n(6),s=[],a="@@clickoutsideContext",l=void 0,c=0;!r.default.prototype.$isServer&&(0,i.on)(document,"mousedown",function(e){return l=e}),!r.default.prototype.$isServer&&(0,i.on)(document,"mouseup",function(e){s.forEach(function(t){return t[a].documentHandler(e,l)})}),t.default={bind:function(e,t,n){s.push(e);var r=c++;e[a]={id:r,documentHandler:o(e,t,n),methodName:t.expression,bindingFn:t.value}},update:function(e,t,n){e[a].documentHandler=o(e,t,n),e[a].methodName=t.expression,e[a].bindingFn=t.value},unbind:function(e){for(var t=s.length,n=0;n<t;n++)if(s[n][a].id===e[a].id){s.splice(n,1);break}delete e[a]}}},function(e,t,n){"use strict";t.__esModule=!0;var o="undefined"==typeof window,r=function(){if(!o){var e=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){return window.setTimeout(e,20)};return function(t){return e(t)}}}(),i=function(){if(!o){var e=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.clearTimeout;return function(t){return e(t)}}}(),s=function(e){var t=e.__resizeTrigger__,n=t.firstElementChild,o=t.lastElementChild,r=n.firstElementChild;o.scrollLeft=o.scrollWidth,o.scrollTop=o.scrollHeight,r.style.width=n.offsetWidth+1+"px",r.style.height=n.offsetHeight+1+"px",n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight},a=function(e){var t=this;s(this),this.__resizeRAF__&&i(this.__resizeRAF__),this.__resizeRAF__=r(function(){(function(e){return e.offsetWidth!==e.__resizeLast__.width||e.offsetHeight!==e.__resizeLast__.height})(t)&&(t.__resizeLast__.width=t.offsetWidth,t.__resizeLast__.height=t.offsetHeight,t.__resizeListeners__.forEach(function(n){n.call(t,e)}))})},l=o?{}:document.attachEvent,c="Webkit Moz O ms".split(" "),u="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),f=!1,p="",d="animationstart";if(!l&&!o){var h=document.createElement("fakeelement");if(void 0!==h.style.animationName&&(f=!0),!1===f)for(var m="",v=0;v<c.length;v++)if(void 0!==h.style[c[v]+"AnimationName"]){m=c[v],p="-"+m.toLowerCase()+"-",d=u[v],f=!0;break}}var g=!1;t.addResizeListener=function(e,t){if(!o)if(l)e.attachEvent("onresize",t);else{if(!e.__resizeTrigger__){"static"===getComputedStyle(e).position&&(e.style.position="relative"),function(){if(!g&&!o){var e="@"+p+"keyframes resizeanim { from { opacity: 0; } to { opacity: 0; } } \n .resize-triggers { "+p+'animation: 1ms resizeanim; visibility: hidden; opacity: 0; }\n .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1 }\n .resize-triggers > div { background: #eee; overflow: auto; }\n .contract-trigger:before { width: 200%; height: 200%; }',t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e)),t.appendChild(n),g=!0}}(),e.__resizeLast__={},e.__resizeListeners__=[];var n=e.__resizeTrigger__=document.createElement("div");n.className="resize-triggers",n.innerHTML='<div class="expand-trigger"><div></div></div><div class="contract-trigger"></div>',e.appendChild(n),s(e),e.addEventListener("scroll",a,!0),d&&n.addEventListener(d,function(t){"resizeanim"===t.animationName&&s(e)})}e.__resizeListeners__.push(t)}},t.removeResizeListener=function(e,t){e&&e.__resizeListeners__&&(l?e.detachEvent("onresize",t):(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||(e.removeEventListener("scroll",a),e.__resizeTrigger__=!e.removeChild(e.__resizeTrigger__))))}},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var o="fluentform",r={getGlobalSettings:o+"-global-settings",saveGlobalSettings:o+"-global-settings-store",getAllForms:o+"-forms",getForm:o+"-form-find",saveForm:o+"-form-store",updateForm:o+"-form-update",removeForm:o+"-form-delete",getElements:o+"-load-editor-components",getFormInputs:o+"-form-inputs",getFormSettings:o+"-settings-formSettings",getMailChimpSettings:o+"-get-form-mailchimp-settings",saveFormSettings:o+"-settings-formSettings-store",removeFormSettings:o+"-settings-formSettings-remove",loadEditorShortcodes:o+"-load-editor-shortcodes",getPages:o+"-get-pages"},i=r;t.b={install:function(e){e.prototype.$action=r}}},function(e,t,n){var o=n(9),r=n(28),i=n(123),s=n(14),a=function(e,t,n){var l,c,u,f=e&a.F,p=e&a.G,d=e&a.S,h=e&a.P,m=e&a.B,v=e&a.W,g=p?r:r[t]||(r[t]={}),b=g.prototype,_=p?o:d?o[t]:(o[t]||{}).prototype;p&&(n=t);for(l in n)(c=!f&&_&&void 0!==_[l])&&l in g||(u=c?_[l]:n[l],g[l]=p&&"function"!=typeof _[l]?n[l]:m&&c?i(u,o):v&&_[l]==u?function(e){var t=function(t,n,o){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,o)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(u):h&&"function"==typeof u?i(Function.call,u):u,h&&((g.virtual||(g.virtual={}))[l]=u,e&a.R&&b&&!b[l]&&s(b,l,u)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,e.exports=a},function(e,t,n){var o=n(21);e.exports=function(e,t){if(!o(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!o(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!o(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!o(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t){var n=Math.ceil,o=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?o:n)(e)}},function(e,t,n){var o=n(44)("keys"),r=n(32);e.exports=function(e){return o[e]||(o[e]=r(e))}},function(e,t,n){var o=n(9),r=o["__core-js_shared__"]||(o["__core-js_shared__"]={});e.exports=function(e){return r[e]||(r[e]={})}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t){e.exports=!0},function(e,t){e.exports={}},function(e,t,n){var o=n(15).f,r=n(11),i=n(18)("toStringTag");e.exports=function(e,t,n){e&&!r(e=n?e:e.prototype,i)&&o(e,i,{configurable:!0,value:t})}},function(e,t,n){t.f=n(18)},function(e,t,n){var o=n(9),r=n(28),i=n(47),s=n(50),a=n(15).f;e.exports=function(e){var t=r.Symbol||(r.Symbol=i?{}:o.Symbol||{});"_"==e.charAt(0)||e in t||a(t,e,{value:s.f(e)})}},function(e,t){e.exports=function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=173)}({0:function(e,t){e.exports=function(e,t,n,o,r,i){var s,a=e=e||{},l=typeof e.default;"object"!==l&&"function"!==l||(s=e,a=e.default);var c="function"==typeof a?a.options:a;t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId=r);var u;if(i?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},c._ssrRegister=u):o&&(u=o),u){var f=c.functional,p=f?c.render:c.beforeCreate;f?(c._injectStyles=u,c.render=function(e,t){return u.call(t),p(e,t)}):c.beforeCreate=p?[].concat(p,u):[u]}return{esModule:s,exports:a,options:c}}},173:function(e,t,n){e.exports=n(174)},174:function(e,t,n){"use strict";t.__esModule=!0;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(175));o.default.install=function(e){e.component(o.default.name,o.default)},t.default=o.default},175:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(176),r=n.n(o),i=n(177),s=n(0)(r.a,i.a,!1,null,null,null);t.default=s.exports},176:function(e,t,n){"use strict";t.__esModule=!0,t.default={name:"ElButton",inject:{elFormItem:{default:""}},props:{type:{type:String,default:"default"},size:String,icon:{type:String,default:""},nativeType:{type:String,default:"button"},loading:Boolean,disabled:Boolean,plain:Boolean,autofocus:Boolean,round:Boolean},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},buttonSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size}},methods:{handleClick:function(e){this.$emit("click",e)},handleInnerClick:function(e){this.disabled&&e.stopPropagation()}}}},177:function(e,t,n){"use strict";var o={render:function(){var e=this.$createElement,t=this._self._c||e;return t("button",{staticClass:"el-button",class:[this.type?"el-button--"+this.type:"",this.buttonSize?"el-button--"+this.buttonSize:"",{"is-disabled":this.disabled,"is-loading":this.loading,"is-plain":this.plain,"is-round":this.round}],attrs:{disabled:this.disabled,autofocus:this.autofocus,type:this.nativeType},on:{click:this.handleClick}},[this.loading?t("i",{staticClass:"el-icon-loading",on:{click:this.handleInnerClick}}):this._e(),this.icon&&!this.loading?t("i",{class:this.icon,on:{click:this.handleInnerClick}}):this._e(),this.$slots.default?t("span",{on:{click:this.handleInnerClick}},[this._t("default")],2):this._e()])},staticRenderFns:[]};t.a=o}})},function(e,t){e.exports=function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=280)}({0:function(e,t){e.exports=function(e,t,n,o,r,i){var s,a=e=e||{},l=typeof e.default;"object"!==l&&"function"!==l||(s=e,a=e.default);var c="function"==typeof a?a.options:a;t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId=r);var u;if(i?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},c._ssrRegister=u):o&&(u=o),u){var f=c.functional,p=f?c.render:c.beforeCreate;f?(c._injectStyles=u,c.render=function(e,t){return u.call(t),p(e,t)}):c.beforeCreate=p?[].concat(p,u):[u]}return{esModule:s,exports:a,options:c}}},280:function(e,t,n){e.exports=n(281)},281:function(e,t,n){"use strict";t.__esModule=!0;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(282));o.default.install=function(e){e.component(o.default.name,o.default)},t.default=o.default},282:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(283),r=n.n(o),i=n(284),s=n(0)(r.a,i.a,!1,null,null,null);t.default=s.exports},283:function(e,t,n){"use strict";t.__esModule=!0,t.default={name:"ElTag",props:{text:String,closable:Boolean,type:String,hit:Boolean,disableTransitions:Boolean,color:String,size:String},methods:{handleClose:function(e){this.$emit("close",e)}},computed:{tagSize:function(){return this.size||(this.$ELEMENT||{}).size}}}},284:function(e,t,n){"use strict";var o={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:e.disableTransitions?"":"el-zoom-in-center"}},[n("span",{staticClass:"el-tag",class:[e.type?"el-tag--"+e.type:"",e.tagSize&&"el-tag--"+e.tagSize,{"is-hit":e.hit}],style:{backgroundColor:e.color}},[e._t("default"),e.closable?n("i",{staticClass:"el-tag__close el-icon-close",on:{click:function(t){t.stopPropagation(),e.handleClose(t)}}}):e._e()],2)])},staticRenderFns:[]};t.a=o}})},function(e,t,n){"use strict";t.__esModule=!0;var o=n(23);t.default={methods:{t:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return o.t.apply(this,t)}}}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){return{methods:{focus:function(){this.$refs[e].focus()}}}}},function(e,t){e.exports="../fonts/vendor/element-ui/lib/theme-chalk/element-icons.woff?2fad952a20fbbcfd1bf2ebb210dccf7a"},function(e,t){e.exports="../fonts/vendor/element-ui/lib/theme-chalk/element-icons.ttf?6f0a76321d30f3c8120915e57f7bd77e"},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,o=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var r=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});if(/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(r))return e;var i;return i=0===r.indexOf("//")?r:0===r.indexOf("/")?n+r:o+r.replace(/^\.\//,""),"url("+JSON.stringify(i)+")"})}},function(e,t,n){function o(e,t){this._id=e,this._clearFn=t}var r=Function.prototype.apply;t.setTimeout=function(){return new o(r.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new o(r.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(60),t.setImmediate=setImmediate,t.clearImmediate=clearImmediate},function(e,t,n){(function(e,t){!function(e,n){"use strict";function o(e){delete a[e]}function r(e){if(l)setTimeout(r,0,e);else{var t=a[e];if(t){l=!0;try{!function(e){var t=e.callback,o=e.args;switch(o.length){case 0:t();break;case 1:t(o[0]);break;case 2:t(o[0],o[1]);break;case 3:t(o[0],o[1],o[2]);break;default:t.apply(n,o)}}(t)}finally{o(e),l=!1}}}}if(!e.setImmediate){var i,s=1,a={},l=!1,c=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,"[object process]"==={}.toString.call(e.process)?i=function(e){t.nextTick(function(){r(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?function(){var t="setImmediate$"+Math.random()+"$",n=function(n){n.source===e&&"string"==typeof n.data&&0===n.data.indexOf(t)&&r(+n.data.slice(t.length))};e.addEventListener?e.addEventListener("message",n,!1):e.attachEvent("onmessage",n),i=function(n){e.postMessage(t+n,"*")}}():e.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){r(e.data)},i=function(t){e.port2.postMessage(t)}}():c&&"onreadystatechange"in c.createElement("script")?function(){var e=c.documentElement;i=function(t){var n=c.createElement("script");n.onreadystatechange=function(){r(t),n.onreadystatechange=null,e.removeChild(n),n=null},e.appendChild(n)}}():i=function(e){setTimeout(r,0,e)},u.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var o={callback:e,args:t};return a[s]=o,i(s),s++},u.clearImmediate=o}}("undefined"==typeof self?void 0===e?this:e:self)}).call(t,n(13),n(61))},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function r(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function i(){h&&p&&(h=!1,p.length?d=p.concat(d):m=-1,d.length&&s())}function s(){if(!h){var e=r(i);h=!0;for(var t=d.length;t;){for(p=d,d=[];++m<t;)p&&p[m].run();m=-1,t=d.length}p=null,h=!1,function(e){if(u===clearTimeout)return clearTimeout(e);if((u===o||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(e);try{u(e)}catch(t){try{return u.call(null,e)}catch(t){return u.call(this,e)}}}(e)}}function a(e,t){this.fun=e,this.array=t}function l(){}var c,u,f=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(e){c=n}try{u="function"==typeof clearTimeout?clearTimeout:o}catch(e){u=o}}();var p,d=[],h=!1,m=-1;f.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];d.push(new a(e,t)),1!==d.length||h||r(s)},a.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=l,f.addListener=l,f.once=l,f.off=l,f.removeListener=l,f.removeAllListeners=l,f.emit=l,f.prependListener=l,f.prependOnceListener=l,f.listeners=function(e){return[]},f.binding=function(e){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(e){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(e,t,n){"use strict";t.__esModule=!0,t.default={el:{colorpicker:{confirm:"OK",clear:"Clear"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:""},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"}}}},function(e,t){e.exports=function(e,t){for(var n=[],o={},r=0;r<t.length;r++){var i=t[r],s=i[0],a={id:e+":"+r,css:i[1],media:i[2],sourceMap:i[3]};o[s]?o[s].parts.push(a):n.push(o[s]={id:s,parts:[a]})}return n}},function(e,t){e.exports=function(e,t,n,o){var r,i=0;return"boolean"!=typeof t&&(o=n,n=t,t=void 0),function(){function s(){i=Number(new Date),n.apply(l,u)}function a(){r=void 0}var l=this,c=Number(new Date)-i,u=arguments;o&&!r&&s(),r&&clearTimeout(r),void 0===o&&c>e?s():!0!==t&&(r=setTimeout(o?a:s,void 0===o?e-c:e))}}},function(e,t,n){e.exports=function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=235)}({12:function(e,t){e.exports=n(26)},2:function(e,t){e.exports=n(6)},20:function(e,t){e.exports=n(24)},235:function(e,t,n){e.exports=n(236)},236:function(e,t,n){"use strict";t.__esModule=!0;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(237));o.default.install=function(e){e.component(o.default.name,o.default)},t.default=o.default},237:function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var r=o(n(8)),i=o(n(12)),s=n(2),a=n(20),l=n(3),c=o(n(5));t.default={name:"ElTooltip",mixins:[r.default],props:{openDelay:{type:Number,default:0},disabled:Boolean,manual:Boolean,effect:{type:String,default:"dark"},popperClass:String,content:String,visibleArrow:{default:!0},transition:{type:String,default:"el-fade-in-linear"},popperOptions:{default:function(){return{boundariesPadding:10,gpuAcceleration:!1}}},enterable:{type:Boolean,default:!0},hideAfter:{type:Number,default:0}},data:function(){return{timeoutPending:null,focusing:!1}},computed:{tooltipId:function(){return"el-tooltip-"+(0,l.generateId)()}},beforeCreate:function(){var e=this;this.$isServer||(this.popperVM=new c.default({data:{node:""},render:function(e){return this.node}}).$mount(),this.debounceClose=(0,i.default)(200,function(){return e.handleClosePopper()}))},render:function(e){var t=this;if(this.popperVM&&(this.popperVM.node=e("transition",{attrs:{name:this.transition},on:{afterLeave:this.doDestroy}},[e("div",{on:{mouseleave:function(){t.setExpectedState(!1),t.debounceClose()},mouseenter:function(){t.setExpectedState(!0)}},ref:"popper",attrs:{role:"tooltip",id:this.tooltipId,"aria-hidden":this.disabled||!this.showPopper?"true":"false"},directives:[{name:"show",value:!this.disabled&&this.showPopper}],class:["el-tooltip__popper","is-"+this.effect,this.popperClass]},[this.$slots.content||this.content])])),!this.$slots.default||!this.$slots.default.length)return this.$slots.default;var n=(0,a.getFirstComponentChild)(this.$slots.default);if(!n)return n;var o=n.data=n.data||{},r=n.data.on=n.data.on||{},i=n.data.nativeOn=n.data.nativeOn||{};return o.staticClass=this.concatClass(o.staticClass,"el-tooltip"),i.mouseenter=r.mouseenter=this.addEventHandle(r.mouseenter,this.show),i.mouseleave=r.mouseleave=this.addEventHandle(r.mouseleave,this.hide),i.focus=r.focus=this.addEventHandle(r.focus,this.handleFocus),i.blur=r.blur=this.addEventHandle(r.blur,this.handleBlur),i.click=r.click=this.addEventHandle(r.click,function(){t.focusing=!1}),n},mounted:function(){this.referenceElm=this.$el,1===this.$el.nodeType&&(this.$el.setAttribute("aria-describedby",this.tooltipId),this.$el.setAttribute("tabindex",0))},watch:{focusing:function(e){e?(0,s.addClass)(this.referenceElm,"focusing"):(0,s.removeClass)(this.referenceElm,"focusing")}},methods:{show:function(){this.setExpectedState(!0),this.handleShowPopper()},hide:function(){this.setExpectedState(!1),this.debounceClose()},handleFocus:function(){this.focusing=!0,this.show()},handleBlur:function(){this.focusing=!1,this.hide()},addEventHandle:function(e,t){return e?Array.isArray(e)?e.indexOf(t)>-1?e:e.concat(t):e===t?e:[e,t]:t},concatClass:function(e,t){return e&&e.indexOf(t)>-1?e:e?t?e+" "+t:e:t||""},handleShowPopper:function(){var e=this;this.expectedState&&!this.manual&&(clearTimeout(this.timeout),this.timeout=setTimeout(function(){e.showPopper=!0},this.openDelay),this.hideAfter>0&&(this.timeoutPending=setTimeout(function(){e.showPopper=!1},this.hideAfter)))},handleClosePopper:function(){this.enterable&&this.expectedState||this.manual||(clearTimeout(this.timeout),this.timeoutPending&&clearTimeout(this.timeoutPending),this.showPopper=!1)},setExpectedState:function(e){!1===e&&clearTimeout(this.timeoutPending),this.expectedState=e}}}},3:function(e,t){e.exports=n(5)},5:function(e,t){e.exports=n(4)},8:function(e,t){e.exports=n(12)}})},function(e,t,n){"use strict";t.__esModule=!0;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(120));t.default=o.default||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}},function(e,t,n){e.exports=!n(16)&&!n(22)(function(){return 7!=Object.defineProperty(n(68)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var o=n(21),r=n(9).document,i=o(r)&&o(r.createElement);e.exports=function(e){return i?r.createElement(e):{}}},function(e,t,n){var o=n(11),r=n(17),i=n(126)(!1),s=n(43)("IE_PROTO");e.exports=function(e,t){var n,a=r(e),l=0,c=[];for(n in a)n!=s&&o(a,n)&&c.push(n);for(;t.length>l;)o(a,n=t[l++])&&(~i(c,n)||c.push(n));return c}},function(e,t,n){var o=n(71);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==o(e)?e.split(""):Object(e)}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var o=n(41);e.exports=function(e){return Object(o(e))}},function(e,t,n){"use strict";var o=n(47),r=n(39),i=n(74),s=n(14),a=n(11),l=n(48),c=n(133),u=n(49),f=n(136),p=n(18)("iterator"),d=!([].keys&&"next"in[].keys()),h=function(){return this};e.exports=function(e,t,n,m,v,g,b){c(n,t,m);var _,y,x,w=function(e){if(!d&&e in $)return $[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},k=t+" Iterator",C="values"==v,S=!1,$=e.prototype,O=$[p]||$["@@iterator"]||v&&$[v],E=!d&&O||w(v),T=v?C?w("entries"):E:void 0,M="Array"==t?$.entries||O:O;if(M&&(x=f(M.call(new e)))!==Object.prototype&&x.next&&(u(x,k,!0),o||a(x,p)||s(x,p,h)),C&&O&&"values"!==O.name&&(S=!0,E=function(){return O.call(this)}),o&&!b||!d&&!S&&$[p]||s($,p,E),l[t]=E,l[k]=h,v)if(_={values:C?E:w("values"),keys:g?E:w("keys"),entries:T},b)for(y in _)y in $||i($,y,_[y]);else r(r.P+r.F*(d||S),t,_);return _}},function(e,t,n){e.exports=n(14)},function(e,t,n){var o=n(29),r=n(134),i=n(45),s=n(43)("IE_PROTO"),a=function(){},l=function(){var e,t=n(68)("iframe"),o=i.length;for(t.style.display="none",n(135).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),l=e.F;o--;)delete l.prototype[i[o]];return l()};e.exports=Object.create||function(e,t){var n;return null!==e?(a.prototype=o(e),n=new a,a.prototype=null,n[s]=e):n=l(),void 0===t?n:r(n,t)}},function(e,t,n){var o=n(69),r=n(45).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return o(e,r)}},function(e,t,n){e.exports=function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=166)}({0:function(e,t){e.exports=function(e,t,n,o,r,i){var s,a=e=e||{},l=typeof e.default;"object"!==l&&"function"!==l||(s=e,a=e.default);var c="function"==typeof a?a.options:a;t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId=r);var u;if(i?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},c._ssrRegister=u):o&&(u=o),u){var f=c.functional,p=f?c.render:c.beforeCreate;f?(c._injectStyles=u,c.render=function(e,t){return u.call(t),p(e,t)}):c.beforeCreate=p?[].concat(p,u):[u]}return{esModule:s,exports:a,options:c}}},1:function(e,t){e.exports=n(7)},166:function(e,t,n){e.exports=n(167)},167:function(e,t,n){"use strict";t.__esModule=!0;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(33));o.default.install=function(e){e.component(o.default.name,o.default)},t.default=o.default},3:function(e,t){e.exports=n(5)},33:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(34),r=n.n(o),i=n(35),s=n(0)(r.a,i.a,!1,null,null,null);t.default=s.exports},34:function(e,t,n){"use strict";t.__esModule=!0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=function(e){return e&&e.__esModule?e:{default:e}}(n(1)),i=n(3);t.default={mixins:[r.default],name:"ElOption",componentName:"ElOption",inject:["select"],props:{value:{required:!0},label:[String,Number],created:Boolean,disabled:{type:Boolean,default:!1}},data:function(){return{index:-1,groupDisabled:!1,visible:!0,hitState:!1,hover:!1}},computed:{isObject:function(){return"[object object]"===Object.prototype.toString.call(this.value).toLowerCase()},currentLabel:function(){return this.label||(this.isObject?"":this.value)},currentValue:function(){return this.value||this.label||""},itemSelected:function(){return this.select.multiple?this.contains(this.select.value,this.value):this.isEqual(this.value,this.select.value)},limitReached:function(){return!!this.select.multiple&&(!this.itemSelected&&(this.select.value||[]).length>=this.select.multipleLimit&&this.select.multipleLimit>0)}},watch:{currentLabel:function(){this.created||this.select.remote||this.dispatch("ElSelect","setSelected")},value:function(){this.created||this.select.remote||this.dispatch("ElSelect","setSelected")}},methods:{isEqual:function(e,t){if(this.isObject){var n=this.select.valueKey;return(0,i.getValueByPath)(e,n)===(0,i.getValueByPath)(t,n)}return e===t},contains:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments[1];if(!this.isObject)return t.indexOf(n)>-1;var r=function(){var o=e.select.valueKey;return{v:t.some(function(e){return(0,i.getValueByPath)(e,o)===(0,i.getValueByPath)(n,o)})}}();return"object"===(void 0===r?"undefined":o(r))?r.v:void 0},handleGroupDisabled:function(e){this.groupDisabled=e},hoverItem:function(){this.disabled||this.groupDisabled||(this.select.hoverIndex=this.select.options.indexOf(this))},selectOptionClick:function(){!0!==this.disabled&&!0!==this.groupDisabled&&this.dispatch("ElSelect","handleOptionClick",this)},queryChange:function(e){var t=String(e).replace(/(\^|\(|\)|\[|\]|\$|\*|\+|\.|\?|\\|\{|\}|\|)/g,"\\$1");this.visible=new RegExp(t,"i").test(this.currentLabel)||this.created,this.visible||this.select.filteredOptionsCount--}},created:function(){this.select.options.push(this),this.select.cachedOptions.push(this),this.select.optionsCount++,this.select.filteredOptionsCount++,this.$on("queryChange",this.queryChange),this.$on("handleGroupDisabled",this.handleGroupDisabled)},beforeDestroy:function(){this.select.onOptionDestroy(this.select.options.indexOf(this))}}},35:function(e,t,n){"use strict";var o={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("li",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-select-dropdown__item",class:{selected:e.itemSelected,"is-disabled":e.disabled||e.groupDisabled||e.limitReached,hover:e.hover},on:{mouseenter:e.hoverItem,click:function(t){t.stopPropagation(),e.selectOptionClick(t)}}},[e._t("default",[n("span",[e._v(e._s(e.currentLabel))])])],2)},staticRenderFns:[]};t.a=o}})},,function(e,t,n){e.exports=function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=392)}({19:function(e,t){e.exports=n(37)},2:function(e,t){e.exports=n(6)},3:function(e,t){e.exports=n(5)},38:function(e,t){e.exports=n(35)},392:function(e,t,n){e.exports=n(393)},393:function(e,t,n){"use strict";t.__esModule=!0;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(394));o.default.install=function(e){e.component(o.default.name,o.default)},t.default=o.default},394:function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var r=n(19),i=o(n(38)),s=n(3),a=o(n(395));t.default={name:"ElScrollbar",components:{Bar:a.default},props:{native:Boolean,wrapStyle:{},wrapClass:{},viewClass:{},viewStyle:{},noresize:Boolean,tag:{type:String,default:"div"}},data:function(){return{sizeWidth:"0",sizeHeight:"0",moveX:0,moveY:0}},computed:{wrap:function(){return this.$refs.wrap}},render:function(e){var t=(0,i.default)(),n=this.wrapStyle;if(t){var o="-"+t+"px",r="margin-bottom: "+o+"; margin-right: "+o+";";Array.isArray(this.wrapStyle)?(n=(0,s.toObject)(this.wrapStyle)).marginRight=n.marginBottom=o:"string"==typeof this.wrapStyle?n+=r:n=r}var l=e(this.tag,{class:["el-scrollbar__view",this.viewClass],style:this.viewStyle,ref:"resize"},this.$slots.default),c=e("div",{ref:"wrap",style:n,on:{scroll:this.handleScroll},class:[this.wrapClass,"el-scrollbar__wrap",t?"":"el-scrollbar__wrap--hidden-default"]},[[l]]),u=void 0;return u=this.native?[e("div",{ref:"wrap",class:[this.wrapClass,"el-scrollbar__wrap"],style:n},[[l]])]:[c,e(a.default,{attrs:{move:this.moveX,size:this.sizeWidth}},[]),e(a.default,{attrs:{vertical:!0,move:this.moveY,size:this.sizeHeight}},[])],e("div",{class:"el-scrollbar"},u)},methods:{handleScroll:function(){var e=this.wrap;this.moveY=100*e.scrollTop/e.clientHeight,this.moveX=100*e.scrollLeft/e.clientWidth},update:function(){var e=void 0,t=void 0,n=this.wrap;n&&(e=100*n.clientHeight/n.scrollHeight,t=100*n.clientWidth/n.scrollWidth,this.sizeHeight=e<100?e+"%":"",this.sizeWidth=t<100?t+"%":"")}},mounted:function(){this.native||(this.$nextTick(this.update),!this.noresize&&(0,r.addResizeListener)(this.$refs.resize,this.update))},beforeDestroy:function(){this.native||!this.noresize&&(0,r.removeResizeListener)(this.$refs.resize,this.update)}}},395:function(e,t,n){"use strict";t.__esModule=!0;var o=n(2),r=n(396);t.default={name:"Bar",props:{vertical:Boolean,size:String,move:Number},computed:{bar:function(){return r.BAR_MAP[this.vertical?"vertical":"horizontal"]},wrap:function(){return this.$parent.wrap}},render:function(e){var t=this.size,n=this.move,o=this.bar;return e("div",{class:["el-scrollbar__bar","is-"+o.key],on:{mousedown:this.clickTrackHandler}},[e("div",{ref:"thumb",class:"el-scrollbar__thumb",on:{mousedown:this.clickThumbHandler},style:(0,r.renderThumbStyle)({size:t,move:n,bar:o})},[])])},methods:{clickThumbHandler:function(e){this.startDrag(e),this[this.bar.axis]=e.currentTarget[this.bar.offset]-(e[this.bar.client]-e.currentTarget.getBoundingClientRect()[this.bar.direction])},clickTrackHandler:function(e){var t=100*(Math.abs(e.target.getBoundingClientRect()[this.bar.direction]-e[this.bar.client])-this.$refs.thumb[this.bar.offset]/2)/this.$el[this.bar.offset];this.wrap[this.bar.scroll]=t*this.wrap[this.bar.scrollSize]/100},startDrag:function(e){e.stopImmediatePropagation(),this.cursorDown=!0,(0,o.on)(document,"mousemove",this.mouseMoveDocumentHandler),(0,o.on)(document,"mouseup",this.mouseUpDocumentHandler),document.onselectstart=function(){return!1}},mouseMoveDocumentHandler:function(e){if(!1!==this.cursorDown){var t=this[this.bar.axis];if(t){var n=100*(-1*(this.$el.getBoundingClientRect()[this.bar.direction]-e[this.bar.client])-(this.$refs.thumb[this.bar.offset]-t))/this.$el[this.bar.offset];this.wrap[this.bar.scroll]=n*this.wrap[this.bar.scrollSize]/100}}},mouseUpDocumentHandler:function(e){this.cursorDown=!1,this[this.bar.axis]=0,(0,o.off)(document,"mousemove",this.mouseMoveDocumentHandler),document.onselectstart=null}},destroyed:function(){(0,o.off)(document,"mouseup",this.mouseUpDocumentHandler)}}},396:function(e,t,n){"use strict";t.__esModule=!0,t.renderThumbStyle=function(e){var t=e.move,n=e.size,o=e.bar,r={},i="translate"+o.axis+"("+t+"%)";return r[o.size]=n,r.transform=i,r.msTransform=i,r.webkitTransform=i,r};t.BAR_MAP={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}}}})},function(e,t,n){e.exports=function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=157)}({0:function(e,t){e.exports=function(e,t,n,o,r,i){var s,a=e=e||{},l=typeof e.default;"object"!==l&&"function"!==l||(s=e,a=e.default);var c="function"==typeof a?a.options:a;t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId=r);var u;if(i?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},c._ssrRegister=u):o&&(u=o),u){var f=c.functional,p=f?c.render:c.beforeCreate;f?(c._injectStyles=u,c.render=function(e,t){return u.call(t),p(e,t)}):c.beforeCreate=p?[].concat(p,u):[u]}return{esModule:s,exports:a,options:c}}},1:function(e,t){e.exports=n(7)},10:function(e,t){e.exports=n(36)},12:function(e,t){e.exports=n(26)},13:function(e,t){e.exports=n(55)},14:function(e,t){e.exports=n(23)},157:function(e,t,n){e.exports=n(158)},158:function(e,t,n){"use strict";t.__esModule=!0;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(159));o.default.install=function(e){e.component(o.default.name,o.default)},t.default=o.default},159:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(160),r=n.n(o),i=n(165),s=n(0)(r.a,i.a,!1,null,null,null);t.default=s.exports},160:function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=o(n(1)),s=o(n(13)),a=o(n(4)),l=o(n(6)),c=o(n(161)),u=o(n(33)),f=o(n(24)),p=o(n(18)),d=o(n(12)),h=o(n(10)),m=n(2),v=n(19),g=n(14),b=o(n(25)),_=n(3),y=o(n(164)),x={medium:36,small:32,mini:28};t.default={mixins:[i.default,a.default,(0,s.default)("reference"),y.default],name:"ElSelect",componentName:"ElSelect",inject:{elFormItem:{default:""}},provide:function(){return{select:this}},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},iconClass:function(){return this.clearable&&!this.disabled&&this.inputHovering&&!this.multiple&&void 0!==this.value&&""!==this.value?"circle-close is-show-close":this.remote&&this.filterable?"":"arrow-up"},debounce:function(){return this.remote?300:0},emptyText:function(){return this.loading?this.loadingText||this.t("el.select.loading"):(!this.remote||""!==this.query||0!==this.options.length)&&(this.filterable&&this.query&&this.options.length>0&&0===this.filteredOptionsCount?this.noMatchText||this.t("el.select.noMatch"):0===this.options.length?this.noDataText||this.t("el.select.noData"):null)},showNewOption:function(){var e=this,t=this.options.filter(function(e){return!e.created}).some(function(t){return t.currentLabel===e.query});return this.filterable&&this.allowCreate&&""!==this.query&&!t},selectSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},collapseTagSize:function(){return["small","mini"].indexOf(this.selectSize)>-1?"mini":"small"}},components:{ElInput:l.default,ElSelectMenu:c.default,ElOption:u.default,ElTag:f.default,ElScrollbar:p.default},directives:{Clickoutside:h.default},props:{name:String,id:String,value:{required:!0},size:String,disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:String,remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String,default:function(){return(0,g.t)("el.select.placeholder")}},defaultFirstOption:Boolean,reserveKeyword:Boolean,valueKey:{type:String,default:"value"},collapseTags:Boolean},data:function(){return{options:[],cachedOptions:[],createdLabel:null,createdSelected:!1,selected:this.multiple?[]:{},inputLength:20,inputWidth:0,cachedPlaceHolder:"",optionsCount:0,filteredOptionsCount:0,visible:!1,selectedLabel:"",hoverIndex:-1,query:"",previousQuery:"",inputHovering:!1,currentPlaceholder:""}},watch:{disabled:function(){var e=this;this.$nextTick(function(){e.resetInputHeight()})},placeholder:function(e){this.cachedPlaceHolder=this.currentPlaceholder=e},value:function(e){this.multiple&&(this.resetInputHeight(),e.length>0||this.$refs.input&&""!==this.query?this.currentPlaceholder="":this.currentPlaceholder=this.cachedPlaceHolder,this.filterable&&!this.reserveKeyword&&(this.query="",this.handleQueryChange(this.query))),this.setSelected(),this.filterable&&!this.multiple&&(this.inputLength=20)},visible:function(e){var t=this;e?(this.handleIconShow(),this.broadcast("ElSelectDropdown","updatePopper"),this.filterable&&(this.query=this.remote?"":this.selectedLabel,this.handleQueryChange(this.query),this.multiple?this.$refs.input.focus():(this.remote||(this.broadcast("ElOption","queryChange",""),this.broadcast("ElOptionGroup","queryChange")),this.broadcast("ElInput","inputSelect")))):(this.$refs.reference.$el.querySelector("input").blur(),this.handleIconHide(),this.broadcast("ElSelectDropdown","destroyPopper"),this.$refs.input&&this.$refs.input.blur(),this.query="",this.selectedLabel="",this.inputLength=20,this.resetHoverIndex(),this.$nextTick(function(){t.$refs.input&&""===t.$refs.input.value&&0===t.selected.length&&(t.currentPlaceholder=t.cachedPlaceHolder)}),this.multiple||this.selected&&(this.filterable&&this.allowCreate&&this.createdSelected&&this.createdOption?this.selectedLabel=this.createdLabel:this.selectedLabel=this.selected.currentLabel,this.filterable&&(this.query=this.selectedLabel))),this.$emit("visible-change",e)},options:function(){if(!this.$isServer){this.multiple&&this.resetInputHeight();var e=this.$el.querySelectorAll("input");-1===[].indexOf.call(e,document.activeElement)&&this.setSelected(),this.defaultFirstOption&&(this.filterable||this.remote)&&this.filteredOptionsCount&&this.checkDefaultFirstOption()}}},methods:{handleQueryChange:function(e){var t=this;if(this.previousQuery!==e){if(this.previousQuery=e,this.$nextTick(function(){t.visible&&t.broadcast("ElSelectDropdown","updatePopper")}),this.hoverIndex=-1,this.multiple&&this.filterable){var n=15*this.$refs.input.value.length+20;this.inputLength=this.collapseTags?Math.min(50,n):n,this.managePlaceholder(),this.resetInputHeight()}this.remote&&"function"==typeof this.remoteMethod?(this.hoverIndex=-1,this.remoteMethod(e)):"function"==typeof this.filterMethod?(this.filterMethod(e),this.broadcast("ElOptionGroup","queryChange")):(this.filteredOptionsCount=this.optionsCount,this.broadcast("ElOption","queryChange",e),this.broadcast("ElOptionGroup","queryChange")),this.defaultFirstOption&&(this.filterable||this.remote)&&this.filteredOptionsCount&&this.checkDefaultFirstOption()}},handleIconHide:function(){var e=this.$el.querySelector(".el-input__icon");e&&(0,m.removeClass)(e,"is-reverse")},handleIconShow:function(){var e=this.$el.querySelector(".el-input__icon");e&&!(0,m.hasClass)(e,"el-icon-circle-close")&&(0,m.addClass)(e,"is-reverse")},scrollToOption:function(e){var t=Array.isArray(e)&&e[0]?e[0].$el:e.$el;if(this.$refs.popper&&t){var n=this.$refs.popper.$el.querySelector(".el-select-dropdown__wrap");(0,b.default)(n,t)}this.$refs.scrollbar&&this.$refs.scrollbar.handleScroll()},handleMenuEnter:function(){var e=this;this.$nextTick(function(){return e.scrollToOption(e.selected)})},emitChange:function(e){(0,_.valueEquals)(this.value,e)||(this.$emit("change",e),this.dispatch("ElFormItem","el.form.change",e))},getOption:function(e){for(var t=void 0,n="[object object]"===Object.prototype.toString.call(e).toLowerCase(),o=this.cachedOptions.length-1;o>=0;o--){var r=this.cachedOptions[o];if(n?(0,_.getValueByPath)(r.value,this.valueKey)===(0,_.getValueByPath)(e,this.valueKey):r.value===e){t=r;break}}if(t)return t;var i={value:e,currentLabel:n?"":e};return this.multiple&&(i.hitState=!1),i},setSelected:function(){var e=this;if(!this.multiple){var t=this.getOption(this.value);return t.created?(this.createdLabel=t.currentLabel,this.createdSelected=!0):this.createdSelected=!1,this.selectedLabel=t.currentLabel,this.selected=t,void(this.filterable&&(this.query=this.selectedLabel))}var n=[];Array.isArray(this.value)&&this.value.forEach(function(t){n.push(e.getOption(t))}),this.selected=n,this.$nextTick(function(){e.resetInputHeight()})},handleFocus:function(e){this.visible=!0,this.$emit("focus",e)},handleBlur:function(e){this.$emit("blur",e)},handleIconClick:function(e){this.iconClass.indexOf("circle-close")>-1?this.deleteSelected(e):this.toggleMenu()},handleMouseDown:function(e){"INPUT"===e.target.tagName&&this.visible&&(this.handleClose(),e.preventDefault())},doDestroy:function(){this.$refs.popper&&this.$refs.popper.doDestroy()},handleClose:function(){this.visible=!1},toggleLastOptionHitState:function(e){if(Array.isArray(this.selected)){var t=this.selected[this.selected.length-1];if(t)return!0===e||!1===e?(t.hitState=e,e):(t.hitState=!t.hitState,t.hitState)}},deletePrevTag:function(e){if(e.target.value.length<=0&&!this.toggleLastOptionHitState()){var t=this.value.slice();t.pop(),this.$emit("input",t),this.emitChange(t)}},managePlaceholder:function(){""!==this.currentPlaceholder&&(this.currentPlaceholder=this.$refs.input.value?"":this.cachedPlaceHolder)},resetInputState:function(e){8!==e.keyCode&&this.toggleLastOptionHitState(!1),this.inputLength=15*this.$refs.input.value.length+20,this.resetInputHeight()},resetInputHeight:function(){var e=this;this.collapseTags||this.$nextTick(function(){if(e.$refs.reference){var t=e.$refs.reference.$el.childNodes,n=[].filter.call(t,function(e){return"INPUT"===e.tagName})[0],o=e.$refs.tags;n.style.height=0===e.selected.length?(x[e.selectSize]||40)+"px":Math.max(o?o.clientHeight+10:0,x[e.selectSize]||40)+"px",e.visible&&!1!==e.emptyText&&e.broadcast("ElSelectDropdown","updatePopper")}})},resetHoverIndex:function(){var e=this;setTimeout(function(){e.multiple?e.selected.length>0?e.hoverIndex=Math.min.apply(null,e.selected.map(function(t){return e.options.indexOf(t)})):e.hoverIndex=-1:e.hoverIndex=e.options.indexOf(e.selected)},300)},handleOptionSelect:function(e){var t=this;if(this.multiple){var n=this.value.slice(),o=this.getValueIndex(n,e.value);o>-1?n.splice(o,1):(this.multipleLimit<=0||n.length<this.multipleLimit)&&n.push(e.value),this.$emit("input",n),this.emitChange(n),e.created&&(this.query="",this.handleQueryChange(""),this.inputLength=20),this.filterable&&this.$refs.input.focus()}else this.$emit("input",e.value),this.emitChange(e.value),this.visible=!1;this.$nextTick(function(){return t.scrollToOption(e)})},getValueIndex:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments[1];if(!("[object object]"===Object.prototype.toString.call(n).toLowerCase()))return t.indexOf(n);var o=function(){var o=e.valueKey,r=-1;return t.some(function(e,t){return(0,_.getValueByPath)(e,o)===(0,_.getValueByPath)(n,o)&&(r=t,!0)}),{v:r}}();return"object"===(void 0===o?"undefined":r(o))?o.v:void 0},toggleMenu:function(){this.disabled||(this.visible=!this.visible,this.visible&&(this.$refs.input||this.$refs.reference).focus())},selectOption:function(){this.options[this.hoverIndex]&&this.handleOptionSelect(this.options[this.hoverIndex])},deleteSelected:function(e){e.stopPropagation(),this.$emit("input",""),this.emitChange(""),this.visible=!1,this.$emit("clear")},deleteTag:function(e,t){var n=this.selected.indexOf(t);if(n>-1&&!this.disabled){var o=this.value.slice();o.splice(n,1),this.$emit("input",o),this.emitChange(o),this.$emit("remove-tag",t)}e.stopPropagation()},onInputChange:function(){this.filterable&&this.query!==this.selectedLabel&&(this.query=this.selectedLabel,this.handleQueryChange(this.query))},onOptionDestroy:function(e){e>-1&&(this.optionsCount--,this.filteredOptionsCount--,this.options.splice(e,1))},resetInputWidth:function(){this.inputWidth=this.$refs.reference.$el.getBoundingClientRect().width},handleResize:function(){this.resetInputWidth(),this.multiple&&this.resetInputHeight()},checkDefaultFirstOption:function(){this.hoverIndex=-1;for(var e=!1,t=this.options.length-1;t>=0;t--)if(this.options[t].created){e=!0,this.hoverIndex=t;break}if(!e)for(var n=0;n!==this.options.length;++n){var o=this.options[n];if(this.query){if(!o.disabled&&!o.groupDisabled&&o.visible){this.hoverIndex=n;break}}else if(o.itemSelected){this.hoverIndex=n;break}}},getValueKey:function(e){return"[object object]"!==Object.prototype.toString.call(e.value).toLowerCase()?e.value:(0,_.getValueByPath)(e.value,this.valueKey)}},created:function(){var e=this;this.cachedPlaceHolder=this.currentPlaceholder=this.placeholder,this.multiple&&!Array.isArray(this.value)&&this.$emit("input",[]),!this.multiple&&Array.isArray(this.value)&&this.$emit("input",""),this.debouncedOnInputChange=(0,d.default)(this.debounce,function(){e.onInputChange()}),this.$on("handleOptionClick",this.handleOptionSelect),this.$on("setSelected",this.setSelected)},mounted:function(){var e=this;this.multiple&&Array.isArray(this.value)&&this.value.length>0&&(this.currentPlaceholder=""),(0,v.addResizeListener)(this.$el,this.handleResize),this.remote&&this.multiple&&this.resetInputHeight(),this.$nextTick(function(){e.$refs.reference&&e.$refs.reference.$el&&(e.inputWidth=e.$refs.reference.$el.getBoundingClientRect().width)}),this.setSelected()},beforeDestroy:function(){this.$el&&this.handleResize&&(0,v.removeResizeListener)(this.$el,this.handleResize)}}},161:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(162),r=n.n(o),i=n(163),s=n(0)(r.a,i.a,!1,null,null,null);t.default=s.exports},162:function(e,t,n){"use strict";t.__esModule=!0;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(8));t.default={name:"ElSelectDropdown",componentName:"ElSelectDropdown",mixins:[o.default],props:{placement:{default:"bottom-start"},boundariesPadding:{default:0},popperOptions:{default:function(){return{gpuAcceleration:!1}}},visibleArrow:{default:!0}},data:function(){return{minWidth:""}},computed:{popperClass:function(){return this.$parent.popperClass}},watch:{"$parent.inputWidth":function(){this.minWidth=this.$parent.$el.getBoundingClientRect().width+"px"}},mounted:function(){var e=this;this.referenceElm=this.$parent.$refs.reference.$el,this.$parent.popperElm=this.popperElm=this.$el,this.$on("updatePopper",function(){e.$parent.visible&&e.updatePopper()}),this.$on("destroyPopper",this.destroyPopper)}}},163:function(e,t,n){"use strict";var o={render:function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"el-select-dropdown el-popper",class:[{"is-multiple":this.$parent.multiple},this.popperClass],style:{minWidth:this.minWidth}},[this._t("default")],2)},staticRenderFns:[]};t.a=o},164:function(e,t,n){"use strict";t.__esModule=!0,t.default={data:function(){return{hoverOption:-1}},computed:{optionsAllDisabled:function(){return this.options.length===this.options.filter(function(e){return!0===e.disabled}).length}},watch:{hoverIndex:function(e){var t=this;"number"==typeof e&&e>-1&&(this.hoverOption=this.options[e]||{}),this.options.forEach(function(e){e.hover=t.hoverOption===e})}},methods:{navigateOptions:function(e){var t=this;if(this.visible){if(0!==this.options.length&&0!==this.filteredOptionsCount){if(!this.optionsAllDisabled){"next"===e?(this.hoverIndex++,this.hoverIndex===this.options.length&&(this.hoverIndex=0)):"prev"===e&&(this.hoverIndex--,this.hoverIndex<0&&(this.hoverIndex=this.options.length-1));var n=this.options[this.hoverIndex];!0!==n.disabled&&!0!==n.groupDisabled&&n.visible||this.navigateOptions(e)}this.$nextTick(function(){return t.scrollToOption(t.hoverOption)})}}else this.visible=!0}}}},165:function(e,t,n){"use strict";var o={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.handleClose,expression:"handleClose"}],staticClass:"el-select",class:[e.selectSize?"el-select--"+e.selectSize:""]},[e.multiple?n("div",{ref:"tags",staticClass:"el-select__tags",style:{"max-width":e.inputWidth-32+"px"},on:{click:function(t){t.stopPropagation(),e.toggleMenu(t)}}},[e.collapseTags&&e.selected.length?n("span",[n("el-tag",{attrs:{closable:!e.disabled,size:e.collapseTagSize,hit:e.selected[0].hitState,type:"info","disable-transitions":""},on:{close:function(t){e.deleteTag(t,e.selected[0])}}},[n("span",{staticClass:"el-select__tags-text"},[e._v(e._s(e.selected[0].currentLabel))])]),e.selected.length>1?n("el-tag",{attrs:{closable:!1,size:e.collapseTagSize,type:"info","disable-transitions":""}},[n("span",{staticClass:"el-select__tags-text"},[e._v("+ "+e._s(e.selected.length-1))])]):e._e()],1):e._e(),e.collapseTags?e._e():n("transition-group",{on:{"after-leave":e.resetInputHeight}},e._l(e.selected,function(t){return n("el-tag",{key:e.getValueKey(t),attrs:{closable:!e.disabled,size:"small",hit:t.hitState,type:"info","disable-transitions":""},on:{close:function(n){e.deleteTag(n,t)}}},[n("span",{staticClass:"el-select__tags-text"},[e._v(e._s(t.currentLabel))])])})),e.filterable?n("input",{directives:[{name:"model",rawName:"v-model",value:e.query,expression:"query"}],ref:"input",staticClass:"el-select__input",class:[e.selectSize?"is-"+e.selectSize:""],style:{width:e.inputLength+"px","max-width":e.inputWidth-42+"px"},attrs:{type:"text",disabled:e.disabled,debounce:e.remote?300:0},domProps:{value:e.query},on:{focus:e.handleFocus,click:function(e){e.stopPropagation()},keyup:e.managePlaceholder,keydown:[e.resetInputState,function(t){if(!("button"in t)&&e._k(t.keyCode,"down",40,t.key))return null;t.preventDefault(),e.navigateOptions("next")},function(t){if(!("button"in t)&&e._k(t.keyCode,"up",38,t.key))return null;t.preventDefault(),e.navigateOptions("prev")},function(t){if(!("button"in t)&&e._k(t.keyCode,"enter",13,t.key))return null;t.preventDefault(),e.selectOption(t)},function(t){if(!("button"in t)&&e._k(t.keyCode,"esc",27,t.key))return null;t.stopPropagation(),t.preventDefault(),e.visible=!1},function(t){if(!("button"in t)&&e._k(t.keyCode,"delete",[8,46],t.key))return null;e.deletePrevTag(t)}],input:[function(t){t.target.composing||(e.query=t.target.value)},function(t){return e.handleQueryChange(t.target.value)}]}}):e._e()],1):e._e(),n("el-input",{ref:"reference",class:{"is-focus":e.visible},attrs:{type:"text",placeholder:e.currentPlaceholder,name:e.name,id:e.id,size:e.selectSize,disabled:e.disabled,readonly:!e.filterable||e.multiple,"validate-event":!1},on:{focus:e.handleFocus,blur:e.handleBlur},nativeOn:{mousedown:function(t){e.handleMouseDown(t)},keyup:function(t){e.debouncedOnInputChange(t)},keydown:[function(t){if(!("button"in t)&&e._k(t.keyCode,"down",40,t.key))return null;t.stopPropagation(),t.preventDefault(),e.navigateOptions("next")},function(t){if(!("button"in t)&&e._k(t.keyCode,"up",38,t.key))return null;t.stopPropagation(),t.preventDefault(),e.navigateOptions("prev")},function(t){if(!("button"in t)&&e._k(t.keyCode,"enter",13,t.key))return null;t.preventDefault(),e.selectOption(t)},function(t){if(!("button"in t)&&e._k(t.keyCode,"esc",27,t.key))return null;t.stopPropagation(),t.preventDefault(),e.visible=!1},function(t){if(!("button"in t)&&e._k(t.keyCode,"tab",9,t.key))return null;e.visible=!1}],paste:function(t){e.debouncedOnInputChange(t)},mouseenter:function(t){e.inputHovering=!0},mouseleave:function(t){e.inputHovering=!1}},model:{value:e.selectedLabel,callback:function(t){e.selectedLabel=t},expression:"selectedLabel"}},[n("i",{class:["el-select__caret","el-input__icon","el-icon-"+e.iconClass],attrs:{slot:"suffix"},on:{click:e.handleIconClick},slot:"suffix"})]),n("transition",{attrs:{name:"el-zoom-in-top"},on:{"before-enter":e.handleMenuEnter,"after-leave":e.doDestroy}},[n("el-select-menu",{directives:[{name:"show",rawName:"v-show",value:e.visible&&!1!==e.emptyText,expression:"visible && emptyText !== false"}],ref:"popper"},[n("el-scrollbar",{directives:[{name:"show",rawName:"v-show",value:e.options.length>0&&!e.loading,expression:"options.length > 0 && !loading"}],ref:"scrollbar",class:{"is-empty":!e.allowCreate&&e.query&&0===e.filteredOptionsCount},attrs:{tag:"ul","wrap-class":"el-select-dropdown__wrap","view-class":"el-select-dropdown__list"}},[e.showNewOption?n("el-option",{attrs:{value:e.query,created:""}}):e._e(),e._t("default")],2),e.emptyText&&(e.allowCreate&&0===e.options.length||!e.allowCreate)?n("p",{staticClass:"el-select-dropdown__empty"},[e._v(e._s(e.emptyText))]):e._e()],1)],1)],1)},staticRenderFns:[]};t.a=o},18:function(e,t){e.exports=n(79)},19:function(e,t){e.exports=n(37)},2:function(e,t){e.exports=n(6)},24:function(e,t){e.exports=n(53)},25:function(e,t){e.exports=n(108)},3:function(e,t){e.exports=n(5)},33:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(34),r=n.n(o),i=n(35),s=n(0)(r.a,i.a,!1,null,null,null);t.default=s.exports},34:function(e,t,n){"use strict";t.__esModule=!0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=function(e){return e&&e.__esModule?e:{default:e}}(n(1)),i=n(3);t.default={mixins:[r.default],name:"ElOption",componentName:"ElOption",inject:["select"],props:{value:{required:!0},label:[String,Number],created:Boolean,disabled:{type:Boolean,default:!1}},data:function(){return{index:-1,groupDisabled:!1,visible:!0,hitState:!1,hover:!1}},computed:{isObject:function(){return"[object object]"===Object.prototype.toString.call(this.value).toLowerCase()},currentLabel:function(){return this.label||(this.isObject?"":this.value)},currentValue:function(){return this.value||this.label||""},itemSelected:function(){return this.select.multiple?this.contains(this.select.value,this.value):this.isEqual(this.value,this.select.value)},limitReached:function(){return!!this.select.multiple&&(!this.itemSelected&&(this.select.value||[]).length>=this.select.multipleLimit&&this.select.multipleLimit>0)}},watch:{currentLabel:function(){this.created||this.select.remote||this.dispatch("ElSelect","setSelected")},value:function(){this.created||this.select.remote||this.dispatch("ElSelect","setSelected")}},methods:{isEqual:function(e,t){if(this.isObject){var n=this.select.valueKey;return(0,i.getValueByPath)(e,n)===(0,i.getValueByPath)(t,n)}return e===t},contains:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments[1];if(!this.isObject)return t.indexOf(n)>-1;var r=function(){var o=e.select.valueKey;return{v:t.some(function(e){return(0,i.getValueByPath)(e,o)===(0,i.getValueByPath)(n,o)})}}();return"object"===(void 0===r?"undefined":o(r))?r.v:void 0},handleGroupDisabled:function(e){this.groupDisabled=e},hoverItem:function(){this.disabled||this.groupDisabled||(this.select.hoverIndex=this.select.options.indexOf(this))},selectOptionClick:function(){!0!==this.disabled&&!0!==this.groupDisabled&&this.dispatch("ElSelect","handleOptionClick",this)},queryChange:function(e){var t=String(e).replace(/(\^|\(|\)|\[|\]|\$|\*|\+|\.|\?|\\|\{|\}|\|)/g,"\\$1");this.visible=new RegExp(t,"i").test(this.currentLabel)||this.created,this.visible||this.select.filteredOptionsCount--}},created:function(){this.select.options.push(this),this.select.cachedOptions.push(this),this.select.optionsCount++,this.select.filteredOptionsCount++,this.$on("queryChange",this.queryChange),this.$on("handleGroupDisabled",this.handleGroupDisabled)},beforeDestroy:function(){this.select.onOptionDestroy(this.select.options.indexOf(this))}}},35:function(e,t,n){"use strict";var o={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("li",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-select-dropdown__item",class:{selected:e.itemSelected,"is-disabled":e.disabled||e.groupDisabled||e.limitReached,hover:e.hover},on:{mouseenter:e.hoverItem,click:function(t){t.stopPropagation(),e.selectOptionClick(t)}}},[e._t("default",[n("span",[e._v(e._s(e.currentLabel))])])],2)},staticRenderFns:[]};t.a=o},4:function(e,t){e.exports=n(54)},6:function(e,t){e.exports=n(27)},8:function(e,t){e.exports=n(12)}})},,function(e,t,n){var o=n(83);"string"==typeof o&&(o=[[e.i,o,""]]);var r={};r.transform=void 0;n(1)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){(e.exports=n(0)(void 0)).push([e.i,".el-message__closeBtn:focus,.el-message__content:focus{outline-width:0}.el-message{min-width:380px;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;border:1px solid #ebeef5;position:fixed;left:50%;top:20px;-webkit-transform:translateX(-50%);transform:translateX(-50%);background-color:#edf2fc;-webkit-transition:opacity .3s,-webkit-transform .4s;transition:opacity .3s,-webkit-transform .4s;transition:opacity .3s,transform .4s;transition:opacity .3s,transform .4s,-webkit-transform .4s;overflow:hidden;padding:15px 15px 15px 20px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-message.is-center{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.el-message p{margin:0}.el-message--info .el-message__content{color:#909399}.el-message--success{background-color:#f0f9eb;border-color:#e1f3d8}.el-message--success .el-message__content{color:#67c23a}.el-message--warning{background-color:#fdf6ec;border-color:#faecd8}.el-message--warning .el-message__content{color:#e6a23c}.el-message--error{background-color:#fef0f0;border-color:#fde2e2}.el-message--error .el-message__content{color:#f56c6c}.el-message__icon{margin-right:10px}.el-message__content{padding:0;font-size:14px;line-height:1}.el-message__closeBtn{position:absolute;top:50%;right:15px;-webkit-transform:translateY(-50%);transform:translateY(-50%);cursor:pointer;color:#c0c4cc;font-size:16px}.el-message__closeBtn:hover{color:#909399}.el-message .el-icon-success{color:#67c23a}.el-message .el-icon-error{color:#f56c6c}.el-message .el-icon-info{color:#909399}.el-message .el-icon-warning{color:#e6a23c}.el-message-fade-enter,.el-message-fade-leave-active{opacity:0;-webkit-transform:translate(-50%,-100%);transform:translate(-50%,-100%)}",""])},function(e,t,n){(e.exports=n(0)(void 0)).push([e.i,".el-fade-in-enter,.el-fade-in-leave-active,.el-fade-in-linear-enter,.el-fade-in-linear-leave,.el-fade-in-linear-leave-active,.fade-in-linear-enter,.fade-in-linear-leave,.fade-in-linear-leave-active{opacity:0}.el-fade-in-linear-enter-active,.el-fade-in-linear-leave-active,.fade-in-linear-enter-active,.fade-in-linear-leave-active{-webkit-transition:opacity .2s linear;transition:opacity .2s linear}.el-fade-in-enter-active,.el-fade-in-leave-active,.el-zoom-in-center-enter-active,.el-zoom-in-center-leave-active{-webkit-transition:all .3s cubic-bezier(.55,0,.1,1);transition:all .3s cubic-bezier(.55,0,.1,1)}.el-zoom-in-center-enter,.el-zoom-in-center-leave-active{opacity:0;-webkit-transform:scaleX(0);transform:scaleX(0)}.el-zoom-in-top-enter-active,.el-zoom-in-top-leave-active{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transition:opacity .3s cubic-bezier(.23,1,.32,1) .1s,-webkit-transform .3s cubic-bezier(.23,1,.32,1) .1s;transition:opacity .3s cubic-bezier(.23,1,.32,1) .1s,-webkit-transform .3s cubic-bezier(.23,1,.32,1) .1s;transition:transform .3s cubic-bezier(.23,1,.32,1) .1s,opacity .3s cubic-bezier(.23,1,.32,1) .1s;transition:transform .3s cubic-bezier(.23,1,.32,1) .1s,opacity .3s cubic-bezier(.23,1,.32,1) .1s,-webkit-transform .3s cubic-bezier(.23,1,.32,1) .1s;-webkit-transform-origin:center top;transform-origin:center top}.el-zoom-in-top-enter,.el-zoom-in-top-leave-active{opacity:0;-webkit-transform:scaleY(0);transform:scaleY(0)}.el-zoom-in-bottom-enter-active,.el-zoom-in-bottom-leave-active{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transition:opacity .3s cubic-bezier(.23,1,.32,1) .1s,-webkit-transform .3s cubic-bezier(.23,1,.32,1) .1s;transition:opacity .3s cubic-bezier(.23,1,.32,1) .1s,-webkit-transform .3s cubic-bezier(.23,1,.32,1) .1s;transition:transform .3s cubic-bezier(.23,1,.32,1) .1s,opacity .3s cubic-bezier(.23,1,.32,1) .1s;transition:transform .3s cubic-bezier(.23,1,.32,1) .1s,opacity .3s cubic-bezier(.23,1,.32,1) .1s,-webkit-transform .3s cubic-bezier(.23,1,.32,1) .1s;-webkit-transform-origin:center bottom;transform-origin:center bottom}.el-zoom-in-bottom-enter,.el-zoom-in-bottom-leave-active{opacity:0;-webkit-transform:scaleY(0);transform:scaleY(0)}.el-zoom-in-left-enter-active,.el-zoom-in-left-leave-active{opacity:1;-webkit-transform:scale(1);transform:scale(1);-webkit-transition:opacity .3s cubic-bezier(.23,1,.32,1) .1s,-webkit-transform .3s cubic-bezier(.23,1,.32,1) .1s;transition:opacity .3s cubic-bezier(.23,1,.32,1) .1s,-webkit-transform .3s cubic-bezier(.23,1,.32,1) .1s;transition:transform .3s cubic-bezier(.23,1,.32,1) .1s,opacity .3s cubic-bezier(.23,1,.32,1) .1s;transition:transform .3s cubic-bezier(.23,1,.32,1) .1s,opacity .3s cubic-bezier(.23,1,.32,1) .1s,-webkit-transform .3s cubic-bezier(.23,1,.32,1) .1s;-webkit-transform-origin:top left;transform-origin:top left}.el-zoom-in-left-enter,.el-zoom-in-left-leave-active{opacity:0;-webkit-transform:scale(.45);transform:scale(.45)}.collapse-transition{-webkit-transition:height .3s ease-in-out,padding-top .3s ease-in-out,padding-bottom .3s ease-in-out;transition:height .3s ease-in-out,padding-top .3s ease-in-out,padding-bottom .3s ease-in-out}.horizontal-collapse-transition{-webkit-transition:width .3s ease-in-out,padding-left .3s ease-in-out,padding-right .3s ease-in-out;transition:width .3s ease-in-out,padding-left .3s ease-in-out,padding-right .3s ease-in-out}.el-list-enter-active,.el-list-leave-active{-webkit-transition:all 1s;transition:all 1s}.el-list-enter,.el-list-leave-active{opacity:0;-webkit-transform:translateY(-30px);transform:translateY(-30px)}.el-opacity-transition{-webkit-transition:opacity .3s cubic-bezier(.55,0,.1,1);transition:opacity .3s cubic-bezier(.55,0,.1,1)}@font-face{font-family:element-icons;src:url("+n(56)+') format("woff"),url('+n(57)+') format("truetype");font-weight:400;font-style:normal}[class*=" el-icon-"],[class^=el-icon-]{font-family:element-icons!important;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;vertical-align:baseline;display:inline-block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.el-icon-upload:before{content:"\\E60D"}.el-icon-error:before{content:"\\E62C"}.el-icon-success:before{content:"\\E62D"}.el-icon-warning:before{content:"\\E62E"}.el-icon-sort-down:before{content:"\\E630"}.el-icon-sort-up:before{content:"\\E631"}.el-icon-arrow-left:before{content:"\\E600"}.el-icon-circle-plus:before{content:"\\E601"}.el-icon-circle-plus-outline:before{content:"\\E602"}.el-icon-arrow-down:before{content:"\\E603"}.el-icon-arrow-right:before{content:"\\E604"}.el-icon-arrow-up:before{content:"\\E605"}.el-icon-back:before{content:"\\E606"}.el-icon-circle-close:before{content:"\\E607"}.el-icon-date:before{content:"\\E608"}.el-icon-circle-close-outline:before{content:"\\E609"}.el-icon-caret-left:before{content:"\\E60A"}.el-icon-caret-bottom:before{content:"\\E60B"}.el-icon-caret-top:before{content:"\\E60C"}.el-icon-caret-right:before{content:"\\E60E"}.el-icon-close:before{content:"\\E60F"}.el-icon-d-arrow-left:before{content:"\\E610"}.el-icon-check:before{content:"\\E611"}.el-icon-delete:before{content:"\\E612"}.el-icon-d-arrow-right:before{content:"\\E613"}.el-icon-document:before{content:"\\E614"}.el-icon-d-caret:before{content:"\\E615"}.el-icon-edit-outline:before{content:"\\E616"}.el-icon-download:before{content:"\\E617"}.el-icon-goods:before{content:"\\E618"}.el-icon-search:before{content:"\\E619"}.el-icon-info:before{content:"\\E61A"}.el-icon-message:before{content:"\\E61B"}.el-icon-edit:before{content:"\\E61C"}.el-icon-location:before{content:"\\E61D"}.el-icon-loading:before{content:"\\E61E"}.el-icon-location-outline:before{content:"\\E61F"}.el-icon-menu:before{content:"\\E620"}.el-icon-minus:before{content:"\\E621"}.el-icon-bell:before{content:"\\E622"}.el-icon-mobile-phone:before{content:"\\E624"}.el-icon-news:before{content:"\\E625"}.el-icon-more:before{content:"\\E646"}.el-icon-more-outline:before{content:"\\E626"}.el-icon-phone:before{content:"\\E627"}.el-icon-phone-outline:before{content:"\\E628"}.el-icon-picture:before{content:"\\E629"}.el-icon-picture-outline:before{content:"\\E62A"}.el-icon-plus:before{content:"\\E62B"}.el-icon-printer:before{content:"\\E62F"}.el-icon-rank:before{content:"\\E632"}.el-icon-refresh:before{content:"\\E633"}.el-icon-question:before{content:"\\E634"}.el-icon-remove:before{content:"\\E635"}.el-icon-share:before{content:"\\E636"}.el-icon-star-on:before{content:"\\E637"}.el-icon-setting:before{content:"\\E638"}.el-icon-circle-check:before{content:"\\E639"}.el-icon-service:before{content:"\\E63A"}.el-icon-sold-out:before{content:"\\E63B"}.el-icon-remove-outline:before{content:"\\E63C"}.el-icon-star-off:before{content:"\\E63D"}.el-icon-circle-check-outline:before{content:"\\E63E"}.el-icon-tickets:before{content:"\\E63F"}.el-icon-sort:before{content:"\\E640"}.el-icon-zoom-in:before{content:"\\E641"}.el-icon-time:before{content:"\\E642"}.el-icon-view:before{content:"\\E643"}.el-icon-upload2:before{content:"\\E644"}.el-icon-zoom-out:before{content:"\\E645"}.el-icon-loading{-webkit-animation:rotating 2s linear infinite;animation:rotating 2s linear infinite}.el-icon--right{margin-left:5px}.el-icon--left{margin-right:5px}@-webkit-keyframes rotating{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes rotating{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}',""])},function(e,t,n){e.exports=function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=356)}({0:function(e,t){e.exports=function(e,t,n,o,r,i){var s,a=e=e||{},l=typeof e.default;"object"!==l&&"function"!==l||(s=e,a=e.default);var c="function"==typeof a?a.options:a;t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId=r);var u;if(i?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},c._ssrRegister=u):o&&(u=o),u){var f=c.functional,p=f?c.render:c.beforeCreate;f?(c._injectStyles=u,c.render=function(e,t){return u.call(t),p(e,t)}):c.beforeCreate=p?[].concat(p,u):[u]}return{esModule:s,exports:a,options:c}}},17:function(e,t){e.exports=n(19)},20:function(e,t){e.exports=n(24)},356:function(e,t,n){e.exports=n(357)},357:function(e,t,n){"use strict";t.__esModule=!0;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(358));t.default=o.default},358:function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var r=o(n(5)),i=o(n(359)),s=n(17),a=n(20),l=r.default.extend(i.default),c=void 0,u=[],f=1,p=function e(t){if(!r.default.prototype.$isServer){"string"==typeof(t=t||{})&&(t={message:t});var n=t.onClose,o="message_"+f++;return t.onClose=function(){e.close(o,n)},c=new l({data:t}),c.id=o,(0,a.isVNode)(c.message)&&(c.$slots.default=[c.message],c.message=null),c.vm=c.$mount(),document.body.appendChild(c.vm.$el),c.vm.visible=!0,c.dom=c.vm.$el,c.dom.style.zIndex=s.PopupManager.nextZIndex(),u.push(c),c.vm}};["success","warning","info","error"].forEach(function(e){p[e]=function(t){return"string"==typeof t&&(t={message:t}),t.type=e,p(t)}}),p.close=function(e,t){for(var n=0,o=u.length;n<o;n++)if(e===u[n].id){"function"==typeof t&&t(u[n]),u.splice(n,1);break}},p.closeAll=function(){for(var e=u.length-1;e>=0;e--)u[e].close()},t.default=p},359:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(360),r=n.n(o),i=n(361),s=n(0)(r.a,i.a,!1,null,null,null);t.default=s.exports},360:function(e,t,n){"use strict";t.__esModule=!0;var o={success:"success",info:"info",warning:"warning",error:"error"};t.default={data:function(){return{visible:!1,message:"",duration:3e3,type:"info",iconClass:"",customClass:"",onClose:null,showClose:!1,closed:!1,timer:null,dangerouslyUseHTMLString:!1,center:!1}},computed:{iconWrapClass:function(){var e=["el-message__icon"];return this.type&&!this.iconClass&&e.push("el-message__icon--"+this.type),e},typeClass:function(){return this.type&&!this.iconClass?"el-message__icon el-icon-"+o[this.type]:""}},watch:{closed:function(e){e&&(this.visible=!1,this.$el.addEventListener("transitionend",this.destroyElement))}},methods:{destroyElement:function(){this.$el.removeEventListener("transitionend",this.destroyElement),this.$destroy(!0),this.$el.parentNode.removeChild(this.$el)},close:function(){this.closed=!0,"function"==typeof this.onClose&&this.onClose(this)},clearTimer:function(){clearTimeout(this.timer)},startTimer:function(){var e=this;this.duration>0&&(this.timer=setTimeout(function(){e.closed||e.close()},this.duration))},keydown:function(e){27===e.keyCode&&(this.closed||this.close())}},mounted:function(){this.startTimer(),document.addEventListener("keydown",this.keydown)},beforeDestroy:function(){document.removeEventListener("keydown",this.keydown)}}},361:function(e,t,n){"use strict";var o={render:function(){var e=this.$createElement,t=this._self._c||e;return t("transition",{attrs:{name:"el-message-fade"}},[t("div",{directives:[{name:"show",rawName:"v-show",value:this.visible,expression:"visible"}],class:["el-message",this.type&&!this.iconClass?"el-message--"+this.type:"",this.center?"is-center":"",this.customClass],attrs:{role:"alert"},on:{mouseenter:this.clearTimer,mouseleave:this.startTimer}},[this.iconClass?t("i",{class:this.iconClass}):t("i",{class:this.typeClass}),this._t("default",[this.dangerouslyUseHTMLString?t("p",{staticClass:"el-message__content",domProps:{innerHTML:this._s(this.message)}}):t("p",{staticClass:"el-message__content"},[this._v(this._s(this.message))])]),this.showClose?t("i",{staticClass:"el-message__closeBtn el-icon-close",on:{click:this.close}}):this._e()],2)])},staticRenderFns:[]};t.a=o},5:function(e,t){e.exports=n(4)}})},function(e,t,n){"use strict";t.__esModule=!0;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(4)),r=n(6),i=!1,s=function(){if(!o.default.prototype.$isServer){var e=l.modalDom;return e?i=!0:(i=!1,e=document.createElement("div"),l.modalDom=e,e.addEventListener("touchmove",function(e){e.preventDefault(),e.stopPropagation()}),e.addEventListener("click",function(){l.doOnModalClick&&l.doOnModalClick()})),e}},a={},l={zIndex:2e3,modalFade:!0,getInstance:function(e){return a[e]},register:function(e,t){e&&t&&(a[e]=t)},deregister:function(e){e&&(a[e]=null,delete a[e])},nextZIndex:function(){return l.zIndex++},modalStack:[],doOnModalClick:function(){var e=l.modalStack[l.modalStack.length-1];if(e){var t=l.getInstance(e.id);t&&t.closeOnClickModal&&t.close()}},openModal:function(e,t,n,a,l){if(!o.default.prototype.$isServer&&e&&void 0!==t){this.modalFade=l;for(var c=this.modalStack,u=0,f=c.length;u<f;u++){if(c[u].id===e)return}var p=s();if((0,r.addClass)(p,"v-modal"),this.modalFade&&!i&&(0,r.addClass)(p,"v-modal-enter"),a){a.trim().split(/\s+/).forEach(function(e){return(0,r.addClass)(p,e)})}setTimeout(function(){(0,r.removeClass)(p,"v-modal-enter")},200),n&&n.parentNode&&11!==n.parentNode.nodeType?n.parentNode.appendChild(p):document.body.appendChild(p),t&&(p.style.zIndex=t),p.tabIndex=0,p.style.display="",this.modalStack.push({id:e,zIndex:t,modalClass:a})}},closeModal:function(e){var t=this.modalStack,n=s();if(t.length>0){var o=t[t.length-1];if(o.id===e){if(o.modalClass){o.modalClass.trim().split(/\s+/).forEach(function(e){return(0,r.removeClass)(n,e)})}t.pop(),t.length>0&&(n.style.zIndex=t[t.length-1].zIndex)}else for(var i=t.length-1;i>=0;i--)if(t[i].id===e){t.splice(i,1);break}}0===t.length&&(this.modalFade&&(0,r.addClass)(n,"v-modal-leave"),setTimeout(function(){0===t.length&&(n.parentNode&&n.parentNode.removeChild(n),n.style.display="none",l.modalDom=void 0),(0,r.removeClass)(n,"v-modal-leave")},200))}};o.default.prototype.$isServer||window.addEventListener("keydown",function(e){if(27===e.keyCode){var t=function(){if(!o.default.prototype.$isServer&&l.modalStack.length>0){var e=l.modalStack[l.modalStack.length-1];if(!e)return;return l.getInstance(e.id)}}();t&&t.closeOnPressEscape&&(t.handleClose?t.handleClose():t.handleAction?t.handleAction("cancel"):t.close())}}),t.default=l},function(e,t,n){var o=n(88);"string"==typeof o&&(o=[[e.i,o,""]]);var r={};r.transform=void 0;n(1)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){(e.exports=n(0)(void 0)).push([e.i,".el-notification{display:-webkit-box;display:-ms-flexbox;display:flex;width:330px;padding:14px 26px 14px 13px;border-radius:8px;-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid #ebeef5;position:fixed;background-color:#fff;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1);-webkit-transition:opacity .3s,left .3s,right .3s,top .4s,bottom .3s,-webkit-transform .3s;transition:opacity .3s,left .3s,right .3s,top .4s,bottom .3s,-webkit-transform .3s;transition:opacity .3s,transform .3s,left .3s,right .3s,top .4s,bottom .3s;transition:opacity .3s,transform .3s,left .3s,right .3s,top .4s,bottom .3s,-webkit-transform .3s;overflow:hidden}.el-notification.right{right:16px}.el-notification.left{left:16px}.el-notification__group{margin-left:13px}.el-notification__title{font-weight:700;font-size:16px;color:#303133;margin:0}.el-notification__content{font-size:14px;line-height:21px;margin:6px 0 0;color:#606266;text-align:justify}.el-notification__content p{margin:0}.el-notification__icon{height:24px;width:24px;font-size:24px}.el-notification__closeBtn{position:absolute;top:18px;right:15px;cursor:pointer;color:#909399;font-size:16px}.el-notification__closeBtn:hover{color:#606266}.el-notification .el-icon-success{color:#67c23a}.el-notification .el-icon-error{color:#f56c6c}.el-notification .el-icon-info{color:#909399}.el-notification .el-icon-warning{color:#e6a23c}.el-notification-fade-enter.right{right:0;-webkit-transform:translateX(100%);transform:translateX(100%)}.el-notification-fade-enter.left{left:0;-webkit-transform:translateX(-100%);transform:translateX(-100%)}.el-notification-fade-leave-active{opacity:0}",""])},function(e,t,n){e.exports=function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=300)}({0:function(e,t){e.exports=function(e,t,n,o,r,i){var s,a=e=e||{},l=typeof e.default;"object"!==l&&"function"!==l||(s=e,a=e.default);var c="function"==typeof a?a.options:a;t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId=r);var u;if(i?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},c._ssrRegister=u):o&&(u=o),u){var f=c.functional,p=f?c.render:c.beforeCreate;f?(c._injectStyles=u,c.render=function(e,t){return u.call(t),p(e,t)}):c.beforeCreate=p?[].concat(p,u):[u]}return{esModule:s,exports:a,options:c}}},17:function(e,t){e.exports=n(19)},20:function(e,t){e.exports=n(24)},300:function(e,t,n){e.exports=n(301)},301:function(e,t,n){"use strict";t.__esModule=!0;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(302));t.default=o.default},302:function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var r=o(n(5)),i=o(n(303)),s=n(17),a=n(20),l=r.default.extend(i.default),c=void 0,u=[],f=1,p=function e(t){if(!r.default.prototype.$isServer){var n=(t=t||{}).onClose,o="notification_"+f++,i=t.position||"top-right";t.onClose=function(){e.close(o,n)},c=new l({data:t}),(0,a.isVNode)(t.message)&&(c.$slots.default=[t.message],t.message="REPLACED_BY_VNODE"),c.id=o,c.vm=c.$mount(),document.body.appendChild(c.vm.$el),c.vm.visible=!0,c.dom=c.vm.$el,c.dom.style.zIndex=s.PopupManager.nextZIndex();var p=t.offset||0;return u.filter(function(e){return e.position===i}).forEach(function(e){p+=e.$el.offsetHeight+16}),p+=16,c.verticalOffset=p,u.push(c),c.vm}};["success","warning","info","error"].forEach(function(e){p[e]=function(t){return("string"==typeof t||(0,a.isVNode)(t))&&(t={message:t}),t.type=e,p(t)}}),p.close=function(e,t){var n=-1,o=u.length,r=u.filter(function(t,o){return t.id===e&&(n=o,!0)})[0];if(r&&("function"==typeof t&&t(r),u.splice(n,1),!(o<=1)))for(var i=r.position,s=r.dom.offsetHeight,a=n;a<o-1;a++)u[a].position===i&&(u[a].dom.style[r.verticalProperty]=parseInt(u[a].dom.style[r.verticalProperty],10)-s-16+"px")},t.default=p},303:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(304),r=n.n(o),i=n(305),s=n(0)(r.a,i.a,!1,null,null,null);t.default=s.exports},304:function(e,t,n){"use strict";t.__esModule=!0;var o={success:"success",info:"info",warning:"warning",error:"error"};t.default={data:function(){return{visible:!1,title:"",message:"",duration:4500,type:"",showClose:!0,customClass:"",iconClass:"",onClose:null,onClick:null,closed:!1,verticalOffset:0,timer:null,dangerouslyUseHTMLString:!1,position:"top-right"}},computed:{typeClass:function(){return this.type&&o[this.type]?"el-icon-"+o[this.type]:""},horizontalClass:function(){return this.position.indexOf("right")>-1?"right":"left"},verticalProperty:function(){return/^top-/.test(this.position)?"top":"bottom"},positionStyle:function(){var e;return e={},e[this.verticalProperty]=this.verticalOffset+"px",e}},watch:{closed:function(e){e&&(this.visible=!1,this.$el.addEventListener("transitionend",this.destroyElement))}},methods:{destroyElement:function(){this.$el.removeEventListener("transitionend",this.destroyElement),this.$destroy(!0),this.$el.parentNode.removeChild(this.$el)},click:function(){"function"==typeof this.onClick&&this.onClick()},close:function(){this.closed=!0,"function"==typeof this.onClose&&this.onClose()},clearTimer:function(){clearTimeout(this.timer)},startTimer:function(){var e=this;this.duration>0&&(this.timer=setTimeout(function(){e.closed||e.close()},this.duration))},keydown:function(e){46===e.keyCode||8===e.keyCode?this.clearTimer():27===e.keyCode?this.closed||this.close():this.startTimer()}},mounted:function(){var e=this;this.duration>0&&(this.timer=setTimeout(function(){e.closed||e.close()},this.duration)),document.addEventListener("keydown",this.keydown)},beforeDestroy:function(){document.removeEventListener("keydown",this.keydown)}}},305:function(e,t,n){"use strict";var o={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"el-notification-fade"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],class:["el-notification",e.customClass,e.horizontalClass],style:e.positionStyle,attrs:{role:"alert"},on:{mouseenter:function(t){e.clearTimer()},mouseleave:function(t){e.startTimer()},click:e.click}},[e.type||e.iconClass?n("i",{staticClass:"el-notification__icon",class:[e.typeClass,e.iconClass]}):e._e(),n("div",{staticClass:"el-notification__group",class:{"is-with-icon":e.typeClass||e.iconClass}},[n("h2",{staticClass:"el-notification__title",domProps:{textContent:e._s(e.title)}}),n("div",{directives:[{name:"show",rawName:"v-show",value:e.message,expression:"message"}],staticClass:"el-notification__content"},[e._t("default",[e.dangerouslyUseHTMLString?n("p",{domProps:{innerHTML:e._s(e.message)}}):n("p",[e._v(e._s(e.message))])])],2),e.showClose?n("div",{staticClass:"el-notification__closeBtn el-icon-close",on:{click:function(t){t.stopPropagation(),e.close(t)}}}):e._e()])])])},staticRenderFns:[]};t.a=o},5:function(e,t){e.exports=n(4)}})},function(e,t,n){var o=n(91);"string"==typeof o&&(o=[[e.i,o,""]]);var r={};r.transform=void 0;n(1)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){(e.exports=n(0)(void 0)).push([e.i,".el-loading-parent--relative{position:relative!important}.el-loading-parent--hidden{overflow:hidden!important}.el-loading-mask{position:absolute;z-index:10000;background-color:hsla(0,0%,100%,.9);margin:0;top:0;right:0;bottom:0;left:0;-webkit-transition:opacity .3s;transition:opacity .3s}.el-loading-mask.is-fullscreen{position:fixed}.el-loading-mask.is-fullscreen .el-loading-spinner{margin-top:-25px}.el-loading-mask.is-fullscreen .el-loading-spinner .circular{height:50px;width:50px}.el-loading-spinner{top:50%;margin-top:-21px;width:100%;text-align:center;position:absolute}.el-loading-spinner .el-loading-text{color:#409eff;margin:3px 0;font-size:14px}.el-loading-spinner .circular{height:42px;width:42px;-webkit-animation:loading-rotate 2s linear infinite;animation:loading-rotate 2s linear infinite}.el-loading-spinner .path{-webkit-animation:loading-dash 1.5s ease-in-out infinite;animation:loading-dash 1.5s ease-in-out infinite;stroke-dasharray:90,150;stroke-dashoffset:0;stroke-width:2;stroke:#409eff;stroke-linecap:round}.el-loading-spinner i{color:#409eff}.el-loading-fade-enter,.el-loading-fade-leave-active{opacity:0}@-webkit-keyframes loading-rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes loading-rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}@keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}",""])},function(e,t,n){e.exports=function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=315)}({0:function(e,t){e.exports=function(e,t,n,o,r,i){var s,a=e=e||{},l=typeof e.default;"object"!==l&&"function"!==l||(s=e,a=e.default);var c="function"==typeof a?a.options:a;t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId=r);var u;if(i?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},c._ssrRegister=u):o&&(u=o),u){var f=c.functional,p=f?c.render:c.beforeCreate;f?(c._injectStyles=u,c.render=function(e,t){return u.call(t),p(e,t)}):c.beforeCreate=p?[].concat(p,u):[u]}return{esModule:s,exports:a,options:c}}},2:function(e,t){e.exports=n(6)},315:function(e,t,n){e.exports=n(316)},316:function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var r=o(n(317)),i=o(n(320));t.default={install:function(e){e.use(r.default),e.prototype.$loading=i.default},directive:r.default,service:i.default}},317:function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}var r=o(n(5)),i=o(n(49)),s=n(2),a=r.default.extend(i.default);t.install=function(e){if(!e.prototype.$isServer){var t=function(t,o){o.value?e.nextTick(function(){o.modifiers.fullscreen?(t.originalPosition=(0,s.getStyle)(document.body,"position"),t.originalOverflow=(0,s.getStyle)(document.body,"overflow"),(0,s.addClass)(t.mask,"is-fullscreen"),n(document.body,t,o)):((0,s.removeClass)(t.mask,"is-fullscreen"),o.modifiers.body?(t.originalPosition=(0,s.getStyle)(document.body,"position"),["top","left"].forEach(function(e){var n="top"===e?"scrollTop":"scrollLeft";t.maskStyle[e]=t.getBoundingClientRect()[e]+document.body[n]+document.documentElement[n]+"px"}),["height","width"].forEach(function(e){t.maskStyle[e]=t.getBoundingClientRect()[e]+"px"}),n(document.body,t,o)):(t.originalPosition=(0,s.getStyle)(t,"position"),n(t,t,o)))}):t.domVisible&&(t.instance.$on("after-leave",function(e){t.domVisible=!1;var n=o.modifiers.fullscreen||o.modifiers.body?document.body:t;(0,s.removeClass)(n,"el-loading-parent--relative"),(0,s.removeClass)(n,"el-loading-parent--hidden")}),t.instance.visible=!1)},n=function(t,n,o){n.domVisible||"none"===(0,s.getStyle)(n,"display")||"hidden"===(0,s.getStyle)(n,"visibility")||(Object.keys(n.maskStyle).forEach(function(e){n.mask.style[e]=n.maskStyle[e]}),"absolute"!==n.originalPosition&&"fixed"!==n.originalPosition&&(0,s.addClass)(t,"el-loading-parent--relative"),o.modifiers.fullscreen&&o.modifiers.lock&&(0,s.addClass)(t,"el-loading-parent--hidden"),n.domVisible=!0,t.appendChild(n.mask),e.nextTick(function(){n.instance.visible=!0}),n.domInserted=!0)};e.directive("loading",{bind:function(e,n,o){var r=e.getAttribute("element-loading-text"),i=e.getAttribute("element-loading-spinner"),s=e.getAttribute("element-loading-background"),l=e.getAttribute("element-loading-custom-class"),c=o.context,u=new a({el:document.createElement("div"),data:{text:c&&c[r]||r,spinner:c&&c[i]||i,background:c&&c[s]||s,customClass:c&&c[l]||l,fullscreen:!!n.modifiers.fullscreen}});e.instance=u,e.mask=u.$el,e.maskStyle={},t(e,n)},update:function(e,n){e.instance.setText(e.getAttribute("element-loading-text")),n.oldValue!==n.value&&t(e,n)},unbind:function(e,n){e.domInserted&&(e.mask&&e.mask.parentNode&&e.mask.parentNode.removeChild(e.mask),t(e,{value:!1,modifiers:n.modifiers}))}})}}},318:function(e,t,n){"use strict";t.__esModule=!0,t.default={data:function(){return{text:null,spinner:null,background:null,fullscreen:!0,visible:!1,customClass:""}},methods:{handleAfterLeave:function(){this.$emit("after-leave")},setText:function(e){this.text=e}}}},319:function(e,t,n){"use strict";var o={render:function(){var e=this.$createElement,t=this._self._c||e;return t("transition",{attrs:{name:"el-loading-fade"},on:{"after-leave":this.handleAfterLeave}},[t("div",{directives:[{name:"show",rawName:"v-show",value:this.visible,expression:"visible"}],staticClass:"el-loading-mask",class:[this.customClass,{"is-fullscreen":this.fullscreen}],style:{backgroundColor:this.background||""}},[t("div",{staticClass:"el-loading-spinner"},[this.spinner?t("i",{class:this.spinner}):t("svg",{staticClass:"circular",attrs:{viewBox:"25 25 50 50"}},[t("circle",{staticClass:"path",attrs:{cx:"50",cy:"50",r:"20",fill:"none"}})]),this.text?t("p",{staticClass:"el-loading-text"},[this._v(this._s(this.text))]):this._e()])])])},staticRenderFns:[]};t.a=o},320:function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var r=o(n(5)),i=o(n(49)),s=n(2),a=o(n(9)),l=r.default.extend(i.default),c={text:null,fullscreen:!0,body:!1,lock:!1,customClass:""},u=void 0;l.prototype.originalPosition="",l.prototype.originalOverflow="",l.prototype.close=function(){var e=this;this.fullscreen&&(u=void 0),this.$on("after-leave",function(t){var n=e.fullscreen||e.body?document.body:e.target;(0,s.removeClass)(n,"el-loading-parent--relative"),(0,s.removeClass)(n,"el-loading-parent--hidden"),e.$el&&e.$el.parentNode&&e.$el.parentNode.removeChild(e.$el),e.$destroy()}),this.visible=!1};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!r.default.prototype.$isServer){if("string"==typeof(e=(0,a.default)({},c,e)).target&&(e.target=document.querySelector(e.target)),e.target=e.target||document.body,e.target!==document.body?e.fullscreen=!1:e.body=!0,e.fullscreen&&u)return u;var t=e.body?document.body:e.target,n=new l({el:document.createElement("div"),data:e});return function(e,t,n){var o={};e.fullscreen?(n.originalPosition=(0,s.getStyle)(document.body,"position"),n.originalOverflow=(0,s.getStyle)(document.body,"overflow")):e.body?(n.originalPosition=(0,s.getStyle)(document.body,"position"),["top","left"].forEach(function(t){var n="top"===t?"scrollTop":"scrollLeft";o[t]=e.target.getBoundingClientRect()[t]+document.body[n]+document.documentElement[n]+"px"}),["height","width"].forEach(function(t){o[t]=e.target.getBoundingClientRect()[t]+"px"})):n.originalPosition=(0,s.getStyle)(t,"position"),Object.keys(o).forEach(function(e){n.$el.style[e]=o[e]})}(e,t,n),"absolute"!==n.originalPosition&&"fixed"!==n.originalPosition&&(0,s.addClass)(t,"el-loading-parent--relative"),e.fullscreen&&e.lock&&(0,s.addClass)(t,"el-loading-parent--hidden"),t.appendChild(n.$el),r.default.nextTick(function(){n.visible=!0}),e.fullscreen&&(u=n),n}}},49:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(318),r=n.n(o),i=n(319),s=n(0)(r.a,i.a,!1,null,null,null);t.default=s.exports},5:function(e,t){e.exports=n(4)},9:function(e,t){e.exports=n(10)}})},function(e,t,n){"use strict";var o,r;"function"==typeof Symbol&&Symbol.iterator;!function(i,s){void 0===(r="function"==typeof(o=s)?o.call(t,n,t,e):o)||(e.exports=r)}(0,function(){function e(e,t,n){this._reference=e.jquery?e[0]:e,this.state={};var o=void 0===t||null===t,r=t&&"[object Object]"===Object.prototype.toString.call(t);return this._popper=o||r?this.parse(r?t:{}):t.jquery?t[0]:t,this._options=Object.assign({},h,n),this._options.modifiers=this._options.modifiers.map(function(e){if(-1===this._options.modifiersIgnored.indexOf(e))return"applyStyle"===e&&this._popper.setAttribute("x-placement",this._options.placement),this.modifiers[e]||e}.bind(this)),this.state.position=this._getPosition(this._popper,this._reference),c(this._popper,{position:this.state.position,top:0}),this.update(),this._setupEventListeners(),this}function t(e){var t=e.style.display,n=e.style.visibility;e.style.display="block",e.style.visibility="hidden";e.offsetWidth;var o=d.getComputedStyle(e),r=parseFloat(o.marginTop)+parseFloat(o.marginBottom),i=parseFloat(o.marginLeft)+parseFloat(o.marginRight),s={width:e.offsetWidth+i,height:e.offsetHeight+r};return e.style.display=t,e.style.visibility=n,s}function n(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function o(e){var t=Object.assign({},e);return t.right=t.left+t.width,t.bottom=t.top+t.height,t}function r(e,t){var n,o=0;for(n in e){if(e[n]===t)return o;o++}return null}function i(e,t){return d.getComputedStyle(e,null)[t]}function s(e){var t=e.offsetParent;return t!==d.document.body&&t?t:d.document.documentElement}function a(e){var t=e.parentNode;return t?t===d.document?d.document.body.scrollTop?d.document.body:d.document.documentElement:-1!==["scroll","auto"].indexOf(i(t,"overflow"))||-1!==["scroll","auto"].indexOf(i(t,"overflow-x"))||-1!==["scroll","auto"].indexOf(i(t,"overflow-y"))?t:a(e.parentNode):e}function l(e){return e!==d.document.body&&("fixed"===i(e,"position")||(e.parentNode?l(e.parentNode):e))}function c(e,t){Object.keys(t).forEach(function(n){var o="";-1!==["width","height","top","right","bottom","left"].indexOf(n)&&function(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}(t[n])&&(o="px"),e.style[n]=t[n]+o})}function u(e){var t={width:e.offsetWidth,height:e.offsetHeight,left:e.offsetLeft,top:e.offsetTop};return t.right=t.left+t.width,t.bottom=t.top+t.height,t}function f(e){var t=e.getBoundingClientRect(),n=-1!=navigator.userAgent.indexOf("MSIE")&&"HTML"===e.tagName?-e.scrollTop:t.top;return{left:t.left,top:n,right:t.right,bottom:t.bottom,width:t.right-t.left,height:t.bottom-n}}function p(e){for(var t=["","ms","webkit","moz","o"],n=0;n<t.length;n++){var o=t[n]?t[n]+e.charAt(0).toUpperCase()+e.slice(1):e;if(void 0!==d.document.body.style[o])return o}return null}var d=window,h={placement:"bottom",gpuAcceleration:!0,offset:0,boundariesElement:"viewport",boundariesPadding:5,preventOverflowOrder:["left","right","top","bottom"],flipBehavior:"flip",arrowElement:"[x-arrow]",modifiers:["shift","offset","preventOverflow","keepTogether","arrow","flip","applyStyle"],modifiersIgnored:[],forceAbsolute:!1};return e.prototype.destroy=function(){return this._popper.removeAttribute("x-placement"),this._popper.style.left="",this._popper.style.position="",this._popper.style.top="",this._popper.style[p("transform")]="",this._removeEventListeners(),this._options.removeOnDestroy&&this._popper.remove(),this},e.prototype.update=function(){var e={instance:this,styles:{}};e.placement=this._options.placement,e._originalPlacement=this._options.placement,e.offsets=this._getOffsets(this._popper,this._reference,e.placement),e.boundaries=this._getBoundaries(e,this._options.boundariesPadding,this._options.boundariesElement),e=this.runModifiers(e,this._options.modifiers),"function"==typeof this.state.updateCallback&&this.state.updateCallback(e)},e.prototype.onCreate=function(e){return e(this),this},e.prototype.onUpdate=function(e){return this.state.updateCallback=e,this},e.prototype.parse=function(e){function t(e,t){t.forEach(function(t){e.classList.add(t)})}function n(e,t){t.forEach(function(t){e.setAttribute(t.split(":")[0],t.split(":")[1]||"")})}var o={tagName:"div",classNames:["popper"],attributes:[],parent:d.document.body,content:"",contentType:"text",arrowTagName:"div",arrowClassNames:["popper__arrow"],arrowAttributes:["x-arrow"]};e=Object.assign({},o,e);var r=d.document,i=r.createElement(e.tagName);if(t(i,e.classNames),n(i,e.attributes),"node"===e.contentType?i.appendChild(e.content.jquery?e.content[0]:e.content):"html"===e.contentType?i.innerHTML=e.content:i.textContent=e.content,e.arrowTagName){var s=r.createElement(e.arrowTagName);t(s,e.arrowClassNames),n(s,e.arrowAttributes),i.appendChild(s)}var a=e.parent.jquery?e.parent[0]:e.parent;if("string"==typeof a){if((a=r.querySelectorAll(e.parent)).length>1&&console.warn("WARNING: the given `parent` query("+e.parent+") matched more than one element, the first one will be used"),0===a.length)throw"ERROR: the given `parent` doesn't exists!";a=a[0]}return a.length>1&&a instanceof Element==!1&&(console.warn("WARNING: you have passed as parent a list of elements, the first one will be used"),a=a[0]),a.appendChild(i),i},e.prototype._getPosition=function(e,t){s(t);if(this._options.forceAbsolute)return"absolute";return l(t)?"fixed":"absolute"},e.prototype._getOffsets=function(e,n,o){o=o.split("-")[0];var r={};r.position=this.state.position;var i="fixed"===r.position,l=function(e,t,n){var o=f(e),r=f(t);if(n){var i=a(t);r.top+=i.scrollTop,r.bottom+=i.scrollTop,r.left+=i.scrollLeft,r.right+=i.scrollLeft}return{top:o.top-r.top,left:o.left-r.left,bottom:o.top-r.top+o.height,right:o.left-r.left+o.width,width:o.width,height:o.height}}(n,s(e),i),c=t(e);return-1!==["right","left"].indexOf(o)?(r.top=l.top+l.height/2-c.height/2,r.left="left"===o?l.left-c.width:l.right):(r.left=l.left+l.width/2-c.width/2,r.top="top"===o?l.top-c.height:l.bottom),r.width=c.width,r.height=c.height,{popper:r,reference:l}},e.prototype._setupEventListeners=function(){if(this.state.updateBound=this.update.bind(this),d.addEventListener("resize",this.state.updateBound),"window"!==this._options.boundariesElement){var e=a(this._reference);e!==d.document.body&&e!==d.document.documentElement||(e=d),e.addEventListener("scroll",this.state.updateBound)}},e.prototype._removeEventListeners=function(){if(d.removeEventListener("resize",this.state.updateBound),"window"!==this._options.boundariesElement){var e=a(this._reference);e!==d.document.body&&e!==d.document.documentElement||(e=d),e.removeEventListener("scroll",this.state.updateBound)}this.state.updateBound=null},e.prototype._getBoundaries=function(e,t,n){var o,r={};if("window"===n){var i=d.document.body,l=d.document.documentElement;o=Math.max(i.scrollHeight,i.offsetHeight,l.clientHeight,l.scrollHeight,l.offsetHeight),r={top:0,right:Math.max(i.scrollWidth,i.offsetWidth,l.clientWidth,l.scrollWidth,l.offsetWidth),bottom:o,left:0}}else if("viewport"===n){var c=s(this._popper),f=a(this._popper),p=u(c),h="fixed"===e.offsets.popper.position?0:function(e){return e==document.body?Math.max(document.documentElement.scrollTop,document.body.scrollTop):e.scrollTop}(f),m="fixed"===e.offsets.popper.position?0:function(e){return e==document.body?Math.max(document.documentElement.scrollLeft,document.body.scrollLeft):e.scrollLeft}(f);r={top:0-(p.top-h),right:d.document.documentElement.clientWidth-(p.left-m),bottom:d.document.documentElement.clientHeight-(p.top-h),left:0-(p.left-m)}}else r=s(this._popper)===n?{top:0,left:0,right:n.clientWidth,bottom:n.clientHeight}:u(n);return r.left+=t,r.right-=t,r.top=r.top+t,r.bottom=r.bottom-t,r},e.prototype.runModifiers=function(e,t,n){var o=t.slice();return void 0!==n&&(o=this._options.modifiers.slice(0,r(this._options.modifiers,n))),o.forEach(function(t){(function(e){return e&&"[object Function]"==={}.toString.call(e)})(t)&&(e=t.call(this,e))}.bind(this)),e},e.prototype.isModifierRequired=function(e,t){var n=r(this._options.modifiers,e);return!!this._options.modifiers.slice(0,n).filter(function(e){return e===t}).length},e.prototype.modifiers={},e.prototype.modifiers.applyStyle=function(e){var t,n={position:e.offsets.popper.position},o=Math.round(e.offsets.popper.left),r=Math.round(e.offsets.popper.top);return this._options.gpuAcceleration&&(t=p("transform"))?(n[t]="translate3d("+o+"px, "+r+"px, 0)",n.top=0,n.left=0):(n.left=o,n.top=r),Object.assign(n,e.styles),c(this._popper,n),this._popper.setAttribute("x-placement",e.placement),this.isModifierRequired(this.modifiers.applyStyle,this.modifiers.arrow)&&e.offsets.arrow&&c(e.arrowElement,e.offsets.arrow),e},e.prototype.modifiers.shift=function(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var i=e.offsets.reference,s=o(e.offsets.popper),a={y:{start:{top:i.top},end:{top:i.top+i.height-s.height}},x:{start:{left:i.left},end:{left:i.left+i.width-s.width}}},l=-1!==["bottom","top"].indexOf(n)?"x":"y";e.offsets.popper=Object.assign(s,a[l][r])}return e},e.prototype.modifiers.preventOverflow=function(e){var t=this._options.preventOverflowOrder,n=o(e.offsets.popper),r={left:function(){var t=n.left;return n.left<e.boundaries.left&&(t=Math.max(n.left,e.boundaries.left)),{left:t}},right:function(){var t=n.left;return n.right>e.boundaries.right&&(t=Math.min(n.left,e.boundaries.right-n.width)),{left:t}},top:function(){var t=n.top;return n.top<e.boundaries.top&&(t=Math.max(n.top,e.boundaries.top)),{top:t}},bottom:function(){var t=n.top;return n.bottom>e.boundaries.bottom&&(t=Math.min(n.top,e.boundaries.bottom-n.height)),{top:t}}};return t.forEach(function(t){e.offsets.popper=Object.assign(n,r[t]())}),e},e.prototype.modifiers.keepTogether=function(e){var t=o(e.offsets.popper),n=e.offsets.reference,r=Math.floor;return t.right<r(n.left)&&(e.offsets.popper.left=r(n.left)-t.width),t.left>r(n.right)&&(e.offsets.popper.left=r(n.right)),t.bottom<r(n.top)&&(e.offsets.popper.top=r(n.top)-t.height),t.top>r(n.bottom)&&(e.offsets.popper.top=r(n.bottom)),e},e.prototype.modifiers.flip=function(e){if(!this.isModifierRequired(this.modifiers.flip,this.modifiers.preventOverflow))return console.warn("WARNING: preventOverflow modifier is required by flip modifier in order to work, be sure to include it before flip!"),e;if(e.flipped&&e.placement===e._originalPlacement)return e;var t=e.placement.split("-")[0],r=n(t),i=e.placement.split("-")[1]||"",s=[];return(s="flip"===this._options.flipBehavior?[t,r]:this._options.flipBehavior).forEach(function(a,l){if(t===a&&s.length!==l+1){t=e.placement.split("-")[0],r=n(t);var c=o(e.offsets.popper),u=-1!==["right","bottom"].indexOf(t);(u&&Math.floor(e.offsets.reference[t])>Math.floor(c[r])||!u&&Math.floor(e.offsets.reference[t])<Math.floor(c[r]))&&(e.flipped=!0,e.placement=s[l+1],i&&(e.placement+="-"+i),e.offsets.popper=this._getOffsets(this._popper,this._reference,e.placement).popper,e=this.runModifiers(e,this._options.modifiers,this._flip))}}.bind(this)),e},e.prototype.modifiers.offset=function(e){var t=this._options.offset,n=e.offsets.popper;return-1!==e.placement.indexOf("left")?n.top-=t:-1!==e.placement.indexOf("right")?n.top+=t:-1!==e.placement.indexOf("top")?n.left-=t:-1!==e.placement.indexOf("bottom")&&(n.left+=t),e},e.prototype.modifiers.arrow=function(e){var n=this._options.arrowElement;if("string"==typeof n&&(n=this._popper.querySelector(n)),!n)return e;if(!this._popper.contains(n))return console.warn("WARNING: `arrowElement` must be child of its popper element!"),e;if(!this.isModifierRequired(this.modifiers.arrow,this.modifiers.keepTogether))return console.warn("WARNING: keepTogether modifier is required by arrow modifier in order to work, be sure to include it before arrow!"),e;var r={},i=e.placement.split("-")[0],s=o(e.offsets.popper),a=e.offsets.reference,l=-1!==["left","right"].indexOf(i),c=l?"height":"width",u=l?"top":"left",f=l?"left":"top",p=l?"bottom":"right",d=t(n)[c];a[p]-d<s[u]&&(e.offsets.popper[u]-=s[u]-(a[p]-d)),a[u]+d>s[p]&&(e.offsets.popper[u]+=a[u]+d-s[p]);var h=a[u]+a[c]/2-d/2-s[u];return h=Math.max(Math.min(s[c]-d-8,h),8),r[u]=h,r[f]="",e.offsets.arrow=r,e.arrowElement=n,e},Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(void 0===e||null===e)throw new TypeError("Cannot convert first argument to object");for(var t=Object(e),n=1;n<arguments.length;n++){var o=arguments[n];if(void 0!==o&&null!==o){o=Object(o);for(var r=Object.keys(o),i=0,s=r.length;i<s;i++){var a=r[i],l=Object.getOwnPropertyDescriptor(o,a);void 0!==l&&l.enumerable&&(t[a]=o[a])}}}return t}}),e})},function(e,t,n){var o=n(95);"string"==typeof o&&(o=[[e.i,o,""]]);var r={};r.transform=void 0;n(1)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){(e.exports=n(0)(void 0)).push([e.i,'.el-input{position:relative;font-size:14px;display:inline-block;width:100%}.el-input::-webkit-scrollbar{z-index:11;width:6px}.el-input::-webkit-scrollbar:horizontal{height:6px}.el-input::-webkit-scrollbar-thumb{border-radius:5px;width:6px;background:#b4bccc}.el-input::-webkit-scrollbar-corner,.el-input::-webkit-scrollbar-track{background:#fff}.el-input::-webkit-scrollbar-track-piece{background:#fff;width:6px}.el-input .el-input__clear{color:#c0c4cc;font-size:14px;line-height:16px;cursor:pointer;-webkit-transition:color .2s cubic-bezier(.645,.045,.355,1);transition:color .2s cubic-bezier(.645,.045,.355,1)}.el-input .el-input__clear:hover{color:#909399}.el-input__inner{-webkit-appearance:none;background-color:#fff;background-image:none;border-radius:4px;border:1px solid #dcdfe6;-webkit-box-sizing:border-box;box-sizing:border-box;color:#606266;display:inline-block;font-size:inherit;height:40px;line-height:1;outline:0;padding:0 15px;-webkit-transition:border-color .2s cubic-bezier(.645,.045,.355,1);transition:border-color .2s cubic-bezier(.645,.045,.355,1);width:100%}.el-input__prefix,.el-input__suffix{position:absolute;top:0;-webkit-transition:all .3s;text-align:center;height:100%;color:#c0c4cc}.el-input__inner::-webkit-input-placeholder{color:#c0c4cc}.el-input__inner:-ms-input-placeholder{color:#c0c4cc}.el-input__inner::placeholder{color:#c0c4cc}.el-input__inner:hover{border-color:#c0c4cc}.el-input.is-active .el-input__inner,.el-input__inner:focus{border-color:#409eff;outline:0}.el-input__suffix{right:5px;transition:all .3s;pointer-events:none}.el-input__suffix-inner{pointer-events:all}.el-input__prefix{left:5px;transition:all .3s}.el-input__icon{height:100%;width:25px;text-align:center;-webkit-transition:all .3s;transition:all .3s;line-height:40px}.el-input__icon:after{content:"";height:100%;width:0;display:inline-block;vertical-align:middle}.el-input__validateIcon{pointer-events:none}.el-input.is-disabled .el-input__inner{background-color:#f5f7fa;border-color:#e4e7ed;color:#c0c4cc;cursor:not-allowed}.el-input.is-disabled .el-input__inner::-webkit-input-placeholder{color:#c0c4cc}.el-input.is-disabled .el-input__inner:-ms-input-placeholder{color:#c0c4cc}.el-input.is-disabled .el-input__inner::placeholder{color:#c0c4cc}.el-input.is-disabled .el-input__icon{cursor:not-allowed}.el-input--suffix .el-input__inner{padding-right:30px}.el-input--prefix .el-input__inner{padding-left:30px}.el-input--medium{font-size:14px}.el-input--medium .el-input__inner{height:36px}.el-input--medium .el-input__icon{line-height:36px}.el-input--small{font-size:13px}.el-input--small .el-input__inner{height:32px}.el-input--small .el-input__icon{line-height:32px}.el-input--mini{font-size:12px}.el-input--mini .el-input__inner{height:28px}.el-input--mini .el-input__icon{line-height:28px}.el-input-group{line-height:normal;display:inline-table;width:100%;border-collapse:separate}.el-input-group>.el-input__inner{vertical-align:middle;display:table-cell}.el-input-group__append,.el-input-group__prepend{background-color:#f5f7fa;color:#909399;vertical-align:middle;display:table-cell;position:relative;border:1px solid #dcdfe6;border-radius:4px;padding:0 20px;width:1px;white-space:nowrap}.el-input-group--prepend .el-input__inner,.el-input-group__append{border-top-left-radius:0;border-bottom-left-radius:0}.el-input-group--append .el-input__inner,.el-input-group__prepend{border-top-right-radius:0;border-bottom-right-radius:0}.el-input-group__append:focus,.el-input-group__prepend:focus{outline:0}.el-input-group__append .el-button,.el-input-group__append .el-select,.el-input-group__prepend .el-button,.el-input-group__prepend .el-select{display:inline-block;margin:-20px}.el-input-group__append button.el-button,.el-input-group__append div.el-select .el-input__inner,.el-input-group__append div.el-select:hover .el-input__inner,.el-input-group__prepend button.el-button,.el-input-group__prepend div.el-select .el-input__inner,.el-input-group__prepend div.el-select:hover .el-input__inner{border-color:transparent;background-color:transparent;color:inherit;border-top:0;border-bottom:0}.el-input-group__append .el-button,.el-input-group__append .el-input,.el-input-group__prepend .el-button,.el-input-group__prepend .el-input{font-size:inherit}.el-input-group__prepend{border-right:0}.el-input-group__append{border-left:0}.el-textarea{display:inline-block;width:100%;vertical-align:bottom;font-size:14px}.el-textarea__inner{display:block;resize:vertical;padding:5px 15px;line-height:1.5;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;font-size:inherit;color:#606266;background-color:#fff;background-image:none;border:1px solid #dcdfe6;border-radius:4px;-webkit-transition:border-color .2s cubic-bezier(.645,.045,.355,1);transition:border-color .2s cubic-bezier(.645,.045,.355,1)}.el-textarea__inner::-webkit-input-placeholder{color:#c0c4cc}.el-textarea__inner:-ms-input-placeholder{color:#c0c4cc}.el-textarea__inner::placeholder{color:#c0c4cc}.el-textarea__inner:hover{border-color:#c0c4cc}.el-textarea__inner:focus{outline:0;border-color:#409eff}.el-textarea.is-disabled .el-textarea__inner{background-color:#f5f7fa;border-color:#e4e7ed;color:#c0c4cc;cursor:not-allowed}.el-textarea.is-disabled .el-textarea__inner::-webkit-input-placeholder{color:#c0c4cc}.el-textarea.is-disabled .el-textarea__inner:-ms-input-placeholder{color:#c0c4cc}.el-textarea.is-disabled .el-textarea__inner::placeholder{color:#c0c4cc}',""])},function(e,t,n){var o=n(97);"string"==typeof o&&(o=[[e.i,o,""]]);var r={};r.transform=void 0;n(1)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){(e.exports=n(0)(void 0)).push([e.i,".el-select-dropdown__item{font-size:14px;padding:0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#606266;height:34px;line-height:34px;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer}.el-select-dropdown__item.is-disabled{color:#c0c4cc;cursor:not-allowed}.el-select-dropdown__item.is-disabled:hover{background-color:#fff}.el-select-dropdown__item.hover,.el-select-dropdown__item:hover{background-color:#f5f7fa}.el-select-dropdown__item.selected{color:#409eff;font-weight:700}.el-select-dropdown__item span{line-height:34px!important}",""])},function(e,t,n){var o=n(99);"string"==typeof o&&(o=[[e.i,o,""]]);var r={};r.transform=void 0;n(1)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){(e.exports=n(0)(void 0)).push([e.i,'.el-button{display:inline-block;line-height:1;white-space:nowrap;cursor:pointer;background:#fff;border:1px solid #dcdfe6;color:#606266;-webkit-appearance:none;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;outline:0;margin:0;-webkit-transition:.1s;transition:.1s;font-weight:500;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;padding:12px 20px;font-size:14px;border-radius:4px}.el-button+.el-button{margin-left:10px}.el-button:focus,.el-button:hover{color:#409eff;border-color:#c6e2ff;background-color:#ecf5ff}.el-button:active{color:#3a8ee6;border-color:#3a8ee6;outline:0}.el-button::-moz-focus-inner{border:0}.el-button [class*=el-icon-]+span{margin-left:5px}.el-button.is-plain:focus,.el-button.is-plain:hover{background:#fff;border-color:#409eff;color:#409eff}.el-button.is-active,.el-button.is-plain:active{color:#3a8ee6;border-color:#3a8ee6}.el-button.is-plain:active{background:#fff;outline:0}.el-button.is-disabled,.el-button.is-disabled:focus,.el-button.is-disabled:hover{color:#c0c4cc;cursor:not-allowed;background-image:none;background-color:#fff;border-color:#ebeef5}.el-button.is-disabled.el-button--text{background-color:transparent}.el-button.is-disabled.is-plain,.el-button.is-disabled.is-plain:focus,.el-button.is-disabled.is-plain:hover{background-color:#fff;border-color:#ebeef5;color:#c0c4cc}.el-button.is-loading{position:relative;pointer-events:none}.el-button.is-loading:before{pointer-events:none;content:"";position:absolute;left:-1px;top:-1px;right:-1px;bottom:-1px;border-radius:inherit;background-color:hsla(0,0%,100%,.35)}.el-button.is-round{border-radius:20px;padding:12px 23px}.el-button--primary{color:#fff;background-color:#409eff;border-color:#409eff}.el-button--primary:focus,.el-button--primary:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}.el-button--primary.is-active,.el-button--primary:active{background:#3a8ee6;border-color:#3a8ee6;color:#fff}.el-button--primary:active{outline:0}.el-button--primary.is-disabled,.el-button--primary.is-disabled:active,.el-button--primary.is-disabled:focus,.el-button--primary.is-disabled:hover{color:#fff;background-color:#a0cfff;border-color:#a0cfff}.el-button--primary.is-plain{color:#409eff;background:#ecf5ff;border-color:#b3d8ff}.el-button--primary.is-plain:focus,.el-button--primary.is-plain:hover{background:#409eff;border-color:#409eff;color:#fff}.el-button--primary.is-plain:active{background:#3a8ee6;border-color:#3a8ee6;color:#fff;outline:0}.el-button--primary.is-plain.is-disabled,.el-button--primary.is-plain.is-disabled:active,.el-button--primary.is-plain.is-disabled:focus,.el-button--primary.is-plain.is-disabled:hover{color:#8cc5ff;background-color:#ecf5ff;border-color:#d9ecff}.el-button--success{color:#fff;background-color:#67c23a;border-color:#67c23a}.el-button--success:focus,.el-button--success:hover{background:#85ce61;border-color:#85ce61;color:#fff}.el-button--success.is-active,.el-button--success:active{background:#5daf34;border-color:#5daf34;color:#fff}.el-button--success:active{outline:0}.el-button--success.is-disabled,.el-button--success.is-disabled:active,.el-button--success.is-disabled:focus,.el-button--success.is-disabled:hover{color:#fff;background-color:#b3e19d;border-color:#b3e19d}.el-button--success.is-plain{color:#67c23a;background:#f0f9eb;border-color:#c2e7b0}.el-button--success.is-plain:focus,.el-button--success.is-plain:hover{background:#67c23a;border-color:#67c23a;color:#fff}.el-button--success.is-plain:active{background:#5daf34;border-color:#5daf34;color:#fff;outline:0}.el-button--success.is-plain.is-disabled,.el-button--success.is-plain.is-disabled:active,.el-button--success.is-plain.is-disabled:focus,.el-button--success.is-plain.is-disabled:hover{color:#a4da89;background-color:#f0f9eb;border-color:#e1f3d8}.el-button--warning{color:#fff;background-color:#e6a23c;border-color:#e6a23c}.el-button--warning:focus,.el-button--warning:hover{background:#ebb563;border-color:#ebb563;color:#fff}.el-button--warning.is-active,.el-button--warning:active{background:#cf9236;border-color:#cf9236;color:#fff}.el-button--warning:active{outline:0}.el-button--warning.is-disabled,.el-button--warning.is-disabled:active,.el-button--warning.is-disabled:focus,.el-button--warning.is-disabled:hover{color:#fff;background-color:#f3d19e;border-color:#f3d19e}.el-button--warning.is-plain{color:#e6a23c;background:#fdf6ec;border-color:#f5dab1}.el-button--warning.is-plain:focus,.el-button--warning.is-plain:hover{background:#e6a23c;border-color:#e6a23c;color:#fff}.el-button--warning.is-plain:active{background:#cf9236;border-color:#cf9236;color:#fff;outline:0}.el-button--warning.is-plain.is-disabled,.el-button--warning.is-plain.is-disabled:active,.el-button--warning.is-plain.is-disabled:focus,.el-button--warning.is-plain.is-disabled:hover{color:#f0c78a;background-color:#fdf6ec;border-color:#faecd8}.el-button--danger{color:#fff;background-color:#f56c6c;border-color:#f56c6c}.el-button--danger:focus,.el-button--danger:hover{background:#f78989;border-color:#f78989;color:#fff}.el-button--danger.is-active,.el-button--danger:active{background:#dd6161;border-color:#dd6161;color:#fff}.el-button--danger:active{outline:0}.el-button--danger.is-disabled,.el-button--danger.is-disabled:active,.el-button--danger.is-disabled:focus,.el-button--danger.is-disabled:hover{color:#fff;background-color:#fab6b6;border-color:#fab6b6}.el-button--danger.is-plain{color:#f56c6c;background:#fef0f0;border-color:#fbc4c4}.el-button--danger.is-plain:focus,.el-button--danger.is-plain:hover{background:#f56c6c;border-color:#f56c6c;color:#fff}.el-button--danger.is-plain:active{background:#dd6161;border-color:#dd6161;color:#fff;outline:0}.el-button--danger.is-plain.is-disabled,.el-button--danger.is-plain.is-disabled:active,.el-button--danger.is-plain.is-disabled:focus,.el-button--danger.is-plain.is-disabled:hover{color:#f9a7a7;background-color:#fef0f0;border-color:#fde2e2}.el-button--info{color:#fff;background-color:#909399;border-color:#909399}.el-button--info:focus,.el-button--info:hover{background:#a6a9ad;border-color:#a6a9ad;color:#fff}.el-button--info.is-active,.el-button--info:active{background:#82848a;border-color:#82848a;color:#fff}.el-button--info:active{outline:0}.el-button--info.is-disabled,.el-button--info.is-disabled:active,.el-button--info.is-disabled:focus,.el-button--info.is-disabled:hover{color:#fff;background-color:#c8c9cc;border-color:#c8c9cc}.el-button--info.is-plain{color:#909399;background:#f4f4f5;border-color:#d3d4d6}.el-button--info.is-plain:focus,.el-button--info.is-plain:hover{background:#909399;border-color:#909399;color:#fff}.el-button--info.is-plain:active{background:#82848a;border-color:#82848a;color:#fff;outline:0}.el-button--info.is-plain.is-disabled,.el-button--info.is-plain.is-disabled:active,.el-button--info.is-plain.is-disabled:focus,.el-button--info.is-plain.is-disabled:hover{color:#bcbec2;background-color:#f4f4f5;border-color:#e9e9eb}.el-button--text,.el-button--text.is-disabled,.el-button--text.is-disabled:focus,.el-button--text.is-disabled:hover,.el-button--text:active{border-color:transparent}.el-button--medium{padding:10px 20px;font-size:14px;border-radius:4px}.el-button--mini,.el-button--small{font-size:12px;border-radius:3px}.el-button--medium.is-round{padding:10px 20px}.el-button--small,.el-button--small.is-round{padding:9px 15px}.el-button--mini,.el-button--mini.is-round{padding:7px 15px}.el-button--text{color:#409eff;background:0 0;padding-left:0;padding-right:0}.el-button--text:focus,.el-button--text:hover{color:#66b1ff;border-color:transparent;background-color:transparent}.el-button--text:active{color:#3a8ee6;background-color:transparent}.el-button-group{display:inline-block;vertical-align:middle}.el-button-group:after,.el-button-group:before{display:table;content:""}.el-button-group:after{clear:both}.el-button-group .el-button{float:left;position:relative}.el-button-group .el-button+.el-button{margin-left:0}.el-button-group .el-button:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.el-button-group .el-button:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.el-button-group .el-button:not(:first-child):not(:last-child){border-radius:0}.el-button-group .el-button:not(:last-child){margin-right:-1px}.el-button-group .el-button.is-active,.el-button-group .el-button:active,.el-button-group .el-button:focus,.el-button-group .el-button:hover{z-index:1}.el-button-group .el-button--primary:first-child{border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--primary:last-child{border-left-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--primary:not(:first-child):not(:last-child){border-left-color:hsla(0,0%,100%,.5);border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--success:first-child{border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--success:last-child{border-left-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--success:not(:first-child):not(:last-child){border-left-color:hsla(0,0%,100%,.5);border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--warning:first-child{border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--warning:last-child{border-left-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--warning:not(:first-child):not(:last-child){border-left-color:hsla(0,0%,100%,.5);border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--danger:first-child{border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--danger:last-child{border-left-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--danger:not(:first-child):not(:last-child){border-left-color:hsla(0,0%,100%,.5);border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--info:first-child{border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--info:last-child{border-left-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--info:not(:first-child):not(:last-child){border-left-color:hsla(0,0%,100%,.5);border-right-color:hsla(0,0%,100%,.5)}',""])},function(e,t,n){"use strict";t.__esModule=!0,t.default={el:{colorpicker:{confirm:"确定",clear:"清空"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!"},upload:{deleteTip:"按 delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"}}}},function(e,t,n){"use strict";function o(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===l}(e)}function r(e,t){return t&&!0===t.clone&&a(e)?s(function(e){return Array.isArray(e)?[]:{}}(e),e,t):e}function i(e,t,n){var o=e.slice();return t.forEach(function(t,i){void 0===o[i]?o[i]=r(t,n):a(t)?o[i]=s(e[i],t,n):-1===e.indexOf(t)&&o.push(r(t,n))}),o}function s(e,t,n){var o=Array.isArray(t);if(o===Array.isArray(e)){if(o){return((n||{arrayMerge:i}).arrayMerge||i)(e,t,n)}return function(e,t,n){var o={};return a(e)&&Object.keys(e).forEach(function(t){o[t]=r(e[t],n)}),Object.keys(t).forEach(function(i){a(t[i])&&e[i]?o[i]=s(e[i],t[i],n):o[i]=r(t[i],n)}),o}(e,t,n)}return r(t,n)}var a=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!o(e)},l="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;s.all=function(e,t){if(!Array.isArray(e)||e.length<2)throw new Error("first argument should be an array with at least two elements");return e.reduce(function(e,n){return s(e,n,t)})};var c=s;e.exports=c},function(e,t,n){"use strict";t.__esModule=!0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=function(e){return function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];return 1===n.length&&"object"===o(n[0])&&(n=n[0]),n&&n.hasOwnProperty||(n={}),e.replace(i,function(t,o,i,s){var a=void 0;return"{"===e[s-1]&&"}"===e[s+t.length]?i:null===(a=(0,r.hasOwn)(n,i)?n[i]:null)||void 0===a?"":a})}};var r=n(5),i=/(%|)\{([0-9a-zA-Z_]+)\}/g},function(e,t,n){var o=n(104);"string"==typeof o&&(o=[[e.i,o,""]]);var r={};r.transform=void 0;n(1)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){(e.exports=n(0)(void 0)).push([e.i,'.el-popper .popper__arrow,.el-popper .popper__arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.el-popper .popper__arrow{border-width:6px;-webkit-filter:drop-shadow(0 2px 12px rgba(0,0,0,.03));filter:drop-shadow(0 2px 12px rgba(0,0,0,.03))}.el-popper .popper__arrow:after{content:" ";border-width:6px}.el-popper[x-placement^=top]{margin-bottom:12px}.el-popper[x-placement^=top] .popper__arrow{bottom:-6px;left:50%;margin-right:3px;border-top-color:#ebeef5;border-bottom-width:0}.el-popper[x-placement^=top] .popper__arrow:after{bottom:1px;margin-left:-6px;border-top-color:#fff;border-bottom-width:0}.el-popper[x-placement^=bottom]{margin-top:12px}.el-popper[x-placement^=bottom] .popper__arrow{top:-6px;left:50%;margin-right:3px;border-top-width:0;border-bottom-color:#ebeef5}.el-popper[x-placement^=bottom] .popper__arrow:after{top:1px;margin-left:-6px;border-top-width:0;border-bottom-color:#fff}.el-popper[x-placement^=right]{margin-left:12px}.el-popper[x-placement^=right] .popper__arrow{top:50%;left:-6px;margin-bottom:3px;border-right-color:#ebeef5;border-left-width:0}.el-popper[x-placement^=right] .popper__arrow:after{bottom:-6px;left:1px;border-right-color:#fff;border-left-width:0}.el-popper[x-placement^=left]{margin-right:12px}.el-popper[x-placement^=left] .popper__arrow{top:50%;right:-6px;margin-bottom:3px;border-right-width:0;border-left-color:#ebeef5}.el-popper[x-placement^=left] .popper__arrow:after{right:1px;bottom:-6px;margin-left:-6px;border-right-width:0;border-left-color:#fff}.el-popover{position:absolute;background:#fff;min-width:150px;border-radius:4px;border:1px solid #ebeef5;padding:12px;z-index:2000;color:#606266;line-height:1.4;text-align:justify;font-size:14px;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-popover--plain{padding:18px 20px}.el-popover__title{color:#303133;font-size:16px;line-height:1;margin-bottom:12px}.el-popover__reference:focus:hover,.el-popover__reference:focus:not(.focusing){outline-width:0}',""])},function(e,t,n){e.exports=function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=229)}({0:function(e,t){e.exports=function(e,t,n,o,r,i){var s,a=e=e||{},l=typeof e.default;"object"!==l&&"function"!==l||(s=e,a=e.default);var c="function"==typeof a?a.options:a;t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId=r);var u;if(i?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},c._ssrRegister=u):o&&(u=o),u){var f=c.functional,p=f?c.render:c.beforeCreate;f?(c._injectStyles=u,c.render=function(e,t){return u.call(t),p(e,t)}):c.beforeCreate=p?[].concat(p,u):[u]}return{esModule:s,exports:a,options:c}}},2:function(e,t){e.exports=n(6)},229:function(e,t,n){e.exports=n(230)},230:function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var r=o(n(231)),i=o(n(234));o(n(5)).default.directive("popover",i.default),r.default.install=function(e){e.directive("popover",i.default),e.component(r.default.name,r.default)},r.default.directive=i.default,t.default=r.default},231:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(232),r=n.n(o),i=n(233),s=n(0)(r.a,i.a,!1,null,null,null);t.default=s.exports},232:function(e,t,n){"use strict";t.__esModule=!0;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(8)),r=n(2),i=n(3);t.default={name:"ElPopover",mixins:[o.default],props:{trigger:{type:String,default:"click",validator:function(e){return["click","focus","hover","manual"].indexOf(e)>-1}},openDelay:{type:Number,default:0},title:String,disabled:Boolean,content:String,reference:{},popperClass:String,width:{},visibleArrow:{default:!0},transition:{type:String,default:"fade-in-linear"}},computed:{tooltipId:function(){return"el-popover-"+(0,i.generateId)()}},watch:{showPopper:function(e){e?this.$emit("show"):this.$emit("hide")}},mounted:function(){var e=this.referenceElm=this.reference||this.$refs.reference,t=this.popper||this.$refs.popper;if(!e&&this.$slots.reference&&this.$slots.reference[0]&&(e=this.referenceElm=this.$slots.reference[0].elm),e&&((0,r.addClass)(e,"el-popover__reference"),e.setAttribute("aria-describedby",this.tooltipId),e.setAttribute("tabindex",0),"click"!==this.trigger&&(0,r.on)(e,"focus",this.handleFocus),"click"!==this.trigger&&(0,r.on)(e,"blur",this.handleBlur),(0,r.on)(e,"keydown",this.handleKeydown),(0,r.on)(e,"click",this.handleClick)),"click"===this.trigger)(0,r.on)(e,"click",this.doToggle),(0,r.on)(document,"click",this.handleDocumentClick);else if("hover"===this.trigger)(0,r.on)(e,"mouseenter",this.handleMouseEnter),(0,r.on)(t,"mouseenter",this.handleMouseEnter),(0,r.on)(e,"mouseleave",this.handleMouseLeave),(0,r.on)(t,"mouseleave",this.handleMouseLeave);else if("focus"===this.trigger){var n=!1;if([].slice.call(e.children).length)for(var o=e.childNodes,i=o.length,s=0;s<i;s++)if("INPUT"===o[s].nodeName||"TEXTAREA"===o[s].nodeName){(0,r.on)(o[s],"focus",this.doShow),(0,r.on)(o[s],"blur",this.doClose),n=!0;break}if(n)return;"INPUT"===e.nodeName||"TEXTAREA"===e.nodeName?((0,r.on)(e,"focus",this.doShow),(0,r.on)(e,"blur",this.doClose)):((0,r.on)(e,"mousedown",this.doShow),(0,r.on)(e,"mouseup",this.doClose))}},methods:{doToggle:function(){this.showPopper=!this.showPopper},doShow:function(){this.showPopper=!0},doClose:function(){this.showPopper=!1},handleFocus:function(){(0,r.addClass)(this.referenceElm,"focusing"),"manual"!==this.trigger&&(this.showPopper=!0)},handleClick:function(){(0,r.removeClass)(this.referenceElm,"focusing")},handleBlur:function(){(0,r.removeClass)(this.referenceElm,"focusing"),"manual"!==this.trigger&&(this.showPopper=!1)},handleMouseEnter:function(){var e=this;clearTimeout(this._timer),this.openDelay?this._timer=setTimeout(function(){e.showPopper=!0},this.openDelay):this.showPopper=!0},handleKeydown:function(e){27===e.keyCode&&"manual"!==this.trigger&&this.doClose()},handleMouseLeave:function(){var e=this;clearTimeout(this._timer),this._timer=setTimeout(function(){e.showPopper=!1},200)},handleDocumentClick:function(e){var t=this.reference||this.$refs.reference,n=this.popper||this.$refs.popper;!t&&this.$slots.reference&&this.$slots.reference[0]&&(t=this.referenceElm=this.$slots.reference[0].elm),this.$el&&t&&!this.$el.contains(e.target)&&!t.contains(e.target)&&n&&!n.contains(e.target)&&(this.showPopper=!1)}},destroyed:function(){var e=this.reference;(0,r.off)(e,"click",this.doToggle),(0,r.off)(e,"mouseup",this.doClose),(0,r.off)(e,"mousedown",this.doShow),(0,r.off)(e,"focus",this.doShow),(0,r.off)(e,"blur",this.doClose),(0,r.off)(e,"mouseleave",this.handleMouseLeave),(0,r.off)(e,"mouseenter",this.handleMouseEnter),(0,r.off)(document,"click",this.handleDocumentClick)}}},233:function(e,t,n){"use strict";var o={render:function(){var e=this.$createElement,t=this._self._c||e;return t("span",[t("transition",{attrs:{name:this.transition},on:{"after-leave":this.doDestroy}},[t("div",{directives:[{name:"show",rawName:"v-show",value:!this.disabled&&this.showPopper,expression:"!disabled && showPopper"}],ref:"popper",staticClass:"el-popover el-popper",class:[this.popperClass,this.content&&"el-popover--plain"],style:{width:this.width+"px"},attrs:{role:"tooltip",id:this.tooltipId,"aria-hidden":this.disabled||!this.showPopper?"true":"false"}},[this.title?t("div",{staticClass:"el-popover__title",domProps:{textContent:this._s(this.title)}}):this._e(),this._t("default",[this._v(this._s(this.content))])],2)]),this._t("reference")],2)},staticRenderFns:[]};t.a=o},234:function(e,t,n){"use strict";t.__esModule=!0,t.default={bind:function(e,t,n){n.context.$refs[t.arg].$refs.reference=e}}},3:function(e,t){e.exports=n(5)},5:function(e,t){e.exports=n(4)},8:function(e,t){e.exports=n(12)}})},function(e,t,n){var o=n(107);"string"==typeof o&&(o=[[e.i,o,""]]);var r={};r.transform=void 0;n(1)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){(e.exports=n(0)(void 0)).push([e.i,'.el-popper .popper__arrow,.el-popper .popper__arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.el-popper .popper__arrow{border-width:6px;-webkit-filter:drop-shadow(0 2px 12px rgba(0,0,0,.03));filter:drop-shadow(0 2px 12px rgba(0,0,0,.03))}.el-popper .popper__arrow:after{content:" ";border-width:6px}.el-popper[x-placement^=top]{margin-bottom:12px}.el-popper[x-placement^=top] .popper__arrow{bottom:-6px;left:50%;margin-right:3px;border-top-color:#ebeef5;border-bottom-width:0}.el-popper[x-placement^=top] .popper__arrow:after{bottom:1px;margin-left:-6px;border-top-color:#fff;border-bottom-width:0}.el-popper[x-placement^=bottom]{margin-top:12px}.el-popper[x-placement^=bottom] .popper__arrow{top:-6px;left:50%;margin-right:3px;border-top-width:0;border-bottom-color:#ebeef5}.el-popper[x-placement^=bottom] .popper__arrow:after{top:1px;margin-left:-6px;border-top-width:0;border-bottom-color:#fff}.el-popper[x-placement^=right]{margin-left:12px}.el-popper[x-placement^=right] .popper__arrow{top:50%;left:-6px;margin-bottom:3px;border-right-color:#ebeef5;border-left-width:0}.el-popper[x-placement^=right] .popper__arrow:after{bottom:-6px;left:1px;border-right-color:#fff;border-left-width:0}.el-popper[x-placement^=left]{margin-right:12px}.el-popper[x-placement^=left] .popper__arrow{top:50%;right:-6px;margin-bottom:3px;border-right-width:0;border-left-color:#ebeef5}.el-popper[x-placement^=left] .popper__arrow:after{right:1px;bottom:-6px;margin-left:-6px;border-right-width:0;border-left-color:#fff}.el-select-dropdown{position:absolute;z-index:1001;border:1px solid #e4e7ed;border-radius:4px;background-color:#fff;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1);-webkit-box-sizing:border-box;box-sizing:border-box;margin:5px 0}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected{color:#409eff;background-color:#fff}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected.hover{background-color:#f5f7fa}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected:after{position:absolute;right:20px;font-family:element-icons;content:"\\E611";font-size:12px;font-weight:700;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.el-select-dropdown .el-scrollbar.is-empty .el-select-dropdown__list{padding:0}.el-select-dropdown .popper__arrow{-webkit-transform:translateX(-400%);transform:translateX(-400%)}.el-select-dropdown.is-arrow-fixed .popper__arrow{-webkit-transform:translateX(-200%);transform:translateX(-200%)}.el-select-dropdown__empty{padding:10px 0;margin:0;text-align:center;color:#999;font-size:14px}.el-select-dropdown__wrap{max-height:274px}.el-select-dropdown__list{list-style:none;padding:6px 0;margin:0;-webkit-box-sizing:border-box;box-sizing:border-box}.el-input{position:relative;font-size:14px;display:inline-block;width:100%}.el-input::-webkit-scrollbar{z-index:11;width:6px}.el-input::-webkit-scrollbar:horizontal{height:6px}.el-input::-webkit-scrollbar-thumb{border-radius:5px;width:6px;background:#b4bccc}.el-input::-webkit-scrollbar-corner,.el-input::-webkit-scrollbar-track{background:#fff}.el-input::-webkit-scrollbar-track-piece{background:#fff;width:6px}.el-input__inner,.el-textarea__inner{-webkit-box-sizing:border-box;background-image:none}.el-input .el-input__clear{color:#c0c4cc;font-size:14px;line-height:16px;cursor:pointer;-webkit-transition:color .2s cubic-bezier(.645,.045,.355,1);transition:color .2s cubic-bezier(.645,.045,.355,1)}.el-input .el-input__clear:hover{color:#909399}.el-input__inner{-webkit-appearance:none;background-color:#fff;border-radius:4px;border:1px solid #dcdfe6;box-sizing:border-box;color:#606266;display:inline-block;font-size:inherit;height:40px;line-height:1;outline:0;padding:0 15px;-webkit-transition:border-color .2s cubic-bezier(.645,.045,.355,1);transition:border-color .2s cubic-bezier(.645,.045,.355,1);width:100%}.el-input__prefix,.el-input__suffix{position:absolute;top:0;-webkit-transition:all .3s;height:100%;color:#c0c4cc;text-align:center}.el-input__inner::-webkit-input-placeholder{color:#c0c4cc}.el-input__inner:-ms-input-placeholder{color:#c0c4cc}.el-input__inner::placeholder{color:#c0c4cc}.el-input__inner:hover{border-color:#c0c4cc}.el-input.is-active .el-input__inner,.el-input__inner:focus{border-color:#409eff;outline:0}.el-input__suffix{right:5px;transition:all .3s;pointer-events:none}.el-input__suffix-inner{pointer-events:all}.el-input__prefix{left:5px;transition:all .3s}.el-input__icon{height:100%;width:25px;text-align:center;-webkit-transition:all .3s;transition:all .3s;line-height:40px}.el-input__icon:after{content:"";height:100%;width:0;display:inline-block;vertical-align:middle}.el-input__validateIcon{pointer-events:none}.el-input.is-disabled .el-input__inner{background-color:#f5f7fa;border-color:#e4e7ed;color:#c0c4cc;cursor:not-allowed}.el-input.is-disabled .el-input__inner::-webkit-input-placeholder{color:#c0c4cc}.el-input.is-disabled .el-input__inner:-ms-input-placeholder{color:#c0c4cc}.el-input.is-disabled .el-input__inner::placeholder{color:#c0c4cc}.el-input.is-disabled .el-input__icon{cursor:not-allowed}.el-input--suffix .el-input__inner{padding-right:30px}.el-input--prefix .el-input__inner{padding-left:30px}.el-input--medium{font-size:14px}.el-input--medium .el-input__inner{height:36px}.el-input--medium .el-input__icon{line-height:36px}.el-input--small{font-size:13px}.el-input--small .el-input__inner{height:32px}.el-input--small .el-input__icon{line-height:32px}.el-input--mini{font-size:12px}.el-input--mini .el-input__inner{height:28px}.el-input--mini .el-input__icon{line-height:28px}.el-input-group{line-height:normal;display:inline-table;width:100%;border-collapse:separate}.el-input-group>.el-input__inner{vertical-align:middle;display:table-cell}.el-input-group__append,.el-input-group__prepend{background-color:#f5f7fa;color:#909399;vertical-align:middle;display:table-cell;position:relative;border:1px solid #dcdfe6;border-radius:4px;padding:0 20px;width:1px;white-space:nowrap}.el-input-group--prepend .el-input__inner,.el-input-group__append{border-top-left-radius:0;border-bottom-left-radius:0}.el-input-group--append .el-input__inner,.el-input-group__prepend{border-top-right-radius:0;border-bottom-right-radius:0}.el-input-group__append:focus,.el-input-group__prepend:focus{outline:0}.el-input-group__append .el-button,.el-input-group__append .el-select,.el-input-group__prepend .el-button,.el-input-group__prepend .el-select{display:inline-block;margin:-20px}.el-input-group__append button.el-button,.el-input-group__append div.el-select .el-input__inner,.el-input-group__append div.el-select:hover .el-input__inner,.el-input-group__prepend button.el-button,.el-input-group__prepend div.el-select .el-input__inner,.el-input-group__prepend div.el-select:hover .el-input__inner{border-color:transparent;background-color:transparent;color:inherit;border-top:0;border-bottom:0}.el-input-group__append .el-button,.el-input-group__append .el-input,.el-input-group__prepend .el-button,.el-input-group__prepend .el-input{font-size:inherit}.el-input-group__prepend{border-right:0}.el-input-group__append{border-left:0}.el-textarea{display:inline-block;width:100%;vertical-align:bottom;font-size:14px}.el-textarea__inner{display:block;resize:vertical;padding:5px 15px;line-height:1.5;box-sizing:border-box;width:100%;font-size:inherit;color:#606266;background-color:#fff;border:1px solid #dcdfe6;border-radius:4px;-webkit-transition:border-color .2s cubic-bezier(.645,.045,.355,1);transition:border-color .2s cubic-bezier(.645,.045,.355,1)}.el-select-dropdown__item,.el-tag{white-space:nowrap;-webkit-box-sizing:border-box}.el-textarea__inner::-webkit-input-placeholder{color:#c0c4cc}.el-textarea__inner:-ms-input-placeholder{color:#c0c4cc}.el-textarea__inner::placeholder{color:#c0c4cc}.el-textarea__inner:hover{border-color:#c0c4cc}.el-textarea__inner:focus{outline:0;border-color:#409eff}.el-textarea.is-disabled .el-textarea__inner{background-color:#f5f7fa;border-color:#e4e7ed;color:#c0c4cc;cursor:not-allowed}.el-textarea.is-disabled .el-textarea__inner::-webkit-input-placeholder{color:#c0c4cc}.el-textarea.is-disabled .el-textarea__inner:-ms-input-placeholder{color:#c0c4cc}.el-textarea.is-disabled .el-textarea__inner::placeholder{color:#c0c4cc}.el-tag{background-color:rgba(64,158,255,.1);display:inline-block;padding:0 10px;height:32px;line-height:30px;font-size:12px;color:#409eff;border-radius:4px;box-sizing:border-box;border:1px solid rgba(64,158,255,.2)}.el-tag .el-icon-close{border-radius:50%;text-align:center;position:relative;cursor:pointer;font-size:12px;height:16px;width:16px;line-height:16px;vertical-align:middle;top:-1px;right:-5px;color:#409eff}.el-tag .el-icon-close:before{display:block}.el-tag .el-icon-close:hover{background-color:#409eff;color:#fff}.el-tag--info,.el-tag--info .el-tag__close{color:#909399}.el-tag--info{background-color:hsla(220,4%,58%,.1);border-color:hsla(220,4%,58%,.2)}.el-tag--info.is-hit{border-color:#909399}.el-tag--info .el-tag__close:hover{background-color:#909399;color:#fff}.el-tag--success{background-color:rgba(103,194,58,.1);border-color:rgba(103,194,58,.2);color:#67c23a}.el-tag--success.is-hit{border-color:#67c23a}.el-tag--success .el-tag__close{color:#67c23a}.el-tag--success .el-tag__close:hover{background-color:#67c23a;color:#fff}.el-tag--warning{background-color:rgba(230,162,60,.1);border-color:rgba(230,162,60,.2);color:#e6a23c}.el-tag--warning.is-hit{border-color:#e6a23c}.el-tag--warning .el-tag__close{color:#e6a23c}.el-tag--warning .el-tag__close:hover{background-color:#e6a23c;color:#fff}.el-tag--danger{background-color:hsla(0,87%,69%,.1);border-color:hsla(0,87%,69%,.2);color:#f56c6c}.el-tag--danger.is-hit{border-color:#f56c6c}.el-tag--danger .el-tag__close{color:#f56c6c}.el-tag--danger .el-tag__close:hover{background-color:#f56c6c;color:#fff}.el-tag--medium{height:28px;line-height:26px}.el-tag--medium .el-icon-close{-webkit-transform:scale(.8);transform:scale(.8)}.el-tag--small{height:24px;padding:0 8px;line-height:22px}.el-tag--small .el-icon-close{-webkit-transform:scale(.8);transform:scale(.8)}.el-tag--mini{height:20px;padding:0 5px;line-height:19px}.el-tag--mini .el-icon-close{margin-left:-3px;-webkit-transform:scale(.7);transform:scale(.7)}.el-select-dropdown__item{font-size:14px;padding:0 20px;position:relative;overflow:hidden;text-overflow:ellipsis;color:#606266;height:34px;line-height:34px;box-sizing:border-box;cursor:pointer}.el-select-dropdown__item.is-disabled{color:#c0c4cc;cursor:not-allowed}.el-select-dropdown__item.is-disabled:hover{background-color:#fff}.el-select-dropdown__item.hover,.el-select-dropdown__item:hover{background-color:#f5f7fa}.el-select-dropdown__item.selected{color:#409eff;font-weight:700}.el-select-dropdown__item span{line-height:34px!important}.el-select-group{margin:0;padding:0}.el-select-group__wrap{position:relative;list-style:none;margin:0;padding:0}.el-select-group__wrap:not(:last-of-type){padding-bottom:24px}.el-select-group__wrap:not(:last-of-type):after{content:"";position:absolute;display:block;left:20px;right:20px;bottom:12px;height:1px;background:#e4e7ed}.el-select-group__title{padding-left:20px;font-size:12px;color:#909399;line-height:30px}.el-select-group .el-select-dropdown__item{padding-left:20px}.el-scrollbar{overflow:hidden;position:relative}.el-scrollbar:active>.el-scrollbar__bar,.el-scrollbar:focus>.el-scrollbar__bar,.el-scrollbar:hover>.el-scrollbar__bar{opacity:1;-webkit-transition:opacity .34s ease-out;transition:opacity .34s ease-out}.el-scrollbar__wrap{overflow:scroll;height:100%}.el-scrollbar__wrap--hidden-default::-webkit-scrollbar{width:0;height:0}.el-scrollbar__thumb{position:relative;display:block;width:0;height:0;cursor:pointer;border-radius:inherit;background-color:hsla(220,4%,58%,.3);-webkit-transition:background-color .3s;transition:background-color .3s}.el-scrollbar__thumb:hover{background-color:hsla(220,4%,58%,.5)}.el-scrollbar__bar{position:absolute;right:2px;bottom:2px;z-index:1;border-radius:4px;opacity:0;-webkit-transition:opacity .12s ease-out;transition:opacity .12s ease-out}.el-scrollbar__bar.is-vertical{width:6px;top:2px}.el-scrollbar__bar.is-vertical>div{width:100%}.el-scrollbar__bar.is-horizontal{height:6px;left:2px}.el-scrollbar__bar.is-horizontal>div{height:100%}.el-select{display:inline-block;position:relative}.el-select:hover .el-input__inner{border-color:#c0c4cc}.el-select .el-input__inner{cursor:pointer;padding-right:35px}.el-select .el-input__inner:focus{border-color:#409eff}.el-select .el-input .el-select__caret{color:#c0c4cc;font-size:14px;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;-webkit-transform:rotate(180deg);transform:rotate(180deg);line-height:16px;cursor:pointer}.el-select .el-input .el-select__caret.is-reverse{-webkit-transform:rotate(0);transform:rotate(0)}.el-select .el-input .el-select__caret.is-show-close{font-size:14px;text-align:center;-webkit-transform:rotate(180deg);transform:rotate(180deg);border-radius:100%;color:#c0c4cc;-webkit-transition:color .2s cubic-bezier(.645,.045,.355,1);transition:color .2s cubic-bezier(.645,.045,.355,1)}.el-select .el-input .el-select__caret.is-show-close:hover{color:#909399}.el-select .el-input.is-disabled .el-input__inner{cursor:not-allowed}.el-select .el-input.is-disabled .el-input__inner:hover{border-color:#e4e7ed}.el-select .el-input.is-focus .el-input__inner{border-color:#409eff}.el-select>.el-input{display:block}.el-select__input{border:none;outline:0;padding:0;margin-left:15px;color:#666;font-size:14px;vertical-align:middle;-webkit-appearance:none;-moz-appearance:none;appearance:none;height:28px;background-color:transparent}.el-select__input.is-mini{height:14px}.el-select__close{cursor:pointer;position:absolute;top:8px;z-index:1000;right:25px;color:#c0c4cc;line-height:18px;font-size:14px}.el-select__close:hover{color:#909399}.el-select__tags{position:absolute;line-height:normal;white-space:normal;z-index:1;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.el-select .el-tag__close{margin-top:-2px}.el-select .el-tag{-webkit-box-sizing:border-box;box-sizing:border-box;border-color:transparent;margin:3px 0 3px 6px;background-color:#f0f2f5}.el-select .el-tag__close.el-icon-close{background-color:#c0c4cc;right:-7px;top:0;color:#fff}.el-select .el-tag__close.el-icon-close:hover{background-color:#909399}.el-select .el-tag__close.el-icon-close:before{display:block;-webkit-transform:translateY(.5px);transform:translateY(.5px)}',""])},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(!o.default.prototype.$isServer)if(t){var n=t.offsetTop,r=t.offsetTop+t.offsetHeight,i=e.scrollTop,s=i+e.clientHeight;n<i?e.scrollTop=n:r>s&&(e.scrollTop=r-e.clientHeight)}else e.scrollTop=0};var o=function(e){return e&&e.__esModule?e:{default:e}}(n(4))},function(e,t,n){var o=n(3)(n(176),n(177),!1,function(e){n(174)},null,null);e.exports=o.exports},,,,,function(e,t,n){var o=n(115);"string"==typeof o&&(o=[[e.i,o,""]]);var r={};r.transform=void 0;n(1)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){(e.exports=n(0)(void 0)).push([e.i,'.el-tooltip:focus:hover,.el-tooltip:focus:not(.focusing){outline-width:0}.el-tooltip__popper{position:absolute;border-radius:4px;padding:10px;z-index:2000;font-size:12px;line-height:1.2}.el-tooltip__popper .popper__arrow,.el-tooltip__popper .popper__arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.el-tooltip__popper .popper__arrow{border-width:6px}.el-tooltip__popper .popper__arrow:after{content:" ";border-width:5px}.el-tooltip__popper[x-placement^=top]{margin-bottom:12px}.el-tooltip__popper[x-placement^=top] .popper__arrow{bottom:-6px;border-top-color:#303133;border-bottom-width:0}.el-tooltip__popper[x-placement^=top] .popper__arrow:after{bottom:1px;margin-left:-5px;border-top-color:#303133;border-bottom-width:0}.el-tooltip__popper[x-placement^=bottom]{margin-top:12px}.el-tooltip__popper[x-placement^=bottom] .popper__arrow{top:-6px;border-top-width:0;border-bottom-color:#303133}.el-tooltip__popper[x-placement^=bottom] .popper__arrow:after{top:1px;margin-left:-5px;border-top-width:0;border-bottom-color:#303133}.el-tooltip__popper[x-placement^=right]{margin-left:12px}.el-tooltip__popper[x-placement^=right] .popper__arrow{left:-6px;border-right-color:#303133;border-left-width:0}.el-tooltip__popper[x-placement^=right] .popper__arrow:after{bottom:-5px;left:1px;border-right-color:#303133;border-left-width:0}.el-tooltip__popper[x-placement^=left]{margin-right:12px}.el-tooltip__popper[x-placement^=left] .popper__arrow{right:-6px;border-right-width:0;border-left-color:#303133}.el-tooltip__popper[x-placement^=left] .popper__arrow:after{right:1px;bottom:-5px;margin-left:-5px;border-right-width:0;border-left-color:#303133}.el-tooltip__popper.is-dark{background:#303133;color:#fff}.el-tooltip__popper.is-light{background:#fff;border:1px solid #303133}.el-tooltip__popper.is-light[x-placement^=top] .popper__arrow{border-top-color:#303133}.el-tooltip__popper.is-light[x-placement^=top] .popper__arrow:after{border-top-color:#fff}.el-tooltip__popper.is-light[x-placement^=bottom] .popper__arrow{border-bottom-color:#303133}.el-tooltip__popper.is-light[x-placement^=bottom] .popper__arrow:after{border-bottom-color:#fff}.el-tooltip__popper.is-light[x-placement^=left] .popper__arrow{border-left-color:#303133}.el-tooltip__popper.is-light[x-placement^=left] .popper__arrow:after{border-left-color:#fff}.el-tooltip__popper.is-light[x-placement^=right] .popper__arrow{border-right-color:#303133}.el-tooltip__popper.is-light[x-placement^=right] .popper__arrow:after{border-right-color:#fff}',""])},function(e,t,n){var o=n(117);"string"==typeof o&&(o=[[e.i,o,""]]);var r={};r.transform=void 0;n(1)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){(e.exports=n(0)(void 0)).push([e.i,"",""])},function(e,t,n){e.exports=function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=260)}({0:function(e,t){e.exports=function(e,t,n,o,r,i){var s,a=e=e||{},l=typeof e.default;"object"!==l&&"function"!==l||(s=e,a=e.default);var c="function"==typeof a?a.options:a;t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId=r);var u;if(i?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},c._ssrRegister=u):o&&(u=o),u){var f=c.functional,p=f?c.render:c.beforeCreate;f?(c._injectStyles=u,c.render=function(e,t){return u.call(t),p(e,t)}):c.beforeCreate=p?[].concat(p,u):[u]}return{esModule:s,exports:a,options:c}}},1:function(e,t){e.exports=n(7)},260:function(e,t,n){e.exports=n(261)},261:function(e,t,n){"use strict";t.__esModule=!0;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(262));o.default.install=function(e){e.component(o.default.name,o.default)},t.default=o.default},262:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(263),r=n.n(o),i=n(265),s=n(0)(r.a,i.a,!1,null,null,null);t.default=s.exports},263:function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var r=o(n(264)),i=o(n(1)),s=o(n(9)),a=n(3);t.default={name:"ElFormItem",componentName:"ElFormItem",mixins:[i.default],provide:function(){return{elFormItem:this}},inject:["elForm"],props:{label:String,labelWidth:String,prop:String,required:{type:Boolean,default:void 0},rules:[Object,Array],error:String,validateStatus:String,for:String,inlineMessage:{type:[String,Boolean],default:""},showMessage:{type:Boolean,default:!0},size:String},watch:{error:{immediate:!0,handler:function(e){this.validateMessage=e,this.validateState=e?"error":""}},validateStatus:function(e){this.validateState=e}},computed:{labelFor:function(){return this.for||this.prop},labelStyle:function(){var e={};if("top"===this.form.labelPosition)return e;var t=this.labelWidth||this.form.labelWidth;return t&&(e.width=t),e},contentStyle:function(){var e={},t=this.label;if("top"===this.form.labelPosition||this.form.inline)return e;if(!t&&!this.labelWidth&&this.isNested)return e;var n=this.labelWidth||this.form.labelWidth;return n&&(e.marginLeft=n),e},form:function(){for(var e=this.$parent,t=e.$options.componentName;"ElForm"!==t;)"ElFormItem"===t&&(this.isNested=!0),t=(e=e.$parent).$options.componentName;return e},fieldValue:{cache:!1,get:function(){var e=this.form.model;if(e&&this.prop){var t=this.prop;return-1!==t.indexOf(":")&&(t=t.replace(/:/,".")),(0,a.getPropByPath)(e,t,!0).v}}},isRequired:function(){var e=this.getRules(),t=!1;return e&&e.length&&e.every(function(e){return!e.required||(t=!0,!1)}),t},_formSize:function(){return this.elForm.size},elFormItemSize:function(){return this.size||this._formSize},sizeClass:function(){return(this.$ELEMENT||{}).size||this.elFormItemSize}},data:function(){return{validateState:"",validateMessage:"",validateDisabled:!1,validator:{},isNested:!1}},methods:{validate:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.noop;this.validateDisabled=!1;var o=this.getFilteredRule(e);if((!o||0===o.length)&&void 0===this.required)return n(),!0;this.validateState="validating";var i={};o&&o.length>0&&o.forEach(function(e){delete e.trigger}),i[this.prop]=o;var s=new r.default(i),l={};l[this.prop]=this.fieldValue,s.validate(l,{firstFields:!0},function(e,o){t.validateState=e?"error":"success",t.validateMessage=e?e[0].message:"",n(t.validateMessage)})},clearValidate:function(){this.validateState="",this.validateMessage="",this.validateDisabled=!1},resetField:function(){this.validateState="",this.validateMessage="";var e=this.form.model,t=this.fieldValue,n=this.prop;-1!==n.indexOf(":")&&(n=n.replace(/:/,"."));var o=(0,a.getPropByPath)(e,n,!0);Array.isArray(t)?(this.validateDisabled=!0,o.o[o.k]=[].concat(this.initialValue)):(this.validateDisabled=!0,o.o[o.k]=this.initialValue)},getRules:function(){var e=this.form.rules,t=this.rules,n=void 0!==this.required?{required:!!this.required}:[];return e=e?(0,a.getPropByPath)(e,this.prop||"").o[this.prop||""]:[],[].concat(t||e||[]).concat(n)},getFilteredRule:function(e){return this.getRules().filter(function(t){return!t.trigger||-1!==t.trigger.indexOf(e)}).map(function(e){return(0,s.default)({},e)})},onFieldBlur:function(){this.validate("blur")},onFieldChange:function(){this.validateDisabled?this.validateDisabled=!1:this.validate("change")}},mounted:function(){if(this.prop){this.dispatch("ElForm","el.form.addField",[this]);var e=this.fieldValue;Array.isArray(e)&&(e=[].concat(e)),Object.defineProperty(this,"initialValue",{value:e});(this.getRules().length||void 0!==this.required)&&(this.$on("el.form.blur",this.onFieldBlur),this.$on("el.form.change",this.onFieldChange))}},beforeDestroy:function(){this.dispatch("ElForm","el.form.removeField",[this])}}},264:function(e,t){e.exports=n(119)},265:function(e,t,n){"use strict";var o={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"el-form-item",class:[{"el-form-item--feedback":this.elForm&&this.elForm.statusIcon,"is-error":"error"===this.validateState,"is-validating":"validating"===this.validateState,"is-success":"success"===this.validateState,"is-required":this.isRequired||this.required},this.sizeClass?"el-form-item--"+this.sizeClass:""]},[this.label||this.$slots.label?t("label",{staticClass:"el-form-item__label",style:this.labelStyle,attrs:{for:this.labelFor}},[this._t("label",[this._v(this._s(this.label+this.form.labelSuffix))])],2):this._e(),t("div",{staticClass:"el-form-item__content",style:this.contentStyle},[this._t("default"),t("transition",{attrs:{name:"el-zoom-in-top"}},["error"===this.validateState&&this.showMessage&&this.form.showMessage?t("div",{staticClass:"el-form-item__error",class:{"el-form-item__error--inline":"boolean"==typeof this.inlineMessage?this.inlineMessage:this.elForm&&this.elForm.inlineMessage||!1}},[this._v("\n "+this._s(this.validateMessage)+"\n ")]):this._e()])],2)])},staticRenderFns:[]};t.a=o},3:function(e,t){e.exports=n(5)},9:function(e,t){e.exports=n(10)}})},function(e,t,n){"use strict";function o(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=1,r=t[0],i=t.length;if("function"==typeof r)return r.apply(null,t.slice(1));if("string"==typeof r){for(var s=String(r).replace(m,function(e){if("%%"===e)return"%";if(o>=i)return e;switch(e){case"%s":return String(t[o++]);case"%d":return Number(t[o++]);case"%j":try{return JSON.stringify(t[o++])}catch(e){return"[Circular]"}break;default:return e}}),a=t[o];o<i;a=t[++o])s+=" "+a;return s}return r}function r(e,t){return void 0===e||null===e||(!("array"!==t||!Array.isArray(e)||e.length)||!(!function(e){return"string"===e||"url"===e||"hex"===e||"email"===e||"pattern"===e}(t)||"string"!=typeof e||e))}function i(e,t,n){function o(s){if(s&&s.length)n(s);else{var a=r;r+=1,a<i?t(e[a],o):n([])}}var r=0,i=e.length;o([])}function s(e,t,n,o){if(t.first){return i(function(e){var t=[];return Object.keys(e).forEach(function(n){t.push.apply(t,e[n])}),t}(e),n,o)}var r=t.firstFields||[];!0===r&&(r=Object.keys(e));var s=Object.keys(e),a=s.length,l=0,c=[],u=function(e){c.push.apply(c,e),++l===a&&o(c)};s.forEach(function(t){var o=e[t];-1!==r.indexOf(t)?i(o,n,u):function(e,t,n){function o(e){r.push.apply(r,e),++i===s&&n(r)}var r=[],i=0,s=e.length;e.forEach(function(e){t(e,o)})}(o,n,u)})}function a(e){return function(t){return t&&t.message?(t.field=t.field||e.fullField,t):{message:t,field:t.field||e.fullField}}}function l(e,t){if(t)for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];"object"===(void 0===o?"undefined":h()(o))&&"object"===h()(e[n])?e[n]=p()({},e[n],o):e[n]=o}return e}function c(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}function u(e){this.rules=null,this._messages=$,this.define(e)}Object.defineProperty(t,"__esModule",{value:!0});var f=n(66),p=n.n(f),d=n(34),h=n.n(d),m=/%[sdj%]/g,v=function(){};var g=function(e,t,n,i,s,a){!e.required||n.hasOwnProperty(e.field)&&!r(t,a||e.type)||i.push(o(s.messages.required,e.fullField))},b=function(e,t,n,r,i){(/^\s+$/.test(t)||""===t)&&r.push(o(i.messages.whitespace,e.fullField))},_={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,url:new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i"),hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},y={integer:function(e){return y.number(e)&&parseInt(e,10)===e},float:function(e){return y.number(e)&&!y.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch(e){return!1}},date:function(e){return"function"==typeof e.getTime&&"function"==typeof e.getMonth&&"function"==typeof e.getYear},number:function(e){return!isNaN(e)&&"number"==typeof e},object:function(e){return"object"===(void 0===e?"undefined":h()(e))&&!y.array(e)},method:function(e){return"function"==typeof e},email:function(e){return"string"==typeof e&&!!e.match(_.email)&&e.length<255},url:function(e){return"string"==typeof e&&!!e.match(_.url)},hex:function(e){return"string"==typeof e&&!!e.match(_.hex)}},x="enum",w={required:g,whitespace:b,type:function(e,t,n,r,i){if(e.required&&void 0===t)g(e,t,n,r,i);else{var s=e.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(s)>-1?y[s](t)||r.push(o(i.messages.types[s],e.fullField,e.type)):s&&(void 0===t?"undefined":h()(t))!==e.type&&r.push(o(i.messages.types[s],e.fullField,e.type))}},range:function(e,t,n,r,i){var s="number"==typeof e.len,a="number"==typeof e.min,l="number"==typeof e.max,c=t,u=null,f="number"==typeof t,p="string"==typeof t,d=Array.isArray(t);if(f?u="number":p?u="string":d&&(u="array"),!u)return!1;(p||d)&&(c=t.length),s?c!==e.len&&r.push(o(i.messages[u].len,e.fullField,e.len)):a&&!l&&c<e.min?r.push(o(i.messages[u].min,e.fullField,e.min)):l&&!a&&c>e.max?r.push(o(i.messages[u].max,e.fullField,e.max)):a&&l&&(c<e.min||c>e.max)&&r.push(o(i.messages[u].range,e.fullField,e.min,e.max))},enum:function(e,t,n,r,i){e[x]=Array.isArray(e[x])?e[x]:[],-1===e[x].indexOf(t)&&r.push(o(i.messages[x],e.fullField,e[x].join(", ")))},pattern:function(e,t,n,r,i){e.pattern&&(e.pattern instanceof RegExp?(e.pattern.lastIndex=0,e.pattern.test(t)||r.push(o(i.messages.pattern.mismatch,e.fullField,t,e.pattern))):"string"==typeof e.pattern&&(new RegExp(e.pattern).test(t)||r.push(o(i.messages.pattern.mismatch,e.fullField,t,e.pattern))))}},k="enum",C=function(e,t,n,o,i){var s=e.type,a=[];if(e.required||!e.required&&o.hasOwnProperty(e.field)){if(r(t,s)&&!e.required)return n();w.required(e,t,o,a,i,s),r(t,s)||w.type(e,t,o,a,i)}n(a)},S={string:function(e,t,n,o,i){var s=[];if(e.required||!e.required&&o.hasOwnProperty(e.field)){if(r(t,"string")&&!e.required)return n();w.required(e,t,o,s,i,"string"),r(t,"string")||(w.type(e,t,o,s,i),w.range(e,t,o,s,i),w.pattern(e,t,o,s,i),!0===e.whitespace&&w.whitespace(e,t,o,s,i))}n(s)},method:function(e,t,n,o,i){var s=[];if(e.required||!e.required&&o.hasOwnProperty(e.field)){if(r(t)&&!e.required)return n();w.required(e,t,o,s,i),void 0!==t&&w.type(e,t,o,s,i)}n(s)},number:function(e,t,n,o,i){var s=[];if(e.required||!e.required&&o.hasOwnProperty(e.field)){if(r(t)&&!e.required)return n();w.required(e,t,o,s,i),void 0!==t&&(w.type(e,t,o,s,i),w.range(e,t,o,s,i))}n(s)},boolean:function(e,t,n,o,i){var s=[];if(e.required||!e.required&&o.hasOwnProperty(e.field)){if(r(t)&&!e.required)return n();w.required(e,t,o,s,i),void 0!==t&&w.type(e,t,o,s,i)}n(s)},regexp:function(e,t,n,o,i){var s=[];if(e.required||!e.required&&o.hasOwnProperty(e.field)){if(r(t)&&!e.required)return n();w.required(e,t,o,s,i),r(t)||w.type(e,t,o,s,i)}n(s)},integer:function(e,t,n,o,i){var s=[];if(e.required||!e.required&&o.hasOwnProperty(e.field)){if(r(t)&&!e.required)return n();w.required(e,t,o,s,i),void 0!==t&&(w.type(e,t,o,s,i),w.range(e,t,o,s,i))}n(s)},float:function(e,t,n,o,i){var s=[];if(e.required||!e.required&&o.hasOwnProperty(e.field)){if(r(t)&&!e.required)return n();w.required(e,t,o,s,i),void 0!==t&&(w.type(e,t,o,s,i),w.range(e,t,o,s,i))}n(s)},array:function(e,t,n,o,i){var s=[];if(e.required||!e.required&&o.hasOwnProperty(e.field)){if(r(t,"array")&&!e.required)return n();w.required(e,t,o,s,i,"array"),r(t,"array")||(w.type(e,t,o,s,i),w.range(e,t,o,s,i))}n(s)},object:function(e,t,n,o,i){var s=[];if(e.required||!e.required&&o.hasOwnProperty(e.field)){if(r(t)&&!e.required)return n();w.required(e,t,o,s,i),void 0!==t&&w.type(e,t,o,s,i)}n(s)},enum:function(e,t,n,o,i){var s=[];if(e.required||!e.required&&o.hasOwnProperty(e.field)){if(r(t)&&!e.required)return n();w.required(e,t,o,s,i),t&&w[k](e,t,o,s,i)}n(s)},pattern:function(e,t,n,o,i){var s=[];if(e.required||!e.required&&o.hasOwnProperty(e.field)){if(r(t,"string")&&!e.required)return n();w.required(e,t,o,s,i),r(t,"string")||w.pattern(e,t,o,s,i)}n(s)},date:function(e,t,n,o,i){var s=[];if(e.required||!e.required&&o.hasOwnProperty(e.field)){if(r(t)&&!e.required)return n();w.required(e,t,o,s,i),r(t)||(w.type(e,t,o,s,i),t&&w.range(e,t.getTime(),o,s,i))}n(s)},url:C,hex:C,email:C,required:function(e,t,n,o,r){var i=[],s=Array.isArray(t)?"array":void 0===t?"undefined":h()(t);w.required(e,t,o,i,r,s),n(i)}},$=c();u.prototype={messages:function(e){return e&&(this._messages=l(c(),e)),this._messages},define:function(e){if(!e)throw new Error("Cannot configure a schema with no rules");if("object"!==(void 0===e?"undefined":h()(e))||Array.isArray(e))throw new Error("Rules must be an object");this.rules={};var t=void 0,n=void 0;for(t in e)e.hasOwnProperty(t)&&(n=e[t],this.rules[t]=Array.isArray(n)?n:[n])},validate:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments[2],i=e,f=n,d=r;if("function"==typeof f&&(d=f,f={}),this.rules&&0!==Object.keys(this.rules).length){if(f.messages){var m=this.messages();m===$&&(m=c()),l(m,f.messages),f.messages=m}else f.messages=this.messages();var g=void 0,b=void 0,_={};(f.keys||Object.keys(this.rules)).forEach(function(n){g=t.rules[n],b=i[n],g.forEach(function(o){var r=o;"function"==typeof r.transform&&(i===e&&(i=p()({},i)),b=i[n]=r.transform(b)),(r="function"==typeof r?{validator:r}:p()({},r)).validator=t.getValidationMethod(r),r.field=n,r.fullField=r.fullField||n,r.type=t.getType(r),r.validator&&(_[n]=_[n]||[],_[n].push({rule:r,value:b,source:i,field:n}))})});var y={};s(_,f,function(e,t){function n(e,t){return p()({},t,{fullField:i.fullField+"."+e})}function r(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(Array.isArray(r)||(r=[r]),r.length&&v("async-validator:",r),r.length&&i.message&&(r=[].concat(i.message)),r=r.map(a(i)),f.first&&r.length)return y[i.field]=1,t(r);if(s){if(i.required&&!e.value)return r=i.message?[].concat(i.message).map(a(i)):f.error?[f.error(i,o(f.messages.required,i.field))]:[],t(r);var l={};if(i.defaultField)for(var c in e.value)e.value.hasOwnProperty(c)&&(l[c]=i.defaultField);l=p()({},l,e.rule.fields);for(var d in l)if(l.hasOwnProperty(d)){var h=Array.isArray(l[d])?l[d]:[l[d]];l[d]=h.map(n.bind(null,d))}var m=new u(l);m.messages(f.messages),e.rule.options&&(e.rule.options.messages=f.messages,e.rule.options.error=f.error),m.validate(e.value,e.rule.options||f,function(e){t(e&&e.length?r.concat(e):e)})}else t(r)}var i=e.rule,s=!("object"!==i.type&&"array"!==i.type||"object"!==h()(i.fields)&&"object"!==h()(i.defaultField));s=s&&(i.required||!i.required&&e.value),i.field=e.field;var l=i.validator(i,e.value,r,e.source,f);l&&l.then&&l.then(function(){return r()},function(e){return r(e)})},function(e){!function(e){function t(e){Array.isArray(e)?r=r.concat.apply(r,e):r.push(e)}var n=void 0,o=void 0,r=[],i={};for(n=0;n<e.length;n++)t(e[n]);if(r.length)for(n=0;n<r.length;n++)i[o=r[n].field]=i[o]||[],i[o].push(r[n]);else r=null,i=null;d(r,i)}(e)})}else d&&d()},getType:function(e){if(void 0===e.type&&e.pattern instanceof RegExp&&(e.type="pattern"),"function"!=typeof e.validator&&e.type&&!S.hasOwnProperty(e.type))throw new Error(o("Unknown rule type %s",e.type));return e.type||"string"},getValidationMethod:function(e){if("function"==typeof e.validator)return e.validator;var t=Object.keys(e),n=t.indexOf("message");return-1!==n&&t.splice(n,1),1===t.length&&"required"===t[0]?S.required:S[this.getType(e)]||!1}},u.register=function(e,t){if("function"!=typeof t)throw new Error("Cannot register a validator by type, validator is not a function");S[e]=t},u.messages=$;t.default=u},function(e,t,n){e.exports={default:n(121),__esModule:!0}},function(e,t,n){n(122),e.exports=n(28).Object.assign},function(e,t,n){var o=n(39);o(o.S+o.F,"Object",{assign:n(125)})},function(e,t,n){var o=n(124);e.exports=function(e,t,n){if(o(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,o){return e.call(t,n,o)};case 3:return function(n,o,r){return e.call(t,n,o,r)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){"use strict";var o=n(31),r=n(46),i=n(33),s=n(72),a=n(70),l=Object.assign;e.exports=!l||n(22)(function(){var e={},t={},n=Symbol();return e[n]=7,"abcdefghijklmnopqrst".split("").forEach(function(e){t[e]=e}),7!=l({},e)[n]||"abcdefghijklmnopqrst"!=Object.keys(l({},t)).join("")})?function(e,t){for(var n=s(e),l=arguments.length,c=1,u=r.f,f=i.f;l>c;)for(var p,d=a(arguments[c++]),h=u?o(d).concat(u(d)):o(d),m=h.length,v=0;m>v;)f.call(d,p=h[v++])&&(n[p]=d[p]);return n}:l},function(e,t,n){var o=n(17),r=n(127),i=n(128);e.exports=function(e){return function(t,n,s){var a,l=o(t),c=r(l.length),u=i(s,c);if(e&&n!=n){for(;c>u;)if((a=l[u++])!=a)return!0}else for(;c>u;u++)if((e||u in l)&&l[u]===n)return e||u||0;return!e&&-1}}},function(e,t,n){var o=n(42),r=Math.min;e.exports=function(e){return e>0?r(o(e),9007199254740991):0}},function(e,t,n){var o=n(42),r=Math.max,i=Math.min;e.exports=function(e,t){return(e=o(e))<0?r(e+t,0):i(e,t)}},function(e,t,n){e.exports={default:n(130),__esModule:!0}},function(e,t,n){n(131),n(137),e.exports=n(50).f("iterator")},function(e,t,n){"use strict";var o=n(132)(!0);n(73)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=o(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){var o=n(42),r=n(41);e.exports=function(e){return function(t,n){var i,s,a=String(r(t)),l=o(n),c=a.length;return l<0||l>=c?e?"":void 0:(i=a.charCodeAt(l))<55296||i>56319||l+1===c||(s=a.charCodeAt(l+1))<56320||s>57343?e?a.charAt(l):i:e?a.slice(l,l+2):s-56320+(i-55296<<10)+65536}}},function(e,t,n){"use strict";var o=n(75),r=n(30),i=n(49),s={};n(14)(s,n(18)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=o(s,{next:r(1,n)}),i(e,t+" Iterator")}},function(e,t,n){var o=n(15),r=n(29),i=n(31);e.exports=n(16)?Object.defineProperties:function(e,t){r(e);for(var n,s=i(t),a=s.length,l=0;a>l;)o.f(e,n=s[l++],t[n]);return e}},function(e,t,n){var o=n(9).document;e.exports=o&&o.documentElement},function(e,t,n){var o=n(11),r=n(72),i=n(43)("IE_PROTO"),s=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=r(e),o(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}},function(e,t,n){n(138);for(var o=n(9),r=n(14),i=n(48),s=n(18)("toStringTag"),a="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),l=0;l<a.length;l++){var c=a[l],u=o[c],f=u&&u.prototype;f&&!f[s]&&r(f,s,c),i[c]=i.Array}},function(e,t,n){"use strict";var o=n(139),r=n(140),i=n(48),s=n(17);e.exports=n(73)(Array,"Array",function(e,t){this._t=s(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,r(1)):r(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){e.exports={default:n(142),__esModule:!0}},function(e,t,n){n(143),n(149),n(150),n(151),e.exports=n(28).Symbol},function(e,t,n){"use strict";var o=n(9),r=n(11),i=n(16),s=n(39),a=n(74),l=n(144).KEY,c=n(22),u=n(44),f=n(49),p=n(32),d=n(18),h=n(50),m=n(51),v=n(145),g=n(146),b=n(29),_=n(21),y=n(17),x=n(40),w=n(30),k=n(75),C=n(147),S=n(148),$=n(15),O=n(31),E=S.f,T=$.f,M=C.f,A=o.Symbol,P=o.JSON,z=P&&P.stringify,j="prototype",F=d("_hidden"),I=d("toPrimitive"),N={}.propertyIsEnumerable,L=u("symbol-registry"),R=u("symbols"),D=u("op-symbols"),B=Object[j],q="function"==typeof A,H=o.QObject,V=!H||!H[j]||!H[j].findChild,U=i&&c(function(){return 7!=k(T({},"a",{get:function(){return T(this,"a",{value:7}).a}})).a})?function(e,t,n){var o=E(B,t);o&&delete B[t],T(e,t,n),o&&e!==B&&T(B,t,o)}:T,W=function(e){var t=R[e]=k(A[j]);return t._k=e,t},X=q&&"symbol"==typeof A.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof A},J=function(e,t,n){return e===B&&J(D,t,n),b(e),t=x(t,!0),b(n),r(R,t)?(n.enumerable?(r(e,F)&&e[F][t]&&(e[F][t]=!1),n=k(n,{enumerable:w(0,!1)})):(r(e,F)||T(e,F,w(1,{})),e[F][t]=!0),U(e,t,n)):T(e,t,n)},K=function(e,t){b(e);for(var n,o=v(t=y(t)),r=0,i=o.length;i>r;)J(e,n=o[r++],t[n]);return e},G=function(e){var t=N.call(this,e=x(e,!0));return!(this===B&&r(R,e)&&!r(D,e))&&(!(t||!r(this,e)||!r(R,e)||r(this,F)&&this[F][e])||t)},Y=function(e,t){if(e=y(e),t=x(t,!0),e!==B||!r(R,t)||r(D,t)){var n=E(e,t);return!n||!r(R,t)||r(e,F)&&e[F][t]||(n.enumerable=!0),n}},Z=function(e){for(var t,n=M(y(e)),o=[],i=0;n.length>i;)r(R,t=n[i++])||t==F||t==l||o.push(t);return o},Q=function(e){for(var t,n=e===B,o=M(n?D:y(e)),i=[],s=0;o.length>s;)!r(R,t=o[s++])||n&&!r(B,t)||i.push(R[t]);return i};q||(a((A=function(){if(this instanceof A)throw TypeError("Symbol is not a constructor!");var e=p(arguments.length>0?arguments[0]:void 0),t=function(n){this===B&&t.call(D,n),r(this,F)&&r(this[F],e)&&(this[F][e]=!1),U(this,e,w(1,n))};return i&&V&&U(B,e,{configurable:!0,set:t}),W(e)})[j],"toString",function(){return this._k}),S.f=Y,$.f=J,n(76).f=C.f=Z,n(33).f=G,n(46).f=Q,i&&!n(47)&&a(B,"propertyIsEnumerable",G,!0),h.f=function(e){return W(d(e))}),s(s.G+s.W+s.F*!q,{Symbol:A});for(var ee="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),te=0;ee.length>te;)d(ee[te++]);for(var ne=O(d.store),oe=0;ne.length>oe;)m(ne[oe++]);s(s.S+s.F*!q,"Symbol",{for:function(e){return r(L,e+="")?L[e]:L[e]=A(e)},keyFor:function(e){if(!X(e))throw TypeError(e+" is not a symbol!");for(var t in L)if(L[t]===e)return t},useSetter:function(){V=!0},useSimple:function(){V=!1}}),s(s.S+s.F*!q,"Object",{create:function(e,t){return void 0===t?k(e):K(k(e),t)},defineProperty:J,defineProperties:K,getOwnPropertyDescriptor:Y,getOwnPropertyNames:Z,getOwnPropertySymbols:Q}),P&&s(s.S+s.F*(!q||c(function(){var e=A();return"[null]"!=z([e])||"{}"!=z({a:e})||"{}"!=z(Object(e))})),"JSON",{stringify:function(e){for(var t,n,o=[e],r=1;arguments.length>r;)o.push(arguments[r++]);if(n=t=o[1],(_(t)||void 0!==e)&&!X(e))return g(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!X(t))return t}),o[1]=t,z.apply(P,o)}}),A[j][I]||n(14)(A[j],I,A[j].valueOf),f(A,"Symbol"),f(Math,"Math",!0),f(o.JSON,"JSON",!0)},function(e,t,n){var o=n(32)("meta"),r=n(21),i=n(11),s=n(15).f,a=0,l=Object.isExtensible||function(){return!0},c=!n(22)(function(){return l(Object.preventExtensions({}))}),u=function(e){s(e,o,{value:{i:"O"+ ++a,w:{}}})},f=e.exports={KEY:o,NEED:!1,fastKey:function(e,t){if(!r(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,o)){if(!l(e))return"F";if(!t)return"E";u(e)}return e[o].i},getWeak:function(e,t){if(!i(e,o)){if(!l(e))return!0;if(!t)return!1;u(e)}return e[o].w},onFreeze:function(e){return c&&f.NEED&&l(e)&&!i(e,o)&&u(e),e}}},function(e,t,n){var o=n(31),r=n(46),i=n(33);e.exports=function(e){var t=o(e),n=r.f;if(n)for(var s,a=n(e),l=i.f,c=0;a.length>c;)l.call(e,s=a[c++])&&t.push(s);return t}},function(e,t,n){var o=n(71);e.exports=Array.isArray||function(e){return"Array"==o(e)}},function(e,t,n){var o=n(17),r=n(76).f,i={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"[object Window]"==i.call(e)?function(e){try{return r(e)}catch(e){return s.slice()}}(e):r(o(e))}},function(e,t,n){var o=n(33),r=n(30),i=n(17),s=n(40),a=n(11),l=n(67),c=Object.getOwnPropertyDescriptor;t.f=n(16)?c:function(e,t){if(e=i(e),t=s(t,!0),l)try{return c(e,t)}catch(e){}if(a(e,t))return r(!o.f.call(e,t),e[t])}},function(e,t){},function(e,t,n){n(51)("asyncIterator")},function(e,t,n){n(51)("observable")},function(e,t,n){var o=n(153);"string"==typeof o&&(o=[[e.i,o,""]]);var r={};r.transform=void 0;n(1)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){(e.exports=n(0)(void 0)).push([e.i,'.el-form--inline .el-form-item,.el-form--inline .el-form-item__content{display:inline-block;vertical-align:top}.el-form-item:after,.el-form-item__content:after{clear:both}.el-form--label-left .el-form-item__label{text-align:left}.el-form--label-top .el-form-item__label{float:none;display:inline-block;text-align:left;padding:0 0 10px}.el-form--inline .el-form-item{margin-right:10px}.el-form--inline .el-form-item__label{float:none;display:inline-block}.el-form--inline.el-form--label-top .el-form-item__content{display:block}.el-form-item{margin-bottom:22px}.el-form-item:after,.el-form-item:before{display:table;content:""}.el-form-item .el-form-item{margin-bottom:0}.el-form-item--mini.el-form-item,.el-form-item--small.el-form-item{margin-bottom:18px}.el-form-item .el-input__validateIcon{display:none}.el-form-item--medium .el-form-item__content,.el-form-item--medium .el-form-item__label{line-height:36px}.el-form-item--small .el-form-item__content,.el-form-item--small .el-form-item__label{line-height:32px}.el-form-item--small .el-form-item__error{padding-top:2px}.el-form-item--mini .el-form-item__content,.el-form-item--mini .el-form-item__label{line-height:28px}.el-form-item--mini .el-form-item__error{padding-top:1px}.el-form-item__label{text-align:right;vertical-align:middle;float:left;font-size:14px;color:#606266;line-height:40px;padding:0 12px 0 0;-webkit-box-sizing:border-box;box-sizing:border-box}.el-form-item__content{line-height:40px;position:relative;font-size:14px}.el-form-item__content:after,.el-form-item__content:before{display:table;content:""}.el-form-item__error{color:#f56c6c;font-size:12px;line-height:1;padding-top:4px;position:absolute;top:100%;left:0}.el-form-item__error--inline{position:relative;top:auto;left:auto;display:inline-block;margin-left:10px}.el-form-item.is-required .el-form-item__label:before{content:"*";color:#f56c6c;margin-right:4px}.el-form-item.is-error .el-input__inner,.el-form-item.is-error .el-input__inner:focus,.el-form-item.is-error .el-textarea__inner,.el-form-item.is-error .el-textarea__inner:focus{border-color:#f56c6c}.el-form-item.is-error .el-input-group__append .el-input__inner,.el-form-item.is-error .el-input-group__prepend .el-input__inner{border-color:transparent}.el-form-item.is-error .el-input__validateIcon{color:#f56c6c}.el-form-item.is-success .el-input__inner,.el-form-item.is-success .el-input__inner:focus,.el-form-item.is-success .el-textarea__inner,.el-form-item.is-success .el-textarea__inner:focus{border-color:#67c23a}.el-form-item.is-success .el-input-group__append .el-input__inner,.el-form-item.is-success .el-input-group__prepend .el-input__inner{border-color:transparent}.el-form-item.is-success .el-input__validateIcon{color:#67c23a}.el-form-item--feedback .el-input__validateIcon{display:inline-block}',""])},function(e,t){e.exports=function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=255)}({0:function(e,t){e.exports=function(e,t,n,o,r,i){var s,a=e=e||{},l=typeof e.default;"object"!==l&&"function"!==l||(s=e,a=e.default);var c="function"==typeof a?a.options:a;t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId=r);var u;if(i?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},c._ssrRegister=u):o&&(u=o),u){var f=c.functional,p=f?c.render:c.beforeCreate;f?(c._injectStyles=u,c.render=function(e,t){return u.call(t),p(e,t)}):c.beforeCreate=p?[].concat(p,u):[u]}return{esModule:s,exports:a,options:c}}},255:function(e,t,n){e.exports=n(256)},256:function(e,t,n){"use strict";t.__esModule=!0;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(257));o.default.install=function(e){e.component(o.default.name,o.default)},t.default=o.default},257:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(258),r=n.n(o),i=n(259),s=n(0)(r.a,i.a,!1,null,null,null);t.default=s.exports},258:function(e,t,n){"use strict";t.__esModule=!0,t.default={name:"ElForm",componentName:"ElForm",provide:function(){return{elForm:this}},props:{model:Object,rules:Object,labelPosition:String,labelWidth:String,labelSuffix:{type:String,default:""},inline:Boolean,inlineMessage:Boolean,statusIcon:Boolean,showMessage:{type:Boolean,default:!0},size:String},watch:{rules:function(){this.validate()}},data:function(){return{fields:[]}},created:function(){var e=this;this.$on("el.form.addField",function(t){t&&e.fields.push(t)}),this.$on("el.form.removeField",function(t){t.prop&&e.fields.splice(e.fields.indexOf(t),1)})},methods:{resetFields:function(){this.model&&this.fields.forEach(function(e){e.resetField()})},clearValidate:function(){this.fields.forEach(function(e){e.clearValidate()})},validate:function(e){var t=this;if(this.model){var n=void 0;"function"!=typeof e&&window.Promise&&(n=new window.Promise(function(t,n){e=function(e){e?t(e):n(e)}}));var o=!0,r=0;return 0===this.fields.length&&e&&e(!0),this.fields.forEach(function(n,i){n.validate("",function(n){n&&(o=!1),"function"==typeof e&&++r===t.fields.length&&e(o)})}),n||void 0}console.warn("[Element Warn][Form]model is required for validate to work!")},validateField:function(e,t){var n=this.fields.filter(function(t){return t.prop===e})[0];if(!n)throw new Error("must call validateField with valid prop string!");n.validate("",t)}}}},259:function(e,t,n){"use strict";var o={render:function(){var e=this.$createElement;return(this._self._c||e)("form",{staticClass:"el-form",class:[this.labelPosition?"el-form--label-"+this.labelPosition:"",{"el-form--inline":this.inline}]},[this._t("default")],2)},staticRenderFns:[]};t.a=o}})},,,,,,,,,,,,,,,,,,,,function(e,t,n){var o=n(175);"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);n(8)("365ad0fc",o,!0)},function(e,t,n){(e.exports=n(0)(void 0)).push([e.i,".remove-btn{cursor:pointer}.el-text-danger{color:#ff4949}",""])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"confirmRemove",props:{plain:{type:Boolean,default:!1}},data:function(){return{visible:!1}},methods:{confirmAction:function(){this.visible=!1,this.$emit("on-confirm")}}}},function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("span",[n("el-popover",{ref:"popover",attrs:{placement:"top",width:"160"},model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}},[n("p",[e._v("Are you sure you want to delete this?")]),e._v(" "),n("div",{staticStyle:{"text-align":"right",margin:"0"}},[n("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(t){e.visible=!1}}},[e._v("cancel")]),e._v(" "),n("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.confirmAction}},[e._v("confirm")])],1)]),e._v(" "),n("span",{directives:[{name:"popover",rawName:"v-popover:popover",arg:"popover"}],staticClass:"remove-btn"},[e._t("icon",[n("el-button",{attrs:{size:"mini",type:"danger",icon:"el-icon-delete",plain:e.plain}},[e._t("default")],2)])],2)],1)},staticRenderFns:[]}},,,,,,,,,,,,,,,,,,,,,,function(e,t,n){var o=n(200);"string"==typeof o&&(o=[[e.i,o,""]]);var r={};r.transform=void 0;n(1)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){(e.exports=n(0)(void 0)).push([e.i,".v-modal-enter{-webkit-animation:v-modal-in .2s ease;animation:v-modal-in .2s ease}.v-modal-leave{-webkit-animation:v-modal-out .2s ease forwards;animation:v-modal-out .2s ease forwards}@-webkit-keyframes v-modal-in{0%{opacity:0}}@keyframes v-modal-in{0%{opacity:0}}@-webkit-keyframes v-modal-out{to{opacity:0}}@keyframes v-modal-out{to{opacity:0}}.v-modal{position:fixed;left:0;top:0;width:100%;height:100%;opacity:.5;background:#000}.el-dialog{position:relative;margin:0 auto 50px;background:#fff;border-radius:2px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.3);box-shadow:0 1px 3px rgba(0,0,0,.3);-webkit-box-sizing:border-box;box-sizing:border-box;width:50%}.el-dialog.is-fullscreen{width:100%;margin-top:0;margin-bottom:0;height:100%;overflow:auto}.el-dialog__wrapper{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto;margin:0}.el-dialog__header{padding:15px 15px 10px}.el-dialog__headerbtn{position:absolute;top:15px;right:15px;padding:0;background:0 0;border:none;outline:0;cursor:pointer;font-size:16px}.el-dialog__headerbtn .el-dialog__close{color:#909399}.el-dialog__headerbtn:focus .el-dialog__close,.el-dialog__headerbtn:hover .el-dialog__close{color:#409eff}.el-dialog__title{line-height:24px;font-size:18px;color:#303133}.el-dialog__body{padding:30px 20px;color:#606266;line-height:24px;font-size:14px}.el-dialog__footer{padding:10px 15px 15px;text-align:right;-webkit-box-sizing:border-box;box-sizing:border-box}.el-dialog--center{text-align:center}.el-dialog--center .el-dialog__header{padding-top:30px}.el-dialog--center .el-dialog__body{text-align:initial;padding:25px 27px 30px}.el-dialog--center .el-dialog__footer{text-align:inherit;padding-bottom:30px}.dialog-fade-enter-active{-webkit-animation:dialog-fade-in .3s;animation:dialog-fade-in .3s}.dialog-fade-leave-active{-webkit-animation:dialog-fade-out .3s;animation:dialog-fade-out .3s}@-webkit-keyframes dialog-fade-in{0%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}@keyframes dialog-fade-in{0%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}@-webkit-keyframes dialog-fade-out{0%{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}to{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}}@keyframes dialog-fade-out{0%{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}to{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}}",""])},function(e,t,n){e.exports=function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=60)}({0:function(e,t){e.exports=function(e,t,n,o,r,i){var s,a=e=e||{},l=typeof e.default;"object"!==l&&"function"!==l||(s=e,a=e.default);var c="function"==typeof a?a.options:a;t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId=r);var u;if(i?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},c._ssrRegister=u):o&&(u=o),u){var f=c.functional,p=f?c.render:c.beforeCreate;f?(c._injectStyles=u,c.render=function(e,t){return u.call(t),p(e,t)}):c.beforeCreate=p?[].concat(p,u):[u]}return{esModule:s,exports:a,options:c}}},1:function(e,t){e.exports=n(7)},17:function(e,t){e.exports=n(19)},60:function(e,t,n){e.exports=n(61)},61:function(e,t,n){"use strict";t.__esModule=!0;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(62));o.default.install=function(e){e.component(o.default.name,o.default)},t.default=o.default},62:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(63),r=n.n(o),i=n(64),s=n(0)(r.a,i.a,!1,null,null,null);t.default=s.exports},63:function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var r=o(n(17)),i=o(n(7)),s=o(n(1));t.default={name:"ElDialog",mixins:[r.default,s.default,i.default],props:{title:{type:String,default:""},modal:{type:Boolean,default:!0},modalAppendToBody:{type:Boolean,default:!0},appendToBody:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},width:String,fullscreen:Boolean,customClass:{type:String,default:""},top:{type:String,default:"15vh"},beforeClose:Function,center:{type:Boolean,default:!1}},data:function(){return{closed:!1}},watch:{visible:function(e){var t=this;e?(this.closed=!1,this.$emit("open"),this.$el.addEventListener("scroll",this.updatePopper),this.$nextTick(function(){t.$refs.dialog.scrollTop=0}),this.appendToBody&&document.body.appendChild(this.$el)):(this.$el.removeEventListener("scroll",this.updatePopper),this.closed||this.$emit("close"))}},computed:{style:function(){var e={};return this.width&&(e.width=this.width),this.fullscreen||(e.marginTop=this.top),e}},methods:{getMigratingConfig:function(){return{props:{size:"size is removed."}}},handleWrapperClick:function(){this.closeOnClickModal&&this.handleClose()},handleClose:function(){"function"==typeof this.beforeClose?this.beforeClose(this.hide):this.hide()},hide:function(e){!1!==e&&(this.$emit("update:visible",!1),this.$emit("close"),this.closed=!0)},updatePopper:function(){this.broadcast("ElSelectDropdown","updatePopper"),this.broadcast("ElDropdownMenu","updatePopper")}},mounted:function(){this.visible&&(this.rendered=!0,this.open(),this.appendToBody&&document.body.appendChild(this.$el))}}},64:function(e,t,n){"use strict";var o={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"dialog-fade"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-dialog__wrapper",on:{click:function(t){if(t.target!==t.currentTarget)return null;e.handleWrapperClick(t)}}},[n("div",{ref:"dialog",staticClass:"el-dialog",class:[{"is-fullscreen":e.fullscreen,"el-dialog--center":e.center},e.customClass],style:e.style},[n("div",{staticClass:"el-dialog__header"},[e._t("title",[n("span",{staticClass:"el-dialog__title"},[e._v(e._s(e.title))])]),e.showClose?n("button",{staticClass:"el-dialog__headerbtn",attrs:{type:"button","aria-label":"Close"},on:{click:e.handleClose}},[n("i",{staticClass:"el-dialog__close el-icon el-icon-close"})]):e._e()],2),e.rendered?n("div",{staticClass:"el-dialog__body"},[e._t("default")],2):e._e(),e.$slots.footer?n("div",{staticClass:"el-dialog__footer"},[e._t("footer")],2):e._e()])])])},staticRenderFns:[]};t.a=o},7:function(e,t){e.exports=n(25)}})},function(e,t,n){var o,r,i;!function(s,a){r=[e,n(203),n(205),n(206)],void 0===(i="function"==typeof(o=a)?o.apply(t,r):o)||(e.exports=i)}(0,function(e,t,n,o){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n="data-clipboard-"+e;if(t.hasAttribute(n))return t.getAttribute(n)}var s=r(t),a=r(n),l=r(o),c="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},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),f=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return o.resolveOptions(n),o.listenClick(e),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,a.default),u(t,[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===c(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=(0,l.default)(e,"click",function(e){return t.onClick(e)})}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new s.default({action:this.action(t),target:this.target(t),text:this.text(t),container:this.container,trigger:t,emitter:this})}},{key:"defaultAction",value:function(e){return i("action",e)}},{key:"defaultTarget",value:function(e){var t=i("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return i("text",e)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,n=!!document.queryCommandSupported;return t.forEach(function(e){n=n&&!!document.queryCommandSupported(e)}),n}}]),t}();e.exports=f})},function(e,t,n){var o,r,i;!function(s,a){r=[e,n(204)],void 0===(i="function"==typeof(o=a)?o.apply(t,r):o)||(e.exports=i)}(0,function(e,t){"use strict";var n=function(e){return e&&e.__esModule?e:{default:e}}(t),o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.resolveOptions(t),this.initSelection()}return r(e,[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var e=this,t="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[t?"right":"left"]="-9999px";var o=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=o+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,n.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,n.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(e){if(void 0!==e){if(!e||"object"!==(void 0===e?"undefined":o(e))||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function(){return this._target}}]),e}();e.exports=i})},function(e,t){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var o=window.getSelection(),r=document.createRange();r.selectNodeContents(e),o.removeAllRanges(),o.addRange(r),t=o.toString()}return t}},function(e,t){function n(){}n.prototype={on:function(e,t,n){var o=this.e||(this.e={});return(o[e]||(o[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){function o(){r.off(e,o),t.apply(n,arguments)}var r=this;return o._=t,this.on(e,o,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),o=0,r=n.length;o<r;o++)n[o].fn.apply(n[o].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),o=n[e],r=[];if(o&&t)for(var i=0,s=o.length;i<s;i++)o[i].fn!==t&&o[i].fn._!==t&&r.push(o[i]);return r.length?n[e]=r:delete n[e],this}},e.exports=n},function(e,t,n){var o=n(207),r=n(208);e.exports=function(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!o.string(t))throw new TypeError("Second argument must be a String");if(!o.fn(n))throw new TypeError("Third argument must be a Function");if(o.node(e))return function(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}(e,t,n);if(o.nodeList(e))return function(e,t,n){return Array.prototype.forEach.call(e,function(e){e.addEventListener(t,n)}),{destroy:function(){Array.prototype.forEach.call(e,function(e){e.removeEventListener(t,n)})}}}(e,t,n);if(o.string(e))return function(e,t,n){return r(document.body,e,t,n)}(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var n=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},function(e,t,n){function o(e,t,n,o,i){var s=function(e,t,n,o){return function(n){n.delegateTarget=r(n.target,t),n.delegateTarget&&o.call(e,n)}}.apply(this,arguments);return e.addEventListener(n,s,i),{destroy:function(){e.removeEventListener(n,s,i)}}}var r=n(209);e.exports=function(e,t,n,r,i){return"function"==typeof e.addEventListener?o.apply(null,arguments):"function"==typeof n?o.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,function(e){return o(e,t,n,r,i)}))}},function(e,t){var n=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var o=Element.prototype;o.matches=o.matchesSelector||o.mozMatchesSelector||o.msMatchesSelector||o.oMatchesSelector||o.webkitMatchesSelector}e.exports=function(e,t){for(;e&&e.nodeType!==n;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){e.exports=n(496)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(82),r=(n.n(o),n(2)),i=(n.n(r),n(85)),s=n.n(i),a=n(87),l=(n.n(a),n(89)),c=n.n(l),u=n(90),f=(n.n(u),n(92)),p=n.n(f),d=n(98),h=(n.n(d),n(52)),m=n.n(h),v=n(94),g=(n.n(v),n(27)),b=n.n(g),y=n(199),x=(n.n(y),n(201)),w=n.n(x),k=n(116),C=(n.n(k),n(118)),S=n.n(C),$=n(152),O=(n.n($),n(154)),E=n.n(O),T=n(96),M=(n.n(T),n(77)),A=n.n(M),P=n(106),z=(n.n(P),n(80)),j=n.n(z),F=n(103),I=(n.n(F),n(105)),N=n.n(I),L=n(114),R=(n.n(L),n(65)),D=n.n(R),B=n(4),q=n.n(B),H=n(62),V=n.n(H),U=n(23),W=n.n(U),X=n(38),J=n(497),K=n.n(J);q.a.use(D.a),q.a.use(N.a),q.a.use(j.a),q.a.use(A.a),q.a.use(E.a),q.a.use(S.a),q.a.use(w.a),q.a.use(b.a),q.a.use(m.a),q.a.use(p.a.directive),q.a.prototype.$loading=p.a.service,q.a.prototype.$notify=c.a,q.a.prototype.$message=s.a,W.a.use(V.a),q.a.use(X.b),q.a.mixin({methods:{$t:function(e){return e}},filters:{ucFirst:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},_startCase:function(e){return _.startCase(e)}}}),new q.a({el:"#ff_all_forms_app",components:{ff_all_forms_table:K.a},data:{message:"Hello Vue!"}})},function(e,t,n){var o=n(3)(n(500),n(509),!1,function(e){n(498)},null,null);e.exports=o.exports},function(e,t,n){var o=n(499);"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);n(8)("ad2e2bb8",o,!0)},function(e,t,n){(e.exports=n(0)(void 0)).push([e.i,".el-message{top:40px}.text-center{text-align:center}.fluent_form_intro{max-width:600px;margin:0 auto;background:#fff;padding:20px 30px}.ff_forms_table .el-loading-mask{z-index:100}.copy{cursor:context-menu}",""])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(501),r=n.n(o),i=n(504),s=n.n(i),a=n(109),l=n.n(a),c=n(202),u=n.n(c);t.default={name:"AllForms",components:{ninja_pagination:r.a,AddFormModal:s.a,remove:l.a},data:function(){return{paginate:{total:0,current_page:1,last_page:1,per_page:10},loading:!1,items:[],search_string:"",selectAll:0,showAddFormModal:!1,checkedItems:[]}},methods:{goToPage:function(e){this.paginate.current_page=e,this.fetchItems()},fetchItems:function(){var e=this;this.loading=!0;var t={action:this.$action.getAllForms,per_page:this.paginate.per_page,page:this.paginate.current_page};jQuery.get(ajaxurl,t).done(function(t){e.items=t.data,e.paginate.total=t.total,e.paginate.current_page=t.current_page,e.paginate.last_page=t.last_page}).fail(function(t){e.$message.error("Something went wrong, please try again.")}).always(function(){e.loading=!1})},removeForm:function(e,t){var n=this,o={action:this.$action.removeForm,formId:e};jQuery.get(ajaxurl,o).done(function(e){n.items.splice(t,1),n.$notify.success({title:"Congratulations!",message:e.message,offset:30})}).fail(function(e){})}},mounted:function(){var e=this;this.fetchItems();new u.a(".copy").on("success",function(t){e.$message({message:"Copied to Clipboard!",type:"success"})})},created:function(){var e=this;-1!=window.location.hash.indexOf("add=1")&&(this.showAddFormModal=!0),jQuery('a[href="admin.php?page=fluent_forms#add=1"]').on("click",function(){e.showAddFormModal=!0})}}},function(e,t,n){var o=n(3)(n(502),n(503),!1,null,null,null);e.exports=o.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"Pagination",props:["paginate"],data:function(){return{pageNumberInput:1}},methods:{goToPage:function(e){e>=1&&e<=this.paginate.last_page?(this.$emit("change_page",e),this.pageNumberInput=e):alert("invalid page number")}}}},function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"tablenav-pages"},[e.paginate.total?n("span",{staticClass:"displaying-num"},[e._v(e._s(e.paginate.total)+" "+e._s(e.$t("items")))]):e._e(),e._v(" "),n("span",{staticClass:"pagination-links"},[1==e.paginate.current_page?[n("span",{staticClass:"tablenav-pages-navspan",attrs:{"aria-hidden":"true"}},[e._v("«")]),e._v(" "),n("span",{staticClass:"tablenav-pages-navspan",attrs:{"aria-hidden":"true"}},[e._v("‹")])]:[n("a",{staticClass:"first-page",attrs:{href:"#"},on:{click:function(t){t.preventDefault(),e.goToPage(1)}}},[n("span",{staticClass:"screen-reader-text"},[e._v(e._s(e.$t("First page")))]),n("span",{attrs:{"aria-hidden":"true"}},[e._v("«")])]),e._v(" "),n("a",{staticClass:"prev-page",attrs:{href:"#"},on:{click:function(t){t.preventDefault(),e.goToPage(e.paginate.current_page-1)}}},[n("span",{staticClass:"screen-reader-text"},[e._v(e._s(e.$t("Previous page")))]),n("span",{attrs:{"aria-hidden":"true"}},[e._v("‹")])])],e._v(" "),n("span",{staticClass:"screen-reader-text"},[e._v(e._s(e.$t("Current Page")))]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.pageNumberInput,expression:"pageNumberInput"}],staticClass:"current-page",attrs:{id:"current-page-selector",type:"text",size:"2","aria-describedby":"table-paging"},domProps:{value:e.pageNumberInput},on:{keydown:function(t){if(!("button"in t)&&e._k(t.keyCode,"enter",13,t.key))return null;t.preventDefault(),e.goToPage(e.pageNumberInput)},input:function(t){t.target.composing||(e.pageNumberInput=t.target.value)}}}),e._v(" \n "+e._s(e.$t("of"))+"\n "),n("span",{staticClass:"total-pages"},[e._v(e._s(e.paginate.last_page))]),e._v(" "),e.paginate.current_page==e.paginate.last_page?[n("span",{staticClass:"tablenav-pages-navspan",attrs:{"aria-hidden":"true"}},[e._v("›")]),e._v(" "),n("span",{staticClass:"tablenav-pages-navspan",attrs:{"aria-hidden":"true"}},[e._v("»")])]:[n("a",{staticClass:"next-page",attrs:{href:"#"},on:{click:function(t){t.preventDefault(),e.goToPage(e.paginate.current_page+1)}}},[n("span",{staticClass:"screen-reader-text"},[e._v(e._s(e.$t("Next page")))]),n("span",{attrs:{"aria-hidden":"true"}},[e._v("›")])]),e._v(" "),n("a",{staticClass:"last-page",attrs:{href:"#"},on:{click:function(t){t.preventDefault(),e.goToPage(e.paginate.last_page)}}},[n("span",{staticClass:"screen-reader-text"},[e._v(e._s(e.$t("Last page")))]),n("span",{attrs:{"aria-hidden":"true"}},[e._v("»")])])]],2)])},staticRenderFns:[]}},function(e,t,n){var o=n(3)(n(507),n(508),!1,function(e){n(505)},null,null);e.exports=o.exports},function(e,t,n){var o=n(506);"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);n(8)("3c873f4f",o,!0)},function(e,t,n){(e.exports=n(0)(void 0)).push([e.i,"small{font-weight:400;font-size:13px;margin-left:15px}",""])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"AddFormModal",props:{visibility:Boolean},data:function(){return{loading:!1,status:"published",templates:{blank:"Blank Form",contact:"Contact Form",support:"Support Form",eventRegistration:"Event Registration"},template:"",form_title:""}},methods:{close:function(){this.$emit("update:visibility",!1)},add:function(){var e=this;this.loading=!0;var t={action:this.$action.saveForm,type:this.template,title:this.form_title,status:this.status};jQuery.post(ajaxurl,t).then(function(t){e.$notify.success({title:"Congratulations!",message:t.data.message,offset:30}),window.location.href=t.data.redirect_url}).fail(function(t){e.$message.error("Please Provide the form name")}).always(function(){e.loading=!1})}}}},function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-dialog",{attrs:{visible:e.visibility,"before-close":e.close}},[n("span",{staticClass:"el-dialog__title",attrs:{slot:"title"},slot:"title"},[e._v("\n Add a New Form\n ")]),e._v(" "),n("el-form",{attrs:{model:{},"label-position":"top"},nativeOn:{submit:function(t){t.preventDefault(),e.add(t)}}},[n("el-form-item",{attrs:{label:"Your Form Name"}},[n("el-input",{attrs:{type:"text",placeholder:"Awesome Form"},model:{value:e.form_title,callback:function(t){e.form_title=t},expression:"form_title"}})],1)],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:e.close}},[e._v("Cancel")]),e._v(" "),n("el-button",{attrs:{loading:e.loading,type:"primary"},on:{click:e.add}},[e.loading?n("span",[e._v("Creating Form...")]):n("span",[e._v("Add Form")])])],1)],1)},staticRenderFns:[]}},function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{staticClass:"row"},[n("h1",{staticClass:"wp-heading-inline"},[e._v(e._s(e.$t("All Forms")))]),e._v(" "),n("div",{staticClass:"pull-right"},[n("el-button",{attrs:{size:"small",type:"primary"},on:{click:function(t){e.showAddFormModal=!0}}},[e._v("\n "+e._s(e.$t("Add Form"))+"\n ")])],1)]),e._v(" "),n("hr"),e._v(" "),e.loading||e.items.length?n("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"ff_forms_table",attrs:{"element-loading-text":"Loading Forms..."}},[e._e(),e._v(" "),n("table",{staticClass:"wp-list-table widefat fixed striped"},[n("thead",[n("tr",[n("th",{staticClass:"col-table-name"},[e._v(e._s(e.$t("Title")))]),e._v(" "),n("th",{staticClass:"col-table-name"},[e._v(e._s(e.$t("Short Code")))]),e._v(" "),n("th",{staticClass:"col-table-name",staticStyle:{width:"150px"}},[e._v(e._s(e.$t("Entries")))]),e._v(" "),n("th",{staticClass:"col-table-name",staticStyle:{width:"150px"}},[e._v(e._s(e.$t("Views")))]),e._v(" "),n("th",{staticClass:"col-table-name",staticStyle:{width:"150px"}},[e._v(e._s(e.$t("Conversion")))])])]),e._v(" "),n("tfoot",[n("tr",[n("th",{staticClass:"col-table-name"},[e._v(e._s(e.$t("Title")))]),e._v(" "),n("th",{staticClass:"col-table-name"},[e._v(e._s(e.$t("ShortCode")))]),e._v(" "),n("th",{staticClass:"col-table-name"},[e._v(e._s(e.$t("Entries")))]),e._v(" "),n("th",{staticClass:"col-table-name"},[e._v(e._s(e.$t("Views")))]),e._v(" "),n("th",{staticClass:"col-table-name"},[e._v(e._s(e.$t("Conversion")))])])]),e._v(" "),n("tbody",[e.loading?n("tr",[n("td",{attrs:{colspan:3}},[e._v(e._s(e.$t("Loading...")))])]):e._e(),e._v(" "),e.items.length||e.loading?e._e():n("tr",[n("td",{attrs:{colspan:3}},[e._v(e._s(e.$t("No Forms found!")))])]),e._v(" "),e._l(e.items,function(t,o){return n("tr",[n("th",{staticClass:"title column-title has-row-actions column-primary page-title"},[n("strong",[e._v("\n "+e._s(t.title)+"\n ")]),e._v(" "),n("div",{staticClass:"row-actions"},[n("span",{staticClass:"ff_edit"},[n("a",{attrs:{href:t.edit_url}},[e._v(" "+e._s(e.$t("Edit")))]),e._v(" |\n ")]),e._v(" "),n("span",{staticClass:"ff_entries"},[n("a",{attrs:{href:t.entries_url}},[e._v(" "+e._s(e.$t("Entries")))]),e._v(" |\n ")]),e._v(" "),n("span",{staticClass:"ff_entries"},[n("a",{attrs:{target:"_blank",href:t.preview_url}},[e._v(" "+e._s(e.$t("Preview")))]),e._v(" |\n ")]),e._v(" "),n("span",{staticClass:"trash"},[n("remove",{on:{"on-confirm":function(n){e.removeForm(t.id,o)}}},[n("a",{attrs:{slot:"icon"},slot:"icon"},[e._v(e._s(e.$t("Delete")))])])],1)])]),e._v(" "),n("td",[n("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"Click to copy shortcode",title:"Click to copy shortcode",placement:"top"}},[n("code",{staticClass:"copy",attrs:{"data-clipboard-text":'[fluentform id="'+t.id+'"]'}},[n("i",{staticClass:"el-icon-document"}),e._v(' [fluentform id="'+e._s(t.id)+'"]\n ')])])],1),e._v(" "),n("td",[e._v(e._s(t.total_Submissions))]),e._v(" "),n("td",[e._v(e._s(t.total_views))]),e._v(" "),n("td",[e._v(e._s(t.conversion)+"%")])])})],2)]),e._v(" "),n("div",{staticClass:"tablenav bottom"},[n("ninja_pagination",{attrs:{paginate:e.paginate},on:{change_page:e.goToPage}})],1)]):n("div",[n("div",{staticClass:"fluent_form_intro"},[n("h1",{staticClass:"text-center"},[e._v("Welcome to FluentFrom")]),e._v(" "),n("p",{staticClass:"text-center"},[e._v("Thank you for installing FluentFrom - The Most Advanced Form Builder Plugin for WordPress")]),e._v(" "),n("div",{staticClass:"text-center"},[n("el-button",{attrs:{type:"primary",round:""},on:{click:function(t){e.showAddFormModal=!0}}},[e._v("Click Here to Create Your First Form")])],1)])]),e._v(" "),n("add-form-modal",{attrs:{visibility:e.showAddFormModal},on:{"update:visibility":function(t){e.showAddFormModal=t}}})],1)},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"alignleft actions"},[t("ul",{staticClass:"subsubsub"},[t("li",{staticClass:"all"},[t("a",{staticClass:"current",attrs:{href:"#"}},[this._v("All "),t("span",{staticClass:"count"},[this._v("(1)")])]),this._v(" |\n ")]),this._v(" "),t("li",{staticClass:"active"},[t("a",{attrs:{href:"#"}},[this._v("Active "),t("span",{staticClass:"count"},[this._v("(1)")])]),this._v(" |\n ")]),this._v(" "),t("li",{staticClass:"inactive"},[t("a",{attrs:{href:"#"}},[this._v("Inactive (0)")]),this._v(" |\n ")]),this._v(" "),t("li",{staticClass:"trash"},[t("a",{attrs:{href:"#"}},[this._v("Trash (0)")])])])])}]}}]);
|
2 |
+
//# sourceMappingURL=fluent-all-forms-admin.js.map
|
public/js/fluent-all-forms-admin.js.map
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"version":3,"file":"/js/fluent-all-forms-admin.js","sources":["webpack:////js/fluent-all-forms-admin.js"],"sourcesContent":["!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=466)}([function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n=e[1]||\"\",r=e[3];if(!r)return n;if(t&&\"function\"==typeof btoa){var o=(s=r,\"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,\"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+\" */\"),i=r.sources.map(function(e){return\"/*# sourceURL=\"+r.sourceRoot+e+\" */\"});return[n].concat(i).concat([o]).join(\"\\n\")}var s;return[n].join(\"\\n\")}(t,e);return t[2]?\"@media \"+t[2]+\"{\"+n+\"}\":n}).join(\"\")},t.i=function(e,n){\"string\"==typeof e&&(e=[[null,e,\"\"]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];\"number\"==typeof i&&(r[i]=!0)}for(o=0;o<e.length;o++){var s=e[o];\"number\"==typeof s[0]&&r[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]=\"(\"+s[2]+\") and (\"+n+\")\"),t.push(s))}},t}},function(e,t,n){var r={},o=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}}(function(){return window&&document&&document.all&&!window.atob}),i=function(e){var t={};return function(e){return void 0===t[e]&&(t[e]=function(e){return document.querySelector(e)}.call(this,e)),t[e]}}(),s=null,a=0,l=[],c=n(58);e.exports=function(e,t){if(\"undefined\"!=typeof DEBUG&&DEBUG&&\"object\"!=typeof document)throw new Error(\"The style-loader cannot be used in a non-browser environment\");(t=t||{}).attrs=\"object\"==typeof t.attrs?t.attrs:{},t.singleton||(t.singleton=o()),t.insertInto||(t.insertInto=\"head\"),t.insertAt||(t.insertAt=\"bottom\");var n=f(e,t);return u(n,t),function(e){for(var o=[],i=0;i<n.length;i++){var s=n[i];(a=r[s.id]).refs--,o.push(a)}if(e){u(f(e,t),t)}for(i=0;i<o.length;i++){var a;if(0===(a=o[i]).refs){for(var l=0;l<a.parts.length;l++)a.parts[l]();delete r[a.id]}}}};function u(e,t){for(var n=0;n<e.length;n++){var o=e[n],i=r[o.id];if(i){i.refs++;for(var s=0;s<i.parts.length;s++)i.parts[s](o.parts[s]);for(;s<o.parts.length;s++)i.parts.push(v(o.parts[s],t))}else{var a=[];for(s=0;s<o.parts.length;s++)a.push(v(o.parts[s],t));r[o.id]={id:o.id,refs:1,parts:a}}}}function f(e,t){for(var n=[],r={},o=0;o<e.length;o++){var i=e[o],s=t.base?i[0]+t.base:i[0],a={css:i[1],media:i[2],sourceMap:i[3]};r[s]?r[s].parts.push(a):n.push(r[s]={id:s,parts:[a]})}return n}function d(e,t){var n=i(e.insertInto);if(!n)throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.\");var r=l[l.length-1];if(\"top\"===e.insertAt)r?r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),l.push(t);else{if(\"bottom\"!==e.insertAt)throw new Error(\"Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.\");n.appendChild(t)}}function p(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=l.indexOf(e);t>=0&&l.splice(t,1)}function h(e){var t=document.createElement(\"style\");return e.attrs.type=\"text/css\",m(t,e.attrs),d(e,t),t}function m(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function v(e,t){var n,r,o,i;if(t.transform&&e.css){if(!(i=t.transform(e.css)))return function(){};e.css=i}if(t.singleton){var l=a++;n=s||(s=h(t)),r=b.bind(null,n,l,!1),o=b.bind(null,n,l,!0)}else e.sourceMap&&\"function\"==typeof URL&&\"function\"==typeof URL.createObjectURL&&\"function\"==typeof URL.revokeObjectURL&&\"function\"==typeof Blob&&\"function\"==typeof btoa?(n=function(e){var t=document.createElement(\"link\");return e.attrs.type=\"text/css\",e.attrs.rel=\"stylesheet\",m(t,e.attrs),d(e,t),t}(t),r=function(e,t,n){var r=n.css,o=n.sourceMap,i=void 0===t.convertToAbsoluteUrls&&o;(t.convertToAbsoluteUrls||i)&&(r=c(r));o&&(r+=\"\\n/*# sourceMappingURL=data:application/json;base64,\"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+\" */\");var s=new Blob([r],{type:\"text/css\"}),a=e.href;e.href=URL.createObjectURL(s),a&&URL.revokeObjectURL(a)}.bind(null,n,t),o=function(){p(n),n.href&&URL.revokeObjectURL(n.href)}):(n=h(t),r=function(e,t){var n=t.css,r=t.media;r&&e.setAttribute(\"media\",r);if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),o=function(){p(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}var g=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join(\"\\n\")}}();function b(e,t,n,r){var o=n?\"\":r.css;if(e.styleSheet)e.styleSheet.cssText=g(t,o);else{var i=document.createTextNode(o),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(i,s[t]):e.appendChild(i)}}},function(e,t,n){var r=n(82);\"string\"==typeof r&&(r=[[e.i,r,\"\"]]);var o={};o.transform=void 0;n(1)(r,o);r.locals&&(e.exports=r.locals)},function(e,t){e.exports=function(e,t,n,r,o,i){var s,a=e=e||{},l=typeof e.default;\"object\"!==l&&\"function\"!==l||(s=e,a=e.default);var c=\"function\"==typeof a?a.options:a;t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),o&&(c._scopeId=o);var u;if(i?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||\"undefined\"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},c._ssrRegister=u):r&&(u=r),u){var f=c.functional,d=f?c.render:c.beforeCreate;f?(c._injectStyles=u,c.render=function(e,t){return u.call(t),d(e,t)}):c.beforeCreate=d?[].concat(d,u):[u]}return{esModule:s,exports:a,options:c}}},function(e,t,n){\"use strict\";(function(t,n){var r=Object.freeze({});function o(e){return void 0===e||null===e}function i(e){return void 0!==e&&null!==e}function s(e){return!0===e}function a(e){return\"string\"==typeof e||\"number\"==typeof e||\"symbol\"==typeof e||\"boolean\"==typeof e}function l(e){return null!==e&&\"object\"==typeof e}var c=Object.prototype.toString;function u(e){return\"[object Object]\"===c.call(e)}function f(e){return\"[object RegExp]\"===c.call(e)}function d(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function p(e){return null==e?\"\":\"object\"==typeof e?JSON.stringify(e,null,2):String(e)}function h(e){var t=parseFloat(e);return isNaN(t)?e:t}function m(e,t){for(var n=Object.create(null),r=e.split(\",\"),o=0;o<r.length;o++)n[r[o]]=!0;return t?function(e){return n[e.toLowerCase()]}:function(e){return n[e]}}var v=m(\"slot,component\",!0),g=m(\"key,ref,slot,slot-scope,is\");function b(e,t){if(e.length){var n=e.indexOf(t);if(n>-1)return e.splice(n,1)}}var _=Object.prototype.hasOwnProperty;function y(e,t){return _.call(e,t)}function x(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var w=/-(\\w)/g,k=x(function(e){return e.replace(w,function(e,t){return t?t.toUpperCase():\"\"})}),C=x(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),S=/\\B([A-Z])/g,$=x(function(e){return e.replace(S,\"-$1\").toLowerCase()});function O(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n}function E(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function T(e,t){for(var n in t)e[n]=t[n];return e}function M(e){for(var t={},n=0;n<e.length;n++)e[n]&&T(t,e[n]);return t}function A(e,t,n){}var P=function(e,t,n){return!1},z=function(e){return e};function j(e,t){if(e===t)return!0;var n=l(e),r=l(t);if(!n||!r)return!n&&!r&&String(e)===String(t);try{var o=Array.isArray(e),i=Array.isArray(t);if(o&&i)return e.length===t.length&&e.every(function(e,n){return j(e,t[n])});if(o||i)return!1;var s=Object.keys(e),a=Object.keys(t);return s.length===a.length&&s.every(function(n){return j(e[n],t[n])})}catch(e){return!1}}function F(e,t){for(var n=0;n<e.length;n++)if(j(e[n],t))return n;return-1}function I(e){var t=!1;return function(){t||(t=!0,e.apply(this,arguments))}}var N=\"data-server-rendered\",L=[\"component\",\"directive\",\"filter\"],R=[\"beforeCreate\",\"created\",\"beforeMount\",\"mounted\",\"beforeUpdate\",\"updated\",\"beforeDestroy\",\"destroyed\",\"activated\",\"deactivated\",\"errorCaptured\"],D={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:P,isReservedAttr:P,isUnknownElement:P,getTagNamespace:A,parsePlatformTagName:z,mustUseProp:P,_lifecycleHooks:R};function B(e){var t=(e+\"\").charCodeAt(0);return 36===t||95===t}function q(e,t,n,r){Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var H=/[^\\w.$]/;var V=\"__proto__\"in{},U=\"undefined\"!=typeof window,W=\"undefined\"!=typeof WXEnvironment&&!!WXEnvironment.platform,X=W&&WXEnvironment.platform.toLowerCase(),J=U&&window.navigator.userAgent.toLowerCase(),K=J&&/msie|trident/.test(J),Y=J&&J.indexOf(\"msie 9.0\")>0,G=J&&J.indexOf(\"edge/\")>0,Z=J&&J.indexOf(\"android\")>0||\"android\"===X,Q=J&&/iphone|ipad|ipod|ios/.test(J)||\"ios\"===X,ee=(J&&/chrome\\/\\d+/.test(J),{}.watch),te=!1;if(U)try{var ne={};Object.defineProperty(ne,\"passive\",{get:function(){te=!0}}),window.addEventListener(\"test-passive\",null,ne)}catch(e){}var re,oe=function(){return void 0===re&&(re=!U&&void 0!==t&&\"server\"===t.process.env.VUE_ENV),re},ie=U&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function se(e){return\"function\"==typeof e&&/native code/.test(e.toString())}var ae,le=\"undefined\"!=typeof Symbol&&se(Symbol)&&\"undefined\"!=typeof Reflect&&se(Reflect.ownKeys);ae=\"undefined\"!=typeof Set&&se(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var ce=A,ue=0,fe=function(){this.id=ue++,this.subs=[]};fe.prototype.addSub=function(e){this.subs.push(e)},fe.prototype.removeSub=function(e){b(this.subs,e)},fe.prototype.depend=function(){fe.target&&fe.target.addDep(this)},fe.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t<n;t++)e[t].update()},fe.target=null;var de=[];var pe=function(e,t,n,r,o,i,s,a){this.tag=e,this.data=t,this.children=n,this.text=r,this.elm=o,this.ns=void 0,this.context=i,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=s,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=a,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1},he={child:{configurable:!0}};he.child.get=function(){return this.componentInstance},Object.defineProperties(pe.prototype,he);var me=function(e){void 0===e&&(e=\"\");var t=new pe;return t.text=e,t.isComment=!0,t};function ve(e){return new pe(void 0,void 0,void 0,String(e))}function ge(e,t){var n=e.componentOptions,r=new pe(e.tag,e.data,e.children,e.text,e.elm,e.context,n,e.asyncFactory);return r.ns=e.ns,r.isStatic=e.isStatic,r.key=e.key,r.isComment=e.isComment,r.fnContext=e.fnContext,r.fnOptions=e.fnOptions,r.fnScopeId=e.fnScopeId,r.isCloned=!0,t&&(e.children&&(r.children=be(e.children,!0)),n&&n.children&&(n.children=be(n.children,!0))),r}function be(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++)r[o]=ge(e[o],t);return r}var _e=Array.prototype,ye=Object.create(_e);[\"push\",\"pop\",\"shift\",\"unshift\",\"splice\",\"sort\",\"reverse\"].forEach(function(e){var t=_e[e];q(ye,e,function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];var o,i=t.apply(this,n),s=this.__ob__;switch(e){case\"push\":case\"unshift\":o=n;break;case\"splice\":o=n.slice(2)}return o&&s.observeArray(o),s.dep.notify(),i})});var xe=Object.getOwnPropertyNames(ye),we={shouldConvert:!0},ke=function(e){if(this.value=e,this.dep=new fe,this.vmCount=0,q(e,\"__ob__\",this),Array.isArray(e)){(V?Ce:Se)(e,ye,xe),this.observeArray(e)}else this.walk(e)};ke.prototype.walk=function(e){for(var t=Object.keys(e),n=0;n<t.length;n++)Oe(e,t[n],e[t[n]])},ke.prototype.observeArray=function(e){for(var t=0,n=e.length;t<n;t++)$e(e[t])};function Ce(e,t,n){e.__proto__=t}function Se(e,t,n){for(var r=0,o=n.length;r<o;r++){var i=n[r];q(e,i,t[i])}}function $e(e,t){if(l(e)&&!(e instanceof pe)){var n;return y(e,\"__ob__\")&&e.__ob__ instanceof ke?n=e.__ob__:we.shouldConvert&&!oe()&&(Array.isArray(e)||u(e))&&Object.isExtensible(e)&&!e._isVue&&(n=new ke(e)),t&&n&&n.vmCount++,n}}function Oe(e,t,n,r,o){var i=new fe,s=Object.getOwnPropertyDescriptor(e,t);if(!s||!1!==s.configurable){var a=s&&s.get,l=s&&s.set,c=!o&&$e(n);Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var t=a?a.call(e):n;return fe.target&&(i.depend(),c&&(c.dep.depend(),Array.isArray(t)&&Me(t))),t},set:function(t){var r=a?a.call(e):n;t===r||t!=t&&r!=r||(l?l.call(e,t):n=t,c=!o&&$e(t),i.notify())}})}}function Ee(e,t,n){if(Array.isArray(e)&&d(t))return e.length=Math.max(e.length,t),e.splice(t,1,n),n;if(t in e&&!(t in Object.prototype))return e[t]=n,n;var r=e.__ob__;return e._isVue||r&&r.vmCount?n:r?(Oe(r.value,t,n),r.dep.notify(),n):(e[t]=n,n)}function Te(e,t){if(Array.isArray(e)&&d(t))e.splice(t,1);else{var n=e.__ob__;e._isVue||n&&n.vmCount||y(e,t)&&(delete e[t],n&&n.dep.notify())}}function Me(e){for(var t=void 0,n=0,r=e.length;n<r;n++)(t=e[n])&&t.__ob__&&t.__ob__.dep.depend(),Array.isArray(t)&&Me(t)}var Ae=D.optionMergeStrategies;function Pe(e,t){if(!t)return e;for(var n,r,o,i=Object.keys(t),s=0;s<i.length;s++)r=e[n=i[s]],o=t[n],y(e,n)?u(r)&&u(o)&&Pe(r,o):Ee(e,n,o);return e}function ze(e,t,n){return n?function(){var r=\"function\"==typeof t?t.call(n,n):t,o=\"function\"==typeof e?e.call(n,n):e;return r?Pe(r,o):o}:t?e?function(){return Pe(\"function\"==typeof t?t.call(this,this):t,\"function\"==typeof e?e.call(this,this):e)}:t:e}Ae.data=function(e,t,n){return n?ze(e,t,n):t&&\"function\"!=typeof t?e:ze(e,t)};function je(e,t){return t?e?e.concat(t):Array.isArray(t)?t:[t]:e}R.forEach(function(e){Ae[e]=je});function Fe(e,t,n,r){var o=Object.create(e||null);return t?T(o,t):o}L.forEach(function(e){Ae[e+\"s\"]=Fe}),Ae.watch=function(e,t,n,r){if(e===ee&&(e=void 0),t===ee&&(t=void 0),!t)return Object.create(e||null);if(!e)return t;var o={};T(o,e);for(var i in t){var s=o[i],a=t[i];s&&!Array.isArray(s)&&(s=[s]),o[i]=s?s.concat(a):Array.isArray(a)?a:[a]}return o},Ae.props=Ae.methods=Ae.inject=Ae.computed=function(e,t,n,r){if(!e)return t;var o=Object.create(null);return T(o,e),t&&T(o,t),o},Ae.provide=ze;var Ie=function(e,t){return void 0===t?e:t};function Ne(e,t,n){\"function\"==typeof t&&(t=t.options),function(e,t){var n=e.props;if(n){var r,o,i={};if(Array.isArray(n))for(r=n.length;r--;)\"string\"==typeof(o=n[r])&&(i[k(o)]={type:null});else if(u(n))for(var s in n)o=n[s],i[k(s)]=u(o)?o:{type:o};e.props=i}}(t),function(e,t){var n=e.inject;if(n){var r=e.inject={};if(Array.isArray(n))for(var o=0;o<n.length;o++)r[n[o]]={from:n[o]};else if(u(n))for(var i in n){var s=n[i];r[i]=u(s)?T({from:i},s):{from:s}}}}(t),function(e){var t=e.directives;if(t)for(var n in t){var r=t[n];\"function\"==typeof r&&(t[n]={bind:r,update:r})}}(t);var r=t.extends;if(r&&(e=Ne(e,r,n)),t.mixins)for(var o=0,i=t.mixins.length;o<i;o++)e=Ne(e,t.mixins[o],n);var s,a={};for(s in e)l(s);for(s in t)y(e,s)||l(s);function l(r){var o=Ae[r]||Ie;a[r]=o(e[r],t[r],n,r)}return a}function Le(e,t,n,r){if(\"string\"==typeof n){var o=e[t];if(y(o,n))return o[n];var i=k(n);if(y(o,i))return o[i];var s=C(i);if(y(o,s))return o[s];return o[n]||o[i]||o[s]}}function Re(e,t,n,r){var o=t[e],i=!y(n,e),s=n[e];if(Be(Boolean,o.type)&&(i&&!y(o,\"default\")?s=!1:Be(String,o.type)||\"\"!==s&&s!==$(e)||(s=!0)),void 0===s){s=function(e,t,n){if(!y(t,\"default\"))return;var r=t.default;0;if(e&&e.$options.propsData&&void 0===e.$options.propsData[n]&&void 0!==e._props[n])return e._props[n];return\"function\"==typeof r&&\"Function\"!==De(t.type)?r.call(e):r}(r,o,e);var a=we.shouldConvert;we.shouldConvert=!0,$e(s),we.shouldConvert=a}return s}function De(e){var t=e&&e.toString().match(/^\\s*function (\\w+)/);return t?t[1]:\"\"}function Be(e,t){if(!Array.isArray(t))return De(t)===De(e);for(var n=0,r=t.length;n<r;n++)if(De(t[n])===De(e))return!0;return!1}function qe(e,t,n){if(t)for(var r=t;r=r.$parent;){var o=r.$options.errorCaptured;if(o)for(var i=0;i<o.length;i++)try{if(!1===o[i].call(r,e,t,n))return}catch(e){He(e,r,\"errorCaptured hook\")}}He(e,t,n)}function He(e,t,n){if(D.errorHandler)try{return D.errorHandler.call(null,e,t,n)}catch(e){Ve(e,null,\"config.errorHandler\")}Ve(e,t,n)}function Ve(e,t,n){if(!U&&!W||\"undefined\"==typeof console)throw e;console.error(e)}var Ue=[],We=!1;function Xe(){We=!1;var e=Ue.slice(0);Ue.length=0;for(var t=0;t<e.length;t++)e[t]()}var Je,Ke,Ye=!1;if(void 0!==n&&se(n))Ke=function(){n(Xe)};else if(\"undefined\"==typeof MessageChannel||!se(MessageChannel)&&\"[object MessageChannelConstructor]\"!==MessageChannel.toString())Ke=function(){setTimeout(Xe,0)};else{var Ge=new MessageChannel,Ze=Ge.port2;Ge.port1.onmessage=Xe,Ke=function(){Ze.postMessage(1)}}if(\"undefined\"!=typeof Promise&&se(Promise)){var Qe=Promise.resolve();Je=function(){Qe.then(Xe),Q&&setTimeout(A)}}else Je=Ke;function et(e,t){var n;if(Ue.push(function(){if(e)try{e.call(t)}catch(e){qe(e,t,\"nextTick\")}else n&&n(t)}),We||(We=!0,Ye?Ke():Je()),!e&&\"undefined\"!=typeof Promise)return new Promise(function(e){n=e})}var tt=new ae;function nt(e){rt(e,tt),tt.clear()}function rt(e,t){var n,r,o=Array.isArray(e);if((o||l(e))&&!Object.isFrozen(e)){if(e.__ob__){var i=e.__ob__.dep.id;if(t.has(i))return;t.add(i)}if(o)for(n=e.length;n--;)rt(e[n],t);else for(n=(r=Object.keys(e)).length;n--;)rt(e[r[n]],t)}}var ot=x(function(e){var t=\"&\"===e.charAt(0),n=\"~\"===(e=t?e.slice(1):e).charAt(0),r=\"!\"===(e=n?e.slice(1):e).charAt(0);return{name:e=r?e.slice(1):e,once:n,capture:r,passive:t}});function it(e){function t(){var e=arguments,n=t.fns;if(!Array.isArray(n))return n.apply(null,arguments);for(var r=n.slice(),o=0;o<r.length;o++)r[o].apply(null,e)}return t.fns=e,t}function st(e,t,n,r,i){var s,a,l,c;for(s in e)a=e[s],l=t[s],c=ot(s),o(a)||(o(l)?(o(a.fns)&&(a=e[s]=it(a)),n(c.name,a,c.once,c.capture,c.passive,c.params)):a!==l&&(l.fns=a,e[s]=l));for(s in t)o(e[s])&&r((c=ot(s)).name,t[s],c.capture)}function at(e,t,n){e instanceof pe&&(e=e.data.hook||(e.data.hook={}));var r,a=e[t];function l(){n.apply(this,arguments),b(r.fns,l)}o(a)?r=it([l]):i(a.fns)&&s(a.merged)?(r=a).fns.push(l):r=it([a,l]),r.merged=!0,e[t]=r}function lt(e,t,n,r,o){if(i(t)){if(y(t,n))return e[n]=t[n],o||delete t[n],!0;if(y(t,r))return e[n]=t[r],o||delete t[r],!0}return!1}function ct(e){return i(e)&&i(e.text)&&(t=e.isComment,!1===t);var t}function ut(e,t){var n,r,l,c,u=[];for(n=0;n<e.length;n++)o(r=e[n])||\"boolean\"==typeof r||(c=u[l=u.length-1],Array.isArray(r)?r.length>0&&(ct((r=ut(r,(t||\"\")+\"_\"+n))[0])&&ct(c)&&(u[l]=ve(c.text+r[0].text),r.shift()),u.push.apply(u,r)):a(r)?ct(c)?u[l]=ve(c.text+r):\"\"!==r&&u.push(ve(r)):ct(r)&&ct(c)?u[l]=ve(c.text+r.text):(s(e._isVList)&&i(r.tag)&&o(r.key)&&i(t)&&(r.key=\"__vlist\"+t+\"_\"+n+\"__\"),u.push(r)));return u}function ft(e,t){return(e.__esModule||le&&\"Module\"===e[Symbol.toStringTag])&&(e=e.default),l(e)?t.extend(e):e}function dt(e){return e.isComment&&e.asyncFactory}function pt(e){if(Array.isArray(e))for(var t=0;t<e.length;t++){var n=e[t];if(i(n)&&(i(n.componentOptions)||dt(n)))return n}}var ht;function mt(e,t,n){n?ht.$once(e,t):ht.$on(e,t)}function vt(e,t){ht.$off(e,t)}function gt(e,t,n){ht=e,st(t,n||{},mt,vt),ht=void 0}function bt(e,t){var n={};if(!e)return n;for(var r=0,o=e.length;r<o;r++){var i=e[r],s=i.data;if(s&&s.attrs&&s.attrs.slot&&delete s.attrs.slot,i.context!==t&&i.fnContext!==t||!s||null==s.slot)(n.default||(n.default=[])).push(i);else{var a=s.slot,l=n[a]||(n[a]=[]);\"template\"===i.tag?l.push.apply(l,i.children||[]):l.push(i)}}for(var c in n)n[c].every(_t)&&delete n[c];return n}function _t(e){return e.isComment&&!e.asyncFactory||\" \"===e.text}function yt(e,t){t=t||{};for(var n=0;n<e.length;n++)Array.isArray(e[n])?yt(e[n],t):t[e[n].key]=e[n].fn;return t}var xt=null;function wt(e){for(;e&&(e=e.$parent);)if(e._inactive)return!0;return!1}function kt(e,t){if(t){if(e._directInactive=!1,wt(e))return}else if(e._directInactive)return;if(e._inactive||null===e._inactive){e._inactive=!1;for(var n=0;n<e.$children.length;n++)kt(e.$children[n]);St(e,\"activated\")}}function Ct(e,t){if(!(t&&(e._directInactive=!0,wt(e))||e._inactive)){e._inactive=!0;for(var n=0;n<e.$children.length;n++)Ct(e.$children[n]);St(e,\"deactivated\")}}function St(e,t){var n=e.$options[t];if(n)for(var r=0,o=n.length;r<o;r++)try{n[r].call(e)}catch(n){qe(n,e,t+\" hook\")}e._hasHookEvent&&e.$emit(\"hook:\"+t)}var $t=[],Ot=[],Et={},Tt=!1,Mt=!1,At=0;function Pt(){Mt=!0;var e,t;for($t.sort(function(e,t){return e.id-t.id}),At=0;At<$t.length;At++)t=(e=$t[At]).id,Et[t]=null,e.run();var n=Ot.slice(),r=$t.slice();At=$t.length=Ot.length=0,Et={},Tt=Mt=!1,function(e){for(var t=0;t<e.length;t++)e[t]._inactive=!0,kt(e[t],!0)}(n),function(e){var t=e.length;for(;t--;){var n=e[t],r=n.vm;r._watcher===n&&r._isMounted&&St(r,\"updated\")}}(r),ie&&D.devtools&&ie.emit(\"flush\")}var zt=0,jt=function(e,t,n,r,o){this.vm=e,o&&(e._watcher=this),e._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++zt,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new ae,this.newDepIds=new ae,this.expression=\"\",\"function\"==typeof t?this.getter=t:(this.getter=function(e){if(!H.test(e)){var t=e.split(\".\");return function(e){for(var n=0;n<t.length;n++){if(!e)return;e=e[t[n]]}return e}}}(t),this.getter||(this.getter=function(){})),this.value=this.lazy?void 0:this.get()};jt.prototype.get=function(){e=this,fe.target&&de.push(fe.target),fe.target=e;var e,t,n=this.vm;try{t=this.getter.call(n,n)}catch(e){if(!this.user)throw e;qe(e,n,'getter for watcher \"'+this.expression+'\"')}finally{this.deep&&nt(t),fe.target=de.pop(),this.cleanupDeps()}return t},jt.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},jt.prototype.cleanupDeps=function(){for(var e=this.deps.length;e--;){var t=this.deps[e];this.newDepIds.has(t.id)||t.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},jt.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():function(e){var t=e.id;if(null==Et[t]){if(Et[t]=!0,Mt){for(var n=$t.length-1;n>At&&$t[n].id>e.id;)n--;$t.splice(n+1,0,e)}else $t.push(e);Tt||(Tt=!0,et(Pt))}}(this)},jt.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||l(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){qe(e,this.vm,'callback for watcher \"'+this.expression+'\"')}else this.cb.call(this.vm,e,t)}}},jt.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},jt.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},jt.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||b(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var Ft={enumerable:!0,configurable:!0,get:A,set:A};function It(e,t,n){Ft.get=function(){return this[t][n]},Ft.set=function(e){this[t][n]=e},Object.defineProperty(e,n,Ft)}function Nt(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},o=e.$options._propKeys=[],i=!e.$parent;we.shouldConvert=i;var s=function(i){o.push(i);var s=Re(i,t,n,e);Oe(r,i,s),i in e||It(e,\"_props\",i)};for(var a in t)s(a);we.shouldConvert=!0}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]=null==t[n]?A:O(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;u(t=e._data=\"function\"==typeof t?function(e,t){try{return e.call(t,t)}catch(e){return qe(e,t,\"data()\"),{}}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,o=(e.$options.methods,n.length);for(;o--;){var i=n[o];0,r&&y(r,i)||B(i)||It(e,\"_data\",i)}$e(t,!0)}(e):$e(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=oe();for(var o in t){var i=t[o],s=\"function\"==typeof i?i:i.get;0,r||(n[o]=new jt(e,s||A,A,Lt)),o in e||Rt(e,o,i)}}(e,t.computed),t.watch&&t.watch!==ee&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var o=0;o<r.length;o++)Bt(e,n,r[o]);else Bt(e,n,r)}}(e,t.watch)}var Lt={lazy:!0};function Rt(e,t,n){var r=!oe();\"function\"==typeof n?(Ft.get=r?Dt(t):n,Ft.set=A):(Ft.get=n.get?r&&!1!==n.cache?Dt(t):n.get:A,Ft.set=n.set?n.set:A),Object.defineProperty(e,t,Ft)}function Dt(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),fe.target&&t.depend(),t.value}}function Bt(e,t,n,r){return u(n)&&(r=n,n=n.handler),\"string\"==typeof n&&(n=e[n]),e.$watch(t,n,r)}function qt(e,t){if(e){for(var n=Object.create(null),r=le?Reflect.ownKeys(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}):Object.keys(e),o=0;o<r.length;o++){for(var i=r[o],s=e[i].from,a=t;a;){if(a._provided&&s in a._provided){n[i]=a._provided[s];break}a=a.$parent}if(!a)if(\"default\"in e[i]){var l=e[i].default;n[i]=\"function\"==typeof l?l.call(t):l}else 0}return n}}function Ht(e,t){var n,r,o,s,a;if(Array.isArray(e)||\"string\"==typeof e)for(n=new Array(e.length),r=0,o=e.length;r<o;r++)n[r]=t(e[r],r);else if(\"number\"==typeof e)for(n=new Array(e),r=0;r<e;r++)n[r]=t(r+1,r);else if(l(e))for(s=Object.keys(e),n=new Array(s.length),r=0,o=s.length;r<o;r++)a=s[r],n[r]=t(e[a],a,r);return i(n)&&(n._isVList=!0),n}function Vt(e,t,n,r){var o,i=this.$scopedSlots[e];if(i)n=n||{},r&&(n=T(T({},r),n)),o=i(n)||t;else{var s=this.$slots[e];s&&(s._rendered=!0),o=s||t}var a=n&&n.slot;return a?this.$createElement(\"template\",{slot:a},o):o}function Ut(e){return Le(this.$options,\"filters\",e)||z}function Wt(e,t,n,r){var o=D.keyCodes[t]||n;return o?Array.isArray(o)?-1===o.indexOf(e):o!==e:r?$(r)!==t:void 0}function Xt(e,t,n,r,o){if(n)if(l(n)){Array.isArray(n)&&(n=M(n));var i,s=function(s){if(\"class\"===s||\"style\"===s||g(s))i=e;else{var a=e.attrs&&e.attrs.type;i=r||D.mustUseProp(t,a,s)?e.domProps||(e.domProps={}):e.attrs||(e.attrs={})}if(!(s in i)&&(i[s]=n[s],o)){(e.on||(e.on={}))[\"update:\"+s]=function(e){n[s]=e}}};for(var a in n)s(a)}else;return e}function Jt(e,t){var n=this._staticTrees||(this._staticTrees=[]),r=n[e];return r&&!t?Array.isArray(r)?be(r):ge(r):(Yt(r=n[e]=this.$options.staticRenderFns[e].call(this._renderProxy,null,this),\"__static__\"+e,!1),r)}function Kt(e,t,n){return Yt(e,\"__once__\"+t+(n?\"_\"+n:\"\"),!0),e}function Yt(e,t,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)e[r]&&\"string\"!=typeof e[r]&&Gt(e[r],t+\"_\"+r,n);else Gt(e,t,n)}function Gt(e,t,n){e.isStatic=!0,e.key=t,e.isOnce=n}function Zt(e,t){if(t)if(u(t)){var n=e.on=e.on?T({},e.on):{};for(var r in t){var o=n[r],i=t[r];n[r]=o?[].concat(o,i):i}}else;return e}function Qt(e){e._o=Kt,e._n=h,e._s=p,e._l=Ht,e._t=Vt,e._q=j,e._i=F,e._m=Jt,e._f=Ut,e._k=Wt,e._b=Xt,e._v=ve,e._e=me,e._u=yt,e._g=Zt}function en(e,t,n,o,i){var a=i.options;this.data=e,this.props=t,this.children=n,this.parent=o,this.listeners=e.on||r,this.injections=qt(a.inject,o),this.slots=function(){return bt(n,o)};var l=Object.create(o),c=s(a._compiled),u=!c;c&&(this.$options=a,this.$slots=this.slots(),this.$scopedSlots=e.scopedSlots||r),a._scopeId?this._c=function(e,t,n,r){var i=ln(l,e,t,n,r,u);return i&&(i.fnScopeId=a._scopeId,i.fnContext=o),i}:this._c=function(e,t,n,r){return ln(l,e,t,n,r,u)}}Qt(en.prototype);function tn(e,t){for(var n in t)e[k(n)]=t[n]}var nn={init:function(e,t,n,r){if(!e.componentInstance||e.componentInstance._isDestroyed){(e.componentInstance=function(e,t,n,r){var o={_isComponent:!0,parent:t,_parentVnode:e,_parentElm:n||null,_refElm:r||null},s=e.data.inlineTemplate;i(s)&&(o.render=s.render,o.staticRenderFns=s.staticRenderFns);return new e.componentOptions.Ctor(o)}(e,xt,n,r)).$mount(t?e.elm:void 0,t)}else if(e.data.keepAlive){var o=e;nn.prepatch(o,o)}},prepatch:function(e,t){var n=t.componentOptions;!function(e,t,n,o,i){var s=!!(i||e.$options._renderChildren||o.data.scopedSlots||e.$scopedSlots!==r);if(e.$options._parentVnode=o,e.$vnode=o,e._vnode&&(e._vnode.parent=o),e.$options._renderChildren=i,e.$attrs=o.data&&o.data.attrs||r,e.$listeners=n||r,t&&e.$options.props){we.shouldConvert=!1;for(var a=e._props,l=e.$options._propKeys||[],c=0;c<l.length;c++){var u=l[c];a[u]=Re(u,e.$options.props,t,e)}we.shouldConvert=!0,e.$options.propsData=t}if(n){var f=e.$options._parentListeners;e.$options._parentListeners=n,gt(e,n,f)}s&&(e.$slots=bt(i,o.context),e.$forceUpdate())}(t.componentInstance=e.componentInstance,n.propsData,n.listeners,t,n.children)},insert:function(e){var t=e.context,n=e.componentInstance;n._isMounted||(n._isMounted=!0,St(n,\"mounted\")),e.data.keepAlive&&(t._isMounted?((r=n)._inactive=!1,Ot.push(r)):kt(n,!0));var r},destroy:function(e){var t=e.componentInstance;t._isDestroyed||(e.data.keepAlive?Ct(t,!0):t.$destroy())}},rn=Object.keys(nn);function on(e,t,n,a,c){if(!o(e)){var u=n.$options._base;if(l(e)&&(e=u.extend(e)),\"function\"==typeof e){var f;if(o(e.cid)&&void 0===(e=function(e,t,n){if(s(e.error)&&i(e.errorComp))return e.errorComp;if(i(e.resolved))return e.resolved;if(s(e.loading)&&i(e.loadingComp))return e.loadingComp;if(!i(e.contexts)){var r=e.contexts=[n],a=!0,c=function(){for(var e=0,t=r.length;e<t;e++)r[e].$forceUpdate()},u=I(function(n){e.resolved=ft(n,t),a||c()}),f=I(function(t){i(e.errorComp)&&(e.error=!0,c())}),d=e(u,f);return l(d)&&(\"function\"==typeof d.then?o(e.resolved)&&d.then(u,f):i(d.component)&&\"function\"==typeof d.component.then&&(d.component.then(u,f),i(d.error)&&(e.errorComp=ft(d.error,t)),i(d.loading)&&(e.loadingComp=ft(d.loading,t),0===d.delay?e.loading=!0:setTimeout(function(){o(e.resolved)&&o(e.error)&&(e.loading=!0,c())},d.delay||200)),i(d.timeout)&&setTimeout(function(){o(e.resolved)&&f(null)},d.timeout))),a=!1,e.loading?e.loadingComp:e.resolved}e.contexts.push(n)}(f=e,u,n)))return function(e,t,n,r,o){var i=me();return i.asyncFactory=e,i.asyncMeta={data:t,context:n,children:r,tag:o},i}(f,t,n,a,c);t=t||{},fn(e),i(t.model)&&function(e,t){var n=e.model&&e.model.prop||\"value\",r=e.model&&e.model.event||\"input\";(t.props||(t.props={}))[n]=t.model.value;var o=t.on||(t.on={});i(o[r])?o[r]=[t.model.callback].concat(o[r]):o[r]=t.model.callback}(e.options,t);var d=function(e,t,n){var r=t.options.props;if(!o(r)){var s={},a=e.attrs,l=e.props;if(i(a)||i(l))for(var c in r){var u=$(c);lt(s,l,c,u,!0)||lt(s,a,c,u,!1)}return s}}(t,e);if(s(e.options.functional))return function(e,t,n,o,s){var a=e.options,l={},c=a.props;if(i(c))for(var u in c)l[u]=Re(u,c,t||r);else i(n.attrs)&&tn(l,n.attrs),i(n.props)&&tn(l,n.props);var f=new en(n,l,s,o,e),d=a.render.call(null,f._c,f);return d instanceof pe&&(d.fnContext=o,d.fnOptions=a,n.slot&&((d.data||(d.data={})).slot=n.slot)),d}(e,d,t,n,a);var p=t.on;if(t.on=t.nativeOn,s(e.options.abstract)){var h=t.slot;t={},h&&(t.slot=h)}!function(e){e.hook||(e.hook={});for(var t=0;t<rn.length;t++){var n=rn[t],r=e.hook[n],o=nn[n];e.hook[n]=r?(i=o,s=r,function(e,t,n,r){i(e,t,n,r),s(e,t,n,r)}):o}var i,s}(t);var m=e.options.name||c;return new pe(\"vue-component-\"+e.cid+(m?\"-\"+m:\"\"),t,void 0,void 0,void 0,n,{Ctor:e,propsData:d,listeners:p,tag:c,children:a},f)}}}var sn=1,an=2;function ln(e,t,n,r,o,l){return(Array.isArray(n)||a(n))&&(o=r,r=n,n=void 0),s(l)&&(o=an),function(e,t,n,r,o){if(i(n)&&i(n.__ob__))return me();i(n)&&i(n.is)&&(t=n.is);if(!t)return me();0;Array.isArray(r)&&\"function\"==typeof r[0]&&((n=n||{}).scopedSlots={default:r[0]},r.length=0);o===an?r=a(s=r)?[ve(s)]:Array.isArray(s)?ut(s):void 0:o===sn&&(r=function(e){for(var t=0;t<e.length;t++)if(Array.isArray(e[t]))return Array.prototype.concat.apply([],e);return e}(r));var s;var l,c;if(\"string\"==typeof t){var u;c=e.$vnode&&e.$vnode.ns||D.getTagNamespace(t),l=D.isReservedTag(t)?new pe(D.parsePlatformTagName(t),n,r,void 0,void 0,e):i(u=Le(e.$options,\"components\",t))?on(u,n,e,r,t):new pe(t,n,r,void 0,void 0,e)}else l=on(t,n,e,r);return i(l)?(c&&cn(l,c),l):me()}(e,t,n,r,o)}function cn(e,t,n){if(e.ns=t,\"foreignObject\"===e.tag&&(t=void 0,n=!0),i(e.children))for(var r=0,a=e.children.length;r<a;r++){var l=e.children[r];i(l.tag)&&(o(l.ns)||s(n))&&cn(l,t,n)}}var un=0;function fn(e){var t=e.options;if(e.super){var n=fn(e.super);if(n!==e.superOptions){e.superOptions=n;var r=function(e){var t,n=e.options,r=e.extendOptions,o=e.sealedOptions;for(var i in n)n[i]!==o[i]&&(t||(t={}),t[i]=dn(n[i],r[i],o[i]));return t}(e);r&&T(e.extendOptions,r),(t=e.options=Ne(n,e.extendOptions)).name&&(t.components[t.name]=e)}}return t}function dn(e,t,n){if(Array.isArray(e)){var r=[];n=Array.isArray(n)?n:[n],t=Array.isArray(t)?t:[t];for(var o=0;o<e.length;o++)(t.indexOf(e[o])>=0||n.indexOf(e[o])<0)&&r.push(e[o]);return r}return e}function pn(e){this._init(e)}pn.prototype._init=function(e){this._uid=un++,this._isVue=!0,e&&e._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r,n._parentElm=t._parentElm,n._refElm=t._refElm;var o=r.componentOptions;n.propsData=o.propsData,n._parentListeners=o.listeners,n._renderChildren=o.children,n._componentTag=o.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(this,e):this.$options=Ne(fn(this.constructor),e||{},this),this._renderProxy=this,this._self=this,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(this),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&>(e,t)}(this),function(e){e._vnode=null,e._staticTrees=null;var t=e.$options,n=e.$vnode=t._parentVnode,o=n&&n.context;e.$slots=bt(t._renderChildren,o),e.$scopedSlots=r,e._c=function(t,n,r,o){return ln(e,t,n,r,o,!1)},e.$createElement=function(t,n,r,o){return ln(e,t,n,r,o,!0)};var i=n&&n.data;Oe(e,\"$attrs\",i&&i.attrs||r,0,!0),Oe(e,\"$listeners\",t._parentListeners||r,0,!0)}(this),St(this,\"beforeCreate\"),function(e){var t=qt(e.$options.inject,e);t&&(we.shouldConvert=!1,Object.keys(t).forEach(function(n){Oe(e,n,t[n])}),we.shouldConvert=!0)}(this),Nt(this),function(e){var t=e.$options.provide;t&&(e._provided=\"function\"==typeof t?t.call(e):t)}(this),St(this,\"created\"),this.$options.el&&this.$mount(this.$options.el)};!function(e){var t={};t.get=function(){return this._data};var n={};n.get=function(){return this._props},Object.defineProperty(e.prototype,\"$data\",t),Object.defineProperty(e.prototype,\"$props\",n),e.prototype.$set=Ee,e.prototype.$delete=Te,e.prototype.$watch=function(e,t,n){if(u(t))return Bt(this,e,t,n);(n=n||{}).user=!0;var r=new jt(this,e,t,n);return n.immediate&&t.call(this,r.value),function(){r.teardown()}}}(pn),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){if(Array.isArray(e))for(var r=0,o=e.length;r<o;r++)this.$on(e[r],n);else(this._events[e]||(this._events[e]=[])).push(n),t.test(e)&&(this._hasHookEvent=!0);return this},e.prototype.$once=function(e,t){var n=this;function r(){n.$off(e,r),t.apply(n,arguments)}return r.fn=t,n.$on(e,r),n},e.prototype.$off=function(e,t){if(!arguments.length)return this._events=Object.create(null),this;if(Array.isArray(e)){for(var n=0,r=e.length;n<r;n++)this.$off(e[n],t);return this}var o=this._events[e];if(!o)return this;if(!t)return this._events[e]=null,this;if(t)for(var i,s=o.length;s--;)if((i=o[s])===t||i.fn===t){o.splice(s,1);break}return this},e.prototype.$emit=function(e){var t=this._events[e];if(t){t=t.length>1?E(t):t;for(var n=E(arguments,1),r=0,o=t.length;r<o;r++)try{t[r].apply(this,n)}catch(t){qe(t,this,'event handler for \"'+e+'\"')}}return this}}(pn),(hn=pn).prototype._update=function(e,t){this._isMounted&&St(this,\"beforeUpdate\");var n=this.$el,r=this._vnode,o=xt;xt=this,this._vnode=e,r?this.$el=this.__patch__(r,e):(this.$el=this.__patch__(this.$el,e,t,!1,this.$options._parentElm,this.$options._refElm),this.$options._parentElm=this.$options._refElm=null),xt=o,n&&(n.__vue__=null),this.$el&&(this.$el.__vue__=this),this.$vnode&&this.$parent&&this.$vnode===this.$parent._vnode&&(this.$parent.$el=this.$el)},hn.prototype.$forceUpdate=function(){this._watcher&&this._watcher.update()},hn.prototype.$destroy=function(){if(!this._isBeingDestroyed){St(this,\"beforeDestroy\"),this._isBeingDestroyed=!0;var e=this.$parent;!e||e._isBeingDestroyed||this.$options.abstract||b(e.$children,this),this._watcher&&this._watcher.teardown();for(var t=this._watchers.length;t--;)this._watchers[t].teardown();this._data.__ob__&&this._data.__ob__.vmCount--,this._isDestroyed=!0,this.__patch__(this._vnode,null),St(this,\"destroyed\"),this.$off(),this.$el&&(this.$el.__vue__=null),this.$vnode&&(this.$vnode.parent=null)}};var hn;Qt((mn=pn).prototype),mn.prototype.$nextTick=function(e){return et(e,this)},mn.prototype._render=function(){var e=this.$options,t=e.render,n=e._parentVnode;if(this._isMounted)for(var o in this.$slots){var i=this.$slots[o];(i._rendered||i[0]&&i[0].elm)&&(this.$slots[o]=be(i,!0))}this.$scopedSlots=n&&n.data.scopedSlots||r,this.$vnode=n;var s;try{s=t.call(this._renderProxy,this.$createElement)}catch(e){qe(e,this,\"render\"),s=this._vnode}return s instanceof pe||(s=me()),s.parent=n,s};var mn;function vn(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,o=e._Ctor||(e._Ctor={});if(o[r])return o[r];var i=e.name||n.options.name;var s=function(e){this._init(e)};return(s.prototype=Object.create(n.prototype)).constructor=s,s.cid=t++,s.options=Ne(n.options,e),s.super=n,s.options.props&&function(e){var t=e.options.props;for(var n in t)It(e.prototype,\"_props\",n)}(s),s.options.computed&&function(e){var t=e.options.computed;for(var n in t)Rt(e.prototype,n,t[n])}(s),s.extend=n.extend,s.mixin=n.mixin,s.use=n.use,L.forEach(function(e){s[e]=n[e]}),i&&(s.options.components[i]=s),s.superOptions=n.options,s.extendOptions=e,s.sealedOptions=T({},s.options),o[r]=s,s}}function gn(e){return e&&(e.Ctor.options.name||e.tag)}function bn(e,t){return Array.isArray(e)?e.indexOf(t)>-1:\"string\"==typeof e?e.split(\",\").indexOf(t)>-1:!!f(e)&&e.test(t)}function _n(e,t){var n=e.cache,r=e.keys,o=e._vnode;for(var i in n){var s=n[i];if(s){var a=gn(s.componentOptions);a&&!t(a)&&yn(n,i,r,o)}}}function yn(e,t,n,r){var o=e[t];!o||r&&o.tag===r.tag||o.componentInstance.$destroy(),e[t]=null,b(n,t)}var xn=[String,RegExp,Array],wn={KeepAlive:{name:\"keep-alive\",abstract:!0,props:{include:xn,exclude:xn,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)yn(this.cache,e,this.keys)},watch:{include:function(e){_n(this,function(t){return bn(e,t)})},exclude:function(e){_n(this,function(t){return!bn(e,t)})}},render:function(){var e=this.$slots.default,t=pt(e),n=t&&t.componentOptions;if(n){var r=gn(n),o=this.include,i=this.exclude;if(o&&(!r||!bn(o,r))||i&&r&&bn(i,r))return t;var s=this.cache,a=this.keys,l=null==t.key?n.Ctor.cid+(n.tag?\"::\"+n.tag:\"\"):t.key;s[l]?(t.componentInstance=s[l].componentInstance,b(a,l),a.push(l)):(s[l]=t,a.push(l),this.max&&a.length>parseInt(this.max)&&yn(s,a[0],a,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={};t.get=function(){return D},Object.defineProperty(e,\"config\",t),e.util={warn:ce,extend:T,mergeOptions:Ne,defineReactive:Oe},e.set=Ee,e.delete=Te,e.nextTick=et,e.options=Object.create(null),L.forEach(function(t){e.options[t+\"s\"]=Object.create(null)}),e.options._base=e,T(e.options.components,wn),e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=E(arguments,1);return n.unshift(this),\"function\"==typeof e.install?e.install.apply(e,n):\"function\"==typeof e&&e.apply(null,n),t.push(e),this},e.mixin=function(e){return this.options=Ne(this.options,e),this},vn(e),n=e,L.forEach(function(e){n[e]=function(t,n){return n?(\"component\"===e&&u(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),\"directive\"===e&&\"function\"==typeof n&&(n={bind:n,update:n}),this.options[e+\"s\"][t]=n,n):this.options[e+\"s\"][t]}});var n}(pn),Object.defineProperty(pn.prototype,\"$isServer\",{get:oe}),Object.defineProperty(pn.prototype,\"$ssrContext\",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),pn.version=\"2.5.13\";var kn=m(\"style,class\"),Cn=m(\"input,textarea,option,select,progress\"),Sn=function(e,t,n){return\"value\"===n&&Cn(e)&&\"button\"!==t||\"selected\"===n&&\"option\"===e||\"checked\"===n&&\"input\"===e||\"muted\"===n&&\"video\"===e},$n=m(\"contenteditable,draggable,spellcheck\"),On=m(\"allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible\"),En=\"http://www.w3.org/1999/xlink\",Tn=function(e){return\":\"===e.charAt(5)&&\"xlink\"===e.slice(0,5)},Mn=function(e){return Tn(e)?e.slice(6,e.length):\"\"},An=function(e){return null==e||!1===e};function Pn(e){for(var t=e.data,n=e,r=e;i(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(t=zn(r.data,t));for(;i(n=n.parent);)n&&n.data&&(t=zn(t,n.data));return function(e,t){if(i(e)||i(t))return jn(e,Fn(t));return\"\"}(t.staticClass,t.class)}function zn(e,t){return{staticClass:jn(e.staticClass,t.staticClass),class:i(e.class)?[e.class,t.class]:t.class}}function jn(e,t){return e?t?e+\" \"+t:e:t||\"\"}function Fn(e){return Array.isArray(e)?function(e){for(var t,n=\"\",r=0,o=e.length;r<o;r++)i(t=Fn(e[r]))&&\"\"!==t&&(n&&(n+=\" \"),n+=t);return n}(e):l(e)?function(e){var t=\"\";for(var n in e)e[n]&&(t&&(t+=\" \"),t+=n);return t}(e):\"string\"==typeof e?e:\"\"}var In={svg:\"http://www.w3.org/2000/svg\",math:\"http://www.w3.org/1998/Math/MathML\"},Nn=m(\"html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot\"),Ln=m(\"svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view\",!0),Rn=function(e){return Nn(e)||Ln(e)};function Dn(e){return Ln(e)?\"svg\":\"math\"===e?\"math\":void 0}var Bn=Object.create(null);var qn=m(\"text,number,password,search,email,tel,url\");function Hn(e){if(\"string\"==typeof e){var t=document.querySelector(e);return t||document.createElement(\"div\")}return e}var Vn=Object.freeze({createElement:function(e,t){var n=document.createElement(e);return\"select\"!==e?n:(t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute(\"multiple\",\"multiple\"),n)},createElementNS:function(e,t){return document.createElementNS(In[e],t)},createTextNode:function(e){return document.createTextNode(e)},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,n){e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},appendChild:function(e,t){e.appendChild(t)},parentNode:function(e){return e.parentNode},nextSibling:function(e){return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},setAttribute:function(e,t,n){e.setAttribute(t,n)}}),Un={create:function(e,t){Wn(t)},update:function(e,t){e.data.ref!==t.data.ref&&(Wn(e,!0),Wn(t))},destroy:function(e){Wn(e,!0)}};function Wn(e,t){var n=e.data.ref;if(n){var r=e.context,o=e.componentInstance||e.elm,i=r.$refs;t?Array.isArray(i[n])?b(i[n],o):i[n]===o&&(i[n]=void 0):e.data.refInFor?Array.isArray(i[n])?i[n].indexOf(o)<0&&i[n].push(o):i[n]=[o]:i[n]=o}}var Xn=new pe(\"\",{},[]),Jn=[\"create\",\"activate\",\"update\",\"remove\",\"destroy\"];function Kn(e,t){return e.key===t.key&&(e.tag===t.tag&&e.isComment===t.isComment&&i(e.data)===i(t.data)&&function(e,t){if(\"input\"!==e.tag)return!0;var n,r=i(n=e.data)&&i(n=n.attrs)&&n.type,o=i(n=t.data)&&i(n=n.attrs)&&n.type;return r===o||qn(r)&&qn(o)}(e,t)||s(e.isAsyncPlaceholder)&&e.asyncFactory===t.asyncFactory&&o(t.asyncFactory.error))}function Yn(e,t,n){var r,o,s={};for(r=t;r<=n;++r)i(o=e[r].key)&&(s[o]=r);return s}var Gn={create:Zn,update:Zn,destroy:function(e){Zn(e,Xn)}};function Zn(e,t){(e.data.directives||t.data.directives)&&function(e,t){var n,r,o,i=e===Xn,s=t===Xn,a=er(e.data.directives,e.context),l=er(t.data.directives,t.context),c=[],u=[];for(n in l)r=a[n],o=l[n],r?(o.oldValue=r.value,tr(o,\"update\",t,e),o.def&&o.def.componentUpdated&&u.push(o)):(tr(o,\"bind\",t,e),o.def&&o.def.inserted&&c.push(o));if(c.length){var f=function(){for(var n=0;n<c.length;n++)tr(c[n],\"inserted\",t,e)};i?at(t,\"insert\",f):f()}u.length&&at(t,\"postpatch\",function(){for(var n=0;n<u.length;n++)tr(u[n],\"componentUpdated\",t,e)});if(!i)for(n in a)l[n]||tr(a[n],\"unbind\",e,e,s)}(e,t)}var Qn=Object.create(null);function er(e,t){var n=Object.create(null);if(!e)return n;var r,o;for(r=0;r<e.length;r++)(o=e[r]).modifiers||(o.modifiers=Qn),n[(i=o,i.rawName||i.name+\".\"+Object.keys(i.modifiers||{}).join(\".\"))]=o,o.def=Le(t.$options,\"directives\",o.name);var i;return n}function tr(e,t,n,r,o){var i=e.def&&e.def[t];if(i)try{i(n.elm,e,n,r,o)}catch(r){qe(r,n.context,\"directive \"+e.name+\" \"+t+\" hook\")}}var nr=[Un,Gn];function rr(e,t){var n=t.componentOptions;if(!(i(n)&&!1===n.Ctor.options.inheritAttrs||o(e.data.attrs)&&o(t.data.attrs))){var r,s,a=t.elm,l=e.data.attrs||{},c=t.data.attrs||{};i(c.__ob__)&&(c=t.data.attrs=T({},c));for(r in c)s=c[r],l[r]!==s&&or(a,r,s);(K||G)&&c.value!==l.value&&or(a,\"value\",c.value);for(r in l)o(c[r])&&(Tn(r)?a.removeAttributeNS(En,Mn(r)):$n(r)||a.removeAttribute(r))}}function or(e,t,n){if(On(t))An(n)?e.removeAttribute(t):(n=\"allowfullscreen\"===t&&\"EMBED\"===e.tagName?\"true\":t,e.setAttribute(t,n));else if($n(t))e.setAttribute(t,An(n)||\"false\"===n?\"false\":\"true\");else if(Tn(t))An(n)?e.removeAttributeNS(En,Mn(t)):e.setAttributeNS(En,t,n);else if(An(n))e.removeAttribute(t);else{if(K&&!Y&&\"TEXTAREA\"===e.tagName&&\"placeholder\"===t&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener(\"input\",r)};e.addEventListener(\"input\",r),e.__ieph=!0}e.setAttribute(t,n)}}var ir={create:rr,update:rr};function sr(e,t){var n=t.elm,r=t.data,s=e.data;if(!(o(r.staticClass)&&o(r.class)&&(o(s)||o(s.staticClass)&&o(s.class)))){var a=Pn(t),l=n._transitionClasses;i(l)&&(a=jn(a,Fn(l))),a!==n._prevClass&&(n.setAttribute(\"class\",a),n._prevClass=a)}}var ar={create:sr,update:sr},lr=/[\\w).+\\-_$\\]]/;function cr(e){var t,n,r,o,i,s=!1,a=!1,l=!1,c=!1,u=0,f=0,d=0,p=0;for(r=0;r<e.length;r++)if(n=t,t=e.charCodeAt(r),s)39===t&&92!==n&&(s=!1);else if(a)34===t&&92!==n&&(a=!1);else if(l)96===t&&92!==n&&(l=!1);else if(c)47===t&&92!==n&&(c=!1);else if(124!==t||124===e.charCodeAt(r+1)||124===e.charCodeAt(r-1)||u||f||d){switch(t){case 34:a=!0;break;case 39:s=!0;break;case 96:l=!0;break;case 40:d++;break;case 41:d--;break;case 91:f++;break;case 93:f--;break;case 123:u++;break;case 125:u--}if(47===t){for(var h=r-1,m=void 0;h>=0&&\" \"===(m=e.charAt(h));h--);m&&lr.test(m)||(c=!0)}}else void 0===o?(p=r+1,o=e.slice(0,r).trim()):v();void 0===o?o=e.slice(0,r).trim():0!==p&&v();function v(){(i||(i=[])).push(e.slice(p,r).trim()),p=r+1}if(i)for(r=0;r<i.length;r++)o=ur(o,i[r]);return o}function ur(e,t){var n=t.indexOf(\"(\");if(n<0)return'_f(\"'+t+'\")('+e+\")\";return'_f(\"'+t.slice(0,n)+'\")('+e+\",\"+t.slice(n+1)}function fr(e){console.error(\"[Vue compiler]: \"+e)}function dr(e,t){return e?e.map(function(e){return e[t]}).filter(function(e){return e}):[]}function pr(e,t,n){(e.props||(e.props=[])).push({name:t,value:n}),e.plain=!1}function hr(e,t,n){(e.attrs||(e.attrs=[])).push({name:t,value:n}),e.plain=!1}function mr(e,t,n){e.attrsMap[t]=n,e.attrsList.push({name:t,value:n})}function vr(e,t,n,o,i,s){(o=o||r).capture&&(delete o.capture,t=\"!\"+t),o.once&&(delete o.once,t=\"~\"+t),o.passive&&(delete o.passive,t=\"&\"+t),\"click\"===t&&(o.right?(t=\"contextmenu\",delete o.right):o.middle&&(t=\"mouseup\"));var a;o.native?(delete o.native,a=e.nativeEvents||(e.nativeEvents={})):a=e.events||(e.events={});var l={value:n};o!==r&&(l.modifiers=o);var c=a[t];Array.isArray(c)?i?c.unshift(l):c.push(l):a[t]=c?i?[l,c]:[c,l]:l,e.plain=!1}function gr(e,t,n){var r=br(e,\":\"+t)||br(e,\"v-bind:\"+t);if(null!=r)return cr(r);if(!1!==n){var o=br(e,t);if(null!=o)return JSON.stringify(o)}}function br(e,t,n){var r;if(null!=(r=e.attrsMap[t]))for(var o=e.attrsList,i=0,s=o.length;i<s;i++)if(o[i].name===t){o.splice(i,1);break}return n&&delete e.attrsMap[t],r}function _r(e,t,n){var r=n||{},o=\"$$v\";r.trim&&(o=\"(typeof $$v === 'string'? $$v.trim(): $$v)\"),r.number&&(o=\"_n(\"+o+\")\");var i=yr(t,o);e.model={value:\"(\"+t+\")\",expression:'\"'+t+'\"',callback:\"function ($$v) {\"+i+\"}\"}}function yr(e,t){var n=function(e){if(xr=e.length,e.indexOf(\"[\")<0||e.lastIndexOf(\"]\")<xr-1)return(Cr=e.lastIndexOf(\".\"))>-1?{exp:e.slice(0,Cr),key:'\"'+e.slice(Cr+1)+'\"'}:{exp:e,key:null};wr=e,Cr=Sr=$r=0;for(;!Er();)Tr(kr=Or())?Ar(kr):91===kr&&Mr(kr);return{exp:e.slice(0,Sr),key:e.slice(Sr+1,$r)}}(e);return null===n.key?e+\"=\"+t:\"$set(\"+n.exp+\", \"+n.key+\", \"+t+\")\"}var xr,wr,kr,Cr,Sr,$r;function Or(){return wr.charCodeAt(++Cr)}function Er(){return Cr>=xr}function Tr(e){return 34===e||39===e}function Mr(e){var t=1;for(Sr=Cr;!Er();)if(Tr(e=Or()))Ar(e);else if(91===e&&t++,93===e&&t--,0===t){$r=Cr;break}}function Ar(e){for(var t=e;!Er()&&(e=Or())!==t;);}var Pr=\"__r\",zr=\"__c\";var jr;function Fr(e,t,n,r,o){t=(i=t)._withTask||(i._withTask=function(){Ye=!0;var e=i.apply(null,arguments);return Ye=!1,e});var i;n&&(t=function(e,t,n){var r=jr;return function o(){null!==e.apply(null,arguments)&&Ir(t,o,n,r)}}(t,e,r)),jr.addEventListener(e,t,te?{capture:r,passive:o}:r)}function Ir(e,t,n,r){(r||jr).removeEventListener(e,t._withTask||t,n)}function Nr(e,t){if(!o(e.data.on)||!o(t.data.on)){var n=t.data.on||{},r=e.data.on||{};jr=t.elm,function(e){if(i(e[Pr])){var t=K?\"change\":\"input\";e[t]=[].concat(e[Pr],e[t]||[]),delete e[Pr]}i(e[zr])&&(e.change=[].concat(e[zr],e.change||[]),delete e[zr])}(n),st(n,r,Fr,Ir,t.context),jr=void 0}}var Lr={create:Nr,update:Nr};function Rr(e,t){if(!o(e.data.domProps)||!o(t.data.domProps)){var n,r,s=t.elm,a=e.data.domProps||{},l=t.data.domProps||{};i(l.__ob__)&&(l=t.data.domProps=T({},l));for(n in a)o(l[n])&&(s[n]=\"\");for(n in l){if(r=l[n],\"textContent\"===n||\"innerHTML\"===n){if(t.children&&(t.children.length=0),r===a[n])continue;1===s.childNodes.length&&s.removeChild(s.childNodes[0])}if(\"value\"===n){s._value=r;var c=o(r)?\"\":String(r);f=c,(u=s).composing||\"OPTION\"!==u.tagName&&!function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(u,f)&&!function(e,t){var n=e.value,r=e._vModifiers;if(i(r)){if(r.lazy)return!1;if(r.number)return h(n)!==h(t);if(r.trim)return n.trim()!==t.trim()}return n!==t}(u,f)||(s.value=c)}else s[n]=r}var u,f}}var Dr={create:Rr,update:Rr},Br=x(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t});function qr(e){var t=Hr(e.style);return e.staticStyle?T(e.staticStyle,t):t}function Hr(e){return Array.isArray(e)?M(e):\"string\"==typeof e?Br(e):e}var Vr,Ur=/^--/,Wr=/\\s*!important$/,Xr=function(e,t,n){if(Ur.test(t))e.style.setProperty(t,n);else if(Wr.test(n))e.style.setProperty(t,n.replace(Wr,\"\"),\"important\");else{var r=Kr(t);if(Array.isArray(n))for(var o=0,i=n.length;o<i;o++)e.style[r]=n[o];else e.style[r]=n}},Jr=[\"Webkit\",\"Moz\",\"ms\"],Kr=x(function(e){if(Vr=Vr||document.createElement(\"div\").style,\"filter\"!==(e=k(e))&&e in Vr)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<Jr.length;n++){var r=Jr[n]+t;if(r in Vr)return r}});function Yr(e,t){var n=t.data,r=e.data;if(!(o(n.staticStyle)&&o(n.style)&&o(r.staticStyle)&&o(r.style))){var s,a,l=t.elm,c=r.staticStyle,u=r.normalizedStyle||r.style||{},f=c||u,d=Hr(t.data.style)||{};t.data.normalizedStyle=i(d.__ob__)?T({},d):d;var p=function(e,t){var n,r={};if(t)for(var o=e;o.componentInstance;)(o=o.componentInstance._vnode)&&o.data&&(n=qr(o.data))&&T(r,n);(n=qr(e.data))&&T(r,n);for(var i=e;i=i.parent;)i.data&&(n=qr(i.data))&&T(r,n);return r}(t,!0);for(a in f)o(p[a])&&Xr(l,a,\"\");for(a in p)(s=p[a])!==f[a]&&Xr(l,a,null==s?\"\":s)}}var Gr={create:Yr,update:Yr};function Zr(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(\" \")>-1?t.split(/\\s+/).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=\" \"+(e.getAttribute(\"class\")||\"\")+\" \";n.indexOf(\" \"+t+\" \")<0&&e.setAttribute(\"class\",(n+t).trim())}}function Qr(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(\" \")>-1?t.split(/\\s+/).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute(\"class\");else{for(var n=\" \"+(e.getAttribute(\"class\")||\"\")+\" \",r=\" \"+t+\" \";n.indexOf(r)>=0;)n=n.replace(r,\" \");(n=n.trim())?e.setAttribute(\"class\",n):e.removeAttribute(\"class\")}}function eo(e){if(e){if(\"object\"==typeof e){var t={};return!1!==e.css&&T(t,to(e.name||\"v\")),T(t,e),t}return\"string\"==typeof e?to(e):void 0}}var to=x(function(e){return{enterClass:e+\"-enter\",enterToClass:e+\"-enter-to\",enterActiveClass:e+\"-enter-active\",leaveClass:e+\"-leave\",leaveToClass:e+\"-leave-to\",leaveActiveClass:e+\"-leave-active\"}}),no=U&&!Y,ro=\"transition\",oo=\"animation\",io=\"transition\",so=\"transitionend\",ao=\"animation\",lo=\"animationend\";no&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(io=\"WebkitTransition\",so=\"webkitTransitionEnd\"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(ao=\"WebkitAnimation\",lo=\"webkitAnimationEnd\"));var co=U?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function uo(e){co(function(){co(e)})}function fo(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),Zr(e,t))}function po(e,t){e._transitionClasses&&b(e._transitionClasses,t),Qr(e,t)}function ho(e,t,n){var r=vo(e,t),o=r.type,i=r.timeout,s=r.propCount;if(!o)return n();var a=o===ro?so:lo,l=0,c=function(){e.removeEventListener(a,u),n()},u=function(t){t.target===e&&++l>=s&&c()};setTimeout(function(){l<s&&c()},i+1),e.addEventListener(a,u)}var mo=/\\b(transform|all)(,|$)/;function vo(e,t){var n,r=window.getComputedStyle(e),o=r[io+\"Delay\"].split(\", \"),i=r[io+\"Duration\"].split(\", \"),s=go(o,i),a=r[ao+\"Delay\"].split(\", \"),l=r[ao+\"Duration\"].split(\", \"),c=go(a,l),u=0,f=0;t===ro?s>0&&(n=ro,u=s,f=i.length):t===oo?c>0&&(n=oo,u=c,f=l.length):f=(n=(u=Math.max(s,c))>0?s>c?ro:oo:null)?n===ro?i.length:l.length:0;return{type:n,timeout:u,propCount:f,hasTransform:n===ro&&mo.test(r[io+\"Property\"])}}function go(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max.apply(null,t.map(function(t,n){return bo(t)+bo(e[n])}))}function bo(e){return 1e3*Number(e.slice(0,-1))}function _o(e,t){var n=e.elm;i(n._leaveCb)&&(n._leaveCb.cancelled=!0,n._leaveCb());var r=eo(e.data.transition);if(!o(r)&&!i(n._enterCb)&&1===n.nodeType){for(var s=r.css,a=r.type,c=r.enterClass,u=r.enterToClass,f=r.enterActiveClass,d=r.appearClass,p=r.appearToClass,m=r.appearActiveClass,v=r.beforeEnter,g=r.enter,b=r.afterEnter,_=r.enterCancelled,y=r.beforeAppear,x=r.appear,w=r.afterAppear,k=r.appearCancelled,C=r.duration,S=xt,$=xt.$vnode;$&&$.parent;)S=($=$.parent).context;var O=!S._isMounted||!e.isRootInsert;if(!O||x||\"\"===x){var E=O&&d?d:c,T=O&&m?m:f,M=O&&p?p:u,A=O?y||v:v,P=O&&\"function\"==typeof x?x:g,z=O?w||b:b,j=O?k||_:_,F=h(l(C)?C.enter:C);0;var N=!1!==s&&!Y,L=wo(P),R=n._enterCb=I(function(){N&&(po(n,M),po(n,T)),R.cancelled?(N&&po(n,E),j&&j(n)):z&&z(n),n._enterCb=null});e.data.show||at(e,\"insert\",function(){var t=n.parentNode,r=t&&t._pending&&t._pending[e.key];r&&r.tag===e.tag&&r.elm._leaveCb&&r.elm._leaveCb(),P&&P(n,R)}),A&&A(n),N&&(fo(n,E),fo(n,T),uo(function(){fo(n,M),po(n,E),R.cancelled||L||(xo(F)?setTimeout(R,F):ho(n,a,R))})),e.data.show&&(t&&t(),P&&P(n,R)),N||L||R()}}}function yo(e,t){var n=e.elm;i(n._enterCb)&&(n._enterCb.cancelled=!0,n._enterCb());var r=eo(e.data.transition);if(o(r)||1!==n.nodeType)return t();if(!i(n._leaveCb)){var s=r.css,a=r.type,c=r.leaveClass,u=r.leaveToClass,f=r.leaveActiveClass,d=r.beforeLeave,p=r.leave,m=r.afterLeave,v=r.leaveCancelled,g=r.delayLeave,b=r.duration,_=!1!==s&&!Y,y=wo(p),x=h(l(b)?b.leave:b);0;var w=n._leaveCb=I(function(){n.parentNode&&n.parentNode._pending&&(n.parentNode._pending[e.key]=null),_&&(po(n,u),po(n,f)),w.cancelled?(_&&po(n,c),v&&v(n)):(t(),m&&m(n)),n._leaveCb=null});g?g(k):k()}function k(){w.cancelled||(e.data.show||((n.parentNode._pending||(n.parentNode._pending={}))[e.key]=e),d&&d(n),_&&(fo(n,c),fo(n,f),uo(function(){fo(n,u),po(n,c),w.cancelled||y||(xo(x)?setTimeout(w,x):ho(n,a,w))})),p&&p(n,w),_||y||w())}}function xo(e){return\"number\"==typeof e&&!isNaN(e)}function wo(e){if(o(e))return!1;var t=e.fns;return i(t)?wo(Array.isArray(t)?t[0]:t):(e._length||e.length)>1}function ko(e,t){!0!==t.data.show&&_o(t)}var Co=function(e){var t,n,r={},l=e.modules,c=e.nodeOps;for(t=0;t<Jn.length;++t)for(r[Jn[t]]=[],n=0;n<l.length;++n)i(l[n][Jn[t]])&&r[Jn[t]].push(l[n][Jn[t]]);function u(e){var t=c.parentNode(e);i(t)&&c.removeChild(t,e)}function f(e,t,n,o,a){if(e.isRootInsert=!a,!function(e,t,n,o){var a=e.data;if(i(a)){var l=i(e.componentInstance)&&a.keepAlive;if(i(a=a.hook)&&i(a=a.init)&&a(e,!1,n,o),i(e.componentInstance))return d(e,t),s(l)&&function(e,t,n,o){for(var s,a=e;a.componentInstance;)if(a=a.componentInstance._vnode,i(s=a.data)&&i(s=s.transition)){for(s=0;s<r.activate.length;++s)r.activate[s](Xn,a);t.push(a);break}p(n,e.elm,o)}(e,t,n,o),!0}}(e,t,n,o)){var l=e.data,u=e.children,f=e.tag;i(f)?(e.elm=e.ns?c.createElementNS(e.ns,f):c.createElement(f,e),b(e),h(e,u,t),i(l)&&g(e,t),p(n,e.elm,o)):s(e.isComment)?(e.elm=c.createComment(e.text),p(n,e.elm,o)):(e.elm=c.createTextNode(e.text),p(n,e.elm,o))}}function d(e,t){i(e.data.pendingInsert)&&(t.push.apply(t,e.data.pendingInsert),e.data.pendingInsert=null),e.elm=e.componentInstance.$el,v(e)?(g(e,t),b(e)):(Wn(e),t.push(e))}function p(e,t,n){i(e)&&(i(n)?n.parentNode===e&&c.insertBefore(e,t,n):c.appendChild(e,t))}function h(e,t,n){if(Array.isArray(t))for(var r=0;r<t.length;++r)f(t[r],n,e.elm,null,!0);else a(e.text)&&c.appendChild(e.elm,c.createTextNode(String(e.text)))}function v(e){for(;e.componentInstance;)e=e.componentInstance._vnode;return i(e.tag)}function g(e,n){for(var o=0;o<r.create.length;++o)r.create[o](Xn,e);i(t=e.data.hook)&&(i(t.create)&&t.create(Xn,e),i(t.insert)&&n.push(e))}function b(e){var t;if(i(t=e.fnScopeId))c.setAttribute(e.elm,t,\"\");else for(var n=e;n;)i(t=n.context)&&i(t=t.$options._scopeId)&&c.setAttribute(e.elm,t,\"\"),n=n.parent;i(t=xt)&&t!==e.context&&t!==e.fnContext&&i(t=t.$options._scopeId)&&c.setAttribute(e.elm,t,\"\")}function _(e,t,n,r,o,i){for(;r<=o;++r)f(n[r],i,e,t)}function y(e){var t,n,o=e.data;if(i(o))for(i(t=o.hook)&&i(t=t.destroy)&&t(e),t=0;t<r.destroy.length;++t)r.destroy[t](e);if(i(t=e.children))for(n=0;n<e.children.length;++n)y(e.children[n])}function x(e,t,n,r){for(;n<=r;++n){var o=t[n];i(o)&&(i(o.tag)?(w(o),y(o)):u(o.elm))}}function w(e,t){if(i(t)||i(e.data)){var n,o=r.remove.length+1;for(i(t)?t.listeners+=o:t=function(e,t){function n(){0==--n.listeners&&u(e)}return n.listeners=t,n}(e.elm,o),i(n=e.componentInstance)&&i(n=n._vnode)&&i(n.data)&&w(n,t),n=0;n<r.remove.length;++n)r.remove[n](e,t);i(n=e.data.hook)&&i(n=n.remove)?n(e,t):t()}else u(e.elm)}function k(e,t,n,r){for(var o=n;o<r;o++){var s=t[o];if(i(s)&&Kn(e,s))return o}}function C(e,t,n,a){if(e!==t){var l=t.elm=e.elm;if(s(e.isAsyncPlaceholder))i(t.asyncFactory.resolved)?O(e.elm,t,n):t.isAsyncPlaceholder=!0;else if(s(t.isStatic)&&s(e.isStatic)&&t.key===e.key&&(s(t.isCloned)||s(t.isOnce)))t.componentInstance=e.componentInstance;else{var u,d=t.data;i(d)&&i(u=d.hook)&&i(u=u.prepatch)&&u(e,t);var p=e.children,h=t.children;if(i(d)&&v(t)){for(u=0;u<r.update.length;++u)r.update[u](e,t);i(u=d.hook)&&i(u=u.update)&&u(e,t)}o(t.text)?i(p)&&i(h)?p!==h&&function(e,t,n,r,s){for(var a,l,u,d=0,p=0,h=t.length-1,m=t[0],v=t[h],g=n.length-1,b=n[0],y=n[g],w=!s;d<=h&&p<=g;)o(m)?m=t[++d]:o(v)?v=t[--h]:Kn(m,b)?(C(m,b,r),m=t[++d],b=n[++p]):Kn(v,y)?(C(v,y,r),v=t[--h],y=n[--g]):Kn(m,y)?(C(m,y,r),w&&c.insertBefore(e,m.elm,c.nextSibling(v.elm)),m=t[++d],y=n[--g]):Kn(v,b)?(C(v,b,r),w&&c.insertBefore(e,v.elm,m.elm),v=t[--h],b=n[++p]):(o(a)&&(a=Yn(t,d,h)),o(l=i(b.key)?a[b.key]:k(b,t,d,h))?f(b,r,e,m.elm):Kn(u=t[l],b)?(C(u,b,r),t[l]=void 0,w&&c.insertBefore(e,u.elm,m.elm)):f(b,r,e,m.elm),b=n[++p]);d>h?_(e,o(n[g+1])?null:n[g+1].elm,n,p,g,r):p>g&&x(0,t,d,h)}(l,p,h,n,a):i(h)?(i(e.text)&&c.setTextContent(l,\"\"),_(l,null,h,0,h.length-1,n)):i(p)?x(0,p,0,p.length-1):i(e.text)&&c.setTextContent(l,\"\"):e.text!==t.text&&c.setTextContent(l,t.text),i(d)&&i(u=d.hook)&&i(u=u.postpatch)&&u(e,t)}}}function S(e,t,n){if(s(n)&&i(e.parent))e.parent.data.pendingInsert=t;else for(var r=0;r<t.length;++r)t[r].data.hook.insert(t[r])}var $=m(\"attrs,class,staticClass,staticStyle,key\");function O(e,t,n,r){var o,a=t.tag,l=t.data,c=t.children;if(r=r||l&&l.pre,t.elm=e,s(t.isComment)&&i(t.asyncFactory))return t.isAsyncPlaceholder=!0,!0;if(i(l)&&(i(o=l.hook)&&i(o=o.init)&&o(t,!0),i(o=t.componentInstance)))return d(t,n),!0;if(i(a)){if(i(c))if(e.hasChildNodes())if(i(o=l)&&i(o=o.domProps)&&i(o=o.innerHTML)){if(o!==e.innerHTML)return!1}else{for(var u=!0,f=e.firstChild,p=0;p<c.length;p++){if(!f||!O(f,c[p],n,r)){u=!1;break}f=f.nextSibling}if(!u||f)return!1}else h(t,c,n);if(i(l)){var m=!1;for(var v in l)if(!$(v)){m=!0,g(t,n);break}!m&&l.class&&nt(l.class)}}else e.data!==t.text&&(e.data=t.text);return!0}return function(e,t,n,a,l,u){if(!o(t)){var d=!1,p=[];if(o(e))d=!0,f(t,p,l,u);else{var h=i(e.nodeType);if(!h&&Kn(e,t))C(e,t,p,a);else{if(h){if(1===e.nodeType&&e.hasAttribute(N)&&(e.removeAttribute(N),n=!0),s(n)&&O(e,t,p))return S(t,p,!0),e;T=e,e=new pe(c.tagName(T).toLowerCase(),{},[],void 0,T)}var m=e.elm,g=c.parentNode(m);if(f(t,p,m._leaveCb?null:g,c.nextSibling(m)),i(t.parent))for(var b=t.parent,_=v(t);b;){for(var w=0;w<r.destroy.length;++w)r.destroy[w](b);if(b.elm=t.elm,_){for(var k=0;k<r.create.length;++k)r.create[k](Xn,b);var $=b.data.hook.insert;if($.merged)for(var E=1;E<$.fns.length;E++)$.fns[E]()}else Wn(b);b=b.parent}i(g)?x(0,[e],0,0):i(e.tag)&&y(e)}}var T;return S(t,p,d),t.elm}i(e)&&y(e)}}({nodeOps:Vn,modules:[ir,ar,Lr,Dr,Gr,U?{create:ko,activate:ko,remove:function(e,t){!0!==e.data.show?yo(e,t):t()}}:{}].concat(nr)});Y&&document.addEventListener(\"selectionchange\",function(){var e=document.activeElement;e&&e.vmodel&&Po(e,\"input\")});var So={inserted:function(e,t,n,r){\"select\"===n.tag?(r.elm&&!r.elm._vOptions?at(n,\"postpatch\",function(){So.componentUpdated(e,t,n)}):$o(e,t,n.context),e._vOptions=[].map.call(e.options,To)):(\"textarea\"===n.tag||qn(e.type))&&(e._vModifiers=t.modifiers,t.modifiers.lazy||(e.addEventListener(\"change\",Ao),Z||(e.addEventListener(\"compositionstart\",Mo),e.addEventListener(\"compositionend\",Ao)),Y&&(e.vmodel=!0)))},componentUpdated:function(e,t,n){if(\"select\"===n.tag){$o(e,t,n.context);var r=e._vOptions,o=e._vOptions=[].map.call(e.options,To);if(o.some(function(e,t){return!j(e,r[t])})){(e.multiple?t.value.some(function(e){return Eo(e,o)}):t.value!==t.oldValue&&Eo(t.value,o))&&Po(e,\"change\")}}}};function $o(e,t,n){Oo(e,t,n),(K||G)&&setTimeout(function(){Oo(e,t,n)},0)}function Oo(e,t,n){var r=t.value,o=e.multiple;if(!o||Array.isArray(r)){for(var i,s,a=0,l=e.options.length;a<l;a++)if(s=e.options[a],o)i=F(r,To(s))>-1,s.selected!==i&&(s.selected=i);else if(j(To(s),r))return void(e.selectedIndex!==a&&(e.selectedIndex=a));o||(e.selectedIndex=-1)}}function Eo(e,t){return t.every(function(t){return!j(t,e)})}function To(e){return\"_value\"in e?e._value:e.value}function Mo(e){e.target.composing=!0}function Ao(e){e.target.composing&&(e.target.composing=!1,Po(e.target,\"input\"))}function Po(e,t){var n=document.createEvent(\"HTMLEvents\");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function zo(e){return!e.componentInstance||e.data&&e.data.transition?e:zo(e.componentInstance._vnode)}var jo={model:So,show:{bind:function(e,t,n){var r=t.value,o=(n=zo(n)).data&&n.data.transition,i=e.__vOriginalDisplay=\"none\"===e.style.display?\"\":e.style.display;r&&o?(n.data.show=!0,_o(n,function(){e.style.display=i})):e.style.display=r?i:\"none\"},update:function(e,t,n){var r=t.value;if(r!==t.oldValue){(n=zo(n)).data&&n.data.transition?(n.data.show=!0,r?_o(n,function(){e.style.display=e.__vOriginalDisplay}):yo(n,function(){e.style.display=\"none\"})):e.style.display=r?e.__vOriginalDisplay:\"none\"}},unbind:function(e,t,n,r,o){o||(e.style.display=e.__vOriginalDisplay)}}},Fo={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Io(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Io(pt(t.children)):e}function No(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var o=n._parentListeners;for(var i in o)t[k(i)]=o[i];return t}function Lo(e,t){if(/\\d-keep-alive$/.test(t.tag))return e(\"keep-alive\",{props:t.componentOptions.propsData})}var Ro={name:\"transition\",props:Fo,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(function(e){return e.tag||dt(e)})).length){0;var r=this.mode;0;var o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var i=Io(o);if(!i)return o;if(this._leaving)return Lo(e,o);var s=\"__transition-\"+this._uid+\"-\";i.key=null==i.key?i.isComment?s+\"comment\":s+i.tag:a(i.key)?0===String(i.key).indexOf(s)?i.key:s+i.key:i.key;var l=(i.data||(i.data={})).transition=No(this),c=this._vnode,u=Io(c);if(i.data.directives&&i.data.directives.some(function(e){return\"show\"===e.name})&&(i.data.show=!0),u&&u.data&&(h=i,m=u,m.key!==h.key||m.tag!==h.tag)&&!dt(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var f=u.data.transition=T({},l);if(\"out-in\"===r)return this._leaving=!0,at(f,\"afterLeave\",function(){t._leaving=!1,t.$forceUpdate()}),Lo(e,o);if(\"in-out\"===r){if(dt(i))return c;var d,p=function(){d()};at(l,\"afterEnter\",p),at(l,\"enterCancelled\",p),at(f,\"delayLeave\",function(e){d=e})}}var h,m;return o}}},Do=T({tag:String,moveClass:String},Fo);delete Do.mode;function Bo(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function qo(e){e.data.newPos=e.elm.getBoundingClientRect()}function Ho(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,o=t.top-n.top;if(r||o){e.data.moved=!0;var i=e.elm.style;i.transform=i.WebkitTransform=\"translate(\"+r+\"px,\"+o+\"px)\",i.transitionDuration=\"0s\"}}var Vo={Transition:Ro,TransitionGroup:{props:Do,render:function(e){for(var t=this.tag||this.$vnode.data.tag||\"span\",n=Object.create(null),r=this.prevChildren=this.children,o=this.$slots.default||[],i=this.children=[],s=No(this),a=0;a<o.length;a++){var l=o[a];if(l.tag)if(null!=l.key&&0!==String(l.key).indexOf(\"__vlist\"))i.push(l),n[l.key]=l,(l.data||(l.data={})).transition=s;else{}}if(r){for(var c=[],u=[],f=0;f<r.length;f++){var d=r[f];d.data.transition=s,d.data.pos=d.elm.getBoundingClientRect(),n[d.key]?c.push(d):u.push(d)}this.kept=e(t,null,c),this.removed=u}return e(t,null,i)},beforeUpdate:function(){this.__patch__(this._vnode,this.kept,!1,!0),this._vnode=this.kept},updated:function(){var e=this.prevChildren,t=this.moveClass||(this.name||\"v\")+\"-move\";e.length&&this.hasMove(e[0].elm,t)&&(e.forEach(Bo),e.forEach(qo),e.forEach(Ho),this._reflow=document.body.offsetHeight,e.forEach(function(e){if(e.data.moved){var n=e.elm,r=n.style;fo(n,t),r.transform=r.WebkitTransform=r.transitionDuration=\"\",n.addEventListener(so,n._moveCb=function e(r){r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(so,e),n._moveCb=null,po(n,t))})}}))},methods:{hasMove:function(e,t){if(!no)return!1;if(this._hasMove)return this._hasMove;var n=e.cloneNode();e._transitionClasses&&e._transitionClasses.forEach(function(e){Qr(n,e)}),Zr(n,t),n.style.display=\"none\",this.$el.appendChild(n);var r=vo(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}}};pn.config.mustUseProp=Sn,pn.config.isReservedTag=Rn,pn.config.isReservedAttr=kn,pn.config.getTagNamespace=Dn,pn.config.isUnknownElement=function(e){if(!U)return!0;if(Rn(e))return!1;if(e=e.toLowerCase(),null!=Bn[e])return Bn[e];var t=document.createElement(e);return e.indexOf(\"-\")>-1?Bn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Bn[e]=/HTMLUnknownElement/.test(t.toString())},T(pn.options.directives,jo),T(pn.options.components,Vo),pn.prototype.__patch__=U?Co:A,pn.prototype.$mount=function(e,t){return e=e&&U?Hn(e):void 0,r=e,o=t,(n=this).$el=r,n.$options.render||(n.$options.render=me),St(n,\"beforeMount\"),new jt(n,function(){n._update(n._render(),o)},A,null,!0),o=!1,null==n.$vnode&&(n._isMounted=!0,St(n,\"mounted\")),n;var n,r,o},pn.nextTick(function(){D.devtools&&ie&&ie.emit(\"init\",pn)},0);var Uo=/\\{\\{((?:.|\\n)+?)\\}\\}/g,Wo=/[-.*+?^${}()|[\\]\\/\\\\]/g,Xo=x(function(e){var t=e[0].replace(Wo,\"\\\\$&\"),n=e[1].replace(Wo,\"\\\\$&\");return new RegExp(t+\"((?:.|\\\\n)+?)\"+n,\"g\")});function Jo(e,t){var n=t?Xo(t):Uo;if(n.test(e)){for(var r,o,i,s=[],a=[],l=n.lastIndex=0;r=n.exec(e);){(o=r.index)>l&&(a.push(i=e.slice(l,o)),s.push(JSON.stringify(i)));var c=cr(r[1].trim());s.push(\"_s(\"+c+\")\"),a.push({\"@binding\":c}),l=o+r[0].length}return l<e.length&&(a.push(i=e.slice(l)),s.push(JSON.stringify(i))),{expression:s.join(\"+\"),tokens:a}}}var Ko={staticKeys:[\"staticClass\"],transformNode:function(e,t){t.warn;var n=br(e,\"class\");n&&(e.staticClass=JSON.stringify(n));var r=gr(e,\"class\",!1);r&&(e.classBinding=r)},genData:function(e){var t=\"\";return e.staticClass&&(t+=\"staticClass:\"+e.staticClass+\",\"),e.classBinding&&(t+=\"class:\"+e.classBinding+\",\"),t}};var Yo,Go={staticKeys:[\"staticStyle\"],transformNode:function(e,t){t.warn;var n=br(e,\"style\");n&&(e.staticStyle=JSON.stringify(Br(n)));var r=gr(e,\"style\",!1);r&&(e.styleBinding=r)},genData:function(e){var t=\"\";return e.staticStyle&&(t+=\"staticStyle:\"+e.staticStyle+\",\"),e.styleBinding&&(t+=\"style:(\"+e.styleBinding+\"),\"),t}},Zo=function(e){return(Yo=Yo||document.createElement(\"div\")).innerHTML=e,Yo.textContent},Qo=m(\"area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr\"),ei=m(\"colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source\"),ti=m(\"address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track\"),ni=/^\\s*([^\\s\"'<>\\/=]+)(?:\\s*(=)\\s*(?:\"([^\"]*)\"+|'([^']*)'+|([^\\s\"'=<>`]+)))?/,ri=\"((?:[a-zA-Z_][\\\\w\\\\-\\\\.]*\\\\:)?[a-zA-Z_][\\\\w\\\\-\\\\.]*)\",oi=new RegExp(\"^<\"+ri),ii=/^\\s*(\\/?)>/,si=new RegExp(\"^<\\\\/\"+ri+\"[^>]*>\"),ai=/^<!DOCTYPE [^>]+>/i,li=/^<!--/,ci=/^<!\\[/,ui=!1;\"x\".replace(/x(.)?/g,function(e,t){ui=\"\"===t});var fi=m(\"script,style,textarea\",!0),di={},pi={\"<\":\"<\",\">\":\">\",\""\":'\"',\"&\":\"&\",\" \":\"\\n\",\"	\":\"\\t\"},hi=/&(?:lt|gt|quot|amp);/g,mi=/&(?:lt|gt|quot|amp|#10|#9);/g,vi=m(\"pre,textarea\",!0),gi=function(e,t){return e&&vi(e)&&\"\\n\"===t[0]};function bi(e,t){var n=t?mi:hi;return e.replace(n,function(e){return pi[e]})}var _i,yi,xi,wi,ki,Ci,Si,$i,Oi=/^@|^v-on:/,Ei=/^v-|^@|^:/,Ti=/(.*?)\\s+(?:in|of)\\s+(.*)/,Mi=/,([^,\\}\\]]*)(?:,([^,\\}\\]]*))?$/,Ai=/^\\(|\\)$/g,Pi=/:(.*)$/,zi=/^:|^v-bind:/,ji=/\\.[^.]+/g,Fi=x(Zo);function Ii(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:function(e){for(var t={},n=0,r=e.length;n<r;n++)t[e[n].name]=e[n].value;return t}(t),parent:n,children:[]}}function Ni(e,t){_i=t.warn||fr,Ci=t.isPreTag||P,Si=t.mustUseProp||P,$i=t.getTagNamespace||P,xi=dr(t.modules,\"transformNode\"),wi=dr(t.modules,\"preTransformNode\"),ki=dr(t.modules,\"postTransformNode\"),yi=t.delimiters;var n,r,o=[],i=!1!==t.preserveWhitespace,s=!1,a=!1;function l(e){e.pre&&(s=!1),Ci(e.tag)&&(a=!1);for(var n=0;n<ki.length;n++)ki[n](e,t)}return function(e,t){for(var n,r,o=[],i=t.expectHTML,s=t.isUnaryTag||P,a=t.canBeLeftOpenTag||P,l=0;e;){if(n=e,r&&fi(r)){var c=0,u=r.toLowerCase(),f=di[u]||(di[u]=new RegExp(\"([\\\\s\\\\S]*?)(</\"+u+\"[^>]*>)\",\"i\")),d=e.replace(f,function(e,n,r){return c=r.length,fi(u)||\"noscript\"===u||(n=n.replace(/<!--([\\s\\S]*?)-->/g,\"$1\").replace(/<!\\[CDATA\\[([\\s\\S]*?)]]>/g,\"$1\")),gi(u,n)&&(n=n.slice(1)),t.chars&&t.chars(n),\"\"});l+=e.length-d.length,e=d,$(u,l-c,l)}else{var p=e.indexOf(\"<\");if(0===p){if(li.test(e)){var h=e.indexOf(\"--\\x3e\");if(h>=0){t.shouldKeepComment&&t.comment(e.substring(4,h)),k(h+3);continue}}if(ci.test(e)){var m=e.indexOf(\"]>\");if(m>=0){k(m+2);continue}}var v=e.match(ai);if(v){k(v[0].length);continue}var g=e.match(si);if(g){var b=l;k(g[0].length),$(g[1],b,l);continue}var _=C();if(_){S(_),gi(r,e)&&k(1);continue}}var y=void 0,x=void 0,w=void 0;if(p>=0){for(x=e.slice(p);!(si.test(x)||oi.test(x)||li.test(x)||ci.test(x)||(w=x.indexOf(\"<\",1))<0);)p+=w,x=e.slice(p);y=e.substring(0,p),k(p)}p<0&&(y=e,e=\"\"),t.chars&&y&&t.chars(y)}if(e===n){t.chars&&t.chars(e);break}}$();function k(t){l+=t,e=e.substring(t)}function C(){var t=e.match(oi);if(t){var n={tagName:t[1],attrs:[],start:l};k(t[0].length);for(var r,o;!(r=e.match(ii))&&(o=e.match(ni));)k(o[0].length),n.attrs.push(o);if(r)return n.unarySlash=r[1],k(r[0].length),n.end=l,n}}function S(e){var n=e.tagName,l=e.unarySlash;i&&(\"p\"===r&&ti(n)&&$(r),a(n)&&r===n&&$(n));for(var c=s(n)||!!l,u=e.attrs.length,f=new Array(u),d=0;d<u;d++){var p=e.attrs[d];ui&&-1===p[0].indexOf('\"\"')&&(\"\"===p[3]&&delete p[3],\"\"===p[4]&&delete p[4],\"\"===p[5]&&delete p[5]);var h=p[3]||p[4]||p[5]||\"\",m=\"a\"===n&&\"href\"===p[1]?t.shouldDecodeNewlinesForHref:t.shouldDecodeNewlines;f[d]={name:p[1],value:bi(h,m)}}c||(o.push({tag:n,lowerCasedTag:n.toLowerCase(),attrs:f}),r=n),t.start&&t.start(n,f,c,e.start,e.end)}function $(e,n,i){var s,a;if(null==n&&(n=l),null==i&&(i=l),e&&(a=e.toLowerCase()),e)for(s=o.length-1;s>=0&&o[s].lowerCasedTag!==a;s--);else s=0;if(s>=0){for(var c=o.length-1;c>=s;c--)t.end&&t.end(o[c].tag,n,i);o.length=s,r=s&&o[s-1].tag}else\"br\"===a?t.start&&t.start(e,[],!0,n,i):\"p\"===a&&(t.start&&t.start(e,[],!1,n,i),t.end&&t.end(e,n,i))}}(e,{warn:_i,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,start:function(e,i,c){var u=r&&r.ns||$i(e);K&&\"svg\"===u&&(i=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];qi.test(r.name)||(r.name=r.name.replace(Hi,\"\"),t.push(r))}return t}(i));var f=Ii(e,i,r);u&&(f.ns=u),\"style\"!==(d=f).tag&&(\"script\"!==d.tag||d.attrsMap.type&&\"text/javascript\"!==d.attrsMap.type)||oe()||(f.forbidden=!0);for(var d,p=0;p<wi.length;p++)f=wi[p](f,t)||f;s||(null!=br(h=f,\"v-pre\")&&(h.pre=!0),f.pre&&(s=!0));var h;Ci(f.tag)&&(a=!0),s?function(e){var t=e.attrsList.length;if(t)for(var n=e.attrs=new Array(t),r=0;r<t;r++)n[r]={name:e.attrsList[r].name,value:JSON.stringify(e.attrsList[r].value)};else e.pre||(e.plain=!0)}(f):f.processed||(Ri(f),function(e){var t=br(e,\"v-if\");if(t)e.if=t,Di(e,{exp:t,block:e});else{null!=br(e,\"v-else\")&&(e.else=!0);var n=br(e,\"v-else-if\");n&&(e.elseif=n)}}(f),null!=br(m=f,\"v-once\")&&(m.once=!0),Li(f,t));var m;function v(e){0}if(n?o.length||n.if&&(f.elseif||f.else)&&(v(),Di(n,{exp:f.elseif,block:f})):(n=f,v()),r&&!f.forbidden)if(f.elseif||f.else)!function(e,t){var n=function(e){var t=e.length;for(;t--;){if(1===e[t].type)return e[t];e.pop()}}(t.children);n&&n.if&&Di(n,{exp:e.elseif,block:e})}(f,r);else if(f.slotScope){r.plain=!1;var g=f.slotTarget||'\"default\"';(r.scopedSlots||(r.scopedSlots={}))[g]=f}else r.children.push(f),f.parent=r;c?l(f):(r=f,o.push(f))},end:function(){var e=o[o.length-1],t=e.children[e.children.length-1];t&&3===t.type&&\" \"===t.text&&!a&&e.children.pop(),o.length-=1,r=o[o.length-1],l(e)},chars:function(e){if(r&&(!K||\"textarea\"!==r.tag||r.attrsMap.placeholder!==e)){var t,n=r.children;if(e=a||e.trim()?(t=r,\"script\"===t.tag||\"style\"===t.tag?e:Fi(e)):i&&n.length?\" \":\"\"){var o;!s&&\" \"!==e&&(o=Jo(e,yi))?n.push({type:2,expression:o.expression,tokens:o.tokens,text:e}):\" \"===e&&n.length&&\" \"===n[n.length-1].text||n.push({type:3,text:e})}}},comment:function(e){r.children.push({type:3,text:e,isComment:!0})}}),n}function Li(e,t){!function(e){var t=gr(e,\"key\");t&&(e.key=t)}(e),e.plain=!e.key&&!e.attrsList.length,function(e){var t=gr(e,\"ref\");t&&(e.ref=t,e.refInFor=function(e){var t=e;for(;t;){if(void 0!==t.for)return!0;t=t.parent}return!1}(e))}(e),function(e){if(\"slot\"===e.tag)e.slotName=gr(e,\"name\");else{var t;\"template\"===e.tag?(t=br(e,\"scope\"),e.slotScope=t||br(e,\"slot-scope\")):(t=br(e,\"slot-scope\"))&&(e.slotScope=t);var n=gr(e,\"slot\");n&&(e.slotTarget='\"\"'===n?'\"default\"':n,\"template\"===e.tag||e.slotScope||hr(e,\"slot\",n))}}(e),function(e){var t;(t=gr(e,\"is\"))&&(e.component=t);null!=br(e,\"inline-template\")&&(e.inlineTemplate=!0)}(e);for(var n=0;n<xi.length;n++)e=xi[n](e,t)||e;!function(e){var t,n,r,o,i,s,a,l=e.attrsList;for(t=0,n=l.length;t<n;t++)if(r=o=l[t].name,i=l[t].value,Ei.test(r))if(e.hasBindings=!0,(s=Bi(r))&&(r=r.replace(ji,\"\")),zi.test(r))r=r.replace(zi,\"\"),i=cr(i),a=!1,s&&(s.prop&&(a=!0,\"innerHtml\"===(r=k(r))&&(r=\"innerHTML\")),s.camel&&(r=k(r)),s.sync&&vr(e,\"update:\"+k(r),yr(i,\"$event\"))),a||!e.component&&Si(e.tag,e.attrsMap.type,r)?pr(e,r,i):hr(e,r,i);else if(Oi.test(r))r=r.replace(Oi,\"\"),vr(e,r,i,s,!1);else{var c=(r=r.replace(Ei,\"\")).match(Pi),u=c&&c[1];u&&(r=r.slice(0,-(u.length+1))),d=r,p=o,h=i,m=u,v=s,((f=e).directives||(f.directives=[])).push({name:d,rawName:p,value:h,arg:m,modifiers:v}),f.plain=!1}else{hr(e,r,JSON.stringify(i)),!e.component&&\"muted\"===r&&Si(e.tag,e.attrsMap.type,r)&&pr(e,r,\"true\")}var f,d,p,h,m,v}(e)}function Ri(e){var t;if(t=br(e,\"v-for\")){var n=function(e){var t=e.match(Ti);if(!t)return;var n={};n.for=t[2].trim();var r=t[1].trim().replace(Ai,\"\"),o=r.match(Mi);o?(n.alias=r.replace(Mi,\"\"),n.iterator1=o[1].trim(),o[2]&&(n.iterator2=o[2].trim())):n.alias=r;return n}(t);n&&T(e,n)}}function Di(e,t){e.ifConditions||(e.ifConditions=[]),e.ifConditions.push(t)}function Bi(e){var t=e.match(ji);if(t){var n={};return t.forEach(function(e){n[e.slice(1)]=!0}),n}}var qi=/^xmlns:NS\\d+/,Hi=/^NS\\d+:/;function Vi(e){return Ii(e.tag,e.attrsList.slice(),e.parent)}var Ui=[Ko,Go,{preTransformNode:function(e,t){if(\"input\"===e.tag){var n=e.attrsMap;if(n[\"v-model\"]&&(n[\"v-bind:type\"]||n[\":type\"])){var r=gr(e,\"type\"),o=br(e,\"v-if\",!0),i=o?\"&&(\"+o+\")\":\"\",s=null!=br(e,\"v-else\",!0),a=br(e,\"v-else-if\",!0),l=Vi(e);Ri(l),mr(l,\"type\",\"checkbox\"),Li(l,t),l.processed=!0,l.if=\"(\"+r+\")==='checkbox'\"+i,Di(l,{exp:l.if,block:l});var c=Vi(e);br(c,\"v-for\",!0),mr(c,\"type\",\"radio\"),Li(c,t),Di(l,{exp:\"(\"+r+\")==='radio'\"+i,block:c});var u=Vi(e);return br(u,\"v-for\",!0),mr(u,\":type\",r),Li(u,t),Di(l,{exp:o,block:u}),s?l.else=!0:a&&(l.elseif=a),l}}}}];var Wi,Xi,Ji,Ki={expectHTML:!0,modules:Ui,directives:{model:function(e,t,n){n;var r=t.value,o=t.modifiers,i=e.tag,s=e.attrsMap.type;if(e.component)return _r(e,r,o),!1;if(\"select\"===i)!function(e,t,n){var r='var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return '+(n&&n.number?\"_n(val)\":\"val\")+\"});\";r=r+\" \"+yr(t,\"$event.target.multiple ? $$selectedVal : $$selectedVal[0]\"),vr(e,\"change\",r,null,!0)}(e,r,o);else if(\"input\"===i&&\"checkbox\"===s)!function(e,t,n){var r=n&&n.number,o=gr(e,\"value\")||\"null\",i=gr(e,\"true-value\")||\"true\",s=gr(e,\"false-value\")||\"false\";pr(e,\"checked\",\"Array.isArray(\"+t+\")?_i(\"+t+\",\"+o+\")>-1\"+(\"true\"===i?\":(\"+t+\")\":\":_q(\"+t+\",\"+i+\")\")),vr(e,\"change\",\"var $$a=\"+t+\",$$el=$event.target,$$c=$$el.checked?(\"+i+\"):(\"+s+\");if(Array.isArray($$a)){var $$v=\"+(r?\"_n(\"+o+\")\":o)+\",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&(\"+t+\"=$$a.concat([$$v]))}else{$$i>-1&&(\"+t+\"=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{\"+yr(t,\"$$c\")+\"}\",null,!0)}(e,r,o);else if(\"input\"===i&&\"radio\"===s)!function(e,t,n){var r=n&&n.number,o=gr(e,\"value\")||\"null\";pr(e,\"checked\",\"_q(\"+t+\",\"+(o=r?\"_n(\"+o+\")\":o)+\")\"),vr(e,\"change\",yr(t,o),null,!0)}(e,r,o);else if(\"input\"===i||\"textarea\"===i)!function(e,t,n){var r=e.attrsMap.type,o=n||{},i=o.lazy,s=o.number,a=o.trim,l=!i&&\"range\"!==r,c=i?\"change\":\"range\"===r?Pr:\"input\",u=\"$event.target.value\";a&&(u=\"$event.target.value.trim()\"),s&&(u=\"_n(\"+u+\")\");var f=yr(t,u);l&&(f=\"if($event.target.composing)return;\"+f),pr(e,\"value\",\"(\"+t+\")\"),vr(e,c,f,null,!0),(a||s)&&vr(e,\"blur\",\"$forceUpdate()\")}(e,r,o);else if(!D.isReservedTag(i))return _r(e,r,o),!1;return!0},text:function(e,t){t.value&&pr(e,\"textContent\",\"_s(\"+t.value+\")\")},html:function(e,t){t.value&&pr(e,\"innerHTML\",\"_s(\"+t.value+\")\")}},isPreTag:function(e){return\"pre\"===e},isUnaryTag:Qo,mustUseProp:Sn,canBeLeftOpenTag:ei,isReservedTag:Rn,getTagNamespace:Dn,staticKeys:(Wi=Ui,Wi.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(\",\"))},Yi=x(function(e){return m(\"type,tag,attrsList,attrsMap,plain,parent,children,attrs\"+(e?\",\"+e:\"\"))});function Gi(e){if(e.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||v(e.tag)||!Ji(e.tag)||function(e){for(;e.parent;){if(\"template\"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(Xi)))}(e),1===e.type){if(!Ji(e.tag)&&\"slot\"!==e.tag&&null==e.attrsMap[\"inline-template\"])return;for(var t=0,n=e.children.length;t<n;t++){var r=e.children[t];Gi(r),r.static||(e.static=!1)}if(e.ifConditions)for(var o=1,i=e.ifConditions.length;o<i;o++){var s=e.ifConditions[o].block;Gi(s),s.static||(e.static=!1)}}}function Zi(e,t){if(1===e.type){if((e.static||e.once)&&(e.staticInFor=t),e.static&&e.children.length&&(1!==e.children.length||3!==e.children[0].type))return void(e.staticRoot=!0);if(e.staticRoot=!1,e.children)for(var n=0,r=e.children.length;n<r;n++)Zi(e.children[n],t||!!e.for);if(e.ifConditions)for(var o=1,i=e.ifConditions.length;o<i;o++)Zi(e.ifConditions[o].block,t)}}var Qi=/^\\s*([\\w$_]+|\\([^)]*?\\))\\s*=>|^function\\s*\\(/,es=/^\\s*[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*|\\['.*?']|\\[\".*?\"]|\\[\\d+]|\\[[A-Za-z_$][\\w$]*])*\\s*$/,ts={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},ns=function(e){return\"if(\"+e+\")return null;\"},rs={stop:\"$event.stopPropagation();\",prevent:\"$event.preventDefault();\",self:ns(\"$event.target !== $event.currentTarget\"),ctrl:ns(\"!$event.ctrlKey\"),shift:ns(\"!$event.shiftKey\"),alt:ns(\"!$event.altKey\"),meta:ns(\"!$event.metaKey\"),left:ns(\"'button' in $event && $event.button !== 0\"),middle:ns(\"'button' in $event && $event.button !== 1\"),right:ns(\"'button' in $event && $event.button !== 2\")};function os(e,t,n){var r=t?\"nativeOn:{\":\"on:{\";for(var o in e)r+='\"'+o+'\":'+is(o,e[o])+\",\";return r.slice(0,-1)+\"}\"}function is(e,t){if(!t)return\"function(){}\";if(Array.isArray(t))return\"[\"+t.map(function(t){return is(e,t)}).join(\",\")+\"]\";var n=es.test(t.value),r=Qi.test(t.value);if(t.modifiers){var o=\"\",i=\"\",s=[];for(var a in t.modifiers)if(rs[a])i+=rs[a],ts[a]&&s.push(a);else if(\"exact\"===a){var l=t.modifiers;i+=ns([\"ctrl\",\"shift\",\"alt\",\"meta\"].filter(function(e){return!l[e]}).map(function(e){return\"$event.\"+e+\"Key\"}).join(\"||\"))}else s.push(a);s.length&&(o+=(c=s,\"if(!('button' in $event)&&\"+c.map(ss).join(\"&&\")+\")return null;\")),i&&(o+=i);return\"function($event){\"+o+(n?t.value+\"($event)\":r?\"(\"+t.value+\")($event)\":t.value)+\"}\"}return n||r?t.value:\"function($event){\"+t.value+\"}\";var c}function ss(e){var t=parseInt(e,10);if(t)return\"$event.keyCode!==\"+t;var n=ts[e];return\"_k($event.keyCode,\"+JSON.stringify(e)+\",\"+JSON.stringify(n)+\",$event.key)\"}var as={on:function(e,t){e.wrapListeners=function(e){return\"_g(\"+e+\",\"+t.value+\")\"}},bind:function(e,t){e.wrapData=function(n){return\"_b(\"+n+\",'\"+e.tag+\"',\"+t.value+\",\"+(t.modifiers&&t.modifiers.prop?\"true\":\"false\")+(t.modifiers&&t.modifiers.sync?\",true\":\"\")+\")\"}},cloak:A},ls=function(e){this.options=e,this.warn=e.warn||fr,this.transforms=dr(e.modules,\"transformCode\"),this.dataGenFns=dr(e.modules,\"genData\"),this.directives=T(T({},as),e.directives);var t=e.isReservedTag||P;this.maybeComponent=function(e){return!t(e.tag)},this.onceId=0,this.staticRenderFns=[]};function cs(e,t){var n=new ls(t);return{render:\"with(this){return \"+(e?us(e,n):'_c(\"div\")')+\"}\",staticRenderFns:n.staticRenderFns}}function us(e,t){if(e.staticRoot&&!e.staticProcessed)return fs(e,t);if(e.once&&!e.onceProcessed)return ds(e,t);if(e.for&&!e.forProcessed)return function(e,t,n,r){var o=e.for,i=e.alias,s=e.iterator1?\",\"+e.iterator1:\"\",a=e.iterator2?\",\"+e.iterator2:\"\";0;return e.forProcessed=!0,(r||\"_l\")+\"((\"+o+\"),function(\"+i+s+a+\"){return \"+(n||us)(e,t)+\"})\"}(e,t);if(e.if&&!e.ifProcessed)return ps(e,t);if(\"template\"!==e.tag||e.slotTarget){if(\"slot\"===e.tag)return function(e,t){var n=e.slotName||'\"default\"',r=gs(e,t),o=\"_t(\"+n+(r?\",\"+r:\"\"),i=e.attrs&&\"{\"+e.attrs.map(function(e){return k(e.name)+\":\"+e.value}).join(\",\")+\"}\",s=e.attrsMap[\"v-bind\"];!i&&!s||r||(o+=\",null\");i&&(o+=\",\"+i);s&&(o+=(i?\"\":\",null\")+\",\"+s);return o+\")\"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:gs(t,n,!0);return\"_c(\"+e+\",\"+ms(t,n)+(r?\",\"+r:\"\")+\")\"}(e.component,e,t);else{var r=e.plain?void 0:ms(e,t),o=e.inlineTemplate?null:gs(e,t,!0);n=\"_c('\"+e.tag+\"'\"+(r?\",\"+r:\"\")+(o?\",\"+o:\"\")+\")\"}for(var i=0;i<t.transforms.length;i++)n=t.transforms[i](e,n);return n}return gs(e,t)||\"void 0\"}function fs(e,t){return e.staticProcessed=!0,t.staticRenderFns.push(\"with(this){return \"+us(e,t)+\"}\"),\"_m(\"+(t.staticRenderFns.length-1)+(e.staticInFor?\",true\":\"\")+\")\"}function ds(e,t){if(e.onceProcessed=!0,e.if&&!e.ifProcessed)return ps(e,t);if(e.staticInFor){for(var n=\"\",r=e.parent;r;){if(r.for){n=r.key;break}r=r.parent}return n?\"_o(\"+us(e,t)+\",\"+t.onceId+++\",\"+n+\")\":us(e,t)}return fs(e,t)}function ps(e,t,n,r){return e.ifProcessed=!0,hs(e.ifConditions.slice(),t,n,r)}function hs(e,t,n,r){if(!e.length)return r||\"_e()\";var o=e.shift();return o.exp?\"(\"+o.exp+\")?\"+i(o.block)+\":\"+hs(e,t,n,r):\"\"+i(o.block);function i(e){return n?n(e,t):e.once?ds(e,t):us(e,t)}}function ms(e,t){var n=\"{\",r=function(e,t){var n=e.directives;if(!n)return;var r,o,i,s,a=\"directives:[\",l=!1;for(r=0,o=n.length;r<o;r++){i=n[r],s=!0;var c=t.directives[i.name];c&&(s=!!c(e,i,t.warn)),s&&(l=!0,a+='{name:\"'+i.name+'\",rawName:\"'+i.rawName+'\"'+(i.value?\",value:(\"+i.value+\"),expression:\"+JSON.stringify(i.value):\"\")+(i.arg?',arg:\"'+i.arg+'\"':\"\")+(i.modifiers?\",modifiers:\"+JSON.stringify(i.modifiers):\"\")+\"},\")}if(l)return a.slice(0,-1)+\"]\"}(e,t);r&&(n+=r+\",\"),e.key&&(n+=\"key:\"+e.key+\",\"),e.ref&&(n+=\"ref:\"+e.ref+\",\"),e.refInFor&&(n+=\"refInFor:true,\"),e.pre&&(n+=\"pre:true,\"),e.component&&(n+='tag:\"'+e.tag+'\",');for(var o=0;o<t.dataGenFns.length;o++)n+=t.dataGenFns[o](e);e.attrs&&(n+=\"attrs:{\"+ys(e.attrs)+\"},\"),e.props&&(n+=\"domProps:{\"+ys(e.props)+\"},\"),e.events&&(n+=os(e.events,!1,t.warn)+\",\"),e.nativeEvents&&(n+=os(e.nativeEvents,!0,t.warn)+\",\"),e.slotTarget&&!e.slotScope&&(n+=\"slot:\"+e.slotTarget+\",\"),e.scopedSlots&&(n+=(i=e.scopedSlots,s=t,\"scopedSlots:_u([\"+Object.keys(i).map(function(e){return vs(e,i[e],s)}).join(\",\")+\"]),\"));var i,s;if(e.model&&(n+=\"model:{value:\"+e.model.value+\",callback:\"+e.model.callback+\",expression:\"+e.model.expression+\"},\"),e.inlineTemplate){var a=function(e,t){var n=e.children[0];0;if(1===n.type){var r=cs(n,t.options);return\"inlineTemplate:{render:function(){\"+r.render+\"},staticRenderFns:[\"+r.staticRenderFns.map(function(e){return\"function(){\"+e+\"}\"}).join(\",\")+\"]}\"}}(e,t);a&&(n+=a+\",\")}return n=n.replace(/,$/,\"\")+\"}\",e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function vs(e,t,n){if(t.for&&!t.forProcessed)return function(e,t,n){var r=t.for,o=t.alias,i=t.iterator1?\",\"+t.iterator1:\"\",s=t.iterator2?\",\"+t.iterator2:\"\";return t.forProcessed=!0,\"_l((\"+r+\"),function(\"+o+i+s+\"){return \"+vs(e,t,n)+\"})\"}(e,t,n);return\"{key:\"+e+\",fn:\"+(\"function(\"+String(t.slotScope)+\"){return \"+(\"template\"===t.tag?t.if?t.if+\"?\"+(gs(t,n)||\"undefined\")+\":undefined\":gs(t,n)||\"undefined\":us(t,n))+\"}\")+\"}\"}function gs(e,t,n,r,o){var i=e.children;if(i.length){var s=i[0];if(1===i.length&&s.for&&\"template\"!==s.tag&&\"slot\"!==s.tag)return(r||us)(s,t);var a=n?function(e,t){for(var n=0,r=0;r<e.length;r++){var o=e[r];if(1===o.type){if(bs(o)||o.ifConditions&&o.ifConditions.some(function(e){return bs(e.block)})){n=2;break}(t(o)||o.ifConditions&&o.ifConditions.some(function(e){return t(e.block)}))&&(n=1)}}return n}(i,t.maybeComponent):0,l=o||_s;return\"[\"+i.map(function(e){return l(e,t)}).join(\",\")+\"]\"+(a?\",\"+a:\"\")}}function bs(e){return void 0!==e.for||\"template\"===e.tag||\"slot\"===e.tag}function _s(e,t){return 1===e.type?us(e,t):3===e.type&&e.isComment?(r=e,\"_e(\"+JSON.stringify(r.text)+\")\"):\"_v(\"+(2===(n=e).type?n.expression:xs(JSON.stringify(n.text)))+\")\";var n,r}function ys(e){for(var t=\"\",n=0;n<e.length;n++){var r=e[n];t+='\"'+r.name+'\":'+xs(r.value)+\",\"}return t.slice(0,-1)}function xs(e){return e.replace(/\\u2028/g,\"\\\\u2028\").replace(/\\u2029/g,\"\\\\u2029\")}new RegExp(\"\\\\b\"+\"do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,super,throw,while,yield,delete,export,import,return,switch,default,extends,finally,continue,debugger,function,arguments\".split(\",\").join(\"\\\\b|\\\\b\")+\"\\\\b\"),new RegExp(\"\\\\b\"+\"delete,typeof,void\".split(\",\").join(\"\\\\s*\\\\([^\\\\)]*\\\\)|\\\\b\")+\"\\\\s*\\\\([^\\\\)]*\\\\)\");function ws(e,t){try{return new Function(e)}catch(n){return t.push({err:n,code:e}),A}}var ks,Cs,Ss=(ks=function(e,t){var n=Ni(e.trim(),t);!1!==t.optimize&&(o=t,(r=n)&&(Xi=Yi(o.staticKeys||\"\"),Ji=o.isReservedTag||P,Gi(r),Zi(r,!1)));var r,o,i=cs(n,t);return{ast:n,render:i.render,staticRenderFns:i.staticRenderFns}},function(e){function t(t,n){var r=Object.create(e),o=[],i=[];if(r.warn=function(e,t){(t?i:o).push(e)},n){n.modules&&(r.modules=(e.modules||[]).concat(n.modules)),n.directives&&(r.directives=T(Object.create(e.directives||null),n.directives));for(var s in n)\"modules\"!==s&&\"directives\"!==s&&(r[s]=n[s])}var a=ks(t,r);return a.errors=o,a.tips=i,a}return{compile:t,compileToFunctions:function(e){var t=Object.create(null);return function(n,r,o){(r=T({},r)).warn,delete r.warn;var i=r.delimiters?String(r.delimiters)+n:n;if(t[i])return t[i];var s=e(n,r),a={},l=[];return a.render=ws(s.render,l),a.staticRenderFns=s.staticRenderFns.map(function(e){return ws(e,l)}),t[i]=a}}(t)}})(Ki).compileToFunctions;function $s(e){return(Cs=Cs||document.createElement(\"div\")).innerHTML=e?'<a href=\"\\n\"/>':'<div a=\"\\n\"/>',Cs.innerHTML.indexOf(\" \")>0}var Os=!!U&&$s(!1),Es=!!U&&$s(!0),Ts=x(function(e){var t=Hn(e);return t&&t.innerHTML}),Ms=pn.prototype.$mount;pn.prototype.$mount=function(e,t){if((e=e&&Hn(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if(\"string\"==typeof r)\"#\"===r.charAt(0)&&(r=Ts(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement(\"div\");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){0;var o=Ss(r,{shouldDecodeNewlines:Os,shouldDecodeNewlinesForHref:Es,delimiters:n.delimiters,comments:n.comments},this),i=o.render,s=o.staticRenderFns;n.render=i,n.staticRenderFns=s}}return Ms.call(this,e,t)};pn.compile=Ss,e.exports=pn}).call(t,n(12),n(59).setImmediate)},function(e,t,n){\"use strict\";t.__esModule=!0,t.noop=function(){},t.hasOwn=function(e,t){return r.call(e,t)},t.toObject=function(e){for(var t={},n=0;n<e.length;n++)e[n]&&o(t,e[n]);return t},t.getPropByPath=function(e,t,n){for(var r=e,o=(t=(t=t.replace(/\\[(\\w+)\\]/g,\".$1\")).replace(/^\\./,\"\")).split(\".\"),i=0,s=o.length;i<s-1&&(r||n);++i){var a=o[i];if(!(a in r)){if(n)throw new Error(\"please transfer a valid prop path to form item!\");break}r=r[a]}return{o:r,k:o[i],v:r?r[o[i]]:null}};var r=Object.prototype.hasOwnProperty;function o(e,t){for(var n in t)e[n]=t[n];return e}t.getValueByPath=function(e,t){for(var n=(t=t||\"\").split(\".\"),r=e,o=null,i=0,s=n.length;i<s;i++){var a=n[i];if(!r)break;if(i===s-1){o=r[a];break}r=r[a]}return o};t.generateId=function(){return Math.floor(1e4*Math.random())},t.valueEquals=function(e,t){if(e===t)return!0;if(!(e instanceof Array))return!1;if(!(t instanceof Array))return!1;if(e.length!==t.length)return!1;for(var n=0;n!==e.length;++n)if(e[n]!==t[n])return!1;return!0}},function(e,t,n){\"use strict\";t.__esModule=!0,t.getStyle=t.once=t.off=t.on=void 0;var r=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e};t.hasClass=h,t.addClass=function(e,t){if(!e)return;for(var n=e.className,r=(t||\"\").split(\" \"),o=0,i=r.length;o<i;o++){var s=r[o];s&&(e.classList?e.classList.add(s):h(e,s)||(n+=\" \"+s))}e.classList||(e.className=n)},t.removeClass=function(e,t){if(!e||!t)return;for(var n=t.split(\" \"),r=\" \"+e.className+\" \",o=0,i=n.length;o<i;o++){var s=n[o];s&&(e.classList?e.classList.remove(s):h(e,s)&&(r=r.replace(\" \"+s+\" \",\" \")))}e.classList||(e.className=u(r))},t.setStyle=m;var o,i=n(4);var s=(o=i,o&&o.__esModule?o:{default:o}).default.prototype.$isServer,a=/([\\:\\-\\_]+(.))/g,l=/^moz([A-Z])/,c=s?0:Number(document.documentMode),u=function(e){return(e||\"\").replace(/^[\\s\\uFEFF]+|[\\s\\uFEFF]+$/g,\"\")},f=function(e){return e.replace(a,function(e,t,n,r){return r?n.toUpperCase():n}).replace(l,\"Moz$1\")},d=t.on=!s&&document.addEventListener?function(e,t,n){e&&t&&n&&e.addEventListener(t,n,!1)}:function(e,t,n){e&&t&&n&&e.attachEvent(\"on\"+t,n)},p=t.off=!s&&document.removeEventListener?function(e,t,n){e&&t&&e.removeEventListener(t,n,!1)}:function(e,t,n){e&&t&&e.detachEvent(\"on\"+t,n)};t.once=function(e,t,n){d(e,t,function r(){n&&n.apply(this,arguments),p(e,t,r)})};function h(e,t){if(!e||!t)return!1;if(-1!==t.indexOf(\" \"))throw new Error(\"className should not contain space.\");return e.classList?e.classList.contains(t):(\" \"+e.className+\" \").indexOf(\" \"+t+\" \")>-1}t.getStyle=c<9?function(e,t){if(!s){if(!e||!t)return null;\"float\"===(t=f(t))&&(t=\"styleFloat\");try{switch(t){case\"opacity\":try{return e.filters.item(\"alpha\").opacity/100}catch(e){return 1}default:return e.style[t]||e.currentStyle?e.currentStyle[t]:null}}catch(n){return e.style[t]}}}:function(e,t){if(!s){if(!e||!t)return null;\"float\"===(t=f(t))&&(t=\"cssFloat\");try{var n=document.defaultView.getComputedStyle(e,\"\");return e.style[t]||n?n[t]:null}catch(n){return e.style[t]}}};function m(e,t,n){if(e&&t)if(\"object\"===(void 0===t?\"undefined\":r(t)))for(var o in t)t.hasOwnProperty(o)&&m(e,o,t[o]);else\"opacity\"===(t=f(t))&&c<9?e.style.filter=isNaN(n)?\"\":\"alpha(opacity=\"+100*n+\")\":e.style[t]=n}},function(e,t,n){\"use strict\";t.__esModule=!0;function r(e,t,n){this.$children.forEach(function(o){o.$options.componentName===e?o.$emit.apply(o,[t].concat(n)):r.apply(o,[e,t].concat([n]))})}t.default={methods:{dispatch:function(e,t,n){for(var r=this.$parent||this.$root,o=r.$options.componentName;r&&(!o||o!==e);)(r=r.$parent)&&(o=r.$options.componentName);r&&r.$emit.apply(r,[t].concat(n))},broadcast:function(e,t,n){r.call(this,e,t,n)}}}},function(e,t,n){var r=\"undefined\"!=typeof document;if(\"undefined\"!=typeof DEBUG&&DEBUG&&!r)throw new Error(\"vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.\");var o=n(63),i={},s=r&&(document.head||document.getElementsByTagName(\"head\")[0]),a=null,l=0,c=!1,u=function(){},f=\"undefined\"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());e.exports=function(e,t,n){c=n;var r=o(e,t);return d(r),function(t){for(var n=[],s=0;s<r.length;s++){var a=r[s];(l=i[a.id]).refs--,n.push(l)}t?d(r=o(e,t)):r=[];for(s=0;s<n.length;s++){var l;if(0===(l=n[s]).refs){for(var c=0;c<l.parts.length;c++)l.parts[c]();delete i[l.id]}}}};function d(e){for(var t=0;t<e.length;t++){var n=e[t],r=i[n.id];if(r){r.refs++;for(var o=0;o<r.parts.length;o++)r.parts[o](n.parts[o]);for(;o<n.parts.length;o++)r.parts.push(h(n.parts[o]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{var s=[];for(o=0;o<n.parts.length;o++)s.push(h(n.parts[o]));i[n.id]={id:n.id,refs:1,parts:s}}}}function p(){var e=document.createElement(\"style\");return e.type=\"text/css\",s.appendChild(e),e}function h(e){var t,n,r=document.querySelector('style[data-vue-ssr-id~=\"'+e.id+'\"]');if(r){if(c)return u;r.parentNode.removeChild(r)}if(f){var o=l++;r=a||(a=p()),t=v.bind(null,r,o,!1),n=v.bind(null,r,o,!0)}else r=p(),t=function(e,t){var n=t.css,r=t.media,o=t.sourceMap;r&&e.setAttribute(\"media\",r);o&&(n+=\"\\n/*# sourceURL=\"+o.sources[0]+\" */\",n+=\"\\n/*# sourceMappingURL=data:application/json;base64,\"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+\" */\");if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,r),n=function(){r.parentNode.removeChild(r)};return t(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap)return;t(e=r)}else n()}}var m=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join(\"\\n\")}}();function v(e,t,n,r){var o=n?\"\":r.css;if(e.styleSheet)e.styleSheet.cssText=m(t,o);else{var i=document.createTextNode(o),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(i,s[t]):e.appendChild(i)}}},function(e,t){var n=e.exports=\"undefined\"!=typeof window&&window.Math==Math?window:\"undefined\"!=typeof self&&self.Math==Math?self:Function(\"return this\")();\"number\"==typeof __g&&(__g=n)},function(e,t,n){\"use strict\";t.__esModule=!0,t.default=function(e){for(var t=1,n=arguments.length;t<n;t++){var r=arguments[t]||{};for(var o in r)if(r.hasOwnProperty(o)){var i=r[o];void 0!==i&&(e[o]=i)}}return e}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){var n;n=function(){return this}();try{n=n||Function(\"return this\")()||(0,eval)(\"this\")}catch(e){\"object\"==typeof window&&(n=window)}e.exports=n},function(e,t,n){\"use strict\";t.__esModule=!0;var r,o=n(4),i=(r=o,r&&r.__esModule?r:{default:r}),s=n(19);var a=i.default.prototype.$isServer?function(){}:n(91),l=function(e){return e.stopPropagation()};t.default={props:{placement:{type:String,default:\"bottom\"},boundariesPadding:{type:Number,default:5},reference:{},popper:{},offset:{default:0},value:Boolean,visibleArrow:Boolean,transition:String,appendToBody:{type:Boolean,default:!0},popperOptions:{type:Object,default:function(){return{gpuAcceleration:!1}}}},data:function(){return{showPopper:!1,currentPlacement:\"\"}},watch:{value:{immediate:!0,handler:function(e){this.showPopper=e,this.$emit(\"input\",e)}},showPopper:function(e){e?this.updatePopper():this.destroyPopper(),this.$emit(\"input\",e)}},methods:{createPopper:function(){var e=this;if(!this.$isServer&&(this.currentPlacement=this.currentPlacement||this.placement,/^(top|bottom|left|right)(-start|-end)?$/g.test(this.currentPlacement))){var t=this.popperOptions,n=this.popperElm=this.popperElm||this.popper||this.$refs.popper,r=this.referenceElm=this.referenceElm||this.reference||this.$refs.reference;!r&&this.$slots.reference&&this.$slots.reference[0]&&(r=this.referenceElm=this.$slots.reference[0].elm),n&&r&&(this.visibleArrow&&this.appendArrow(n),this.appendToBody&&document.body.appendChild(this.popperElm),this.popperJS&&this.popperJS.destroy&&this.popperJS.destroy(),t.placement=this.currentPlacement,t.offset=this.offset,this.popperJS=new a(r,n,t),this.popperJS.onCreate(function(t){e.$emit(\"created\",e),e.resetTransformOrigin(),e.$nextTick(e.updatePopper)}),\"function\"==typeof t.onUpdate&&this.popperJS.onUpdate(t.onUpdate),this.popperJS._popper.style.zIndex=s.PopupManager.nextZIndex(),this.popperElm.addEventListener(\"click\",l))}},updatePopper:function(){this.popperJS?this.popperJS.update():this.createPopper()},doDestroy:function(){!this.showPopper&&this.popperJS&&(this.popperJS.destroy(),this.popperJS=null)},destroyPopper:function(){this.popperJS&&this.resetTransformOrigin()},resetTransformOrigin:function(){var e=this.popperJS._popper.getAttribute(\"x-placement\").split(\"-\")[0],t={top:\"bottom\",bottom:\"top\",left:\"right\",right:\"left\"}[e];this.popperJS._popper.style.transformOrigin=[\"top\",\"bottom\"].indexOf(e)>-1?\"center \"+t:t+\" center\"},appendArrow:function(e){var t=void 0;if(!this.appended){this.appended=!0;for(var n in e.attributes)if(/^_v-/.test(e.attributes[n].name)){t=e.attributes[n].name;break}var r=document.createElement(\"div\");t&&r.setAttribute(t,\"\"),r.setAttribute(\"x-arrow\",\"\"),r.className=\"popper__arrow\",e.appendChild(r)}}},beforeDestroy:function(){this.doDestroy(),this.popperElm&&this.popperElm.parentNode===document.body&&(this.popperElm.removeEventListener(\"click\",l),document.body.removeChild(this.popperElm))},deactivated:function(){this.$options.beforeDestroy[0].call(this)}}},function(e,t,n){var r=n(15),o=n(29);e.exports=n(16)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(28),o=n(66),i=n(40),s=Object.defineProperty;t.f=n(16)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return s(e,t,n)}catch(e){}if(\"get\"in n||\"set\"in n)throw TypeError(\"Accessors not supported!\");return\"value\"in n&&(e[t]=n.value),e}},function(e,t,n){e.exports=!n(21)(function(){return 7!=Object.defineProperty({},\"a\",{get:function(){return 7}}).a})},function(e,t,n){var r=n(69),o=n(41);e.exports=function(e){return r(o(e))}},function(e,t,n){var r=n(44)(\"wks\"),o=n(31),i=n(9).Symbol,s=\"function\"==typeof i;(e.exports=function(e){return r[e]||(r[e]=s&&i[e]||(s?i:o)(\"Symbol.\"+e))}).store=r},function(e,t,n){\"use strict\";t.__esModule=!0,t.PopupManager=void 0;var r=l(n(4)),o=l(n(10)),i=l(n(84)),s=l(n(34)),a=n(6);function l(e){return e&&e.__esModule?e:{default:e}}var c=1,u=[],f=void 0;t.default={props:{visible:{type:Boolean,default:!1},transition:{type:String,default:\"\"},openDelay:{},closeDelay:{},zIndex:{},modal:{type:Boolean,default:!1},modalFade:{type:Boolean,default:!0},modalClass:{},modalAppendToBody:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!1},closeOnClickModal:{type:Boolean,default:!1}},created:function(){this.transition&&function(e){if(-1===u.indexOf(e)){var t=function(e){var t=e.__vue__;if(!t){var n=e.previousSibling;n.__vue__&&(t=n.__vue__)}return t};r.default.transition(e,{afterEnter:function(e){var n=t(e);n&&n.doAfterOpen&&n.doAfterOpen()},afterLeave:function(e){var n=t(e);n&&n.doAfterClose&&n.doAfterClose()}})}}(this.transition)},beforeMount:function(){this._popupId=\"popup-\"+c++,i.default.register(this._popupId,this)},beforeDestroy:function(){i.default.deregister(this._popupId),i.default.closeModal(this._popupId),this.modal&&null!==this.bodyOverflow&&\"hidden\"!==this.bodyOverflow&&(document.body.style.overflow=this.bodyOverflow,document.body.style.paddingRight=this.bodyPaddingRight),this.bodyOverflow=null,this.bodyPaddingRight=null},data:function(){return{opened:!1,bodyOverflow:null,bodyPaddingRight:null,rendered:!1}},watch:{visible:function(e){var t=this;if(e){if(this._opening)return;this.rendered?this.open():(this.rendered=!0,r.default.nextTick(function(){t.open()}))}else this.close()}},methods:{open:function(e){var t=this;this.rendered||(this.rendered=!0);var n=(0,o.default)({},this.$props||this,e);this._closeTimer&&(clearTimeout(this._closeTimer),this._closeTimer=null),clearTimeout(this._openTimer);var r=Number(n.openDelay);r>0?this._openTimer=setTimeout(function(){t._openTimer=null,t.doOpen(n)},r):this.doOpen(n)},doOpen:function(e){if(!this.$isServer&&(!this.willOpen||this.willOpen())&&!this.opened){this._opening=!0;var t=function e(t){return 3===t.nodeType&&e(t=t.nextElementSibling||t.nextSibling),t}(this.$el),n=e.modal,r=e.zIndex;if(r&&(i.default.zIndex=r),n&&(this._closing&&(i.default.closeModal(this._popupId),this._closing=!1),i.default.openModal(this._popupId,i.default.nextZIndex(),this.modalAppendToBody?void 0:t,e.modalClass,e.modalFade),e.lockScroll)){this.bodyOverflow||(this.bodyPaddingRight=document.body.style.paddingRight,this.bodyOverflow=document.body.style.overflow),f=(0,s.default)();var o=document.documentElement.clientHeight<document.body.scrollHeight,l=(0,a.getStyle)(document.body,\"overflowY\");f>0&&(o||\"scroll\"===l)&&(document.body.style.paddingRight=f+\"px\"),document.body.style.overflow=\"hidden\"}\"static\"===getComputedStyle(t).position&&(t.style.position=\"absolute\"),t.style.zIndex=i.default.nextZIndex(),this.opened=!0,this.onOpen&&this.onOpen(),this.transition||this.doAfterOpen()}},doAfterOpen:function(){this._opening=!1},close:function(){var e=this;if(!this.willClose||this.willClose()){null!==this._openTimer&&(clearTimeout(this._openTimer),this._openTimer=null),clearTimeout(this._closeTimer);var t=Number(this.closeDelay);t>0?this._closeTimer=setTimeout(function(){e._closeTimer=null,e.doClose()},t):this.doClose()}},doClose:function(){var e=this;this._closing=!0,this.onClose&&this.onClose(),this.lockScroll&&setTimeout(function(){e.modal&&\"hidden\"!==e.bodyOverflow&&(document.body.style.overflow=e.bodyOverflow,document.body.style.paddingRight=e.bodyPaddingRight),e.bodyOverflow=null,e.bodyPaddingRight=null},200),this.opened=!1,this.transition||this.doAfterClose()},doAfterClose:function(){i.default.closeModal(this._popupId),this._closing=!1}}},t.PopupManager=i.default},function(e,t){e.exports=function(e){return\"object\"==typeof e?null!==e:\"function\"==typeof e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){\"use strict\";t.__esModule=!0,t.i18n=t.use=t.t=void 0;var r=s(n(99)),o=s(n(4)),i=s(n(100));function s(e){return e&&e.__esModule?e:{default:e}}var a=(0,s(n(101)).default)(o.default),l=r.default,c=!1,u=function(){var e=Object.getPrototypeOf(this||o.default).$t;if(\"function\"==typeof e&&o.default.locale)return c||(c=!0,o.default.locale(o.default.config.lang,(0,i.default)(l,o.default.locale(o.default.config.lang)||{},{clone:!0}))),e.apply(this,arguments)},f=t.t=function(e,t){var n=u.apply(this,arguments);if(null!==n&&void 0!==n)return n;for(var r=e.split(\".\"),o=l,i=0,s=r.length;i<s;i++){if(n=o[r[i]],i===s-1)return a(n,t);if(!n)return\"\";o=n}return\"\"},d=t.use=function(e){l=e||l},p=t.i18n=function(e){u=e||u};t.default={use:d,t:f,i18n:p}},,function(e,t,n){\"use strict\";t.__esModule=!0,t.default={mounted:function(){return void 0},methods:{getMigratingConfig:function(){return{props:{},events:{}}}}}},function(e,t,n){\"use strict\";t.__esModule=!0;var r=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e};t.isVNode=function(e){return\"object\"===(void 0===e?\"undefined\":r(e))&&(0,o.hasOwn)(e,\"componentOptions\")},t.getFirstComponentChild=function(e){return e&&e.filter(function(e){return e&&e.tag})[0]};var o=n(5)},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"/dist/\",n(n.s=111)}({0:function(e,t){e.exports=function(e,t,n,r,o,i){var s,a=e=e||{},l=typeof e.default;\"object\"!==l&&\"function\"!==l||(s=e,a=e.default);var c=\"function\"==typeof a?a.options:a;t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),o&&(c._scopeId=o);var u;if(i?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||\"undefined\"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},c._ssrRegister=u):r&&(u=r),u){var f=c.functional,d=f?c.render:c.beforeCreate;f?(c._injectStyles=u,c.render=function(e,t){return u.call(t),d(e,t)}):c.beforeCreate=d?[].concat(d,u):[u]}return{esModule:s,exports:a,options:c}}},1:function(e,t){e.exports=n(7)},111:function(e,t,n){e.exports=n(112)},112:function(e,t,n){\"use strict\";t.__esModule=!0;var r,o=n(113),i=(r=o,r&&r.__esModule?r:{default:r});i.default.install=function(e){e.component(i.default.name,i.default)},t.default=i.default},113:function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var r=n(114),o=n.n(r),i=n(116),s=n(0)(o.a,i.a,!1,null,null,null);t.default=s.exports},114:function(e,t,n){\"use strict\";t.__esModule=!0;var r=a(n(1)),o=a(n(7)),i=a(n(115)),s=a(n(9));function a(e){return e&&e.__esModule?e:{default:e}}t.default={name:\"ElInput\",componentName:\"ElInput\",mixins:[r.default,o.default],inject:{elForm:{default:\"\"},elFormItem:{default:\"\"}},data:function(){return{currentValue:this.value,textareaCalcStyle:{},prefixOffset:null,suffixOffset:null,hovering:!1,focused:!1}},props:{value:[String,Number],placeholder:String,size:String,resize:String,name:String,form:String,id:String,maxlength:Number,minlength:Number,readonly:Boolean,autofocus:Boolean,disabled:Boolean,type:{type:String,default:\"text\"},autosize:{type:[Boolean,Object],default:!1},rows:{type:Number,default:2},autoComplete:{type:String,default:\"off\"},max:{},min:{},step:{},validateEvent:{type:Boolean,default:!0},suffixIcon:String,prefixIcon:String,label:String,clearable:{type:Boolean,default:!1}},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},validateState:function(){return this.elFormItem?this.elFormItem.validateState:\"\"},needStatusIcon:function(){return!!this.elForm&&this.elForm.statusIcon},validateIcon:function(){return{validating:\"el-icon-loading\",success:\"el-icon-circle-check\",error:\"el-icon-circle-close\"}[this.validateState]},textareaStyle:function(){return(0,s.default)({},this.textareaCalcStyle,{resize:this.resize})},inputSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},isGroup:function(){return this.$slots.prepend||this.$slots.append},showClear:function(){return this.clearable&&\"\"!==this.currentValue&&(this.focused||this.hovering)}},watch:{value:function(e,t){this.setCurrentValue(e)}},methods:{focus:function(){(this.$refs.input||this.$refs.textarea).focus()},getMigratingConfig:function(){return{props:{icon:\"icon is removed, use suffix-icon / prefix-icon instead.\",\"on-icon-click\":\"on-icon-click is removed.\"},events:{click:\"click is removed.\"}}},handleBlur:function(e){this.focused=!1,this.$emit(\"blur\",e),this.validateEvent&&this.dispatch(\"ElFormItem\",\"el.form.blur\",[this.currentValue])},inputSelect:function(){(this.$refs.input||this.$refs.textarea).select()},resizeTextarea:functi
|