Version Description
Download this release
Release Info
| Developer | creativethemeshq |
| Plugin | |
| Version | 1.7.32 |
| Comparing to | |
| See all releases | |
Code changes from version 1.0.3 to 1.7.32
- blocksy-companion.php +100 -48
- framework/autoload.php +57 -27
- framework/cache-reset-manager.php +167 -0
- framework/cli.php +82 -0
- framework/dashboard.php +105 -1
- framework/edd/theme-updater-admin.php +449 -0
- framework/edd/theme-updater-class.php +165 -0
- framework/extensions-manager-api.php +33 -6
- framework/extensions-manager.php +331 -208
- framework/extensions/cookies-consent/config.php +2 -1
- framework/extensions/cookies-consent/customizer.php +66 -19
- framework/extensions/cookies-consent/extension.php +65 -18
- framework/extensions/cookies-consent/global.php +53 -31
- framework/extensions/cookies-consent/helpers.php +18 -15
- framework/extensions/cookies-consent/readme.php +17 -5
- framework/extensions/cookies-consent/static/bundle/main.css +3 -3
- framework/extensions/cookies-consent/static/bundle/main.js +3 -3
- framework/extensions/cookies-consent/static/bundle/sync.js +1 -1
- framework/extensions/cookies-consent/static/images/type-1.svg +16 -23
- framework/extensions/cookies-consent/static/images/type-2.svg +17 -29
- framework/extensions/cookies-consent/static/js/ct-events.js +270 -0
- framework/extensions/cookies-consent/static/js/helpers.js +7 -0
- framework/extensions/cookies-consent/static/js/lazy-load-helpers.js +20 -0
- framework/extensions/cookies-consent/static/js/main.js +3 -2
- framework/extensions/cookies-consent/static/js/sync.js +16 -5
- framework/extensions/cookies-consent/static/js/sync/helpers.js +145 -0
- framework/extensions/cookies-consent/static/js/variables.js +17 -7
- framework/extensions/cookies-consent/static/sass/main.scss +28 -29
- framework/extensions/mailchimp/admin-static/bundle/1.2c9ebf0a36c6c732fee6.js +14 -0
- framework/extensions/mailchimp/admin-static/bundle/2.976c8f43abfe584b1a9d.js +1 -0
- framework/extensions/mailchimp/admin-static/bundle/main.js +1 -1
- framework/extensions/mailchimp/admin-static/bundle/sync.js +1 -1
- framework/extensions/mailchimp/admin-static/js/ListPicker.js +1 -1
- framework/extensions/mailchimp/admin-static/js/ListPicker/Implementation.js +4 -2
- framework/extensions/mailchimp/admin-static/js/main.js +1 -0
- framework/extensions/mailchimp/admin-static/js/sync.js +56 -29
- framework/extensions/mailchimp/admin-static/js/variables.js +23 -10
- framework/extensions/mailchimp/config.php +1 -0
- framework/extensions/mailchimp/ct-mailchimp/options.php +26 -2
- framework/extensions/mailchimp/ct-mailchimp/view.php +30 -18
- framework/extensions/mailchimp/customizer.php +81 -45
- framework/extensions/mailchimp/dashboard-static/bundle/main.js +4 -10
- framework/extensions/mailchimp/dashboard-static/js/EditCredentials.js +72 -92
- framework/extensions/mailchimp/dashboard-static/js/ListPicker.js +15 -16
- framework/extensions/mailchimp/dashboard-static/js/Mailchimp.js +36 -7
- framework/extensions/mailchimp/dashboard-static/js/hooks/useActivationWithRequirements.js +10 -11
- framework/extensions/mailchimp/dashboard-static/js/main.js +1 -0
- framework/extensions/mailchimp/extension.php +54 -20
- framework/extensions/mailchimp/global.php +80 -42
- framework/extensions/mailchimp/helpers.php +51 -17
- framework/extensions/mailchimp/mailchimp-manager.php +37 -10
- framework/extensions/mailchimp/pre-boot.php +0 -1
- framework/extensions/mailchimp/readme.php +5 -11
- framework/extensions/mailchimp/static/bundle/main.css +3 -3
- framework/extensions/mailchimp/static/bundle/main.js +1 -0
- framework/extensions/mailchimp/static/js/main.js +82 -0
- framework/extensions/mailchimp/static/sass/main.scss +28 -18
- framework/extensions/mailchimp/static/sass/single-block.scss +42 -26
- framework/extensions/mailchimp/static/sass/widget.scss +21 -19
- framework/extensions/trending/config.php +6 -0
- framework/extensions/trending/customizer.php +193 -0
- framework/extensions/trending/extension.php +83 -0
- framework/extensions/trending/global.php +53 -0
- framework/extensions/trending/helpers.php +195 -0
- framework/extensions/trending/static/bundle/main.css +7 -0
- framework/extensions/trending/static/bundle/main.js +1 -0
- framework/extensions/trending/static/bundle/sync.js +1 -0
- framework/extensions/trending/static/js/main.js +17 -0
- framework/extensions/trending/static/js/sync.js +42 -0
- framework/extensions/trending/static/js/trending-block.js +139 -0
- framework/extensions/trending/static/sass/main.scss +0 -0
- framework/extensions/widgets/static/bundle/main.css +3 -3
- framework/extensions/widgets/static/sass/about-me.scss +67 -0
- framework/extensions/widgets/static/sass/contact-info.scss +19 -26
- framework/extensions/widgets/static/sass/facebook.scss +37 -0
- framework/extensions/widgets/static/sass/main.scss +4 -0
- framework/extensions/widgets/static/sass/posts.scss +118 -35
- framework/extensions/widgets/static/sass/quote.scss +39 -0
- framework/extensions/widgets/static/sass/social-icons.scss +23 -0
- framework/extensions/widgets/widgets/ct-about-me/helpers.php +18 -0
- framework/extensions/widgets/widgets/ct-about-me/options.php +235 -0
- framework/extensions/widgets/widgets/ct-about-me/view.php +139 -0
- framework/extensions/widgets/widgets/ct-about-me/widget.php +22 -0
- framework/extensions/widgets/widgets/ct-advertisement/view.php +9 -3
- framework/extensions/widgets/widgets/ct-advertisement/widget.php +1 -0
- framework/extensions/widgets/widgets/ct-contact-info/options.php +51 -17
- framework/extensions/widgets/widgets/ct-contact-info/view.php +10 -88
- framework/extensions/widgets/widgets/ct-contact-info/widget.php +1 -0
- framework/extensions/widgets/widgets/ct-facebook/options.php +52 -0
- framework/extensions/widgets/widgets/ct-facebook/view.php +61 -0
- framework/extensions/widgets/widgets/ct-facebook/widget.php +22 -0
- framework/extensions/widgets/widgets/ct-posts/options.php +272 -61
- framework/extensions/widgets/widgets/ct-posts/view.php +168 -67
- framework/extensions/widgets/widgets/ct-posts/widget.php +1 -0
- framework/extensions/widgets/widgets/ct-quote/options.php +55 -0
- framework/extensions/widgets/widgets/ct-quote/view.php +57 -0
- framework/extensions/widgets/widgets/ct-quote/widget.php +22 -0
- framework/extensions/widgets/widgets/ct-socials/options.php +8 -58
- framework/extensions/widgets/widgets/ct-socials/view.php +7 -9
- framework/extensions/widgets/widgets/ct-socials/widget.php +1 -0
- framework/extensions/woocommerce-extra/config.php +7 -0
- framework/extensions/woocommerce-extra/customizer.php +45 -0
- framework/extensions/woocommerce-extra/extension.php +100 -0
- framework/extensions/woocommerce-extra/floating-cart.php +92 -0
- framework/extensions/woocommerce-extra/global.php +70 -0
- framework/extensions/woocommerce-extra/helpers.php +281 -0
- framework/extensions/woocommerce-extra/readme.php +37 -0
- framework/extensions/woocommerce-extra/static/bundle/main.css +8 -0
- framework/extensions/woocommerce-extra/static/bundle/main.js +1 -0
- framework/extensions/woocommerce-extra/static/bundle/sync.js +1 -0
- framework/extensions/woocommerce-extra/static/js/floating-cart.js +94 -0
- framework/extensions/woocommerce-extra/static/js/helpers.js +15 -0
- framework/extensions/woocommerce-extra/static/js/main.js +217 -0
- framework/extensions/woocommerce-extra/static/js/sync.js +19 -0
- framework/extensions/woocommerce-extra/static/js/variables.js +28 -0
- framework/extensions/woocommerce-extra/static/sass/floating-bar/main.scss +156 -0
- framework/extensions/woocommerce-extra/static/sass/main.scss +3 -0
- framework/extensions/woocommerce-extra/static/sass/quick-view/main.scss +8 -0
- framework/extensions/woocommerce-extra/static/sass/quick-view/quick-view-button.scss +44 -0
- framework/extensions/woocommerce-extra/static/sass/quick-view/quick-view-card.scss +39 -0
- framework/extensions/woocommerce-extra/static/sass/quick-view/quick-view-gallery.scss +32 -0
- framework/extensions/woocommerce-extra/static/sass/quick-view/quick-view-loader.scss +10 -0
- framework/extensions/woocommerce-extra/static/sass/quick-view/quick-view-modal.scss +23 -0
- framework/extensions/woocommerce-extra/static/sass/quick-view/quick-view-summary.scss +63 -0
- framework/features/conditions-manager.php +455 -0
- framework/features/demo-install.php +340 -0
- framework/features/demo-install/child-theme.php +121 -0
- framework/features/demo-install/content-eraser.php +175 -0
- framework/features/demo-install/content-export.php +663 -0
- framework/features/demo-install/content-installer.php +416 -0
- framework/features/demo-install/fake-content-eraser.php +273 -0
- framework/features/demo-install/install-finish.php +189 -0
- framework/features/demo-install/options-export.php +106 -0
- framework/features/demo-install/options-import.php +319 -0
- framework/features/demo-install/parsers.php +701 -0
- framework/features/demo-install/plugins-uninstaller.php +44 -0
- framework/features/demo-install/required-plugins.php +85 -0
- framework/features/demo-install/widgets-export.php +67 -0
- framework/features/demo-install/widgets-import.php +277 -0
- framework/features/demo-install/wp-importer.php +1345 -0
- framework/features/dynamic-css.php +270 -0
- framework/features/google-analytics.php +63 -37
- framework/features/header.php +520 -0
- framework/features/header/account-modal.php +125 -0
- framework/features/header/header-options.php +177 -0
- framework/features/header/items/account/config.php +24 -0
- framework/features/header/items/account/dynamic-styles.php +277 -0
- framework/features/header/items/account/options.php +388 -0
- framework/features/header/items/account/sync.js +169 -0
- framework/features/header/items/account/view.php +101 -0
- framework/features/opengraph-meta-data.php +224 -0
- framework/helpers/blocksy-integration.php +177 -0
- framework/helpers/helpers.php +102 -0
- framework/theme-integration.php +228 -14
- framework/views/optin.php +6 -0
- framework/widgets-manager.php +40 -31
- freemius-pricing/178afa6030e76635dbe835e111d2c507.png +0 -0
- freemius-pricing/27b5a722a5553d9de0170325267fccec.png +0 -0
- freemius-pricing/4375c4a3ddc6f637c2ab9a2d7220f91e.png +0 -0
- freemius-pricing/5480ed23b199531a8cbc05924f26952b.png +0 -0
- freemius-pricing/b4f3b958f4a019862d81b15f3f8eee3a.svg +402 -0
- freemius-pricing/c03f665db27af43971565560adfba594.png +0 -0
- freemius-pricing/cb5fc4f6ec7ada72e986f6e7dde365bf.png +0 -0
- freemius-pricing/dd89563360f0272635c8f0ab7d7f1402.png +0 -0
- freemius-pricing/e366d70661d8ad2493bd6afbd779f125.png +0 -0
- freemius-pricing/f3aac72a8e63997d6bb888f816457e9b.png +0 -0
- freemius-pricing/f928f1be99776af83e8e6be4baf8ffe7.svg +227 -0
- freemius-pricing/fde48e4609a6ddc11d639fc2421f2afd.png +0 -0
- freemius-pricing/freemius-pricing.js +27 -0
blocksy-companion.php
CHANGED
|
@@ -3,65 +3,117 @@
|
|
| 3 |
/*
|
| 4 |
Plugin Name: Blocksy Companion
|
| 5 |
Description: This plugin is the companion for the Blocksy theme, it runs and adds its enhacements only if the Blocksy theme is installed and active.
|
| 6 |
-
Version: 1.
|
| 7 |
Author: CreativeThemes
|
| 8 |
Author URI: https://creativethemes.com
|
| 9 |
Text Domain: blc
|
| 10 |
Domain Path: /languages/
|
| 11 |
-
Network: true
|
| 12 |
License: GPLv2 or later
|
| 13 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 14 |
*/
|
| 15 |
|
| 16 |
-
if ( !
|
| 17 |
-
|
|
|
|
| 18 |
}
|
| 19 |
-
define( 'BLOCKSY__FILE__', __FILE__ );
|
| 20 |
-
define( 'BLOCKSY_PLUGIN_BASE', plugin_basename( BLOCKSY__FILE__ ) );
|
| 21 |
-
define( 'BLOCKSY_PATH', plugin_dir_path( BLOCKSY__FILE__ ) );
|
| 22 |
-
define( 'BLOCKSY_URL', plugin_dir_url( BLOCKSY__FILE__ ) );
|
| 23 |
|
| 24 |
-
add_action( 'plugins_loaded', 'blc_load_plugin_textdomain' );
|
| 25 |
|
| 26 |
-
if (
|
| 27 |
-
|
| 28 |
-
} elseif ( ! version_compare( get_bloginfo( 'version' ), '5.0', '>=' ) ) {
|
| 29 |
-
add_action( 'admin_notices', 'blc_fail_wp_version' );
|
| 30 |
} else {
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
-
/**
|
| 45 |
-
* Blocksy admin notice for minimum PHP version.
|
| 46 |
-
*
|
| 47 |
-
* Warning when the site doesn't have the minimum required PHP version.
|
| 48 |
-
*/
|
| 49 |
-
function blc_fail_php_version() {
|
| 50 |
-
/* translators: %s: PHP version */
|
| 51 |
-
$message = sprintf( esc_html__( 'Blocksy requires PHP version %s+, plugin is currently NOT RUNNING.', 'blc' ), '7.0' );
|
| 52 |
-
$html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) );
|
| 53 |
-
echo wp_kses_post( $html_message );
|
| 54 |
}
|
| 55 |
-
|
| 56 |
-
/**
|
| 57 |
-
* Blocksy admin notice for minimum WordPress version.
|
| 58 |
-
*
|
| 59 |
-
* Warning when the site doesn't have the minimum required WordPress version.
|
| 60 |
-
*/
|
| 61 |
-
function blc_fail_wp_version() {
|
| 62 |
-
/* translators: %s: WordPress version */
|
| 63 |
-
$message = sprintf( esc_html__( 'Blocksy requires WordPress version %s+. Because you are using an earlier version, the plugin is currently NOT RUNNING.', 'blc' ), '5.0' );
|
| 64 |
-
$html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) );
|
| 65 |
-
echo wp_kses_post( $html_message );
|
| 66 |
-
}
|
| 67 |
-
|
| 3 |
/*
|
| 4 |
Plugin Name: Blocksy Companion
|
| 5 |
Description: This plugin is the companion for the Blocksy theme, it runs and adds its enhacements only if the Blocksy theme is installed and active.
|
| 6 |
+
Version: 1.7.32
|
| 7 |
Author: CreativeThemes
|
| 8 |
Author URI: https://creativethemes.com
|
| 9 |
Text Domain: blc
|
| 10 |
Domain Path: /languages/
|
|
|
|
| 11 |
License: GPLv2 or later
|
| 12 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 13 |
*/
|
| 14 |
|
| 15 |
+
if ( !defined( 'ABSPATH' ) ) {
|
| 16 |
+
exit;
|
| 17 |
+
// Exit if accessed directly.
|
| 18 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
|
|
|
| 20 |
|
| 21 |
+
if ( function_exists( 'blc_fs' ) ) {
|
| 22 |
+
blc_fs()->set_basename( false, __FILE__ );
|
|
|
|
|
|
|
| 23 |
} else {
|
| 24 |
+
|
| 25 |
+
if ( !function_exists( 'blc_fs' ) ) {
|
| 26 |
+
global $blc_fs ;
|
| 27 |
+
|
| 28 |
+
if ( !isset( $blc_fs ) ) {
|
| 29 |
+
// Include Freemius SDK.
|
| 30 |
+
require_once dirname( __FILE__ ) . '/freemius/start.php';
|
| 31 |
+
$blc_fs = fs_dynamic_init( array(
|
| 32 |
+
'id' => '5115',
|
| 33 |
+
'slug' => 'blocksy-companion',
|
| 34 |
+
'premium_slug' => 'blocksy-companion-pro',
|
| 35 |
+
'type' => 'plugin',
|
| 36 |
+
'public_key' => 'pk_b00a5cbae90b2e948015a7d0710f5',
|
| 37 |
+
'premium_suffix' => 'PRO',
|
| 38 |
+
'is_premium' => false,
|
| 39 |
+
'has_addons' => false,
|
| 40 |
+
'has_paid_plans' => true,
|
| 41 |
+
'menu' => ( true ? [
|
| 42 |
+
'slug' => 'ct-dashboard',
|
| 43 |
+
'support' => false,
|
| 44 |
+
'contact' => false,
|
| 45 |
+
'pricing' => true,
|
| 46 |
+
'account' => true,
|
| 47 |
+
] : [
|
| 48 |
+
'support' => false,
|
| 49 |
+
'contact' => false,
|
| 50 |
+
'pricing' => false,
|
| 51 |
+
'account' => false,
|
| 52 |
+
] ),
|
| 53 |
+
'is_live' => true,
|
| 54 |
+
) );
|
| 55 |
+
function blc_fs()
|
| 56 |
+
{
|
| 57 |
+
global $blc_fs ;
|
| 58 |
+
return $blc_fs;
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
blc_fs();
|
| 62 |
+
do_action( 'blc_fs_loaded' );
|
| 63 |
+
blc_fs()->add_filter( 'freemius_pricing_js_path', function ( $d ) {
|
| 64 |
+
// return BLOCKSY_PATH . 'freemius-pricing/freemius-pricing.js';
|
| 65 |
+
// Only in DEV!!
|
| 66 |
+
return WP_CONTENT_DIR . '/plugins/blocksy-companion/freemius-pricing/freemius-pricing.js';
|
| 67 |
+
} );
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
define( 'BLOCKSY__FILE__', __FILE__ );
|
| 73 |
+
define( 'BLOCKSY_PLUGIN_BASE', plugin_basename( BLOCKSY__FILE__ ) );
|
| 74 |
+
define( 'BLOCKSY_PATH', plugin_dir_path( BLOCKSY__FILE__ ) );
|
| 75 |
+
define( 'BLOCKSY_URL', plugin_dir_url( BLOCKSY__FILE__ ) );
|
| 76 |
+
add_action( 'init', function () {
|
| 77 |
+
/**
|
| 78 |
+
* Load Blocksy textdomain.
|
| 79 |
+
*
|
| 80 |
+
* Load gettext translate for Blocksy text domain.
|
| 81 |
+
*/
|
| 82 |
+
load_plugin_textdomain( 'blc', false, dirname( BLOCKSY_PLUGIN_BASE ) . '/languages' );
|
| 83 |
+
} );
|
| 84 |
+
|
| 85 |
+
if ( !version_compare( PHP_VERSION, '7.0', '>=' ) ) {
|
| 86 |
+
add_action( 'admin_notices', 'blc_fail_php_version' );
|
| 87 |
+
} elseif ( !version_compare( get_bloginfo( 'version' ), '5.0', '>=' ) ) {
|
| 88 |
+
add_action( 'admin_notices', 'blc_fail_wp_version' );
|
| 89 |
+
} else {
|
| 90 |
+
require BLOCKSY_PATH . 'plugin.php';
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
/**
|
| 94 |
+
* Blocksy admin notice for minimum PHP version.
|
| 95 |
+
*
|
| 96 |
+
* Warning when the site doesn't have the minimum required PHP version.
|
| 97 |
+
*/
|
| 98 |
+
function blc_fail_php_version()
|
| 99 |
+
{
|
| 100 |
+
/* translators: %s: PHP version */
|
| 101 |
+
$message = sprintf( esc_html__( 'Blocksy requires PHP version %s+, plugin is currently NOT RUNNING.', 'blc' ), '7.0' );
|
| 102 |
+
$html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) );
|
| 103 |
+
echo wp_kses_post( $html_message ) ;
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
/**
|
| 107 |
+
* Blocksy admin notice for minimum WordPress version.
|
| 108 |
+
*
|
| 109 |
+
* Warning when the site doesn't have the minimum required WordPress version.
|
| 110 |
+
*/
|
| 111 |
+
function blc_fail_wp_version()
|
| 112 |
+
{
|
| 113 |
+
/* translators: %s: WordPress version */
|
| 114 |
+
$message = sprintf( esc_html__( 'Blocksy requires WordPress version %s+. Because you are using an earlier version, the plugin is currently NOT RUNNING.', 'blc' ), '5.0' );
|
| 115 |
+
$html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) );
|
| 116 |
+
echo wp_kses_post( $html_message ) ;
|
| 117 |
+
}
|
| 118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
framework/autoload.php
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
|
| 3 |
namespace Blocksy;
|
| 4 |
|
| 5 |
-
if (
|
| 6 |
exit; // Exit if accessed directly.
|
| 7 |
}
|
| 8 |
|
|
@@ -14,25 +14,55 @@ class Autoloader {
|
|
| 14 |
/**
|
| 15 |
* Classes map.
|
| 16 |
*
|
| 17 |
-
* Maps
|
| 18 |
*
|
| 19 |
* @static
|
| 20 |
*
|
| 21 |
* @var array Classes used by blocksy.
|
| 22 |
*/
|
| 23 |
-
private static
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
| 28 |
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
/**
|
| 38 |
* Run autoloader.
|
|
@@ -42,7 +72,7 @@ class Autoloader {
|
|
| 42 |
* @static
|
| 43 |
*/
|
| 44 |
public static function run() {
|
| 45 |
-
spl_autoload_register(
|
| 46 |
}
|
| 47 |
|
| 48 |
/**
|
|
@@ -54,14 +84,14 @@ class Autoloader {
|
|
| 54 |
*
|
| 55 |
* @param string $relative_class_name Class name.
|
| 56 |
*/
|
| 57 |
-
private static function load_class(
|
| 58 |
-
if (
|
| 59 |
-
$filename = BLOCKSY_PATH . '/' . self
|
| 60 |
} else {
|
| 61 |
$filename = strtolower(
|
| 62 |
preg_replace(
|
| 63 |
-
[
|
| 64 |
-
[
|
| 65 |
$relative_class_name
|
| 66 |
)
|
| 67 |
);
|
|
@@ -69,7 +99,7 @@ class Autoloader {
|
|
| 69 |
$filename = BLOCKSY_PATH . $filename . '.php';
|
| 70 |
}
|
| 71 |
|
| 72 |
-
if (
|
| 73 |
require $filename;
|
| 74 |
}
|
| 75 |
}
|
|
@@ -83,26 +113,26 @@ class Autoloader {
|
|
| 83 |
*
|
| 84 |
* @param string $class Class name.
|
| 85 |
*/
|
| 86 |
-
private static function autoload(
|
| 87 |
if (
|
| 88 |
-
0 !== strpos(
|
| 89 |
&&
|
| 90 |
-
! isset(
|
| 91 |
) {
|
| 92 |
return;
|
| 93 |
}
|
| 94 |
|
| 95 |
-
$relative_class_name = preg_replace(
|
| 96 |
|
| 97 |
$final_class_name = __NAMESPACE__ . '\\' . $relative_class_name;
|
| 98 |
|
| 99 |
-
if (
|
| 100 |
$final_class_name = $relative_class_name;
|
| 101 |
$relative_class_name = '_' . $relative_class_name;
|
| 102 |
}
|
| 103 |
|
| 104 |
-
if (
|
| 105 |
-
self::load_class(
|
| 106 |
}
|
| 107 |
}
|
| 108 |
}
|
| 2 |
|
| 3 |
namespace Blocksy;
|
| 4 |
|
| 5 |
+
if (! defined('ABSPATH')) {
|
| 6 |
exit; // Exit if accessed directly.
|
| 7 |
}
|
| 8 |
|
| 14 |
/**
|
| 15 |
* Classes map.
|
| 16 |
*
|
| 17 |
+
* Maps Blocksy classes to file names.
|
| 18 |
*
|
| 19 |
* @static
|
| 20 |
*
|
| 21 |
* @var array Classes used by blocksy.
|
| 22 |
*/
|
| 23 |
+
private static function get_classes_map() {
|
| 24 |
+
return apply_filters('blocksy_autoloader_classes_map', [
|
| 25 |
+
'ExtensionsManager' => 'framework/extensions-manager.php',
|
| 26 |
+
'ExtensionsManagerApi' => 'framework/extensions-manager-api.php',
|
| 27 |
+
'Dashboard' => 'framework/dashboard.php',
|
| 28 |
+
'ThemeIntegration' => 'framework/theme-integration.php',
|
| 29 |
+
'CacheResetManager' => 'framework/cache-reset-manager.php',
|
| 30 |
|
| 31 |
+
'GoogleAnalytics' => 'framework/features/google-analytics.php',
|
| 32 |
+
'OpenGraphMetaData' => 'framework/features/opengraph-meta-data.php',
|
| 33 |
+
'HeaderAdditions' => 'framework/features/header.php',
|
| 34 |
+
'ConditionsManager' => 'framework/features/conditions-manager.php',
|
| 35 |
|
| 36 |
+
'Cli' => 'framework/cli.php',
|
| 37 |
+
|
| 38 |
+
'DynamicCss' => 'framework/features/dynamic-css.php',
|
| 39 |
+
'DemoInstall' => 'framework/features/demo-install.php',
|
| 40 |
+
'DemoInstallContentExport' => 'framework/features/demo-install/content-export.php',
|
| 41 |
+
'DemoInstallWidgetsExport' => 'framework/features/demo-install/widgets-export.php',
|
| 42 |
+
'DemoInstallOptionsExport' => 'framework/features/demo-install/options-export.php',
|
| 43 |
+
|
| 44 |
+
'DemoInstallChildThemeInstaller' => 'framework/features/demo-install/child-theme.php',
|
| 45 |
+
'DemoInstallPluginsInstaller' => 'framework/features/demo-install/required-plugins.php',
|
| 46 |
+
'DemoInstallPluginsUninstaller' => 'framework/features/demo-install/plugins-uninstaller.php',
|
| 47 |
+
'DemoInstallContentInstaller' => 'framework/features/demo-install/content-installer.php',
|
| 48 |
+
'DemoInstallOptionsInstaller' => 'framework/features/demo-install/options-import.php',
|
| 49 |
+
'DemoInstallWidgetsInstaller' => 'framework/features/demo-install/widgets-import.php',
|
| 50 |
+
'DemoInstallContentEraser' => 'framework/features/demo-install/content-eraser.php',
|
| 51 |
+
'DemoInstallFakeContentEraser' => 'framework/features/demo-install/fake-content-eraser.php',
|
| 52 |
+
'DemoInstallFinalActions' => 'framework/features/demo-install/install-finish.php',
|
| 53 |
+
'Premium' => 'framework/premium/pro.php',
|
| 54 |
+
|
| 55 |
+
/**
|
| 56 |
+
* No namespace
|
| 57 |
+
*/
|
| 58 |
+
'_BlocksyWidgetFactory' => 'framework/widgets-manager.php',
|
| 59 |
+
'_Blocksy_WP_Import' => 'framework/features/demo-install/wp-importer.php',
|
| 60 |
+
|
| 61 |
+
// TODO: remove when getting rid of EDD
|
| 62 |
+
'_EDD_SL_Plugin_Updater' => 'framework/edd/EDD_SL_Plugin_Updater.php',
|
| 63 |
+
'_EDD_Theme_Updater_Admin' => 'framework/edd/theme-updater-admin.php'
|
| 64 |
+
]);
|
| 65 |
+
}
|
| 66 |
|
| 67 |
/**
|
| 68 |
* Run autoloader.
|
| 72 |
* @static
|
| 73 |
*/
|
| 74 |
public static function run() {
|
| 75 |
+
spl_autoload_register([__CLASS__, 'autoload']);
|
| 76 |
}
|
| 77 |
|
| 78 |
/**
|
| 84 |
*
|
| 85 |
* @param string $relative_class_name Class name.
|
| 86 |
*/
|
| 87 |
+
private static function load_class($relative_class_name) {
|
| 88 |
+
if (isset( self::get_classes_map()[$relative_class_name])) {
|
| 89 |
+
$filename = BLOCKSY_PATH . '/' . self::get_classes_map()[$relative_class_name];
|
| 90 |
} else {
|
| 91 |
$filename = strtolower(
|
| 92 |
preg_replace(
|
| 93 |
+
['/([a-z])([A-Z])/', '/_/', '/\\\/'],
|
| 94 |
+
['$1-$2', '-', DIRECTORY_SEPARATOR],
|
| 95 |
$relative_class_name
|
| 96 |
)
|
| 97 |
);
|
| 99 |
$filename = BLOCKSY_PATH . $filename . '.php';
|
| 100 |
}
|
| 101 |
|
| 102 |
+
if (is_readable($filename)) {
|
| 103 |
require $filename;
|
| 104 |
}
|
| 105 |
}
|
| 113 |
*
|
| 114 |
* @param string $class Class name.
|
| 115 |
*/
|
| 116 |
+
private static function autoload($class) {
|
| 117 |
if (
|
| 118 |
+
0 !== strpos($class, __NAMESPACE__ . '\\')
|
| 119 |
&&
|
| 120 |
+
! isset(self::get_classes_map()['_' . $class])
|
| 121 |
) {
|
| 122 |
return;
|
| 123 |
}
|
| 124 |
|
| 125 |
+
$relative_class_name = preg_replace('/^' . __NAMESPACE__ . '\\\/', '', $class);
|
| 126 |
|
| 127 |
$final_class_name = __NAMESPACE__ . '\\' . $relative_class_name;
|
| 128 |
|
| 129 |
+
if (isset(self::get_classes_map()['_' . $relative_class_name])) {
|
| 130 |
$final_class_name = $relative_class_name;
|
| 131 |
$relative_class_name = '_' . $relative_class_name;
|
| 132 |
}
|
| 133 |
|
| 134 |
+
if (! class_exists($final_class_name)) {
|
| 135 |
+
self::load_class($relative_class_name);
|
| 136 |
}
|
| 137 |
}
|
| 138 |
}
|
framework/cache-reset-manager.php
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
namespace Blocksy;
|
| 4 |
+
|
| 5 |
+
class CacheResetManager {
|
| 6 |
+
public function __construct() {
|
| 7 |
+
add_action(
|
| 8 |
+
'upgrader_process_complete',
|
| 9 |
+
[$this, 'handle_update'],
|
| 10 |
+
10, 2
|
| 11 |
+
);
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
public function handle_update($upgrader, $options) {
|
| 15 |
+
if ($options['action'] !== 'update') {
|
| 16 |
+
return;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
if ($options['type'] === 'theme') {
|
| 20 |
+
if (in_array('blocksy', $options['themes'])) {
|
| 21 |
+
$this->run_cache_purge();
|
| 22 |
+
do_action('blocksy:dynamic-css:regenere_css_files');
|
| 23 |
+
}
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
if ($options['type'] === 'plugin') {
|
| 27 |
+
$plugins = [];
|
| 28 |
+
|
| 29 |
+
if (isset($options['plugins']) && is_array($options['plugins'])) {
|
| 30 |
+
$plugins = $options['plugins'];
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
if (in_array(BLOCKSY_PLUGIN_BASE, $plugins)) {
|
| 34 |
+
$this->run_cache_purge();
|
| 35 |
+
do_action('blocksy:dynamic-css:regenere_css_files');
|
| 36 |
+
}
|
| 37 |
+
}
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
public function run_cache_purge() {
|
| 41 |
+
# Purge all W3 Total Cache
|
| 42 |
+
if (function_exists('w3tc_pgcache_flush')) {
|
| 43 |
+
w3tc_pgcache_flush();
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
if (function_exists('w3tc_flush_all')) {
|
| 47 |
+
w3tc_flush_all();
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
# Purge WP Super Cache
|
| 51 |
+
if (function_exists('wp_cache_clear_cache')) {
|
| 52 |
+
wp_cache_clear_cache();
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
if (isset($GLOBALS['wp_fastest_cache'])) {
|
| 56 |
+
if (method_exists($GLOBALS['wp_fastest_cache'], 'deleteCache')) {
|
| 57 |
+
$GLOBALS['wp_fastest_cache']->deleteCache();
|
| 58 |
+
$GLOBALS['wp_fastest_cache']->deleteCache(true);
|
| 59 |
+
}
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
if (function_exists('cachify_flush_cache')) {
|
| 63 |
+
cachify_flush_cache();
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
if (class_exists("comet_cache")) {
|
| 67 |
+
\comet_cache::clear();
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
if (class_exists("zencache")) {
|
| 71 |
+
\zencache::clear();
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
if (class_exists('LiteSpeed_Cache_Tags')) {
|
| 75 |
+
\LiteSpeed_Cache_Tags::add_purge_tag('*');
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
if (function_exists('sg_cachepress_purge_cache')) {
|
| 79 |
+
sg_cachepress_purge_cache();
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
if (class_exists('LiteSpeed_Cache_Purge')) {
|
| 83 |
+
\LiteSpeed_Cache_Purge::purge_all('Clear Cache For Me');
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
if (class_exists('WP_Optimize') && defined('WPO_PLUGIN_MAIN_PATH')) {
|
| 87 |
+
if (! class_exists('WP_Optimize_Cache_Commands')) include_once(WPO_PLUGIN_MAIN_PATH . 'cache/class-cache-commands.php');
|
| 88 |
+
if (! class_exists('WP_Optimize_Minify_Commands')) include_once(WPO_PLUGIN_MAIN_PATH . 'minify/class-wp-optimize-minify-commands.php');
|
| 89 |
+
|
| 90 |
+
if (class_exists('WP_Optimize_Cache_Commands')) {
|
| 91 |
+
$wpoptimize_cache_commands = new \WP_Optimize_Cache_Commands();
|
| 92 |
+
$wpoptimize_cache_commands->purge_page_cache();
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
if (class_exists('WP_Optimize_Minify_Commands')) {
|
| 96 |
+
$wpoptimize_minify_commands = new \WP_Optimize_Minify_Commands();
|
| 97 |
+
$wpoptimize_minify_commands->purge_minify_cache();
|
| 98 |
+
}
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
if (
|
| 102 |
+
class_exists('WPaaS\Plugin')
|
| 103 |
+
&&
|
| 104 |
+
function_exists('fastvelocity_godaddy_request')
|
| 105 |
+
) {
|
| 106 |
+
fastvelocity_godaddy_request('BAN');
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
# Purge WP Engine
|
| 110 |
+
if (class_exists("WpeCommon")) {
|
| 111 |
+
if (method_exists('WpeCommon', 'purge_memcached')) {
|
| 112 |
+
\WpeCommon::purge_memcached();
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
if (method_exists('WpeCommon', 'clear_maxcdn_cache')) {
|
| 116 |
+
\WpeCommon::clear_maxcdn_cache();
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
if (method_exists('WpeCommon', 'purge_varnish_cache')) {
|
| 120 |
+
\WpeCommon::purge_varnish_cache();
|
| 121 |
+
}
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
if (function_exists('rocket_clean_domain')) {
|
| 125 |
+
rocket_clean_domain();
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
if (function_exists('wp_cache_clean_cache')) {
|
| 129 |
+
global $file_prefix;
|
| 130 |
+
wp_cache_clean_cache( $file_prefix, true );
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
if (class_exists('autoptimizeCache')) {
|
| 134 |
+
\autoptimizeCache::clearall();
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
if (function_exists('fvm_purge_all')) {
|
| 138 |
+
fvm_purge_all();
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
if (function_exists('fastvelocity_purge_others')) {
|
| 142 |
+
fastvelocity_purge_others();
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
# wordpress default cache
|
| 146 |
+
if (function_exists('wp_cache_flush')) {
|
| 147 |
+
wp_cache_flush();
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
# https://wordpress.org/plugins/hummingbird-performance/
|
| 151 |
+
do_action('wphb_clear_page_cache');
|
| 152 |
+
|
| 153 |
+
if (class_exists('Swift_Performance_Cache')) {
|
| 154 |
+
\Swift_Performance_Cache::clear_all_cache();
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
if (class_exists('\SiteGround_Optimizer\Supercacher\Supercacher')) {
|
| 158 |
+
\SiteGround_Optimizer\Supercacher\Supercacher::get_instance()->purge_everything();
|
| 159 |
+
do_action('siteground_delete_assets');
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
if (class_exists('ShortPixelAI')) {
|
| 163 |
+
\ShortPixelAI::clear_css_cache();
|
| 164 |
+
}
|
| 165 |
+
}
|
| 166 |
+
}
|
| 167 |
+
|
framework/cli.php
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
namespace Blocksy;
|
| 4 |
+
|
| 5 |
+
class Cli {
|
| 6 |
+
public function __construct() {
|
| 7 |
+
\WP_CLI::add_command('blocksy demo plugins', function ($args) {
|
| 8 |
+
$plugins = [
|
| 9 |
+
'coblocks',
|
| 10 |
+
'elementor',
|
| 11 |
+
'contact-form-7',
|
| 12 |
+
'woocommerce'
|
| 13 |
+
];
|
| 14 |
+
|
| 15 |
+
foreach ($plugins as $plugin) {
|
| 16 |
+
\WP_CLI::runcommand('plugin install ' . $plugin, [] );
|
| 17 |
+
\WP_CLI::runcommand('plugin activate ' . $plugin, [] );
|
| 18 |
+
}
|
| 19 |
+
});
|
| 20 |
+
|
| 21 |
+
\WP_CLI::add_command('blocksy demo options', function ($args) {
|
| 22 |
+
$options = new DemoInstallOptionsInstaller([
|
| 23 |
+
'has_streaming' => false,
|
| 24 |
+
'demo_name' => 'Main:elementor'
|
| 25 |
+
]);
|
| 26 |
+
|
| 27 |
+
$options->import();
|
| 28 |
+
});
|
| 29 |
+
|
| 30 |
+
\WP_CLI::add_command('blocksy widgets drop', function ($args) {
|
| 31 |
+
$sidebars_widgets = get_option('sidebars_widgets', array());
|
| 32 |
+
|
| 33 |
+
if (! isset($sidebars_widgets['wp_inactive_widgets'])) {
|
| 34 |
+
$sidebars_widgets['wp_inactive_widgets'] = [];
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
foreach ($sidebars_widgets as $sidebar_id => $widgets) {
|
| 38 |
+
if (! $widgets) continue;
|
| 39 |
+
if ($sidebar_id === 'wp_inactive_widgets') {
|
| 40 |
+
continue;
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
if ($sidebar_id === 'array_version') {
|
| 44 |
+
continue;
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
foreach ($widgets as $widget_id) {
|
| 48 |
+
$sidebars_widgets['wp_inactive_widgets'][] = $widget_id;
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
$sidebars_widgets[$sidebar_id] = [];
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
update_option('sidebars_widgets', $sidebars_widgets);
|
| 55 |
+
unset($sidebars_widgets['array_version']);
|
| 56 |
+
|
| 57 |
+
set_theme_mod('sidebars_widgets', [
|
| 58 |
+
'time' => time(),
|
| 59 |
+
'data' => $sidebars_widgets
|
| 60 |
+
]);
|
| 61 |
+
});
|
| 62 |
+
|
| 63 |
+
\WP_CLI::add_command('blocksy demo widgets', function ($args) {
|
| 64 |
+
$options = new DemoInstallWidgetsInstaller([
|
| 65 |
+
'has_streaming' => false,
|
| 66 |
+
'demo_name' => 'Blocksy News:elementor'
|
| 67 |
+
]);
|
| 68 |
+
|
| 69 |
+
$options->import();
|
| 70 |
+
});
|
| 71 |
+
|
| 72 |
+
\WP_CLI::add_command('blocksy demo content', function ($args) {
|
| 73 |
+
$options = new DemoInstallContentInstaller([
|
| 74 |
+
'has_streaming' => false,
|
| 75 |
+
'demo_name' => 'Main:elementor'
|
| 76 |
+
]);
|
| 77 |
+
|
| 78 |
+
$options->import();
|
| 79 |
+
});
|
| 80 |
+
}
|
| 81 |
+
}
|
| 82 |
+
|
framework/dashboard.php
CHANGED
|
@@ -9,6 +9,109 @@ class Dashboard {
|
|
| 9 |
[ $this, 'enqueue_static' ],
|
| 10 |
100
|
| 11 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
}
|
| 13 |
|
| 14 |
public function enqueue_static() {
|
|
@@ -19,6 +122,7 @@ class Dashboard {
|
|
| 19 |
|
| 20 |
$deps = apply_filters('blocksy-dashboard-scripts-dependencies', [
|
| 21 |
'wp-i18n',
|
|
|
|
| 22 |
'ct-options-scripts'
|
| 23 |
]);
|
| 24 |
|
|
@@ -27,7 +131,7 @@ class Dashboard {
|
|
| 27 |
BLOCKSY_URL . 'static/bundle/dashboard.js',
|
| 28 |
$deps,
|
| 29 |
$data['Version'],
|
| 30 |
-
|
| 31 |
);
|
| 32 |
|
| 33 |
wp_enqueue_style(
|
| 9 |
[ $this, 'enqueue_static' ],
|
| 10 |
100
|
| 11 |
);
|
| 12 |
+
|
| 13 |
+
add_action('admin_body_class', function ($class) {
|
| 14 |
+
if (blc_fs()->is_activation_mode()) {
|
| 15 |
+
$class .= ' blocksy-fs-optin-dashboard';
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
return $class;
|
| 19 |
+
});
|
| 20 |
+
|
| 21 |
+
blc_fs()->add_filter(
|
| 22 |
+
'connect-message_on-premium',
|
| 23 |
+
function ($text) {
|
| 24 |
+
if (strpos($text, '<br>') !== false) {
|
| 25 |
+
$exploded_message = explode('<br>', $text);
|
| 26 |
+
|
| 27 |
+
$text = '<span>' . $exploded_message[0] . '</span>' . $exploded_message[1];
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
return $text;
|
| 31 |
+
}
|
| 32 |
+
);
|
| 33 |
+
|
| 34 |
+
blc_fs()->add_filter(
|
| 35 |
+
'connect_message_on_update',
|
| 36 |
+
function (
|
| 37 |
+
$message,
|
| 38 |
+
$user_first_name,
|
| 39 |
+
$product_title,
|
| 40 |
+
$user_login,
|
| 41 |
+
$site_link,
|
| 42 |
+
$freemius_link
|
| 43 |
+
) {
|
| 44 |
+
$is_network_upgrade_mode = ( fs_is_network_admin() && blc_fs()->is_network_upgrade_mode() );
|
| 45 |
+
$slug = blc_fs()->get_slug();
|
| 46 |
+
$is_gdpr_required = \FS_GDPR_Manager::instance()->is_required();
|
| 47 |
+
$hey_x_text = esc_html( sprintf( fs_text_x_inline( 'Hey %s,', 'greeting', 'hey-x', $slug ), $user_first_name ) );
|
| 48 |
+
|
| 49 |
+
$default_optin_message = $is_gdpr_required ?
|
| 50 |
+
fs_text_inline( 'Never miss an important update - opt in to our security & feature updates notifications, educational content, offers, and non-sensitive diagnostic tracking with %4$s. If you skip this, that\'s okay! %1$s will still work just fine.', 'connect-message_on-update', $slug ) :
|
| 51 |
+
fs_text_inline( 'Never miss an important update - opt in to our security & feature updates notifications, and non-sensitive diagnostic tracking with %4$s. If you skip this, that\'s okay! %1$s will still work just fine.', 'connect-message_on-update', $slug );
|
| 52 |
+
|
| 53 |
+
return (($is_network_upgrade_mode ?
|
| 54 |
+
'' :
|
| 55 |
+
/* translators: %s: name (e.g. Hey John,) */
|
| 56 |
+
'<span>' . $hey_x_text . '</span>'
|
| 57 |
+
) .
|
| 58 |
+
sprintf(
|
| 59 |
+
esc_html( $default_optin_message ),
|
| 60 |
+
'<b>' . esc_html( blc_fs()->get_plugin_name() ) . '</b>',
|
| 61 |
+
'<b>' . $user_login . '</b>',
|
| 62 |
+
$site_link,
|
| 63 |
+
$freemius_link
|
| 64 |
+
));
|
| 65 |
+
|
| 66 |
+
}, 10, 6
|
| 67 |
+
);
|
| 68 |
+
|
| 69 |
+
blc_fs()->add_action('connect/before', function () {
|
| 70 |
+
$path = dirname(__FILE__) . '/views/optin.php';
|
| 71 |
+
|
| 72 |
+
echo blc_call_fn(
|
| 73 |
+
['fn' => 'blocksy_render_view'],
|
| 74 |
+
$path,
|
| 75 |
+
[]
|
| 76 |
+
);
|
| 77 |
+
});
|
| 78 |
+
|
| 79 |
+
blc_fs()->add_action('connect/after', function () {
|
| 80 |
+
echo '</div>';
|
| 81 |
+
});
|
| 82 |
+
|
| 83 |
+
add_action(
|
| 84 |
+
'wp_ajax_blocksy_fs_connect_again',
|
| 85 |
+
function () {
|
| 86 |
+
if (! current_user_can('edit_theme_options')) {
|
| 87 |
+
wp_send_json_error();
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
blc_fs()->connect_again();
|
| 91 |
+
wp_send_json_success();
|
| 92 |
+
}
|
| 93 |
+
);
|
| 94 |
+
|
| 95 |
+
add_filter(
|
| 96 |
+
'blocksy_dashboard_localizations',
|
| 97 |
+
function ($d) {
|
| 98 |
+
$is_anonymous = blc_fs()->is_anonymous();
|
| 99 |
+
$connect_template = '';
|
| 100 |
+
|
| 101 |
+
if ($is_anonymous) {
|
| 102 |
+
ob_start();
|
| 103 |
+
blc_fs()->_connect_page_render();
|
| 104 |
+
$connect_template = ob_get_clean();
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
return array_merge([
|
| 108 |
+
'is_pro' => blc_fs()->is__premium_only(),
|
| 109 |
+
'is_anonymous' => $is_anonymous,
|
| 110 |
+
'connect_template' => $connect_template,
|
| 111 |
+
'has_beta_consent' => Plugin::instance()->user_wants_beta_updates()
|
| 112 |
+
], $d);
|
| 113 |
+
}
|
| 114 |
+
);
|
| 115 |
}
|
| 116 |
|
| 117 |
public function enqueue_static() {
|
| 122 |
|
| 123 |
$deps = apply_filters('blocksy-dashboard-scripts-dependencies', [
|
| 124 |
'wp-i18n',
|
| 125 |
+
'ct-events',
|
| 126 |
'ct-options-scripts'
|
| 127 |
]);
|
| 128 |
|
| 131 |
BLOCKSY_URL . 'static/bundle/dashboard.js',
|
| 132 |
$deps,
|
| 133 |
$data['Version'],
|
| 134 |
+
false
|
| 135 |
);
|
| 136 |
|
| 137 |
wp_enqueue_style(
|
framework/edd/theme-updater-admin.php
ADDED
|
@@ -0,0 +1,449 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Theme updater admin page and functions.
|
| 4 |
+
*
|
| 5 |
+
* @package EDD Theme Updater
|
| 6 |
+
*/
|
| 7 |
+
|
| 8 |
+
class EDD_Theme_Updater_Admin {
|
| 9 |
+
|
| 10 |
+
/**
|
| 11 |
+
* Variables required for the theme updater
|
| 12 |
+
*
|
| 13 |
+
* @since 1.0.0
|
| 14 |
+
* @type string
|
| 15 |
+
*/
|
| 16 |
+
protected $remote_api_url = null;
|
| 17 |
+
protected $theme_slug = null;
|
| 18 |
+
protected $version = null;
|
| 19 |
+
protected $author = null;
|
| 20 |
+
protected $download_id = null;
|
| 21 |
+
protected $renew_url = null;
|
| 22 |
+
protected $strings = null;
|
| 23 |
+
|
| 24 |
+
/**
|
| 25 |
+
* Initialize the class.
|
| 26 |
+
*
|
| 27 |
+
* @since 1.0.0
|
| 28 |
+
*/
|
| 29 |
+
function __construct( $config = array(), $strings = array() ) {
|
| 30 |
+
|
| 31 |
+
$config = wp_parse_args( $config, array(
|
| 32 |
+
'remote_api_url' => 'http://easydigitaldownloads.com',
|
| 33 |
+
'theme_slug' => get_template(),
|
| 34 |
+
'item_name' => '',
|
| 35 |
+
'license' => '',
|
| 36 |
+
'version' => '',
|
| 37 |
+
'author' => '',
|
| 38 |
+
'download_id' => '',
|
| 39 |
+
'renew_url' => ''
|
| 40 |
+
) );
|
| 41 |
+
|
| 42 |
+
// Set config arguments
|
| 43 |
+
$this->remote_api_url = $config['remote_api_url'];
|
| 44 |
+
$this->item_name = $config['item_name'];
|
| 45 |
+
$this->theme_slug = sanitize_key( $config['theme_slug'] );
|
| 46 |
+
$this->version = $config['version'];
|
| 47 |
+
$this->author = $config['author'];
|
| 48 |
+
$this->download_id = $config['download_id'];
|
| 49 |
+
$this->renew_url = $config['renew_url'];
|
| 50 |
+
|
| 51 |
+
// Populate version fallback
|
| 52 |
+
if ( '' == $config['version'] ) {
|
| 53 |
+
$theme = wp_get_theme( $this->theme_slug );
|
| 54 |
+
$this->version = $theme->get( 'Version' );
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
// Strings passed in from the updater config
|
| 58 |
+
$this->strings = $strings;
|
| 59 |
+
|
| 60 |
+
add_action( 'admin_init', array( $this, 'updater' ) );
|
| 61 |
+
// add_action( 'admin_init', array( $this, 'register_option' ) );
|
| 62 |
+
// add_action( 'admin_init', array( $this, 'license_action' ) );
|
| 63 |
+
// add_action( 'admin_menu', array( $this, 'license_menu' ) );
|
| 64 |
+
// add_action( 'update_option_' . $this->theme_slug . '_license_key', array( $this, 'activate_license' ), 10, 2 );
|
| 65 |
+
add_filter( 'http_request_args', array( $this, 'disable_wporg_request' ), 5, 2 );
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
/**
|
| 69 |
+
* Creates the updater class.
|
| 70 |
+
*
|
| 71 |
+
* since 1.0.0
|
| 72 |
+
*/
|
| 73 |
+
function updater() {
|
| 74 |
+
|
| 75 |
+
/* If there is no valid license key status, don't allow updates. */
|
| 76 |
+
if ( get_option( $this->theme_slug . '_license_key_status', false) != 'valid' ) {
|
| 77 |
+
// return;
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
if ( !class_exists( 'EDD_Theme_Updater' ) ) {
|
| 81 |
+
// Load our custom theme updater
|
| 82 |
+
include( dirname( __FILE__ ) . '/theme-updater-class.php' );
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
new EDD_Theme_Updater(
|
| 86 |
+
array(
|
| 87 |
+
'remote_api_url' => $this->remote_api_url,
|
| 88 |
+
'version' => $this->version,
|
| 89 |
+
// 'license' => trim( get_option( $this->theme_slug . '_license_key' ) ),
|
| 90 |
+
'license' => '123456',
|
| 91 |
+
'item_name' => $this->item_name,
|
| 92 |
+
'author' => $this->author
|
| 93 |
+
),
|
| 94 |
+
$this->strings
|
| 95 |
+
);
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
/**
|
| 99 |
+
* Adds a menu item for the theme license under the appearance menu.
|
| 100 |
+
*
|
| 101 |
+
* since 1.0.0
|
| 102 |
+
*/
|
| 103 |
+
function license_menu() {
|
| 104 |
+
|
| 105 |
+
$strings = $this->strings;
|
| 106 |
+
|
| 107 |
+
add_theme_page(
|
| 108 |
+
$strings['theme-license'],
|
| 109 |
+
$strings['theme-license'],
|
| 110 |
+
'manage_options',
|
| 111 |
+
$this->theme_slug . '-license',
|
| 112 |
+
array( $this, 'license_page' )
|
| 113 |
+
);
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
/**
|
| 117 |
+
* Outputs the markup used on the theme license page.
|
| 118 |
+
*
|
| 119 |
+
* since 1.0.0
|
| 120 |
+
*/
|
| 121 |
+
function license_page() {
|
| 122 |
+
|
| 123 |
+
$strings = $this->strings;
|
| 124 |
+
|
| 125 |
+
$license = trim( get_option( $this->theme_slug . '_license_key' ) );
|
| 126 |
+
$status = get_option( $this->theme_slug . '_license_key_status', false );
|
| 127 |
+
|
| 128 |
+
// Checks license status to display under license key
|
| 129 |
+
if ( ! $license ) {
|
| 130 |
+
$message = $strings['enter-key'];
|
| 131 |
+
} else {
|
| 132 |
+
// delete_transient( $this->theme_slug . '_license_message' );
|
| 133 |
+
if ( ! get_transient( $this->theme_slug . '_license_message', false ) ) {
|
| 134 |
+
set_transient( $this->theme_slug . '_license_message', $this->check_license(), ( 60 * 60 * 24 ) );
|
| 135 |
+
}
|
| 136 |
+
$message = get_transient( $this->theme_slug . '_license_message' );
|
| 137 |
+
}
|
| 138 |
+
?>
|
| 139 |
+
<div class="wrap">
|
| 140 |
+
<h2><?php echo $strings['theme-license'] ?></h2>
|
| 141 |
+
<form method="post" action="options.php">
|
| 142 |
+
|
| 143 |
+
<?php settings_fields( $this->theme_slug . '-license' ); ?>
|
| 144 |
+
|
| 145 |
+
<table class="form-table">
|
| 146 |
+
<tbody>
|
| 147 |
+
|
| 148 |
+
<tr valign="top">
|
| 149 |
+
<th scope="row" valign="top">
|
| 150 |
+
<?php echo $strings['license-key']; ?>
|
| 151 |
+
</th>
|
| 152 |
+
<td>
|
| 153 |
+
<input id="<?php echo $this->theme_slug; ?>_license_key" name="<?php echo $this->theme_slug; ?>_license_key" type="text" class="regular-text" value="<?php echo esc_attr( $license ); ?>" />
|
| 154 |
+
<p class="description">
|
| 155 |
+
<?php echo $message; ?>
|
| 156 |
+
</p>
|
| 157 |
+
</td>
|
| 158 |
+
</tr>
|
| 159 |
+
|
| 160 |
+
<?php if ( $license ) { ?>
|
| 161 |
+
<tr valign="top">
|
| 162 |
+
<th scope="row" valign="top">
|
| 163 |
+
<?php echo $strings['license-action']; ?>
|
| 164 |
+
</th>
|
| 165 |
+
<td>
|
| 166 |
+
<?php
|
| 167 |
+
wp_nonce_field( $this->theme_slug . '_nonce', $this->theme_slug . '_nonce' );
|
| 168 |
+
if ( 'valid' == $status ) { ?>
|
| 169 |
+
<input type="submit" class="button-secondary" name="<?php echo $this->theme_slug; ?>_license_deactivate" value="<?php esc_attr_e( $strings['deactivate-license'] ); ?>"/>
|
| 170 |
+
<?php } else { ?>
|
| 171 |
+
<input type="submit" class="button-secondary" name="<?php echo $this->theme_slug; ?>_license_activate" value="<?php esc_attr_e( $strings['activate-license'] ); ?>"/>
|
| 172 |
+
<?php }
|
| 173 |
+
?>
|
| 174 |
+
</td>
|
| 175 |
+
</tr>
|
| 176 |
+
<?php } ?>
|
| 177 |
+
|
| 178 |
+
</tbody>
|
| 179 |
+
</table>
|
| 180 |
+
<?php submit_button(); ?>
|
| 181 |
+
</form>
|
| 182 |
+
<?php
|
| 183 |
+
}
|
| 184 |
+
|
| 185 |
+
/**
|
| 186 |
+
* Registers the option used to store the license key in the options table.
|
| 187 |
+
*
|
| 188 |
+
* since 1.0.0
|
| 189 |
+
*/
|
| 190 |
+
function register_option() {
|
| 191 |
+
register_setting(
|
| 192 |
+
$this->theme_slug . '-license',
|
| 193 |
+
$this->theme_slug . '_license_key',
|
| 194 |
+
array( $this, 'sanitize_license' )
|
| 195 |
+
);
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
/**
|
| 199 |
+
* Sanitizes the license key.
|
| 200 |
+
*
|
| 201 |
+
* since 1.0.0
|
| 202 |
+
*
|
| 203 |
+
* @param string $new License key that was submitted.
|
| 204 |
+
* @return string $new Sanitized license key.
|
| 205 |
+
*/
|
| 206 |
+
function sanitize_license( $new ) {
|
| 207 |
+
|
| 208 |
+
$old = get_option( $this->theme_slug . '_license_key' );
|
| 209 |
+
|
| 210 |
+
if ( $old && $old != $new ) {
|
| 211 |
+
// New license has been entered, so must reactivate
|
| 212 |
+
delete_option( $this->theme_slug . '_license_key_status' );
|
| 213 |
+
delete_transient( $this->theme_slug . '_license_message' );
|
| 214 |
+
}
|
| 215 |
+
|
| 216 |
+
return $new;
|
| 217 |
+
}
|
| 218 |
+
|
| 219 |
+
/**
|
| 220 |
+
* Makes a call to the API.
|
| 221 |
+
*
|
| 222 |
+
* @since 1.0.0
|
| 223 |
+
*
|
| 224 |
+
* @param array $api_params to be used for wp_remote_get.
|
| 225 |
+
* @return array $response decoded JSON response.
|
| 226 |
+
*/
|
| 227 |
+
function get_api_response( $api_params ) {
|
| 228 |
+
|
| 229 |
+
// Call the custom API.
|
| 230 |
+
$response = wp_remote_get(
|
| 231 |
+
add_query_arg( $api_params, $this->remote_api_url ),
|
| 232 |
+
array( 'timeout' => 15, 'sslverify' => false )
|
| 233 |
+
);
|
| 234 |
+
|
| 235 |
+
// Make sure the response came back okay.
|
| 236 |
+
if ( is_wp_error( $response ) ) {
|
| 237 |
+
return false;
|
| 238 |
+
}
|
| 239 |
+
|
| 240 |
+
$response = json_decode( wp_remote_retrieve_body( $response ) );
|
| 241 |
+
|
| 242 |
+
return $response;
|
| 243 |
+
}
|
| 244 |
+
|
| 245 |
+
/**
|
| 246 |
+
* Activates the license key.
|
| 247 |
+
*
|
| 248 |
+
* @since 1.0.0
|
| 249 |
+
*/
|
| 250 |
+
function activate_license() {
|
| 251 |
+
|
| 252 |
+
$license = trim( get_option( $this->theme_slug . '_license_key' ) );
|
| 253 |
+
|
| 254 |
+
// Data to send in our API request.
|
| 255 |
+
$api_params = array(
|
| 256 |
+
'edd_action' => 'activate_license',
|
| 257 |
+
'license' => $license,
|
| 258 |
+
'item_name' => urlencode( $this->item_name )
|
| 259 |
+
);
|
| 260 |
+
|
| 261 |
+
$license_data = $this->get_api_response( $api_params );
|
| 262 |
+
|
| 263 |
+
// $response->license will be either "active" or "inactive"
|
| 264 |
+
if ( $license_data && isset( $license_data->license ) ) {
|
| 265 |
+
update_option( $this->theme_slug . '_license_key_status', $license_data->license );
|
| 266 |
+
delete_transient( $this->theme_slug . '_license_message' );
|
| 267 |
+
}
|
| 268 |
+
|
| 269 |
+
}
|
| 270 |
+
|
| 271 |
+
/**
|
| 272 |
+
* Deactivates the license key.
|
| 273 |
+
*
|
| 274 |
+
* @since 1.0.0
|
| 275 |
+
*/
|
| 276 |
+
function deactivate_license() {
|
| 277 |
+
|
| 278 |
+
// Retrieve the license from the database.
|
| 279 |
+
$license = trim( get_option( $this->theme_slug . '_license_key' ) );
|
| 280 |
+
|
| 281 |
+
// Data to send in our API request.
|
| 282 |
+
$api_params = array(
|
| 283 |
+
'edd_action' => 'deactivate_license',
|
| 284 |
+
'license' => $license,
|
| 285 |
+
'item_name' => urlencode( $this->item_name )
|
| 286 |
+
);
|
| 287 |
+
|
| 288 |
+
$license_data = $this->get_api_response( $api_params );
|
| 289 |
+
|
| 290 |
+
// $license_data->license will be either "deactivated" or "failed"
|
| 291 |
+
if ( $license_data && ( $license_data->license == 'deactivated' ) ) {
|
| 292 |
+
delete_option( $this->theme_slug . '_license_key_status' );
|
| 293 |
+
delete_transient( $this->theme_slug . '_license_message' );
|
| 294 |
+
}
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
/**
|
| 298 |
+
* Constructs a renewal link
|
| 299 |
+
*
|
| 300 |
+
* @since 1.0.0
|
| 301 |
+
*/
|
| 302 |
+
function get_renewal_link() {
|
| 303 |
+
|
| 304 |
+
// If a renewal link was passed in the config, use that
|
| 305 |
+
if ( '' != $this->renew_url ) {
|
| 306 |
+
return $this->renew_url;
|
| 307 |
+
}
|
| 308 |
+
|
| 309 |
+
// If download_id was passed in the config, a renewal link can be constructed
|
| 310 |
+
// $license_key = trim( get_option( $this->theme_slug . '_license_key', false ) );
|
| 311 |
+
$license_key = '123456';
|
| 312 |
+
|
| 313 |
+
if ( '' != $this->download_id && $license_key ) {
|
| 314 |
+
$url = esc_url( $this->remote_api_url );
|
| 315 |
+
$url .= '/checkout/?edd_license_key=' . $license_key . '&download_id=' . $this->download_id;
|
| 316 |
+
return $url;
|
| 317 |
+
}
|
| 318 |
+
|
| 319 |
+
// Otherwise return the remote_api_url
|
| 320 |
+
return $this->remote_api_url;
|
| 321 |
+
|
| 322 |
+
}
|
| 323 |
+
|
| 324 |
+
|
| 325 |
+
|
| 326 |
+
/**
|
| 327 |
+
* Checks if a license action was submitted.
|
| 328 |
+
*
|
| 329 |
+
* @since 1.0.0
|
| 330 |
+
*/
|
| 331 |
+
function license_action() {
|
| 332 |
+
|
| 333 |
+
if ( isset( $_POST[ $this->theme_slug . '_license_activate' ] ) ) {
|
| 334 |
+
if ( check_admin_referer( $this->theme_slug . '_nonce', $this->theme_slug . '_nonce' ) ) {
|
| 335 |
+
$this->activate_license();
|
| 336 |
+
}
|
| 337 |
+
}
|
| 338 |
+
|
| 339 |
+
if ( isset( $_POST[$this->theme_slug . '_license_deactivate'] ) ) {
|
| 340 |
+
if ( check_admin_referer( $this->theme_slug . '_nonce', $this->theme_slug . '_nonce' ) ) {
|
| 341 |
+
$this->deactivate_license();
|
| 342 |
+
}
|
| 343 |
+
}
|
| 344 |
+
|
| 345 |
+
}
|
| 346 |
+
|
| 347 |
+
/**
|
| 348 |
+
* Checks if license is valid and gets expire date.
|
| 349 |
+
*
|
| 350 |
+
* @since 1.0.0
|
| 351 |
+
*
|
| 352 |
+
* @return string $message License status message.
|
| 353 |
+
*/
|
| 354 |
+
function check_license() {
|
| 355 |
+
|
| 356 |
+
$license = trim( get_option( $this->theme_slug . '_license_key' ) );
|
| 357 |
+
$strings = $this->strings;
|
| 358 |
+
|
| 359 |
+
$api_params = array(
|
| 360 |
+
'edd_action' => 'check_license',
|
| 361 |
+
'license' => $license,
|
| 362 |
+
'item_name' => urlencode( $this->item_name )
|
| 363 |
+
);
|
| 364 |
+
|
| 365 |
+
$license_data = $this->get_api_response( $api_params );
|
| 366 |
+
|
| 367 |
+
// If response doesn't include license data, return
|
| 368 |
+
if ( !isset( $license_data->license ) ) {
|
| 369 |
+
$message = $strings['license-unknown'];
|
| 370 |
+
return $message;
|
| 371 |
+
}
|
| 372 |
+
|
| 373 |
+
// Get expire date
|
| 374 |
+
$expires = false;
|
| 375 |
+
if ( isset( $license_data->expires ) ) {
|
| 376 |
+
$expires = date_i18n( get_option( 'date_format' ), strtotime( $license_data->expires ) );
|
| 377 |
+
$renew_link = '<a href="' . esc_url( $this->get_renewal_link() ) . '" target="_blank">' . $strings['renew'] . '</a>';
|
| 378 |
+
}
|
| 379 |
+
|
| 380 |
+
// Get site counts
|
| 381 |
+
$site_count = $license_data->site_count;
|
| 382 |
+
$license_limit = $license_data->license_limit;
|
| 383 |
+
|
| 384 |
+
// If unlimited
|
| 385 |
+
if ( 0 == $license_limit ) {
|
| 386 |
+
$license_limit = $strings['unlimited'];
|
| 387 |
+
}
|
| 388 |
+
|
| 389 |
+
if ( $license_data->license == 'valid' ) {
|
| 390 |
+
$message = $strings['license-key-is-active'] . ' ';
|
| 391 |
+
if ( $expires ) {
|
| 392 |
+
$message .= sprintf( $strings['expires%s'], $expires ) . ' ';
|
| 393 |
+
}
|
| 394 |
+
if ( $site_count && $license_limit ) {
|
| 395 |
+
$message .= sprintf( $strings['%1$s/%2$-sites'], $site_count, $license_limit );
|
| 396 |
+
}
|
| 397 |
+
} else if ( $license_data->license == 'expired' ) {
|
| 398 |
+
if ( $expires ) {
|
| 399 |
+
$message = sprintf( $strings['license-key-expired-%s'], $expires );
|
| 400 |
+
} else {
|
| 401 |
+
$message = $strings['license-key-expired'];
|
| 402 |
+
}
|
| 403 |
+
if ( $renew_link ) {
|
| 404 |
+
$message .= ' ' . $renew_link;
|
| 405 |
+
}
|
| 406 |
+
} else if ( $license_data->license == 'invalid' ) {
|
| 407 |
+
$message = $strings['license-keys-do-not-match'];
|
| 408 |
+
} else if ( $license_data->license == 'inactive' ) {
|
| 409 |
+
$message = $strings['license-is-inactive'];
|
| 410 |
+
} else if ( $license_data->license == 'disabled' ) {
|
| 411 |
+
$message = $strings['license-key-is-disabled'];
|
| 412 |
+
} else if ( $license_data->license == 'site_inactive' ) {
|
| 413 |
+
// Site is inactive
|
| 414 |
+
$message = $strings['site-is-inactive'];
|
| 415 |
+
} else {
|
| 416 |
+
$message = $strings['license-status-unknown'];
|
| 417 |
+
}
|
| 418 |
+
|
| 419 |
+
return $message;
|
| 420 |
+
}
|
| 421 |
+
|
| 422 |
+
/**
|
| 423 |
+
* Disable requests to wp.org repository for this theme.
|
| 424 |
+
*
|
| 425 |
+
* @since 1.0.0
|
| 426 |
+
*/
|
| 427 |
+
function disable_wporg_request( $r, $url ) {
|
| 428 |
+
return $r;
|
| 429 |
+
|
| 430 |
+
// If it's not a theme update request, bail.
|
| 431 |
+
if ( 0 !== strpos( $url, 'https://api.wordpress.org/themes/update-check/1.1/' ) ) {
|
| 432 |
+
return $r;
|
| 433 |
+
}
|
| 434 |
+
|
| 435 |
+
// Decode the JSON response
|
| 436 |
+
$themes = json_decode( $r['body']['themes'] );
|
| 437 |
+
|
| 438 |
+
// Remove the active parent and child themes from the check
|
| 439 |
+
$parent = get_option( 'template' );
|
| 440 |
+
$child = get_option( 'stylesheet' );
|
| 441 |
+
unset( $themes->themes->$parent );
|
| 442 |
+
unset( $themes->themes->$child );
|
| 443 |
+
|
| 444 |
+
// Encode the updated JSON response
|
| 445 |
+
$r['body']['themes'] = json_encode( $themes );
|
| 446 |
+
|
| 447 |
+
return $r;
|
| 448 |
+
}
|
| 449 |
+
}
|
framework/edd/theme-updater-class.php
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Theme updater class.
|
| 4 |
+
*
|
| 5 |
+
* @package EDD Theme Updater
|
| 6 |
+
*/
|
| 7 |
+
|
| 8 |
+
class EDD_Theme_Updater {
|
| 9 |
+
|
| 10 |
+
private $remote_api_url;
|
| 11 |
+
private $request_data;
|
| 12 |
+
private $response_key;
|
| 13 |
+
private $theme_slug;
|
| 14 |
+
private $license_key;
|
| 15 |
+
private $version;
|
| 16 |
+
private $author;
|
| 17 |
+
protected $strings = null;
|
| 18 |
+
|
| 19 |
+
function __construct( $args = array(), $strings = array() ) {
|
| 20 |
+
|
| 21 |
+
$args = wp_parse_args( $args, array(
|
| 22 |
+
'remote_api_url' => 'http://easydigitaldownloads.com',
|
| 23 |
+
'request_data' => array(),
|
| 24 |
+
'theme_slug' => get_template(),
|
| 25 |
+
'item_name' => '',
|
| 26 |
+
'license' => '',
|
| 27 |
+
'version' => '',
|
| 28 |
+
'author' => ''
|
| 29 |
+
) );
|
| 30 |
+
extract( $args );
|
| 31 |
+
|
| 32 |
+
$this->license = $license;
|
| 33 |
+
$this->item_name = $item_name;
|
| 34 |
+
$this->version = $version;
|
| 35 |
+
$this->theme_slug = sanitize_key( $theme_slug );
|
| 36 |
+
$this->author = $author;
|
| 37 |
+
$this->remote_api_url = $remote_api_url;
|
| 38 |
+
$this->response_key = $this->theme_slug . '-update-response';
|
| 39 |
+
$this->strings = $strings;
|
| 40 |
+
|
| 41 |
+
add_filter( 'site_transient_update_themes', array( &$this, 'theme_update_transient' ) );
|
| 42 |
+
add_filter( 'delete_site_transient_update_themes', array( &$this, 'delete_theme_update_transient' ) );
|
| 43 |
+
add_action( 'load-update-core.php', array( &$this, 'delete_theme_update_transient' ) );
|
| 44 |
+
add_action( 'load-themes.php', array( &$this, 'delete_theme_update_transient' ) );
|
| 45 |
+
add_action( 'load-themes.php', array( &$this, 'load_themes_screen' ) );
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
function load_themes_screen() {
|
| 49 |
+
add_thickbox();
|
| 50 |
+
add_action( 'admin_notices', array( &$this, 'update_nag' ) );
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
function update_nag() {
|
| 54 |
+
|
| 55 |
+
$strings = $this->strings;
|
| 56 |
+
|
| 57 |
+
$theme = wp_get_theme( $this->theme_slug );
|
| 58 |
+
|
| 59 |
+
$api_response = get_transient( $this->response_key );
|
| 60 |
+
|
| 61 |
+
if ( false === $api_response ) {
|
| 62 |
+
return;
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
$update_url = wp_nonce_url( 'update.php?action=upgrade-theme&theme=' . urlencode( $this->theme_slug ), 'upgrade-theme_' . $this->theme_slug );
|
| 66 |
+
$update_onclick = ' onclick="if ( confirm(\'' . esc_js( $strings['update-notice'] ) . '\') ) {return true;}return false;"';
|
| 67 |
+
|
| 68 |
+
if ( version_compare( $this->version, $api_response->new_version, '<' ) ) {
|
| 69 |
+
|
| 70 |
+
echo '<div id="update-nag">';
|
| 71 |
+
printf(
|
| 72 |
+
$strings['update-available'],
|
| 73 |
+
$theme->get( 'Name' ),
|
| 74 |
+
$api_response->new_version,
|
| 75 |
+
'#TB_inline?width=640&inlineId=' . $this->theme_slug . '_changelog',
|
| 76 |
+
$theme->get( 'Name' ),
|
| 77 |
+
$update_url,
|
| 78 |
+
$update_onclick
|
| 79 |
+
);
|
| 80 |
+
echo '</div>';
|
| 81 |
+
echo '<div id="' . $this->theme_slug . '_' . 'changelog" style="display:none;">';
|
| 82 |
+
echo wpautop( $api_response->sections['changelog'] );
|
| 83 |
+
echo '</div>';
|
| 84 |
+
}
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
function theme_update_transient($value) {
|
| 88 |
+
$update_data = $this->check_for_update();
|
| 89 |
+
|
| 90 |
+
if ($update_data && ! isset($value->response[$this->theme_slug])) {
|
| 91 |
+
$value->response[$this->theme_slug] = @$update_data;
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
if (
|
| 95 |
+
$update_data
|
| 96 |
+
&&
|
| 97 |
+
isset($value->response[$this->theme_slug])
|
| 98 |
+
&&
|
| 99 |
+
isset($value->response[$this->theme_slug]['new_version'])
|
| 100 |
+
&&
|
| 101 |
+
version_compare(
|
| 102 |
+
$update_data['new_version'],
|
| 103 |
+
$value->response[$this->theme_slug]['new_version']
|
| 104 |
+
) > 0
|
| 105 |
+
) {
|
| 106 |
+
$value->response[$this->theme_slug] = $update_data;
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
return $value;
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
function delete_theme_update_transient() {
|
| 113 |
+
delete_transient($this->response_key);
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
function check_for_update() {
|
| 117 |
+
$update_data = get_transient( $this->response_key );
|
| 118 |
+
|
| 119 |
+
if ( false === $update_data ) {
|
| 120 |
+
$failed = false;
|
| 121 |
+
|
| 122 |
+
$api_params = array(
|
| 123 |
+
'edd_action' => 'get_version',
|
| 124 |
+
'license' => $this->license,
|
| 125 |
+
'name' => $this->item_name,
|
| 126 |
+
'slug' => $this->theme_slug,
|
| 127 |
+
'author' => $this->author
|
| 128 |
+
);
|
| 129 |
+
|
| 130 |
+
$response = wp_remote_post( $this->remote_api_url, array( 'timeout' => 15, 'body' => $api_params ) );
|
| 131 |
+
|
| 132 |
+
// Make sure the response was successful
|
| 133 |
+
if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
|
| 134 |
+
$failed = true;
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
$update_data = json_decode( wp_remote_retrieve_body( $response ) );
|
| 138 |
+
|
| 139 |
+
if ( ! is_object( $update_data ) ) {
|
| 140 |
+
$failed = true;
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
// If the response failed, try again in 30 minutes
|
| 144 |
+
if ( $failed ) {
|
| 145 |
+
$data = new stdClass;
|
| 146 |
+
$data->new_version = $this->version;
|
| 147 |
+
set_transient( $this->response_key, $data, strtotime( '+30 minutes' ) );
|
| 148 |
+
return false;
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
// If the status is 'ok', return the update arguments
|
| 152 |
+
if ( ! $failed ) {
|
| 153 |
+
$update_data->sections = maybe_unserialize( $update_data->sections );
|
| 154 |
+
set_transient( $this->response_key, $update_data, strtotime( '+12 hours' ) );
|
| 155 |
+
}
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
if ( version_compare( $this->version, $update_data->new_version, '>=' ) ) {
|
| 159 |
+
return false;
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
return (array) $update_data;
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
}
|
framework/extensions-manager-api.php
CHANGED
|
@@ -14,20 +14,47 @@ class ExtensionsManagerApi {
|
|
| 14 |
|
| 15 |
protected $ajax_actions = [
|
| 16 |
'blocksy_extensions_status',
|
| 17 |
-
|
| 18 |
'blocksy_extension_activate',
|
| 19 |
'blocksy_extension_deactivate',
|
| 20 |
];
|
| 21 |
|
| 22 |
public function blocksy_extensions_status() {
|
| 23 |
-
$this->check_capability(
|
| 24 |
$manager = Plugin::instance()->extensions;
|
| 25 |
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
}
|
| 28 |
|
| 29 |
public function blocksy_extension_activate() {
|
| 30 |
-
$this->check_capability(
|
| 31 |
$manager = Plugin::instance()->extensions;
|
| 32 |
|
| 33 |
$manager->activate_extension($this->get_extension_from_request());
|
|
@@ -36,7 +63,7 @@ class ExtensionsManagerApi {
|
|
| 36 |
}
|
| 37 |
|
| 38 |
public function blocksy_extension_deactivate() {
|
| 39 |
-
$this->check_capability(
|
| 40 |
$manager = Plugin::instance()->extensions;
|
| 41 |
|
| 42 |
$manager->deactivate_extension($this->get_extension_from_request());
|
|
@@ -59,7 +86,7 @@ class ExtensionsManagerApi {
|
|
| 59 |
wp_send_json_error();
|
| 60 |
}
|
| 61 |
|
| 62 |
-
return addslashes(
|
| 63 |
}
|
| 64 |
|
| 65 |
public function attach_ajax_actions() {
|
| 14 |
|
| 15 |
protected $ajax_actions = [
|
| 16 |
'blocksy_extensions_status',
|
|
|
|
| 17 |
'blocksy_extension_activate',
|
| 18 |
'blocksy_extension_deactivate',
|
| 19 |
];
|
| 20 |
|
| 21 |
public function blocksy_extensions_status() {
|
| 22 |
+
$this->check_capability('edit_theme_options');
|
| 23 |
$manager = Plugin::instance()->extensions;
|
| 24 |
|
| 25 |
+
$maybe_input = json_decode(file_get_contents('php://input'), true);
|
| 26 |
+
|
| 27 |
+
$data = $manager->get_extensions([
|
| 28 |
+
'forced_reread' => true
|
| 29 |
+
]);
|
| 30 |
+
|
| 31 |
+
if (
|
| 32 |
+
$maybe_input
|
| 33 |
+
&&
|
| 34 |
+
isset($maybe_input['extension'])
|
| 35 |
+
&&
|
| 36 |
+
isset($maybe_input['extAction'])
|
| 37 |
+
) {
|
| 38 |
+
$ext_preboot = $manager->get($maybe_input['extension'], [
|
| 39 |
+
'type' => 'preboot'
|
| 40 |
+
]);
|
| 41 |
+
|
| 42 |
+
if (method_exists(
|
| 43 |
+
$ext_preboot, 'ext_action'
|
| 44 |
+
)) {
|
| 45 |
+
$result = $ext_preboot->ext_action($maybe_input['extAction']);
|
| 46 |
+
|
| 47 |
+
if ($result) {
|
| 48 |
+
$data[$maybe_input['extension']]['data'] = $result;
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
wp_send_json_success($data);
|
| 54 |
}
|
| 55 |
|
| 56 |
public function blocksy_extension_activate() {
|
| 57 |
+
$this->check_capability('edit_theme_options');
|
| 58 |
$manager = Plugin::instance()->extensions;
|
| 59 |
|
| 60 |
$manager->activate_extension($this->get_extension_from_request());
|
| 63 |
}
|
| 64 |
|
| 65 |
public function blocksy_extension_deactivate() {
|
| 66 |
+
$this->check_capability('edit_theme_options');
|
| 67 |
$manager = Plugin::instance()->extensions;
|
| 68 |
|
| 69 |
$manager->deactivate_extension($this->get_extension_from_request());
|
| 86 |
wp_send_json_error();
|
| 87 |
}
|
| 88 |
|
| 89 |
+
return addslashes($_POST['ext']);
|
| 90 |
}
|
| 91 |
|
| 92 |
public function attach_ajax_actions() {
|
framework/extensions-manager.php
CHANGED
|
@@ -2,211 +2,334 @@
|
|
| 2 |
|
| 3 |
namespace Blocksy;
|
| 4 |
|
| 5 |
-
class ExtensionsManager
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
namespace Blocksy;
|
| 4 |
|
| 5 |
+
class ExtensionsManager
|
| 6 |
+
{
|
| 7 |
+
/**
|
| 8 |
+
* Collection of all the activated extensions.
|
| 9 |
+
*
|
| 10 |
+
* @var array The array of all the extension objects.
|
| 11 |
+
*/
|
| 12 |
+
private $extensions = array() ;
|
| 13 |
+
private function get_option_name()
|
| 14 |
+
{
|
| 15 |
+
return 'blocksy_active_extensions';
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
public function get( $id, $args = array() )
|
| 19 |
+
{
|
| 20 |
+
$args = wp_parse_args( $args, [
|
| 21 |
+
'type' => 'regular',
|
| 22 |
+
] );
|
| 23 |
+
if ( !isset( $this->extensions[$id] ) ) {
|
| 24 |
+
return null;
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
if ( $args['type'] === 'preboot' ) {
|
| 28 |
+
if ( !isset( $this->extensions[$id]['__object_preboot'] ) ) {
|
| 29 |
+
return null;
|
| 30 |
+
}
|
| 31 |
+
return $this->extensions[$id]['__object_preboot'];
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
if ( !isset( $this->extensions[$id]['__object'] ) ) {
|
| 35 |
+
return null;
|
| 36 |
+
}
|
| 37 |
+
return $this->extensions[$id]['__object'];
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
/**
|
| 41 |
+
* Collect all available extensions and activate the ones that have to be so.
|
| 42 |
+
*/
|
| 43 |
+
public function __construct()
|
| 44 |
+
{
|
| 45 |
+
$this->read_installed_extensions();
|
| 46 |
+
if ( $this->is_dashboard_page() ) {
|
| 47 |
+
$this->do_extensions_preboot();
|
| 48 |
+
}
|
| 49 |
+
foreach ( $this->get_activated_extensions() as $single_id ) {
|
| 50 |
+
$this->boot_activated_extension_for( $single_id );
|
| 51 |
+
}
|
| 52 |
+
add_action( 'activate_blocksy-companion/blocksy-companion.php', [ $this, 'handle_activation' ], 11 );
|
| 53 |
+
add_action( 'deactivate_blocksy-companion/blocksy-companion.php', [ $this, 'handle_deactivation' ], 11 );
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
public function handle_activation()
|
| 57 |
+
{
|
| 58 |
+
ob_start();
|
| 59 |
+
foreach ( $this->get_activated_extensions() as $id ) {
|
| 60 |
+
if ( method_exists( $this->get_class_name_for( $id ), "onActivation" ) ) {
|
| 61 |
+
call_user_func( [ $this->get_class_name_for( $id ), 'onActivation' ] );
|
| 62 |
+
}
|
| 63 |
+
}
|
| 64 |
+
ob_get_clean();
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
public function handle_deactivation()
|
| 68 |
+
{
|
| 69 |
+
foreach ( $this->get_activated_extensions() as $id ) {
|
| 70 |
+
if ( method_exists( $this->get_class_name_for( $id ), "onDeactivation" ) ) {
|
| 71 |
+
call_user_func( [ $this->get_class_name_for( $id ), 'onDeactivation' ] );
|
| 72 |
+
}
|
| 73 |
+
}
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
public function do_extensions_preboot()
|
| 77 |
+
{
|
| 78 |
+
foreach ( array_keys( $this->get_extensions() ) as $single_id ) {
|
| 79 |
+
$this->maybe_do_extension_preboot( $single_id );
|
| 80 |
+
}
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
private function is_dashboard_page()
|
| 84 |
+
{
|
| 85 |
+
global $pagenow ;
|
| 86 |
+
$is_ct_settings = isset( $_GET['page'] ) && 'ct-dashboard' === $_GET['page'];
|
| 87 |
+
return $is_ct_settings;
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
public function get_extensions( $args = array() )
|
| 91 |
+
{
|
| 92 |
+
$args = wp_parse_args( $args, [
|
| 93 |
+
'forced_reread' => false,
|
| 94 |
+
] );
|
| 95 |
+
|
| 96 |
+
if ( $args['forced_reread'] ) {
|
| 97 |
+
foreach ( $this->extensions as $id => $extension ) {
|
| 98 |
+
$this->extensions[$id]['config'] = $this->read_config_for( $extension['path'] );
|
| 99 |
+
$this->extensions[$id]['readme'] = $this->read_readme_for( $extension['path'] );
|
| 100 |
+
}
|
| 101 |
+
$this->register_fake_extensions();
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
return $this->extensions;
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
public function can( $capability = 'install_plugins' )
|
| 108 |
+
{
|
| 109 |
+
$user = wp_get_current_user();
|
| 110 |
+
// return array_intersect(['administrator'], $user->roles );
|
| 111 |
+
|
| 112 |
+
if ( is_multisite() ) {
|
| 113 |
+
// Only network admin can change files that affects the entire network.
|
| 114 |
+
$can = current_user_can_for_blog( get_current_blog_id(), $capability );
|
| 115 |
+
} else {
|
| 116 |
+
$can = current_user_can( $capability );
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
if ( $can ) {
|
| 120 |
+
// Also you can use this method to get the capability.
|
| 121 |
+
$can = $capability;
|
| 122 |
+
}
|
| 123 |
+
return $can;
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
public function activate_extension( $id )
|
| 127 |
+
{
|
| 128 |
+
if ( !isset( $this->extensions[$id] ) ) {
|
| 129 |
+
return;
|
| 130 |
+
}
|
| 131 |
+
if ( !$this->extensions[$id]['path'] ) {
|
| 132 |
+
return;
|
| 133 |
+
}
|
| 134 |
+
$activated = $this->get_activated_extensions();
|
| 135 |
+
|
| 136 |
+
if ( !in_array( strtolower( $id ), $activated ) ) {
|
| 137 |
+
$path = $this->extensions[$id]['path'];
|
| 138 |
+
require_once $path . '/extension.php';
|
| 139 |
+
if ( method_exists( $this->get_class_name_for( $id ), "onActivation" ) ) {
|
| 140 |
+
call_user_func( [ $this->get_class_name_for( $id ), 'onActivation' ] );
|
| 141 |
+
}
|
| 142 |
+
$class = $this->get_class_name_for( $id );
|
| 143 |
+
// Init extension right away.
|
| 144 |
+
new $class();
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
$activated[] = strtolower( $id );
|
| 148 |
+
update_option( $this->get_option_name(), array_unique( $activated ) );
|
| 149 |
+
Plugin::instance()->dynamic_css->generate_css_files();
|
| 150 |
+
}
|
| 151 |
+
|
| 152 |
+
public function deactivate_extension( $id )
|
| 153 |
+
{
|
| 154 |
+
if ( !isset( $this->extensions[$id] ) ) {
|
| 155 |
+
return;
|
| 156 |
+
}
|
| 157 |
+
if ( !$this->extensions[$id]['path'] ) {
|
| 158 |
+
return;
|
| 159 |
+
}
|
| 160 |
+
$activated = $this->get_activated_extensions();
|
| 161 |
+
if ( in_array( strtolower( $id ), $activated ) ) {
|
| 162 |
+
if ( method_exists( $this->get_class_name_for( $id ), "onDeactivation" ) ) {
|
| 163 |
+
call_user_func( [ $this->get_class_name_for( $id ), 'onDeactivation' ] );
|
| 164 |
+
}
|
| 165 |
+
}
|
| 166 |
+
update_option( $this->get_option_name(), array_diff( $activated, [ $id ] ) );
|
| 167 |
+
Plugin::instance()->dynamic_css->generate_css_files();
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
private function read_installed_extensions()
|
| 171 |
+
{
|
| 172 |
+
$paths_to_look_for_extensions = apply_filters( 'blocksy_extensions_paths', [ BLOCKSY_PATH . 'framework/extensions' ] );
|
| 173 |
+
foreach ( $paths_to_look_for_extensions as $single_path ) {
|
| 174 |
+
$all_extensions = glob( $single_path . '/*', GLOB_ONLYDIR );
|
| 175 |
+
foreach ( $all_extensions as $single_extension ) {
|
| 176 |
+
$this->register_extension_for( $single_extension );
|
| 177 |
+
}
|
| 178 |
+
}
|
| 179 |
+
$this->register_fake_extensions();
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
private function register_fake_extensions()
|
| 183 |
+
{
|
| 184 |
+
return;
|
| 185 |
+
$this->extensions['custom-fonts'] = [
|
| 186 |
+
'path' => null,
|
| 187 |
+
'__object' => null,
|
| 188 |
+
'config' => [
|
| 189 |
+
'name' => __( 'Custom Fonts', 'blc' ),
|
| 190 |
+
'description' => __( 'Upload unlimited number of custom fonts.', 'blc' ),
|
| 191 |
+
'pro' => true,
|
| 192 |
+
],
|
| 193 |
+
'readme' => '',
|
| 194 |
+
'data' => null,
|
| 195 |
+
];
|
| 196 |
+
$this->extensions['sidebars'] = [
|
| 197 |
+
'path' => null,
|
| 198 |
+
'__object' => null,
|
| 199 |
+
'config' => [
|
| 200 |
+
'name' => __( 'Sidebars', 'blc' ),
|
| 201 |
+
'description' => __( 'Create unlimited number of custom sidebars.', 'blc' ),
|
| 202 |
+
'pro' => true,
|
| 203 |
+
],
|
| 204 |
+
'readme' => '',
|
| 205 |
+
'data' => null,
|
| 206 |
+
];
|
| 207 |
+
$this->extensions['white-label'] = [
|
| 208 |
+
'path' => null,
|
| 209 |
+
'__object' => null,
|
| 210 |
+
'config' => [
|
| 211 |
+
'name' => __( 'White Label', 'blc' ),
|
| 212 |
+
'description' => __( 'Change theme/companion branding', 'blc' ),
|
| 213 |
+
'pro' => true,
|
| 214 |
+
],
|
| 215 |
+
'readme' => '',
|
| 216 |
+
'data' => null,
|
| 217 |
+
];
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
private function register_extension_for( $path )
|
| 221 |
+
{
|
| 222 |
+
$id = str_replace( '_', '-', basename( $path ) );
|
| 223 |
+
if ( isset( $this->extensions[$id] ) ) {
|
| 224 |
+
return;
|
| 225 |
+
}
|
| 226 |
+
$this->extensions[$id] = [
|
| 227 |
+
'path' => $path,
|
| 228 |
+
'__object' => null,
|
| 229 |
+
'config' => $this->read_config_for( $path ),
|
| 230 |
+
'readme' => $this->read_readme_for( $path ),
|
| 231 |
+
'data' => null,
|
| 232 |
+
];
|
| 233 |
+
}
|
| 234 |
+
|
| 235 |
+
private function maybe_do_extension_preboot( $id )
|
| 236 |
+
{
|
| 237 |
+
if ( !isset( $this->extensions[$id] ) ) {
|
| 238 |
+
return false;
|
| 239 |
+
}
|
| 240 |
+
if ( isset( $this->extensions[$id]['__object_preboot'] ) ) {
|
| 241 |
+
return;
|
| 242 |
+
}
|
| 243 |
+
$class_name = explode( '-', $id );
|
| 244 |
+
$class_name = array_map( 'ucfirst', $class_name );
|
| 245 |
+
$class_name = 'BlocksyExtension' . implode( '', $class_name ) . 'PreBoot';
|
| 246 |
+
$path = $this->extensions[$id]['path'];
|
| 247 |
+
if ( !file_exists( $path . '/pre-boot.php' ) ) {
|
| 248 |
+
return;
|
| 249 |
+
}
|
| 250 |
+
require_once $path . '/pre-boot.php';
|
| 251 |
+
$this->extensions[$id]['__object_preboot'] = new $class_name();
|
| 252 |
+
if ( method_exists( $this->extensions[$id]['__object_preboot'], 'ext_data' ) ) {
|
| 253 |
+
$this->extensions[$id]['data'] = $this->extensions[$id]['__object_preboot']->ext_data();
|
| 254 |
+
}
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
private function boot_activated_extension_for( $id )
|
| 258 |
+
{
|
| 259 |
+
if ( !isset( $this->extensions[$id] ) ) {
|
| 260 |
+
return false;
|
| 261 |
+
}
|
| 262 |
+
if ( !isset( $this->extensions[$id]['path'] ) ) {
|
| 263 |
+
return false;
|
| 264 |
+
}
|
| 265 |
+
if ( !$this->extensions[$id]['path'] ) {
|
| 266 |
+
return false;
|
| 267 |
+
}
|
| 268 |
+
if ( isset( $this->extensions[$id]['__object'] ) ) {
|
| 269 |
+
return;
|
| 270 |
+
}
|
| 271 |
+
$class_name = explode( '-', $id );
|
| 272 |
+
$class_name = array_map( 'ucfirst', $class_name );
|
| 273 |
+
$class_name = 'BlocksyExtension' . implode( '', $class_name );
|
| 274 |
+
$path = $this->extensions[$id]['path'];
|
| 275 |
+
if ( !file_exists( $path . '/extension.php' ) ) {
|
| 276 |
+
return;
|
| 277 |
+
}
|
| 278 |
+
require_once $path . '/extension.php';
|
| 279 |
+
$this->extensions[$id]['__object'] = new $class_name();
|
| 280 |
+
}
|
| 281 |
+
|
| 282 |
+
private function get_class_name_for( $id )
|
| 283 |
+
{
|
| 284 |
+
$class_name = explode( '-', $id );
|
| 285 |
+
$class_name = array_map( 'ucfirst', $class_name );
|
| 286 |
+
return 'BlocksyExtension' . implode( '', $class_name );
|
| 287 |
+
}
|
| 288 |
+
|
| 289 |
+
private function read_readme_for( $path )
|
| 290 |
+
{
|
| 291 |
+
$readme = '';
|
| 292 |
+
ob_start();
|
| 293 |
+
if ( is_readable( $path . '/readme.php' ) ) {
|
| 294 |
+
require $path . '/readme.php';
|
| 295 |
+
}
|
| 296 |
+
$readme = ob_get_clean();
|
| 297 |
+
if ( empty(trim( $readme )) ) {
|
| 298 |
+
return null;
|
| 299 |
+
}
|
| 300 |
+
return trim( $readme );
|
| 301 |
+
}
|
| 302 |
+
|
| 303 |
+
private function read_config_for( $file_path )
|
| 304 |
+
{
|
| 305 |
+
$_extract_variables = [
|
| 306 |
+
'config' => [],
|
| 307 |
+
];
|
| 308 |
+
|
| 309 |
+
if ( is_readable( $file_path . '/config.php' ) ) {
|
| 310 |
+
require $file_path . '/config.php';
|
| 311 |
+
foreach ( $_extract_variables as $variable_name => $default_value ) {
|
| 312 |
+
if ( isset( ${$variable_name} ) ) {
|
| 313 |
+
$_extract_variables[$variable_name] = ${$variable_name};
|
| 314 |
+
}
|
| 315 |
+
}
|
| 316 |
+
}
|
| 317 |
+
|
| 318 |
+
$name = explode( '-', basename( $file_path ) );
|
| 319 |
+
$name = array_map( 'ucfirst', $name );
|
| 320 |
+
$name = implode( ' ', $name );
|
| 321 |
+
$_extract_variables['config'] = array_merge( [
|
| 322 |
+
'name' => $name,
|
| 323 |
+
'description' => '',
|
| 324 |
+
'pro' => false,
|
| 325 |
+
'hidden' => false,
|
| 326 |
+
], $_extract_variables['config'] );
|
| 327 |
+
return $_extract_variables['config'];
|
| 328 |
+
}
|
| 329 |
+
|
| 330 |
+
private function get_activated_extensions()
|
| 331 |
+
{
|
| 332 |
+
return get_option( $this->get_option_name(), [] );
|
| 333 |
+
}
|
| 334 |
+
|
| 335 |
+
}
|
framework/extensions/cookies-consent/config.php
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
|
| 3 |
$config = [
|
|
|
|
| 4 |
'description' => __('Enable this extension in order to comply with the GDPR regulations.', 'blc')
|
| 5 |
-
];
|
| 1 |
<?php
|
| 2 |
|
| 3 |
$config = [
|
| 4 |
+
'name' => __('Cookies Consent', 'blc'),
|
| 5 |
'description' => __('Enable this extension in order to comply with the GDPR regulations.', 'blc')
|
| 6 |
+
];
|
framework/extensions/cookies-consent/customizer.php
CHANGED
|
@@ -9,9 +9,13 @@ $options = [
|
|
| 9 |
'type' => 'ct-options',
|
| 10 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 11 |
'inner-options' => [
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
blocksy_rand_md5() => [
|
| 14 |
-
'title' => __( 'General', '
|
| 15 |
'type' => 'tab',
|
| 16 |
'options' => [
|
| 17 |
|
|
@@ -19,18 +23,17 @@ $options = [
|
|
| 19 |
'label' => false,
|
| 20 |
'type' => 'ct-image-picker',
|
| 21 |
'value' => 'type-1',
|
| 22 |
-
'attr' => [ 'data-type' => 'background' ],
|
| 23 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 24 |
'choices' => [
|
| 25 |
|
| 26 |
'type-1' => [
|
| 27 |
'src' => BLOCKSY_URL . 'framework/extensions/cookies-consent/static/images/type-1.svg',
|
| 28 |
-
'title' => __( 'Type 1', '
|
| 29 |
],
|
| 30 |
|
| 31 |
'type-2' => [
|
| 32 |
'src' => BLOCKSY_URL . 'framework/extensions/cookies-consent/static/images/type-2.svg',
|
| 33 |
-
'title' => __( 'Type 2', '
|
| 34 |
],
|
| 35 |
|
| 36 |
],
|
|
@@ -39,7 +42,7 @@ $options = [
|
|
| 39 |
'cookie_consent_period' => [
|
| 40 |
'label' => __('Cookie period', 'blc'),
|
| 41 |
'type' => 'ct-select',
|
| 42 |
-
'value' => '
|
| 43 |
'design' => 'inline',
|
| 44 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 45 |
'choices' => blocksy_ordered_keys(
|
|
@@ -58,13 +61,18 @@ $options = [
|
|
| 58 |
),
|
| 59 |
],
|
| 60 |
|
| 61 |
-
|
| 62 |
'cookie_consent_content' => [
|
| 63 |
'label' => __( 'Content', 'blc' ),
|
| 64 |
-
'type' => '
|
| 65 |
-
'design' => 'block',
|
| 66 |
'value' => __('We use cookies to ensure that we give you the best experience on our website.', 'blc'),
|
|
|
|
| 67 |
'setting' => [ 'transport' => 'postMessage' ],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
],
|
| 69 |
|
| 70 |
'cookie_consent_button_text' => [
|
|
@@ -79,32 +87,43 @@ $options = [
|
|
| 79 |
],
|
| 80 |
|
| 81 |
blocksy_rand_md5() => [
|
| 82 |
-
'title' => __( 'Design', '
|
| 83 |
'type' => 'tab',
|
| 84 |
'options' => [
|
| 85 |
|
| 86 |
'cookieContentColor' => [
|
| 87 |
-
'label' => __( '
|
| 88 |
'type' => 'ct-color-picker',
|
| 89 |
'design' => 'inline',
|
| 90 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 91 |
|
| 92 |
'value' => [
|
| 93 |
'default' => [
|
| 94 |
-
'color' => '
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
],
|
| 96 |
],
|
| 97 |
|
| 98 |
'pickers' => [
|
| 99 |
[
|
| 100 |
-
'title' => __( 'Initial', '
|
| 101 |
'id' => 'default',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
],
|
| 103 |
],
|
| 104 |
],
|
| 105 |
|
| 106 |
'cookieButtonBackground' => [
|
| 107 |
-
'label' => __( 'Button Color', '
|
| 108 |
'type' => 'ct-color-picker',
|
| 109 |
'design' => 'inline',
|
| 110 |
'setting' => [ 'transport' => 'postMessage' ],
|
|
@@ -120,19 +139,19 @@ $options = [
|
|
| 120 |
|
| 121 |
'pickers' => [
|
| 122 |
[
|
| 123 |
-
'title' => __( 'Initial', '
|
| 124 |
'id' => 'default',
|
| 125 |
],
|
| 126 |
|
| 127 |
[
|
| 128 |
-
'title' => __( 'Hover', '
|
| 129 |
'id' => 'hover',
|
| 130 |
],
|
| 131 |
],
|
| 132 |
],
|
| 133 |
|
| 134 |
'cookieBackground' => [
|
| 135 |
-
'label' => __( 'Background Color', '
|
| 136 |
'type' => 'ct-color-picker',
|
| 137 |
'design' => 'inline',
|
| 138 |
'setting' => [ 'transport' => 'postMessage' ],
|
|
@@ -145,7 +164,7 @@ $options = [
|
|
| 145 |
|
| 146 |
'pickers' => [
|
| 147 |
[
|
| 148 |
-
'title' => __( 'Initial', '
|
| 149 |
'id' => 'default',
|
| 150 |
],
|
| 151 |
],
|
|
@@ -157,7 +176,7 @@ $options = [
|
|
| 157 |
'options' => [
|
| 158 |
|
| 159 |
'cookieMaxWidth' => [
|
| 160 |
-
'label' => __( 'Maximum Width', '
|
| 161 |
'type' => 'ct-slider',
|
| 162 |
'value' => 400,
|
| 163 |
'min' => 200,
|
|
@@ -171,7 +190,35 @@ $options = [
|
|
| 171 |
],
|
| 172 |
],
|
| 173 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 174 |
],
|
| 175 |
],
|
| 176 |
],
|
| 177 |
-
];
|
| 9 |
'type' => 'ct-options',
|
| 10 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 11 |
'inner-options' => [
|
| 12 |
+
blocksy_rand_md5() => [
|
| 13 |
+
'type' => 'ct-title',
|
| 14 |
+
'label' => __( 'Cookies Notification', 'blocksy' ),
|
| 15 |
+
],
|
| 16 |
|
| 17 |
blocksy_rand_md5() => [
|
| 18 |
+
'title' => __( 'General', 'blc' ),
|
| 19 |
'type' => 'tab',
|
| 20 |
'options' => [
|
| 21 |
|
| 23 |
'label' => false,
|
| 24 |
'type' => 'ct-image-picker',
|
| 25 |
'value' => 'type-1',
|
|
|
|
| 26 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 27 |
'choices' => [
|
| 28 |
|
| 29 |
'type-1' => [
|
| 30 |
'src' => BLOCKSY_URL . 'framework/extensions/cookies-consent/static/images/type-1.svg',
|
| 31 |
+
'title' => __( 'Type 1', 'blc' ),
|
| 32 |
],
|
| 33 |
|
| 34 |
'type-2' => [
|
| 35 |
'src' => BLOCKSY_URL . 'framework/extensions/cookies-consent/static/images/type-2.svg',
|
| 36 |
+
'title' => __( 'Type 2', 'blc' ),
|
| 37 |
],
|
| 38 |
|
| 39 |
],
|
| 42 |
'cookie_consent_period' => [
|
| 43 |
'label' => __('Cookie period', 'blc'),
|
| 44 |
'type' => 'ct-select',
|
| 45 |
+
'value' => 'forever',
|
| 46 |
'design' => 'inline',
|
| 47 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 48 |
'choices' => blocksy_ordered_keys(
|
| 61 |
),
|
| 62 |
],
|
| 63 |
|
|
|
|
| 64 |
'cookie_consent_content' => [
|
| 65 |
'label' => __( 'Content', 'blc' ),
|
| 66 |
+
'type' => 'wp-editor',
|
|
|
|
| 67 |
'value' => __('We use cookies to ensure that we give you the best experience on our website.', 'blc'),
|
| 68 |
+
'disableRevertButton' => true,
|
| 69 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 70 |
+
|
| 71 |
+
'quicktags' => false,
|
| 72 |
+
'mediaButtons' => false,
|
| 73 |
+
'tinymce' => [
|
| 74 |
+
'toolbar1' => 'bold,italic,link,alignleft,aligncenter,alignright,undo,redo',
|
| 75 |
+
],
|
| 76 |
],
|
| 77 |
|
| 78 |
'cookie_consent_button_text' => [
|
| 87 |
],
|
| 88 |
|
| 89 |
blocksy_rand_md5() => [
|
| 90 |
+
'title' => __( 'Design', 'blc' ),
|
| 91 |
'type' => 'tab',
|
| 92 |
'options' => [
|
| 93 |
|
| 94 |
'cookieContentColor' => [
|
| 95 |
+
'label' => __( 'Font Color', 'blc' ),
|
| 96 |
'type' => 'ct-color-picker',
|
| 97 |
'design' => 'inline',
|
| 98 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 99 |
|
| 100 |
'value' => [
|
| 101 |
'default' => [
|
| 102 |
+
'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
|
| 103 |
+
],
|
| 104 |
+
|
| 105 |
+
'hover' => [
|
| 106 |
+
'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
|
| 107 |
],
|
| 108 |
],
|
| 109 |
|
| 110 |
'pickers' => [
|
| 111 |
[
|
| 112 |
+
'title' => __( 'Initial', 'blc' ),
|
| 113 |
'id' => 'default',
|
| 114 |
+
'inherit' => 'var(--color)'
|
| 115 |
+
],
|
| 116 |
+
|
| 117 |
+
[
|
| 118 |
+
'title' => __( 'Hover', 'blc' ),
|
| 119 |
+
'id' => 'hover',
|
| 120 |
+
'inherit' => 'var(--colorHover)'
|
| 121 |
],
|
| 122 |
],
|
| 123 |
],
|
| 124 |
|
| 125 |
'cookieButtonBackground' => [
|
| 126 |
+
'label' => __( 'Button Color', 'blc' ),
|
| 127 |
'type' => 'ct-color-picker',
|
| 128 |
'design' => 'inline',
|
| 129 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 139 |
|
| 140 |
'pickers' => [
|
| 141 |
[
|
| 142 |
+
'title' => __( 'Initial', 'blc' ),
|
| 143 |
'id' => 'default',
|
| 144 |
],
|
| 145 |
|
| 146 |
[
|
| 147 |
+
'title' => __( 'Hover', 'blc' ),
|
| 148 |
'id' => 'hover',
|
| 149 |
],
|
| 150 |
],
|
| 151 |
],
|
| 152 |
|
| 153 |
'cookieBackground' => [
|
| 154 |
+
'label' => __( 'Background Color', 'blc' ),
|
| 155 |
'type' => 'ct-color-picker',
|
| 156 |
'design' => 'inline',
|
| 157 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 164 |
|
| 165 |
'pickers' => [
|
| 166 |
[
|
| 167 |
+
'title' => __( 'Initial', 'blc' ),
|
| 168 |
'id' => 'default',
|
| 169 |
],
|
| 170 |
],
|
| 176 |
'options' => [
|
| 177 |
|
| 178 |
'cookieMaxWidth' => [
|
| 179 |
+
'label' => __( 'Maximum Width', 'blc' ),
|
| 180 |
'type' => 'ct-slider',
|
| 181 |
'value' => 400,
|
| 182 |
'min' => 200,
|
| 190 |
],
|
| 191 |
],
|
| 192 |
|
| 193 |
+
blocksy_rand_md5() => [
|
| 194 |
+
'type' => 'ct-title',
|
| 195 |
+
'label' => __( 'Forms Cookies Content', 'blocksy' ),
|
| 196 |
+
],
|
| 197 |
+
|
| 198 |
+
'forms_cookie_consent_content' => [
|
| 199 |
+
'label' => false,
|
| 200 |
+
'type' => 'wp-editor',
|
| 201 |
+
'value' => sprintf(
|
| 202 |
+
__('I accept the %sPrivacy Policy%s', 'blc'),
|
| 203 |
+
'<a href="/privacy-policy">',
|
| 204 |
+
'</a>'
|
| 205 |
+
),
|
| 206 |
+
'desc' => __( 'This text will appear under each comment form and subscribe form.', 'blc' ),
|
| 207 |
+
// 'attr' => [ 'data-height' => 'heading-label' ],
|
| 208 |
+
'disableRevertButton' => true,
|
| 209 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 210 |
+
|
| 211 |
+
'quicktags' => false,
|
| 212 |
+
'mediaButtons' => false,
|
| 213 |
+
'tinymce' => [
|
| 214 |
+
'toolbar1' => 'bold,italic,link,alignleft,aligncenter,alignright,undo,redo',
|
| 215 |
+
'forced_root_block' => '',
|
| 216 |
+
'force_br_newlines' => true,
|
| 217 |
+
'force_p_newlines' => false
|
| 218 |
+
],
|
| 219 |
+
],
|
| 220 |
+
|
| 221 |
],
|
| 222 |
],
|
| 223 |
],
|
| 224 |
+
];
|
framework/extensions/cookies-consent/extension.php
CHANGED
|
@@ -3,11 +3,63 @@
|
|
| 3 |
require_once dirname( __FILE__ ) . '/helpers.php';
|
| 4 |
|
| 5 |
class BlocksyExtensionCookiesConsent {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
public static function should_display_notification() {
|
| 7 |
return !isset($_COOKIE['blocksy_cookies_consent_accepted']);
|
| 8 |
}
|
| 9 |
|
| 10 |
public function __construct() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
add_filter(
|
| 12 |
'blocksy_extensions_customizer_options',
|
| 13 |
[$this, 'add_options_panel']
|
|
@@ -25,7 +77,7 @@ class BlocksyExtensionCookiesConsent {
|
|
| 25 |
wp_enqueue_script(
|
| 26 |
'blocksy-cookies-consent-customizer-sync',
|
| 27 |
BLOCKSY_URL . 'framework/extensions/cookies-consent/static/bundle/sync.js',
|
| 28 |
-
[ 'customize-preview' ],
|
| 29 |
$data['Version'],
|
| 30 |
true
|
| 31 |
);
|
|
@@ -52,38 +104,33 @@ class BlocksyExtensionCookiesConsent {
|
|
| 52 |
wp_enqueue_style(
|
| 53 |
'blocksy-ext-cookies-consent-styles',
|
| 54 |
BLOCKSY_URL . 'framework/extensions/cookies-consent/static/bundle/main.css',
|
| 55 |
-
[],
|
| 56 |
$data['Version']
|
| 57 |
);
|
| 58 |
|
| 59 |
wp_enqueue_script(
|
| 60 |
'blocksy-ext-cookies-consent-scripts',
|
| 61 |
BLOCKSY_URL . 'framework/extensions/cookies-consent/static/bundle/main.js',
|
| 62 |
-
[],
|
| 63 |
$data['Version'],
|
| 64 |
true
|
| 65 |
);
|
| 66 |
});
|
| 67 |
|
| 68 |
-
add_action('blocksy:global-dynamic-css:enqueue', function (
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
dirname( __FILE__ ) . '/global.php',
|
| 74 |
-
[],
|
| 75 |
-
[
|
| 76 |
-
'css' => $css,
|
| 77 |
-
'tablet_css' => $tablet_css,
|
| 78 |
-
'mobile_css' => $mobile_css
|
| 79 |
-
]
|
| 80 |
-
);
|
| 81 |
-
|
| 82 |
}, 10, 3);
|
| 83 |
}
|
| 84 |
|
| 85 |
public function add_options_panel($options) {
|
| 86 |
-
$options['cookie_consent_ext'] =
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
dirname( __FILE__ ) . '/customizer.php',
|
| 88 |
[], false
|
| 89 |
);
|
| 3 |
require_once dirname( __FILE__ ) . '/helpers.php';
|
| 4 |
|
| 5 |
class BlocksyExtensionCookiesConsent {
|
| 6 |
+
public static function onActivation() {
|
| 7 |
+
do_action('wpsc_add_cookie', 'blocksy_cookies_consent_accepted');
|
| 8 |
+
|
| 9 |
+
if (function_exists('flush_rocket_htaccess')) {
|
| 10 |
+
add_filter('rocket_cache_dynamic_cookies', function ($cookies) {
|
| 11 |
+
$cookies[] = 'blocksy_cookies_consent_accepted';
|
| 12 |
+
return $cookies;
|
| 13 |
+
});
|
| 14 |
+
|
| 15 |
+
// Update the WP Rocket rules on the .htaccess file.
|
| 16 |
+
flush_rocket_htaccess();
|
| 17 |
+
// Regenerate the config file.
|
| 18 |
+
rocket_generate_config_file();
|
| 19 |
+
// Clear WP Rocket cache.
|
| 20 |
+
rocket_clean_domain();
|
| 21 |
+
}
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
public static function onDeactivation() {
|
| 25 |
+
do_action('wpsc_delete_cookie', 'blocksy_cookies_consent_accepted');
|
| 26 |
+
|
| 27 |
+
if (function_exists('flush_rocket_htaccess')) {
|
| 28 |
+
add_filter('rocket_cache_dynamic_cookies', function ($cookies) {
|
| 29 |
+
return array_diff(
|
| 30 |
+
$cookies,
|
| 31 |
+
[ 'blocksy_cookies_consent_accepted' ]
|
| 32 |
+
);
|
| 33 |
+
}, 200);
|
| 34 |
+
|
| 35 |
+
// Update the WP Rocket rules on the .htaccess file.
|
| 36 |
+
flush_rocket_htaccess();
|
| 37 |
+
// Regenerate the config file.
|
| 38 |
+
rocket_generate_config_file();
|
| 39 |
+
// Clear WP Rocket cache.
|
| 40 |
+
rocket_clean_domain();
|
| 41 |
+
}
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
public static function should_display_notification() {
|
| 45 |
return !isset($_COOKIE['blocksy_cookies_consent_accepted']);
|
| 46 |
}
|
| 47 |
|
| 48 |
public function __construct() {
|
| 49 |
+
add_action('blocksy:footer:after', function () {
|
| 50 |
+
echo blocksy_ext_cookies_consent_output();
|
| 51 |
+
});
|
| 52 |
+
|
| 53 |
+
add_filter('rocket_cache_dynamic_cookies', function ($cookies) {
|
| 54 |
+
$cookies[] = 'blocksy_cookies_consent_accepted';
|
| 55 |
+
return $cookies;
|
| 56 |
+
});
|
| 57 |
+
|
| 58 |
+
add_filter('blocksy-async-scripts-handles', function ($d) {
|
| 59 |
+
$d[] = 'blocksy-ext-cookies-consent-scripts';
|
| 60 |
+
return $d;
|
| 61 |
+
});
|
| 62 |
+
|
| 63 |
add_filter(
|
| 64 |
'blocksy_extensions_customizer_options',
|
| 65 |
[$this, 'add_options_panel']
|
| 77 |
wp_enqueue_script(
|
| 78 |
'blocksy-cookies-consent-customizer-sync',
|
| 79 |
BLOCKSY_URL . 'framework/extensions/cookies-consent/static/bundle/sync.js',
|
| 80 |
+
[ 'ct-events', 'customize-preview' ],
|
| 81 |
$data['Version'],
|
| 82 |
true
|
| 83 |
);
|
| 104 |
wp_enqueue_style(
|
| 105 |
'blocksy-ext-cookies-consent-styles',
|
| 106 |
BLOCKSY_URL . 'framework/extensions/cookies-consent/static/bundle/main.css',
|
| 107 |
+
['ct-main-styles'],
|
| 108 |
$data['Version']
|
| 109 |
);
|
| 110 |
|
| 111 |
wp_enqueue_script(
|
| 112 |
'blocksy-ext-cookies-consent-scripts',
|
| 113 |
BLOCKSY_URL . 'framework/extensions/cookies-consent/static/bundle/main.js',
|
| 114 |
+
['ct-events'],
|
| 115 |
$data['Version'],
|
| 116 |
true
|
| 117 |
);
|
| 118 |
});
|
| 119 |
|
| 120 |
+
add_action('blocksy:global-dynamic-css:enqueue', function ($args) {
|
| 121 |
+
blocksy_theme_get_dynamic_styles(array_merge([
|
| 122 |
+
'path' => dirname( __FILE__ ) . '/global.php',
|
| 123 |
+
'chunk' => 'global'
|
| 124 |
+
], $args));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
}, 10, 3);
|
| 126 |
}
|
| 127 |
|
| 128 |
public function add_options_panel($options) {
|
| 129 |
+
$options['cookie_consent_ext'] = blc_call_fn(
|
| 130 |
+
[
|
| 131 |
+
'fn' => 'blocksy_get_options',
|
| 132 |
+
'default' => 'array'
|
| 133 |
+
],
|
| 134 |
dirname( __FILE__ ) . '/customizer.php',
|
| 135 |
[], false
|
| 136 |
);
|
framework/extensions/cookies-consent/global.php
CHANGED
|
@@ -1,44 +1,66 @@
|
|
| 1 |
<?php
|
| 2 |
|
| 3 |
-
//
|
| 4 |
-
|
| 5 |
-
'cookieContentColor',
|
| 6 |
-
|
| 7 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
|
|
|
| 17 |
'default' => [ 'color' => 'var(--paletteColor1)' ],
|
| 18 |
'hover' => [ 'color' => 'var(--paletteColor2)' ],
|
| 19 |
-
]
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
| 26 |
|
| 27 |
-
$css->put(
|
| 28 |
-
'.cookie-notification',
|
| 29 |
-
"--buttonHoverColor: {$cookieButtonBackground['hover']}"
|
| 30 |
-
);
|
| 31 |
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
|
|
|
| 37 |
$css->put(
|
| 38 |
-
'
|
| 39 |
-
|
| 40 |
);
|
| 41 |
|
| 42 |
-
$cookieMaxWidth = get_theme_mod( 'cookieMaxWidth', 400 );
|
| 43 |
-
$css->put( ':root', '--cookieMaxWidth: ' . $cookieMaxWidth . 'px' );
|
| 44 |
-
|
| 1 |
<?php
|
| 2 |
|
| 3 |
+
// Content color
|
| 4 |
+
blc_call_fn(['fn' => 'blocksy_output_colors'], [
|
| 5 |
+
'value' => get_theme_mod('cookieContentColor'),
|
| 6 |
+
'default' => [
|
| 7 |
+
'default' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
|
| 8 |
+
'hover' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
|
| 9 |
+
],
|
| 10 |
+
'css' => $css,
|
| 11 |
+
'variables' => [
|
| 12 |
+
'default' => [
|
| 13 |
+
'selector' => '.cookie-notification',
|
| 14 |
+
'variable' => 'color'
|
| 15 |
+
],
|
| 16 |
|
| 17 |
+
'hover' => [
|
| 18 |
+
'selector' => '.cookie-notification',
|
| 19 |
+
'variable' => 'colorHover'
|
| 20 |
+
],
|
| 21 |
+
],
|
| 22 |
+
]);
|
| 23 |
|
| 24 |
+
// Button color
|
| 25 |
+
blc_call_fn(['fn' => 'blocksy_output_colors'], [
|
| 26 |
+
'value' => get_theme_mod('cookieButtonBackground'),
|
| 27 |
+
'default' => [
|
| 28 |
'default' => [ 'color' => 'var(--paletteColor1)' ],
|
| 29 |
'hover' => [ 'color' => 'var(--paletteColor2)' ],
|
| 30 |
+
],
|
| 31 |
+
'css' => $css,
|
| 32 |
+
'variables' => [
|
| 33 |
+
'default' => [
|
| 34 |
+
'selector' => '.cookie-notification',
|
| 35 |
+
'variable' => 'buttonInitialColor'
|
| 36 |
+
],
|
| 37 |
|
| 38 |
+
'hover' => [
|
| 39 |
+
'selector' => '.cookie-notification',
|
| 40 |
+
'variable' => 'buttonHoverColor'
|
| 41 |
+
]
|
| 42 |
+
],
|
| 43 |
+
]);
|
| 44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
+
// Background color
|
| 47 |
+
blc_call_fn(['fn' => 'blocksy_output_colors'], [
|
| 48 |
+
'value' => get_theme_mod('cookieBackground'),
|
| 49 |
+
'default' => [
|
| 50 |
+
'default' => [ 'color' => '#ffffff' ],
|
| 51 |
+
],
|
| 52 |
+
'css' => $css,
|
| 53 |
+
'variables' => [
|
| 54 |
+
'default' => [
|
| 55 |
+
'selector' => '.cookie-notification',
|
| 56 |
+
'variable' => 'backgroundColor'
|
| 57 |
+
],
|
| 58 |
+
],
|
| 59 |
+
]);
|
| 60 |
|
| 61 |
+
$cookieMaxWidth = get_theme_mod( 'cookieMaxWidth', 400 );
|
| 62 |
$css->put(
|
| 63 |
+
'.cookie-notification',
|
| 64 |
+
'--maxWidth: ' . $cookieMaxWidth . 'px'
|
| 65 |
);
|
| 66 |
|
|
|
|
|
|
|
|
|
framework/extensions/cookies-consent/helpers.php
CHANGED
|
@@ -29,7 +29,7 @@ function blocksy_ext_cookies_consent_output($forced = false) {
|
|
| 29 |
);
|
| 30 |
|
| 31 |
$button_text = get_theme_mod('cookie_consent_button_text', __('Accept', 'blc'));
|
| 32 |
-
$period = get_theme_mod('cookie_consent_period', '
|
| 33 |
$type = get_theme_mod('cookie_consent_type', 'type-1');
|
| 34 |
|
| 35 |
$class = 'container';
|
|
@@ -43,15 +43,14 @@ function blocksy_ext_cookies_consent_output($forced = false) {
|
|
| 43 |
?>
|
| 44 |
|
| 45 |
|
| 46 |
-
<div class="cookie-notification ct-fade-in-start" data-period="<?php
|
| 47 |
-
|
| 48 |
-
<div class="<?php esc_attr_e($class) ?>">
|
| 49 |
|
|
|
|
| 50 |
<?php if (!empty($content)) { ?>
|
| 51 |
-
<
|
| 52 |
<?php } ?>
|
| 53 |
|
| 54 |
-
<button class="ct-accept"><?php echo esc_html($button_text) ?></button>
|
| 55 |
|
| 56 |
<?php if ($type === 'type-1' || is_customize_preview()) { ?>
|
| 57 |
<button class="ct-close">×</button>
|
|
@@ -64,23 +63,27 @@ function blocksy_ext_cookies_consent_output($forced = false) {
|
|
| 64 |
return ob_get_clean();
|
| 65 |
}
|
| 66 |
|
| 67 |
-
function blocksy_ext_cookies_checkbox() {
|
| 68 |
ob_start();
|
| 69 |
|
| 70 |
-
|
| 71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
sprintf(
|
| 73 |
-
'
|
| 74 |
-
|
|
|
|
| 75 |
)
|
| 76 |
);
|
| 77 |
|
| 78 |
?>
|
| 79 |
|
| 80 |
-
<
|
| 81 |
-
<input id="gdprconfirm" name="gdprconfirm" type="checkbox" required
|
| 82 |
-
|
| 83 |
-
</div>
|
| 84 |
|
| 85 |
<?php
|
| 86 |
|
| 29 |
);
|
| 30 |
|
| 31 |
$button_text = get_theme_mod('cookie_consent_button_text', __('Accept', 'blc'));
|
| 32 |
+
$period = get_theme_mod('cookie_consent_period', 'forever');
|
| 33 |
$type = get_theme_mod('cookie_consent_type', 'type-1');
|
| 34 |
|
| 35 |
$class = 'container';
|
| 43 |
?>
|
| 44 |
|
| 45 |
|
| 46 |
+
<div class="cookie-notification ct-fade-in-start" data-period="<?php echo esc_attr($period) ?>" data-type="<?php echo esc_attr($type) ?>">
|
|
|
|
|
|
|
| 47 |
|
| 48 |
+
<div class="<?php echo esc_attr($class) ?>">
|
| 49 |
<?php if (!empty($content)) { ?>
|
| 50 |
+
<div class="ct-cookies-content"><?php echo wp_kses_post($content) ?></div>
|
| 51 |
<?php } ?>
|
| 52 |
|
| 53 |
+
<button type="submit" class="ct-button ct-accept"><?php echo esc_html($button_text) ?></button>
|
| 54 |
|
| 55 |
<?php if ($type === 'type-1' || is_customize_preview()) { ?>
|
| 56 |
<button class="ct-close">×</button>
|
| 63 |
return ob_get_clean();
|
| 64 |
}
|
| 65 |
|
| 66 |
+
function blocksy_ext_cookies_checkbox($prefix = '') {
|
| 67 |
ob_start();
|
| 68 |
|
| 69 |
+
if (! empty($prefix)) {
|
| 70 |
+
$prefix = '_' . $prefix;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
$message = get_theme_mod(
|
| 74 |
+
'forms_cookie_consent_content',
|
| 75 |
sprintf(
|
| 76 |
+
__('I accept the %sPrivacy Policy%s', 'blc'),
|
| 77 |
+
'<a href="/privacy-policy">',
|
| 78 |
+
'</a>'
|
| 79 |
)
|
| 80 |
);
|
| 81 |
|
| 82 |
?>
|
| 83 |
|
| 84 |
+
<p class="gdpr-confirm-policy">
|
| 85 |
+
<input id="gdprconfirm<?php echo $prefix ?>" name="gdprconfirm" type="checkbox" required /><label for="gdprconfirm<?php echo $prefix ?>"><?php echo $message ?></label>
|
| 86 |
+
</p>
|
|
|
|
| 87 |
|
| 88 |
<?php
|
| 89 |
|
framework/extensions/cookies-consent/readme.php
CHANGED
|
@@ -1,14 +1,12 @@
|
|
| 1 |
-
<
|
| 2 |
|
| 3 |
<p>
|
| 4 |
<?php echo __('After installing and activating the Cookies Consent extension you will be able to configure it from this location:', 'blc') ?>
|
| 5 |
</p>
|
| 6 |
|
| 7 |
-
<ul>
|
| 8 |
<li>
|
| 9 |
-
<
|
| 10 |
-
<?php echo __('Customizer', 'blc') ?>
|
| 11 |
-
</b>
|
| 12 |
<i>
|
| 13 |
<?php
|
| 14 |
echo sprintf(
|
|
@@ -23,4 +21,18 @@
|
|
| 23 |
</li>
|
| 24 |
</ul>
|
| 25 |
|
|
|
|
|
|
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<h2><?php echo __('Instructions', 'blc'); ?></h2>
|
| 2 |
|
| 3 |
<p>
|
| 4 |
<?php echo __('After installing and activating the Cookies Consent extension you will be able to configure it from this location:', 'blc') ?>
|
| 5 |
</p>
|
| 6 |
|
| 7 |
+
<ul class="ct-modal-list">
|
| 8 |
<li>
|
| 9 |
+
<h4><?php echo __('Customizer', 'blc') ?></h4>
|
|
|
|
|
|
|
| 10 |
<i>
|
| 11 |
<?php
|
| 12 |
echo sprintf(
|
| 21 |
</li>
|
| 22 |
</ul>
|
| 23 |
|
| 24 |
+
<div class="extension-notice">
|
| 25 |
+
<h4><?php echo __('Known problems with caching plugins', 'blc'); ?></h4>
|
| 26 |
|
| 27 |
+
<p>
|
| 28 |
+
<?php
|
| 29 |
+
echo sprintf(
|
| 30 |
+
__('Please read %s to find out more information.', 'blc'),
|
| 31 |
+
sprintf(
|
| 32 |
+
'<a href="https://creativethemes.com/blocksy/docs/extensions/cookies-consent/#cache/">%s</a>',
|
| 33 |
+
__('this article', 'blc')
|
| 34 |
+
)
|
| 35 |
+
);
|
| 36 |
+
?>
|
| 37 |
+
</p>
|
| 38 |
+
</div>
|
framework/extensions/cookies-consent/static/bundle/main.css
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
/**
|
| 2 |
-
* - v1.
|
| 3 |
*
|
| 4 |
-
* Copyright (c)
|
| 5 |
* Licensed GPLv2+
|
| 6 |
*/
|
| 7 |
|
| 8 |
-
.cookie-notification{position:fixed;left:0;bottom:0;z-index:999999;color:var(--
|
| 1 |
/**
|
| 2 |
+
* - v1.7.32
|
| 3 |
*
|
| 4 |
+
* Copyright (c) 2020
|
| 5 |
* Licensed GPLv2+
|
| 6 |
*/
|
| 7 |
|
| 8 |
+
.cookie-notification{position:fixed;left:0;bottom:0;z-index:999999;color:var(--color)}.cookie-notification a:hover{color:var(--colorHover)}@media (max-width: 479.98px){.cookie-notification>div{flex-direction:column}}@media (max-width: 689.98px){.cookie-notification{right:0}.cookie-notification>div{display:flex;align-items:center;padding-top:15px;padding-bottom:15px}}@media (max-width: 689.98px){.cookie-notification[data-type='type-1']{background:var(--backgroundColor)}}@media (min-width: 690px){.cookie-notification[data-type='type-1']{padding:0 25px 25px 25px}.cookie-notification[data-type='type-1'] .ct-cookies-content{margin-bottom:15px;max-width:90%}}.cookie-notification[data-type='type-1'] .container{position:relative}@media (max-width: 689.98px){.cookie-notification[data-type='type-1'] .container{width:88%;margin:0 auto}}@media (min-width: 690px){.cookie-notification[data-type='type-1'] .container{background:var(--backgroundColor);box-shadow:0px 5px 30px -5px rgba(34,56,101,0.15);padding:25px 40px 25px 25px;border-radius:3px;max-width:var(--maxWidth)}}.cookie-notification[data-type='type-2']{right:0;background:var(--backgroundColor)}@media (min-width: 690px){.cookie-notification[data-type='type-2']{padding:15px 0}.cookie-notification[data-type='type-2'] .ct-container{display:flex;align-items:center;justify-content:center}.cookie-notification[data-type='type-2'] .ct-accept{margin-left:25px}}.cookie-notification[data-type='type-2'] .ct-close{display:none}.cookie-notification .ct-cookies-content{line-height:1.4}.cookie-notification .ct-cookies-content a{text-decoration:underline;color:var(--colorHover)}@media (max-width: 479.98px){.cookie-notification .ct-cookies-content{text-align:center;margin-bottom:15px}}@media (max-width: 689.98px){.cookie-notification .ct-cookies-content{font-size:13px}}@media (min-width: 690px){.cookie-notification .ct-cookies-content{font-size:14px}}.cookie-notification .ct-accept{--buttonFontSize: 13px;--buttonMinHeight: 35px;--padding: 0 20px;--buttonShadow: none;--buttonTransform: none}@media (max-width: 479.98px){.cookie-notification .ct-accept{width:100%}}@media (min-width: 480px) and (max-width: 689.98px){.cookie-notification .ct-accept{margin-left:20px}}.cookie-notification .ct-close{display:flex;align-items:center;justify-content:center;width:45px;height:45px;position:absolute;top:0;right:0;opacity:0.5;color:inherit;cursor:pointer;background:transparent}.cookie-notification .ct-close:hover{opacity:1}@media (max-width: 689.98px){.cookie-notification .ct-close{display:none}}.cookie-notification.ct-fade-in-start,.cookie-notification.ct-fade-in-end,.cookie-notification.ct-fade-start,.cookie-notification.ct-fade-end{transition:all 0.3s ease}.cookie-notification.ct-fade-in-start{opacity:0;transform:translate3d(0, 15px, 0)}.cookie-notification.ct-fade-end{opacity:0;transform:translate3d(0, 15px, 0)}
|
framework/extensions/cookies-consent/static/bundle/main.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
-
!function(e){var t={};function n(
|
| 2 |
/*!
|
| 3 |
-
* JavaScript Cookie v2.2.
|
| 4 |
* https://github.com/js-cookie/js-cookie
|
| 5 |
*
|
| 6 |
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
|
| 7 |
* Released under the MIT license
|
| 8 |
-
*/!function(i){if(void 0===(
|
| 1 |
+
!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,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t){e.exports=ctEvents},function(e,t,n){var r,o;
|
| 2 |
/*!
|
| 3 |
+
* JavaScript Cookie v2.2.1
|
| 4 |
* https://github.com/js-cookie/js-cookie
|
| 5 |
*
|
| 6 |
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
|
| 7 |
* Released under the MIT license
|
| 8 |
+
*/!function(i){if(void 0===(o="function"==typeof(r=i)?r.call(t,n,t,e):r)||(e.exports=o),!0,e.exports=i(),!!0){var c=window.Cookies,a=window.Cookies=i();a.noConflict=function(){return window.Cookies=c,a}}}((function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function n(r){function o(){}function i(t,n,i){if("undefined"!=typeof document){"number"==typeof(i=e({path:"/"},o.defaults,i)).expires&&(i.expires=new Date(1*new Date+864e5*i.expires)),i.expires=i.expires?i.expires.toUTCString():"";try{var c=JSON.stringify(n);/^[\{\[]/.test(c)&&(n=c)}catch(e){}n=r.write?r.write(n,t):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var a="";for(var u in i)i[u]&&(a+="; "+u,!0!==i[u]&&(a+="="+i[u].split(";")[0]));return document.cookie=t+"="+n+a}}function c(e,n){if("undefined"!=typeof document){for(var o={},i=document.cookie?document.cookie.split("; "):[],c=0;c<i.length;c++){var a=i[c].split("="),u=a.slice(1).join("=");n||'"'!==u.charAt(0)||(u=u.slice(1,-1));try{var f=t(a[0]);if(u=(r.read||r)(u,f)||t(u),n)try{u=JSON.parse(u)}catch(e){}if(o[f]=u,e===f)break}catch(e){}}return e?o[e]:o}}return o.set=i,o.get=function(e){return c(e,!1)},o.getJSON=function(e){return c(e,!0)},o.remove=function(t,n){i(t,"",e(n,{expires:-1}))},o.defaults={},o.withConverter=n,o}((function(){}))}))},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),i=n(1),c=n.n(i);function a(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var f,s=function(){var e=document.querySelector(".cookie-notification");e&&(requestAnimationFrame((function(){e.classList.remove("ct-fade-in-start"),e.classList.add("ct-fade-in-end"),d(e,(function(){e.classList.remove("ct-fade-in-end")}))})),a(e.querySelectorAll("button")).map((function(t){t.addEventListener("click",(function(n){if(n.preventDefault(),t.classList.contains("ct-accept")){c.a.set("blocksy_cookies_consent_accepted","true",{expires:new Date(1*new Date+{onehour:36e5,oneday:864e5,oneweek:6048e5,onemonth:26784e5,threemonths:80352e5,sixmonths:160704e5,oneyear:31536e6,forever:864e9}[t.closest("[data-period]").dataset.period])})}e.classList.add("ct-fade-start"),requestAnimationFrame((function(){e.classList.remove("ct-fade-start"),e.classList.add("ct-fade-end"),d(e,(function(){e.parentNode.removeChild(e)}))}))}))})))};function d(e,t){setTimeout((function(){t()}),300)}f=function(){s(),o.a.on("blocksy:cookies:init",(function(){s()}))},/comp|inter|loaded/.test(document.readyState)?f():document.addEventListener("DOMContentLoaded",f,!1)}]);
|
framework/extensions/cookies-consent/static/bundle/sync.js
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
!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,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t);var r,o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"desktop",r=document.querySelector("#"+{desktop:"ct-main-styles-inline-css",tablet:"ct-main-styles-tablet-inline-css",mobile:"ct-main-styles-mobile-inline-css"}[n]),o=r.innerText,i=e.selector||":root",c=new RegExp(i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\s?{[\\s\\S]*?}","gm"),l=o.match(c);l&&(r.innerText=o.replace(c,l[0].indexOf("--"+e.variable+":")>-1?l[0].replace(new RegExp("--"+e.variable+":[\\s\\S]*?;","gm"),"CT_CSS_SKIP_RULE"===t?"":"--"+e.variable+": "+t+";"):l[0].replace(new RegExp(i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\s?{","gm"),i+" {"+("CT_CSS_SKIP_RULE"===t?"":"--"+e.variable+": "+t+";"))))},i=function(e,t){return[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(e.selector?document.querySelectorAll(e.selector):[document.documentElement])).map(function(n){if(!e.responsive){var r=(e.type||"").indexOf("color")>-1?t["color"===e.type?"default":e.type.split(":")[1]].color:e.extractValue?e.extractValue(t):t;return"border"===(e.type||"")&&(r="none"===t.style?"none":t.width+"px "+t.style+" "+t.color.color),void o(e,""+r+(e.unit||""))}t=function(e){return e.desktop?e:{desktop:e,tablet:e,mobile:e}}(t),t=e.extractValue?e.extractValue(t):t,e.respect_visibility&&(wp.customize(e.respect_visibility)().mobile||(t.mobile="0"+(e.unit?"":"px")),wp.customize(e.respect_visibility)().tablet||(t.tablet="0"+(e.unit?"":"px")),wp.customize(e.respect_visibility)().desktop||(t.desktop="0"+(e.unit?"":"px"))),e.respect_stacking&&(wp.customize(e.respect_stacking)().mobile&&(t.mobile=2*parseInt(t.mobile,10)+(e.unit?"":"px")),wp.customize(e.respect_stacking)().tablet&&(t.tablet=2*parseInt(t.tablet,10)+(e.unit?"":"px"))),e.enabled&&"no"===!wp.customize(e.enabled)()&&(t.mobile="0"+(e.unit?"":"px"),t.tablet="0"+(e.unit?"":"px"),t.desktop="0"+(e.unit?"":"px")),o(e,""+t.desktop+(e.unit||""),"desktop"),o(e,""+t.tablet+(e.unit||""),"tablet"),o(e,""+t.mobile+(e.unit||""),"mobile")})};r={cookieContentColor:{variable:"cookieContentColor",type:"color"},cookieBackground:{variable:"cookieBackground",type:"color"},cookieButtonBackground:[{selector:".cookie-notification",variable:"buttonInitialColor",type:"color:default"},{selector:".cookie-notification",variable:"buttonHoverColor",type:"color:hover"}],cookieMaxWidth:{variable:"cookieMaxWidth",unit:"px"}},wp.customize.bind("change",function(e){return r[e.id]&&(Array.isArray(r[e.id])?r[e.id]:[r[e.id]]).map(function(t){return i(t,e())})});var c=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var c,l=e[Symbol.iterator]();!(r=(c=l.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&l.return&&l.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};var a=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";n||((t=document.createElement("div")).innerHTML=document.querySelector(".ct-customizer-preview-cache-container").value,n=t);var o=n.querySelector(".ct-customizer-preview-cache [data-"+r+'="'+e+'"]').innerHTML,i=document.createElement("div");return i.innerHTML=o,i},u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=l({fragment_id:null,selector:null,parent_selector:null,strategy:"append",whenInserted:function(){},beforeInsert:function(e){},should_insert:!0},e);var t=document.querySelector(e.parent_selector);if([].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(document.querySelectorAll(e.parent_selector+" "+e.selector))).map(function(e){return e.parentNode.removeChild(e)}),e.should_insert){for(var n=a(e.fragment_id);n.firstElementChild;)if(e.beforeInsert(n.firstElementChild),"append"===e.strategy&&t.appendChild(n.firstElementChild),"firstChild"===e.strategy&&t.insertBefore(n.firstElementChild,t.firstElementChild),e.strategy.indexOf("maybeBefore")>-1){var r=e.strategy.split(":"),o=c(r,2),i=(o[0],o[1]);t.querySelector(i)?t.insertBefore(n.firstElementChild,t.querySelector(i)):t.appendChild(n.firstElementChild)}e.whenInserted()}},s=function(){var e=function(e){if(!document.querySelector(".cookie-notification"))return u({fragment_id:"blocksy-cookies-consent-section",selector:".cookie-notification",parent_selector:"#main-container"}),!0}(),t=document.querySelector(".cookie-notification");if(t){t.querySelector("p").innerHTML=wp.customize("cookie_consent_content")(),t.querySelector("button.ct-accept").innerHTML=wp.customize("cookie_consent_button_text")();var n=wp.customize("cookie_consent_type")();t.dataset.type=n,t.firstElementChild.classList.remove("ct-container","container"),t.firstElementChild.classList.add("type-1"===n?"container":"ct-container"),e&&setTimeout(function(){return window.ctEvents.trigger("blocksy:cookies:init")})}};wp.customize("cookie_consent_content",function(e){return e.bind(function(e){s()})}),wp.customize("cookie_consent_button_text",function(e){return e.bind(function(e){return s()})}),wp.customize("cookie_consent_type",function(e){return e.bind(function(e){return s()})})}]);
|
| 1 |
+
!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,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t){e.exports=ctEvents},function(e,t,n){"use strict";n.r(t);var r,o=function(e){if([e.top,e.right,e.bottom,e.left].reduce((function(e,t){return!!e&&!("auto"!==t&&t&&t.toString().match(/\d/g))}),!0))return"CT_CSS_SKIP_RULE";var t=["auto"!==e.top&&e.top.toString().match(/\d/g)?e.top:0,"auto"!==e.right&&e.right.toString().match(/\d/g)?e.right:0,"auto"!==e.bottom&&e.bottom.toString().match(/\d/g)?e.bottom:0,"auto"!==e.left&&e.left.toString().match(/\d/g)?e.left:0];return t[0]===t[1]&&t[0]===t[2]&&t[0]===t[3]?t[0]:t[0]===t[2]&&t[1]===t[3]?"".concat(t[0]," ").concat(t[3]):t.join(" ")},c=function(e,t){var n=t.forcedOutput,r=void 0!==n&&n;if("CT_CSS_SKIP_RULE"===e)return"CT_CSS_SKIP_RULE";if("none"===e)return"none";if(!e.enable)return r?"none":"CT_CSS_SKIP_RULE";if(0===parseFloat(e.blur)&&0===parseFloat(e.spread)&&0===parseFloat(e.v_offset)&&0===parseFloat(e.h_offset))return r?"none":"CT_CSS_SKIP_RULE";var o=[];return e.inset&&o.push("inset"),o.push("".concat(e.h_offset,"px")),o.push("".concat(e.v_offset,"px")),0!==parseFloat(e.blur)&&(o.push("".concat(e.blur,"px")),0!==parseFloat(e.spread)&&o.push("".concat(e.spread,"px"))),0===parseFloat(e.blur)&&0!==parseFloat(e.spread)&&(o.push("".concat(e.blur,"px")),o.push("".concat(e.spread,"px"))),o.push(e.color.color),o.join(" ")},i=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"desktop",r={desktop:"ct-main-styles-inline-css",tablet:"ct-main-styles-tablet-inline-css",mobile:"ct-main-styles-mobile-inline-css"},o=document.querySelector("style#".concat(r[n])),c=o.innerText,i="".concat(e["".concat(n,"_selector_prefix")]?"".concat(e["".concat(n,"_selector_prefix")]," "):"").concat(e.selector||":root"),a=null,l=c.match(a);0===c.trim().indexOf(i)?(a=new RegExp("".concat(i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=c.match(a)):(a=new RegExp("\\}\\s*?".concat(i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=c.match(a)),l||(0===(c="".concat(c," ").concat(i," { }")).trim().indexOf(i)?(a=new RegExp("".concat(i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=c.match(a)):(a=new RegExp("\\}\\s*?".concat(i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=c.match(a))),o.innerText=c.replace(a,l[0].indexOf("--".concat(e.variable,":"))>-1?l[0].replace(new RegExp("--".concat(e.variable,":[\\s\\S]*?;"),"gm"),t.indexOf("CT_CSS_SKIP_RULE")>-1||t.indexOf(e.variable)>-1?"":"--".concat(e.variable,": ").concat(t,";")):l[0].replace(new RegExp("".concat(i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{"),"gm"),"".concat(i," {").concat(t.indexOf("CT_CSS_SKIP_RULE")>-1||t.indexOf(e.variable)>-1?"":"--".concat(e.variable,": ").concat(t,";"))))},a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"desktop",r=(e.type||"").indexOf("color")>-1?t["color"===e.type?"default":e.type.split(":")[1]].color:t;"border"===(e.type||"")&&(r="none"===t.style?"none":"".concat(t.width,"px ").concat(t.style," ").concat(t.color.color)),"spacing"===(e.type||"")&&(r=o(t)),"box-shadow"===(e.type||"")&&(r=c(t,e)),i(e,"".concat(r).concat(e.unit||"").concat(e.important?" !important":""),n)},l=function(e,t){var n=t;t=e.extractValue?e.extractValue(t):t,e.whenDone&&e.whenDone(t,n),t=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e&&Object.keys(e).indexOf("desktop")>-1?t?e:e.desktop:t?{desktop:e,tablet:e,mobile:e}:e}(t,!!e.responsive),e.responsive?(e.enabled&&"no"===!wp.customize(e.enabled)()&&(t.mobile="0"+(e.unit?"":"px"),t.tablet="0"+(e.unit?"":"px"),t.desktop="0"+(e.unit?"":"px")),a(e,t.desktop,"desktop"),a(e,t.tablet,"tablet"),a(e,t.mobile,"mobile")):a(e,t)};r={cookieContentColor:[{selector:".cookie-notification",variable:"color",type:"color:default"},{selector:".cookie-notification",variable:"colorHover",type:"color:hover"}],cookieBackground:{selector:".cookie-notification",variable:"backgroundColor",type:"color"},cookieButtonBackground:[{selector:".cookie-notification",variable:"buttonInitialColor",type:"color:default"},{selector:".cookie-notification",variable:"buttonHoverColor",type:"color:hover"}],cookieMaxWidth:{selector:".cookie-notification",variable:"maxWidth",unit:"px"}},wp.customize.bind("change",(function(e){return r[e.id]&&(Array.isArray(r[e.id])?r[e.id]:[r[e.id]]).map((function(t){return l(t,e())}))}));var u=n(0),s=n.n(u);function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,c=void 0;try{for(var i,a=e[Symbol.iterator]();!(r=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,c=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw c}}return n}(e,t)||d(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||d(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){if(e){if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var h=function(){var e=document.createElement("div");return e.innerHTML=document.querySelector(".ct-customizer-preview-cache-container").value,e},g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";if(t||(t=h()),t.querySelector(".ct-customizer-preview-cache [data-".concat(n,'="').concat(e,'"]'))){var r=t.querySelector(".ct-customizer-preview-cache [data-".concat(n,'="').concat(e,'"]')).innerHTML,o=document.createElement("div");return o.innerHTML=r,o}},S=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=y({fragment_id:null,selector:null,parent_selector:null,strategy:"append",whenInserted:function(){},beforeInsert:function(e){},should_insert:!0},e);var t=document.querySelector(e.parent_selector);if(p(document.querySelectorAll("".concat(e.parent_selector," ").concat(e.selector))).map((function(e){return e.parentNode.removeChild(e)})),e.should_insert){var n=g(e.fragment_id);if(n){for(;n.firstElementChild;)if(e.beforeInsert(n.firstElementChild),"append"===e.strategy&&t.appendChild(n.firstElementChild),"firstChild"===e.strategy&&t.insertBefore(n.firstElementChild,t.firstElementChild),e.strategy.indexOf("maybeBefore")>-1){var r=e.strategy.split(":"),o=f(r,2),c=(o[0],o[1]);t.querySelector(c)?t.insertBefore(n.firstElementChild,t.querySelector(c)):t.appendChild(n.firstElementChild)}e.whenInserted()}}};function _(e){return function(e){if(Array.isArray(e))return x(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var O=function(){var e=function(e){if(!document.querySelector(".cookie-notification"))return S({fragment_id:"blocksy-cookies-consent-section",selector:".cookie-notification",parent_selector:"#main-container"}),!0}(),t=document.querySelector(".cookie-notification");if(t){t.querySelector(".ct-cookies-content")&&(t.querySelector(".ct-cookies-content").innerHTML=wp.customize("cookie_consent_content")()),t.querySelector("button.ct-accept").innerHTML=wp.customize("cookie_consent_button_text")();var n=wp.customize("cookie_consent_type")();t.dataset.type=n,t.firstElementChild.classList.remove("ct-container","container"),t.firstElementChild.classList.add("type-1"===n?"container":"ct-container"),e&&setTimeout((function(){return s.a.trigger("blocksy:cookies:init")}))}};wp.customize("cookie_consent_content",(function(e){return e.bind((function(e){O()}))})),wp.customize("cookie_consent_button_text",(function(e){return e.bind((function(e){return O()}))})),wp.customize("cookie_consent_type",(function(e){return e.bind((function(e){return O()}))})),wp.customize("forms_cookie_consent_content",(function(e){return e.bind((function(e){return _(document.querySelectorAll(".gdpr-confirm-policy label")).map((function(t){return t.innerHTML=e}))}))}))}]);
|
framework/extensions/cookies-consent/static/images/type-1.svg
CHANGED
|
@@ -1,41 +1,34 @@
|
|
| 1 |
<?xml version="1.0" encoding="utf-8"?>
|
| 2 |
-
<!-- Generator: Adobe Illustrator 23.0.
|
| 3 |
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
| 4 |
viewBox="0 0 100 70" style="enable-background:new 0 0 100 70;" xml:space="preserve">
|
| 5 |
<style type="text/css">
|
| 6 |
.st0{fill:#FFFFFF;}
|
| 7 |
.st1{fill:#EDEFF0;}
|
| 8 |
-
.st2{fill:#
|
| 9 |
-
.st3{fill:#
|
| 10 |
-
.st4{fill:#
|
| 11 |
</style>
|
| 12 |
<path class="st0" d="M13,73.5c-1.4,0-2.5-1.1-2.5-2.5V13c0-1.4,1.1-2.5,2.5-2.5h74c1.4,0,2.5,1.1,2.5,2.5v58c0,1.4-1.1,2.5-2.5,2.5
|
| 13 |
H13z"/>
|
| 14 |
-
<path class="st1" d="M11,
|
| 15 |
-
<path class="st2" d="
|
| 16 |
-
<path class="st3" d="M87,11c1.1,0,2,0.9,2,2v58c0,1.1-0.9,2-2,2H13c-1.1,0-2-0.9-2-2V13c0-1.1,0.9-2,2-2H87 M87,10H13
|
| 17 |
c-1.7,0-3,1.3-3,3v58c0,1.7,1.3,3,3,3h74c1.6,0,3-1.3,3-3V13C90,11.3,88.6,10,87,10z"/>
|
| 18 |
-
<path class="
|
| 19 |
-
|
| 20 |
-
c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h4c0.3,0,0.5,0.2,0.5,0.5S63.8,22.5,63.5,22.5z M22.4,20.5c0.5-0.9,1.4-1.4,2.4-1.4
|
| 27 |
-
c0.7,0,1.3,0.3,1.8,0.7c-0.1,0-0.3,0-0.4,0.1c-0.4,0.2-0.5,0.8,0,1.1c0.3,0.2,0.4,0.6,0.4,0.9s-0.7,1.5-0.7,1.5l-0.6-2.2V21
|
| 28 |
-
c0-0.1,0-0.1,0.1-0.2l0.1-0.1h0.3v-0.2H24v0.2h0.1c0.1,0,0.1,0.1,0.2,0.1c0.1,0.1,0.1,0.3,0.2,0.5l0.2,0.8l-0.5,1.2L23.6,21
|
| 29 |
-
c0,0,0-0.2,0.1-0.2l0.1-0.1v-0.2C23.8,20.5,22.4,20.5,22.4,20.5z M22.7,20.9c0,0-0.1-0.2-0.3-0.2h-0.1c-0.1,0.3-0.2,0.7-0.2,1.1
|
| 30 |
-
c0,1.1,0.7,2.1,1.7,2.5L22.7,20.9z M27.2,20.5c0.1,0.2,0,0.5-0.1,0.9c-0.3,0.9-0.9,2.4-1.2,3c1-0.4,1.6-1.4,1.6-2.5
|
| 31 |
-
C27.6,21.4,27.4,20.9,27.2,20.5 M24.9,22.8l-0.7,1.7c0.2,0,0.4,0.1,0.6,0.1s0.5,0,0.7-0.1L24.9,22.8z"/>
|
| 32 |
<g>
|
| 33 |
-
<path class="
|
| 34 |
C49.2,65.4,48.8,65.9,48.2,65.9z"/>
|
| 35 |
<path class="st0" d="M35.9,53.3h-17c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h17c0.3,0,0.5,0.2,0.5,0.5S36.2,53.3,35.9,53.3z"/>
|
| 36 |
<path class="st0" d="M24.7,56.3h-5.8c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h5.8c0.3,0,0.5,0.2,0.5,0.5S25,56.3,24.7,56.3z"/>
|
| 37 |
<path class="st0" d="M35.9,56.3h-9.2c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h9.2c0.3,0,0.5,0.2,0.5,0.5S36.2,56.3,35.9,56.3z"/>
|
| 38 |
-
<path class="st0" d="M27.8,63.2h-7.3c-1.1,0-2.1-0.9-2.1-2.
|
| 39 |
C29.9,62.3,28.9,63.2,27.8,63.2z"/>
|
| 40 |
<path class="st0" d="M43.7,53.3h-5.8c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h5.8c0.3,0,0.5,0.2,0.5,0.5S44,53.3,43.7,53.3z"/>
|
| 41 |
<path class="st0" d="M38.7,49.9H19.4c-0.6,0-1-0.5-1-1l0,0c0-0.6,0.5-1,1-1h19.2c0.6,0,1,0.5,1,1l0,0
|
| 1 |
<?xml version="1.0" encoding="utf-8"?>
|
| 2 |
+
<!-- Generator: Adobe Illustrator 23.0.4, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
| 3 |
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
| 4 |
viewBox="0 0 100 70" style="enable-background:new 0 0 100 70;" xml:space="preserve">
|
| 5 |
<style type="text/css">
|
| 6 |
.st0{fill:#FFFFFF;}
|
| 7 |
.st1{fill:#EDEFF0;}
|
| 8 |
+
.st2{fill:#565D66;}
|
| 9 |
+
.st3{fill:#4F5459;}
|
| 10 |
+
.st4{fill:#6E747A;}
|
| 11 |
</style>
|
| 12 |
<path class="st0" d="M13,73.5c-1.4,0-2.5-1.1-2.5-2.5V13c0-1.4,1.1-2.5,2.5-2.5h74c1.4,0,2.5,1.1,2.5,2.5v58c0,1.4-1.1,2.5-2.5,2.5
|
| 13 |
H13z"/>
|
| 14 |
+
<path class="st1" d="M11,11h78v14H11V11z"/>
|
| 15 |
+
<path class="st2" d="M87,11c1.1,0,2,0.9,2,2v58c0,1.1-0.9,2-2,2H13c-1.1,0-2-0.9-2-2V13c0-1.1,0.9-2,2-2H87 M87,10H13
|
|
|
|
| 16 |
c-1.7,0-3,1.3-3,3v58c0,1.7,1.3,3,3,3h74c1.6,0,3-1.3,3-3V13C90,11.3,88.6,10,87,10z"/>
|
| 17 |
+
<path class="st3" d="M77.5,18.5h-4c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h4c0.3,0,0.5,0.2,0.5,0.5S77.8,18.5,77.5,18.5z
|
| 18 |
+
M70.5,18.5h-4c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h4c0.3,0,0.5,0.2,0.5,0.5S70.8,18.5,70.5,18.5z M63.5,18.5h-4
|
| 19 |
+
c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h4c0.3,0,0.5,0.2,0.5,0.5S63.8,18.5,63.5,18.5z M22.4,16.5c0.5-0.9,1.4-1.4,2.4-1.4
|
| 20 |
+
c0.7,0,1.3,0.3,1.8,0.7c-0.1,0-0.3,0-0.4,0.1c-0.4,0.2-0.5,0.8,0,1.1c0.3,0.2,0.4,0.6,0.4,0.9s-0.7,1.5-0.7,1.5l-0.6-2.2V17
|
| 21 |
+
c0-0.1,0-0.1,0.1-0.2l0.1-0.1h0.3v-0.2H24v0.2h0.1c0.1,0,0.1,0.1,0.2,0.1c0.1,0.1,0.1,0.3,0.2,0.5l0.2,0.8l-0.5,1.2L23.6,17
|
| 22 |
+
c0,0,0-0.2,0.1-0.2l0.1-0.1v-0.2C23.8,16.5,22.4,16.5,22.4,16.5z M22.7,16.9c0,0-0.1-0.2-0.3-0.2h-0.1c-0.1,0.3-0.2,0.7-0.2,1.1
|
| 23 |
+
c0,1.1,0.7,2.1,1.7,2.5L22.7,16.9z M27.2,16.5c0.1,0.2,0,0.5-0.1,0.9c-0.3,0.9-0.9,2.4-1.2,3c1-0.4,1.6-1.4,1.6-2.5
|
| 24 |
+
C27.6,17.4,27.4,16.9,27.2,16.5 M24.9,18.8l-0.7,1.7c0.2,0,0.4,0.1,0.6,0.1s0.5,0,0.7-0.1L24.9,18.8z"/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
<g>
|
| 26 |
+
<path class="st4" d="M48.2,65.9H16.6c-0.5,0-1-0.5-1-1V45.7c0-0.6,0.5-1,1-1h31.6c0.5,0,1,0.4,1,1v19.1
|
| 27 |
C49.2,65.4,48.8,65.9,48.2,65.9z"/>
|
| 28 |
<path class="st0" d="M35.9,53.3h-17c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h17c0.3,0,0.5,0.2,0.5,0.5S36.2,53.3,35.9,53.3z"/>
|
| 29 |
<path class="st0" d="M24.7,56.3h-5.8c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h5.8c0.3,0,0.5,0.2,0.5,0.5S25,56.3,24.7,56.3z"/>
|
| 30 |
<path class="st0" d="M35.9,56.3h-9.2c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h9.2c0.3,0,0.5,0.2,0.5,0.5S36.2,56.3,35.9,56.3z"/>
|
| 31 |
+
<path class="st0" d="M27.8,63.2h-7.3c-1.1,0-2.1-0.9-2.1-2.1l0,0c0-1.1,0.9-2.1,2.1-2.1h7.3c1.1,0,2.1,0.9,2.1,2.1l0,0
|
| 32 |
C29.9,62.3,28.9,63.2,27.8,63.2z"/>
|
| 33 |
<path class="st0" d="M43.7,53.3h-5.8c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h5.8c0.3,0,0.5,0.2,0.5,0.5S44,53.3,43.7,53.3z"/>
|
| 34 |
<path class="st0" d="M38.7,49.9H19.4c-0.6,0-1-0.5-1-1l0,0c0-0.6,0.5-1,1-1h19.2c0.6,0,1,0.5,1,1l0,0
|
framework/extensions/cookies-consent/static/images/type-2.svg
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
<?xml version="1.0" encoding="utf-8"?>
|
| 2 |
-
<!-- Generator: Adobe Illustrator 23.0.
|
| 3 |
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
| 4 |
viewBox="0 0 100 70" style="enable-background:new 0 0 100 70;" xml:space="preserve">
|
| 5 |
<style type="text/css">
|
|
@@ -12,35 +12,23 @@
|
|
| 12 |
<path class="st0" d="M13,73.5c-1.4,0-2.5-1.1-2.5-2.5V13c0-1.4,1.1-2.5,2.5-2.5h74c1.4,0,2.5,1.1,2.5,2.5v58c0,1.4-1.1,2.5-2.5,2.5
|
| 13 |
H13z"/>
|
| 14 |
<g>
|
| 15 |
-
<rect x="10.4" y="
|
| 16 |
-
<path class="st0" d="M32.3,
|
| 17 |
-
|
| 18 |
-
<path class="st0" d="
|
| 19 |
-
|
| 20 |
-
<path class="st0" d="
|
| 21 |
-
|
| 22 |
-
<path class="st0" d="M84.2,67.1h-7.3c-1.1,0-2.1-0.9-2.1-2.1v0c0-1.1,0.9-2.1,2.1-2.1h7.3c1.1,0,2.1,0.9,2.1,2.1v0
|
| 23 |
-
C86.3,66.2,85.4,67.1,84.2,67.1z"/>
|
| 24 |
-
<path class="st0" d="M40.1,67.5h-5.8c-0.3,0-0.5-0.2-0.5-0.5c0-0.3,0.2-0.5,0.5-0.5h5.8c0.3,0,0.5,0.2,0.5,0.5
|
| 25 |
-
C40.6,67.3,40.4,67.5,40.1,67.5z"/>
|
| 26 |
-
<path class="st0" d="M35.1,64H15.9c-0.6,0-1-0.5-1-1l0,0c0-0.6,0.5-1,1-1h19.2c0.6,0,1,0.5,1,1l0,0C36.1,63.6,35.7,64,35.1,64z"/>
|
| 27 |
</g>
|
| 28 |
-
<path class="st2" d="M11,
|
| 29 |
-
<path class="st1" d="M89.5,15h-79v-2c0-1.4,1.1-2.5,2.5-2.5h74c1.4,0,2.5,1.1,2.5,2.5V15z"/>
|
| 30 |
<path class="st3" d="M87,11c1.1,0,2,0.9,2,2v58c0,1.1-0.9,2-2,2H13c-1.1,0-2-0.9-2-2V13c0-1.1,0.9-2,2-2H87 M87,10H13
|
| 31 |
c-1.7,0-3,1.3-3,3v58c0,1.7,1.3,3,3,3h74c1.6,0,3-1.3,3-3V13C90,11.3,88.6,10,87,10z"/>
|
| 32 |
-
<path class="
|
| 33 |
-
|
| 34 |
-
c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h4c0.3,0,0.5,0.2,0.5,0.5S63.8,22.5,63.5,22.5z M22.4,20.5c0.5-0.9,1.4-1.4,2.4-1.4
|
| 41 |
-
c0.7,0,1.3,0.3,1.8,0.7c-0.1,0-0.3,0-0.4,0.1c-0.4,0.2-0.5,0.8,0,1.1c0.3,0.2,0.4,0.6,0.4,0.9s-0.7,1.5-0.7,1.5l-0.6-2.2V21
|
| 42 |
-
c0-0.1,0-0.1,0.1-0.2l0.1-0.1h0.3v-0.2H24v0.2h0.1c0.1,0,0.1,0.1,0.2,0.1c0.1,0.1,0.1,0.3,0.2,0.5l0.2,0.8l-0.5,1.2L23.6,21
|
| 43 |
-
c0,0,0-0.2,0.1-0.2l0.1-0.1v-0.2C23.8,20.5,22.4,20.5,22.4,20.5z M22.7,20.9c0,0-0.1-0.2-0.3-0.2h-0.1c-0.1,0.3-0.2,0.7-0.2,1.1
|
| 44 |
-
c0,1.1,0.7,2.1,1.7,2.5L22.7,20.9z M27.2,20.5c0.1,0.2,0,0.5-0.1,0.9c-0.3,0.9-0.9,2.4-1.2,3c1-0.4,1.6-1.4,1.6-2.5
|
| 45 |
-
C27.6,21.4,27.4,20.9,27.2,20.5 M24.9,22.8l-0.7,1.7c0.2,0,0.4,0.1,0.6,0.1s0.5,0,0.7-0.1L24.9,22.8z"/>
|
| 46 |
</svg>
|
| 1 |
<?xml version="1.0" encoding="utf-8"?>
|
| 2 |
+
<!-- Generator: Adobe Illustrator 23.0.4, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
| 3 |
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
| 4 |
viewBox="0 0 100 70" style="enable-background:new 0 0 100 70;" xml:space="preserve">
|
| 5 |
<style type="text/css">
|
| 12 |
<path class="st0" d="M13,73.5c-1.4,0-2.5-1.1-2.5-2.5V13c0-1.4,1.1-2.5,2.5-2.5h74c1.4,0,2.5,1.1,2.5,2.5v58c0,1.4-1.1,2.5-2.5,2.5
|
| 13 |
H13z"/>
|
| 14 |
<g>
|
| 15 |
+
<rect x="10.4" y="57.2" class="st1" width="79.1" height="13"/>
|
| 16 |
+
<path class="st0" d="M32.3,66.5h-17c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h17c0.3,0,0.5,0.2,0.5,0.5S32.6,66.5,32.3,66.5z"/>
|
| 17 |
+
<path class="st0" d="M43.9,66.5h-9.2c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h9.2c0.3,0,0.5,0.2,0.5,0.5S44.2,66.5,43.9,66.5z"/>
|
| 18 |
+
<path class="st0" d="M84.2,66.1h-7.3c-1.1,0-2.1-0.9-2.1-2.1l0,0c0-1.1,0.9-2.1,2.1-2.1h7.3c1.1,0,2.1,0.9,2.1,2.1l0,0
|
| 19 |
+
C86.3,65.2,85.4,66.1,84.2,66.1z"/>
|
| 20 |
+
<path class="st0" d="M51.9,66.5h-5.8c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h5.8c0.3,0,0.5,0.2,0.5,0.5S52.2,66.5,51.9,66.5z"/>
|
| 21 |
+
<path class="st0" d="M35.1,63H15.9c-0.6,0-1-0.5-1-1l0,0c0-0.6,0.5-1,1-1h19.2c0.6,0,1,0.5,1,1l0,0C36.1,62.6,35.7,63,35.1,63z"/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
</g>
|
| 23 |
+
<path class="st2" d="M11,11h78v14H11V11z"/>
|
|
|
|
| 24 |
<path class="st3" d="M87,11c1.1,0,2,0.9,2,2v58c0,1.1-0.9,2-2,2H13c-1.1,0-2-0.9-2-2V13c0-1.1,0.9-2,2-2H87 M87,10H13
|
| 25 |
c-1.7,0-3,1.3-3,3v58c0,1.7,1.3,3,3,3h74c1.6,0,3-1.3,3-3V13C90,11.3,88.6,10,87,10z"/>
|
| 26 |
+
<path class="st4" d="M77.5,18.5h-4c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h4c0.3,0,0.5,0.2,0.5,0.5S77.8,18.5,77.5,18.5z
|
| 27 |
+
M70.5,18.5h-4c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h4c0.3,0,0.5,0.2,0.5,0.5S70.8,18.5,70.5,18.5z M63.5,18.5h-4
|
| 28 |
+
c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h4c0.3,0,0.5,0.2,0.5,0.5S63.8,18.5,63.5,18.5z M22.4,16.5c0.5-0.9,1.4-1.4,2.4-1.4
|
| 29 |
+
c0.7,0,1.3,0.3,1.8,0.7c-0.1,0-0.3,0-0.4,0.1c-0.4,0.2-0.5,0.8,0,1.1c0.3,0.2,0.4,0.6,0.4,0.9s-0.7,1.5-0.7,1.5l-0.6-2.2V17
|
| 30 |
+
c0-0.1,0-0.1,0.1-0.2l0.1-0.1h0.3v-0.2H24v0.2h0.1c0.1,0,0.1,0.1,0.2,0.1c0.1,0.1,0.1,0.3,0.2,0.5l0.2,0.8l-0.5,1.2L23.6,17
|
| 31 |
+
c0,0,0-0.2,0.1-0.2l0.1-0.1v-0.2C23.8,16.5,22.4,16.5,22.4,16.5z M22.7,16.9c0,0-0.1-0.2-0.3-0.2h-0.1c-0.1,0.3-0.2,0.7-0.2,1.1
|
| 32 |
+
c0,1.1,0.7,2.1,1.7,2.5L22.7,16.9z M27.2,16.5c0.1,0.2,0,0.5-0.1,0.9c-0.3,0.9-0.9,2.4-1.2,3c1-0.4,1.6-1.4,1.6-2.5
|
| 33 |
+
C27.6,17.4,27.4,16.9,27.2,16.5 M24.9,18.8l-0.7,1.7c0.2,0,0.4,0.1,0.6,0.1s0.5,0,0.7-0.1L24.9,18.8z"/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
</svg>
|
framework/extensions/cookies-consent/static/js/ct-events.js
ADDED
|
@@ -0,0 +1,270 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Listen and trigger custom events to communicate between javascript components
|
| 3 |
+
*/
|
| 4 |
+
window.ctEvents =
|
| 5 |
+
window.ctEvents ||
|
| 6 |
+
new (function () {
|
| 7 |
+
var _events = {}
|
| 8 |
+
var currentIndentation = 1
|
| 9 |
+
var debug = false
|
| 10 |
+
|
| 11 |
+
this.countAll = function (topic) {
|
| 12 |
+
return _events[topic]
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
/**
|
| 16 |
+
* Make log helper public
|
| 17 |
+
*
|
| 18 |
+
* @param {String} [message]
|
| 19 |
+
* @param {Object} [data]
|
| 20 |
+
*/
|
| 21 |
+
this.log = log
|
| 22 |
+
|
| 23 |
+
/**
|
| 24 |
+
* Enable/Disable Debug
|
| 25 |
+
* @param {Boolean} enabled
|
| 26 |
+
*/
|
| 27 |
+
this.debug = function (enabled) {
|
| 28 |
+
debug = Boolean(enabled)
|
| 29 |
+
|
| 30 |
+
return this
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
/**
|
| 34 |
+
* Add event listener
|
| 35 |
+
*
|
| 36 |
+
* @param event {String | Object}
|
| 37 |
+
* Can be a:
|
| 38 |
+
* - single event: 'event1'
|
| 39 |
+
* - space separated event list: 'event1 event2 event2'
|
| 40 |
+
* - an object: {event1: function () {}, event2: function () {}}
|
| 41 |
+
*
|
| 42 |
+
* @param callback {Function}
|
| 43 |
+
*/
|
| 44 |
+
this.on = function (topicStringOrObject, listener) {
|
| 45 |
+
objectMap(
|
| 46 |
+
splitTopicStringOrObject(topicStringOrObject, listener),
|
| 47 |
+
function (eventName, listener) {
|
| 48 |
+
;(_events[eventName] || (_events[eventName] = [])).push(
|
| 49 |
+
listener
|
| 50 |
+
)
|
| 51 |
+
|
| 52 |
+
debug && log('✚ ' + eventName)
|
| 53 |
+
}
|
| 54 |
+
)
|
| 55 |
+
|
| 56 |
+
return this
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
/**
|
| 60 |
+
* Same as .on(), but callback will executed only once
|
| 61 |
+
*/
|
| 62 |
+
this.one = function (topicStringOrObject, listener) {
|
| 63 |
+
objectMap(
|
| 64 |
+
splitTopicStringOrObject(topicStringOrObject, listener),
|
| 65 |
+
function (eventName, listener) {
|
| 66 |
+
;(_events[eventName] || (_events[eventName] = [])).push(
|
| 67 |
+
once(listener)
|
| 68 |
+
)
|
| 69 |
+
|
| 70 |
+
debug && log('✚ [' + eventName + ']')
|
| 71 |
+
}
|
| 72 |
+
)
|
| 73 |
+
|
| 74 |
+
return this
|
| 75 |
+
|
| 76 |
+
// https://github.com/jashkenas/underscore/blob/8fc7032295d60aff3620ef85d4aa6549a55688a0/underscore.js#L946
|
| 77 |
+
function once(func) {
|
| 78 |
+
var memo
|
| 79 |
+
|
| 80 |
+
var times = 2
|
| 81 |
+
|
| 82 |
+
return function () {
|
| 83 |
+
if (--times > 0) {
|
| 84 |
+
memo = func.apply(this, arguments)
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
if (times <= 1) func = null
|
| 88 |
+
|
| 89 |
+
return memo
|
| 90 |
+
}
|
| 91 |
+
}
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
/**
|
| 95 |
+
* In order to remove one single listener you should give as an argument
|
| 96 |
+
* the same callback function. If you want to remove *all* listeners from
|
| 97 |
+
* a particular event you should not pass the second argument.
|
| 98 |
+
*
|
| 99 |
+
* @param topicStringOrObject {String | Object}
|
| 100 |
+
* @param listener {Function | false}
|
| 101 |
+
*/
|
| 102 |
+
this.off = function (topicStringOrObject, listener) {
|
| 103 |
+
objectMap(
|
| 104 |
+
splitTopicStringOrObject(topicStringOrObject, listener),
|
| 105 |
+
function (eventName, listener) {
|
| 106 |
+
if (_events[eventName]) {
|
| 107 |
+
if (listener) {
|
| 108 |
+
_events[eventName].splice(
|
| 109 |
+
_events[eventName].indexOf(listener) >>> 0,
|
| 110 |
+
1
|
| 111 |
+
)
|
| 112 |
+
} else {
|
| 113 |
+
_events[eventName] = []
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
debug && log('✖ ' + eventName)
|
| 117 |
+
}
|
| 118 |
+
}
|
| 119 |
+
)
|
| 120 |
+
|
| 121 |
+
return this
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
/**
|
| 125 |
+
* Trigger an event. In case you provide multiple events via space-separated
|
| 126 |
+
* string or an object of events it will execute listeners for each event
|
| 127 |
+
* separatedly. You can use the "all" event to trigger all events.
|
| 128 |
+
*
|
| 129 |
+
* @param topicStringOrObject {String | Object}
|
| 130 |
+
* @param data {Object}
|
| 131 |
+
*/
|
| 132 |
+
this.trigger = function (eventName, data) {
|
| 133 |
+
objectMap(splitTopicStringOrObject(eventName), function (
|
| 134 |
+
eventName
|
| 135 |
+
) {
|
| 136 |
+
log('╭─ ' + eventName, data)
|
| 137 |
+
|
| 138 |
+
changeIndentation(+1)
|
| 139 |
+
|
| 140 |
+
try {
|
| 141 |
+
// TODO: REFACTOR THAT!!!!!!!!!
|
| 142 |
+
// Maybe this is an occasion for using 'all' event???
|
| 143 |
+
if (eventName === 'fw:options:init') {
|
| 144 |
+
fw.options.startListeningToEvents(
|
| 145 |
+
data.$elements || document.body
|
| 146 |
+
)
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
+
;(_events[eventName] || []).map(dispatchSingleEvent)
|
| 150 |
+
;(_events['all'] || []).map(dispatchSingleEvent)
|
| 151 |
+
} catch (e) {
|
| 152 |
+
console.log(
|
| 153 |
+
'%c [Events] Exception raised.',
|
| 154 |
+
'color: red; font-weight: bold;'
|
| 155 |
+
)
|
| 156 |
+
|
| 157 |
+
if (typeof console !== 'undefined') {
|
| 158 |
+
console.error(e)
|
| 159 |
+
} else {
|
| 160 |
+
throw e
|
| 161 |
+
}
|
| 162 |
+
}
|
| 163 |
+
|
| 164 |
+
changeIndentation(-1)
|
| 165 |
+
|
| 166 |
+
log('╰─ ' + eventName, data)
|
| 167 |
+
|
| 168 |
+
function dispatchSingleEvent(listenerDescriptor) {
|
| 169 |
+
if (!listenerDescriptor) return
|
| 170 |
+
|
| 171 |
+
listenerDescriptor.call(window, data)
|
| 172 |
+
}
|
| 173 |
+
})
|
| 174 |
+
|
| 175 |
+
return this
|
| 176 |
+
|
| 177 |
+
function changeIndentation(increment) {
|
| 178 |
+
if (typeof increment != 'undefined') {
|
| 179 |
+
currentIndentation += increment > 0 ? +1 : -1
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
if (currentIndentation < 0) {
|
| 183 |
+
currentIndentation = 0
|
| 184 |
+
}
|
| 185 |
+
}
|
| 186 |
+
}
|
| 187 |
+
|
| 188 |
+
/**
|
| 189 |
+
* Check if an event has listeners
|
| 190 |
+
* @param {String} [event]
|
| 191 |
+
* @return {Boolean}
|
| 192 |
+
*/
|
| 193 |
+
this.hasListeners = function (eventName) {
|
| 194 |
+
if (!_events) {
|
| 195 |
+
return false
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
return (_events[eventName] || []).length > 0
|
| 199 |
+
}
|
| 200 |
+
|
| 201 |
+
/**
|
| 202 |
+
* Probably split string into general purpose object representation for
|
| 203 |
+
* event names and listeners. This function leaves objects un-modified.
|
| 204 |
+
*
|
| 205 |
+
* @param topicStringOrObject {String | Object}
|
| 206 |
+
* @param listener {Function | false}
|
| 207 |
+
*
|
| 208 |
+
* @returns {Object} {
|
| 209 |
+
* eventname: listener,
|
| 210 |
+
* otherevent: listener
|
| 211 |
+
* }
|
| 212 |
+
*/
|
| 213 |
+
function splitTopicStringOrObject(topicStringOrObject, listener) {
|
| 214 |
+
if (typeof topicStringOrObject !== 'string') {
|
| 215 |
+
return topicStringOrObject
|
| 216 |
+
}
|
| 217 |
+
|
| 218 |
+
var arrayOfEvents = topicStringOrObject
|
| 219 |
+
.replace(/\s\s+/g, ' ')
|
| 220 |
+
.trim()
|
| 221 |
+
.split(' ')
|
| 222 |
+
|
| 223 |
+
var len = arrayOfEvents.length
|
| 224 |
+
|
| 225 |
+
var listenerDescriptor = Object.create(null)
|
| 226 |
+
|
| 227 |
+
for (var i = 0; i < len; i++) {
|
| 228 |
+
listenerDescriptor[arrayOfEvents[i]] = listener
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
+
return listenerDescriptor
|
| 232 |
+
}
|
| 233 |
+
|
| 234 |
+
/**
|
| 235 |
+
* returns a new object with the predicate applied to each value
|
| 236 |
+
* objectMap({a: 3, b: 5, c: 9}, (key, value) => value + 1); // {a: 4, b: 6, c: 10}
|
| 237 |
+
* objectMap({a: 3, b: 5, c: 9}, (key, value) => key); // {a: 'a', b: 'b', c: 'c'}
|
| 238 |
+
* objectMap({a: 3, b: 5, c: 9}, (key, value) => key + value); // {a: 'a3', b: 'b5', c: 'c9'}
|
| 239 |
+
*
|
| 240 |
+
* https://github.com/angus-c/just/tree/master/packages/object-map
|
| 241 |
+
*/
|
| 242 |
+
function objectMap(obj, predicate) {
|
| 243 |
+
var result = {}
|
| 244 |
+
var keys = Object.keys(obj)
|
| 245 |
+
var len = keys.length
|
| 246 |
+
|
| 247 |
+
for (var i = 0; i < len; i++) {
|
| 248 |
+
var key = keys[i]
|
| 249 |
+
result[key] = predicate(key, obj[key])
|
| 250 |
+
}
|
| 251 |
+
|
| 252 |
+
return result
|
| 253 |
+
}
|
| 254 |
+
|
| 255 |
+
function log(message, data) {
|
| 256 |
+
if (!debug) {
|
| 257 |
+
return
|
| 258 |
+
}
|
| 259 |
+
|
| 260 |
+
if (typeof data != 'undefined') {
|
| 261 |
+
console.log('[Event] ' + getIndentation() + message, '─', data)
|
| 262 |
+
} else {
|
| 263 |
+
console.log('[Event] ' + getIndentation() + message)
|
| 264 |
+
}
|
| 265 |
+
|
| 266 |
+
function getIndentation() {
|
| 267 |
+
return new Array(currentIndentation).join('│ ')
|
| 268 |
+
}
|
| 269 |
+
}
|
| 270 |
+
})()
|
framework/extensions/cookies-consent/static/js/helpers.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export const onDocumentLoaded = cb => {
|
| 2 |
+
if (/comp|inter|loaded/.test(document.readyState)) {
|
| 3 |
+
cb()
|
| 4 |
+
} else {
|
| 5 |
+
document.addEventListener('DOMContentLoaded', cb, false)
|
| 6 |
+
}
|
| 7 |
+
}
|
framework/extensions/cookies-consent/static/js/lazy-load-helpers.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export const markImagesAsLoaded = el =>
|
| 2 |
+
[...el.querySelectorAll('.ct-image-container.ct-lazy')].map(el => {
|
| 3 |
+
if (el.querySelector('img')) {
|
| 4 |
+
el.querySelector('img').setAttribute(
|
| 5 |
+
'src',
|
| 6 |
+
el.querySelector('img').dataset.ctLazy
|
| 7 |
+
)
|
| 8 |
+
|
| 9 |
+
if (el.querySelector('img').dataset.ctLazySet) {
|
| 10 |
+
el.querySelector('img').setAttribute(
|
| 11 |
+
'srcset',
|
| 12 |
+
el.querySelector('img').dataset.ctLazySet
|
| 13 |
+
)
|
| 14 |
+
}
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
el.classList.remove('ct-lazy')
|
| 18 |
+
el.classList.add('ct-lazy-loaded')
|
| 19 |
+
})
|
| 20 |
+
|
framework/extensions/cookies-consent/static/js/main.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import ctEvents from 'ct-events'
|
| 2 |
import cookie from 'js-cookie'
|
|
|
|
| 3 |
|
| 4 |
const initCookies = () => {
|
| 5 |
const notification = document.querySelector('.cookie-notification')
|
|
@@ -52,10 +53,10 @@ const initCookies = () => {
|
|
| 52 |
})
|
| 53 |
}
|
| 54 |
|
| 55 |
-
|
| 56 |
initCookies()
|
| 57 |
|
| 58 |
-
|
| 59 |
initCookies()
|
| 60 |
})
|
| 61 |
})
|
| 1 |
import ctEvents from 'ct-events'
|
| 2 |
import cookie from 'js-cookie'
|
| 3 |
+
import { onDocumentLoaded } from './helpers'
|
| 4 |
|
| 5 |
const initCookies = () => {
|
| 6 |
const notification = document.querySelector('.cookie-notification')
|
| 53 |
})
|
| 54 |
}
|
| 55 |
|
| 56 |
+
onDocumentLoaded(() => {
|
| 57 |
initCookies()
|
| 58 |
|
| 59 |
+
ctEvents.on('blocksy:cookies:init', () => {
|
| 60 |
initCookies()
|
| 61 |
})
|
| 62 |
})
|
framework/extensions/cookies-consent/static/js/sync.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import './variables'
|
|
|
|
| 2 |
|
| 3 |
-
import { renderWithStrategy } from '
|
| 4 |
|
| 5 |
const maybeAnimateCookiesConsent = cb => {
|
| 6 |
if (document.querySelector('.cookie-notification')) return
|
|
@@ -23,9 +24,11 @@ const render = () => {
|
|
| 23 |
return
|
| 24 |
}
|
| 25 |
|
| 26 |
-
notification.querySelector('
|
| 27 |
-
|
| 28 |
-
|
|
|
|
|
|
|
| 29 |
|
| 30 |
notification.querySelector('button.ct-accept').innerHTML = wp.customize(
|
| 31 |
'cookie_consent_button_text'
|
|
@@ -41,7 +44,7 @@ const render = () => {
|
|
| 41 |
)
|
| 42 |
|
| 43 |
if (didInsert) {
|
| 44 |
-
setTimeout(() =>
|
| 45 |
}
|
| 46 |
}
|
| 47 |
|
|
@@ -52,3 +55,11 @@ wp.customize('cookie_consent_content', val =>
|
|
| 52 |
)
|
| 53 |
wp.customize('cookie_consent_button_text', val => val.bind(to => render()))
|
| 54 |
wp.customize('cookie_consent_type', val => val.bind(to => render()))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import './variables'
|
| 2 |
+
import ctEvents from 'ct-events'
|
| 3 |
|
| 4 |
+
import { renderWithStrategy } from './sync/helpers'
|
| 5 |
|
| 6 |
const maybeAnimateCookiesConsent = cb => {
|
| 7 |
if (document.querySelector('.cookie-notification')) return
|
| 24 |
return
|
| 25 |
}
|
| 26 |
|
| 27 |
+
if (notification.querySelector('.ct-cookies-content')) {
|
| 28 |
+
notification.querySelector(
|
| 29 |
+
'.ct-cookies-content'
|
| 30 |
+
).innerHTML = wp.customize('cookie_consent_content')()
|
| 31 |
+
}
|
| 32 |
|
| 33 |
notification.querySelector('button.ct-accept').innerHTML = wp.customize(
|
| 34 |
'cookie_consent_button_text'
|
| 44 |
)
|
| 45 |
|
| 46 |
if (didInsert) {
|
| 47 |
+
setTimeout(() => ctEvents.trigger('blocksy:cookies:init'))
|
| 48 |
}
|
| 49 |
}
|
| 50 |
|
| 55 |
)
|
| 56 |
wp.customize('cookie_consent_button_text', val => val.bind(to => render()))
|
| 57 |
wp.customize('cookie_consent_type', val => val.bind(to => render()))
|
| 58 |
+
|
| 59 |
+
wp.customize('forms_cookie_consent_content', val =>
|
| 60 |
+
val.bind(to =>
|
| 61 |
+
[...document.querySelectorAll('.gdpr-confirm-policy label')].map(
|
| 62 |
+
el => (el.innerHTML = to)
|
| 63 |
+
)
|
| 64 |
+
)
|
| 65 |
+
)
|
framework/extensions/cookies-consent/static/js/sync/helpers.js
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export const getCache = () => {
|
| 2 |
+
const div = document.createElement('div')
|
| 3 |
+
|
| 4 |
+
div.innerHTML = document.querySelector(
|
| 5 |
+
'.ct-customizer-preview-cache-container'
|
| 6 |
+
).value
|
| 7 |
+
|
| 8 |
+
return div
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
export const getFreshHtmlFor = (id, cache = null, attr = 'id') => {
|
| 12 |
+
if (!cache) {
|
| 13 |
+
cache = getCache()
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
if (
|
| 17 |
+
!cache.querySelector(
|
| 18 |
+
`.ct-customizer-preview-cache [data-${attr}="${id}"]`
|
| 19 |
+
)
|
| 20 |
+
) {
|
| 21 |
+
return
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
const newHtml = cache.querySelector(
|
| 25 |
+
`.ct-customizer-preview-cache [data-${attr}="${id}"]`
|
| 26 |
+
).innerHTML
|
| 27 |
+
|
| 28 |
+
const e = document.createElement('div')
|
| 29 |
+
e.innerHTML = newHtml
|
| 30 |
+
|
| 31 |
+
return e
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
export const renderWithStrategy = (args = {}) => {
|
| 35 |
+
args = {
|
| 36 |
+
fragment_id: null,
|
| 37 |
+
|
| 38 |
+
selector: null,
|
| 39 |
+
parent_selector: null,
|
| 40 |
+
|
| 41 |
+
// append | firstChild | maybeBefore:selector
|
| 42 |
+
strategy: 'append',
|
| 43 |
+
whenInserted: () => {},
|
| 44 |
+
beforeInsert: el => {},
|
| 45 |
+
|
| 46 |
+
should_insert: true,
|
| 47 |
+
|
| 48 |
+
...args
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
const parent = document.querySelector(args.parent_selector)
|
| 52 |
+
;[
|
| 53 |
+
...document.querySelectorAll(`${args.parent_selector} ${args.selector}`)
|
| 54 |
+
].map(el => el.parentNode.removeChild(el))
|
| 55 |
+
|
| 56 |
+
if (!args.should_insert) return
|
| 57 |
+
|
| 58 |
+
const el = getFreshHtmlFor(args.fragment_id)
|
| 59 |
+
|
| 60 |
+
if (!el) {
|
| 61 |
+
return
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
while (el.firstElementChild) {
|
| 65 |
+
args.beforeInsert(el.firstElementChild)
|
| 66 |
+
|
| 67 |
+
if (args.strategy === 'append') {
|
| 68 |
+
parent.appendChild(el.firstElementChild)
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
if (args.strategy === 'firstChild') {
|
| 72 |
+
parent.insertBefore(el.firstElementChild, parent.firstElementChild)
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
if (args.strategy.indexOf('maybeBefore') > -1) {
|
| 76 |
+
const [_, selector] = args.strategy.split(':')
|
| 77 |
+
|
| 78 |
+
if (parent.querySelector(selector)) {
|
| 79 |
+
parent.insertBefore(
|
| 80 |
+
el.firstElementChild,
|
| 81 |
+
parent.querySelector(selector)
|
| 82 |
+
)
|
| 83 |
+
} else {
|
| 84 |
+
parent.appendChild(el.firstElementChild)
|
| 85 |
+
}
|
| 86 |
+
}
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
args.whenInserted()
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
export const checkAndReplace = (args = {}) => {
|
| 93 |
+
args = {
|
| 94 |
+
id: null,
|
| 95 |
+
|
| 96 |
+
fragment_id: null,
|
| 97 |
+
|
| 98 |
+
selector: null,
|
| 99 |
+
parent_selector: null,
|
| 100 |
+
|
| 101 |
+
// append | firstChild | maybeBefore:selector
|
| 102 |
+
strategy: 'append',
|
| 103 |
+
whenInserted: () => {},
|
| 104 |
+
beforeInsert: el => {},
|
| 105 |
+
watch: [],
|
| 106 |
+
|
| 107 |
+
...args
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
const render = () => {
|
| 111 |
+
const to = wp.customize(args.id)()
|
| 112 |
+
|
| 113 |
+
renderWithStrategy({
|
| 114 |
+
...args,
|
| 115 |
+
should_insert: to === 'yes'
|
| 116 |
+
})
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
wp.customize(args.id, val => val.bind(to => render()))
|
| 120 |
+
args.watch.map(opt => wp.customize(opt, val => val.bind(() => render())))
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
export const responsiveClassesFor = (id, el) => {
|
| 124 |
+
el.classList.remove('ct-hidden-sm', 'ct-hidden-md', 'ct-hidden-lg')
|
| 125 |
+
|
| 126 |
+
if (!wp.customize(id)) return
|
| 127 |
+
|
| 128 |
+
const data = wp.customize(id)() || {
|
| 129 |
+
mobile: false,
|
| 130 |
+
tablet: true,
|
| 131 |
+
desktop: true
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
+
if (!data.mobile) {
|
| 135 |
+
el.classList.add('ct-hidden-sm')
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
if (!data.tablet) {
|
| 139 |
+
el.classList.add('ct-hidden-md')
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
if (!data.desktop) {
|
| 143 |
+
el.classList.add('ct-hidden-lg')
|
| 144 |
+
}
|
| 145 |
+
}
|
framework/extensions/cookies-consent/static/js/variables.js
CHANGED
|
@@ -1,14 +1,23 @@
|
|
| 1 |
import { handleVariablesFor } from 'customizer-sync-helpers'
|
| 2 |
|
| 3 |
handleVariablesFor({
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
cookieBackground: {
|
| 11 |
-
|
|
|
|
| 12 |
type: 'color'
|
| 13 |
},
|
| 14 |
|
|
@@ -27,7 +36,8 @@ handleVariablesFor({
|
|
| 27 |
],
|
| 28 |
|
| 29 |
cookieMaxWidth: {
|
| 30 |
-
|
|
|
|
| 31 |
unit: 'px'
|
| 32 |
}
|
| 33 |
})
|
| 1 |
import { handleVariablesFor } from 'customizer-sync-helpers'
|
| 2 |
|
| 3 |
handleVariablesFor({
|
| 4 |
+
cookieContentColor: [
|
| 5 |
+
{
|
| 6 |
+
selector: '.cookie-notification',
|
| 7 |
+
variable: 'color',
|
| 8 |
+
type: 'color:default'
|
| 9 |
+
},
|
| 10 |
+
|
| 11 |
+
{
|
| 12 |
+
selector: '.cookie-notification',
|
| 13 |
+
variable: 'colorHover',
|
| 14 |
+
type: 'color:hover'
|
| 15 |
+
}
|
| 16 |
+
],
|
| 17 |
|
| 18 |
cookieBackground: {
|
| 19 |
+
selector: '.cookie-notification',
|
| 20 |
+
variable: 'backgroundColor',
|
| 21 |
type: 'color'
|
| 22 |
},
|
| 23 |
|
| 36 |
],
|
| 37 |
|
| 38 |
cookieMaxWidth: {
|
| 39 |
+
selector: '.cookie-notification',
|
| 40 |
+
variable: 'maxWidth',
|
| 41 |
unit: 'px'
|
| 42 |
}
|
| 43 |
})
|
framework/extensions/cookies-consent/static/sass/main.scss
CHANGED
|
@@ -5,7 +5,11 @@
|
|
| 5 |
left: 0;
|
| 6 |
bottom: 0;
|
| 7 |
z-index: 999999;
|
| 8 |
-
color: var(--
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
@include media-breakpoint-down (xs) {
|
| 11 |
> div {
|
|
@@ -24,16 +28,17 @@
|
|
| 24 |
}
|
| 25 |
}
|
| 26 |
|
|
|
|
| 27 |
// type 1
|
| 28 |
&[data-type='type-1'] {
|
| 29 |
@include media-breakpoint-down (sm) {
|
| 30 |
-
background: var(--
|
| 31 |
}
|
| 32 |
|
| 33 |
@include media-breakpoint-up (md) {
|
| 34 |
padding: 0 25px 25px 25px;
|
| 35 |
|
| 36 |
-
|
| 37 |
margin-bottom: 15px;
|
| 38 |
max-width: 90%;
|
| 39 |
}
|
|
@@ -48,19 +53,20 @@
|
|
| 48 |
}
|
| 49 |
|
| 50 |
@include media-breakpoint-up (md) {
|
| 51 |
-
background: var(--
|
| 52 |
-
box-shadow: 0px
|
| 53 |
padding: 25px 40px 25px 25px;
|
| 54 |
border-radius: 3px;
|
| 55 |
-
max-width: var(--
|
| 56 |
}
|
| 57 |
}
|
| 58 |
}
|
| 59 |
|
|
|
|
| 60 |
// type 2
|
| 61 |
&[data-type='type-2'] {
|
| 62 |
right: 0;
|
| 63 |
-
background: var(--
|
| 64 |
|
| 65 |
@include media-breakpoint-up (md) {
|
| 66 |
padding: 15px 0;
|
|
@@ -81,10 +87,15 @@
|
|
| 81 |
}
|
| 82 |
}
|
| 83 |
|
| 84 |
-
|
| 85 |
-
|
| 86 |
line-height: 1.4;
|
| 87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
@include media-breakpoint-down (xs) {
|
| 89 |
text-align: center;
|
| 90 |
margin-bottom: 15px;
|
|
@@ -100,15 +111,11 @@
|
|
| 100 |
}
|
| 101 |
|
| 102 |
.ct-accept {
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
padding: 20px,
|
| 109 |
-
shadow: false,
|
| 110 |
-
translate: false
|
| 111 |
-
));
|
| 112 |
|
| 113 |
@include media-breakpoint-down (xs) {
|
| 114 |
width: 100%;
|
|
@@ -120,26 +127,18 @@
|
|
| 120 |
}
|
| 121 |
|
| 122 |
.ct-close {
|
| 123 |
-
position: absolute;
|
| 124 |
-
top: 0;
|
| 125 |
-
right: 0;
|
| 126 |
-
border: 0;
|
| 127 |
display: flex;
|
| 128 |
align-items: center;
|
| 129 |
justify-content: center;
|
| 130 |
width: 45px;
|
| 131 |
height: 45px;
|
| 132 |
-
|
|
|
|
|
|
|
| 133 |
opacity: 0.5;
|
| 134 |
color: inherit;
|
| 135 |
cursor: pointer;
|
| 136 |
-
appearance: none;
|
| 137 |
background: transparent;
|
| 138 |
-
transition: opacity 0.2s ease;
|
| 139 |
-
|
| 140 |
-
&:focus {
|
| 141 |
-
outline: none;
|
| 142 |
-
}
|
| 143 |
|
| 144 |
&:hover {
|
| 145 |
opacity: 1;
|
| 5 |
left: 0;
|
| 6 |
bottom: 0;
|
| 7 |
z-index: 999999;
|
| 8 |
+
color: var(--color);
|
| 9 |
+
|
| 10 |
+
a:hover {
|
| 11 |
+
color: var(--colorHover);
|
| 12 |
+
}
|
| 13 |
|
| 14 |
@include media-breakpoint-down (xs) {
|
| 15 |
> div {
|
| 28 |
}
|
| 29 |
}
|
| 30 |
|
| 31 |
+
|
| 32 |
// type 1
|
| 33 |
&[data-type='type-1'] {
|
| 34 |
@include media-breakpoint-down (sm) {
|
| 35 |
+
background: var(--backgroundColor);
|
| 36 |
}
|
| 37 |
|
| 38 |
@include media-breakpoint-up (md) {
|
| 39 |
padding: 0 25px 25px 25px;
|
| 40 |
|
| 41 |
+
.ct-cookies-content {
|
| 42 |
margin-bottom: 15px;
|
| 43 |
max-width: 90%;
|
| 44 |
}
|
| 53 |
}
|
| 54 |
|
| 55 |
@include media-breakpoint-up (md) {
|
| 56 |
+
background: var(--backgroundColor);
|
| 57 |
+
box-shadow: 0px 5px 30px -5px rgba(34, 56, 101, 0.15);
|
| 58 |
padding: 25px 40px 25px 25px;
|
| 59 |
border-radius: 3px;
|
| 60 |
+
max-width: var(--maxWidth);
|
| 61 |
}
|
| 62 |
}
|
| 63 |
}
|
| 64 |
|
| 65 |
+
|
| 66 |
// type 2
|
| 67 |
&[data-type='type-2'] {
|
| 68 |
right: 0;
|
| 69 |
+
background: var(--backgroundColor);
|
| 70 |
|
| 71 |
@include media-breakpoint-up (md) {
|
| 72 |
padding: 15px 0;
|
| 87 |
}
|
| 88 |
}
|
| 89 |
|
| 90 |
+
|
| 91 |
+
.ct-cookies-content {
|
| 92 |
line-height: 1.4;
|
| 93 |
|
| 94 |
+
a {
|
| 95 |
+
text-decoration: underline;
|
| 96 |
+
color: var(--colorHover);
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
@include media-breakpoint-down (xs) {
|
| 100 |
text-align: center;
|
| 101 |
margin-bottom: 15px;
|
| 111 |
}
|
| 112 |
|
| 113 |
.ct-accept {
|
| 114 |
+
--buttonFontSize: 13px;
|
| 115 |
+
--buttonMinHeight: 35px;
|
| 116 |
+
--padding: 0 20px;
|
| 117 |
+
--buttonShadow: none;
|
| 118 |
+
--buttonTransform: none;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
|
| 120 |
@include media-breakpoint-down (xs) {
|
| 121 |
width: 100%;
|
| 127 |
}
|
| 128 |
|
| 129 |
.ct-close {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
display: flex;
|
| 131 |
align-items: center;
|
| 132 |
justify-content: center;
|
| 133 |
width: 45px;
|
| 134 |
height: 45px;
|
| 135 |
+
position: absolute;
|
| 136 |
+
top: 0;
|
| 137 |
+
right: 0;
|
| 138 |
opacity: 0.5;
|
| 139 |
color: inherit;
|
| 140 |
cursor: pointer;
|
|
|
|
| 141 |
background: transparent;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
|
| 143 |
&:hover {
|
| 144 |
opacity: 1;
|
framework/extensions/mailchimp/admin-static/bundle/1.2c9ebf0a36c6c732fee6.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
(window.blocksyMailchimpExtJsonp=window.blocksyMailchimpExtJsonp||[]).push([[1],[,,,,,,function(e,t,n){var o;
|
| 2 |
+
/*!
|
| 3 |
+
Copyright (c) 2017 Jed Watson.
|
| 4 |
+
Licensed under the MIT License (MIT), see
|
| 5 |
+
http://jedwatson.github.io/classnames
|
| 6 |
+
*/!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var i=typeof o;if("string"===i||"number"===i)e.push(o);else if(Array.isArray(o)&&o.length){var s=r.apply(null,o);s&&e.push(s)}else if("object"===i)for(var u in o)n.call(o,u)&&o[u]&&e.push(u)}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(o=function(){return r}.apply(t,[]))||(e.exports=o)}()},function(e,t,n){e.exports=n(8)()},function(e,t,n){"use strict";var o=n(9);function r(){}function i(){}i.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,i,s){if(s!==o){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";e.exports=n(11)},function(e,t,n){"use strict";
|
| 7 |
+
/** @license React v16.13.1
|
| 8 |
+
* react-is.production.min.js
|
| 9 |
+
*
|
| 10 |
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
| 11 |
+
*
|
| 12 |
+
* This source code is licensed under the MIT license found in the
|
| 13 |
+
* LICENSE file in the root directory of this source tree.
|
| 14 |
+
*/var o="function"==typeof Symbol&&Symbol.for,r=o?Symbol.for("react.element"):60103,i=o?Symbol.for("react.portal"):60106,s=o?Symbol.for("react.fragment"):60107,u=o?Symbol.for("react.strict_mode"):60108,a=o?Symbol.for("react.profiler"):60114,l=o?Symbol.for("react.provider"):60109,p=o?Symbol.for("react.context"):60110,d=o?Symbol.for("react.async_mode"):60111,c=o?Symbol.for("react.concurrent_mode"):60111,h=o?Symbol.for("react.forward_ref"):60112,f=o?Symbol.for("react.suspense"):60113,g=o?Symbol.for("react.suspense_list"):60120,m=o?Symbol.for("react.memo"):60115,v=o?Symbol.for("react.lazy"):60116,y=o?Symbol.for("react.block"):60121,I=o?Symbol.for("react.fundamental"):60117,S=o?Symbol.for("react.responder"):60118,b=o?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case d:case c:case s:case a:case u:case f:return e;default:switch(e=e&&e.$$typeof){case p:case h:case v:case m:case l:return e;default:return t}}case i:return t}}}function x(e){return w(e)===c}t.AsyncMode=d,t.ConcurrentMode=c,t.ContextConsumer=p,t.ContextProvider=l,t.Element=r,t.ForwardRef=h,t.Fragment=s,t.Lazy=v,t.Memo=m,t.Portal=i,t.Profiler=a,t.StrictMode=u,t.Suspense=f,t.isAsyncMode=function(e){return x(e)||w(e)===d},t.isConcurrentMode=x,t.isContextConsumer=function(e){return w(e)===p},t.isContextProvider=function(e){return w(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===h},t.isFragment=function(e){return w(e)===s},t.isLazy=function(e){return w(e)===v},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===i},t.isProfiler=function(e){return w(e)===a},t.isStrictMode=function(e){return w(e)===u},t.isSuspense=function(e){return w(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===s||e===c||e===a||e===u||e===f||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===m||e.$$typeof===l||e.$$typeof===p||e.$$typeof===h||e.$$typeof===I||e.$$typeof===S||e.$$typeof===b||e.$$typeof===y)},t.typeOf=w},function(e,t,n){"use strict";function o(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}function r(){return(r=Object.assign||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}).apply(this,arguments)}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var s=n(7),u=n.n(s),a=n(1);n(10);function l(e){return null!=e&&"object"==typeof e&&1===e.nodeType}function p(e,t){return(!t||"hidden"!==e)&&("visible"!==e&&"clip"!==e)}function d(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var n=getComputedStyle(e,null);return p(n.overflowY,t)||p(n.overflowX,t)||function(e){var t=function(e){return e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView.frameElement:null}(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)}(e)}return!1}function c(e,t,n,o,r,i,s,u){return i<e&&s>t||i>e&&s<t?0:i<=e&&u<=n||s>=t&&u>=n?i-e-o:s>t&&u<n||i<e&&u>n?s-t+r:0}var h=0;function f(e){return"function"==typeof e?e:g}function g(){}function m(e,t){null!==e&&function(e,t){var n=t.scrollMode,o=t.block,r=t.inline,i=t.boundary,s=t.skipOverflowHiddenElements,u="function"==typeof i?i:function(e){return e!==i};if(!l(e))throw new TypeError("Invalid target");for(var a=document.scrollingElement||document.documentElement,p=[],h=e;l(h)&&u(h);){if((h=h.parentNode)===a){p.push(h);break}h===document.body&&d(h)&&!d(document.documentElement)||d(h,s)&&p.push(h)}for(var f=window.visualViewport?visualViewport.width:innerWidth,g=window.visualViewport?visualViewport.height:innerHeight,m=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,y=e.getBoundingClientRect(),I=y.height,S=y.width,b=y.top,w=y.right,x=y.bottom,C=y.left,H="start"===o||"nearest"===o?b:"end"===o?x:b+I/2,O="center"===r?C+S/2:"end"===r?w:C,E=[],P=0;P<p.length;P++){var M=p[P],D=M.getBoundingClientRect(),T=D.height,k=D.width,R=D.top,A=D.right,V=D.bottom,K=D.left;if("if-needed"===n&&b>=0&&C>=0&&x<=g&&w<=f&&b>=R&&x<=V&&C>=K&&w<=A)return E;var _=getComputedStyle(M),L=parseInt(_.borderLeftWidth,10),$=parseInt(_.borderTopWidth,10),B=parseInt(_.borderRightWidth,10),j=parseInt(_.borderBottomWidth,10),W=0,U=0,N="offsetWidth"in M?M.offsetWidth-M.clientWidth-L-B:0,F="offsetHeight"in M?M.offsetHeight-M.clientHeight-$-j:0;if(a===M)W="start"===o?H:"end"===o?H-g:"nearest"===o?c(v,v+g,g,$,j,v+H,v+H+I,I):H-g/2,U="start"===r?O:"center"===r?O-f/2:"end"===r?O-f:c(m,m+f,f,L,B,m+O,m+O+S,S),W=Math.max(0,W+v),U=Math.max(0,U+m);else{W="start"===o?H-R-$:"end"===o?H-V+j+F:"nearest"===o?c(R,V,T,$,j+F,H,H+I,I):H-(R+T/2)+F/2,U="start"===r?O-K-L:"center"===r?O-(K+k/2)+N/2:"end"===r?O-A+B+N:c(K,A,k,L,B+N,O,O+S,S);var z=M.scrollLeft,Y=M.scrollTop;H+=Y-(W=Math.max(0,Math.min(Y+W,M.scrollHeight-T+F))),O+=z-(U=Math.max(0,Math.min(z+U,M.scrollWidth-k+N)))}E.push({el:M,top:W,left:U})}return E}(e,{boundary:t,block:"nearest",scrollMode:"if-needed"}).forEach((function(e){var t=e.el,n=e.top,o=e.left;t.scrollTop=n,t.scrollLeft=o}))}function v(e,t){return e===t||e.contains&&e.contains(t)}function y(e,t){var n;function o(){n&&clearTimeout(n)}function r(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];o(),n=setTimeout((function(){n=null,e.apply(void 0,i)}),t)}return r.cancel=o,r}function I(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return t.some((function(t){return t&&t.apply(void 0,[e].concat(o)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function S(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach((function(t){"function"==typeof t?t(e):t&&(t.current=e)}))}}function b(e){var t=e.isOpen,n=e.selectedItem,o=e.resultCount,r=e.previousResultCount,i=e.itemToString;return t?o?o!==r?o+" result"+(1===o?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":n?i(n):""}function w(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}function x(e){return"string"==typeof e.type}function C(e){return e.props}var H=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function O(e){void 0===e&&(e={});var t={};return H.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function E(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function P(e,t,n){var o=n-1;("number"!=typeof t||t<0||t>=n)&&(t=e>0?-1:o+1);var r=t+e;return r<0?r=o:r>o&&(r=0),r}var M=y((function(){T().textContent=""}),500);function D(e,t){var n=T(t);e&&(n.textContent=e,M())}function T(e){void 0===e&&(e=document);var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var k=Object.freeze({__proto__:null,unknown:0,mouseUp:1,itemMouseEnter:2,keyDownArrowUp:3,keyDownArrowDown:4,keyDownEscape:5,keyDownEnter:6,keyDownHome:7,keyDownEnd:8,clickItem:9,blurInput:10,changeInput:11,keyDownSpaceButton:12,clickButton:13,blurButton:14,controlledPropUpdatedSelectedItem:15,touchEnd:16}),R=function(){var e=function(e){var t,n;function s(t){var n=e.call(this,t)||this;n.id=n.props.id||"downshift-"+String(h++),n.menuId=n.props.menuId||n.id+"-menu",n.labelId=n.props.labelId||n.id+"-label",n.inputId=n.props.inputId||n.id+"-input",n.getItemId=n.props.getItemId||function(e){return n.id+"-item-"+e},n.input=null,n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var o=setTimeout((function(){n.timeoutIds=n.timeoutIds.filter((function(e){return e!==o})),e()}),t);n.timeoutIds.push(o)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=O(t),n.internalSetState(r({highlightedIndex:e},t))},n.clearSelection=function(e){n.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:n.props.defaultHighlightedIndex,isOpen:n.props.defaultIsOpen},e)},n.selectItem=function(e,t,o){t=O(t),n.internalSetState(r({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),o)},n.selectItemAtIndex=function(e,t,o){var r=n.items[e];null!=r&&n.selectItem(r,t,o)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var o,i,s={},u="function"==typeof e;return!u&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,r({},n.getStateAndHelpers(),{},e)),n.setState((function(t){t=n.getState(t);var a=u?e(t):e;a=n.props.stateReducer(t,a),o=a.hasOwnProperty("selectedItem");var l={},p={};return o&&a.selectedItem!==t.selectedItem&&(i=a.selectedItem),a.type=a.type||0,Object.keys(a).forEach((function(e){t[e]!==a[e]&&(s[e]=a[e]),"type"!==e&&(p[e]=a[e],n.isControlledProp(e)||(l[e]=a[e]))})),u&&a.hasOwnProperty("inputValue")&&n.props.onInputValueChange(a.inputValue,r({},n.getStateAndHelpers(),{},a)),l}),(function(){f(t)(),Object.keys(s).length>1&&n.props.onStateChange(s,n.getStateAndHelpers()),o&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==i&&n.props.onChange(i,n.getStateAndHelpers()),n.props.onUserAction(s,n.getStateAndHelpers())}))},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var i,s=void 0===e?{}:e,u=s.refKey,a=void 0===u?"ref":u,l=s.ref,p=o(s,["refKey","ref"]),d=(void 0===t?{}:t).suppressRefError,c=void 0!==d&&d;n.getRootProps.called=!0,n.getRootProps.refKey=a,n.getRootProps.suppressRefError=c;var h=n.getState().isOpen;return r(((i={})[a]=S(l,n.rootRef),i.role="combobox",i["aria-expanded"]=h,i["aria-haspopup"]="listbox",i["aria-owns"]=h?n.menuId:null,i["aria-labelledby"]=n.labelId,i),p)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:4})}else this.internalSetState({isOpen:!0,type:4},(function(){var e=t.getItemCount();e>0&&t.setHighlightedIndex(P(1,t.getState().highlightedIndex,e),{type:4})}))},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:3})}else this.internalSetState({isOpen:!0,type:3},(function(){var e=t.getItemCount();e>0&&t.setHighlightedIndex(P(-1,t.getState().highlightedIndex,e),{type:4})}))},Enter:function(e){var t=this.getState(),n=t.isOpen,o=t.highlightedIndex;if(n&&null!=o){e.preventDefault();var r=this.items[o],i=this.getItemNodeFromIndex(o);if(null==r||i&&i.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}},Escape:function(e){e.preventDefault(),this.reset({type:5,selectedItem:null,inputValue:""})}},n.buttonKeyDownHandlers=r({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=r({},n.keyDownHandlers,{Home:function(e){this.highlightFirstOrLastIndex(e,!0,{type:7})},End:function(e){this.highlightFirstOrLastIndex(e,!1,{type:8})}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,i=t.onClick,s=(t.onPress,t.onKeyDown),u=t.onKeyUp,a=t.onBlur,l=o(t,["onClick","onPress","onKeyDown","onKeyUp","onBlur"]),p=n.getState().isOpen,d={onClick:I(i,n.buttonHandleClick),onKeyDown:I(s,n.buttonHandleKeyDown),onKeyUp:I(u,n.buttonHandleKeyUp),onBlur:I(a,n.buttonHandleBlur)};return r({type:"button",role:"button","aria-label":p?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},l.disabled?{}:d,{},l)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=E(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(i(n),e)},n.buttonHandleClick=function(e){e.preventDefault(),n.props.environment.document.activeElement===n.props.environment.document.body&&e.target.focus(),n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){n.isMouseDown||null!=n.props.environment.document.activeElement&&n.props.environment.document.activeElement.id===n.inputId||n.props.environment.document.activeElement===t||n.reset({type:14})}))},n.getLabelProps=function(e){return r({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,i=t.onKeyDown,s=t.onBlur,u=t.onChange,a=t.onInput,l=(t.onChangeText,o(t,["onKeyDown","onBlur","onChange","onInput","onChangeText"])),p={};var d,c=n.getState(),h=c.inputValue,f=c.isOpen,g=c.highlightedIndex;l.disabled||((d={}).onChange=I(u,a,n.inputHandleChange),d.onKeyDown=I(i,n.inputHandleKeyDown),d.onBlur=I(s,n.inputHandleBlur),p=d);return r({"aria-autocomplete":"list","aria-activedescendant":f&&"number"==typeof g&&g>=0?n.getItemId(g):null,"aria-controls":f?n.menuId:null,"aria-labelledby":n.labelId,autoComplete:"off",value:h,id:n.inputId},p,{},l)},n.inputHandleKeyDown=function(e){var t=E(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(i(n),e)},n.inputHandleChange=function(e){n.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleBlur=function(){n.internalSetTimeout((function(){var e=n.props.environment.document&&!!n.props.environment.document.activeElement&&!!n.props.environment.document.activeElement.dataset&&n.props.environment.document.activeElement.dataset.toggle&&n._rootNode&&n._rootNode.contains(n.props.environment.document.activeElement);n.isMouseDown||e||n.reset({type:10})}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var i,s=void 0===e?{}:e,u=s.refKey,a=void 0===u?"ref":u,l=s.ref,p=o(s,["refKey","ref"]),d=(void 0===t?{}:t).suppressRefError,c=void 0!==d&&d;return n.getMenuProps.called=!0,n.getMenuProps.refKey=a,n.getMenuProps.suppressRefError=c,r(((i={})[a]=S(l,n.menuRef),i.role="listbox",i["aria-labelledby"]=p&&p["aria-label"]?null:n.labelId,i.id=n.menuId,i),p)},n.getItemProps=function(e){var t,i=void 0===e?{}:e,s=i.onMouseMove,u=i.onMouseDown,a=i.onClick,l=(i.onPress,i.index),p=i.item,d=void 0===p?void 0:p,c=o(i,["onMouseMove","onMouseDown","onClick","onPress","index","item"]);void 0===l?(n.items.push(d),l=n.items.indexOf(d)):n.items[l]=d;var h=a,f=((t={onMouseMove:I(s,(function(){l!==n.getState().highlightedIndex&&(n.setHighlightedIndex(l,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:I(u,(function(e){e.preventDefault()}))}).onClick=I(h,(function(){n.selectItemAtIndex(l,{type:9})})),t),g=c.disabled?{onMouseDown:f.onMouseDown}:f;return r({id:n.getItemId(l),role:"option","aria-selected":n.getState().highlightedIndex===l},g,{},c)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=O(e),n.internalSetState((function(t){var o=t.selectedItem;return r({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(o)},e)}),t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=O(e),n.internalSetState((function(t){var o=t.isOpen;return r({isOpen:!o},o&&{highlightedIndex:n.props.defaultHighlightedIndex},{},e)}),(function(){var o=n.getState(),r=o.isOpen,i=o.highlightedIndex;r&&n.getItemCount()>0&&"number"==typeof i&&n.setHighlightedIndex(i,e),f(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=y((function(){var e=n.getState(),t=n.items[e.highlightedIndex],o=n.getItemCount(),i=n.props.getA11yStatusMessage(r({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:o,highlightedItem:t},e));n.previousResultCount=o,D(i,n.props.environment.document)}),200);var s=n.props,u=s.defaultHighlightedIndex,a=s.initialHighlightedIndex,l=void 0===a?u:a,p=s.defaultIsOpen,d=s.initialIsOpen,c=void 0===d?p:d,g=s.initialInputValue,m=void 0===g?"":g,v=s.initialSelectedItem,b=void 0===v?null:v,w=n.getState({highlightedIndex:l,isOpen:c,inputValue:m,selectedItem:b});return null!=w.selectedItem&&void 0===n.props.initialInputValue&&(w.inputValue=n.props.itemToString(w.selectedItem)),n.state=w,n}n=e,(t=s).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var u=s.prototype;return u.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},u.getState=function(e){var t=this;return void 0===e&&(e=this.state),Object.keys(e).reduce((function(n,o){return n[o]=t.isControlledProp(o)?t.props[o]:e[o],n}),{})},u.isControlledProp=function(e){return void 0!==this.props[e]},u.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},u.getItemNodeFromIndex=function(e){return this.props.environment.document.getElementById(this.getItemId(e))},u.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},u.moveHighlightedIndex=function(e,t){var n=this.getItemCount();if(n>0){var o=P(e,this.getState().highlightedIndex,n);this.setHighlightedIndex(o,t)}},u.highlightFirstOrLastIndex=function(e,t,n){var o=this.getItemCount()-1;o<0||!this.getState().isOpen||(e.preventDefault(),this.setHighlightedIndex(t?0:o,n))},u.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,o=e.selectedItem,r=e.isOpen,i=this.props.itemToString,s=this.id,u=this.getRootProps,a=this.getToggleButtonProps,l=this.getLabelProps,p=this.getMenuProps,d=this.getInputProps,c=this.getItemProps,h=this.openMenu,f=this.closeMenu,g=this.toggleMenu,m=this.selectItem,v=this.selectItemAtIndex,y=this.selectHighlightedItem,I=this.setHighlightedIndex,S=this.clearSelection,b=this.clearItems;return{getRootProps:u,getToggleButtonProps:a,getLabelProps:l,getMenuProps:p,getInputProps:d,getItemProps:c,reset:this.reset,openMenu:h,closeMenu:f,toggleMenu:g,selectItem:m,selectItemAtIndex:v,selectHighlightedItem:y,setHighlightedIndex:I,clearSelection:S,clearItems:b,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:i,id:s,highlightedIndex:t,inputValue:n,isOpen:r,selectedItem:o}},u.componentDidMount=function(){var e=this;var t=function(t,n){void 0===n&&(n=!0);var o=e.props.environment.document;return[e._rootNode,e._menuNode].some((function(e){return e&&(v(e,t)||n&&v(e,o.activeElement))}))},n=function(){e.isMouseDown=!0},o=function(n){e.isMouseDown=!1,!t(n.target)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},r=function(){e.isTouchMove=!1},i=function(){e.isTouchMove=!0},s=function(n){var o=t(n.target,!1);e.isTouchMove||o||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},u=this.props.environment;u.addEventListener("mousedown",n),u.addEventListener("mouseup",o),u.addEventListener("touchstart",r),u.addEventListener("touchmove",i),u.addEventListener("touchend",s),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),u.removeEventListener("mousedown",n),u.removeEventListener("mouseup",o),u.removeEventListener("touchstart",r),u.removeEventListener("touchmove",i),u.removeEventListener("touchend",s)}},u.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,o=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==o},u.componentDidUpdate=function(e,t){this.isControlledProp("selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},u.componentWillUnmount=function(){this.cleanup()},u.render=function(){var e=w(this.props.children,g);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var t=w(e(this.getStateAndHelpers()));return t?this.getRootProps.called||this.props.suppressRefError?t:x(t)?Object(a.cloneElement)(t,this.getRootProps(C(t))):void 0:null},s}(a.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:b,itemToString:function(e){return null==e?"":String(e)},onStateChange:g,onInputValueChange:g,onUserAction:g,onChange:g,onSelect:g,onOuterClick:g,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:m},e.stateChangeTypes=k,e}();u.a.array.isRequired,u.a.func,u.a.func,u.a.func,u.a.bool,u.a.number,u.a.number,u.a.number,u.a.bool,u.a.bool,u.a.bool,u.a.any,u.a.any,u.a.any,u.a.string,u.a.string,u.a.string,u.a.func,u.a.string,u.a.func,u.a.func,u.a.func,u.a.func,u.a.func,u.a.shape({addEventListener:u.a.func,removeEventListener:u.a.func,document:u.a.shape({getElementById:u.a.func,activeElement:u.a.any,body:u.a.any})});"undefined"==typeof window||window;t.a=R}]]);
|
framework/extensions/mailchimp/admin-static/bundle/2.976c8f43abfe584b1a9d.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
| 1 |
+
(window.blocksyMailchimpExtJsonp=window.blocksyMailchimpExtJsonp||[]).push([[2],{13:function(e,t,n){"use strict";n.r(t);var r=n(0),a=n(12),c=n(2),i=n(6),o=n.n(i);function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function l(e,t,n,r,a,c,i){try{var o=e[c](i),u=o.value}catch(e){return void n(e)}o.done?t(u):Promise.resolve(u).then(r,a)}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,c=void 0;try{for(var i,o=e[Symbol.iterator]();!(r=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,c=e}finally{try{r||null==o.return||o.return()}finally{if(a)throw c}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var d=null;t.default=function(e){var t=e.value,n=e.onChange,i=s(Object(r.useState)(d||[]),2),f=i[0],p=i[1],m=s(Object(r.useState)(!d),2),b=m[0],v=m[1],h=function(){var e,t=(e=regeneratorRuntime.mark((function e(){var t,n,r,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(!(a.length>0&&void 0!==a[0])||a[0])&&v(!0),(t=new FormData).append("action","blocksy_ext_mailchimp_get_actual_lists"),e.prev=4,e.next=7,fetch(ajaxurl,{method:"POST",body:t});case 7:if(200!==(n=e.sent).status){e.next=18;break}return e.next=11,n.json();case 11:if(!(r=e.sent).success){e.next=18;break}if("api_key_invalid"===r.data.result){e.next=18;break}return v(!1),p(r.data.result),d=r.data.result,e.abrupt("return");case 18:e.next=22;break;case 20:e.prev=20,e.t0=e.catch(4);case 22:v(!1);case 23:case"end":return e.stop()}}),e,null,[[4,20]])})),function(){var t=this,n=arguments;return new Promise((function(r,a){var c=e.apply(t,n);function i(e){l(c,r,a,i,o,"next",e)}function o(e){l(c,r,a,i,o,"throw",e)}i(void 0)}))});return function(){return t.apply(this,arguments)}}();return Object(r.useEffect)((function(){h(!d)}),[]),0===f.length?Object(r.createElement)("div",{className:"ct-select-input"},Object(r.createElement)("input",{disabled:!0,placeholder:b?Object(c.__)("Loading...","blc"):Object(c.__)("Invalid API Key...","blc")})):Object(r.createElement)(a.a,{selectedItem:t||f[0].id,onChange:function(e){return n(e)},itemToString:function(e){return e?(f.find((function(t){return t.id===e}))||{}).name:""}},(function(e){var t=e.getInputProps,n=e.getItemProps,a=(e.getLabelProps,e.getMenuProps),i=e.isOpen,l=(e.inputValue,e.highlightedIndex),s=e.selectedItem,d=e.openMenu;return Object(r.createElement)("div",{className:"ct-select-input"},Object(r.createElement)("input",u({},t({onFocus:function(){return d()},onClick:function(){return d()}}),{placeholder:Object(c.__)("Select list...","blc"),readOnly:!0})),i&&Object(r.createElement)("div",a({className:"ct-select-dropdown"}),f.map((function(e,t){return Object(r.createElement)("div",n({key:e.id,index:t,item:e.id,className:o()("ct-select-dropdown-item",{active:l===t,selected:s===e.id})}),e.name)}))))}))}}}]);
|
framework/extensions/mailchimp/admin-static/bundle/main.js
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
!function(e){function t(t){for(var n,o,
|
| 1 |
+
!function(e){function t(t){for(var n,o,c=t[0],i=t[1],u=0,l=[];u<c.length;u++)o=c[u],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&l.push(r[o][0]),r[o]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(a&&a(t);l.length;)l.shift()()}var n={},r={0:0};function o(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.e=function(e){var t=[],n=r[e];if(0!==n)if(n)t.push(n[2]);else{var c=new Promise((function(t,o){n=r[e]=[t,o]}));t.push(n[2]=c);var i,u=document.createElement("script");u.charset="utf-8",u.timeout=120,o.nc&&u.setAttribute("nonce",o.nc),u.src=function(e){return o.p+""+e+"."+{1:"2c9ebf0a36c6c732fee6",2:"976c8f43abfe584b1a9d"}[e]+".js"}(e);var a=new Error;i=function(t){u.onerror=u.onload=null,clearTimeout(l);var n=r[e];if(0!==n){if(n){var o=t&&("load"===t.type?"missing":t.type),c=t&&t.target&&t.target.src;a.message="Loading chunk "+e+" failed.\n("+o+": "+c+")",a.name="ChunkLoadError",a.type=o,a.request=c,n[1](a)}r[e]=void 0}};var l=setTimeout((function(){i({type:"timeout",target:u})}),12e4);u.onerror=u.onload=i,document.head.appendChild(u)}return Promise.all(t)},o.m=e,o.c=n,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o.oe=function(e){throw console.error(e),e};var c=window.blocksyMailchimpExtJsonp=window.blocksyMailchimpExtJsonp||[],i=c.push.bind(c);c.push=t,c=c.slice();for(var u=0;u<c.length;u++)t(c[u]);var a=i;o(o.s=5)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.React},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=ctEvents},function(e,t,n){n.p=blocksy_ext_mailchimp_localization.public_url},function(e,t,n){"use strict";n.r(t);n(4);var r=n(0),o=n(2),c=n(1),i=Object(c.lazy)((function(){return Promise.all([n.e(1),n.e(2)]).then(n.bind(null,13))})),u=function(e){return Object(r.createElement)("div",null,Object(r.createElement)(c.Suspense,{fallback:Object(r.createElement)("div",{className:"ct-select-input"},Object(r.createElement)("input",{disabled:!0,placeholder:Object(o.__)("Loading...","blc")}))},Object(r.createElement)(i,e)))},a=n(3),l=n.n(a);document.addEventListener("DOMContentLoaded",(function(){return l.a.on("blocksy:options:register",(function(e){e["blocksy-mailchimp"]=u}))}))}]);
|
framework/extensions/mailchimp/admin-static/bundle/sync.js
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
!function(e){var t={};function r(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,function(t){return e[t]}.bind(null,n));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";r.r(t);var i=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],i=!0,n=!1,o=void 0;try{for(var l,c=e[Symbol.iterator]();!(i=(l=c.next()).done)&&(r.push(l.value),!t||r.length!==t);i=!0);}catch(e){n=!0,o=e}finally{try{!i&&c.return&&c.return()}finally{if(n)throw o}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};var o,l=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";r||((t=document.createElement("div")).innerHTML=document.querySelector(".ct-customizer-preview-cache-container").value,r=t);var n=r.querySelector(".ct-customizer-preview-cache [data-"+i+'="'+e+'"]').innerHTML,o=document.createElement("div");return o.innerHTML=n,o},c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=n({fragment_id:null,selector:null,parent_selector:null,strategy:"append",whenInserted:function(){},beforeInsert:function(e){},should_insert:!0},e);var t=document.querySelector(e.parent_selector);if([].concat(function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}(document.querySelectorAll(e.parent_selector+" "+e.selector))).map(function(e){return e.parentNode.removeChild(e)}),e.should_insert){for(var r=l(e.fragment_id);r.firstElementChild;)if(e.beforeInsert(r.firstElementChild),"append"===e.strategy&&t.appendChild(r.firstElementChild),"firstChild"===e.strategy&&t.insertBefore(r.firstElementChild,t.firstElementChild),e.strategy.indexOf("maybeBefore")>-1){var o=e.strategy.split(":"),c=i(o,2),a=(c[0],c[1]);t.querySelector(a)?t.insertBefore(r.firstElementChild,t.querySelector(a)):t.appendChild(r.firstElementChild)}e.whenInserted()}},a=function(e,t){if(t.classList.remove("ct-hidden-sm","ct-hidden-md","ct-hidden-lg"),wp.customize(e)){var r=wp.customize(e)()||{mobile:!1,tablet:!0,desktop:!0};r.mobile||t.classList.add("ct-hidden-sm"),r.tablet||t.classList.add("ct-hidden-md"),r.desktop||t.classList.add("ct-hidden-lg")}},u=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"desktop",i=document.querySelector("#"+{desktop:"ct-main-styles-inline-css",tablet:"ct-main-styles-tablet-inline-css",mobile:"ct-main-styles-mobile-inline-css"}[r]),n=i.innerText,o=e.selector||":root",l=new RegExp(o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\s?{[\\s\\S]*?}","gm"),c=n.match(l);c&&(i.innerText=n.replace(l,c[0].indexOf("--"+e.variable+":")>-1?c[0].replace(new RegExp("--"+e.variable+":[\\s\\S]*?;","gm"),"CT_CSS_SKIP_RULE"===t?"":"--"+e.variable+": "+t+";"):c[0].replace(new RegExp(o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\s?{","gm"),o+" {"+("CT_CSS_SKIP_RULE"===t?"":"--"+e.variable+": "+t+";"))))},s=function(e,t){return[].concat(function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}(e.selector?document.querySelectorAll(e.selector):[document.documentElement])).map(function(r){if(!e.responsive){var i=(e.type||"").indexOf("color")>-1?t["color"===e.type?"default":e.type.split(":")[1]].color:e.extractValue?e.extractValue(t):t;return"border"===(e.type||"")&&(i="none"===t.style?"none":t.width+"px "+t.style+" "+t.color.color),void u(e,""+i+(e.unit||""))}t=function(e){return e.desktop?e:{desktop:e,tablet:e,mobile:e}}(t),t=e.extractValue?e.extractValue(t):t,e.respect_visibility&&(wp.customize(e.respect_visibility)().mobile||(t.mobile="0"+(e.unit?"":"px")),wp.customize(e.respect_visibility)().tablet||(t.tablet="0"+(e.unit?"":"px")),wp.customize(e.respect_visibility)().desktop||(t.desktop="0"+(e.unit?"":"px"))),e.respect_stacking&&(wp.customize(e.respect_stacking)().mobile&&(t.mobile=2*parseInt(t.mobile,10)+(e.unit?"":"px")),wp.customize(e.respect_stacking)().tablet&&(t.tablet=2*parseInt(t.tablet,10)+(e.unit?"":"px"))),e.enabled&&"no"===!wp.customize(e.enabled)()&&(t.mobile="0"+(e.unit?"":"px"),t.tablet="0"+(e.unit?"":"px"),t.desktop="0"+(e.unit?"":"px")),u(e,""+t.desktop+(e.unit||""),"desktop"),u(e,""+t.tablet+(e.unit||""),"tablet"),u(e,""+t.mobile+(e.unit||""),"mobile")})};o={mailchimpContent:{variable:"mailchimpContent",type:"color"},mailchimpButton:[{selector:".ct-mailchimp-block",variable:"buttonInitialColor",type:"color:default"},{selector:".ct-mailchimp-block",variable:"buttonHoverColor",type:"color:hover"}],mailchimpBackground:{variable:"mailchimpBackground",type:"color"},mailchimpShadow:{variable:"mailchimpShadow",type:"color"},mailchimpSpacing:{variable:"mailchimpSpacing",responsive:!0,unit:""}},wp.customize.bind("change",function(e){return o[e.id]&&(Array.isArray(o[e.id])?o[e.id]:[o[e.id]]).map(function(t){return s(t,e())})}),wp.customize("mailchimp_subscribe_visibility",function(e){return e.bind(function(e){var t=document.querySelector(".ct-mailchimp-block");a("mailchimp_subscribe_visibility",t)})}),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=n({id:null,fragment_id:null,selector:null,parent_selector:null,strategy:"append",whenInserted:function(){},beforeInsert:function(e){},watch:[]},e);var t=function(){var t=wp.customize(e.id)();c(n({},e,{should_insert:"yes"===t}))};wp.customize(e.id,function(e){return e.bind(function(e){return t()})}),e.watch.map(function(e){return wp.customize(e,function(e){return e.bind(function(){return t()})})})}({id:"mailchimp_single_post_enabled",strategy:"append",parent_selector:".content-area article",selector:".ct-mailchimp-block",fragment_id:"blocksy-mailchimp-subscribe",watch:["has_mailchimp_name","mailchimp_button_text","mailchimp_title","mailchimp_text"],whenInserted:function(){var e=document.querySelector(".ct-mailchimp-block");a("mailchimp_subscribe_visibility",e),"yes"!==wp.customize("has_mailchimp_name")()&&e.querySelector('[name="FNAME"]').parentNode.removeChild(e.querySelector('[name="FNAME"]')),e.querySelector("button").innerHTML=wp.customize("mailchimp_button_text")(),e.querySelector("h4").innerHTML=wp.customize("mailchimp_title")(),e.querySelector(".ct-mailchimp-description").innerHTML=wp.customize("mailchimp_text")()}})}]);
|
| 1 |
+
!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,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var c,a=e[Symbol.iterator]();!(r=(c=a.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}(e,t)||i(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||i(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.r(t);var u,p=function(){var e=document.createElement("div");return e.innerHTML=document.querySelector(".ct-customizer-preview-cache-container").value,e},m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";if(t||(t=p()),t.querySelector(".ct-customizer-preview-cache [data-".concat(n,'="').concat(e,'"]'))){var r=t.querySelector(".ct-customizer-preview-cache [data-".concat(n,'="').concat(e,'"]')).innerHTML,o=document.createElement("div");return o.innerHTML=r,o}},d=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=l({fragment_id:null,selector:null,parent_selector:null,strategy:"append",whenInserted:function(){},beforeInsert:function(e){},should_insert:!0},e);var t=document.querySelector(e.parent_selector);if(o(document.querySelectorAll("".concat(e.parent_selector," ").concat(e.selector))).map((function(e){return e.parentNode.removeChild(e)})),e.should_insert){var n=m(e.fragment_id);if(n){for(;n.firstElementChild;)if(e.beforeInsert(n.firstElementChild),"append"===e.strategy&&t.appendChild(n.firstElementChild),"firstChild"===e.strategy&&t.insertBefore(n.firstElementChild,t.firstElementChild),e.strategy.indexOf("maybeBefore")>-1){var i=e.strategy.split(":"),c=r(i,2),a=(c[0],c[1]);t.querySelector(a)?t.insertBefore(n.firstElementChild,t.querySelector(a)):t.appendChild(n.firstElementChild)}e.whenInserted()}}},f=function(e,t){if(t.classList.remove("ct-hidden-sm","ct-hidden-md","ct-hidden-lg"),wp.customize(e)){var n=wp.customize(e)()||{mobile:!1,tablet:!0,desktop:!0};n.mobile||t.classList.add("ct-hidden-sm"),n.tablet||t.classList.add("ct-hidden-md"),n.desktop||t.classList.add("ct-hidden-lg")}},b=function(e){if([e.top,e.right,e.bottom,e.left].reduce((function(e,t){return!!e&&!("auto"!==t&&t&&t.toString().match(/\d/g))}),!0))return"CT_CSS_SKIP_RULE";var t=["auto"!==e.top&&e.top.toString().match(/\d/g)?e.top:0,"auto"!==e.right&&e.right.toString().match(/\d/g)?e.right:0,"auto"!==e.bottom&&e.bottom.toString().match(/\d/g)?e.bottom:0,"auto"!==e.left&&e.left.toString().match(/\d/g)?e.left:0];return t[0]===t[1]&&t[0]===t[2]&&t[0]===t[3]?t[0]:t[0]===t[2]&&t[1]===t[3]?"".concat(t[0]," ").concat(t[3]):t.join(" ")},h=function(e,t){var n=t.forcedOutput,r=void 0!==n&&n;if("CT_CSS_SKIP_RULE"===e)return"CT_CSS_SKIP_RULE";if("none"===e)return"none";if(!e.enable)return r?"none":"CT_CSS_SKIP_RULE";if(0===parseFloat(e.blur)&&0===parseFloat(e.spread)&&0===parseFloat(e.v_offset)&&0===parseFloat(e.h_offset))return r?"none":"CT_CSS_SKIP_RULE";var o=[];return e.inset&&o.push("inset"),o.push("".concat(e.h_offset,"px")),o.push("".concat(e.v_offset,"px")),0!==parseFloat(e.blur)&&(o.push("".concat(e.blur,"px")),0!==parseFloat(e.spread)&&o.push("".concat(e.spread,"px"))),0===parseFloat(e.blur)&&0!==parseFloat(e.spread)&&(o.push("".concat(e.blur,"px")),o.push("".concat(e.spread,"px"))),o.push(e.color.color),o.join(" ")},y=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"desktop",r={desktop:"ct-main-styles-inline-css",tablet:"ct-main-styles-tablet-inline-css",mobile:"ct-main-styles-mobile-inline-css"},o=document.querySelector("style#".concat(r[n])),i=o.innerText,c="".concat(e["".concat(n,"_selector_prefix")]?"".concat(e["".concat(n,"_selector_prefix")]," "):"").concat(e.selector||":root"),a=null,l=i.match(a);0===i.trim().indexOf(c)?(a=new RegExp("".concat(c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=i.match(a)):(a=new RegExp("\\}\\s*?".concat(c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=i.match(a)),l||(0===(i="".concat(i," ").concat(c," { }")).trim().indexOf(c)?(a=new RegExp("".concat(c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=i.match(a)):(a=new RegExp("\\}\\s*?".concat(c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=i.match(a))),o.innerText=i.replace(a,l[0].indexOf("--".concat(e.variable,":"))>-1?l[0].replace(new RegExp("--".concat(e.variable,":[\\s\\S]*?;"),"gm"),t.indexOf("CT_CSS_SKIP_RULE")>-1||t.indexOf(e.variable)>-1?"":"--".concat(e.variable,": ").concat(t,";")):l[0].replace(new RegExp("".concat(c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{"),"gm"),"".concat(c," {").concat(t.indexOf("CT_CSS_SKIP_RULE")>-1||t.indexOf(e.variable)>-1?"":"--".concat(e.variable,": ").concat(t,";"))))},v=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"desktop",r=(e.type||"").indexOf("color")>-1?t["color"===e.type?"default":e.type.split(":")[1]].color:t;"border"===(e.type||"")&&(r="none"===t.style?"none":"".concat(t.width,"px ").concat(t.style," ").concat(t.color.color)),"spacing"===(e.type||"")&&(r=b(t)),"box-shadow"===(e.type||"")&&(r=h(t,e)),y(e,"".concat(r).concat(e.unit||"").concat(e.important?" !important":""),n)},g=function(e,t){var n=t;t=e.extractValue?e.extractValue(t):t,e.whenDone&&e.whenDone(t,n),t=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e&&Object.keys(e).indexOf("desktop")>-1?t?e:e.desktop:t?{desktop:e,tablet:e,mobile:e}:e}(t,!!e.responsive),e.responsive?(e.enabled&&"no"===!wp.customize(e.enabled)()&&(t.mobile="0"+(e.unit?"":"px"),t.tablet="0"+(e.unit?"":"px"),t.desktop="0"+(e.unit?"":"px")),v(e,t.desktop,"desktop"),v(e,t.tablet,"tablet"),v(e,t.mobile,"mobile")):v(e,t)};u={mailchimpContent:[{selector:".ct-mailchimp-block",variable:"color",type:"color:default"},{selector:".ct-mailchimp-block",variable:"linkHoverColor",type:"color:hover"}],mailchimpButton:[{selector:".ct-mailchimp-block",variable:"buttonInitialColor",type:"color:default"},{selector:".ct-mailchimp-block",variable:"buttonHoverColor",type:"color:hover"}],mailchimpBackground:{selector:".ct-mailchimp-block",variable:"mailchimpBackground",type:"color"},mailchimpShadow:{selector:".ct-mailchimp-block",type:"box-shadow",variable:"box-shadow",responsive:!0},mailchimpSpacing:{selector:".ct-mailchimp-block",variable:"padding",responsive:!0,unit:""}},wp.customize.bind("change",(function(e){return u[e.id]&&(Array.isArray(u[e.id])?u[e.id]:[u[e.id]]).map((function(t){return g(t,e())}))})),wp.customize("mailchimp_subscribe_visibility",(function(e){return e.bind((function(e){var t=document.querySelector(".ct-mailchimp-block");f("mailchimp_subscribe_visibility",t)}))})),(document.body.classList.contains("single")||document.body.classList.contains("page"))&&function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=l({id:null,fragment_id:null,selector:null,parent_selector:null,strategy:"append",whenInserted:function(){},beforeInsert:function(e){},watch:[]},e);var t=function(){var t=wp.customize(e.id)();d(l(l({},e),{},{should_insert:"yes"===t}))};wp.customize(e.id,(function(e){return e.bind((function(e){return t()}))})),e.watch.map((function(e){return wp.customize(e,(function(e){return e.bind((function(){return t()}))}))}))}({id:"mailchimp_single_post_enabled",strategy:"append",parent_selector:".content-area article",selector:".ct-mailchimp-block",fragment_id:"blocksy-mailchimp-subscribe",watch:["has_mailchimp_name","mailchimp_button_text","mailchimp_title","mailchimp_text","mailchimp_name_label","mailchimp_mail_label"],whenInserted:function(){if(document.body.classList.contains("single")||document.body.classList.contains("page")){var e=document.querySelector(".ct-mailchimp-block");f("mailchimp_subscribe_visibility",e),"yes"!==wp.customize("has_mailchimp_name")()?e.querySelector('[name="FNAME"]').remove():e.querySelector('[name="FNAME"]').setAttribute("placeholder","".concat(wp.customize("mailchimp_name_label")())),e.querySelector('[name="EMAIL"]').setAttribute("placeholder","".concat(wp.customize("mailchimp_mail_label")()," *")),e.querySelector("button").innerHTML=wp.customize("mailchimp_button_text")(),e.querySelector("h4").innerHTML=wp.customize("mailchimp_title")(),e.querySelector(".ct-mailchimp-description").innerHTML=wp.customize("mailchimp_text")()}}})}]);
|
framework/extensions/mailchimp/admin-static/js/ListPicker.js
CHANGED
|
@@ -11,7 +11,7 @@ const ListPicker = props => (
|
|
| 11 |
<Suspense
|
| 12 |
fallback={
|
| 13 |
<div className="ct-select-input">
|
| 14 |
-
<input disabled placeholder={__('Loading...')} />
|
| 15 |
</div>
|
| 16 |
}>
|
| 17 |
<ListPickerImplementation {...props} />
|
| 11 |
<Suspense
|
| 12 |
fallback={
|
| 13 |
<div className="ct-select-input">
|
| 14 |
+
<input disabled placeholder={__('Loading...', 'blc')} />
|
| 15 |
</div>
|
| 16 |
}>
|
| 17 |
<ListPickerImplementation {...props} />
|
framework/extensions/mailchimp/admin-static/js/ListPicker/Implementation.js
CHANGED
|
@@ -55,7 +55,9 @@ const ListPickerImplementation = ({ value, onChange }) => {
|
|
| 55 |
<input
|
| 56 |
disabled
|
| 57 |
placeholder={
|
| 58 |
-
isLoadingLists
|
|
|
|
|
|
|
| 59 |
}
|
| 60 |
/>
|
| 61 |
</div>
|
|
@@ -83,7 +85,7 @@ const ListPickerImplementation = ({ value, onChange }) => {
|
|
| 83 |
onFocus: () => openMenu(),
|
| 84 |
onClick: () => openMenu()
|
| 85 |
})}
|
| 86 |
-
placeholder={__('Select list...')}
|
| 87 |
readOnly
|
| 88 |
/>
|
| 89 |
|
| 55 |
<input
|
| 56 |
disabled
|
| 57 |
placeholder={
|
| 58 |
+
isLoadingLists
|
| 59 |
+
? __('Loading...', 'blc')
|
| 60 |
+
: __('Invalid API Key...', 'blc')
|
| 61 |
}
|
| 62 |
/>
|
| 63 |
</div>
|
| 85 |
onFocus: () => openMenu(),
|
| 86 |
onClick: () => openMenu()
|
| 87 |
})}
|
| 88 |
+
placeholder={__('Select list...', 'blc')}
|
| 89 |
readOnly
|
| 90 |
/>
|
| 91 |
|
framework/extensions/mailchimp/admin-static/js/main.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import './public-path'
|
| 2 |
import { createElement, Fragment, Component } from '@wordpress/element'
|
| 3 |
import ListPicker from './ListPicker'
|
|
|
|
| 4 |
|
| 5 |
document.addEventListener('DOMContentLoaded', () =>
|
| 6 |
ctEvents.on('blocksy:options:register', opts => {
|
| 1 |
import './public-path'
|
| 2 |
import { createElement, Fragment, Component } from '@wordpress/element'
|
| 3 |
import ListPicker from './ListPicker'
|
| 4 |
+
import ctEvents from 'ct-events'
|
| 5 |
|
| 6 |
document.addEventListener('DOMContentLoaded', () =>
|
| 7 |
ctEvents.on('blocksy:options:register', opts => {
|
framework/extensions/mailchimp/admin-static/js/sync.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import {
|
| 2 |
checkAndReplace,
|
| 3 |
responsiveClassesFor
|
| 4 |
-
} from '../../../
|
| 5 |
|
| 6 |
import './variables'
|
| 7 |
|
|
@@ -12,40 +12,67 @@ wp.customize('mailchimp_subscribe_visibility', val =>
|
|
| 12 |
})
|
| 13 |
)
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
|
|
|
|
|
|
| 29 |
|
| 30 |
-
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
-
if (wp.customize('has_mailchimp_name')() !== 'yes') {
|
| 36 |
block
|
| 37 |
-
.querySelector('[name="
|
| 38 |
-
.
|
| 39 |
-
|
|
|
|
|
|
|
| 40 |
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
|
| 45 |
-
|
|
|
|
|
|
|
| 46 |
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
})
|
|
|
| 1 |
import {
|
| 2 |
checkAndReplace,
|
| 3 |
responsiveClassesFor
|
| 4 |
+
} from '../../../cookies-consent/static/js/sync/helpers'
|
| 5 |
|
| 6 |
import './variables'
|
| 7 |
|
| 12 |
})
|
| 13 |
)
|
| 14 |
|
| 15 |
+
if (
|
| 16 |
+
document.body.classList.contains('single') ||
|
| 17 |
+
document.body.classList.contains('page')
|
| 18 |
+
) {
|
| 19 |
+
checkAndReplace({
|
| 20 |
+
id: 'mailchimp_single_post_enabled',
|
| 21 |
+
strategy: 'append',
|
| 22 |
|
| 23 |
+
parent_selector: '.content-area article',
|
| 24 |
+
selector: '.ct-mailchimp-block',
|
| 25 |
+
fragment_id: 'blocksy-mailchimp-subscribe',
|
| 26 |
|
| 27 |
+
watch: [
|
| 28 |
+
'has_mailchimp_name',
|
| 29 |
+
'mailchimp_button_text',
|
| 30 |
+
'mailchimp_title',
|
| 31 |
+
'mailchimp_text',
|
| 32 |
+
'mailchimp_name_label',
|
| 33 |
+
'mailchimp_mail_label'
|
| 34 |
+
],
|
| 35 |
|
| 36 |
+
whenInserted: () => {
|
| 37 |
+
if (
|
| 38 |
+
!document.body.classList.contains('single') &&
|
| 39 |
+
!document.body.classList.contains('page')
|
| 40 |
+
) {
|
| 41 |
+
return
|
| 42 |
+
}
|
| 43 |
+
const block = document.querySelector('.ct-mailchimp-block')
|
| 44 |
|
| 45 |
+
responsiveClassesFor('mailchimp_subscribe_visibility', block)
|
| 46 |
+
|
| 47 |
+
if (wp.customize('has_mailchimp_name')() !== 'yes') {
|
| 48 |
+
block.querySelector('[name="FNAME"]').remove()
|
| 49 |
+
} else {
|
| 50 |
+
block
|
| 51 |
+
.querySelector('[name="FNAME"]')
|
| 52 |
+
.setAttribute(
|
| 53 |
+
'placeholder',
|
| 54 |
+
`${wp.customize('mailchimp_name_label')()}`
|
| 55 |
+
)
|
| 56 |
+
}
|
| 57 |
|
|
|
|
| 58 |
block
|
| 59 |
+
.querySelector('[name="EMAIL"]')
|
| 60 |
+
.setAttribute(
|
| 61 |
+
'placeholder',
|
| 62 |
+
`${wp.customize('mailchimp_mail_label')()} *`
|
| 63 |
+
)
|
| 64 |
|
| 65 |
+
block.querySelector('button').innerHTML = wp.customize(
|
| 66 |
+
'mailchimp_button_text'
|
| 67 |
+
)()
|
| 68 |
|
| 69 |
+
block.querySelector('h4').innerHTML = wp.customize(
|
| 70 |
+
'mailchimp_title'
|
| 71 |
+
)()
|
| 72 |
|
| 73 |
+
block.querySelector(
|
| 74 |
+
'.ct-mailchimp-description'
|
| 75 |
+
).innerHTML = wp.customize('mailchimp_text')()
|
| 76 |
+
}
|
| 77 |
+
})
|
| 78 |
+
}
|
framework/extensions/mailchimp/admin-static/js/variables.js
CHANGED
|
@@ -1,11 +1,20 @@
|
|
| 1 |
import { handleVariablesFor } from 'customizer-sync-helpers'
|
| 2 |
|
| 3 |
handleVariablesFor({
|
| 4 |
-
|
| 5 |
-
mailchimpContent:
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
mailchimpButton: [
|
| 11 |
{
|
|
@@ -22,18 +31,22 @@ handleVariablesFor({
|
|
| 22 |
],
|
| 23 |
|
| 24 |
mailchimpBackground: {
|
|
|
|
| 25 |
variable: 'mailchimpBackground',
|
| 26 |
type: 'color'
|
| 27 |
},
|
| 28 |
|
| 29 |
mailchimpShadow: {
|
| 30 |
-
|
| 31 |
-
type: '
|
| 32 |
-
|
|
|
|
|
|
|
| 33 |
|
| 34 |
mailchimpSpacing: {
|
| 35 |
-
|
|
|
|
| 36 |
responsive: true,
|
| 37 |
unit: ''
|
| 38 |
}
|
| 39 |
-
})
|
| 1 |
import { handleVariablesFor } from 'customizer-sync-helpers'
|
| 2 |
|
| 3 |
handleVariablesFor({
|
| 4 |
+
|
| 5 |
+
mailchimpContent: [
|
| 6 |
+
{
|
| 7 |
+
selector: '.ct-mailchimp-block',
|
| 8 |
+
variable: 'color',
|
| 9 |
+
type: 'color:default'
|
| 10 |
+
},
|
| 11 |
+
|
| 12 |
+
{
|
| 13 |
+
selector: '.ct-mailchimp-block',
|
| 14 |
+
variable: 'linkHoverColor',
|
| 15 |
+
type: 'color:hover'
|
| 16 |
+
}
|
| 17 |
+
],
|
| 18 |
|
| 19 |
mailchimpButton: [
|
| 20 |
{
|
| 31 |
],
|
| 32 |
|
| 33 |
mailchimpBackground: {
|
| 34 |
+
selector: '.ct-mailchimp-block',
|
| 35 |
variable: 'mailchimpBackground',
|
| 36 |
type: 'color'
|
| 37 |
},
|
| 38 |
|
| 39 |
mailchimpShadow: {
|
| 40 |
+
selector: '.ct-mailchimp-block',
|
| 41 |
+
type: 'box-shadow',
|
| 42 |
+
variable: 'box-shadow',
|
| 43 |
+
responsive: true
|
| 44 |
+
},
|
| 45 |
|
| 46 |
mailchimpSpacing: {
|
| 47 |
+
selector: '.ct-mailchimp-block',
|
| 48 |
+
variable: 'padding',
|
| 49 |
responsive: true,
|
| 50 |
unit: ''
|
| 51 |
}
|
| 52 |
+
})
|
framework/extensions/mailchimp/config.php
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
<?php
|
| 2 |
|
| 3 |
$config = [
|
|
|
|
| 4 |
'description' => __('Display a Mailchimp subscribe form with the help of a widget or a block.', 'blc')
|
| 5 |
];
|
| 6 |
|
| 1 |
<?php
|
| 2 |
|
| 3 |
$config = [
|
| 4 |
+
'name' => __('Mailchimp', 'blc'),
|
| 5 |
'description' => __('Display a Mailchimp subscribe form with the help of a widget or a block.', 'blc')
|
| 6 |
];
|
| 7 |
|
framework/extensions/mailchimp/ct-mailchimp/options.php
CHANGED
|
@@ -9,7 +9,6 @@
|
|
| 9 |
|
| 10 |
|
| 11 |
$options = [
|
| 12 |
-
|
| 13 |
'title' => [
|
| 14 |
'type' => 'text',
|
| 15 |
'label' => __( 'Title', 'blc' ),
|
|
@@ -64,9 +63,33 @@ $options = [
|
|
| 64 |
'disableRevertButton' => true,
|
| 65 |
],
|
| 66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
'mailchimp_button_text' => [
|
| 68 |
'type' => 'text',
|
| 69 |
-
'label' => __( 'Button
|
| 70 |
'design' => 'inline',
|
| 71 |
'value' => __( 'Subscribe', 'blc' ),
|
| 72 |
'disableRevertButton' => true,
|
|
@@ -77,6 +100,7 @@ $options = [
|
|
| 77 |
'label' => __( 'Content Alignment', 'blc' ),
|
| 78 |
'value' => 'center',
|
| 79 |
'view' => 'text',
|
|
|
|
| 80 |
'attr' => [ 'data-type' => 'alignment' ],
|
| 81 |
'disableRevertButton' => true,
|
| 82 |
'choices' => [
|
| 9 |
|
| 10 |
|
| 11 |
$options = [
|
|
|
|
| 12 |
'title' => [
|
| 13 |
'type' => 'text',
|
| 14 |
'label' => __( 'Title', 'blc' ),
|
| 63 |
'disableRevertButton' => true,
|
| 64 |
],
|
| 65 |
|
| 66 |
+
blocksy_rand_md5() => [
|
| 67 |
+
'type' => 'ct-condition',
|
| 68 |
+
'condition' => [ 'has_mailchimp_name' => 'yes' ],
|
| 69 |
+
'options' => [
|
| 70 |
+
|
| 71 |
+
'mailchimp_name_label' => [
|
| 72 |
+
'type' => 'text',
|
| 73 |
+
'label' => __( 'Name Label', 'blc' ),
|
| 74 |
+
'design' => 'inline',
|
| 75 |
+
'value' => __( 'Your name', 'blc' ),
|
| 76 |
+
'disableRevertButton' => true,
|
| 77 |
+
],
|
| 78 |
+
|
| 79 |
+
],
|
| 80 |
+
],
|
| 81 |
+
|
| 82 |
+
'mailchimp_mail_label' => [
|
| 83 |
+
'type' => 'text',
|
| 84 |
+
'label' => __( 'Mail Label', 'blc' ),
|
| 85 |
+
'design' => 'inline',
|
| 86 |
+
'value' => __( 'Your email', 'blc' ),
|
| 87 |
+
'disableRevertButton' => true,
|
| 88 |
+
],
|
| 89 |
+
|
| 90 |
'mailchimp_button_text' => [
|
| 91 |
'type' => 'text',
|
| 92 |
+
'label' => __( 'Button Label', 'blc' ),
|
| 93 |
'design' => 'inline',
|
| 94 |
'value' => __( 'Subscribe', 'blc' ),
|
| 95 |
'disableRevertButton' => true,
|
| 100 |
'label' => __( 'Content Alignment', 'blc' ),
|
| 101 |
'value' => 'center',
|
| 102 |
'view' => 'text',
|
| 103 |
+
'design' => 'inline',
|
| 104 |
'attr' => [ 'data-type' => 'alignment' ],
|
| 105 |
'disableRevertButton' => true,
|
| 106 |
'choices' => [
|
framework/extensions/mailchimp/ct-mailchimp/view.php
CHANGED
|
@@ -30,19 +30,31 @@ if (blocksy_default_akg( 'mailchimp_list_id_source', $atts, 'default' ) === 'cus
|
|
| 30 |
$manager = new BlocksyMailchimpManager();
|
| 31 |
|
| 32 |
// Button value
|
| 33 |
-
$
|
| 34 |
|
| 35 |
-
if (! $
|
| 36 |
return;
|
| 37 |
}
|
| 38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
// Content alignment
|
| 40 |
$alignment = blocksy_default_akg( 'mailchimp_alignment', $atts, 'center' );
|
| 41 |
|
|
|
|
|
|
|
|
|
|
| 42 |
$data_alignment = '';
|
| 43 |
|
| 44 |
if ( $alignment !== 'left' ) {
|
| 45 |
-
$data_alignment = 'data-alignment=' . $alignment;
|
| 46 |
}
|
| 47 |
|
| 48 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
|
@@ -56,7 +68,7 @@ echo $before_title . wp_kses_post( $title ) . $after_title;
|
|
| 56 |
?>
|
| 57 |
|
| 58 |
|
| 59 |
-
<form action="<?php echo esc_attr($form_url) ?>" method="post" class="ct-mailchimp-form"
|
| 60 |
|
| 61 |
<?php if( !empty( $message ) ) { ?>
|
| 62 |
<div class="ct-mailchimp-description">
|
|
@@ -64,23 +76,23 @@ echo $before_title . wp_kses_post( $title ) . $after_title;
|
|
| 64 |
</div>
|
| 65 |
<?php } ?>
|
| 66 |
|
| 67 |
-
|
| 68 |
-
<?php
|
| 69 |
-
|
| 70 |
-
|
|
|
|
| 71 |
|
| 72 |
-
|
|
|
|
|
|
|
| 73 |
|
| 74 |
-
|
| 75 |
-
<?php echo esc_html($button_text) ?>
|
| 76 |
-
</button>
|
| 77 |
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
</div>
|
| 84 |
</form>
|
| 85 |
|
| 86 |
</div>
|
| 30 |
$manager = new BlocksyMailchimpManager();
|
| 31 |
|
| 32 |
// Button value
|
| 33 |
+
$mailchimp_data = $manager->get_form_url_and_gdpr_for($list_id);
|
| 34 |
|
| 35 |
+
if (! $mailchimp_data) {
|
| 36 |
return;
|
| 37 |
}
|
| 38 |
|
| 39 |
+
$form_url = $mailchimp_data['form_url'];
|
| 40 |
+
$has_gdpr_fields = $mailchimp_data['has_gdpr_fields'];
|
| 41 |
+
|
| 42 |
+
$skip_submit_output = '';
|
| 43 |
+
|
| 44 |
+
if ($has_gdpr_fields) {
|
| 45 |
+
$skip_submit_output = 'data-skip-submit';
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
// Content alignment
|
| 49 |
$alignment = blocksy_default_akg( 'mailchimp_alignment', $atts, 'center' );
|
| 50 |
|
| 51 |
+
$name_label = blocksy_default_akg('mailchimp_name_label', $atts, __( 'Your name', 'blc' ));
|
| 52 |
+
$email_label = blocksy_default_akg('mailchimp_mail_label', $atts, __( 'Your email', 'blc' ));
|
| 53 |
+
|
| 54 |
$data_alignment = '';
|
| 55 |
|
| 56 |
if ( $alignment !== 'left' ) {
|
| 57 |
+
$data_alignment = ' data-alignment=' . $alignment;
|
| 58 |
}
|
| 59 |
|
| 60 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
| 68 |
?>
|
| 69 |
|
| 70 |
|
| 71 |
+
<form action="<?php echo esc_attr($form_url) ?>" method="post" class="ct-mailchimp-widget-form" target="_blank" <?php echo $skip_submit_output ?>>
|
| 72 |
|
| 73 |
<?php if( !empty( $message ) ) { ?>
|
| 74 |
<div class="ct-mailchimp-description">
|
| 76 |
</div>
|
| 77 |
<?php } ?>
|
| 78 |
|
| 79 |
+
<?php if ( $has_name ) { ?>
|
| 80 |
+
<input type="text" name="FNAME" placeholder="<?php esc_attr_e($name_label, 'blc'); ?>" title="<?php echo __('Name', 'blocksy') ?>" />
|
| 81 |
+
<?php } ?>
|
| 82 |
+
|
| 83 |
+
<input type="email" name="EMAIL" placeholder="<?php esc_attr_e($email_label, 'blc'); ?> *" title="<?php echo __('Email', 'blocksy') ?>" required />
|
| 84 |
|
| 85 |
+
<button class="button">
|
| 86 |
+
<?php echo esc_html($button_text) ?>
|
| 87 |
+
</button>
|
| 88 |
|
| 89 |
+
<div class="ct-mailchimp-message"></div>
|
|
|
|
|
|
|
| 90 |
|
| 91 |
+
<?php
|
| 92 |
+
if (function_exists('blocksy_ext_cookies_checkbox')) {
|
| 93 |
+
echo blocksy_ext_cookies_checkbox('mailchimp');
|
| 94 |
+
}
|
| 95 |
+
?>
|
|
|
|
| 96 |
</form>
|
| 97 |
|
| 98 |
</div>
|
framework/extensions/mailchimp/customizer.php
CHANGED
|
@@ -9,7 +9,7 @@ $options = [
|
|
| 9 |
'inner-options' => [
|
| 10 |
|
| 11 |
blocksy_rand_md5() => [
|
| 12 |
-
'title' => __( 'General', '
|
| 13 |
'type' => 'tab',
|
| 14 |
'options' => [
|
| 15 |
|
|
@@ -70,6 +70,11 @@ $options = [
|
|
| 70 |
],
|
| 71 |
],
|
| 72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
'has_mailchimp_name' => [
|
| 74 |
'type' => 'ct-switch',
|
| 75 |
'label' => __( 'Name Field', 'blc' ),
|
|
@@ -78,10 +83,36 @@ $options = [
|
|
| 78 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 79 |
],
|
| 80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
'mailchimp_button_text' => [
|
| 82 |
'type' => 'text',
|
| 83 |
-
'label' => __( 'Button
|
| 84 |
-
'design' => '
|
| 85 |
'value' => __( 'Subscribe', 'blc' ),
|
| 86 |
'disableRevertButton' => true,
|
| 87 |
'setting' => [ 'transport' => 'postMessage' ],
|
|
@@ -89,11 +120,10 @@ $options = [
|
|
| 89 |
|
| 90 |
blocksy_rand_md5() => [
|
| 91 |
'type' => 'ct-divider',
|
| 92 |
-
'attr' => [ 'data-type' => 'small' ],
|
| 93 |
],
|
| 94 |
|
| 95 |
'mailchimp_subscribe_visibility' => [
|
| 96 |
-
'label' => __( 'Visibility', '
|
| 97 |
'type' => 'ct-visibility',
|
| 98 |
'design' => 'block',
|
| 99 |
'setting' => [ 'transport' => 'postMessage' ],
|
|
@@ -104,9 +134,9 @@ $options = [
|
|
| 104 |
],
|
| 105 |
|
| 106 |
'choices' => blocksy_ordered_keys([
|
| 107 |
-
'desktop' => __( 'Desktop', '
|
| 108 |
-
'tablet' => __( 'Tablet', '
|
| 109 |
-
'mobile' => __( 'Mobile', '
|
| 110 |
]),
|
| 111 |
],
|
| 112 |
|
|
@@ -114,32 +144,43 @@ $options = [
|
|
| 114 |
],
|
| 115 |
|
| 116 |
blocksy_rand_md5() => [
|
| 117 |
-
'title' => __( 'Design', '
|
| 118 |
'type' => 'tab',
|
| 119 |
'options' => [
|
| 120 |
|
| 121 |
'mailchimpContent' => [
|
| 122 |
-
'label' => __( 'Content Color', '
|
| 123 |
'type' => 'ct-color-picker',
|
| 124 |
'design' => 'inline',
|
| 125 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 126 |
|
| 127 |
'value' => [
|
| 128 |
'default' => [
|
| 129 |
-
'color' => '
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
],
|
| 131 |
],
|
| 132 |
|
| 133 |
'pickers' => [
|
| 134 |
[
|
| 135 |
-
'title' => __( 'Initial', '
|
| 136 |
'id' => 'default',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
],
|
| 138 |
],
|
| 139 |
],
|
| 140 |
|
| 141 |
'mailchimpButton' => [
|
| 142 |
-
'label' => __( 'Button Color', '
|
| 143 |
'type' => 'ct-color-picker',
|
| 144 |
'design' => 'inline',
|
| 145 |
'setting' => [ 'transport' => 'postMessage' ],
|
|
@@ -156,64 +197,39 @@ $options = [
|
|
| 156 |
|
| 157 |
'pickers' => [
|
| 158 |
[
|
| 159 |
-
'title' => __( 'Initial', '
|
| 160 |
'id' => 'default',
|
| 161 |
],
|
| 162 |
|
| 163 |
[
|
| 164 |
-
'title' => __( 'Hover', '
|
| 165 |
'id' => 'hover',
|
| 166 |
],
|
| 167 |
],
|
| 168 |
],
|
| 169 |
|
| 170 |
'mailchimpBackground' => [
|
| 171 |
-
'label' => __( 'Background Color', '
|
| 172 |
'type' => 'ct-color-picker',
|
| 173 |
'design' => 'inline',
|
| 174 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 175 |
|
| 176 |
'value' => [
|
| 177 |
'default' => [
|
| 178 |
-
'color' =>
|
| 179 |
],
|
| 180 |
],
|
| 181 |
|
| 182 |
'pickers' => [
|
| 183 |
[
|
| 184 |
-
'title' => __( 'Initial', '
|
| 185 |
'id' => 'default',
|
| 186 |
],
|
| 187 |
],
|
| 188 |
],
|
| 189 |
|
| 190 |
-
'mailchimpShadow' => [
|
| 191 |
-
'label' => __( 'Shadow Color', 'blocksy' ),
|
| 192 |
-
'type' => 'ct-color-picker',
|
| 193 |
-
'design' => 'inline',
|
| 194 |
-
'setting' => [ 'transport' => 'postMessage' ],
|
| 195 |
-
|
| 196 |
-
'value' => [
|
| 197 |
-
'default' => [
|
| 198 |
-
'color' => 'rgba(210, 213, 218, 0.4)',
|
| 199 |
-
],
|
| 200 |
-
],
|
| 201 |
-
|
| 202 |
-
'pickers' => [
|
| 203 |
-
[
|
| 204 |
-
'title' => __( 'Initial', 'blocksy' ),
|
| 205 |
-
'id' => 'default',
|
| 206 |
-
],
|
| 207 |
-
],
|
| 208 |
-
],
|
| 209 |
-
|
| 210 |
-
blocksy_rand_md5() => [
|
| 211 |
-
'type' => 'ct-divider',
|
| 212 |
-
'attr' => [ 'data-type' => 'small' ],
|
| 213 |
-
],
|
| 214 |
-
|
| 215 |
'mailchimpSpacing' => [
|
| 216 |
-
'label' => __( 'Container Inner Spacing', '
|
| 217 |
'type' => 'ct-slider',
|
| 218 |
'value' => '40px',
|
| 219 |
'units' => blocksy_units_config([
|
|
@@ -224,11 +240,31 @@ $options = [
|
|
| 224 |
],
|
| 225 |
]),
|
| 226 |
'responsive' => true,
|
|
|
|
| 227 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 228 |
],
|
| 229 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 230 |
],
|
| 231 |
],
|
| 232 |
|
| 233 |
],
|
| 234 |
-
];
|
| 9 |
'inner-options' => [
|
| 10 |
|
| 11 |
blocksy_rand_md5() => [
|
| 12 |
+
'title' => __( 'General', 'blc' ),
|
| 13 |
'type' => 'tab',
|
| 14 |
'options' => [
|
| 15 |
|
| 70 |
],
|
| 71 |
],
|
| 72 |
|
| 73 |
+
blocksy_rand_md5() => [
|
| 74 |
+
'type' => 'ct-divider',
|
| 75 |
+
'attr' => [ 'data-type' => 'small' ],
|
| 76 |
+
],
|
| 77 |
+
|
| 78 |
'has_mailchimp_name' => [
|
| 79 |
'type' => 'ct-switch',
|
| 80 |
'label' => __( 'Name Field', 'blc' ),
|
| 83 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 84 |
],
|
| 85 |
|
| 86 |
+
blocksy_rand_md5() => [
|
| 87 |
+
'type' => 'ct-condition',
|
| 88 |
+
'condition' => [ 'has_mailchimp_name' => 'yes' ],
|
| 89 |
+
'options' => [
|
| 90 |
+
|
| 91 |
+
'mailchimp_name_label' => [
|
| 92 |
+
'type' => 'text',
|
| 93 |
+
'label' => __( 'Name Label', 'blc' ),
|
| 94 |
+
'design' => 'inline',
|
| 95 |
+
'value' => __( 'Your name', 'blc' ),
|
| 96 |
+
'disableRevertButton' => true,
|
| 97 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 98 |
+
],
|
| 99 |
+
|
| 100 |
+
],
|
| 101 |
+
],
|
| 102 |
+
|
| 103 |
+
'mailchimp_mail_label' => [
|
| 104 |
+
'type' => 'text',
|
| 105 |
+
'label' => __( 'Mail Label', 'blc' ),
|
| 106 |
+
'design' => 'inline',
|
| 107 |
+
'value' => __( 'Your email', 'blc' ),
|
| 108 |
+
'disableRevertButton' => true,
|
| 109 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 110 |
+
],
|
| 111 |
+
|
| 112 |
'mailchimp_button_text' => [
|
| 113 |
'type' => 'text',
|
| 114 |
+
'label' => __( 'Button Label', 'blc' ),
|
| 115 |
+
'design' => 'inline',
|
| 116 |
'value' => __( 'Subscribe', 'blc' ),
|
| 117 |
'disableRevertButton' => true,
|
| 118 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 120 |
|
| 121 |
blocksy_rand_md5() => [
|
| 122 |
'type' => 'ct-divider',
|
|
|
|
| 123 |
],
|
| 124 |
|
| 125 |
'mailchimp_subscribe_visibility' => [
|
| 126 |
+
'label' => __( 'Visibility', 'blc' ),
|
| 127 |
'type' => 'ct-visibility',
|
| 128 |
'design' => 'block',
|
| 129 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 134 |
],
|
| 135 |
|
| 136 |
'choices' => blocksy_ordered_keys([
|
| 137 |
+
'desktop' => __( 'Desktop', 'blc' ),
|
| 138 |
+
'tablet' => __( 'Tablet', 'blc' ),
|
| 139 |
+
'mobile' => __( 'Mobile', 'blc' ),
|
| 140 |
]),
|
| 141 |
],
|
| 142 |
|
| 144 |
],
|
| 145 |
|
| 146 |
blocksy_rand_md5() => [
|
| 147 |
+
'title' => __( 'Design', 'blc' ),
|
| 148 |
'type' => 'tab',
|
| 149 |
'options' => [
|
| 150 |
|
| 151 |
'mailchimpContent' => [
|
| 152 |
+
'label' => __( 'Content Color', 'blc' ),
|
| 153 |
'type' => 'ct-color-picker',
|
| 154 |
'design' => 'inline',
|
| 155 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 156 |
|
| 157 |
'value' => [
|
| 158 |
'default' => [
|
| 159 |
+
'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
|
| 160 |
+
],
|
| 161 |
+
|
| 162 |
+
'hover' => [
|
| 163 |
+
'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
|
| 164 |
],
|
| 165 |
],
|
| 166 |
|
| 167 |
'pickers' => [
|
| 168 |
[
|
| 169 |
+
'title' => __( 'Initial', 'blc' ),
|
| 170 |
'id' => 'default',
|
| 171 |
+
'inherit' => 'var(--color)'
|
| 172 |
+
],
|
| 173 |
+
|
| 174 |
+
[
|
| 175 |
+
'title' => __( 'Hover', 'blc' ),
|
| 176 |
+
'id' => 'hover',
|
| 177 |
+
'inherit' => 'var(--linkHoverColor)'
|
| 178 |
],
|
| 179 |
],
|
| 180 |
],
|
| 181 |
|
| 182 |
'mailchimpButton' => [
|
| 183 |
+
'label' => __( 'Button Color', 'blc' ),
|
| 184 |
'type' => 'ct-color-picker',
|
| 185 |
'design' => 'inline',
|
| 186 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 197 |
|
| 198 |
'pickers' => [
|
| 199 |
[
|
| 200 |
+
'title' => __( 'Initial', 'blc' ),
|
| 201 |
'id' => 'default',
|
| 202 |
],
|
| 203 |
|
| 204 |
[
|
| 205 |
+
'title' => __( 'Hover', 'blc' ),
|
| 206 |
'id' => 'hover',
|
| 207 |
],
|
| 208 |
],
|
| 209 |
],
|
| 210 |
|
| 211 |
'mailchimpBackground' => [
|
| 212 |
+
'label' => __( 'Background Color', 'blc' ),
|
| 213 |
'type' => 'ct-color-picker',
|
| 214 |
'design' => 'inline',
|
| 215 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 216 |
|
| 217 |
'value' => [
|
| 218 |
'default' => [
|
| 219 |
+
'color' => '#ffffff',
|
| 220 |
],
|
| 221 |
],
|
| 222 |
|
| 223 |
'pickers' => [
|
| 224 |
[
|
| 225 |
+
'title' => __( 'Initial', 'blc' ),
|
| 226 |
'id' => 'default',
|
| 227 |
],
|
| 228 |
],
|
| 229 |
],
|
| 230 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 231 |
'mailchimpSpacing' => [
|
| 232 |
+
'label' => __( 'Container Inner Spacing', 'blc' ),
|
| 233 |
'type' => 'ct-slider',
|
| 234 |
'value' => '40px',
|
| 235 |
'units' => blocksy_units_config([
|
| 240 |
],
|
| 241 |
]),
|
| 242 |
'responsive' => true,
|
| 243 |
+
'divider' => 'top',
|
| 244 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 245 |
],
|
| 246 |
|
| 247 |
+
'mailchimpShadow' => [
|
| 248 |
+
'label' => __( 'Shadow', 'blocksy' ),
|
| 249 |
+
'type' => 'ct-box-shadow',
|
| 250 |
+
'responsive' => true,
|
| 251 |
+
'divider' => 'top',
|
| 252 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 253 |
+
'value' => blocksy_box_shadow_value([
|
| 254 |
+
'enable' => true,
|
| 255 |
+
'h_offset' => 0,
|
| 256 |
+
'v_offset' => 50,
|
| 257 |
+
'blur' => 90,
|
| 258 |
+
'spread' => 0,
|
| 259 |
+
'inset' => false,
|
| 260 |
+
'color' => [
|
| 261 |
+
'color' => 'rgba(210, 213, 218, 0.4)',
|
| 262 |
+
],
|
| 263 |
+
])
|
| 264 |
+
],
|
| 265 |
+
|
| 266 |
],
|
| 267 |
],
|
| 268 |
|
| 269 |
],
|
| 270 |
+
];
|
framework/extensions/mailchimp/dashboard-static/bundle/main.js
CHANGED
|
@@ -1,20 +1,14 @@
|
|
| 1 |
-
!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,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=
|
| 2 |
/*!
|
| 3 |
Copyright (c) 2017 Jed Watson.
|
| 4 |
Licensed under the MIT License (MIT), see
|
| 5 |
http://jedwatson.github.io/classnames
|
| 6 |
-
*/
|
| 7 |
-
|
| 8 |
-
Copyright (c) 2017 Jed Watson.
|
| 9 |
-
Licensed under the MIT License (MIT), see
|
| 10 |
-
http://jedwatson.github.io/classnames
|
| 11 |
-
*/
|
| 12 |
-
!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)&&r.length){var a=o.apply(null,r);a&&e.push(a)}else if("object"===i)for(var s in r)n.call(r,s)&&r[s]&&e.push(s)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(6)),i=r(n(4)),a=r(n(1)),s=r(n(12));let u=void 0,l=void 0,c=[],d=e=>"undefined"!=typeof window&&window.requestAnimationFrame(e),p=e=>"undefined"!=typeof window&&window.cancelAnimationFrame(e),f=void 0,h=()=>Date.now(),m=void 0,g=void 0;const v=(e,t)=>l={fn:e,transform:t},y=e=>c=e,b=e=>u=e,w=e=>f=e,x=e=>m=e,O=e=>g=e;var S=Object.freeze({get bugfixes(){return u},get applyAnimatedValues(){return l},get colorNames(){return c},get requestFrame(){return d},get cancelFrame(){return p},get interpolation(){return f},get now(){return h},get defaultElement(){return m},get createAnimatedStyle(){return g},injectApplyAnimatedValues:v,injectColorNames:y,injectBugfixes:b,injectInterpolation:w,injectFrame:(e,t)=>{var n=[e,t];return d=n[0],p=n[1],n},injectNow:e=>h=e,injectDefaultElement:x,injectCreateAnimatedStyle:O});class E{attach(){}detach(){}getValue(){}getAnimatedValue(){return this.getValue()}addChild(e){}removeChild(e){}getChildren(){return[]}}const I=e=>Object.keys(e).map(t=>e[t]);class C extends E{constructor(){var e;super(...arguments),e=this,this.children=[],this.getChildren=(()=>this.children),this.getPayload=function(t){return void 0===t&&(t=void 0),void 0!==t&&e.payload?e.payload[t]:e.payload||e}}addChild(e){0===this.children.length&&this.attach(),this.children.push(e)}removeChild(e){const t=this.children.indexOf(e);this.children.splice(t,1),0===this.children.length&&this.detach()}}class A extends C{constructor(){super(...arguments),this.payload=[],this.getAnimatedValue=(()=>this.getValue()),this.attach=(()=>this.payload.forEach(e=>e instanceof E&&e.addChild(this))),this.detach=(()=>this.payload.forEach(e=>e instanceof E&&e.removeChild(this)))}}class j extends C{constructor(){super(...arguments),this.payload={},this.getAnimatedValue=(()=>this.getValue(!0)),this.attach=(()=>I(this.payload).forEach(e=>e instanceof E&&e.addChild(this))),this.detach=(()=>I(this.payload).forEach(e=>e instanceof E&&e.removeChild(this)))}getValue(e){void 0===e&&(e=!1);const t={};for(const n in this.payload){const r=this.payload[n];(!e||r instanceof E)&&(t[n]=r instanceof E?r[e?"getAnimatedValue":"getValue"]():r)}return t}}class k extends j{constructor(e){super(),!(e=e||{}).transform||e.transform instanceof E||(e=l.transform(e)),this.payload=e}}const P={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199};class _{static create(e,t,n){if("function"==typeof e)return e;if(f&&e.output&&"string"==typeof e.output[0])return f(e);if(Array.isArray(e))return _.create({range:e,output:t,extrapolate:n||"extend"});let r=e.output,o=e.range||[0,1],i=e.easing||(e=>e),a="extend",s=e.map;void 0!==e.extrapolateLeft?a=e.extrapolateLeft:void 0!==e.extrapolate&&(a=e.extrapolate);let u="extend";return void 0!==e.extrapolateRight?u=e.extrapolateRight:void 0!==e.extrapolate&&(u=e.extrapolate),e=>{let t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,o);return function(e,t,n,r,o,i,a,s,u){let l=u?u(e):e;if(l<t){if("identity"===a)return l;"clamp"===a&&(l=t)}if(l>n){if("identity"===s)return l;"clamp"===s&&(l=n)}if(r===o)return r;if(t===n)return e<=t?r:o;t===-1/0?l=-l:n===1/0?l-=t:l=(l-t)/(n-t);l=i(l),r===-1/0?l=-l:o===1/0?l+=r:l=l*(o-r)+r;return l}(e,o[t],o[t+1],r[t],r[t+1],i,a,u,s)}}}const T="[-+]?\\d*\\.?\\d+",M=T+"%";function R(){return"\\(\\s*("+Array.prototype.slice.call(arguments).join(")\\s*,\\s*(")+")\\s*\\)"}const D=new RegExp("rgb"+R(T,T,T)),U=new RegExp("rgba"+R(T,T,T,T)),F=new RegExp("hsl"+R(T,M,M)),V=new RegExp("hsla"+R(T,M,M,T)),L=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,H=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,N=/^#([0-9a-fA-F]{6})$/,B=/^#([0-9a-fA-F]{8})$/;function K(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function W(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=K(o,r,e+1/3),a=K(o,r,e),s=K(o,r,e-1/3);return Math.round(255*i)<<24|Math.round(255*a)<<16|Math.round(255*s)<<8}function q(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function $(e){return(parseFloat(e)%360+360)%360/360}function z(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function G(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Y(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=N.exec(e))?parseInt(t[1]+"ff",16)>>>0:P.hasOwnProperty(e)?P[e]:(t=D.exec(e))?(q(t[1])<<24|q(t[2])<<16|q(t[3])<<8|255)>>>0:(t=U.exec(e))?(q(t[1])<<24|q(t[2])<<16|q(t[3])<<8|z(t[4]))>>>0:(t=L.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=B.exec(e))?parseInt(t[1],16)>>>0:(t=H.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=F.exec(e))?(255|W($(t[1]),G(t[2]),G(t[3])))>>>0:(t=V.exec(e))?(W($(t[1]),G(t[2]),G(t[3]))|z(t[4]))>>>0:null}(e);return null===t?e:`rgba(${(4278190080&(t=t||0))>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`}const Q=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,J=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,X=new RegExp(`(${Object.keys(P).join("|")})`,"g");class Z extends A{constructor(e,t,n){super(),this.getValue=(()=>this.calc(...this.payload.map(e=>e.getValue()))),this.updateConfig=((e,t)=>this.calc=_.create(e,t)),this.interpolate=((e,t)=>new Z(this,e,t)),this.payload=e instanceof A&&!e.updateConfig?e.payload:Array.isArray(e)?e:[e],this.calc=_.create(t,n)}}class ee extends C{constructor(e){var t;super(),t=this,this.setValue=function(e,n){void 0===n&&(n=!0),t.value=e,n&&t.flush()},this.getValue=(()=>this.value),this.updateStyles=(()=>(function e(t,n){"function"==typeof t.update?n.add(t):t.getChildren().forEach(t=>e(t,n))})(this,this.animatedStyles)),this.updateValue=(e=>this.flush(this.value=e)),this.interpolate=((e,t)=>new Z(this,e,t)),this.value=e,this.animatedStyles=new Set,this.done=!1,this.startPosition=e,this.lastPosition=e,this.lastVelocity=void 0,this.lastTime=void 0,this.controller=void 0}flush(){0===this.animatedStyles.size&&this.updateStyles(),this.animatedStyles.forEach(e=>e.update())}prepare(e){void 0===this.controller&&(this.controller=e),this.controller===e&&(this.startPosition=this.value,this.lastPosition=this.value,this.lastVelocity=e.isActive?this.lastVelocity:void 0,this.lastTime=e.isActive?this.lastTime:void 0,this.done=!1,this.animatedStyles.clear())}}class te extends A{constructor(e){var t;super(),t=this,this.setValue=function(e,n){void 0===n&&(n=!0),Array.isArray(e)?e.length===t.payload.length&&e.forEach((e,r)=>t.payload[r].setValue(e,n)):t.payload.forEach((r,o)=>t.payload[o].setValue(e,n))},this.getValue=(()=>this.payload.map(e=>e.getValue())),this.interpolate=((e,t)=>new Z(this,e,t)),this.payload=e.map(e=>new ee(e))}}function ne(e,t){return null==e?t:e}function re(e){return void 0!==e?Array.isArray(e)?e:[e]:[]}function oe(e,t){if(typeof e!=typeof t)return!1;if("string"==typeof e||"number"==typeof e)return e===t;let n;for(n in e)if(!(n in t))return!1;for(n in t)if(e[n]!==t[n])return!1;return void 0!==n||e===t}function ie(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"function"==typeof e?e(...n):e}function ae(e){return Object.keys(e).map(t=>e[t])}function se(e){const t=function(e){return e.to,e.from,e.config,e.native,e.onStart,e.onRest,e.onFrame,e.children,e.reset,e.reverse,e.force,e.immediate,e.impl,e.inject,e.delay,e.attach,e.destroyed,e.interpolateTo,e.autoStart,e.ref,o(e,["to","from","config","native","onStart","onRest","onFrame","children","reset","reverse","force","immediate","impl","inject","delay","attach","destroyed","interpolateTo","autoStart","ref"])}(e),n=Object.keys(e).reduce((n,r)=>void 0!==t[r]?n:i({},n,{[r]:e[r]}),{});return i({to:t},n)}function ue(e,t){let n=t[0],r=t[1];return i({},e,{[n]:new(Array.isArray(r)?te:ee)(r)})}function le(e){const t=e.from,n=e.to,r=e.native,o=Object.entries(i({},t,n));return r?o.reduce(ue,{}):i({},t,n)}function ce(e,t){return t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e)),e}const de=e=>"auto"===e,pe=(e,t)=>(n,r)=>{let o=r[0],a=r[1];return i({},n,{[o]:"auto"===a?~o.indexOf("height")?t:e:a})};let fe={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const he=["Webkit","Ms","Moz","O"];function me(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||fe.hasOwnProperty(e)&&fe[e]?(""+t).trim():t+"px"}fe=Object.keys(fe).reduce((e,t)=>(he.forEach(n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t]),e),fe);const ge={};O(e=>new k(e)),x("div"),w(function(e){const t=e.output.map(e=>e.replace(J,Y)).map(e=>e.replace(X,Y)),n=t[0].match(Q).map(()=>[]);t.forEach(e=>{e.match(Q).forEach((e,t)=>n[t].push(+e))});const r=t[0].match(Q).map((t,r)=>_.create(i({},e,{output:n[r]})));return e=>{let n=0;return t[0].replace(Q,()=>r[n++](e)).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,(e,t,n,r,o)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${o})`)}}),y(P),b(function(e,t){const n=e.from,r=e.to,o=e.children;if(!ae(r).some(de)&&!ae(n).some(de))return;let u=o(le(e));if(!u)return;Array.isArray(u)&&(u={type:"div",props:{children:u}});const l=u.props.style;return a.createElement(u.type,i({key:u.key?u.key:void 0},u.props,{style:i({},l,{position:"absolute",visibility:"hidden"}),ref:o=>{if(o){let a,u,l=s.findDOMNode(o),c=getComputedStyle(l);if("border-box"===c.boxSizing)a=l.offsetWidth,u=l.offsetHeight;else{const e=parseFloat(c.paddingLeft||0)+parseFloat(c.paddingRight||0),t=parseFloat(c.paddingTop||0)+parseFloat(c.paddingBottom||0),n=parseFloat(c.borderLeftWidth||0)+parseFloat(c.borderRightWidth||0),r=parseFloat(c.borderTopWidth||0)+parseFloat(c.borderBottomWidth||0);a=l.offsetWidth-e-n,u=l.offsetHeight-t-r}const d=pe(a,u);t(i({},e,{from:Object.entries(n).reduce(d,n),to:Object.entries(r).reduce(d,r)}))}}}))}),v((e,t)=>{if(!e.nodeType||void 0===e.setAttribute)return!1;{const i=t.style,a=t.children,s=t.scrollTop,u=t.scrollLeft,l=o(t,["style","children","scrollTop","scrollLeft"]);void 0!==s&&(e.scrollTop=s),void 0!==u&&(e.scrollLeft=u),void 0!==a&&(e.textContent=a);for(let t in i)if(i.hasOwnProperty(t)){var n=0===t.indexOf("--"),r=me(t,i[t],n);"float"===t&&(t="cssFloat"),n?e.style.setProperty(t,r):e.style[t]=r}for(let t in l){const n=ge[t]||(ge[t]=t.replace(/([A-Z])/g,e=>"-"+e.toLowerCase()));void 0!==e.getAttribute(n)&&e.setAttribute(n,l[t])}}},e=>e);let ve=!1;const ye=new Set,be=()=>{let e=h();for(let t of ye){let n=!0,r=!0;for(let o=0;o<t.configs.length;o++){let i,a,s=t.configs[o];for(let o=0;o<s.animatedValues.length;o++){let u=s.animatedValues[o];if(u.done)continue;let l=s.fromValues[o],c=s.toValues[o],d=u.lastPosition,p=c instanceof E,f=Array.isArray(s.initialVelocity)?s.initialVelocity[o]:s.initialVelocity;if(p&&(c=c.getValue()),s.immediate||!p&&!s.decay&&l===c)u.updateValue(c),u.done=!0;else if(s.delay&&e-t.startTime<s.delay)n=!1;else if(r=!1,"string"!=typeof l&&"string"!=typeof c){if(void 0!==s.duration)d=l+s.easing((e-t.startTime-s.delay)/s.duration)*(c-l),i=e>=t.startTime+s.delay+s.duration;else if(s.decay)d=l+f/(1-.998)*(1-Math.exp(-(1-.998)*(e-t.startTime))),(i=Math.abs(u.lastPosition-d)<.1)&&(c=d);else{a=void 0!==u.lastTime?u.lastTime:e,f=void 0!==u.lastVelocity?u.lastVelocity:s.initialVelocity,e>a+64&&(a=e);let t=Math.floor(e-a);for(let e=0;e<t;++e){d+=1*(f+=1*((-s.tension*(d-c)+-s.friction*f)/s.mass)/1e3)/1e3}let n=!(!s.clamp||0===s.tension)&&(l<c?d>c:d<c),r=Math.abs(f)<=s.precision,o=0===s.tension||Math.abs(c-d)<=s.precision;i=n||r&&o,u.lastVelocity=f,u.lastTime=e}p&&!s.toValues[o].done&&(i=!1),i?(u.value!==c&&(d=c),u.done=!0):n=!1,u.updateValue(d),u.lastPosition=d}else u.updateValue(c),u.done=!0}!t.props.onFrame&&t.props.native||(t.animatedProps[s.name]=s.interpolation.getValue())}!t.props.onFrame&&t.props.native||(!t.props.native&&t.onUpdate&&t.onUpdate(),t.props.onFrame&&t.props.onFrame(t.animatedProps)),n&&(ye.delete(t),t.debouncedOnEnd({finished:!0,noChange:r}))}ye.size?d(be):ve=!1},we=e=>{ye.has(e)||(ye.add(e),ve||d(be),ve=!0)},xe=e=>{ye.has(e)&&ye.delete(e)};class Oe{constructor(e,t){void 0===t&&(t={native:!0,interpolateTo:!0,autoStart:!0}),this.getValues=(()=>this.props.native?this.interpolations:this.animatedProps),this.dependents=new Set,this.isActive=!1,this.hasChanged=!1,this.props={},this.merged={},this.animations={},this.interpolations={},this.animatedProps={},this.configs=[],this.frame=void 0,this.startTime=void 0,this.lastTime=void 0,this.update(i({},e,t))}update(e){this.props=i({},this.props,e);let t=this.props.interpolateTo?se(this.props):this.props,n=t.from,r=void 0===n?{}:n,o=t.to,a=void 0===o?{}:o,s=t.config,u=void 0===s?{}:s,l=t.delay,d=void 0===l?0:l,p=t.reverse,f=t.attach,h=t.reset,m=t.immediate,g=t.autoStart,v=t.ref;if(p){var y=[a,r];r=y[0],a=y[1]}this.hasChanged=!1;let b=f&&f(this),w=h?{}:this.merged;if(this.merged=i({},r,w,a),this.animations=Object.entries(this.merged).reduce((e,t,n)=>{let o=t[0],a=t[1],s=!h&&e[o]||{};const l="number"==typeof a,p="string"==typeof a&&!a.startsWith("#")&&!/\d/.test(a)&&!c[a],f=!l&&!p&&Array.isArray(a);let g=void 0!==r[o]?r[o]:a,v=l||f?a:p?a:1,y=ie(u,o);if(b&&(v=b.animations[o].parent),void 0===y.decay&&oe(s.changes,a))return e;{let t,n;if(this.hasChanged=!0,l||p)t=n=s.parent||new ee(g);else if(f)t=n=s.parent||new te(g);else{const e=s.interpolation&&s.interpolation.calc(s.parent.value);s.parent?(t=s.parent).setValue(0,!1):t=new ee(0);const r={output:[void 0!==e?e:g,a]};s.interpolation?(n=s.interpolation,s.interpolation.updateConfig(r)):n=t.interpolate(r)}ie(m,o)&&t.setValue(a,!1);const r=re(t.getPayload());return r.forEach(e=>e.prepare(this)),i({},e,{[o]:i({},s,{name:o,parent:t,interpolation:n,animatedValues:r,changes:a,fromValues:re(t.getValue()),toValues:re(b?v.getPayload():v),immediate:ie(m,o),delay:ne(y.delay,d||0),initialVelocity:ne(y.velocity,0),clamp:ne(y.clamp,!1),precision:ne(y.precision,.01),tension:ne(y.tension,170),friction:ne(y.friction,26),mass:ne(y.mass,1),duration:y.duration,easing:ne(y.easing,e=>e),decay:y.decay})})}},this.animations),this.hasChanged){this.configs=ae(this.animations),this.animatedProps={},this.interpolations={};for(let e in this.animations)this.interpolations[e]=this.animations[e].interpolation,this.animatedProps[e]=this.animations[e].interpolation.getValue()}for(var x=arguments.length,O=new Array(x>1?x-1:0),S=1;S<x;S++)O[S-1]=arguments[S];v||!g&&!O.length||this.start(...O);const E=O[0],I=O[1];return this.onEnd="function"==typeof E&&E,this.onUpdate=I,this.getValues()}start(e,t){return this.startTime=h(),this.isActive&&this.stop(),this.isActive=!0,this.onEnd="function"==typeof e&&e,this.onUpdate=t,this.props.onStart&&this.props.onStart(),we(this),new Promise(e=>this.resolve=e)}stop(e){void 0===e&&(e=!1),e&&ae(this.animations).forEach(e=>e.changes=void 0),this.debouncedOnEnd({finished:e})}destroy(){xe(this),this.props={},this.merged={},this.animations={},this.interpolations={},this.animatedProps={},this.configs=[]}debouncedOnEnd(e){xe(this),this.isActive=!1;const t=this.onEnd;this.onEnd=null,t&&t(e),this.resolve&&this.resolve(),this.resolve=null}}class Se extends j{constructor(e,t){super(),e.style&&(e=i({},e,{style:g(e.style)})),this.payload=e,this.update=t,this.attach()}}function Ee(e){class t extends a.Component{constructor(e){super(),this.callback=(()=>{if(this.node){!1===l.fn(this.node,this.propsAnimated.getAnimatedValue(),this)&&this.forceUpdate()}}),this.attachProps(e)}componentWillUnmount(){this.propsAnimated&&this.propsAnimated.detach()}setNativeProps(e){!1===l.fn(this.node,e,this)&&this.forceUpdate()}attachProps(e){e.forwardRef;let t=o(e,["forwardRef"]);const n=this.propsAnimated;this.propsAnimated=new Se(t,this.callback),n&&n.detach()}shouldComponentUpdate(e){const t=e.style,n=o(e,["style"]),r=this.props,i=r.style;return(!oe(o(r,["style"]),n)||!oe(i,t))&&(this.attachProps(e),!0)}render(){const t=this.propsAnimated.getValue(),n=(t.scrollTop,t.scrollLeft,o(t,["scrollTop","scrollLeft"]));return a.createElement(e,i({},n,{ref:e=>this.node=ce(e,this.props.forwardRef)}))}}return a.forwardRef((e,n)=>a.createElement(t,i({},e,{forwardRef:n})))}const Ie={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}};class Ce extends a.Component{constructor(){super(...arguments),this.state={lastProps:{from:{},to:{}},propsChanged:!1,internal:!1},this.controller=new Oe(null,null),this.didUpdate=!1,this.didInject=!1,this.finished=!0,this.start=(()=>{this.finished=!1;let e=this.mounted;this.controller.start(t=>this.finish(i({},t,{wasMounted:e})),this.update)}),this.stop=(()=>this.controller.stop(!0)),this.update=(()=>this.mounted&&this.setState({internal:!0})),this.finish=(e=>{let t=e.finished,n=e.noChange,r=e.wasMounted;this.finished=!0,this.mounted&&t&&(!this.props.onRest||!r&&n||this.props.onRest(this.controller.merged),this.mounted&&this.didInject&&(this.afterInject=le(this.props),this.setState({internal:!0})),this.mounted&&(this.didInject||this.props.after)&&this.setState({internal:!0}),this.didInject=!1)})}componentDidMount(){this.componentDidUpdate(),this.mounted=!0}componentWillUnmount(){this.mounted=!1,this.stop()}static getDerivedStateFromProps(e,t){let n=t.internal,r=t.lastProps;const o=e.from,i=e.to,a=e.reset,s=e.force;return{propsChanged:!oe(i,r.to)||!oe(o,r.from)||a&&!n||s&&!n,lastProps:e,internal:!1}}render(){const e=this.props.children,t=this.state.propsChanged;if(this.props.inject&&t&&!this.injectProps){const e=this.props.inject(this.props,e=>{this.injectProps=e,this.setState({internal:!0})});if(e)return e}(this.injectProps||t)&&(this.didInject=!1,this.injectProps?(this.controller.update(this.injectProps),this.didInject=!0):t&&this.controller.update(this.props),this.didUpdate=!0,this.afterInject=void 0,this.injectProps=void 0);let n=i({},this.controller.getValues(),this.afterInject);return this.finished&&(n=i({},n,this.props.after)),Object.keys(n).length?e(n):null}componentDidUpdate(){this.didUpdate&&this.start(),this.didUpdate=!1}}Ce.defaultProps={from:{},to:{},config:Ie.default,native:!1,immediate:!1,reset:!1,force:!1,inject:u};class Ae extends a.PureComponent{constructor(){super(...arguments),this.first=!0,this.instances=new Set,this.hook=((e,t,n,r)=>(this.instances.add(e),(r?t===n-1:0===t)?void 0:Array.from(this.instances)[r?t+1:t-1]))}render(){const e=this.props,t=e.items,n=e.children,r=e.from,s=void 0===r?{}:r,u=e.initial,l=e.reverse,c=e.keys,d=e.delay,p=e.onRest,f=o(e,["items","children","from","initial","reverse","keys","delay","onRest"]),h=re(t);return re(h).map((e,t)=>a.createElement(Ce,i({onRest:0===t?p:null,key:"function"==typeof c?c(e):re(c)[t],from:this.first&&void 0!==u?u||{}:s},f,{delay:0===t&&d||void 0,attach:e=>this.hook(e,t,h.length,l),children:r=>{const o=n(e,t);return o?o(r):null}})))}componentDidUpdate(e){this.first=!1,e.items!==this.props.items&&this.instances.clear()}}Ae.defaultProps={keys:e=>e};class je extends a.PureComponent{constructor(){var e;super(...arguments),e=this,this.guid=0,this.state={props:{},resolve:()=>null,last:!0,index:0},this.next=function(t,n,r){return void 0===n&&(n=!0),void 0===r&&(r=0),e.running=!0,new Promise(o=>{e.mounted&&e.setState(e=>({props:t,resolve:o,last:n,index:r}),()=>e.running=!1)})}}componentDidMount(){this.mounted=!0,this.componentDidUpdate({})}componentWillUnmount(){this.mounted=!1}componentDidUpdate(e){var t=this;const n=this.props,r=n.states,o=n.filter,i=n.state;if((e.state!==this.props.state||this.props.reset&&!this.running||!oe(r[i],e.states[e.state]))&&r&&i&&r[i]){const e=++this.guid,n=r[i];if(n)if(Array.isArray(n)){let t=Promise.resolve();for(let r=0;r<n.length;r++){let i=r,a=n[i],s=i===n.length-1;t=t.then(()=>e===this.guid&&this.next(o(a),s,i))}}else if("function"==typeof n){let r=0;n(function(n,i){return void 0===i&&(i=!1),e===t.guid&&t.next(o(n),i,r++)},()=>d(()=>this.instance&&this.instance.stop()),this.props)}else this.next(o(r[i]))}}render(){const e=this.state,t=e.props,n=e.resolve,r=e.last,s=e.index;if(!t||0===Object.keys(t).length)return null;let u=this.props,l=(u.state,u.filter,u.states,u.config),c=u.primitive,d=u.onRest,p=u.forwardRef,f=o(u,["state","filter","states","config","primitive","onRest","forwardRef"]);return Array.isArray(l)&&(l=l[s]),a.createElement(c,i({ref:e=>this.instance=ce(e,p),config:l},f,t,{onRest:e=>{n(e),d&&r&&d(e)}}))}}je.defaultProps={state:"__default"};const ke=a.forwardRef((e,t)=>a.createElement(je,i({},e,{forwardRef:t})));ke.create=(e=>(function(t,n){return void 0===n&&(n=(e=>e)),("function"==typeof t||Array.isArray(t))&&(t={__default:t}),r=>a.createElement(je,i({primitive:e,states:t,filter:n},r))})),ke.Spring=(e=>ke.create(Ce)(e,se)),ke.Trail=(e=>ke.create(Ae)(e,se));let Pe=0,_e=e=>{let t=e.items,n=e.keys,r=o(e,["items","keys"]);return t=re(void 0!==t?t:null),n="function"==typeof n?t.map(n):re(n),i({items:t,keys:n.map(e=>String(e))},r)};class Te extends a.PureComponent{componentDidMount(){this.mounted=!0}componentWillUnmount(){this.mounted=!1}constructor(e){super(e),this.destroyItem=((e,t,n)=>r=>{const o=this.props,i=o.onRest,a=o.onDestroyed;this.mounted&&(a&&a(e),this.setState(e=>{return{deleted:e.deleted.filter(e=>e.key!==t)}}),i&&i(e,n,r))}),this.state={first:!0,transitions:[],current:{},deleted:[],prevProps:e}}static getDerivedStateFromProps(e,t){let n=t.first,r=t.prevProps,a=o(t,["first","prevProps"]),s=_e(e),u=s.items,l=s.keys,c=s.initial,d=s.from,p=s.enter,f=s.leave,h=s.update,m=s.trail,g=void 0===m?0:m,v=s.unique,y=s.config,b=_e(r),w=b.keys,x=b.items,O=i({},a.current),S=[...a.deleted],E=Object.keys(O),I=new Set(E),C=new Set(l),A=l.filter(e=>!I.has(e)),j=a.transitions.filter(e=>!e.destroyed&&!C.has(e.originalKey)).map(e=>e.originalKey),k=l.filter(e=>I.has(e)),P=0;A.forEach(e=>{v&&S.find(t=>t.originalKey===e)&&(S=S.filter(t=>t.originalKey!==e));const t=l.indexOf(e),r=u[t];O[e]={state:"enter",originalKey:e,key:v?String(e):Pe++,item:r,trail:P+=g,config:ie(y,r,"enter"),from:ie(n&&void 0!==c?c||{}:d,r),to:ie(p,r)}}),j.forEach(e=>{const t=w.indexOf(e),n=x[t];S.push(i({},O[e],{state:"leave",destroyed:!0,left:w[Math.max(0,t-1)],right:w[Math.min(w.length,t+1)],trail:P+=g,config:ie(y,n,"leave"),to:ie(f,n)})),delete O[e]}),k.forEach(e=>{const t=l.indexOf(e),n=u[t];O[e]=i({},O[e],{item:n,state:"update",trail:P+=g,config:ie(y,n,"update"),to:ie(h,n)})});let _=l.map(e=>O[e]);return S.forEach(e=>{let t,n=e.left,r=e.right,i=o(e,["left","right"]);-1!==(t=_.findIndex(e=>e.originalKey===n))&&(t+=1),-1===t&&(t=_.findIndex(e=>e.originalKey===r)),-1===t&&(t=S.findIndex(e=>e.originalKey===n)),-1===t&&(t=S.findIndex(e=>e.originalKey===r)),t=Math.max(0,t),_=[..._.slice(0,t),i,..._.slice(t)]}),{first:n&&0===A.length,transitions:_,current:O,deleted:S,prevProps:e}}render(){const e=this.props,t=(e.initial,e.from,e.enter,e.leave,e.update,e.onDestroyed,e.keys,e.items,e.onFrame),n=e.onRest,r=e.onStart,s=(e.trail,e.config,e.children),u=(e.unique,e.reset),l=o(e,["initial","from","enter","leave","update","onDestroyed","keys","items","onFrame","onRest","onStart","trail","config","children","unique","reset"]);return this.state.transitions.map((e,o)=>{let c=e.state,d=e.key,p=e.item,f=e.from,h=e.to,m=e.trail,g=e.config,v=e.destroyed;return a.createElement(ke,i({reset:u&&"enter"===c,primitive:Ce,state:c,filter:se,states:{[c]:h},key:d,onRest:v?this.destroyItem(p,d,c):n&&(e=>n(p,c,e)),onStart:r&&(()=>r(p,c)),onFrame:t&&(e=>t(p,c,e)),delay:m,config:g},l,{from:f,children:e=>{const t=s(p,c,o);return t?t(e):null}}))})}}Te.defaultProps={keys:e=>e,unique:!1,reset:!1};const Me=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].reduce((e,t)=>(e[t]=Ee(t),e),Ee);t.Spring=Ce,t.Keyframes=ke,t.Transition=Te,t.Trail=Ae,t.Controller=Oe,t.config=Ie,t.animated=Me,t.interpolate=((e,t,n)=>e&&new Z(e,t,n)),t.Globals=S},function(e,t){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}},function(e,t,n){e.exports=n(19)()},function(e,t,n){e.exports=n(21)()},function(e,t){e.exports=window.BlocksyReactDOM},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n.apply(this,arguments)}e.exports=n},function(e,t,n){"use strict";e.exports=n(27)},function(e,t){e.exports=function(e,t,n,r){var o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),u=0;u<i.length;u++){var l=i[u];if(!s(l))return!1;var c=e[l],d=t[l];if(!1===(o=n?n.call(r,c,d,l):void 0)||void 0===o&&c!==d)return!1}return!0}},,,,function(e,t,n){"use strict";var r=n(20);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";var r=n(22);function o(){}e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=o,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){var r=n(24);"string"==typeof r&&(r=[[e.i,r,""]]);n(26)(r,{});r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(25)()).push([e.i,"/* This code is subject to LICENSE in root of this repository */\n\n/* Used to detect in JavaScript if apps have loaded styles or not. */\n:root {\n --reach-dialog: 1;\n}\n\n[data-reach-dialog-overlay] {\n background: hsla(0, 0%, 0%, 0.33);\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n overflow: auto;\n}\n\n[data-reach-dialog-content] {\n width: 50vw;\n margin: 10vh auto;\n background: white;\n padding: 2rem;\n outline: none;\n}\n","",{version:3,sources:["/Users/andreiglingeanu/Projects/full/plugins/blocksy-companion/node_modules/@reach/dialog/styles.css"],names:[],mappings:"AAAA,gEAAgE;;AAEhE,qEAAqE;AACrE;EACE,kBAAkB;CACnB;;AAED;EACE,kCAAkC;EAClC,gBAAgB;EAChB,OAAO;EACP,SAAS;EACT,UAAU;EACV,QAAQ;EACR,eAAe;CAChB;;AAED;EACE,YAAY;EACZ,kBAAkB;EAClB,kBAAkB;EAClB,cAAc;EACd,cAAc;CACf",file:"styles.css",sourcesContent:["/* This code is subject to LICENSE in root of this repository */\n\n/* Used to detect in JavaScript if apps have loaded styles or not. */\n:root {\n --reach-dialog: 1;\n}\n\n[data-reach-dialog-overlay] {\n background: hsla(0, 0%, 0%, 0.33);\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n overflow: auto;\n}\n\n[data-reach-dialog-content] {\n width: 50vw;\n margin: 10vh auto;\n background: white;\n padding: 2rem;\n outline: none;\n}\n"],sourceRoot:""}])},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t];n[2]?e.push("@media "+n[2]+"{"+n[1]+"}"):e.push(n[1])}return e.join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];"number"==typeof i&&(r[i]=!0)}for(o=0;o<t.length;o++){var a=t[o];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),e.push(a))}},e}},function(e,t){var n={},r=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}},o=r(function(){return/msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase())}),i=r(function(){return document.head||document.getElementsByTagName("head")[0]}),a=null,s=0,u=[];function l(e,t){for(var r=0;r<e.length;r++){var o=e[r],i=n[o.id];if(i){i.refs++;for(var a=0;a<i.parts.length;a++)i.parts[a](o.parts[a]);for(;a<o.parts.length;a++)i.parts.push(h(o.parts[a],t))}else{var s=[];for(a=0;a<o.parts.length;a++)s.push(h(o.parts[a],t));n[o.id]={id:o.id,refs:1,parts:s}}}}function c(e){for(var t=[],n={},r=0;r<e.length;r++){var o=e[r],i=o[0],a={css:o[1],media:o[2],sourceMap:o[3]};n[i]?n[i].parts.push(a):t.push(n[i]={id:i,parts:[a]})}return t}function d(e,t){var n=i(),r=u[u.length-1];if("top"===e.insertAt)r?r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),u.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){e.parentNode.removeChild(e);var t=u.indexOf(e);t>=0&&u.splice(t,1)}function f(e){var t=document.createElement("style");return t.type="text/css",d(e,t),t}function h(e,t){var n,r,o;if(t.singleton){var i=s++;n=a||(a=f(t)),r=v.bind(null,n,i,!1),o=v.bind(null,n,i,!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 t.rel="stylesheet",d(e,t),t}(t),r=function(e,t){var n=t.css,r=t.sourceMap;r&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var o=new Blob([n],{type:"text/css"}),i=e.href;e.href=URL.createObjectURL(o),i&&URL.revokeObjectURL(i)}.bind(null,n),o=function(){p(n),n.href&&URL.revokeObjectURL(n.href)}):(n=f(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()}}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");void 0===(t=t||{}).singleton&&(t.singleton=o()),void 0===t.insertAt&&(t.insertAt="bottom");var r=c(e);return l(r,t),function(e){for(var o=[],i=0;i<r.length;i++){var a=r[i];(s=n[a.id]).refs--,o.push(s)}e&&l(c(e),t);for(i=0;i<o.length;i++){var s;if(0===(s=o[i]).refs){for(var u=0;u<s.parts.length;u++)s.parts[u]();delete n[s.id]}}}};var m,g=(m=[],function(e,t){return m[e]=t,m.filter(Boolean).join("\n")});function v(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=g(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}},function(e,t,n){"use strict";
|
| 13 |
-
/** @license React v16.8.6
|
| 14 |
* react-is.production.min.js
|
| 15 |
*
|
| 16 |
* Copyright (c) Facebook, Inc. and its affiliates.
|
| 17 |
*
|
| 18 |
* This source code is licensed under the MIT license found in the
|
| 19 |
* LICENSE file in the root directory of this source tree.
|
| 20 |
-
*/Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,l=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,d=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,h=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116;function v(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case d:case p:case a:case u:case s:case h:return e;default:switch(e=e&&e.$$typeof){case c:case f:case l:return e;default:return t}}case g:case m:case i:return t}}}function y(e){return v(e)===p}t.typeOf=v,t.AsyncMode=d,t.ConcurrentMode=p,t.ContextConsumer=c,t.ContextProvider=l,t.Element=o,t.ForwardRef=f,t.Fragment=a,t.Lazy=g,t.Memo=m,t.Portal=i,t.Profiler=u,t.StrictMode=s,t.Suspense=h,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===p||e===u||e===s||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===l||e.$$typeof===c||e.$$typeof===f)},t.isAsyncMode=function(e){return y(e)||v(e)===d},t.isConcurrentMode=y,t.isContextConsumer=function(e){return v(e)===c},t.isContextProvider=function(e){return v(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return v(e)===f},t.isFragment=function(e){return v(e)===a},t.isLazy=function(e){return v(e)===g},t.isMemo=function(e){return v(e)===m},t.isPortal=function(e){return v(e)===i},t.isProfiler=function(e){return v(e)===u},t.isStrictMode=function(e){return v(e)===s},t.isSuspense=function(e){return v(e)===h}},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"FOCUS_GROUP",function(){return T}),n.d(r,"FOCUS_DISABLED",function(){return M}),n.d(r,"FOCUS_ALLOW",function(){return R}),n.d(r,"FOCUS_AUTO",function(){return D});var o=n(0),i=n(3),a=n(7),s=n.n(a),u=n(8),l=n(1),c=n.n(l);n(10);function d(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}var p=function(e){e.initialState,e.getInitialState,e.refs,e.getRefs,e.didMount,e.didUpdate,e.willUnmount,e.getSnapshotBeforeUpdate,e.shouldUpdate,e.render;return function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["initialState","getInitialState","refs","getRefs","didMount","didUpdate","willUnmount","getSnapshotBeforeUpdate","shouldUpdate","render"])},f=function(e){function t(){var n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=d(this,e.call.apply(e,[this].concat(i))),h.call(r),d(r,n)}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,e),t.prototype.getArgs=function(){var e=this.state,t=this.props,n=this._setState,r=this._forceUpdate,o=this._refs;return{state:e,props:p(t),refs:o,setState:n,forceUpdate:r}},t.prototype.componentDidMount=function(){this.props.didMount&&this.props.didMount(this.getArgs())},t.prototype.shouldComponentUpdate=function(e,t){return!this.props.shouldUpdate||this.props.shouldUpdate({props:this.props,state:this.state,nextProps:p(e),nextState:t})},t.prototype.componentWillUnmount=function(){this.props.willUnmount&&this.props.willUnmount({state:this.state,props:p(this.props),refs:this._refs})},t.prototype.componentDidUpdate=function(e,t,n){this.props.didUpdate&&this.props.didUpdate(Object.assign(this.getArgs(),{prevProps:p(e),prevState:t}),n)},t.prototype.getSnapshotBeforeUpdate=function(e,t){return this.props.getSnapshotBeforeUpdate?this.props.getSnapshotBeforeUpdate(Object.assign(this.getArgs(),{prevProps:p(e),prevState:t})):null},t.prototype.render=function(){var e=this.props,t=e.children,n=e.render;return n?n(this.getArgs()):"function"==typeof t?t(this.getArgs()):t||null},t}(c.a.Component);f.defaultProps={getInitialState:function(){},getRefs:function(){return{}}};var h=function(){var e=this;this.state=this.props.initialState||this.props.getInitialState(this.props),this._refs=this.props.refs||this.props.getRefs(this.getArgs()),this._setState=function(){return e.setState.apply(e,arguments)},this._forceUpdate=function(){return e.forceUpdate.apply(e,arguments)}},m=f,g=n(12),v=function(e){var t=e.children,n=e.type,r=void 0===n?"reach-portal":n;return c.a.createElement(m,{getRefs:function(){return{node:null}},didMount:function(e){var t=e.refs,n=e.forceUpdate;t.node=document.createElement(r),document.body.appendChild(t.node),n()},willUnmount:function(e){var t=e.refs.node;document.body.removeChild(t)},render:function(e){var n=e.refs.node;return n?Object(g.createPortal)(t,n):null}})};var y=function(e,t){return function(n){if(e&&e(n),!n.defaultPrevented)return t(n)}},b=n(13),w=n.n(b),x=n(9),O=n.n(x),S=n(2),E=n.n(S),I=n(5),C=n.n(I),A=(n(11),function(e){for(var t=Array(e.length),n=0;n<e.length;++n)t[n]=e[n];return t}),j=function(e){return Array.isArray(e)?e:[e]},k=function(e,t){var n=e.tabIndex-t.tabIndex,r=e.index-t.index;if(n){if(!e.tabIndex)return 1;if(!t.tabIndex)return-1}return n||r},P=function(e,t,n){return A(e).map(function(e,t){return{node:e,index:t,tabIndex:n&&-1===e.tabIndex?(e.dataset||{}).focusGuard?0:-1:e.tabIndex}}).filter(function(e){return!t||e.tabIndex>=0}).sort(k)},_=["button:enabled:not([readonly])","select:enabled:not([readonly])","textarea:enabled:not([readonly])","input:enabled:not([readonly])","a[href]","area[href]","iframe","object","embed","[tabindex]","[contenteditable]","[autofocus]"],T="data-focus-lock",M="data-focus-lock-disabled",R="data-no-focus-lock",D="data-autofocus-inside",U=_.join(","),F=U+", [data-focus-guard]",V=function(e,t){return e.reduce(function(e,n){return e.concat(A(n.querySelectorAll(t?F:U)),n.parentNode?A(n.parentNode.querySelectorAll(_.join(","))).filter(function(e){return e===n}):[])},[])},L=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n.push(t),t.parentNode&&e(t.parentNode,n),n},H=function(e,t){for(var n=L(e),r=L(t),o=0;o<n.length;o+=1){var i=n[o];if(r.indexOf(i)>=0)return i}return!1},N=function(e){return A(e).filter(function(e){return function e(t){return!t||t===document||!((n=window.getComputedStyle(t,null))&&n.getPropertyValue&&("none"===n.getPropertyValue("display")||"hidden"===n.getPropertyValue("visibility")))&&e(t.parentNode);var n}(e)}).filter(function(e){return function(e){return!(("INPUT"===e.tagName||"BUTTON"===e.tagName)&&("hidden"===e.type||e.disabled))}(e)})},B=function(e,t){return P(N(V(e,t)),!0,t)},K=function(e){return N((t=e.querySelectorAll("["+D+"]"),A(t).map(function(e){return V([e])}).reduce(function(e,t){return e.concat(t)},[])));var t},W=function(e){return"INPUT"===e.tagName&&"radio"===e.type},q=function(e){return e[0]&&e.length>1&&W(e[0])&&e[0].name?function(e,t){return t.filter(W).filter(function(t){return t.name===e.name}).filter(function(e){return e.checked})[0]||e}(e[0],e):e[0]},$="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},z=function(e){return j(e).filter(Boolean).reduce(function(e,t){var n=t.getAttribute(T);return e.push.apply(e,n?function e(t){for(var n=t.length,r=0;r<n;r+=1)for(var o=function(n){if(r!==n&&t[r].contains(t[n]))return{v:e(t.filter(function(e){return e!==t[n]}))}},i=0;i<n;i+=1){var a=o(i);if("object"===(void 0===a?"undefined":$(a)))return a.v}return t}(A(function e(t){return t.parentNode?e(t.parentNode):t}(t).querySelectorAll("["+T+'="'+n+'"]:not(['+M+'="disabled"])'))):[t]),e},[])},G=function(e,t,n){var r=j(e),o=j(t),i=r[0],a=null;return o.filter(Boolean).forEach(function(e){a=H(a||e,e)||a,n.filter(Boolean).forEach(function(e){var t=H(i,e);t&&(a=!a||t.contains(a)?t:H(t,a))})}),a},Y=function(e){return!(e.dataset&&e.dataset.focusGuard)},Q=function(e,t){var n=document&&document.activeElement,r=z(e).filter(Y),o=G(n||e,e,r),i=B(r).filter(function(e){var t=e.node;return Y(t)});if(i[0]||(i=(a=r,P(N(V(a)),!1)).filter(function(e){var t=e.node;return Y(t)}))[0]){var a,s,u,l=B([o]).map(function(e){return e.node}),c=(s=i,l.map(function(e){return s.find(function(t){var n=t.node;return e===n})}).filter(Boolean)),d=c.map(function(e){return e.node}),p=function(e,t,n,r,o){var i=e.length,a=e[0],s=e[i-1];if(!(e.indexOf(n)>=0)){var u=t.indexOf(n),l=t.indexOf(r||u),c=e.indexOf(r),d=u-l,p=t.indexOf(a),f=t.indexOf(s);return-1===u||-1===c?e.indexOf(o.length?q(o):q(e)):!d&&c>=0?c:d&&Math.abs(d)>1?c:u<=p?i-1:u>f?0:d?Math.abs(d)>1?c:(i+c+d)%i:void 0}}(d,l,n,t,d.filter((u=function(e){return e.reduce(function(e,t){return e.concat(K(t))},[])}(r),function(e){return!!e.autofocus||e.dataset&&!!e.dataset.autofocus||u.indexOf(e)>=0})));return void 0===p?p:c[p]}},J=function(e){return e===document.activeElement},X=function(e){var t=document&&document.activeElement;return!(!t||t.dataset&&t.dataset.focusGuard)&&z(e).reduce(function(e,n){return e||n.contains(t)||(r=A(n.querySelectorAll("iframe")),o=J,!!r.filter(function(e){return e===o})[0]);var r,o},!1)},Z=function(){return document&&A(document.querySelectorAll("["+R+"]")).some(function(e){return e.contains(document.activeElement)})},ee=0,te=!1,ne=function(e,t){var n,r=Q(e,t);if(!te&&r){if(ee>2)return console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),te=!0,void setTimeout(function(){te=!1},1);ee++,(n=r.node).focus(),n.contentWindow&&n.contentWindow.focus(),ee--}},re=n(15),oe=n.n(re);function ie(e){var t=window.setImmediate;void 0!==t?t(e):setTimeout(e,1)}var ae=function(){return document&&document.activeElement===document.body||Z()},se=null,ue=null,le=null;function ce(e,t,n,r){var o=null,i=e;do{var a=r[i];if(a.guard)a.node.dataset.focusAutoGuard&&(o=a);else{if(!a.lockItem)break;if(i!==e)return;o=null}}while((i+=n)!==t);o&&(o.node.tabIndex=0)}var de=function(e){return e&&"current"in e?e.current:e},pe=function(){var e,t,n,r,o,i,a=!1;if(se){var s=se,u=s.observed,l=s.persistentFocus,c=s.autoFocus,d=s.shards,p=u||le&&le.portaledElement,f=document&&document.activeElement;if(p){var h=[p].concat(d.map(de).filter(Boolean));if(f&&!function(e){return(se.whiteList||function(){return!0})(e)}(f)||(l||!ae()||!ue&&c)&&(!p||X(h)||(i=f,le&&le.portaledElement===i)||(document&&!ue&&f&&!c?(f.blur(),document.body.focus()):(a=ne(h,ue),le={})),ue=document&&document.activeElement),document){var m=document&&document.activeElement,g=(t=z(e=h).filter(Y),n=G(e,e,t),r=B([n],!0),o=B(t).filter(function(e){var t=e.node;return Y(t)}).map(function(e){return e.node}),r.map(function(e){var t=e.node;return{node:t,index:e.index,lockItem:o.indexOf(t)>=0,guard:!Y(t)}})),v=g.find(function(e){return e.node===m});if(v){g.filter(function(e){var t=e.guard,n=e.node;return t&&n.dataset.focusAutoGuard}).forEach(function(e){return e.node.removeAttribute("tabIndex")});var y=g.indexOf(v);ce(y,g.length,1,g),ce(y,-1,-1,g)}}}}return a},fe=function(e){pe()&&e&&(e.stopPropagation(),e.preventDefault())},he=function(){return ie(pe)},me=function(e){var t=e.target,n=e.currentTarget;n.contains(t)||(le={observerNode:n,portaledElement:t})},ge=function(){document.addEventListener("focusin",fe,!0),document.addEventListener("focusout",he)},ve=function(){document.removeEventListener("focusin",fe,!0),document.removeEventListener("focusout",he)};var ye=function(e,t){return function(n){var r,o=[];function i(){r=e(o.map(function(e){return e.props})),t(r)}var a=function(e){function t(){return e.apply(this,arguments)||this}O()(t,e),t.peek=function(){return r};var a=t.prototype;return a.shouldComponentUpdate=function(e){return!oe()(e,this.props)},a.componentDidMount=function(){o.push(this),i()},a.componentDidUpdate=function(){i()},a.componentWillUnmount=function(){var e=o.indexOf(this);o.splice(e,1),i()},a.render=function(){return c.a.createElement(n,this.props)},t}(l.Component);return C()(a,"displayName","SideEffect("+function(e){return e.displayName||e.name||"Component"}(n)+")"),a}}(function(e){return e.filter(function(e){return!e.disabled}).slice(-1)[0]},function(e){e&&!se&&ge();var t=se,n=t&&e&&e.onActivation===t.onActivation;se=e,t&&!n&&t.onDeactivation(),e?(ue=null,n&&t.observed===e.observed||e.onActivation(),pe(!0),ie(pe)):(ve(),ue=null)})(function(){return null}),be={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},we=function(e){var t=e.children;return c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{key:"guard-first","data-focus-guard":!0,"data-focus-auto-guard":!0,style:be}),t,t&&c.a.createElement("div",{key:"guard-last","data-focus-guard":!0,"data-focus-auto-guard":!0,style:be}))};we.propTypes={},we.defaultProps={children:null};var xe=function(e){var t=e.children;return c.a.createElement("div",null,t)};xe.propTypes={};var Oe=c.a.Fragment?c.a.Fragment:xe,Se=[],Ee=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t=e.call.apply(e,[this].concat(r))||this,C()(E()(E()(t)),"state",{observed:void 0}),C()(E()(E()(t)),"onActivation",function(){t.originalFocusedElement=t.originalFocusedElement||document&&document.activeElement,t.state.observed&&t.props.onActivation&&t.props.onActivation(t.state.observed),t.isActive=!0}),C()(E()(E()(t)),"onDeactivation",function(){t.isActive=!1,t.props.returnFocus&&t.originalFocusedElement&&t.originalFocusedElement.focus&&(t.originalFocusedElement.focus(),t.originalFocusedElement=null),t.props.onDeactivation&&t.props.onDeactivation(t.state.observed)}),C()(E()(E()(t)),"onFocus",function(e){t.isActive&&me(e)}),C()(E()(E()(t)),"onBlur",he),C()(E()(E()(t)),"setObserveNode",function(e){return t.setState({observed:e})}),C()(E()(E()(t)),"isActive",!1),C()(E()(E()(t)),"update",function(){return t.setState(function(e){return{escapeAttempts:e.escapeAttempts+1}})}),C()(E()(E()(t)),"originalFocusedElement",null),t}return O()(t,e),t.prototype.render=function(){var e,t=this.props,n=t.children,o=t.disabled,i=t.noFocusGuards,a=t.persistentFocus,s=t.autoFocus,u=(t.allowTextSelection,t.group),l=t.className,d=t.whiteList,p=t.shards,f=void 0===p?Se:p,h=t.as,m=void 0===h?"div":h,g=t.lockProps,v=void 0===g?{}:g,y=this.state.observed;var b=w()(((e={})[r.FOCUS_DISABLED]=o&&"disabled",e[r.FOCUS_GROUP]=u,e),v);return c.a.createElement(Oe,null,!i&&[c.a.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:o?-1:0,style:be}),c.a.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:o?-1:1,style:be})],c.a.createElement(m,w()({ref:this.setObserveNode},b,{className:l,onBlur:this.onBlur,onFocus:this.onFocus}),c.a.createElement(ye,{observed:y,disabled:o,persistentFocus:a,autoFocus:s,whiteList:d,shards:f,onActivation:this.onActivation,onDeactivation:this.onDeactivation}),n),!i&&c.a.createElement("div",{"data-focus-guard":!0,tabIndex:o?-1:0,style:be}))},t}(l.Component);Ee.propTypes={},Ee.defaultProps={disabled:!1,returnFocus:!1,noFocusGuards:!1,autoFocus:!0,persistentFocus:!1,allowTextSelection:void 0,group:void 0,className:void 0,whiteList:void 0,shards:void 0,as:"div",lockProps:{},onActivation:void 0,onDeactivation:void 0};var Ie=Ee,Ce=function(e,t){return(Ce=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function Ae(e,t){function n(){this.constructor=e}Ce(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var je=function(){return(je=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};var ke,Pe={left:0,top:0,right:0,gap:0},_e=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Pe;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[parseInt(n||"",10)||0,parseInt(r||"",10)||0,parseInt(o||"",10)||0]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Te=(ke=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");return e.type="text/css",e}())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){!--e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}}(),function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ae(t,e),t.prototype.componentDidMount=function(){ke.add(this.props.styles)},t.prototype.componentWillUnmount=function(){ke.remove()},t.prototype.render=function(){return null},t}(l.PureComponent)),Me=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n body {\n overflow: hidden "+r+";\n "+[t&&"position: relative "+r+";","margin"==n&&"\n padding-left: "+o+"px;\n padding-top: "+i+"px;\n padding-right: "+a+"px;\n margin-left:0;\n margin-top:0;\n margin-right: "+s+"px "+r+";\n ","padding"==n&&"padding-right: "+s+"px "+r+";"].filter(Boolean).join("")+"\n }\n \n .right-scroll-bar-position {\n right: "+s+"px "+r+";\n }\n \n .width-before-scroll-bar {\n margin-right: "+s+"px "+r+";\n }\n \n .right-scroll-bar-position .right-scroll-bar-position {\n right: 0 "+r+";\n }\n \n .width-before-scroll-bar .width-before-scroll-bar {\n margin-right: 0 "+r+";\n }\n"},Re=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={gap:_e(t.props.gapMode)},t.onResize=function(){t.forceUpdate(),t.state.gap&&t.props.dynamic&&window.innerHeight>document.body.offsetHeight&&t.setState({gap:Pe})},t}return Ae(t,e),t.prototype.componentDidMount=function(){var e=_e(this.props.gapMode);e!==this.state.gap&&this.setState({gap:e}),"undefined"!=typeof window&&window.addEventListener("resize",this.onResize)},t.prototype.componentWillUnmount=function(){"undefined"!=typeof window&&window.removeEventListener("resize",this.onResize)},t.prototype.componentDidUpdate=function(){if(!this.state.gap){var e=_e(this.props.gapMode);e!==this.state.gap&&this.setState({gap:e})}},t.prototype.render=function(){var e=this.props,t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r,i=this.state.gap;return i.gap?l.createElement(Te,{styles:Me(i,!t,o,n?"":"!important")}):null},t}(l.Component),De=function(e,t,n){var r,o=n,i=t.target,a=e.contains(i),s=!1,u=o>0,l=0,c=0;do{var d=i.scrollTop,p=i.scrollHeight-i.clientHeight-d;(d||p)&&(r=i,"hidden"!==window.getComputedStyle(r).overflowY&&(l+=p,c+=d)),i=i.parentNode}while(!a&&i!==document.body||a&&(e.contains(i)||e===i));return u&&o>l?s=!0:!u&&-o>c&&(s=!0),s},Ue=!1;if("undefined"!=typeof window)try{var Fe=Object.defineProperty({},"passive",{get:function(){return Ue=!0,!0}});window.addEventListener("test",Fe,Fe),window.removeEventListener("test",Fe,Fe)}catch(e){Ue=!1}var Ve=!!Ue&&{passive:!1},Le=function(e){return e.changedTouches?e.changedTouches[0].clientY:0},He={fullWidth:"width-before-scroll-bar",zeroRight:"right-scroll-bar-position"},Ne=function(e){return e&&"current"in e?e.current:e},Be=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.shouldPreventQueue=[],n.touchStart=0,n.ref=l.createRef(),n.shouldPrevent=function(e){var r=t.stack.filter(function(e){return e.props.enabled});if(r.length&&r[r.length-1]===n){var o=e.deltaY||Le(e),i=n.shouldPreventQueue.filter(function(t){return t.name===e.type&&t.delta===o&&t.target===e.target})[0];if(i&&i.should)e.preventDefault();else if(!i){var a=(n.props.shards||[]).map(Ne).filter(Boolean).filter(function(t){return t.contains(e.target)});(a.length>0?n.shouldCancelEvent(e,a[0]):!n.props.noIsolation)&&e.preventDefault()}}},n.shouldCancel=function(e,t,r,o){var i={name:e,delta:t,target:r,should:o};n.shouldPreventQueue.push(i),setTimeout(function(){n.shouldPreventQueue=n.shouldPreventQueue.filter(function(e){return e!==i})},1)},n.scrollTouchStart=function(e){n.touchStart=Le(e)},n.scrollWheel=function(e){n.shouldCancel(e.type,e.deltaY,e.target,n.shouldCancelEvent(e,n.ref.current))},n.scrollTouchMove=function(e){n.shouldCancel(e.type,Le(e),e.target,n.shouldCancelEvent(e,n.ref.current))},n}return Ae(t,e),t.prototype.componentDidMount=function(){t.stack.push(this),this.componentDidUpdate({enabled:!1})},t.prototype.componentWillUnmount=function(){var e=this;t.stack=t.stack.filter(function(t){return t!==e}),this.disable()},t.prototype.componentDidUpdate=function(e){e.enabled!==this.props.enabled&&(this.props.enabled?this.enable():this.disable())},t.prototype.enable=function(){"undefined"!=typeof document&&(document.addEventListener("wheel",this.shouldPrevent,Ve),document.addEventListener("touchmove",this.shouldPrevent,Ve),document.addEventListener("touchstart",this.scrollTouchStart,Ve))},t.prototype.disable=function(){"undefined"!=typeof window&&(document.removeEventListener("wheel",this.shouldPrevent,Ve),document.removeEventListener("touchmove",this.shouldPrevent,Ve),document.removeEventListener("touchstart",this.scrollTouchStart,Ve))},t.prototype.shouldCancelEvent=function(e,t){switch(e.type){case"wheel":case"scroll":return De(t,e,e.deltaY);case"touchmove":return De(t,e,this.touchStart-Le(e))}return!1},t.prototype.render=function(){var e=this.props,t=e.forwardProps,n=e.children,r=e.className,o=e.removeScrollBar,i=e.enabled,a={ref:this.ref,onScrollCapture:this.scrollWheel,onWheelCapture:this.scrollWheel,onTouchMoveCapture:this.scrollTouchMove};return l.createElement(l.Fragment,null,o&&i&&l.createElement(Re,{gapMode:"margin"}),t?l.cloneElement(l.Children.only(n),a):l.createElement("div",je({},a,{className:r}),n))},t.classNames=He,t.defaultProps={enabled:!0,removeScrollBar:!0},t.stack=[],t}(l.Component),Ke=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function We(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var qe=function(){},$e=function(){},ze=function(e){var t,n,r;e.disposeAriaHider=(t=e.overlayNode,n=[],r=[],Array.prototype.forEach.call(document.querySelectorAll("body > *"),function(e){if(e!==t.parentNode){var o=e.getAttribute("aria-hidden");null!==o&&"false"!==o||(n.push(o),r.push(e),e.setAttribute("aria-hidden","true"))}}),function(){r.forEach(function(e,t){var r=n[t];null===r?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r)})})},Ge=function(e){e.refs.disposeAriaHider()},Ye=(c.a.createContext(),c.a.forwardRef(function(e,t){var n=e.isOpen,r=void 0===n||n,o=e.onDismiss,i=void 0===o?qe:o,a=e.initialFocusRef,s=e.onClick,u=e.onKeyDown,l=We(e,["isOpen","onDismiss","initialFocusRef","onClick","onKeyDown"]);return c.a.createElement(m,{didMount:$e},r?c.a.createElement(v,{"data-reach-dialog-wrapper":!0},c.a.createElement(m,{refs:{overlayNode:null},didMount:function(e){var t=e.refs;ze(t)},willUnmount:Ge},function(e){var n=e.refs;return c.a.createElement(Ie,{returnFocus:!0,onActivation:function(){a&&a.current.focus()}},c.a.createElement(Be,null,c.a.createElement("div",Ke({"data-reach-dialog-overlay":!0,onClick:y(s,function(e){e.stopPropagation(),i()}),onKeyDown:y(u,function(e){"Escape"===e.key&&(e.stopPropagation(),i())}),ref:function(e){n.overlayNode=e,t&&t(e)}},l))))})):null)}));Ye.propTypes={initialFocusRef:function(){}};var Qe=function(e){return e.stopPropagation()},Je=c.a.forwardRef(function(e,t){var n=e.onClick,r=(e.onKeyDown,We(e,["onClick","onKeyDown"]));return c.a.createElement("div",Ke({"aria-modal":"true","data-reach-dialog-content":!0,tabIndex:"-1",onClick:y(n,Qe),ref:function(e){t&&t(e)}},r))}),Xe=(n(23),function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()),Ze=function(e){var t=Object(o.useState)(!1),n=Xe(t,2),r=n[0],i=n[1];return[function(){return i(!0)},Object(o.createElement)(u.Transition,{items:r,config:{duration:200},from:{opacity:0,y:-10},enter:{opacity:1,y:0},leave:{opacity:0,y:10}},function(t){return t&&function(t){return Object(o.createElement)(Ye,{style:{opacity:t.opacity},onDismiss:function(){return i(!1)}},Object(o.createElement)(Je,{style:{transform:"translate3d(0px, "+t.y+"px, 0px)"}},Object(o.createElement)("button",{className:"close-button",onClick:function(){return i(!1)}},"×"),Object(o.createElement)("div",{className:"ct-extension-readme",dangerouslySetInnerHTML:{__html:e.readme}})))}})]},et=n(6),tt=n(4);function nt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n(14);function rt(e){return null!=e&&"object"==typeof e&&1===e.nodeType}function ot(e,t){return(!t||"hidden"!==e)&&("visible"!==e&&"clip"!==e)}function it(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var n=getComputedStyle(e,null);return ot(n.overflowY,t)||ot(n.overflowX,t)}return!1}function at(e,t,n,r,o,i,a,s){return i<e&&a>t||i>e&&a<t?0:i<=e&&s<=n||a>=t&&s>=n?i-e-r:a>t&&s<n||i<e&&s>n?a-t+o:0}var st=function(e,t){var n=t.scrollMode,r=t.block,o=t.inline,i=t.boundary,a=t.skipOverflowHiddenElements,s="function"==typeof i?i:function(e){return e!==i};if(!rt(e))throw new TypeError("Invalid target");for(var u=document.scrollingElement||document.documentElement,l=[],c=e;rt(c)&&s(c);){if((c=c.parentNode)===u){l.push(c);break}c===document.body&&it(c)&&!it(document.documentElement)||it(c,a)&&l.push(c)}for(var d=window.visualViewport?visualViewport.width:innerWidth,p=window.visualViewport?visualViewport.height:innerHeight,f=window.scrollX||pageXOffset,h=window.scrollY||pageYOffset,m=e.getBoundingClientRect(),g=m.height,v=m.width,y=m.top,b=m.right,w=m.bottom,x=m.left,O="start"===r||"nearest"===r?y:"end"===r?w:y+g/2,S="center"===o?x+v/2:"end"===o?b:x,E=[],I=0;I<l.length;I++){var C=l[I],A=C.getBoundingClientRect(),j=A.height,k=A.width,P=A.top,_=A.right,T=A.bottom,M=A.left;if("if-needed"===n&&y>=0&&x>=0&&w<=p&&b<=d&&y>=P&&w<=T&&x>=M&&b<=_)return E;var R=getComputedStyle(C),D=parseInt(R.borderLeftWidth,10),U=parseInt(R.borderTopWidth,10),F=parseInt(R.borderRightWidth,10),V=parseInt(R.borderBottomWidth,10),L=0,H=0,N="offsetWidth"in C?C.offsetWidth-C.clientWidth-D-F:0,B="offsetHeight"in C?C.offsetHeight-C.clientHeight-U-V:0;if(u===C)L="start"===r?O:"end"===r?O-p:"nearest"===r?at(h,h+p,p,U,V,h+O,h+O+g,g):O-p/2,H="start"===o?S:"center"===o?S-d/2:"end"===o?S-d:at(f,f+d,d,D,F,f+S,f+S+v,v),L=Math.max(0,L+h),H=Math.max(0,H+f);else{L="start"===r?O-P-U:"end"===r?O-T+V+B:"nearest"===r?at(P,T,j,U,V+B,O,O+g,g):O-(P+j/2)+B/2,H="start"===o?S-M-D:"center"===o?S-(M+k/2)+N/2:"end"===o?S-_+F+N:at(M,_,k,D,F+N,S,S+v,v);var K=C.scrollLeft,W=C.scrollTop;O+=W-(L=Math.max(0,Math.min(W+L,C.scrollHeight-j+B))),S+=K-(H=Math.max(0,Math.min(K+H,C.scrollWidth-k+N)))}E.push({el:C,top:L,left:H})}return E},ut="undefined"==typeof document?null:document.getElementById("a11y-status-message"),lt=[];function ct(e){var t=lt[lt.length-1]===e;lt=t?[].concat(lt,[e]):[e];for(var n=function(){if(ut)return ut;return(ut=document.createElement("div")).setAttribute("id","a11y-status-message"),ut.setAttribute("role","status"),ut.setAttribute("aria-live","polite"),ut.setAttribute("aria-relevant","additions text"),Object.assign(ut.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),document.body.appendChild(ut),ut}();n.lastChild;)n.removeChild(n.firstChild);lt.filter(Boolean).forEach(function(e,t){n.appendChild(function(e,t){var n=t===lt.length-1?"block":"none",r=document.createElement("div");return r.style.display=n,r.textContent=e,r}(e,t))})}var dt=0,pt=2,ft=3,ht=4,mt=5,gt=6,vt=7,yt=8,bt=9,wt=10,xt=11,Ot=12,St=13,Et=14,It=Object.freeze({unknown:dt,mouseUp:1,itemMouseEnter:pt,keyDownArrowUp:ft,keyDownArrowDown:ht,keyDownEscape:mt,keyDownEnter:gt,keyDownHome:vt,keyDownEnd:yt,clickItem:bt,blurInput:wt,changeInput:xt,keyDownSpaceButton:Ot,clickButton:St,blurButton:Et,controlledPropUpdatedSelectedItem:15,touchEnd:16}),Ct=0;function At(e){return"function"==typeof e?e:jt}function jt(){}function kt(e,t){return e===t||e.contains&&e.contains(t)}function Pt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return t.some(function(t){return t&&t.apply(void 0,[e].concat(r)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault})}}function _t(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}function Tt(e){return"string"==typeof e.type}function Mt(e){return e.props}var Rt=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function Dt(e){void 0===e&&(e={});var t={};return Rt.forEach(function(n){e.hasOwnProperty(n)&&(t[n]=e[n])}),t}function Ut(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function Ft(e,t,n){var r=n-1;("number"!=typeof t||t<0||t>=n)&&(t=e>0?-1:r+1);var o=t+e;return o<0?o=r:o>r&&(o=0),o}var Vt=function(e){var t,n;function r(t){var n=e.call(this,t)||this;n.id=n.props.id||"downshift-"+String(Ct++),n.menuId=n.props.menuId||n.id+"-menu",n.labelId=n.props.labelId||n.id+"-label",n.inputId=n.props.inputId||n.id+"-input",n.getItemId=n.props.getItemId||function(e){return n.id+"-item-"+e},n.input=null,n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var r=setTimeout(function(){n.timeoutIds=n.timeoutIds.filter(function(e){return e!==r}),e()},t);n.timeoutIds.push(r)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=Dt(t),n.internalSetState(Object(tt.default)({highlightedIndex:e},t))},n.clearSelection=function(e){n.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:n.props.defaultHighlightedIndex,isOpen:n.props.defaultIsOpen},e)},n.selectItem=function(e,t,r){t=Dt(t),n.internalSetState(Object(tt.default)({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),r)},n.selectItemAtIndex=function(e,t,r){var o=n.items[e];null!=o&&n.selectItem(o,t,r)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var r,o,i={},a="function"==typeof e;return!a&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,Object(tt.default)({},n.getStateAndHelpers(),e)),n.setState(function(t){t=n.getState(t);var s=a?e(t):e;s=n.props.stateReducer(t,s),r=s.hasOwnProperty("selectedItem");var u={},l={};return r&&s.selectedItem!==t.selectedItem&&(o=s.selectedItem),s.type=s.type||dt,Object.keys(s).forEach(function(e){t[e]!==s[e]&&(i[e]=s[e]),"type"!==e&&(l[e]=s[e],n.isControlledProp(e)||(u[e]=s[e]))}),a&&s.hasOwnProperty("inputValue")&&n.props.onInputValueChange(s.inputValue,Object(tt.default)({},n.getStateAndHelpers(),s)),u},function(){At(t)(),Object.keys(i).length>1&&n.props.onStateChange(i,n.getStateAndHelpers()),r&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==o&&n.props.onChange(o,n.getStateAndHelpers()),n.props.onUserAction(i,n.getStateAndHelpers())})},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var r,o=void 0===e?{}:e,i=o.refKey,a=void 0===i?"ref":i,s=Object(et.default)(o,["refKey"]),u=(void 0===t?{}:t).suppressRefError,l=void 0!==u&&u;n.getRootProps.called=!0,n.getRootProps.refKey=a,n.getRootProps.suppressRefError=l;var c=n.getState().isOpen;return Object(tt.default)(((r={})[a]=n.rootRef,r.role="combobox",r["aria-expanded"]=c,r["aria-haspopup"]="listbox",r["aria-owns"]=c?n.menuId:null,r["aria-labelledby"]=n.labelId,r),s)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:ht})}else this.internalSetState({isOpen:!0,type:ht},function(){var e=t.getItemCount();e>0&&t.setHighlightedIndex(Ft(1,t.getState().highlightedIndex,e),{type:ht})})},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:ft})}else this.internalSetState({isOpen:!0,type:ft},function(){var e=t.getItemCount();e>0&&t.setHighlightedIndex(Ft(-1,t.getState().highlightedIndex,e),{type:ht})})},Enter:function(e){var t=this.getState(),n=t.isOpen,r=t.highlightedIndex;if(n&&null!=r){e.preventDefault();var o=this.items[r],i=this.getItemNodeFromIndex(r);if(null==o||i&&i.hasAttribute("disabled"))return;this.selectHighlightedItem({type:gt})}},Escape:function(e){e.preventDefault(),this.reset({type:mt})}},n.buttonKeyDownHandlers=Object(tt.default)({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:Ot})}}),n.inputKeyDownHandlers=Object(tt.default)({},n.keyDownHandlers,{Home:function(e){this.highlightFirstOrLastIndex(e,!0,{type:vt})},End:function(e){this.highlightFirstOrLastIndex(e,!1,{type:yt})}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,r=t.onClick,o=(t.onPress,t.onKeyDown),i=t.onKeyUp,a=t.onBlur,s=Object(et.default)(t,["onClick","onPress","onKeyDown","onKeyUp","onBlur"]),u=n.getState().isOpen,l={onClick:Pt(r,n.buttonHandleClick),onKeyDown:Pt(o,n.buttonHandleKeyDown),onKeyUp:Pt(i,n.buttonHandleKeyUp),onBlur:Pt(a,n.buttonHandleBlur)},c=s.disabled?{}:l;return Object(tt.default)({type:"button",role:"button","aria-label":u?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},c,s)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=Ut(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(nt(n),e)},n.buttonHandleClick=function(e){e.preventDefault(),n.props.environment.document.activeElement===n.props.environment.document.body&&e.target.focus(),n.internalSetTimeout(function(){return n.toggleMenu({type:St})})},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout(function(){n.isMouseDown||null!=n.props.environment.document.activeElement&&n.props.environment.document.activeElement.id===n.inputId||n.props.environment.document.activeElement===t||n.reset({type:Et})})},n.getLabelProps=function(e){return Object(tt.default)({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,r=t.onKeyDown,o=t.onBlur,i=t.onChange,a=t.onInput,s=(t.onChangeText,Object(et.default)(t,["onKeyDown","onBlur","onChange","onInput","onChangeText"])),u={};var l,c=n.getState(),d=c.inputValue,p=c.isOpen,f=c.highlightedIndex;s.disabled||((l={}).onChange=Pt(i,a,n.inputHandleChange),l.onKeyDown=Pt(r,n.inputHandleKeyDown),l.onBlur=Pt(o,n.inputHandleBlur),u=l);return Object(tt.default)({"aria-autocomplete":"list","aria-activedescendant":p&&"number"==typeof f&&f>=0?n.getItemId(f):null,"aria-controls":p?n.menuId:null,"aria-labelledby":n.labelId,autoComplete:"off",value:d,id:n.inputId},u,s)},n.inputHandleKeyDown=function(e){var t=Ut(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(nt(n),e)},n.inputHandleChange=function(e){n.internalSetState({type:xt,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleTextChange=function(e){n.internalSetState({type:xt,isOpen:!0,inputValue:e,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleBlur=function(){n.internalSetTimeout(function(){var e=n.props.environment.document&&!!n.props.environment.document.activeElement&&!!n.props.environment.document.activeElement.dataset&&n.props.environment.document.activeElement.dataset.toggle&&n._rootNode&&n._rootNode.contains(n.props.environment.document.activeElement);n.isMouseDown||e||n.reset({type:wt})})},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var r,o=void 0===e?{}:e,i=o.refKey,a=void 0===i?"ref":i,s=o.ref,u=Object(et.default)(o,["refKey","ref"]),l=(void 0===t?{}:t).suppressRefError,c=void 0!==l&&l;return n.getMenuProps.called=!0,n.getMenuProps.refKey=a,n.getMenuProps.suppressRefError=c,Object(tt.default)(((r={})[a]=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach(function(e){e&&e.apply(void 0,n)})}}(s,n.menuRef),r.role="listbox",r["aria-labelledby"]=u&&u["aria-label"]?null:n.labelId,r.id=n.menuId,r),u)},n.getItemProps=function(e){var t,r=void 0===e?{}:e,o=r.onMouseMove,i=r.onMouseDown,a=r.onClick,s=(r.onPress,r.index),u=r.item,l=void 0===u?void 0:u,c=Object(et.default)(r,["onMouseMove","onMouseDown","onClick","onPress","index","item"]);void 0===s?(n.items.push(l),s=n.items.indexOf(l)):n.items[s]=l;var d=a,p=((t={onMouseMove:Pt(o,function(){s!==n.getState().highlightedIndex&&(n.setHighlightedIndex(s,{type:pt}),n.avoidScrolling=!0,n.internalSetTimeout(function(){return n.avoidScrolling=!1},250))}),onMouseDown:Pt(i,function(e){e.preventDefault()})}).onClick=Pt(d,function(){n.selectItemAtIndex(s,{type:bt})}),t),f=c.disabled?{onMouseDown:p.onMouseDown}:p;return Object(tt.default)({id:n.getItemId(s),role:"option","aria-selected":n.getState().highlightedIndex===s},f,c)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=Dt(e),n.internalSetState(function(t){var r=t.selectedItem;return Object(tt.default)({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(r)},e)},t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=Dt(e),n.internalSetState(function(t){var r=t.isOpen;return Object(tt.default)({isOpen:!r},r&&{highlightedIndex:n.props.defaultHighlightedIndex},e)},function(){var r=n.getState(),o=r.isOpen,i=r.highlightedIndex;o&&n.getItemCount()>0&&"number"==typeof i&&n.setHighlightedIndex(i,e),At(t)()})},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=function(e,t){var n;function r(){n&&clearTimeout(n)}function o(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];r(),n=setTimeout(function(){n=null,e.apply(void 0,i)},t)}return o.cancel=r,o}(function(){var e=n.getState(),t=n.items[e.highlightedIndex],r=n.getItemCount(),o=n.props.getA11yStatusMessage(Object(tt.default)({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:r,highlightedItem:t},e));n.previousResultCount=r,ct(o)},200);var r=n.props,o=r.defaultHighlightedIndex,i=r.initialHighlightedIndex,a=void 0===i?o:i,s=r.defaultIsOpen,u=r.initialIsOpen,l=void 0===u?s:u,c=r.initialInputValue,d=void 0===c?"":c,p=r.initialSelectedItem,f=void 0===p?null:p,h=n.getState({highlightedIndex:a,isOpen:l,inputValue:d,selectedItem:f});return null!=h.selectedItem&&void 0===n.props.initialInputValue&&(h.inputValue=n.props.itemToString(h.selectedItem)),n.state=h,n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o=r.prototype;return o.internalClearTimeouts=function(){this.timeoutIds.forEach(function(e){clearTimeout(e)}),this.timeoutIds=[]},o.getState=function(e){var t=this;return void 0===e&&(e=this.state),Object.keys(e).reduce(function(n,r){return n[r]=t.isControlledProp(r)?t.props[r]:e[r],n},{})},o.isControlledProp=function(e){return void 0!==this.props[e]},o.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},o.getItemNodeFromIndex=function(e){return this.props.environment.document.getElementById(this.getItemId(e))},o.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},o.moveHighlightedIndex=function(e,t){var n=this.getItemCount();if(n>0){var r=Ft(e,this.getState().highlightedIndex,n);this.setHighlightedIndex(r,t)}},o.highlightFirstOrLastIndex=function(e,t,n){var r=this.getItemCount()-1;r<0||!this.getState().isOpen||(e.preventDefault(),this.setHighlightedIndex(t?0:r,n))},o.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,r=e.selectedItem,o=e.isOpen,i=this.props.itemToString,a=this.id,s=this.getRootProps,u=this.getToggleButtonProps,l=this.getLabelProps,c=this.getMenuProps,d=this.getInputProps,p=this.getItemProps,f=this.openMenu,h=this.closeMenu,m=this.toggleMenu,g=this.selectItem,v=this.selectItemAtIndex,y=this.selectHighlightedItem,b=this.setHighlightedIndex,w=this.clearSelection,x=this.clearItems;return{getRootProps:s,getToggleButtonProps:u,getLabelProps:l,getMenuProps:c,getInputProps:d,getItemProps:p,reset:this.reset,openMenu:f,closeMenu:h,toggleMenu:m,selectItem:g,selectItemAtIndex:v,selectHighlightedItem:y,setHighlightedIndex:b,clearSelection:w,clearItems:x,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:i,id:a,highlightedIndex:t,inputValue:n,isOpen:o,selectedItem:r}},o.componentDidMount=function(){var e=this;var t=function(t,n){void 0===n&&(n=!0);var r=e.props.environment.document;return[e._rootNode,e._menuNode].some(function(e){return e&&(kt(e,t)||n&&kt(e,r.activeElement))})},n=function(){e.isMouseDown=!0},r=function(n){e.isMouseDown=!1,!t(n.target)&&e.getState().isOpen&&e.reset({type:1},function(){return e.props.onOuterClick(e.getStateAndHelpers())})},o=function(){e.isTouchMove=!1},i=function(){e.isTouchMove=!0},a=function(n){var r=t(n.target,!1);e.isTouchMove||r||!e.getState().isOpen||e.reset({type:16},function(){return e.props.onOuterClick(e.getStateAndHelpers())})};this.props.environment.addEventListener("mousedown",n),this.props.environment.addEventListener("mouseup",r),this.props.environment.addEventListener("touchstart",o),this.props.environment.addEventListener("touchmove",i),this.props.environment.addEventListener("touchend",a),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),e.props.environment.removeEventListener("mousedown",n),e.props.environment.removeEventListener("mouseup",r),e.props.environment.removeEventListener("touchstart",o),e.props.environment.removeEventListener("touchmove",i),e.props.environment.removeEventListener("touchend",a)}},o.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,r=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==r},o.componentDidUpdate=function(e,t){this.isControlledProp("selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},o.componentWillUnmount=function(){this.cleanup()},o.render=function(){var e=_t(this.props.children,jt);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var t=_t(e(this.getStateAndHelpers()));return t?this.getRootProps.called||this.props.suppressRefError?t:Tt(t)?c.a.cloneElement(t,this.getRootProps(Mt(t))):void 0:null},r}(l.Component);Vt.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:function(e){var t=e.isOpen,n=e.selectedItem,r=e.resultCount,o=e.previousResultCount,i=e.itemToString;return t?r?r!==o?r+" result"+(1===r?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":n?i(n):""},itemToString:function(e){return null==e?"":String(e)},onStateChange:jt,onInputValueChange:jt,onUserAction:jt,onChange:jt,onSelect:jt,onOuterClick:jt,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:function(e,t){null!==e&&st(e,{boundary:t,block:"nearest",scrollMode:"if-needed"}).forEach(function(e){var t=e.el,n=e.top,r=e.left;t.scrollTop=n,t.scrollLeft=r})}},Vt.stateChangeTypes=It;var Lt=Vt,Ht=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nt=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();var Bt=function(e){var t,n,r=e.listId,a=e.apiKey,u=e.onChange,l=Object(o.useState)([]),c=Nt(l,2),d=c[0],p=c[1],f=Object(o.useState)(!1),h=Nt(f,2),m=h[0],g=h[1],v=Object(o.useState)({controller:null}),y=Nt(v,2),b=y[0].controller,w=y[1],x=(t=regeneratorRuntime.mark(function e(){var t,n,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return b&&b.abort(),g(!0),"AbortController"in window&&(b=new AbortController,w({controller:b})),(t=new FormData).append("api_key",a),t.append("action","blocksy_ext_mailchimp_maybe_get_lists"),e.prev=6,e.next=9,fetch(ctDashboardLocalizations.ajax_url,{method:"POST",signal:b.signal,body:t});case 9:if(200!==(n=e.sent).status){e.next=19;break}return e.next=13,n.json();case 13:if(!(r=e.sent).success){e.next=19;break}if("api_key_invalid"===r.data.result){e.next=19;break}return g(!1),p(r.data.result),e.abrupt("return");case 19:e.next=23;break;case 21:e.prev=21,e.t0=e.catch(6);case 23:p([]),g(!1);case 25:case"end":return e.stop()}},e,void 0,[[6,21]])}),n=function(){var e=t.apply(this,arguments);return new Promise(function(t,n){return function r(o,i){try{var a=e[o](i),s=a.value}catch(e){return void n(e)}if(!a.done)return Promise.resolve(s).then(function(e){r("next",e)},function(e){r("throw",e)});t(s)}("next")})},function(){return n.apply(this,arguments)});return Object(o.useEffect)(function(){a&&-1!==a.indexOf("-")?x():p([])},[a]),0===d.length?Object(o.createElement)("div",{className:"ct-select-input"},Object(o.createElement)("input",{disabled:!0,placeholder:m?Object(i.__)("Loading"):Object(i.__)("Invalid API Key...")})):Object(o.createElement)(Lt,{selectedItem:r||"",onChange:function(e){return u(e)},itemToString:function(e){return e?(d.find(function(t){return t.id===e})||{}).name:""}},function(e){var t=e.getInputProps,n=e.getItemProps,r=(e.getLabelProps,e.getMenuProps),a=e.isOpen,u=(e.inputValue,e.highlightedIndex),l=e.selectedItem,c=e.openMenu;return Object(o.createElement)("div",{className:"ct-select-input"},Object(o.createElement)("input",Ht({},t({onFocus:function(){return c()},onClick:function(){return c()}}),{placeholder:Object(i.__)("Select list..."),readOnly:!0})),a&&Object(o.createElement)("div",r({className:"ct-select-dropdown"}),d.map(function(e,t){return Object(o.createElement)("div",n({key:e.id,index:t,item:e.id,className:s()("ct-select-dropdown-item",{active:u===t,selected:l===e.id})}),e.name)})))})},Kt=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();var Wt=function(e){var t,n,r=e.extension,a=e.isEditingCredentials,l=e.setIsEditingCredentials,c=e.onCredentialsValidated,d=Object(o.useState)(r.data.api_key),p=Kt(d,2),f=p[0],h=p[1],m=Object(o.useState)(r.data.list_id),g=Kt(m,2),v=g[0],y=g[1],b=Object(o.useState)(!1),w=Kt(b,2),x=w[0],O=w[1],S=Object(o.useState)(!1),E=Kt(S,2),I=E[0],C=E[1],A=(t=regeneratorRuntime.mark(function e(){var t,n,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return(t=new FormData).append("api_key",f),t.append("list_id",v),t.append("action","blocksy_ext_mailchimp_maybe_save_credentials"),O(!0),e.prev=5,e.next=8,fetch(ctDashboardLocalizations.ajax_url,{method:"POST",body:t});case 8:if(200!==(n=e.sent).status){e.next=14;break}return e.next=12,n.json();case 12:(r=e.sent).success&&"api_key_invalid"!==r.data.result&&(c(),C(!1));case 14:C(!0),e.next=20;break;case 17:e.prev=17,e.t0=e.catch(5),C(!0);case 20:return e.next=22,new Promise(function(e){return setTimeout(function(){return e()},1e3)});case 22:O(!1);case 23:case"end":return e.stop()}},e,void 0,[[5,17]])}),n=function(){var e=t.apply(this,arguments);return new Promise(function(t,n){return function r(o,i){try{var a=e[o](i),s=a.value}catch(e){return void n(e)}if(!a.done)return Promise.resolve(s).then(function(e){r("next",e)},function(e){r("throw",e)});t(s)}("next")})},function(){return n.apply(this,arguments)});return Object(o.createElement)(u.Transition,{items:a,config:{duration:200},from:{opacity:0,y:-10},enter:{opacity:1,y:0},leave:{opacity:0,y:10}},function(e){return e&&function(e){return Object(o.createElement)(Ye,{style:{opacity:e.opacity},onDismiss:function(){return l(!1)}},Object(o.createElement)(Je,{style:{transform:"translate3d(0px, "+e.y+"px, 0px)"}},Object(o.createElement)("button",{className:"close-button",onClick:function(){return l(!1)}},"×"),Object(o.createElement)("div",{className:s()("ct-mailchimp-edit-credentials ct-extension-config",{"ct-key-invalid":I})},Object(o.createElement)("h1",null,Object(i.__)("MailChimp Credentials")),Object(o.createElement)("p",{dangerouslySetInnerHTML:{__html:Object(i.sprintf)(Object(i.__)("Enter your MailChimp credentials in the form below. More info on how to generate an API key can be found %s."),Object(i.sprintf)('<a target="_blank" href="https://mailchimp.com/help/about-api-keys/">%s</a>',Object(i.__)("here")))}}),Object(o.createElement)("ul",{className:"mailchimp-credentials"},Object(o.createElement)("li",null,Object(o.createElement)("label",null,Object(i.__)("API Key")),Object(o.createElement)("input",{type:"text",onChange:function(e){var t=e.target.value;return h(t)},value:f||""})),Object(o.createElement)("li",null,Object(o.createElement)("label",null,Object(i.__)("List ID")),Object(o.createElement)(Bt,{listId:v,onChange:function(e){return y(e)},apiKey:f})),Object(o.createElement)("li",null,Object(o.createElement)("button",{className:"ct-button","data-button":"blue",disabled:!f||!v||x,onClick:function(){return A()}},x?Object(i.__)("Loading..."):Object(i.__)("Activate")))))))}})},qt=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();var $t=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},i=Object(o.useState)(!1),a=qt(i,2),s=a[0],u=a[1],l=Object(o.useState)(!1),c=qt(l,2),d=c[0],p=c[1],f=(t=regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return(n=new FormData).append("ext",e.name),n.append("action",e.__object?"blocksy_extension_deactivate":"blocksy_extension_activate"),u(!0),t.prev=4,t.next=7,fetch(ctDashboardLocalizations.ajax_url,{method:"POST",body:n});case 7:r(),t.next=12;break;case 10:t.prev=10,t.t0=t.catch(4);case 12:return t.next=14,new Promise(function(e){return setTimeout(function(){return e()},1e3)});case 14:u(!1);case 15:case"end":return t.stop()}},t,void 0,[[4,10]])}),n=function(){var e=t.apply(this,arguments);return new Promise(function(t,n){return function r(o,i){try{var a=e[o](i),s=a.value}catch(e){return void n(e)}if(!a.done)return Promise.resolve(s).then(function(e){r("next",e)},function(e){r("throw",e)});t(s)}("next")})},function(){return n.apply(this,arguments)});return[s,function(){e.__object||e.data.api_key?f():p(!0)},Object(o.createElement)(o.Fragment,null,e.__object&&e.data.api_key&&Object(o.createElement)("button",{className:"ct-minimal-button ct-config-btn dashicons dashicons-admin-generic",title:"Edit Credentials",onClick:function(){return p(!0)}}),Object(o.createElement)(Wt,{isEditingCredentials:d,setIsEditingCredentials:p,extension:e,onCredentialsValidated:function(){e.__object||f(),p(!1)}}))]},zt=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),Gt=function(e){var t=e.extension,n=e.onExtsSync,r=$t(t,function(){n()}),a=zt(r,3),u=a[0],l=a[1],c=a[2],d=Ze(t),p=zt(d,2),f=p[0],h=p[1];return Object(o.createElement)("li",{className:s()({active:!!t.__object})},Object(o.createElement)("h4",{className:"ct-extension-title"},t.config.name),t.config.description&&Object(o.createElement)("div",{className:"ct-extension-description"},t.config.description),Object(o.createElement)("div",{className:"ct-extension-actions"},Object(o.createElement)("button",{className:"ct-button","data-button":"white",disabled:u,onClick:function(){return l()}},u?Object(i.__)("Loading"):t.__object?Object(i.__)("Deactivate"):Object(i.__)("Activate")),c,t.readme&&Object(o.createElement)("button",{onClick:function(){return f()},"data-button":"white",className:"ct-minimal-button ct-instruction"},Object(o.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 24 24"},Object(o.createElement)("path",{d:"M12,2C6.477,2,2,6.477,2,12s4.477,10,10,10s10-4.477,10-10S17.523,2,12,2z M12,17L12,17c-0.552,0-1-0.448-1-1v-4 c0-0.552,0.448-1,1-1h0c0.552,0,1,0.448,1,1v4C13,16.552,12.552,17,12,17z M12.5,9h-1C11.224,9,11,8.776,11,8.5v-1 C11,7.224,11.224,7,11.5,7h1C12.776,7,13,7.224,13,7.5v1C13,8.776,12.776,9,12.5,9z"})))),h)};ctEvents.on("ct:extensions:card",function(e){var t=e.CustomComponent;"mailchimp"===e.extension.name&&(t.extension=Gt)})}]);
|
| 1 |
+
!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,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=17)}([function(e,t){e.exports=window.wp.element},function(e,t,n){e.exports=n(11)()},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.r(t),n.d(t,"default",(function(){return r}))},function(e,t){e.exports=window.React},function(e,t){e.exports=window.wp.i18n},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}n.r(t),n.d(t,"default",(function(){return r}))},function(e,t,n){var r;
|
| 2 |
/*!
|
| 3 |
Copyright (c) 2017 Jed Watson.
|
| 4 |
Licensed under the MIT License (MIT), see
|
| 5 |
http://jedwatson.github.io/classnames
|
| 6 |
+
*/!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)&&r.length){var a=o.apply(null,r);a&&e.push(a)}else if("object"===i)for(var s in r)n.call(r,s)&&r[s]&&e.push(s)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(5)),i=r(n(2)),a=r(n(3)),s=r(n(15));let l=void 0,u=void 0,c=[],d=e=>"undefined"!=typeof window&&window.requestAnimationFrame(e),p=e=>"undefined"!=typeof window&&window.cancelAnimationFrame(e),f=void 0,h=()=>Date.now(),m=void 0,g=void 0;const y=(e,t)=>u={fn:e,transform:t},v=e=>c=e,b=e=>l=e,w=e=>f=e,O=e=>m=e,S=e=>g=e;var I=Object.freeze({get bugfixes(){return l},get applyAnimatedValues(){return u},get colorNames(){return c},get requestFrame(){return d},get cancelFrame(){return p},get interpolation(){return f},get now(){return h},get defaultElement(){return m},get createAnimatedStyle(){return g},injectApplyAnimatedValues:y,injectColorNames:v,injectBugfixes:b,injectInterpolation:w,injectFrame:(e,t)=>{var n=[e,t];return d=n[0],p=n[1],n},injectNow:e=>h=e,injectDefaultElement:O,injectCreateAnimatedStyle:S});class x{attach(){}detach(){}getValue(){}getAnimatedValue(){return this.getValue()}addChild(e){}removeChild(e){}getChildren(){return[]}}const j=e=>Object.keys(e).map(t=>e[t]);class E extends x{constructor(){var e;super(...arguments),e=this,this.children=[],this.getChildren=()=>this.children,this.getPayload=function(t){return void 0===t&&(t=void 0),void 0!==t&&e.payload?e.payload[t]:e.payload||e}}addChild(e){0===this.children.length&&this.attach(),this.children.push(e)}removeChild(e){const t=this.children.indexOf(e);this.children.splice(t,1),0===this.children.length&&this.detach()}}class C extends E{constructor(){super(...arguments),this.payload=[],this.getAnimatedValue=()=>this.getValue(),this.attach=()=>this.payload.forEach(e=>e instanceof x&&e.addChild(this)),this.detach=()=>this.payload.forEach(e=>e instanceof x&&e.removeChild(this))}}class k extends E{constructor(){super(...arguments),this.payload={},this.getAnimatedValue=()=>this.getValue(!0),this.attach=()=>j(this.payload).forEach(e=>e instanceof x&&e.addChild(this)),this.detach=()=>j(this.payload).forEach(e=>e instanceof x&&e.removeChild(this))}getValue(e){void 0===e&&(e=!1);const t={};for(const n in this.payload){const r=this.payload[n];(!e||r instanceof x)&&(t[n]=r instanceof x?r[e?"getAnimatedValue":"getValue"]():r)}return t}}class A extends k{constructor(e){super(),!(e=e||{}).transform||e.transform instanceof x||(e=u.transform(e)),this.payload=e}}const P={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199};class _{static create(e,t,n){if("function"==typeof e)return e;if(f&&e.output&&"string"==typeof e.output[0])return f(e);if(Array.isArray(e))return _.create({range:e,output:t,extrapolate:n||"extend"});let r=e.output,o=e.range||[0,1],i=e.easing||(e=>e),a="extend",s=e.map;void 0!==e.extrapolateLeft?a=e.extrapolateLeft:void 0!==e.extrapolate&&(a=e.extrapolate);let l="extend";return void 0!==e.extrapolateRight?l=e.extrapolateRight:void 0!==e.extrapolate&&(l=e.extrapolate),e=>{let t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,o);return function(e,t,n,r,o,i,a,s,l){let u=l?l(e):e;if(u<t){if("identity"===a)return u;"clamp"===a&&(u=t)}if(u>n){if("identity"===s)return u;"clamp"===s&&(u=n)}if(r===o)return r;if(t===n)return e<=t?r:o;t===-1/0?u=-u:n===1/0?u-=t:u=(u-t)/(n-t);u=i(u),r===-1/0?u=-u:o===1/0?u+=r:u=u*(o-r)+r;return u}(e,o[t],o[t+1],r[t],r[t+1],i,a,l,s)}}}const D="[-+]?\\d*\\.?\\d+";function M(){return"\\(\\s*("+Array.prototype.slice.call(arguments).join(")\\s*,\\s*(")+")\\s*\\)"}const T=new RegExp("rgb"+M(D,D,D)),R=new RegExp("rgba"+M(D,D,D,D)),V=new RegExp("hsl"+M(D,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),H=new RegExp("hsla"+M(D,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",D)),F=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,U=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,N=/^#([0-9a-fA-F]{6})$/,L=/^#([0-9a-fA-F]{8})$/;function K(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function $(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=K(o,r,e+1/3),a=K(o,r,e),s=K(o,r,e-1/3);return Math.round(255*i)<<24|Math.round(255*a)<<16|Math.round(255*s)<<8}function B(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function W(e){return(parseFloat(e)%360+360)%360/360}function q(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function z(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function G(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=N.exec(e))?parseInt(t[1]+"ff",16)>>>0:P.hasOwnProperty(e)?P[e]:(t=T.exec(e))?(B(t[1])<<24|B(t[2])<<16|B(t[3])<<8|255)>>>0:(t=R.exec(e))?(B(t[1])<<24|B(t[2])<<16|B(t[3])<<8|q(t[4]))>>>0:(t=F.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=L.exec(e))?parseInt(t[1],16)>>>0:(t=U.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=V.exec(e))?(255|$(W(t[1]),z(t[2]),z(t[3])))>>>0:(t=H.exec(e))?($(W(t[1]),z(t[2]),z(t[3]))|q(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}const Y=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,X=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Z=new RegExp(`(${Object.keys(P).join("|")})`,"g");class J extends C{constructor(e,t,n){super(),this.getValue=()=>this.calc(...this.payload.map(e=>e.getValue())),this.updateConfig=(e,t)=>this.calc=_.create(e,t),this.interpolate=(e,t)=>new J(this,e,t),this.payload=e instanceof C&&!e.updateConfig?e.payload:Array.isArray(e)?e:[e],this.calc=_.create(t,n)}}class Q extends E{constructor(e){var t;super(),t=this,this.setValue=function(e,n){void 0===n&&(n=!0),t.value=e,n&&t.flush()},this.getValue=()=>this.value,this.updateStyles=()=>function e(t,n){"function"==typeof t.update?n.add(t):t.getChildren().forEach(t=>e(t,n))}(this,this.animatedStyles),this.updateValue=e=>this.flush(this.value=e),this.interpolate=(e,t)=>new J(this,e,t),this.value=e,this.animatedStyles=new Set,this.done=!1,this.startPosition=e,this.lastPosition=e,this.lastVelocity=void 0,this.lastTime=void 0,this.controller=void 0}flush(){0===this.animatedStyles.size&&this.updateStyles(),this.animatedStyles.forEach(e=>e.update())}prepare(e){void 0===this.controller&&(this.controller=e),this.controller===e&&(this.startPosition=this.value,this.lastPosition=this.value,this.lastVelocity=e.isActive?this.lastVelocity:void 0,this.lastTime=e.isActive?this.lastTime:void 0,this.done=!1,this.animatedStyles.clear())}}class ee extends C{constructor(e){var t;super(),t=this,this.setValue=function(e,n){void 0===n&&(n=!0),Array.isArray(e)?e.length===t.payload.length&&e.forEach((e,r)=>t.payload[r].setValue(e,n)):t.payload.forEach((r,o)=>t.payload[o].setValue(e,n))},this.getValue=()=>this.payload.map(e=>e.getValue()),this.interpolate=(e,t)=>new J(this,e,t),this.payload=e.map(e=>new Q(e))}}function te(e,t){return null==e?t:e}function ne(e){return void 0!==e?Array.isArray(e)?e:[e]:[]}function re(e,t){if(typeof e!=typeof t)return!1;if("string"==typeof e||"number"==typeof e)return e===t;let n;for(n in e)if(!(n in t))return!1;for(n in t)if(e[n]!==t[n])return!1;return void 0!==n||e===t}function oe(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"function"==typeof e?e(...n):e}function ie(e){return Object.keys(e).map(t=>e[t])}function ae(e){const t=function(e){return e.to,e.from,e.config,e.native,e.onStart,e.onRest,e.onFrame,e.children,e.reset,e.reverse,e.force,e.immediate,e.impl,e.inject,e.delay,e.attach,e.destroyed,e.interpolateTo,e.autoStart,e.ref,o(e,["to","from","config","native","onStart","onRest","onFrame","children","reset","reverse","force","immediate","impl","inject","delay","attach","destroyed","interpolateTo","autoStart","ref"])}(e),n=Object.keys(e).reduce((n,r)=>void 0!==t[r]?n:i({},n,{[r]:e[r]}),{});return i({to:t},n)}function se(e,t){let n=t[0],r=t[1];return i({},e,{[n]:new(Array.isArray(r)?ee:Q)(r)})}function le(e){const t=e.from,n=e.to,r=e.native,o=Object.entries(i({},t,n));return r?o.reduce(se,{}):i({},t,n)}function ue(e,t){return t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e)),e}const ce=e=>"auto"===e;let de={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const pe=["Webkit","Ms","Moz","O"];function fe(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||de.hasOwnProperty(e)&&de[e]?(""+t).trim():t+"px"}de=Object.keys(de).reduce((e,t)=>(pe.forEach(n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t]),e),de);const he={};S(e=>new A(e)),O("div"),w((function(e){const t=e.output.map(e=>e.replace(X,G)).map(e=>e.replace(Z,G)),n=t[0].match(Y).map(()=>[]);t.forEach(e=>{e.match(Y).forEach((e,t)=>n[t].push(+e))});const r=t[0].match(Y).map((t,r)=>_.create(i({},e,{output:n[r]})));return e=>{let n=0;return t[0].replace(Y,()=>r[n++](e)).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,(e,t,n,r,o)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${o})`)}})),v(P),b((function(e,t){const n=e.from,r=e.to,o=e.children;if(!ie(r).some(ce)&&!ie(n).some(ce))return;let l=o(le(e));if(!l)return;Array.isArray(l)&&(l={type:"div",props:{children:l}});const u=l.props.style;return a.createElement(l.type,i({key:l.key?l.key:void 0},l.props,{style:i({},u,{position:"absolute",visibility:"hidden"}),ref:o=>{if(o){let a,l,u=s.findDOMNode(o),c=getComputedStyle(u);if("border-box"===c.boxSizing)a=u.offsetWidth,l=u.offsetHeight;else{const e=parseFloat(c.paddingLeft||0)+parseFloat(c.paddingRight||0),t=parseFloat(c.paddingTop||0)+parseFloat(c.paddingBottom||0),n=parseFloat(c.borderLeftWidth||0)+parseFloat(c.borderRightWidth||0),r=parseFloat(c.borderTopWidth||0)+parseFloat(c.borderBottomWidth||0);a=u.offsetWidth-e-n,l=u.offsetHeight-t-r}const d=((e,t)=>(n,r)=>{let o=r[0],a=r[1];return i({},n,{[o]:"auto"===a?~o.indexOf("height")?t:e:a})})(a,l);t(i({},e,{from:Object.entries(n).reduce(d,n),to:Object.entries(r).reduce(d,r)}))}}}))})),y((e,t)=>{if(!e.nodeType||void 0===e.setAttribute)return!1;{const i=t.style,a=t.children,s=t.scrollTop,l=t.scrollLeft,u=o(t,["style","children","scrollTop","scrollLeft"]);void 0!==s&&(e.scrollTop=s),void 0!==l&&(e.scrollLeft=l),void 0!==a&&(e.textContent=a);for(let t in i)if(i.hasOwnProperty(t)){var n=0===t.indexOf("--"),r=fe(t,i[t],n);"float"===t&&(t="cssFloat"),n?e.style.setProperty(t,r):e.style[t]=r}for(let t in u){const n=he[t]||(he[t]=t.replace(/([A-Z])/g,e=>"-"+e.toLowerCase()));void 0!==e.getAttribute(n)&&e.setAttribute(n,u[t])}}},e=>e);let me=!1;const ge=new Set,ye=()=>{let e=h();for(let t of ge){let n=!0,r=!0;for(let o=0;o<t.configs.length;o++){let i,a,s=t.configs[o];for(let o=0;o<s.animatedValues.length;o++){let l=s.animatedValues[o];if(l.done)continue;let u=s.fromValues[o],c=s.toValues[o],d=l.lastPosition,p=c instanceof x,f=Array.isArray(s.initialVelocity)?s.initialVelocity[o]:s.initialVelocity;if(p&&(c=c.getValue()),s.immediate||!p&&!s.decay&&u===c)l.updateValue(c),l.done=!0;else if(s.delay&&e-t.startTime<s.delay)n=!1;else if(r=!1,"string"!=typeof u&&"string"!=typeof c){if(void 0!==s.duration)d=u+s.easing((e-t.startTime-s.delay)/s.duration)*(c-u),i=e>=t.startTime+s.delay+s.duration;else if(s.decay)d=u+f/(1-.998)*(1-Math.exp(-(1-.998)*(e-t.startTime))),i=Math.abs(l.lastPosition-d)<.1,i&&(c=d);else{a=void 0!==l.lastTime?l.lastTime:e,f=void 0!==l.lastVelocity?l.lastVelocity:s.initialVelocity,e>a+64&&(a=e);let t=Math.floor(e-a);for(let e=0;e<t;++e){f+=1*((-s.tension*(d-c)+-s.friction*f)/s.mass)/1e3,d+=1*f/1e3}let n=!(!s.clamp||0===s.tension)&&(u<c?d>c:d<c),r=Math.abs(f)<=s.precision,o=0===s.tension||Math.abs(c-d)<=s.precision;i=n||r&&o,l.lastVelocity=f,l.lastTime=e}p&&!s.toValues[o].done&&(i=!1),i?(l.value!==c&&(d=c),l.done=!0):n=!1,l.updateValue(d),l.lastPosition=d}else l.updateValue(c),l.done=!0}!t.props.onFrame&&t.props.native||(t.animatedProps[s.name]=s.interpolation.getValue())}!t.props.onFrame&&t.props.native||(!t.props.native&&t.onUpdate&&t.onUpdate(),t.props.onFrame&&t.props.onFrame(t.animatedProps)),n&&(ge.delete(t),t.debouncedOnEnd({finished:!0,noChange:r}))}ge.size?d(ye):me=!1},ve=e=>{ge.has(e)&&ge.delete(e)};class be{constructor(e,t){void 0===t&&(t={native:!0,interpolateTo:!0,autoStart:!0}),this.getValues=()=>this.props.native?this.interpolations:this.animatedProps,this.dependents=new Set,this.isActive=!1,this.hasChanged=!1,this.props={},this.merged={},this.animations={},this.interpolations={},this.animatedProps={},this.configs=[],this.frame=void 0,this.startTime=void 0,this.lastTime=void 0,this.update(i({},e,t))}update(e){this.props=i({},this.props,e);let t=this.props.interpolateTo?ae(this.props):this.props,n=t.from,r=void 0===n?{}:n,o=t.to,a=void 0===o?{}:o,s=t.config,l=void 0===s?{}:s,u=t.delay,d=void 0===u?0:u,p=t.reverse,f=t.attach,h=t.reset,m=t.immediate,g=t.autoStart,y=t.ref;if(p){var v=[a,r];r=v[0],a=v[1]}this.hasChanged=!1;let b=f&&f(this),w=h?{}:this.merged;if(this.merged=i({},r,w,a),this.animations=Object.entries(this.merged).reduce((e,t,n)=>{let o=t[0],a=t[1],s=!h&&e[o]||{};const u="number"==typeof a,p="string"==typeof a&&!a.startsWith("#")&&!/\d/.test(a)&&!c[a],f=!u&&!p&&Array.isArray(a);let g=void 0!==r[o]?r[o]:a,y=u||f||p?a:1,v=oe(l,o);if(b&&(y=b.animations[o].parent),void 0===v.decay&&re(s.changes,a))return e;{let t,n;if(this.hasChanged=!0,u||p)t=n=s.parent||new Q(g);else if(f)t=n=s.parent||new ee(g);else{const e=s.interpolation&&s.interpolation.calc(s.parent.value);s.parent?(t=s.parent,t.setValue(0,!1)):t=new Q(0);const r={output:[void 0!==e?e:g,a]};s.interpolation?(n=s.interpolation,s.interpolation.updateConfig(r)):n=t.interpolate(r)}oe(m,o)&&t.setValue(a,!1);const r=ne(t.getPayload());return r.forEach(e=>e.prepare(this)),i({},e,{[o]:i({},s,{name:o,parent:t,interpolation:n,animatedValues:r,changes:a,fromValues:ne(t.getValue()),toValues:ne(b?y.getPayload():y),immediate:oe(m,o),delay:te(v.delay,d||0),initialVelocity:te(v.velocity,0),clamp:te(v.clamp,!1),precision:te(v.precision,.01),tension:te(v.tension,170),friction:te(v.friction,26),mass:te(v.mass,1),duration:v.duration,easing:te(v.easing,e=>e),decay:v.decay})})}},this.animations),this.hasChanged){this.configs=ie(this.animations),this.animatedProps={},this.interpolations={};for(let e in this.animations)this.interpolations[e]=this.animations[e].interpolation,this.animatedProps[e]=this.animations[e].interpolation.getValue()}for(var O=arguments.length,S=new Array(O>1?O-1:0),I=1;I<O;I++)S[I-1]=arguments[I];y||!g&&!S.length||this.start(...S);const x=S[0],j=S[1];return this.onEnd="function"==typeof x&&x,this.onUpdate=j,this.getValues()}start(e,t){var n;return this.startTime=h(),this.isActive&&this.stop(),this.isActive=!0,this.onEnd="function"==typeof e&&e,this.onUpdate=t,this.props.onStart&&this.props.onStart(),n=this,ge.has(n)||(ge.add(n),me||d(ye),me=!0),new Promise(e=>this.resolve=e)}stop(e){void 0===e&&(e=!1),e&&ie(this.animations).forEach(e=>e.changes=void 0),this.debouncedOnEnd({finished:e})}destroy(){ve(this),this.props={},this.merged={},this.animations={},this.interpolations={},this.animatedProps={},this.configs=[]}debouncedOnEnd(e){ve(this),this.isActive=!1;const t=this.onEnd;this.onEnd=null,t&&t(e),this.resolve&&this.resolve(),this.resolve=null}}class we extends k{constructor(e,t){super(),e.style&&(e=i({},e,{style:g(e.style)})),this.payload=e,this.update=t,this.attach()}}function Oe(e){class t extends a.Component{constructor(e){super(),this.callback=()=>{if(this.node){!1===u.fn(this.node,this.propsAnimated.getAnimatedValue(),this)&&this.forceUpdate()}},this.attachProps(e)}componentWillUnmount(){this.propsAnimated&&this.propsAnimated.detach()}setNativeProps(e){!1===u.fn(this.node,e,this)&&this.forceUpdate()}attachProps(e){e.forwardRef;let t=o(e,["forwardRef"]);const n=this.propsAnimated;this.propsAnimated=new we(t,this.callback),n&&n.detach()}shouldComponentUpdate(e){const t=e.style,n=o(e,["style"]),r=this.props,i=r.style;return(!re(o(r,["style"]),n)||!re(i,t))&&(this.attachProps(e),!0)}render(){const t=this.propsAnimated.getValue(),n=(t.scrollTop,t.scrollLeft,o(t,["scrollTop","scrollLeft"]));return a.createElement(e,i({},n,{ref:e=>this.node=ue(e,this.props.forwardRef)}))}}return a.forwardRef((e,n)=>a.createElement(t,i({},e,{forwardRef:n})))}const Se={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}};class Ie extends a.Component{constructor(){super(...arguments),this.state={lastProps:{from:{},to:{}},propsChanged:!1,internal:!1},this.controller=new be(null,null),this.didUpdate=!1,this.didInject=!1,this.finished=!0,this.start=()=>{this.finished=!1;let e=this.mounted;this.controller.start(t=>this.finish(i({},t,{wasMounted:e})),this.update)},this.stop=()=>this.controller.stop(!0),this.update=()=>this.mounted&&this.setState({internal:!0}),this.finish=e=>{let t=e.finished,n=e.noChange,r=e.wasMounted;this.finished=!0,this.mounted&&t&&(!this.props.onRest||!r&&n||this.props.onRest(this.controller.merged),this.mounted&&this.didInject&&(this.afterInject=le(this.props),this.setState({internal:!0})),this.mounted&&(this.didInject||this.props.after)&&this.setState({internal:!0}),this.didInject=!1)}}componentDidMount(){this.componentDidUpdate(),this.mounted=!0}componentWillUnmount(){this.mounted=!1,this.stop()}static getDerivedStateFromProps(e,t){let n=t.internal,r=t.lastProps;const o=e.from,i=e.to,a=e.reset,s=e.force;return{propsChanged:!re(i,r.to)||!re(o,r.from)||a&&!n||s&&!n,lastProps:e,internal:!1}}render(){const e=this.props.children,t=this.state.propsChanged;if(this.props.inject&&t&&!this.injectProps){const e=this.props.inject(this.props,e=>{this.injectProps=e,this.setState({internal:!0})});if(e)return e}(this.injectProps||t)&&(this.didInject=!1,this.injectProps?(this.controller.update(this.injectProps),this.didInject=!0):t&&this.controller.update(this.props),this.didUpdate=!0,this.afterInject=void 0,this.injectProps=void 0);let n=i({},this.controller.getValues(),this.afterInject);return this.finished&&(n=i({},n,this.props.after)),Object.keys(n).length?e(n):null}componentDidUpdate(){this.didUpdate&&this.start(),this.didUpdate=!1}}Ie.defaultProps={from:{},to:{},config:Se.default,native:!1,immediate:!1,reset:!1,force:!1,inject:l};class xe extends a.PureComponent{constructor(){super(...arguments),this.first=!0,this.instances=new Set,this.hook=(e,t,n,r)=>(this.instances.add(e),(r?t===n-1:0===t)?void 0:Array.from(this.instances)[r?t+1:t-1])}render(){const e=this.props,t=e.items,n=e.children,r=e.from,s=void 0===r?{}:r,l=e.initial,u=e.reverse,c=e.keys,d=e.delay,p=e.onRest,f=o(e,["items","children","from","initial","reverse","keys","delay","onRest"]),h=ne(t);return ne(h).map((e,t)=>a.createElement(Ie,i({onRest:0===t?p:null,key:"function"==typeof c?c(e):ne(c)[t],from:this.first&&void 0!==l?l||{}:s},f,{delay:0===t&&d||void 0,attach:e=>this.hook(e,t,h.length,u),children:r=>{const o=n(e,t);return o?o(r):null}})))}componentDidUpdate(e){this.first=!1,e.items!==this.props.items&&this.instances.clear()}}xe.defaultProps={keys:e=>e};class je extends a.PureComponent{constructor(){var e;super(...arguments),e=this,this.guid=0,this.state={props:{},resolve:()=>null,last:!0,index:0},this.next=function(t,n,r){return void 0===n&&(n=!0),void 0===r&&(r=0),e.running=!0,new Promise(o=>{e.mounted&&e.setState(e=>({props:t,resolve:o,last:n,index:r}),()=>e.running=!1)})}}componentDidMount(){this.mounted=!0,this.componentDidUpdate({})}componentWillUnmount(){this.mounted=!1}componentDidUpdate(e){var t=this;const n=this.props,r=n.states,o=n.filter,i=n.state;if((e.state!==this.props.state||this.props.reset&&!this.running||!re(r[i],e.states[e.state]))&&r&&i&&r[i]){const e=++this.guid,n=r[i];if(n)if(Array.isArray(n)){let t=Promise.resolve();for(let r=0;r<n.length;r++){let i=r,a=n[i],s=i===n.length-1;t=t.then(()=>e===this.guid&&this.next(o(a),s,i))}}else if("function"==typeof n){let r=0;n((function(n,i){return void 0===i&&(i=!1),e===t.guid&&t.next(o(n),i,r++)}),()=>d(()=>this.instance&&this.instance.stop()),this.props)}else this.next(o(r[i]))}}render(){const e=this.state,t=e.props,n=e.resolve,r=e.last,s=e.index;if(!t||0===Object.keys(t).length)return null;let l=this.props,u=(l.state,l.filter,l.states,l.config),c=l.primitive,d=l.onRest,p=l.forwardRef,f=o(l,["state","filter","states","config","primitive","onRest","forwardRef"]);return Array.isArray(u)&&(u=u[s]),a.createElement(c,i({ref:e=>this.instance=ue(e,p),config:u},f,t,{onRest:e=>{n(e),d&&r&&d(e)}}))}}je.defaultProps={state:"__default"};const Ee=a.forwardRef((e,t)=>a.createElement(je,i({},e,{forwardRef:t})));Ee.create=e=>function(t,n){return void 0===n&&(n=e=>e),("function"==typeof t||Array.isArray(t))&&(t={__default:t}),r=>a.createElement(je,i({primitive:e,states:t,filter:n},r))},Ee.Spring=e=>Ee.create(Ie)(e,ae),Ee.Trail=e=>Ee.create(xe)(e,ae);let Ce=0,ke=e=>{let t=e.items,n=e.keys,r=o(e,["items","keys"]);return t=ne(void 0!==t?t:null),n="function"==typeof n?t.map(n):ne(n),i({items:t,keys:n.map(e=>String(e))},r)};class Ae extends a.PureComponent{componentDidMount(){this.mounted=!0}componentWillUnmount(){this.mounted=!1}constructor(e){super(e),this.destroyItem=(e,t,n)=>r=>{const o=this.props,i=o.onRest,a=o.onDestroyed;this.mounted&&(a&&a(e),this.setState(e=>({deleted:e.deleted.filter(e=>e.key!==t)})),i&&i(e,n,r))},this.state={first:!0,transitions:[],current:{},deleted:[],prevProps:e}}static getDerivedStateFromProps(e,t){let n=t.first,r=t.prevProps,a=o(t,["first","prevProps"]),s=ke(e),l=s.items,u=s.keys,c=s.initial,d=s.from,p=s.enter,f=s.leave,h=s.update,m=s.trail,g=void 0===m?0:m,y=s.unique,v=s.config,b=ke(r),w=b.keys,O=b.items,S=i({},a.current),I=[...a.deleted],x=Object.keys(S),j=new Set(x),E=new Set(u),C=u.filter(e=>!j.has(e)),k=a.transitions.filter(e=>!e.destroyed&&!E.has(e.originalKey)).map(e=>e.originalKey),A=u.filter(e=>j.has(e)),P=0;C.forEach(e=>{y&&I.find(t=>t.originalKey===e)&&(I=I.filter(t=>t.originalKey!==e));const t=u.indexOf(e),r=l[t];S[e]={state:"enter",originalKey:e,key:y?String(e):Ce++,item:r,trail:P+=g,config:oe(v,r,"enter"),from:oe(n&&void 0!==c?c||{}:d,r),to:oe(p,r)}}),k.forEach(e=>{const t=w.indexOf(e),n=O[t];I.push(i({},S[e],{state:"leave",destroyed:!0,left:w[Math.max(0,t-1)],right:w[Math.min(w.length,t+1)],trail:P+=g,config:oe(v,n,"leave"),to:oe(f,n)})),delete S[e]}),A.forEach(e=>{const t=u.indexOf(e),n=l[t];S[e]=i({},S[e],{item:n,state:"update",trail:P+=g,config:oe(v,n,"update"),to:oe(h,n)})});let _=u.map(e=>S[e]);return I.forEach(e=>{let t,n=e.left,r=e.right,i=o(e,["left","right"]);-1!==(t=_.findIndex(e=>e.originalKey===n))&&(t+=1),-1===t&&(t=_.findIndex(e=>e.originalKey===r)),-1===t&&(t=I.findIndex(e=>e.originalKey===n)),-1===t&&(t=I.findIndex(e=>e.originalKey===r)),t=Math.max(0,t),_=[..._.slice(0,t),i,..._.slice(t)]}),{first:n&&0===C.length,transitions:_,current:S,deleted:I,prevProps:e}}render(){const e=this.props,t=(e.initial,e.from,e.enter,e.leave,e.update,e.onDestroyed,e.keys,e.items,e.onFrame),n=e.onRest,r=e.onStart,s=(e.trail,e.config,e.children),l=(e.unique,e.reset),u=o(e,["initial","from","enter","leave","update","onDestroyed","keys","items","onFrame","onRest","onStart","trail","config","children","unique","reset"]);return this.state.transitions.map((e,o)=>{let c=e.state,d=e.key,p=e.item,f=e.from,h=e.to,m=e.trail,g=e.config,y=e.destroyed;return a.createElement(Ee,i({reset:l&&"enter"===c,primitive:Ie,state:c,filter:ae,states:{[c]:h},key:d,onRest:y?this.destroyItem(p,d,c):n&&(e=>n(p,c,e)),onStart:r&&(()=>r(p,c)),onFrame:t&&(e=>t(p,c,e)),delay:m,config:g},u,{from:f,children:e=>{const t=s(p,c,o);return t?t(e):null}}))})}}Ae.defaultProps={keys:e=>e,unique:!1,reset:!1};const Pe=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].reduce((e,t)=>(e[t]=Oe(t),e),Oe);t.Spring=Ie,t.Keyframes=Ee,t.Transition=Ae,t.Trail=xe,t.Controller=be,t.config=Se,t.animated=Pe,t.interpolate=(e,t,n)=>e&&new J(e,t,n),t.Globals=I},function(e,t,n){"use strict";e.exports=n(16)},function(e,t){e.exports=ctEvents},function(e,t,n){var r,o,i=n(13),a=n(14),s=(o=[],{activateTrap:function(e){if(o.length>0){var t=o[o.length-1];t!==e&&t.pause()}var n=o.indexOf(e);-1===n||o.splice(n,1),o.push(e)},deactivateTrap:function(e){var t=o.indexOf(e);-1!==t&&o.splice(t,1),o.length>0&&o[o.length-1].unpause()}});function l(e){return setTimeout(e,0)}e.exports=function(e,t){var n=document,o="string"==typeof e?n.querySelector(e):e,u=a({returnFocusOnDeactivate:!0,escapeDeactivates:!0},t),c={firstTabbableNode:null,lastTabbableNode:null,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1},d={activate:function(e){if(c.active)return;O(),c.active=!0,c.paused=!1,c.nodeFocusedBeforeActivation=n.activeElement;var t=e&&e.onActivate?e.onActivate:u.onActivate;t&&t();return f(),d},deactivate:p,pause:function(){if(c.paused||!c.active)return;c.paused=!0,h()},unpause:function(){if(!c.paused||!c.active)return;c.paused=!1,O(),f()}};return d;function p(e){if(c.active){clearTimeout(r),h(),c.active=!1,c.paused=!1,s.deactivateTrap(d);var t=e&&void 0!==e.onDeactivate?e.onDeactivate:u.onDeactivate;return t&&t(),(e&&void 0!==e.returnFocus?e.returnFocus:u.returnFocusOnDeactivate)&&l((function(){var e;S((e=c.nodeFocusedBeforeActivation,m("setReturnFocus")||e))})),d}}function f(){if(c.active)return s.activateTrap(d),r=l((function(){S(g())})),n.addEventListener("focusin",v,!0),n.addEventListener("mousedown",y,{capture:!0,passive:!1}),n.addEventListener("touchstart",y,{capture:!0,passive:!1}),n.addEventListener("click",w,{capture:!0,passive:!1}),n.addEventListener("keydown",b,{capture:!0,passive:!1}),d}function h(){if(c.active)return n.removeEventListener("focusin",v,!0),n.removeEventListener("mousedown",y,!0),n.removeEventListener("touchstart",y,!0),n.removeEventListener("click",w,!0),n.removeEventListener("keydown",b,!0),d}function m(e){var t=u[e],r=t;if(!t)return null;if("string"==typeof t&&!(r=n.querySelector(t)))throw new Error("`"+e+"` refers to no known node");if("function"==typeof t&&!(r=t()))throw new Error("`"+e+"` did not return a node");return r}function g(){var e;if(!(e=null!==m("initialFocus")?m("initialFocus"):o.contains(n.activeElement)?n.activeElement:c.firstTabbableNode||m("fallbackFocus")))throw new Error("Your focus-trap needs to have at least one focusable element");return e}function y(e){o.contains(e.target)||(u.clickOutsideDeactivates?p({returnFocus:!i.isFocusable(e.target)}):u.allowOutsideClick&&u.allowOutsideClick(e)||e.preventDefault())}function v(e){o.contains(e.target)||e.target instanceof Document||(e.stopImmediatePropagation(),S(c.mostRecentlyFocusedNode||g()))}function b(e){if(!1!==u.escapeDeactivates&&function(e){return"Escape"===e.key||"Esc"===e.key||27===e.keyCode}(e))return e.preventDefault(),void p();(function(e){return"Tab"===e.key||9===e.keyCode})(e)&&function(e){if(O(),e.shiftKey&&e.target===c.firstTabbableNode)return e.preventDefault(),void S(c.lastTabbableNode);if(!e.shiftKey&&e.target===c.lastTabbableNode)e.preventDefault(),S(c.firstTabbableNode)}(e)}function w(e){u.clickOutsideDeactivates||o.contains(e.target)||u.allowOutsideClick&&u.allowOutsideClick(e)||(e.preventDefault(),e.stopImmediatePropagation())}function O(){var e=i(o);c.firstTabbableNode=e[0]||g(),c.lastTabbableNode=e[e.length-1]||g()}function S(e){e!==n.activeElement&&(e&&e.focus?(e.focus(),c.mostRecentlyFocusedNode=e,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(e)&&e.select()):S(g()))}}},function(e,t,n){"use strict";var r=n(12);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){var n=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'],r=n.join(","),o="undefined"==typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;function i(e,t){t=t||{};var n,i,s,l=[],d=[],p=e.querySelectorAll(r);for(t.includeContainer&&o.call(e,r)&&(p=Array.prototype.slice.apply(p)).unshift(e),n=0;n<p.length;n++)a(i=p[n])&&(0===(s=u(i))?l.push(i):d.push({documentOrder:n,tabIndex:s,node:i}));return d.sort(c).map((function(e){return e.node})).concat(l)}function a(e){return!(!s(e)||function(e){return function(e){return d(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t=function(e){for(var t=0;t<e.length;t++)if(e[t].checked)return e[t]}(e.ownerDocument.querySelectorAll('input[type="radio"][name="'+e.name+'"]'));return!t||t===e}(e)}(e)||u(e)<0)}function s(e){return!(e.disabled||function(e){return d(e)&&"hidden"===e.type}(e)||function(e){return null===e.offsetParent||"hidden"===getComputedStyle(e).visibility}(e))}i.isTabbable=function(e){if(!e)throw new Error("No node provided");return!1!==o.call(e,r)&&a(e)},i.isFocusable=function(e){if(!e)throw new Error("No node provided");return!1!==o.call(e,l)&&s(e)};var l=n.concat("iframe").join(",");function u(e){var t=parseInt(e.getAttribute("tabindex"),10);return isNaN(t)?function(e){return"true"===e.contentEditable}(e)?0:e.tabIndex:t}function c(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex}function d(e){return"INPUT"===e.tagName}e.exports=i},function(e,t){e.exports=function(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var o in r)n.call(r,o)&&(e[o]=r[o])}return e};var n=Object.prototype.hasOwnProperty},function(e,t){e.exports=window.ReactDOM},function(e,t,n){"use strict";
|
| 7 |
+
/** @license React v16.13.1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
* react-is.production.min.js
|
| 9 |
*
|
| 10 |
* Copyright (c) Facebook, Inc. and its affiliates.
|
| 11 |
*
|
| 12 |
* This source code is licensed under the MIT license found in the
|
| 13 |
* LICENSE file in the root directory of this source tree.
|
| 14 |
+
*/var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,l=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,d=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,h=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.suspense_list"):60120,g=r?Symbol.for("react.memo"):60115,y=r?Symbol.for("react.lazy"):60116,v=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,O=r?Symbol.for("react.scope"):60119;function S(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case d:case p:case a:case l:case s:case h:return e;default:switch(e=e&&e.$$typeof){case c:case f:case y:case g:case u:return e;default:return t}}case i:return t}}}function I(e){return S(e)===p}t.AsyncMode=d,t.ConcurrentMode=p,t.ContextConsumer=c,t.ContextProvider=u,t.Element=o,t.ForwardRef=f,t.Fragment=a,t.Lazy=y,t.Memo=g,t.Portal=i,t.Profiler=l,t.StrictMode=s,t.Suspense=h,t.isAsyncMode=function(e){return I(e)||S(e)===d},t.isConcurrentMode=I,t.isContextConsumer=function(e){return S(e)===c},t.isContextProvider=function(e){return S(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return S(e)===f},t.isFragment=function(e){return S(e)===a},t.isLazy=function(e){return S(e)===y},t.isMemo=function(e){return S(e)===g},t.isPortal=function(e){return S(e)===i},t.isProfiler=function(e){return S(e)===l},t.isStrictMode=function(e){return S(e)===s},t.isSuspense=function(e){return S(e)===h},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===p||e===l||e===s||e===h||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===g||e.$$typeof===u||e.$$typeof===c||e.$$typeof===f||e.$$typeof===b||e.$$typeof===w||e.$$typeof===O||e.$$typeof===v)},t.typeOf=S},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n(9),i=n.n(o),a=n(4),s=n(6),l=n.n(s),u=n(3),c=n.n(u),d=n(1),p=n.n(d);function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(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}var m=function(e){e.initialState,e.getInitialState,e.refs,e.getRefs,e.didMount,e.didUpdate,e.willUnmount,e.getSnapshotBeforeUpdate,e.shouldUpdate,e.render;return function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["initialState","getInitialState","refs","getRefs","didMount","didUpdate","willUnmount","getSnapshotBeforeUpdate","shouldUpdate","render"])},g=function(e){function t(){var n,r;f(this,t);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=h(this,e.call.apply(e,[this].concat(i))),y.call(r),h(r,n)}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,e),t.prototype.getArgs=function(){var e=this.state,t=this.props,n=this._setState,r=this._forceUpdate,o=this._refs;return{state:e,props:m(t),refs:o,setState:n,forceUpdate:r}},t.prototype.componentDidMount=function(){this.props.didMount&&this.props.didMount(this.getArgs())},t.prototype.shouldComponentUpdate=function(e,t){return!this.props.shouldUpdate||this.props.shouldUpdate({props:this.props,state:this.state,nextProps:m(e),nextState:t})},t.prototype.componentWillUnmount=function(){this.props.willUnmount&&this.props.willUnmount({state:this.state,props:m(this.props),refs:this._refs})},t.prototype.componentDidUpdate=function(e,t,n){this.props.didUpdate&&this.props.didUpdate(Object.assign(this.getArgs(),{prevProps:m(e),prevState:t}),n)},t.prototype.getSnapshotBeforeUpdate=function(e,t){return this.props.getSnapshotBeforeUpdate?this.props.getSnapshotBeforeUpdate(Object.assign(this.getArgs(),{prevProps:m(e),prevState:t})):null},t.prototype.render=function(){var e=this.props,t=e.children,n=e.render;return n?n(this.getArgs()):"function"==typeof t?t(this.getArgs()):t||null},t}(c.a.Component);g.defaultProps={getInitialState:function(){},getRefs:function(){return{}}};var y=function(){var e=this;this.state=this.props.initialState||this.props.getInitialState(this.props),this._refs=this.props.refs||this.props.getRefs(this.getArgs()),this._setState=function(){return e.setState.apply(e,arguments)},this._forceUpdate=function(){return e.forceUpdate.apply(e,arguments)}},v=g,b=function(e){var t=e.children,n=e.container,o=void 0===n?document.body:n,i=e.type,a=void 0===i?"reach-portal":i;return Object(r.createElement)(v,{getRefs:function(){return{node:null}},didMount:function(e){var t=e.refs,n=e.forceUpdate,r=o.hasOwnProperty("current")?o.current:o;t.node=document.createElement(a),r.appendChild(t.node),n()},willUnmount:function(e){var t=e.refs.node,n=o.hasOwnProperty("current")?o.current:o;n&&n.removeChild(t)},render:function(e){var n=e.refs.node;return n?Object(r.createPortal)(t,n):null}})};var w=function(e,t){return function(n){if(e&&e(n),!n.defaultPrevented)return t(n)}},O=n(10),S=n.n(O);function I(){return(I=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function x(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var j=function(){},E=function(){},C=function(e,t){var n,r,o;e.disposeAriaHider=(n=e.overlayNode,r=[],o=[],Array.prototype.forEach.call(document.querySelectorAll("body > *"),(function(e){if(e!==n.parentNode){var t=e.getAttribute("aria-hidden");null!==t&&"false"!==t||(r.push(t),o.push(e),e.setAttribute("aria-hidden","true"))}})),function(){o.forEach((function(e,t){var n=r[t];null===n?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",n)}))}),e.trap=S()(e.overlayNode,{initialFocus:t?function(){return t.current}:void 0,fallbackFocus:e.contentNode,escapeDeactivates:!1,clickOutsideDeactivates:!1})},k=function(e){var t=e.refs;t.trap.deactivate(),t.disposeAriaHider()},A=React.createContext(),P=React.forwardRef((function(e,t){var n=e.container,o=e.isOpen,i=void 0===o||o,a=e.onDismiss,s=void 0===a?j:a,l=e.initialFocusRef,u=e.onClick,c=e.onKeyDown,d=x(e,["container","isOpen","onDismiss","initialFocusRef","onClick","onKeyDown"]);return Object(r.createElement)(v,{didMount:E},i?Object(r.createElement)(b,{container:n,"data-reach-dialog-wrapper":!0},Object(r.createElement)(v,{refs:{overlayNode:null,contentNode:null},didMount:function(e){var t=e.refs;C(t,l)},willUnmount:k},(function(e){var n=e.refs;return Object(r.createElement)(A.Provider,{value:function(e){return n.contentNode=e}},Object(r.createElement)("div",I({"data-reach-dialog-overlay":!0,onClick:w(u,(function(e){e.stopPropagation(),s()})),onKeyDown:w(c,(function(e){"Escape"===e.key&&(e.stopPropagation(),s())})),ref:function(e){n.overlayNode=e,t&&t(e)}},d)))}))):null)}));P.propTypes={initialFocusRef:function(){}};var _=function(e){return e.stopPropagation()},D=React.forwardRef((function(e,t){var n=e.onClick,o=(e.onKeyDown,x(e,["onClick","onKeyDown"]));return Object(r.createElement)(A.Consumer,null,(function(e){return Object(r.createElement)("div",I({"aria-modal":"true","data-reach-dialog-content":!0,tabIndex:"-1",onClick:w(n,_),ref:function(n){e(n),t&&t(n)}},o))}))})),M=n(7),T=function(e){return!!e},R=function(e){var t=e.items,n=e.isVisible,o=void 0===n?T:n,i=e.render,a=e.className,s=e.onDismiss;return Object(r.createElement)(M.Transition,{items:t,onStart:function(){return document.body.classList[o(t)?"add":"remove"]("ct-dashboard-overlay-open")},config:{duration:200},from:{opacity:0,y:-10},enter:{opacity:1,y:0},leave:{opacity:0,y:10}},(function(e){return o(e)&&function(t){return Object(r.createElement)(P,{style:{opacity:t.opacity},container:document.querySelector("#wpbody"),onDismiss:function(){return s()}},Object(r.createElement)(D,{className:l()("ct-admin-modal",a),style:{transform:"translate3d(0px, ".concat(t.y,"px, 0px)")}},Object(r.createElement)("button",{className:"close-button",onClick:function(){return s()}},"×"),i(e,t)))}}))};function V(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return H(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return H(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var F=function(e){var t=V(Object(r.useState)(!1),2),n=t[0],o=t[1];return[function(){return o(!0)},Object(r.createElement)(R,{items:n,onDismiss:function(){return o(!1)},render:function(){return Object(r.createElement)("div",{className:"ct-modal-content",dangerouslySetInnerHTML:{__html:e.readme}})}})]},U=n(5),N=n(2);function L(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n(8);function K(e){return null!=e&&"object"==typeof e&&1===e.nodeType}function $(e,t){return(!t||"hidden"!==e)&&("visible"!==e&&"clip"!==e)}function B(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var n=getComputedStyle(e,null);return $(n.overflowY,t)||$(n.overflowX,t)||function(e){var t=function(e){return e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView.frameElement:null}(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)}(e)}return!1}function W(e,t,n,r,o,i,a,s){return i<e&&a>t||i>e&&a<t?0:i<=e&&s<=n||a>=t&&s>=n?i-e-r:a>t&&s<n||i<e&&s>n?a-t+o:0}var q=0;function z(e){return"function"==typeof e?e:G}function G(){}function Y(e,t){null!==e&&function(e,t){var n=t.scrollMode,r=t.block,o=t.inline,i=t.boundary,a=t.skipOverflowHiddenElements,s="function"==typeof i?i:function(e){return e!==i};if(!K(e))throw new TypeError("Invalid target");for(var l=document.scrollingElement||document.documentElement,u=[],c=e;K(c)&&s(c);){if((c=c.parentNode)===l){u.push(c);break}c===document.body&&B(c)&&!B(document.documentElement)||B(c,a)&&u.push(c)}for(var d=window.visualViewport?visualViewport.width:innerWidth,p=window.visualViewport?visualViewport.height:innerHeight,f=window.scrollX||pageXOffset,h=window.scrollY||pageYOffset,m=e.getBoundingClientRect(),g=m.height,y=m.width,v=m.top,b=m.right,w=m.bottom,O=m.left,S="start"===r||"nearest"===r?v:"end"===r?w:v+g/2,I="center"===o?O+y/2:"end"===o?b:O,x=[],j=0;j<u.length;j++){var E=u[j],C=E.getBoundingClientRect(),k=C.height,A=C.width,P=C.top,_=C.right,D=C.bottom,M=C.left;if("if-needed"===n&&v>=0&&O>=0&&w<=p&&b<=d&&v>=P&&w<=D&&O>=M&&b<=_)return x;var T=getComputedStyle(E),R=parseInt(T.borderLeftWidth,10),V=parseInt(T.borderTopWidth,10),H=parseInt(T.borderRightWidth,10),F=parseInt(T.borderBottomWidth,10),U=0,N=0,L="offsetWidth"in E?E.offsetWidth-E.clientWidth-R-H:0,$="offsetHeight"in E?E.offsetHeight-E.clientHeight-V-F:0;if(l===E)U="start"===r?S:"end"===r?S-p:"nearest"===r?W(h,h+p,p,V,F,h+S,h+S+g,g):S-p/2,N="start"===o?I:"center"===o?I-d/2:"end"===o?I-d:W(f,f+d,d,R,H,f+I,f+I+y,y),U=Math.max(0,U+h),N=Math.max(0,N+f);else{U="start"===r?S-P-V:"end"===r?S-D+F+$:"nearest"===r?W(P,D,k,V,F+$,S,S+g,g):S-(P+k/2)+$/2,N="start"===o?I-M-R:"center"===o?I-(M+A/2)+L/2:"end"===o?I-_+H+L:W(M,_,A,R,H+L,I,I+y,y);var q=E.scrollLeft,z=E.scrollTop;S+=z-(U=Math.max(0,Math.min(z+U,E.scrollHeight-k+$))),I+=q-(N=Math.max(0,Math.min(q+N,E.scrollWidth-A+L)))}x.push({el:E,top:U,left:N})}return x}(e,{boundary:t,block:"nearest",scrollMode:"if-needed"}).forEach((function(e){var t=e.el,n=e.top,r=e.left;t.scrollTop=n,t.scrollLeft=r}))}function X(e,t){return e===t||e.contains&&e.contains(t)}function Z(e,t){var n;function r(){n&&clearTimeout(n)}function o(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];r(),n=setTimeout((function(){n=null,e.apply(void 0,i)}),t)}return o.cancel=r,o}function J(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return t.some((function(t){return t&&t.apply(void 0,[e].concat(r)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function Q(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach((function(t){"function"==typeof t?t(e):t&&(t.current=e)}))}}function ee(e){var t=e.isOpen,n=e.selectedItem,r=e.resultCount,o=e.previousResultCount,i=e.itemToString;return t?r?r!==o?r+" result"+(1===r?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":n?i(n):""}function te(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}function ne(e){return"string"==typeof e.type}function re(e){return e.props}var oe=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function ie(e){void 0===e&&(e={});var t={};return oe.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function ae(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function se(e,t,n){var r=n-1;("number"!=typeof t||t<0||t>=n)&&(t=e>0?-1:r+1);var o=t+e;return o<0?o=r:o>r&&(o=0),o}var le=Z((function(){ce().textContent=""}),500);function ue(e,t){var n=ce(t);e&&(n.textContent=e,le())}function ce(e){void 0===e&&(e=document);var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var de=Object.freeze({__proto__:null,unknown:0,mouseUp:1,itemMouseEnter:2,keyDownArrowUp:3,keyDownArrowDown:4,keyDownEscape:5,keyDownEnter:6,keyDownHome:7,keyDownEnd:8,clickItem:9,blurInput:10,changeInput:11,keyDownSpaceButton:12,clickButton:13,blurButton:14,controlledPropUpdatedSelectedItem:15,touchEnd:16}),pe=function(){var e=function(e){var t,n;function r(t){var n=e.call(this,t)||this;n.id=n.props.id||"downshift-"+String(q++),n.menuId=n.props.menuId||n.id+"-menu",n.labelId=n.props.labelId||n.id+"-label",n.inputId=n.props.inputId||n.id+"-input",n.getItemId=n.props.getItemId||function(e){return n.id+"-item-"+e},n.input=null,n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var r=setTimeout((function(){n.timeoutIds=n.timeoutIds.filter((function(e){return e!==r})),e()}),t);n.timeoutIds.push(r)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=ie(t),n.internalSetState(Object(N.default)({highlightedIndex:e},t))},n.clearSelection=function(e){n.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:n.props.defaultHighlightedIndex,isOpen:n.props.defaultIsOpen},e)},n.selectItem=function(e,t,r){t=ie(t),n.internalSetState(Object(N.default)({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),r)},n.selectItemAtIndex=function(e,t,r){var o=n.items[e];null!=o&&n.selectItem(o,t,r)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var r,o,i={},a="function"==typeof e;return!a&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,Object(N.default)({},n.getStateAndHelpers(),{},e)),n.setState((function(t){t=n.getState(t);var s=a?e(t):e;s=n.props.stateReducer(t,s),r=s.hasOwnProperty("selectedItem");var l={},u={};return r&&s.selectedItem!==t.selectedItem&&(o=s.selectedItem),s.type=s.type||0,Object.keys(s).forEach((function(e){t[e]!==s[e]&&(i[e]=s[e]),"type"!==e&&(u[e]=s[e],n.isControlledProp(e)||(l[e]=s[e]))})),a&&s.hasOwnProperty("inputValue")&&n.props.onInputValueChange(s.inputValue,Object(N.default)({},n.getStateAndHelpers(),{},s)),l}),(function(){z(t)(),Object.keys(i).length>1&&n.props.onStateChange(i,n.getStateAndHelpers()),r&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==o&&n.props.onChange(o,n.getStateAndHelpers()),n.props.onUserAction(i,n.getStateAndHelpers())}))},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var r,o=void 0===e?{}:e,i=o.refKey,a=void 0===i?"ref":i,s=o.ref,l=Object(U.default)(o,["refKey","ref"]),u=(void 0===t?{}:t).suppressRefError,c=void 0!==u&&u;n.getRootProps.called=!0,n.getRootProps.refKey=a,n.getRootProps.suppressRefError=c;var d=n.getState().isOpen;return Object(N.default)(((r={})[a]=Q(s,n.rootRef),r.role="combobox",r["aria-expanded"]=d,r["aria-haspopup"]="listbox",r["aria-owns"]=d?n.menuId:null,r["aria-labelledby"]=n.labelId,r),l)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:4})}else this.internalSetState({isOpen:!0,type:4},(function(){var e=t.getItemCount();e>0&&t.setHighlightedIndex(se(1,t.getState().highlightedIndex,e),{type:4})}))},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:3})}else this.internalSetState({isOpen:!0,type:3},(function(){var e=t.getItemCount();e>0&&t.setHighlightedIndex(se(-1,t.getState().highlightedIndex,e),{type:4})}))},Enter:function(e){var t=this.getState(),n=t.isOpen,r=t.highlightedIndex;if(n&&null!=r){e.preventDefault();var o=this.items[r],i=this.getItemNodeFromIndex(r);if(null==o||i&&i.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}},Escape:function(e){e.preventDefault(),this.reset({type:5,selectedItem:null,inputValue:""})}},n.buttonKeyDownHandlers=Object(N.default)({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=Object(N.default)({},n.keyDownHandlers,{Home:function(e){this.highlightFirstOrLastIndex(e,!0,{type:7})},End:function(e){this.highlightFirstOrLastIndex(e,!1,{type:8})}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,r=t.onClick,o=(t.onPress,t.onKeyDown),i=t.onKeyUp,a=t.onBlur,s=Object(U.default)(t,["onClick","onPress","onKeyDown","onKeyUp","onBlur"]),l=n.getState().isOpen,u={onClick:J(r,n.buttonHandleClick),onKeyDown:J(o,n.buttonHandleKeyDown),onKeyUp:J(i,n.buttonHandleKeyUp),onBlur:J(a,n.buttonHandleBlur)},c=s.disabled?{}:u;return Object(N.default)({type:"button",role:"button","aria-label":l?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},c,{},s)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=ae(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(L(n),e)},n.buttonHandleClick=function(e){e.preventDefault(),n.props.environment.document.activeElement===n.props.environment.document.body&&e.target.focus(),n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){n.isMouseDown||null!=n.props.environment.document.activeElement&&n.props.environment.document.activeElement.id===n.inputId||n.props.environment.document.activeElement===t||n.reset({type:14})}))},n.getLabelProps=function(e){return Object(N.default)({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,r=t.onKeyDown,o=t.onBlur,i=t.onChange,a=t.onInput,s=(t.onChangeText,Object(U.default)(t,["onKeyDown","onBlur","onChange","onInput","onChangeText"])),l={};var u,c=n.getState(),d=c.inputValue,p=c.isOpen,f=c.highlightedIndex;s.disabled||((u={}).onChange=J(i,a,n.inputHandleChange),u.onKeyDown=J(r,n.inputHandleKeyDown),u.onBlur=J(o,n.inputHandleBlur),l=u);return Object(N.default)({"aria-autocomplete":"list","aria-activedescendant":p&&"number"==typeof f&&f>=0?n.getItemId(f):null,"aria-controls":p?n.menuId:null,"aria-labelledby":n.labelId,autoComplete:"off",value:d,id:n.inputId},l,{},s)},n.inputHandleKeyDown=function(e){var t=ae(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(L(n),e)},n.inputHandleChange=function(e){n.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleBlur=function(){n.internalSetTimeout((function(){var e=n.props.environment.document&&!!n.props.environment.document.activeElement&&!!n.props.environment.document.activeElement.dataset&&n.props.environment.document.activeElement.dataset.toggle&&n._rootNode&&n._rootNode.contains(n.props.environment.document.activeElement);n.isMouseDown||e||n.reset({type:10})}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var r,o=void 0===e?{}:e,i=o.refKey,a=void 0===i?"ref":i,s=o.ref,l=Object(U.default)(o,["refKey","ref"]),u=(void 0===t?{}:t).suppressRefError,c=void 0!==u&&u;return n.getMenuProps.called=!0,n.getMenuProps.refKey=a,n.getMenuProps.suppressRefError=c,Object(N.default)(((r={})[a]=Q(s,n.menuRef),r.role="listbox",r["aria-labelledby"]=l&&l["aria-label"]?null:n.labelId,r.id=n.menuId,r),l)},n.getItemProps=function(e){var t,r=void 0===e?{}:e,o=r.onMouseMove,i=r.onMouseDown,a=r.onClick,s=(r.onPress,r.index),l=r.item,u=void 0===l?void 0:l,c=Object(U.default)(r,["onMouseMove","onMouseDown","onClick","onPress","index","item"]);void 0===s?(n.items.push(u),s=n.items.indexOf(u)):n.items[s]=u;var d=a,p=((t={onMouseMove:J(o,(function(){s!==n.getState().highlightedIndex&&(n.setHighlightedIndex(s,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:J(i,(function(e){e.preventDefault()}))}).onClick=J(d,(function(){n.selectItemAtIndex(s,{type:9})})),t),f=c.disabled?{onMouseDown:p.onMouseDown}:p;return Object(N.default)({id:n.getItemId(s),role:"option","aria-selected":n.getState().highlightedIndex===s},f,{},c)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=ie(e),n.internalSetState((function(t){var r=t.selectedItem;return Object(N.default)({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(r)},e)}),t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=ie(e),n.internalSetState((function(t){var r=t.isOpen;return Object(N.default)({isOpen:!r},r&&{highlightedIndex:n.props.defaultHighlightedIndex},{},e)}),(function(){var r=n.getState(),o=r.isOpen,i=r.highlightedIndex;o&&n.getItemCount()>0&&"number"==typeof i&&n.setHighlightedIndex(i,e),z(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=Z((function(){var e=n.getState(),t=n.items[e.highlightedIndex],r=n.getItemCount(),o=n.props.getA11yStatusMessage(Object(N.default)({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:r,highlightedItem:t},e));n.previousResultCount=r,ue(o,n.props.environment.document)}),200);var r=n.props,o=r.defaultHighlightedIndex,i=r.initialHighlightedIndex,a=void 0===i?o:i,s=r.defaultIsOpen,l=r.initialIsOpen,u=void 0===l?s:l,c=r.initialInputValue,d=void 0===c?"":c,p=r.initialSelectedItem,f=void 0===p?null:p,h=n.getState({highlightedIndex:a,isOpen:u,inputValue:d,selectedItem:f});return null!=h.selectedItem&&void 0===n.props.initialInputValue&&(h.inputValue=n.props.itemToString(h.selectedItem)),n.state=h,n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o=r.prototype;return o.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},o.getState=function(e){var t=this;return void 0===e&&(e=this.state),Object.keys(e).reduce((function(n,r){return n[r]=t.isControlledProp(r)?t.props[r]:e[r],n}),{})},o.isControlledProp=function(e){return void 0!==this.props[e]},o.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},o.getItemNodeFromIndex=function(e){return this.props.environment.document.getElementById(this.getItemId(e))},o.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},o.moveHighlightedIndex=function(e,t){var n=this.getItemCount();if(n>0){var r=se(e,this.getState().highlightedIndex,n);this.setHighlightedIndex(r,t)}},o.highlightFirstOrLastIndex=function(e,t,n){var r=this.getItemCount()-1;r<0||!this.getState().isOpen||(e.preventDefault(),this.setHighlightedIndex(t?0:r,n))},o.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,r=e.selectedItem,o=e.isOpen,i=this.props.itemToString,a=this.id,s=this.getRootProps,l=this.getToggleButtonProps,u=this.getLabelProps,c=this.getMenuProps,d=this.getInputProps,p=this.getItemProps,f=this.openMenu,h=this.closeMenu,m=this.toggleMenu,g=this.selectItem,y=this.selectItemAtIndex,v=this.selectHighlightedItem,b=this.setHighlightedIndex,w=this.clearSelection,O=this.clearItems;return{getRootProps:s,getToggleButtonProps:l,getLabelProps:u,getMenuProps:c,getInputProps:d,getItemProps:p,reset:this.reset,openMenu:f,closeMenu:h,toggleMenu:m,selectItem:g,selectItemAtIndex:y,selectHighlightedItem:v,setHighlightedIndex:b,clearSelection:w,clearItems:O,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:i,id:a,highlightedIndex:t,inputValue:n,isOpen:o,selectedItem:r}},o.componentDidMount=function(){var e=this;var t=function(t,n){void 0===n&&(n=!0);var r=e.props.environment.document;return[e._rootNode,e._menuNode].some((function(e){return e&&(X(e,t)||n&&X(e,r.activeElement))}))},n=function(){e.isMouseDown=!0},r=function(n){e.isMouseDown=!1,!t(n.target)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},o=function(){e.isTouchMove=!1},i=function(){e.isTouchMove=!0},a=function(n){var r=t(n.target,!1);e.isTouchMove||r||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},s=this.props.environment;s.addEventListener("mousedown",n),s.addEventListener("mouseup",r),s.addEventListener("touchstart",o),s.addEventListener("touchmove",i),s.addEventListener("touchend",a),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),s.removeEventListener("mousedown",n),s.removeEventListener("mouseup",r),s.removeEventListener("touchstart",o),s.removeEventListener("touchmove",i),s.removeEventListener("touchend",a)}},o.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,r=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==r},o.componentDidUpdate=function(e,t){this.isControlledProp("selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},o.componentWillUnmount=function(){this.cleanup()},o.render=function(){var e=te(this.props.children,G);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var t=te(e(this.getStateAndHelpers()));return t?this.getRootProps.called||this.props.suppressRefError?t:ne(t)?Object(u.cloneElement)(t,this.getRootProps(re(t))):void 0:null},r}(u.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:ee,itemToString:function(e){return null==e?"":String(e)},onStateChange:G,onInputValueChange:G,onUserAction:G,onChange:G,onSelect:G,onOuterClick:G,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:Y},e.stateChangeTypes=de,e}();p.a.array.isRequired,p.a.func,p.a.func,p.a.func,p.a.bool,p.a.number,p.a.number,p.a.number,p.a.bool,p.a.bool,p.a.bool,p.a.any,p.a.any,p.a.any,p.a.string,p.a.string,p.a.string,p.a.func,p.a.string,p.a.func,p.a.func,p.a.func,p.a.func,p.a.func,p.a.shape({addEventListener:p.a.func,removeEventListener:p.a.func,document:p.a.shape({getElementById:p.a.func,activeElement:p.a.any,body:p.a.any})});"undefined"==typeof window||window;var fe=pe;function he(){return(he=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function me(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function ge(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ye(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ye(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ye(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ve=function(e){var t=e.listId,n=e.apiKey,o=e.onChange,i=ge(Object(r.useState)([]),2),s=i[0],u=i[1],c=ge(Object(r.useState)(!1),2),d=c[0],p=c[1],f=ge(Object(r.useState)({controller:null}),2),h=f[0].controller,m=f[1],g=function(){var e,t=(e=regeneratorRuntime.mark((function e(){var t,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h&&h.abort(),p(!0),"AbortController"in window&&(h=new AbortController,m({controller:h})),(t=new FormData).append("api_key",n),t.append("action","blocksy_ext_mailchimp_maybe_get_lists"),e.prev=6,e.next=9,fetch(ctDashboardLocalizations.ajax_url,{method:"POST",signal:h.signal,body:t});case 9:if(200!==(r=e.sent).status){e.next=19;break}return e.next=13,r.json();case 13:if(!(o=e.sent).success){e.next=19;break}if("api_key_invalid"===o.data.result){e.next=19;break}return p(!1),u(o.data.result),e.abrupt("return");case 19:e.next=23;break;case 21:e.prev=21,e.t0=e.catch(6);case 23:u([]),p(!1);case 25:case"end":return e.stop()}}),e,null,[[6,21]])})),function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){me(i,r,o,a,s,"next",e)}function s(e){me(i,r,o,a,s,"throw",e)}a(void 0)}))});return function(){return t.apply(this,arguments)}}();return Object(r.useEffect)((function(){n&&-1!==n.indexOf("-")?g():u([])}),[n]),0===s.length?Object(r.createElement)("div",{className:"ct-select-input"},Object(r.createElement)("input",{disabled:!0,placeholder:d?Object(a.__)("Loading","blc"):Object(a.__)("Invalid API Key...","blc")})):Object(r.createElement)(fe,{selectedItem:t||"",onChange:function(e){return o(e)},itemToString:function(e){return e?(s.find((function(t){return t.id===e}))||{}).name:""}},(function(e){var t=e.getInputProps,n=e.getItemProps,o=(e.getLabelProps,e.getMenuProps),i=e.isOpen,u=(e.inputValue,e.highlightedIndex),c=e.selectedItem,d=e.openMenu;return Object(r.createElement)("div",{className:"ct-select-input"},Object(r.createElement)("input",he({},t({onFocus:function(){return d()},onClick:function(){return d()}}),{placeholder:Object(a.__)("Select list...","blc"),readOnly:!0})),i&&Object(r.createElement)("div",o({className:"ct-select-dropdown"}),s.map((function(e,t){return Object(r.createElement)("div",n({key:e.id,index:t,item:e.id,className:l()("ct-select-dropdown-item",{active:u===t,selected:c===e.id})}),e.name)}))))}))};function be(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function we(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Oe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Oe(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Se=function(e){var t=e.extension,n=e.isEditingCredentials,o=e.setIsEditingCredentials,i=e.onCredentialsValidated,s=we(Object(r.useState)(t.data.api_key),2),u=s[0],c=s[1],d=we(Object(r.useState)(t.data.list_id),2),p=d[0],f=d[1],h=we(Object(r.useState)(!1),2),m=h[0],g=h[1],y=we(Object(r.useState)(!1),2),v=y[0],b=y[1],w=function(){var e,t=(e=regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=new FormData).append("api_key",u),t.append("list_id",p),t.append("action","blocksy_ext_mailchimp_maybe_save_credentials"),g(!0),e.prev=5,e.next=8,fetch(ctDashboardLocalizations.ajax_url,{method:"POST",body:t});case 8:if(200!==(n=e.sent).status){e.next=14;break}return e.next=12,n.json();case 12:(r=e.sent).success&&"api_key_invalid"!==r.data.result&&(i(),b(!1));case 14:b(!0),e.next=20;break;case 17:e.prev=17,e.t0=e.catch(5),b(!0);case 20:return e.next=22,new Promise((function(e){return setTimeout((function(){return e()}),1e3)}));case 22:g(!1);case 23:case"end":return e.stop()}}),e,null,[[5,17]])})),function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){be(i,r,o,a,s,"next",e)}function s(e){be(i,r,o,a,s,"throw",e)}a(void 0)}))});return function(){return t.apply(this,arguments)}}();return Object(r.createElement)(R,{items:n,onDismiss:function(){return o(!1)},className:"ct-mailchimp-modal",render:function(){return Object(r.createElement)("div",{className:l()("ct-modal-content",{"ct-key-invalid":v})},Object(r.createElement)("h2",null,Object(a.__)("MailChimp Credentials","blc")),Object(r.createElement)("p",{dangerouslySetInnerHTML:{__html:Object(a.sprintf)(Object(a.__)("Enter your MailChimp credentials in the form below. More info on how to generate an API key can be found %shere%s.","blc"),'<a target="_blank" href="https://mailchimp.com/help/about-api-keys/">',"</a>")}}),Object(r.createElement)("div",{className:"mailchimp-credentials"},Object(r.createElement)("section",null,Object(r.createElement)("label",null,Object(a.__)("API Key","blc")),Object(r.createElement)("div",{className:"ct-option-input"},Object(r.createElement)("input",{type:"text",onChange:function(e){var t=e.target.value;return c(t)},value:u||""}))),Object(r.createElement)("section",null,Object(r.createElement)("label",null,Object(a.__)("List ID","blc")),Object(r.createElement)(ve,{listId:p,onChange:function(e){return f(e)},apiKey:u})),Object(r.createElement)("section",null,Object(r.createElement)("label",null," "),Object(r.createElement)("button",{className:"ct-button","data-button":"blue",disabled:!u||!p||m,onClick:function(){return w()}},m?Object(a.__)("Loading...","blc"):t.__object?Object(a.__)("Save Settings","blc"):Object(a.__)("Activate","blc")))))}})};function Ie(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function xe(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ie(i,r,o,a,s,"next",e)}function s(e){Ie(i,r,o,a,s,"throw",e)}a(void 0)}))}}function je(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ee(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ee(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ce=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=Object(r.useState)(!1),o=je(n,2),i=o[0],s=o[1],l=Object(r.useState)(!1),u=je(l,2),c=u[0],d=u[1],p=function(){var n=xe(regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return(r=new FormData).append("ext",e.name),r.append("action",e.__object?"blocksy_extension_deactivate":"blocksy_extension_activate"),s(!0),n.prev=4,n.next=7,fetch(ctDashboardLocalizations.ajax_url,{method:"POST",body:r});case 7:t(),n.next=12;break;case 10:n.prev=10,n.t0=n.catch(4);case 12:s(!1);case 13:case"end":return n.stop()}}),n,null,[[4,10]])})));return function(){return n.apply(this,arguments)}}(),f=function(){e.__object||e.data.api_key?p():d(!0)};return[i,f,Object(r.createElement)(r.Fragment,null,e.__object&&e.data.api_key&&Object(r.createElement)("button",{className:"ct-button ct-config-btn","data-button":"white",title:"Edit Credentials",onClick:function(){return d(!0)}},Object(a.__)("Configure","blc")),Object(r.createElement)(Se,{isEditingCredentials:c,setIsEditingCredentials:d,extension:e,onCredentialsValidated:function(){e.__object||p(),d(!1)}}))]};function ke(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ae(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ae(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Pe=function(e){var t=e.extension,n=e.onExtsSync,o=ke(Ce(t,(function(){n()})),3),i=o[0],s=o[1],u=o[2],c=ke(F(t),2),d=c[0],p=c[1];return Object(r.createElement)("li",{className:l()({active:!!t.__object})},Object(r.createElement)("h4",{className:"ct-extension-title"},t.config.name,i&&Object(r.createElement)("svg",{width:"15",height:"15",viewBox:"0 0 100 100"},Object(r.createElement)("g",{transform:"translate(50,50)"},Object(r.createElement)("g",{transform:"scale(1)"},Object(r.createElement)("circle",{cx:"0",cy:"0",r:"50",fill:"#687c93"}),Object(r.createElement)("circle",{cx:"0",cy:"-26",r:"12",fill:"#ffffff",transform:"rotate(161.634)"},Object(r.createElement)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"linear",values:"0 0 0;360 0 0",keyTimes:"0;1",dur:"1s",begin:"0s",repeatCount:"indefinite"})))))),t.config.description&&Object(r.createElement)("div",{className:"ct-extension-description"},t.config.description),Object(r.createElement)("div",{className:"ct-extension-actions"},Object(r.createElement)("button",{className:l()(t.__object?"ct-button":"ct-button-primary"),"data-button":"white",disabled:i,onClick:function(){return s()}},t.__object?Object(a.__)("Deactivate","blc"):Object(a.__)("Activate","blc")),u,t.readme&&Object(r.createElement)("button",{onClick:function(){return d()},"data-button":"white",className:"ct-minimal-button ct-instruction"},Object(r.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 24 24"},Object(r.createElement)("path",{d:"M12,2C6.477,2,2,6.477,2,12s4.477,10,10,10s10-4.477,10-10S17.523,2,12,2z M12,17L12,17c-0.552,0-1-0.448-1-1v-4 c0-0.552,0.448-1,1-1h0c0.552,0,1,0.448,1,1v4C13,16.552,12.552,17,12,17z M12.5,9h-1C11.224,9,11,8.776,11,8.5v-1 C11,7.224,11.224,7,11.5,7h1C12.776,7,13,7.224,13,7.5v1C13,8.776,12.776,9,12.5,9z"})))),p)};i.a.on("ct:extensions:card",(function(e){var t=e.CustomComponent;"mailchimp"===e.extension.name&&(t.extension=Pe)}))}]);
|
framework/extensions/mailchimp/dashboard-static/js/EditCredentials.js
CHANGED
|
@@ -3,20 +3,19 @@ import {
|
|
| 3 |
Component,
|
| 4 |
useEffect,
|
| 5 |
useState,
|
| 6 |
-
Fragment
|
| 7 |
} from '@wordpress/element'
|
| 8 |
|
| 9 |
-
import { Transition } from 'react-spring/renderprops'
|
| 10 |
-
import { Dialog, DialogOverlay, DialogContent } from '@reach/dialog'
|
| 11 |
import classnames from 'classnames'
|
| 12 |
import { __, sprintf } from 'ct-i18n'
|
| 13 |
import ListPicker from './ListPicker'
|
|
|
|
| 14 |
|
| 15 |
const EditCredentials = ({
|
| 16 |
extension,
|
| 17 |
isEditingCredentials,
|
| 18 |
setIsEditingCredentials,
|
| 19 |
-
onCredentialsValidated
|
| 20 |
}) => {
|
| 21 |
const [apiKey, setApiKey] = useState(extension.data.api_key)
|
| 22 |
const [listId, setListId] = useState(extension.data.list_id)
|
|
@@ -36,7 +35,7 @@ const EditCredentials = ({
|
|
| 36 |
try {
|
| 37 |
const response = await fetch(ctDashboardLocalizations.ajax_url, {
|
| 38 |
method: 'POST',
|
| 39 |
-
body
|
| 40 |
})
|
| 41 |
|
| 42 |
if (response.status === 200) {
|
|
@@ -55,102 +54,83 @@ const EditCredentials = ({
|
|
| 55 |
makeKeyInvalid(true)
|
| 56 |
}
|
| 57 |
|
| 58 |
-
await new Promise(r => setTimeout(() => r(), 1000))
|
| 59 |
|
| 60 |
setIsLoading(false)
|
| 61 |
}
|
| 62 |
|
| 63 |
return (
|
| 64 |
-
<
|
| 65 |
items={isEditingCredentials}
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
}
|
| 92 |
-
|
| 93 |
-
<h1>{__('MailChimp Credentials')}</h1>
|
| 94 |
-
<p
|
| 95 |
-
dangerouslySetInnerHTML={{
|
| 96 |
-
__html: sprintf(
|
| 97 |
-
__(
|
| 98 |
-
'Enter your MailChimp credentials in the form below. More info on how to generate an API key can be found %s.'
|
| 99 |
-
),
|
| 100 |
-
|
| 101 |
-
sprintf(
|
| 102 |
-
'<a target="_blank" href="https://mailchimp.com/help/about-api-keys/">%s</a>',
|
| 103 |
-
__('here')
|
| 104 |
-
)
|
| 105 |
-
)
|
| 106 |
-
}}
|
| 107 |
/>
|
| 108 |
-
|
| 109 |
-
<ul className="mailchimp-credentials">
|
| 110 |
-
<li>
|
| 111 |
-
<label>{__('API Key')}</label>
|
| 112 |
-
|
| 113 |
-
<input
|
| 114 |
-
type="text"
|
| 115 |
-
onChange={({ target: { value } }) =>
|
| 116 |
-
setApiKey(value)
|
| 117 |
-
}
|
| 118 |
-
value={apiKey || ''}
|
| 119 |
-
/>
|
| 120 |
-
</li>
|
| 121 |
-
|
| 122 |
-
<li>
|
| 123 |
-
<label>{__('List ID')}</label>
|
| 124 |
-
|
| 125 |
-
<ListPicker
|
| 126 |
-
listId={listId}
|
| 127 |
-
onChange={id => setListId(id)}
|
| 128 |
-
apiKey={apiKey}
|
| 129 |
-
/>
|
| 130 |
-
</li>
|
| 131 |
-
|
| 132 |
-
<li>
|
| 133 |
-
<button
|
| 134 |
-
className="ct-button"
|
| 135 |
-
data-button="blue"
|
| 136 |
-
disabled={
|
| 137 |
-
!apiKey || !listId || isLoading
|
| 138 |
-
}
|
| 139 |
-
onClick={() =>
|
| 140 |
-
attemptToSaveCredentials()
|
| 141 |
-
}>
|
| 142 |
-
{isLoading
|
| 143 |
-
? __('Loading...')
|
| 144 |
-
: __('Activate')}
|
| 145 |
-
</button>
|
| 146 |
-
</li>
|
| 147 |
-
</ul>
|
| 148 |
</div>
|
| 149 |
-
</
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 154 |
)
|
| 155 |
}
|
| 156 |
|
| 3 |
Component,
|
| 4 |
useEffect,
|
| 5 |
useState,
|
| 6 |
+
Fragment,
|
| 7 |
} from '@wordpress/element'
|
| 8 |
|
|
|
|
|
|
|
| 9 |
import classnames from 'classnames'
|
| 10 |
import { __, sprintf } from 'ct-i18n'
|
| 11 |
import ListPicker from './ListPicker'
|
| 12 |
+
import Overlay from '../../../../../static/js/helpers/Overlay'
|
| 13 |
|
| 14 |
const EditCredentials = ({
|
| 15 |
extension,
|
| 16 |
isEditingCredentials,
|
| 17 |
setIsEditingCredentials,
|
| 18 |
+
onCredentialsValidated,
|
| 19 |
}) => {
|
| 20 |
const [apiKey, setApiKey] = useState(extension.data.api_key)
|
| 21 |
const [listId, setListId] = useState(extension.data.list_id)
|
| 35 |
try {
|
| 36 |
const response = await fetch(ctDashboardLocalizations.ajax_url, {
|
| 37 |
method: 'POST',
|
| 38 |
+
body,
|
| 39 |
})
|
| 40 |
|
| 41 |
if (response.status === 200) {
|
| 54 |
makeKeyInvalid(true)
|
| 55 |
}
|
| 56 |
|
| 57 |
+
await new Promise((r) => setTimeout(() => r(), 1000))
|
| 58 |
|
| 59 |
setIsLoading(false)
|
| 60 |
}
|
| 61 |
|
| 62 |
return (
|
| 63 |
+
<Overlay
|
| 64 |
items={isEditingCredentials}
|
| 65 |
+
onDismiss={() => setIsEditingCredentials(false)}
|
| 66 |
+
className={'ct-mailchimp-modal'}
|
| 67 |
+
render={() => (
|
| 68 |
+
<div
|
| 69 |
+
className={classnames(
|
| 70 |
+
'ct-modal-content',
|
| 71 |
+
{
|
| 72 |
+
'ct-key-invalid': isApiKeyInvalid,
|
| 73 |
+
}
|
| 74 |
+
)}>
|
| 75 |
+
|
| 76 |
+
<h2>{__('MailChimp Credentials', 'blc')}</h2>
|
| 77 |
+
|
| 78 |
+
<p
|
| 79 |
+
dangerouslySetInnerHTML={{
|
| 80 |
+
__html: sprintf(
|
| 81 |
+
__(
|
| 82 |
+
'Enter your MailChimp credentials in the form below. More info on how to generate an API key can be found %shere%s.',
|
| 83 |
+
'blc'
|
| 84 |
+
),
|
| 85 |
+
'<a target="_blank" href="https://mailchimp.com/help/about-api-keys/">',
|
| 86 |
+
'</a>'
|
| 87 |
+
),
|
| 88 |
+
}}
|
| 89 |
+
/>
|
| 90 |
+
|
| 91 |
+
<div className="mailchimp-credentials">
|
| 92 |
+
<section>
|
| 93 |
+
<label>{__('API Key', 'blc')}</label>
|
| 94 |
+
|
| 95 |
+
<div className="ct-option-input">
|
| 96 |
+
<input
|
| 97 |
+
type="text"
|
| 98 |
+
onChange={({ target: { value } }) =>
|
| 99 |
+
setApiKey(value)
|
| 100 |
}
|
| 101 |
+
value={apiKey || ''}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
</div>
|
| 104 |
+
</section>
|
| 105 |
+
|
| 106 |
+
<section>
|
| 107 |
+
<label>{__('List ID', 'blc')}</label>
|
| 108 |
+
|
| 109 |
+
<ListPicker
|
| 110 |
+
listId={listId}
|
| 111 |
+
onChange={(id) => setListId(id)}
|
| 112 |
+
apiKey={apiKey}
|
| 113 |
+
/>
|
| 114 |
+
</section>
|
| 115 |
+
|
| 116 |
+
<section>
|
| 117 |
+
<label> </label>
|
| 118 |
+
<button
|
| 119 |
+
className="ct-button"
|
| 120 |
+
data-button="blue"
|
| 121 |
+
disabled={!apiKey || !listId || isLoading}
|
| 122 |
+
onClick={() => attemptToSaveCredentials()}>
|
| 123 |
+
{isLoading
|
| 124 |
+
? __('Loading...', 'blc')
|
| 125 |
+
: !extension.__object
|
| 126 |
+
? __('Activate', 'blc')
|
| 127 |
+
: __('Save Settings', 'blc')}
|
| 128 |
+
</button>
|
| 129 |
+
</section>
|
| 130 |
+
</div>
|
| 131 |
+
</div>
|
| 132 |
+
)}
|
| 133 |
+
/>
|
| 134 |
)
|
| 135 |
}
|
| 136 |
|
framework/extensions/mailchimp/dashboard-static/js/ListPicker.js
CHANGED
|
@@ -61,29 +61,28 @@ const ListPicker = ({ listId, apiKey, onChange }) => {
|
|
| 61 |
setListsLoading(false)
|
| 62 |
}
|
| 63 |
|
| 64 |
-
useEffect(
|
| 65 |
-
()
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
}
|
| 70 |
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
[apiKey]
|
| 79 |
-
)
|
| 80 |
|
| 81 |
return lists.length === 0 ? (
|
| 82 |
<div className="ct-select-input">
|
| 83 |
<input
|
| 84 |
disabled
|
| 85 |
placeholder={
|
| 86 |
-
isLoadingLists
|
|
|
|
|
|
|
| 87 |
}
|
| 88 |
/>
|
| 89 |
</div>
|
|
@@ -111,7 +110,7 @@ const ListPicker = ({ listId, apiKey, onChange }) => {
|
|
| 111 |
onFocus: () => openMenu(),
|
| 112 |
onClick: () => openMenu()
|
| 113 |
})}
|
| 114 |
-
placeholder={__('Select list...')}
|
| 115 |
readOnly
|
| 116 |
/>
|
| 117 |
|
| 61 |
setListsLoading(false)
|
| 62 |
}
|
| 63 |
|
| 64 |
+
useEffect(() => {
|
| 65 |
+
if (!apiKey) {
|
| 66 |
+
setLists([])
|
| 67 |
+
return
|
| 68 |
+
}
|
|
|
|
| 69 |
|
| 70 |
+
if (apiKey.indexOf('-') === -1) {
|
| 71 |
+
setLists([])
|
| 72 |
+
return
|
| 73 |
+
}
|
| 74 |
|
| 75 |
+
maybeFetchLists()
|
| 76 |
+
}, [apiKey])
|
|
|
|
|
|
|
| 77 |
|
| 78 |
return lists.length === 0 ? (
|
| 79 |
<div className="ct-select-input">
|
| 80 |
<input
|
| 81 |
disabled
|
| 82 |
placeholder={
|
| 83 |
+
isLoadingLists
|
| 84 |
+
? __('Loading', 'blc')
|
| 85 |
+
: __('Invalid API Key...', 'blc')
|
| 86 |
}
|
| 87 |
/>
|
| 88 |
</div>
|
| 110 |
onFocus: () => openMenu(),
|
| 111 |
onClick: () => openMenu()
|
| 112 |
})}
|
| 113 |
+
placeholder={__('Select list...', 'blc')}
|
| 114 |
readOnly
|
| 115 |
/>
|
| 116 |
|
framework/extensions/mailchimp/dashboard-static/js/Mailchimp.js
CHANGED
|
@@ -24,7 +24,36 @@ const Mailchimp = ({ extension, onExtsSync }) => {
|
|
| 24 |
|
| 25 |
return (
|
| 26 |
<li className={classnames({ active: !!extension.__object })}>
|
| 27 |
-
<h4 className="ct-extension-title">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
{extension.config.description && (
|
| 30 |
<div className="ct-extension-description">
|
|
@@ -34,15 +63,15 @@ const Mailchimp = ({ extension, onExtsSync }) => {
|
|
| 34 |
|
| 35 |
<div className="ct-extension-actions">
|
| 36 |
<button
|
| 37 |
-
className=
|
|
|
|
|
|
|
| 38 |
data-button="white"
|
| 39 |
disabled={isLoading}
|
| 40 |
onClick={() => activationAction()}>
|
| 41 |
-
{
|
| 42 |
-
? __('
|
| 43 |
-
:
|
| 44 |
-
? __('Deactivate')
|
| 45 |
-
: __('Activate')}
|
| 46 |
</button>
|
| 47 |
|
| 48 |
{ui}
|
| 24 |
|
| 25 |
return (
|
| 26 |
<li className={classnames({ active: !!extension.__object })}>
|
| 27 |
+
<h4 className="ct-extension-title">
|
| 28 |
+
{extension.config.name}
|
| 29 |
+
|
| 30 |
+
{isLoading && (
|
| 31 |
+
<svg width="15" height="15" viewBox="0 0 100 100">
|
| 32 |
+
<g transform="translate(50,50)">
|
| 33 |
+
<g transform="scale(1)">
|
| 34 |
+
<circle cx="0" cy="0" r="50" fill="#687c93" />
|
| 35 |
+
<circle
|
| 36 |
+
cx="0"
|
| 37 |
+
cy="-26"
|
| 38 |
+
r="12"
|
| 39 |
+
fill="#ffffff"
|
| 40 |
+
transform="rotate(161.634)">
|
| 41 |
+
<animateTransform
|
| 42 |
+
attributeName="transform"
|
| 43 |
+
type="rotate"
|
| 44 |
+
calcMode="linear"
|
| 45 |
+
values="0 0 0;360 0 0"
|
| 46 |
+
keyTimes="0;1"
|
| 47 |
+
dur="1s"
|
| 48 |
+
begin="0s"
|
| 49 |
+
repeatCount="indefinite"
|
| 50 |
+
/>
|
| 51 |
+
</circle>
|
| 52 |
+
</g>
|
| 53 |
+
</g>
|
| 54 |
+
</svg>
|
| 55 |
+
)}
|
| 56 |
+
</h4>
|
| 57 |
|
| 58 |
{extension.config.description && (
|
| 59 |
<div className="ct-extension-description">
|
| 63 |
|
| 64 |
<div className="ct-extension-actions">
|
| 65 |
<button
|
| 66 |
+
className={classnames(
|
| 67 |
+
extension.__object ? 'ct-button' : 'ct-button-primary'
|
| 68 |
+
)}
|
| 69 |
data-button="white"
|
| 70 |
disabled={isLoading}
|
| 71 |
onClick={() => activationAction()}>
|
| 72 |
+
{extension.__object
|
| 73 |
+
? __('Deactivate', 'blc')
|
| 74 |
+
: __('Activate', 'blc')}
|
|
|
|
|
|
|
| 75 |
</button>
|
| 76 |
|
| 77 |
{ui}
|
framework/extensions/mailchimp/dashboard-static/js/hooks/useActivationWithRequirements.js
CHANGED
|
@@ -7,8 +7,8 @@ import {
|
|
| 7 |
} from '@wordpress/element'
|
| 8 |
|
| 9 |
import { Transition } from 'react-spring/renderprops'
|
| 10 |
-
import { Dialog, DialogOverlay, DialogContent } from '@reach/dialog'
|
| 11 |
import EditCredentials from '../EditCredentials'
|
|
|
|
| 12 |
|
| 13 |
const useActivationWithRequirements = (extension, cb = () => {}) => {
|
| 14 |
const [isLoading, setIsLoading] = useState(false)
|
|
@@ -36,8 +36,6 @@ const useActivationWithRequirements = (extension, cb = () => {}) => {
|
|
| 36 |
cb()
|
| 37 |
} catch (e) {}
|
| 38 |
|
| 39 |
-
await new Promise(r => setTimeout(() => r(), 1000))
|
| 40 |
-
|
| 41 |
setIsLoading(false)
|
| 42 |
}
|
| 43 |
|
|
@@ -54,14 +52,15 @@ const useActivationWithRequirements = (extension, cb = () => {}) => {
|
|
| 54 |
isLoading,
|
| 55 |
handleActionWithRequirements,
|
| 56 |
<Fragment>
|
| 57 |
-
{extension.__object &&
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
|
|
|
| 65 |
|
| 66 |
<EditCredentials
|
| 67 |
isEditingCredentials={isEditingCredentials}
|
| 7 |
} from '@wordpress/element'
|
| 8 |
|
| 9 |
import { Transition } from 'react-spring/renderprops'
|
|
|
|
| 10 |
import EditCredentials from '../EditCredentials'
|
| 11 |
+
import { __, sprintf } from 'ct-i18n'
|
| 12 |
|
| 13 |
const useActivationWithRequirements = (extension, cb = () => {}) => {
|
| 14 |
const [isLoading, setIsLoading] = useState(false)
|
| 36 |
cb()
|
| 37 |
} catch (e) {}
|
| 38 |
|
|
|
|
|
|
|
| 39 |
setIsLoading(false)
|
| 40 |
}
|
| 41 |
|
| 52 |
isLoading,
|
| 53 |
handleActionWithRequirements,
|
| 54 |
<Fragment>
|
| 55 |
+
{extension.__object && extension.data.api_key && (
|
| 56 |
+
<button
|
| 57 |
+
className="ct-button ct-config-btn"
|
| 58 |
+
data-button="white"
|
| 59 |
+
title="Edit Credentials"
|
| 60 |
+
onClick={() => setIsEditingCredentials(true)}>
|
| 61 |
+
{__('Configure', 'blc')}
|
| 62 |
+
</button>
|
| 63 |
+
)}
|
| 64 |
|
| 65 |
<EditCredentials
|
| 66 |
isEditingCredentials={isEditingCredentials}
|
framework/extensions/mailchimp/dashboard-static/js/main.js
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
| 5 |
useState,
|
| 6 |
Fragment
|
| 7 |
} from '@wordpress/element'
|
|
|
|
| 8 |
|
| 9 |
import Mailchimp from './Mailchimp'
|
| 10 |
|
| 5 |
useState,
|
| 6 |
Fragment
|
| 7 |
} from '@wordpress/element'
|
| 8 |
+
import ctEvents from 'ct-events'
|
| 9 |
|
| 10 |
import Mailchimp from './Mailchimp'
|
| 11 |
|
framework/extensions/mailchimp/extension.php
CHANGED
|
@@ -5,20 +5,11 @@ require_once dirname( __FILE__ ) . '/mailchimp-manager.php';
|
|
| 5 |
|
| 6 |
class BlocksyExtensionMailchimp {
|
| 7 |
public function __construct() {
|
| 8 |
-
add_action('blocksy:global-dynamic-css:enqueue', function (
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
dirname( __FILE__ ) . '/global.php',
|
| 14 |
-
[],
|
| 15 |
-
[
|
| 16 |
-
'css' => $css,
|
| 17 |
-
'tablet_css' => $tablet_css,
|
| 18 |
-
'mobile_css' => $mobile_css
|
| 19 |
-
]
|
| 20 |
-
);
|
| 21 |
-
|
| 22 |
}, 10, 3);
|
| 23 |
|
| 24 |
add_filter('blocksy-options-scripts-dependencies', function ($d) {
|
|
@@ -38,7 +29,31 @@ class BlocksyExtensionMailchimp {
|
|
| 38 |
BLOCKSY_URL . 'framework/extensions/mailchimp/admin-static/bundle/main.js',
|
| 39 |
[],
|
| 40 |
$data['Version'],
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
);
|
| 43 |
|
| 44 |
wp_localize_script(
|
|
@@ -64,9 +79,17 @@ class BlocksyExtensionMailchimp {
|
|
| 64 |
wp_enqueue_style(
|
| 65 |
'blocksy-ext-mailchimp-styles',
|
| 66 |
BLOCKSY_URL . 'framework/extensions/mailchimp/static/bundle/main.css',
|
| 67 |
-
[],
|
| 68 |
$data['Version']
|
| 69 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
});
|
| 71 |
|
| 72 |
add_filter('blocksy_widgets_paths', function ($all_widgets) {
|
|
@@ -77,7 +100,8 @@ class BlocksyExtensionMailchimp {
|
|
| 77 |
add_filter(
|
| 78 |
'blocksy_single_posts_end_customizer_options',
|
| 79 |
function ($opts) {
|
| 80 |
-
$opts['mailchimp_single_post_enabled'] =
|
|
|
|
| 81 |
dirname( __FILE__ ) . '/customizer.php',
|
| 82 |
[], false
|
| 83 |
);
|
|
@@ -86,10 +110,20 @@ class BlocksyExtensionMailchimp {
|
|
| 86 |
}
|
| 87 |
);
|
| 88 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
add_action(
|
| 90 |
-
'
|
| 91 |
function () {
|
| 92 |
-
if (! function_exists('get_plugin_data')){
|
| 93 |
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
| 94 |
}
|
| 95 |
|
|
@@ -98,7 +132,7 @@ class BlocksyExtensionMailchimp {
|
|
| 98 |
wp_enqueue_script(
|
| 99 |
'blocksy-mailchimp-customizer-sync',
|
| 100 |
BLOCKSY_URL . 'framework/extensions/mailchimp/admin-static/bundle/sync.js',
|
| 101 |
-
[ 'customize-preview' ],
|
| 102 |
$data['Version'],
|
| 103 |
true
|
| 104 |
);
|
| 5 |
|
| 6 |
class BlocksyExtensionMailchimp {
|
| 7 |
public function __construct() {
|
| 8 |
+
add_action('blocksy:global-dynamic-css:enqueue', function ($args) {
|
| 9 |
+
blocksy_theme_get_dynamic_styles(array_merge([
|
| 10 |
+
'path' => dirname( __FILE__ ) . '/global.php',
|
| 11 |
+
'chunk' => 'global'
|
| 12 |
+
], $args));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
}, 10, 3);
|
| 14 |
|
| 15 |
add_filter('blocksy-options-scripts-dependencies', function ($d) {
|
| 29 |
BLOCKSY_URL . 'framework/extensions/mailchimp/admin-static/bundle/main.js',
|
| 30 |
[],
|
| 31 |
$data['Version'],
|
| 32 |
+
true
|
| 33 |
+
);
|
| 34 |
+
|
| 35 |
+
wp_localize_script(
|
| 36 |
+
'blocksy-ext-mailchimp-admin-scripts',
|
| 37 |
+
'blocksy_ext_mailchimp_localization',
|
| 38 |
+
[
|
| 39 |
+
'public_url' => BLOCKSY_URL . 'framework/extensions/mailchimp/admin-static/bundle/',
|
| 40 |
+
]
|
| 41 |
+
);
|
| 42 |
+
});
|
| 43 |
+
|
| 44 |
+
add_action('customize_controls_enqueue_scripts', function () {
|
| 45 |
+
if (! function_exists('get_plugin_data')) {
|
| 46 |
+
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
$data = get_plugin_data(BLOCKSY__FILE__);
|
| 50 |
+
|
| 51 |
+
wp_register_script(
|
| 52 |
+
'blocksy-ext-mailchimp-admin-scripts',
|
| 53 |
+
BLOCKSY_URL . 'framework/extensions/mailchimp/admin-static/bundle/main.js',
|
| 54 |
+
[],
|
| 55 |
+
$data['Version'],
|
| 56 |
+
true
|
| 57 |
);
|
| 58 |
|
| 59 |
wp_localize_script(
|
| 79 |
wp_enqueue_style(
|
| 80 |
'blocksy-ext-mailchimp-styles',
|
| 81 |
BLOCKSY_URL . 'framework/extensions/mailchimp/static/bundle/main.css',
|
| 82 |
+
['ct-main-styles'],
|
| 83 |
$data['Version']
|
| 84 |
);
|
| 85 |
+
|
| 86 |
+
wp_enqueue_script(
|
| 87 |
+
'blocksy-ext-mailchimp-scripts',
|
| 88 |
+
BLOCKSY_URL . 'framework/extensions/mailchimp/static/bundle/main.js',
|
| 89 |
+
[],
|
| 90 |
+
$data['Version'],
|
| 91 |
+
true
|
| 92 |
+
);
|
| 93 |
});
|
| 94 |
|
| 95 |
add_filter('blocksy_widgets_paths', function ($all_widgets) {
|
| 100 |
add_filter(
|
| 101 |
'blocksy_single_posts_end_customizer_options',
|
| 102 |
function ($opts) {
|
| 103 |
+
$opts['mailchimp_single_post_enabled'] = blc_call_fn(
|
| 104 |
+
['fn' => 'blocksy_get_options'],
|
| 105 |
dirname( __FILE__ ) . '/customizer.php',
|
| 106 |
[], false
|
| 107 |
);
|
| 110 |
}
|
| 111 |
);
|
| 112 |
|
| 113 |
+
add_filter('blocksy_extensions_metabox_post:elements:before', function ($opts) {
|
| 114 |
+
$opts['disable_subscribe_form'] = [
|
| 115 |
+
'label' => __( 'Disable Subscribe Form', 'blc' ),
|
| 116 |
+
'type' => 'ct-switch',
|
| 117 |
+
'value' => 'no',
|
| 118 |
+
];
|
| 119 |
+
|
| 120 |
+
return $opts;
|
| 121 |
+
}, 5);
|
| 122 |
+
|
| 123 |
add_action(
|
| 124 |
+
'customize_controls_enqueue_scripts',
|
| 125 |
function () {
|
| 126 |
+
if (! function_exists('get_plugin_data')) {
|
| 127 |
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
| 128 |
}
|
| 129 |
|
| 132 |
wp_enqueue_script(
|
| 133 |
'blocksy-mailchimp-customizer-sync',
|
| 134 |
BLOCKSY_URL . 'framework/extensions/mailchimp/admin-static/bundle/sync.js',
|
| 135 |
+
[ 'customize-preview', 'ct-events' ],
|
| 136 |
$data['Version'],
|
| 137 |
true
|
| 138 |
);
|
framework/extensions/mailchimp/global.php
CHANGED
|
@@ -1,60 +1,98 @@
|
|
| 1 |
<?php
|
| 2 |
|
| 3 |
// Mailchimp
|
| 4 |
-
|
| 5 |
-
'mailchimpContent',
|
| 6 |
-
|
| 7 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
| 13 |
|
| 14 |
-
|
| 15 |
-
'mailchimpButton',
|
| 16 |
-
[
|
| 17 |
'default' => [ 'color' => 'var(--paletteColor1)' ],
|
| 18 |
'hover' => [ 'color' => 'var(--paletteColor2)' ],
|
| 19 |
-
]
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
$css->put(
|
| 28 |
-
'.ct-mailchimp-block',
|
| 29 |
-
"--buttonHoverColor: {$mailchimpButton['hover']}"
|
| 30 |
-
);
|
| 31 |
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
| 36 |
|
| 37 |
-
|
| 38 |
-
'
|
| 39 |
-
|
| 40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
-
|
| 43 |
-
'mailchimpShadow',
|
| 44 |
-
[
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
-
|
| 48 |
-
'
|
| 49 |
-
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
-
|
| 53 |
'css' => $css,
|
| 54 |
'tablet_css' => $tablet_css,
|
| 55 |
'mobile_css' => $mobile_css,
|
| 56 |
-
'selector' => '
|
| 57 |
-
'variableName' => '
|
| 58 |
'value' => get_theme_mod('mailchimpSpacing', [
|
| 59 |
'mobile' => '40px',
|
| 60 |
'tablet' => '40px',
|
| 1 |
<?php
|
| 2 |
|
| 3 |
// Mailchimp
|
| 4 |
+
blc_call_fn(['fn' => 'blocksy_output_colors'], [
|
| 5 |
+
'value' => get_theme_mod('mailchimpContent'),
|
| 6 |
+
'default' => [
|
| 7 |
+
'default' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
|
| 8 |
+
'hover' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
|
| 9 |
+
],
|
| 10 |
+
'css' => $css,
|
| 11 |
+
'variables' => [
|
| 12 |
+
'default' => [
|
| 13 |
+
'selector' => '.ct-mailchimp-block',
|
| 14 |
+
'variable' => 'color'
|
| 15 |
+
],
|
| 16 |
|
| 17 |
+
'hover' => [
|
| 18 |
+
'selector' => '.ct-mailchimp-block',
|
| 19 |
+
'variable' => 'linkHoverColor'
|
| 20 |
+
],
|
| 21 |
+
],
|
| 22 |
+
]);
|
| 23 |
|
| 24 |
+
blc_call_fn(['fn' => 'blocksy_output_colors'], [
|
| 25 |
+
'value' => get_theme_mod('mailchimpButton'),
|
| 26 |
+
'default' => [
|
| 27 |
'default' => [ 'color' => 'var(--paletteColor1)' ],
|
| 28 |
'hover' => [ 'color' => 'var(--paletteColor2)' ],
|
| 29 |
+
],
|
| 30 |
+
'css' => $css,
|
| 31 |
+
'variables' => [
|
| 32 |
+
'default' => [
|
| 33 |
+
'selector' => '.ct-mailchimp-block',
|
| 34 |
+
'variable' => 'buttonInitialColor'
|
| 35 |
+
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
+
'hover' => [
|
| 38 |
+
'selector' => '.ct-mailchimp-block',
|
| 39 |
+
'variable' => 'buttonHoverColor'
|
| 40 |
+
]
|
| 41 |
+
],
|
| 42 |
+
]);
|
| 43 |
|
| 44 |
+
blc_call_fn(['fn' => 'blocksy_output_colors'], [
|
| 45 |
+
'value' => get_theme_mod('mailchimpBackground'),
|
| 46 |
+
'default' => ['default' => [ 'color' => '#ffffff' ]],
|
| 47 |
+
'css' => $css,
|
| 48 |
+
'variables' => [
|
| 49 |
+
'default' => [
|
| 50 |
+
'selector' => '.ct-mailchimp-block',
|
| 51 |
+
'variable' => 'backgroundColor'
|
| 52 |
+
],
|
| 53 |
+
],
|
| 54 |
+
]);
|
| 55 |
|
| 56 |
+
blc_call_fn(['fn' => 'blocksy_output_colors'], [
|
| 57 |
+
'value' => get_theme_mod('mailchimpShadow'),
|
| 58 |
+
'default' => ['default' => [ 'color' => 'rgba(210, 213, 218, 0.4)' ]],
|
| 59 |
+
'css' => $css,
|
| 60 |
+
'variables' => [
|
| 61 |
+
'default' => [
|
| 62 |
+
'selector' => '.ct-mailchimp-block',
|
| 63 |
+
'variable' => 'mailchimpShadow'
|
| 64 |
+
],
|
| 65 |
+
],
|
| 66 |
+
]);
|
| 67 |
|
| 68 |
+
blc_call_fn(['fn' => 'blocksy_output_box_shadow'], [
|
| 69 |
+
'css' => $css,
|
| 70 |
+
'tablet_css' => $tablet_css,
|
| 71 |
+
'mobile_css' => $mobile_css,
|
| 72 |
+
'selector' => '.ct-mailchimp-block',
|
| 73 |
+
'value' => get_theme_mod(
|
| 74 |
+
'mailchimpShadow',
|
| 75 |
+
blc_call_fn(['fn' => 'blocksy_box_shadow_value'], [
|
| 76 |
+
'enable' => true,
|
| 77 |
+
'h_offset' => 0,
|
| 78 |
+
'v_offset' => 50,
|
| 79 |
+
'blur' => 90,
|
| 80 |
+
'spread' => 0,
|
| 81 |
+
'inset' => false,
|
| 82 |
+
'color' => [
|
| 83 |
+
'color' => 'rgba(210, 213, 218, 0.4)',
|
| 84 |
+
],
|
| 85 |
+
])
|
| 86 |
+
),
|
| 87 |
+
'responsive' => true
|
| 88 |
+
]);
|
| 89 |
|
| 90 |
+
blc_call_fn(['fn' => 'blocksy_output_responsive'], [
|
| 91 |
'css' => $css,
|
| 92 |
'tablet_css' => $tablet_css,
|
| 93 |
'mobile_css' => $mobile_css,
|
| 94 |
+
'selector' => '.ct-mailchimp-block',
|
| 95 |
+
'variableName' => 'padding',
|
| 96 |
'value' => get_theme_mod('mailchimpSpacing', [
|
| 97 |
'mobile' => '40px',
|
| 98 |
'tablet' => '40px',
|
framework/extensions/mailchimp/helpers.php
CHANGED
|
@@ -23,6 +23,19 @@ function blc_ext_mailchimp_subscribe_form($forced = false) {
|
|
| 23 |
}
|
| 24 |
}
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
$title = get_theme_mod('mailchimp_title', __(
|
| 27 |
'Newsletter Updates', 'blc'
|
| 28 |
));
|
|
@@ -38,6 +51,9 @@ function blc_ext_mailchimp_subscribe_form($forced = false) {
|
|
| 38 |
|
| 39 |
$has_name = get_theme_mod( 'has_mailchimp_name', 'no' ) === 'yes';
|
| 40 |
|
|
|
|
|
|
|
|
|
|
| 41 |
if ($forced) {
|
| 42 |
$has_name = true;
|
| 43 |
}
|
|
@@ -50,15 +66,25 @@ function blc_ext_mailchimp_subscribe_form($forced = false) {
|
|
| 50 |
|
| 51 |
$manager = new BlocksyMailchimpManager();
|
| 52 |
|
| 53 |
-
$
|
| 54 |
|
| 55 |
-
if (! $
|
| 56 |
return '';
|
| 57 |
}
|
| 58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
$class = 'ct-mailchimp-block';
|
| 60 |
|
| 61 |
-
$class .= ' ' .
|
|
|
|
| 62 |
get_theme_mod('mailchimp_subscribe_visibility', [
|
| 63 |
'desktop' => true,
|
| 64 |
'tablet' => true,
|
|
@@ -66,33 +92,41 @@ function blc_ext_mailchimp_subscribe_form($forced = false) {
|
|
| 66 |
])
|
| 67 |
);
|
| 68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
ob_start();
|
| 70 |
|
| 71 |
?>
|
| 72 |
|
| 73 |
-
<div class="<?php
|
| 74 |
-
<
|
| 75 |
-
<?php echo esc_html($title) ?>
|
| 76 |
-
</h4>
|
| 77 |
|
| 78 |
<p class="ct-mailchimp-description">
|
| 79 |
-
<?php echo
|
| 80 |
</p>
|
| 81 |
|
| 82 |
-
<form action="<?php echo esc_attr($form_url) ?>" method="post" class="ct-mailchimp-form"
|
| 83 |
-
<?php
|
| 84 |
-
|
| 85 |
-
|
|
|
|
|
|
|
|
|
|
| 86 |
|
| 87 |
-
|
|
|
|
|
|
|
|
|
|
| 88 |
|
| 89 |
-
<
|
| 90 |
-
<?php echo esc_html($button_text) ?>
|
| 91 |
-
</button>
|
| 92 |
|
| 93 |
<?php
|
| 94 |
if (function_exists('blocksy_ext_cookies_checkbox')) {
|
| 95 |
-
echo blocksy_ext_cookies_checkbox();
|
| 96 |
}
|
| 97 |
?>
|
| 98 |
|
| 23 |
}
|
| 24 |
}
|
| 25 |
|
| 26 |
+
if (
|
| 27 |
+
blocksy_default_akg(
|
| 28 |
+
'disable_subscribe_form',
|
| 29 |
+
blc_call_fn([
|
| 30 |
+
'fn' => 'blocksy_get_post_options',
|
| 31 |
+
'default' => 'array'
|
| 32 |
+
]),
|
| 33 |
+
'no'
|
| 34 |
+
) === 'yes'
|
| 35 |
+
) {
|
| 36 |
+
return '';
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
$title = get_theme_mod('mailchimp_title', __(
|
| 40 |
'Newsletter Updates', 'blc'
|
| 41 |
));
|
| 51 |
|
| 52 |
$has_name = get_theme_mod( 'has_mailchimp_name', 'no' ) === 'yes';
|
| 53 |
|
| 54 |
+
$name_label = get_theme_mod('mailchimp_name_label', __( 'Your name', 'blc' ));
|
| 55 |
+
$email_label = get_theme_mod('mailchimp_mail_label', __( 'Your email', 'blc' ));
|
| 56 |
+
|
| 57 |
if ($forced) {
|
| 58 |
$has_name = true;
|
| 59 |
}
|
| 66 |
|
| 67 |
$manager = new BlocksyMailchimpManager();
|
| 68 |
|
| 69 |
+
$mailchimp_data = $manager->get_form_url_and_gdpr_for($list_id);
|
| 70 |
|
| 71 |
+
if (! $mailchimp_data) {
|
| 72 |
return '';
|
| 73 |
}
|
| 74 |
|
| 75 |
+
$form_url = $mailchimp_data['form_url'];
|
| 76 |
+
$has_gdpr_fields = $mailchimp_data['has_gdpr_fields'];
|
| 77 |
+
|
| 78 |
+
$skip_submit_output = '';
|
| 79 |
+
|
| 80 |
+
if ($has_gdpr_fields) {
|
| 81 |
+
$skip_submit_output = 'data-skip-submit';
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
$class = 'ct-mailchimp-block';
|
| 85 |
|
| 86 |
+
$class .= ' ' . blc_call_fn(
|
| 87 |
+
['fn' => 'blocksy_visibility_classes'],
|
| 88 |
get_theme_mod('mailchimp_subscribe_visibility', [
|
| 89 |
'desktop' => true,
|
| 90 |
'tablet' => true,
|
| 92 |
])
|
| 93 |
);
|
| 94 |
|
| 95 |
+
$fields_number = '1';
|
| 96 |
+
|
| 97 |
+
if ($has_name) {
|
| 98 |
+
$fields_number = '2';
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
ob_start();
|
| 102 |
|
| 103 |
?>
|
| 104 |
|
| 105 |
+
<div class="<?php echo esc_attr($class) ?>">
|
| 106 |
+
<h3><?php echo esc_html($title) ?></h3>
|
|
|
|
|
|
|
| 107 |
|
| 108 |
<p class="ct-mailchimp-description">
|
| 109 |
+
<?php echo $description ?>
|
| 110 |
</p>
|
| 111 |
|
| 112 |
+
<form target="_blank" action="<?php echo esc_attr($form_url) ?>" method="post" class="ct-mailchimp-block-form" <?php echo $skip_submit_output ?>>
|
| 113 |
+
<section data-fields="<?php echo $fields_number ?>">
|
| 114 |
+
<?php if ($has_name) { ?>
|
| 115 |
+
<input type="text" name="FNAME" placeholder="<?php esc_attr_e($name_label, 'blc'); ?>" title="<?php echo __('Name', 'blc') ?>" />
|
| 116 |
+
<?php } ?>
|
| 117 |
+
|
| 118 |
+
<input type="email" name="EMAIL" placeholder="<?php esc_attr_e($email_label, 'blc'); ?> *" title="<?php echo __('Email', 'blc') ?>" required />
|
| 119 |
|
| 120 |
+
<button class="button">
|
| 121 |
+
<?php echo esc_html($button_text) ?>
|
| 122 |
+
</button>
|
| 123 |
+
</section>
|
| 124 |
|
| 125 |
+
<div class="ct-mailchimp-message"></div>
|
|
|
|
|
|
|
| 126 |
|
| 127 |
<?php
|
| 128 |
if (function_exists('blocksy_ext_cookies_checkbox')) {
|
| 129 |
+
echo blocksy_ext_cookies_checkbox('subscribe');
|
| 130 |
}
|
| 131 |
?>
|
| 132 |
|
framework/extensions/mailchimp/mailchimp-manager.php
CHANGED
|
@@ -5,10 +5,16 @@ class BlocksyMailchimpManager {
|
|
| 5 |
}
|
| 6 |
|
| 7 |
public function get_settings() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
return array_merge([
|
| 9 |
'api_key' => null,
|
| 10 |
'list_id' => null
|
| 11 |
-
],
|
| 12 |
}
|
| 13 |
|
| 14 |
public function set_settings($vals) {
|
|
@@ -18,15 +24,15 @@ class BlocksyMailchimpManager {
|
|
| 18 |
], $vals));
|
| 19 |
}
|
| 20 |
|
| 21 |
-
public function can(
|
| 22 |
-
if (
|
| 23 |
// Only network admin can change files that affects the entire network.
|
| 24 |
$can = current_user_can_for_blog( get_current_blog_id(), $capability );
|
| 25 |
} else {
|
| 26 |
$can = current_user_can( $capability );
|
| 27 |
}
|
| 28 |
|
| 29 |
-
if (
|
| 30 |
// Also you can use this method to get the capability.
|
| 31 |
$can = $capability;
|
| 32 |
}
|
|
@@ -43,7 +49,6 @@ class BlocksyMailchimpManager {
|
|
| 43 |
return 'api_key_invalid';
|
| 44 |
}
|
| 45 |
|
| 46 |
-
|
| 47 |
$region = explode('-', $api_key);
|
| 48 |
|
| 49 |
$response = wp_remote_get('https://' . $region[1] . '.api.mailchimp.com/3.0/lists', [
|
|
@@ -71,7 +76,12 @@ class BlocksyMailchimpManager {
|
|
| 71 |
return [
|
| 72 |
'name' => $list['name'],
|
| 73 |
'id' => $list['id'],
|
| 74 |
-
'subscribe_url_long' => $list['subscribe_url_long']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
];
|
| 76 |
}, $body['lists']);
|
| 77 |
} else {
|
|
@@ -79,7 +89,15 @@ class BlocksyMailchimpManager {
|
|
| 79 |
}
|
| 80 |
}
|
| 81 |
|
| 82 |
-
public function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
$settings = $this->get_settings();
|
| 84 |
|
| 85 |
if (! isset($settings['api_key'])) {
|
|
@@ -105,16 +123,25 @@ class BlocksyMailchimpManager {
|
|
| 105 |
}
|
| 106 |
|
| 107 |
if (! $settings['list_id']) {
|
| 108 |
-
return
|
|
|
|
|
|
|
|
|
|
| 109 |
}
|
| 110 |
|
| 111 |
foreach ($lists as $single_list) {
|
| 112 |
if ($single_list['id'] === $settings['list_id']) {
|
| 113 |
-
return
|
|
|
|
|
|
|
|
|
|
| 114 |
}
|
| 115 |
}
|
| 116 |
|
| 117 |
-
return
|
|
|
|
|
|
|
|
|
|
| 118 |
}
|
| 119 |
}
|
| 120 |
|
| 5 |
}
|
| 6 |
|
| 7 |
public function get_settings() {
|
| 8 |
+
$option = get_option('blocksy_ext_mailchimp_credentials', []);
|
| 9 |
+
|
| 10 |
+
if (empty($option)) {
|
| 11 |
+
$option = [];
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
return array_merge([
|
| 15 |
'api_key' => null,
|
| 16 |
'list_id' => null
|
| 17 |
+
], $option);
|
| 18 |
}
|
| 19 |
|
| 20 |
public function set_settings($vals) {
|
| 24 |
], $vals));
|
| 25 |
}
|
| 26 |
|
| 27 |
+
public function can($capability = 'manage_options') {
|
| 28 |
+
if (is_multisite()) {
|
| 29 |
// Only network admin can change files that affects the entire network.
|
| 30 |
$can = current_user_can_for_blog( get_current_blog_id(), $capability );
|
| 31 |
} else {
|
| 32 |
$can = current_user_can( $capability );
|
| 33 |
}
|
| 34 |
|
| 35 |
+
if ($can) {
|
| 36 |
// Also you can use this method to get the capability.
|
| 37 |
$can = $capability;
|
| 38 |
}
|
| 49 |
return 'api_key_invalid';
|
| 50 |
}
|
| 51 |
|
|
|
|
| 52 |
$region = explode('-', $api_key);
|
| 53 |
|
| 54 |
$response = wp_remote_get('https://' . $region[1] . '.api.mailchimp.com/3.0/lists', [
|
| 76 |
return [
|
| 77 |
'name' => $list['name'],
|
| 78 |
'id' => $list['id'],
|
| 79 |
+
'subscribe_url_long' => $list['subscribe_url_long'],
|
| 80 |
+
'subscribe_url_long_json' => $this->transform_subscribe_url(
|
| 81 |
+
$list['subscribe_url_long']
|
| 82 |
+
),
|
| 83 |
+
|
| 84 |
+
'has_gdpr_fields' => $list['marketing_permissions']
|
| 85 |
];
|
| 86 |
}, $body['lists']);
|
| 87 |
} else {
|
| 89 |
}
|
| 90 |
}
|
| 91 |
|
| 92 |
+
public function transform_subscribe_url($url) {
|
| 93 |
+
return str_replace(
|
| 94 |
+
'subscribe',
|
| 95 |
+
'subscribe/post-json',
|
| 96 |
+
$url . '&c=callback'
|
| 97 |
+
);
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
public function get_form_url_and_gdpr_for($maybe_custom_list = null) {
|
| 101 |
$settings = $this->get_settings();
|
| 102 |
|
| 103 |
if (! isset($settings['api_key'])) {
|
| 123 |
}
|
| 124 |
|
| 125 |
if (! $settings['list_id']) {
|
| 126 |
+
return [
|
| 127 |
+
'form_url' => $lists[0]['subscribe_url_long'],
|
| 128 |
+
'has_gdpr_fields' => $lists[0]['has_gdpr_fields']
|
| 129 |
+
];
|
| 130 |
}
|
| 131 |
|
| 132 |
foreach ($lists as $single_list) {
|
| 133 |
if ($single_list['id'] === $settings['list_id']) {
|
| 134 |
+
return [
|
| 135 |
+
'form_url' => $single_list['subscribe_url_long'],
|
| 136 |
+
'has_gdpr_fields' => $single_list['has_gdpr_fields']
|
| 137 |
+
];
|
| 138 |
}
|
| 139 |
}
|
| 140 |
|
| 141 |
+
return [
|
| 142 |
+
'form_url' => $lists[0]['subscribe_url_long'],
|
| 143 |
+
'has_gdpr_fields' => $lists[0]['has_gdpr_fields']
|
| 144 |
+
];
|
| 145 |
}
|
| 146 |
}
|
| 147 |
|
framework/extensions/mailchimp/pre-boot.php
CHANGED
|
@@ -3,7 +3,6 @@
|
|
| 3 |
require_once dirname( __FILE__ ) . '/mailchimp-manager.php';
|
| 4 |
|
| 5 |
class BlocksyExtensionMailchimpPreBoot {
|
| 6 |
-
|
| 7 |
public function __construct() {
|
| 8 |
add_action(
|
| 9 |
'wp_ajax_blocksy_ext_mailchimp_maybe_get_lists',
|
| 3 |
require_once dirname( __FILE__ ) . '/mailchimp-manager.php';
|
| 4 |
|
| 5 |
class BlocksyExtensionMailchimpPreBoot {
|
|
|
|
| 6 |
public function __construct() {
|
| 7 |
add_action(
|
| 8 |
'wp_ajax_blocksy_ext_mailchimp_maybe_get_lists',
|
framework/extensions/mailchimp/readme.php
CHANGED
|
@@ -1,14 +1,12 @@
|
|
| 1 |
-
<
|
| 2 |
|
| 3 |
<p>
|
| 4 |
<?php echo __('After installing and activating the Mailchimp extension you will have two possibilities to show your subscribe form:', 'blc') ?>
|
| 5 |
</p>
|
| 6 |
|
| 7 |
-
<ol>
|
| 8 |
<li>
|
| 9 |
-
<
|
| 10 |
-
<?php echo __('Mailchimp Widget', 'blc') ?>
|
| 11 |
-
</b>
|
| 12 |
<i>
|
| 13 |
<?php
|
| 14 |
echo sprintf(
|
|
@@ -23,9 +21,7 @@
|
|
| 23 |
</li>
|
| 24 |
|
| 25 |
<li>
|
| 26 |
-
<
|
| 27 |
-
<?php echo __('Mailchimp Block', 'blc') ?>
|
| 28 |
-
</b>
|
| 29 |
<i>
|
| 30 |
<?php
|
| 31 |
echo sprintf(
|
|
@@ -38,6 +34,4 @@
|
|
| 38 |
?>
|
| 39 |
</i>
|
| 40 |
</li>
|
| 41 |
-
</ol>
|
| 42 |
-
|
| 43 |
-
|
| 1 |
+
<h2><?php echo __('Instructions', 'blc'); ?></h2>
|
| 2 |
|
| 3 |
<p>
|
| 4 |
<?php echo __('After installing and activating the Mailchimp extension you will have two possibilities to show your subscribe form:', 'blc') ?>
|
| 5 |
</p>
|
| 6 |
|
| 7 |
+
<ol class="ct-modal-list">
|
| 8 |
<li>
|
| 9 |
+
<h4><?php echo __('Mailchimp Widget', 'blc') ?></h4>
|
|
|
|
|
|
|
| 10 |
<i>
|
| 11 |
<?php
|
| 12 |
echo sprintf(
|
| 21 |
</li>
|
| 22 |
|
| 23 |
<li>
|
| 24 |
+
<h4><?php echo __('Mailchimp Block', 'blc') ?></h4>
|
|
|
|
|
|
|
| 25 |
<i>
|
| 26 |
<?php
|
| 27 |
echo sprintf(
|
| 34 |
?>
|
| 35 |
</i>
|
| 36 |
</li>
|
| 37 |
+
</ol>
|
|
|
|
|
|
framework/extensions/mailchimp/static/bundle/main.css
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
/**
|
| 2 |
-
* - v1.
|
| 3 |
*
|
| 4 |
-
* Copyright (c)
|
| 5 |
* Licensed GPLv2+
|
| 6 |
*/
|
| 7 |
|
| 8 |
-
|
| 1 |
/**
|
| 2 |
+
* - v1.7.32
|
| 3 |
*
|
| 4 |
+
* Copyright (c) 2020
|
| 5 |
* Licensed GPLv2+
|
| 6 |
*/
|
| 7 |
|
| 8 |
+
aside[data-type="type-1"] .ct-mailchimp-widget{padding:30px;background:#fff;border-radius:3px;box-shadow:0px 12px 18px -6px rgba(34,56,101,0.04)}.ct-widget-inner[data-alignment="center"]{text-align:center}.ct-widget-inner[data-alignment="right"]{text-align:right}.ct-mailchimp-widget-form .ct-mailchimp-description:not(:empty){margin-bottom:10px}.ct-mailchimp-widget-form>*:not(:first-child){margin-top:10px}.ct-mailchimp-widget-form button{width:100%}.ct-mailchimp-widget-form .gdpr-confirm-policy{--display: inline-flex;--contentSpacing: 0;margin-top:20px}.ct-mailchimp-block{margin-top:60px;text-align:center;color:var(--color);padding:var(--padding);background:var(--backgroundColor);box-shadow:var(--box-shadow);--linkInitialColor: var(--color)}.ct-mailchimp-block>*:first-child{margin-top:20px}.ct-mailchimp-block>*:last-child{margin-bottom:20px}.ct-mailchimp-block>h3{--fontSize: 25px}.ct-mailchimp-block .ct-mailchimp-description:not(:empty){margin-bottom:30px}.ct-mailchimp-block form{max-width:550px;margin:0 auto}@media (min-width: 690px){.ct-mailchimp-block form{width:85%}}.ct-mailchimp-block form button{--buttonMinHeight: var(--formInputHeight);--padding: 0 15px;width:100%}.ct-mailchimp-block form [data-fields]{display:grid;grid-column-gap:15px;grid-row-gap:15px}@media (min-width: 690px){.ct-mailchimp-block form [data-fields="1"]{grid-template-columns:65% 1fr}}@media (min-width: 690px){.ct-mailchimp-block form [data-fields="2"]{grid-template-columns:32.5% 32.5% 1fr}}.ct-mailchimp-block .ct-mailchimp-message,.ct-mailchimp-block .gdpr-confirm-policy{margin-top:15px;--contentSpacing: 0}form[class*="ct-mailchimp"] .button{--buttonFontWeight: 600}.ct-mailchimp-message{display:none;font-size:16px}.ct-mailchimp-message a{text-decoration:underline}.subscribe-error .ct-mailchimp-message{display:block;font-size:14px;color:#e42b2b}.subscribe-success button.button,.subscribe-success input[type="text"],.subscribe-success input[type="email"],.subscribe-success .gdpr-confirm-policy,.subscribe-success .ct-mailchimp-description{display:none}.subscribe-success .ct-mailchimp-message{display:block}
|
framework/extensions/mailchimp/static/bundle/main.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
| 1 |
+
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";r.r(t);var n;function o(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}n=function(){o(document.querySelectorAll(".ct-mailchimp-widget-form, .ct-mailchimp-block-form")).map((function(e){e.matches("[data-skip-submit]")||e.addEventListener("submit",(function(e){e.preventDefault();var t=e.target;if(t.querySelector('[type="email"]').value.trim()){if(document.getElementById("js-validate-robot")&&""!==document.getElementById("js-validate-robot").value)return!1;for(var r=t.action.replace("subscribe","subscribe/post-json"),n="",o="mailchimpCallback",i=t.querySelectorAll("input"),c=0;c<i.length;c++)n+="&"+i[c].name+"="+encodeURIComponent(i[c].value);n+="&c=".concat(o);var u=document.createElement("script");u.src=r+n,document.body.appendChild(u),t.classList.remove("subscribe-error","subscribe-success"),t.classList.add("subscribe-loading"),window[o]=function(e){delete window[o],document.body.removeChild(u),t.classList.remove("subscribe-loading"),e&&(t.classList.add("error"===e.result?"subscribe-error":"subscribe-success"),t.querySelector(".ct-mailchimp-message").innerHTML=e.msg.replace("0 - ",""))}}}))}))},/comp|inter|loaded/.test(document.readyState)?n():document.addEventListener("DOMContentLoaded",n,!1)}]);
|
framework/extensions/mailchimp/static/js/main.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { onDocumentLoaded } from '../../../cookies-consent/static/js/helpers'
|
| 2 |
+
|
| 3 |
+
onDocumentLoaded(() => {
|
| 4 |
+
;[
|
| 5 |
+
...document.querySelectorAll(
|
| 6 |
+
'.ct-mailchimp-widget-form, .ct-mailchimp-block-form'
|
| 7 |
+
)
|
| 8 |
+
].map(el => {
|
| 9 |
+
if (el.matches('[data-skip-submit]')) {
|
| 10 |
+
return
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
el.addEventListener('submit', e => {
|
| 14 |
+
e.preventDefault()
|
| 15 |
+
const form = e.target
|
| 16 |
+
|
| 17 |
+
if (!form.querySelector('[type="email"]').value.trim()) {
|
| 18 |
+
return
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
// Check for spam
|
| 22 |
+
if (
|
| 23 |
+
document.getElementById('js-validate-robot') &&
|
| 24 |
+
document.getElementById('js-validate-robot').value !== ''
|
| 25 |
+
) {
|
| 26 |
+
return false
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
// Get url for mailchimp
|
| 30 |
+
var url = form.action.replace('subscribe', 'subscribe/post-json')
|
| 31 |
+
|
| 32 |
+
// Add form data to object
|
| 33 |
+
var data = ''
|
| 34 |
+
|
| 35 |
+
var callback = 'mailchimpCallback'
|
| 36 |
+
|
| 37 |
+
var inputs = form.querySelectorAll('input')
|
| 38 |
+
|
| 39 |
+
for (var i = 0; i < inputs.length; i++) {
|
| 40 |
+
data +=
|
| 41 |
+
'&' +
|
| 42 |
+
inputs[i].name +
|
| 43 |
+
'=' +
|
| 44 |
+
encodeURIComponent(inputs[i].value)
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
data += `&c=${callback}`
|
| 48 |
+
|
| 49 |
+
// Create & add post script to the DOM
|
| 50 |
+
var script = document.createElement('script')
|
| 51 |
+
script.src = url + data
|
| 52 |
+
|
| 53 |
+
document.body.appendChild(script)
|
| 54 |
+
|
| 55 |
+
form.classList.remove('subscribe-error', 'subscribe-success')
|
| 56 |
+
form.classList.add('subscribe-loading')
|
| 57 |
+
|
| 58 |
+
// Callback function
|
| 59 |
+
window[callback] = function (data) {
|
| 60 |
+
// Remove post script from the DOM
|
| 61 |
+
delete window[callback]
|
| 62 |
+
document.body.removeChild(script)
|
| 63 |
+
|
| 64 |
+
form.classList.remove('subscribe-loading')
|
| 65 |
+
|
| 66 |
+
if (!data) {
|
| 67 |
+
return
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
form.classList.add(
|
| 71 |
+
data.result === 'error'
|
| 72 |
+
? 'subscribe-error'
|
| 73 |
+
: 'subscribe-success'
|
| 74 |
+
)
|
| 75 |
+
|
| 76 |
+
form.querySelector(
|
| 77 |
+
'.ct-mailchimp-message'
|
| 78 |
+
).innerHTML = data.msg.replace('0 - ', '')
|
| 79 |
+
}
|
| 80 |
+
})
|
| 81 |
+
})
|
| 82 |
+
})
|
framework/extensions/mailchimp/static/sass/main.scss
CHANGED
|
@@ -2,29 +2,39 @@
|
|
| 2 |
@import 'widget';
|
| 3 |
@import 'single-block';
|
| 4 |
|
| 5 |
-
.ct-mailchimp-form {
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
margin-bottom: 10px;
|
| 11 |
-
}
|
| 12 |
-
}
|
| 13 |
}
|
|
|
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
}
|
| 24 |
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
// pointer-events: none;
|
| 28 |
-
}
|
| 29 |
}
|
| 30 |
}
|
| 2 |
@import 'widget';
|
| 3 |
@import 'single-block';
|
| 4 |
|
|
|
|
| 5 |
|
| 6 |
+
form[class*="ct-mailchimp"] {
|
| 7 |
+
.button {
|
| 8 |
+
--buttonFontWeight: 600;
|
|
|
|
|
|
|
|
|
|
| 9 |
}
|
| 10 |
+
}
|
| 11 |
|
| 12 |
+
// form messages
|
| 13 |
+
.ct-mailchimp-message {
|
| 14 |
+
display: none;
|
| 15 |
+
font-size: 16px;
|
| 16 |
+
|
| 17 |
+
a {
|
| 18 |
+
text-decoration: underline;
|
| 19 |
+
}
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
.subscribe-error .ct-mailchimp-message {
|
| 23 |
+
display: block;
|
| 24 |
+
font-size: 14px;
|
| 25 |
+
color: #e42b2b;
|
| 26 |
+
}
|
| 27 |
|
| 28 |
+
.subscribe-success {
|
| 29 |
+
button.button,
|
| 30 |
+
input[type="text"],
|
| 31 |
+
input[type="email"],
|
| 32 |
+
.gdpr-confirm-policy,
|
| 33 |
+
.ct-mailchimp-description {
|
| 34 |
+
display: none;
|
| 35 |
}
|
| 36 |
|
| 37 |
+
.ct-mailchimp-message {
|
| 38 |
+
display: block;
|
|
|
|
|
|
|
| 39 |
}
|
| 40 |
}
|
framework/extensions/mailchimp/static/sass/single-block.scss
CHANGED
|
@@ -1,9 +1,11 @@
|
|
| 1 |
.ct-mailchimp-block {
|
| 2 |
margin-top: 60px;
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
| 7 |
|
| 8 |
> * {
|
| 9 |
&:first-child {
|
|
@@ -15,40 +17,54 @@
|
|
| 15 |
}
|
| 16 |
}
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
}
|
| 21 |
|
| 22 |
.ct-mailchimp-description {
|
| 23 |
-
text-align: center;
|
| 24 |
-
|
| 25 |
&:not(:empty) {
|
| 26 |
-
margin-top: 10px;
|
| 27 |
-
margin-bottom:
|
| 28 |
}
|
| 29 |
}
|
| 30 |
|
| 31 |
-
|
| 32 |
form {
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
grid-row-gap: 15px;
|
| 36 |
-
margin-left: auto;
|
| 37 |
-
margin-right: auto;
|
| 38 |
-
|
| 39 |
-
@include media-breakpoint-down (sm) {
|
| 40 |
-
input {
|
| 41 |
-
text-align: center;
|
| 42 |
-
}
|
| 43 |
-
}
|
| 44 |
|
| 45 |
@include media-breakpoint-up (md) {
|
| 46 |
-
|
| 47 |
}
|
| 48 |
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
}
|
| 53 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
}
|
| 1 |
.ct-mailchimp-block {
|
| 2 |
margin-top: 60px;
|
| 3 |
+
text-align: center;
|
| 4 |
+
color: var(--color);
|
| 5 |
+
padding: var(--padding);
|
| 6 |
+
background: var(--backgroundColor);
|
| 7 |
+
box-shadow: var(--box-shadow);
|
| 8 |
+
--linkInitialColor: var(--color);
|
| 9 |
|
| 10 |
> * {
|
| 11 |
&:first-child {
|
| 17 |
}
|
| 18 |
}
|
| 19 |
|
| 20 |
+
> h3 {
|
| 21 |
+
--fontSize: 25px;
|
| 22 |
}
|
| 23 |
|
| 24 |
.ct-mailchimp-description {
|
|
|
|
|
|
|
| 25 |
&:not(:empty) {
|
| 26 |
+
// margin-top: 10px;
|
| 27 |
+
margin-bottom: 30px;
|
| 28 |
}
|
| 29 |
}
|
| 30 |
|
|
|
|
| 31 |
form {
|
| 32 |
+
max-width: 550px;
|
| 33 |
+
margin: 0 auto;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
@include media-breakpoint-up (md) {
|
| 36 |
+
width: 85%;
|
| 37 |
}
|
| 38 |
|
| 39 |
+
button {
|
| 40 |
+
--buttonMinHeight: var(--formInputHeight);
|
| 41 |
+
--padding: 0 15px;
|
| 42 |
+
width: 100%;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
[data-fields] {
|
| 46 |
+
display: grid;
|
| 47 |
+
grid-column-gap: 15px;
|
| 48 |
+
grid-row-gap: 15px;
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
[data-fields="1"] {
|
| 52 |
+
|
| 53 |
+
@include media-breakpoint-up (md) {
|
| 54 |
+
grid-template-columns: 65% 1fr;
|
| 55 |
+
}
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
[data-fields="2"] {
|
| 59 |
+
@include media-breakpoint-up (md) {
|
| 60 |
+
grid-template-columns: 32.5% 32.5% 1fr;
|
| 61 |
+
}
|
| 62 |
}
|
| 63 |
}
|
| 64 |
+
|
| 65 |
+
.ct-mailchimp-message,
|
| 66 |
+
.gdpr-confirm-policy {
|
| 67 |
+
margin-top: 15px;
|
| 68 |
+
--contentSpacing: 0;
|
| 69 |
+
}
|
| 70 |
}
|
framework/extensions/mailchimp/static/sass/widget.scss
CHANGED
|
@@ -1,15 +1,3 @@
|
|
| 1 |
-
.ct-mailchimp-widget {
|
| 2 |
-
.ct-mailchimp-description {
|
| 3 |
-
&:not(:empty) {
|
| 4 |
-
margin-bottom: 20px;
|
| 5 |
-
}
|
| 6 |
-
}
|
| 7 |
-
|
| 8 |
-
input {
|
| 9 |
-
text-align: center;
|
| 10 |
-
}
|
| 11 |
-
}
|
| 12 |
-
|
| 13 |
aside[data-type="type-1"] {
|
| 14 |
.ct-mailchimp-widget {
|
| 15 |
padding: 30px;
|
|
@@ -23,18 +11,32 @@ aside[data-type="type-1"] {
|
|
| 23 |
.ct-widget-inner {
|
| 24 |
&[data-alignment="center"] {
|
| 25 |
text-align: center;
|
| 26 |
-
|
| 27 |
-
.gdpr-confirm-policy {
|
| 28 |
-
justify-content: center;
|
| 29 |
-
}
|
| 30 |
}
|
| 31 |
|
| 32 |
&[data-alignment="right"] {
|
| 33 |
text-align: right;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
-
|
| 36 |
-
|
|
|
|
| 37 |
}
|
| 38 |
}
|
| 39 |
-
}
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
aside[data-type="type-1"] {
|
| 2 |
.ct-mailchimp-widget {
|
| 3 |
padding: 30px;
|
| 11 |
.ct-widget-inner {
|
| 12 |
&[data-alignment="center"] {
|
| 13 |
text-align: center;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
}
|
| 15 |
|
| 16 |
&[data-alignment="right"] {
|
| 17 |
text-align: right;
|
| 18 |
+
}
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
.ct-mailchimp-widget-form {
|
| 22 |
|
| 23 |
+
.ct-mailchimp-description {
|
| 24 |
+
&:not(:empty) {
|
| 25 |
+
margin-bottom: 10px;
|
| 26 |
}
|
| 27 |
}
|
|
|
|
| 28 |
|
| 29 |
+
> *:not(:first-child) {
|
| 30 |
+
margin-top: 10px;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
button {
|
| 34 |
+
width: 100%;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
.gdpr-confirm-policy {
|
| 38 |
+
--display: inline-flex;
|
| 39 |
+
--contentSpacing: 0;
|
| 40 |
+
margin-top: 20px;
|
| 41 |
+
}
|
| 42 |
+
}
|
framework/extensions/trending/config.php
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
$config = [
|
| 4 |
+
'title' => __('Trending Block', 'blc'),
|
| 5 |
+
'description' => __('Display a trending list of posts, products or custom post types at the bottom of your website.', 'blc')
|
| 6 |
+
];
|
framework/extensions/trending/customizer.php
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
$all_post_types = [
|
| 4 |
+
'post' => __('Posts', 'blc')
|
| 5 |
+
];
|
| 6 |
+
|
| 7 |
+
if (class_exists('WooCommerce')) {
|
| 8 |
+
$all_post_types['product'] = __('Products', 'blc');
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
if (function_exists('blocksy_manager')) {
|
| 12 |
+
$post_types = blocksy_manager()->post_types->get_supported_post_types();
|
| 13 |
+
|
| 14 |
+
foreach ($post_types as $single_post_type) {
|
| 15 |
+
$post_type_object = get_post_type_object($single_post_type);
|
| 16 |
+
|
| 17 |
+
if (! $post_type_object) {
|
| 18 |
+
continue;
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
$all_post_types[$single_post_type] = $post_type_object->labels->singular_name;
|
| 22 |
+
}
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
$options = [
|
| 26 |
+
'title' => __('Trending Posts', 'blc'),
|
| 27 |
+
'container' => [ 'priority' => 8 ],
|
| 28 |
+
'options' => [
|
| 29 |
+
'trending_posts_section_options' => [
|
| 30 |
+
'type' => 'ct-options',
|
| 31 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 32 |
+
'inner-options' => [
|
| 33 |
+
blocksy_rand_md5() => [
|
| 34 |
+
'type' => 'ct-title',
|
| 35 |
+
'label' => __( 'Trending Posts', 'blocksy' ),
|
| 36 |
+
],
|
| 37 |
+
|
| 38 |
+
blocksy_rand_md5() => [
|
| 39 |
+
'title' => __( 'General', 'blc' ),
|
| 40 |
+
'type' => 'tab',
|
| 41 |
+
'options' => [
|
| 42 |
+
'trending_block_post_type' => count($all_post_types) > 1 ? [
|
| 43 |
+
'label' => __( 'Post Type', 'blc' ),
|
| 44 |
+
'type' => 'ct-select',
|
| 45 |
+
'value' => 'post',
|
| 46 |
+
'design' => 'inline',
|
| 47 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 48 |
+
'choices' => blocksy_ordered_keys($all_post_types),
|
| 49 |
+
|
| 50 |
+
'sync' => [
|
| 51 |
+
'selector' => '.ct-trending-block',
|
| 52 |
+
'render' => function () {
|
| 53 |
+
echo blc_get_trending_block();
|
| 54 |
+
}
|
| 55 |
+
],
|
| 56 |
+
] : [
|
| 57 |
+
'label' => __('Post Type', 'blc'),
|
| 58 |
+
'type' => 'hidden',
|
| 59 |
+
'value' => 'post',
|
| 60 |
+
'design' => 'none',
|
| 61 |
+
'setting' => ['transport' => 'postMessage'],
|
| 62 |
+
],
|
| 63 |
+
|
| 64 |
+
'trending_block_filter' => [
|
| 65 |
+
'label' => __( 'Trending From', 'blc' ),
|
| 66 |
+
'type' => 'ct-select',
|
| 67 |
+
'value' => 'all_time',
|
| 68 |
+
'view' => 'text',
|
| 69 |
+
'design' => 'inline',
|
| 70 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 71 |
+
'choices' => blocksy_ordered_keys(
|
| 72 |
+
[
|
| 73 |
+
'all_time' => __( 'All Time', 'blc' ),
|
| 74 |
+
'last_24_hours' => __( 'Last 24 Hours', 'blc' ),
|
| 75 |
+
'last_7_days' => __( 'Last 7 Days', 'blc' ),
|
| 76 |
+
'last_month' => __( 'Last Month', 'blc' ),
|
| 77 |
+
]
|
| 78 |
+
),
|
| 79 |
+
|
| 80 |
+
'sync' => [
|
| 81 |
+
'selector' => '.ct-trending-block',
|
| 82 |
+
'render' => function () {
|
| 83 |
+
echo blocksy_get_trending_block();
|
| 84 |
+
}
|
| 85 |
+
],
|
| 86 |
+
],
|
| 87 |
+
|
| 88 |
+
blocksy_rand_md5() => [
|
| 89 |
+
'type' => 'ct-divider',
|
| 90 |
+
],
|
| 91 |
+
|
| 92 |
+
'trendingBlockContainerSpacing' => [
|
| 93 |
+
'label' => __( 'Container Inner Spacing', 'blc' ),
|
| 94 |
+
'type' => 'ct-slider',
|
| 95 |
+
'value' => [
|
| 96 |
+
'mobile' => '30px',
|
| 97 |
+
'tablet' => '30px',
|
| 98 |
+
'desktop' => '30px',
|
| 99 |
+
],
|
| 100 |
+
'units' => blocksy_units_config([
|
| 101 |
+
[
|
| 102 |
+
'unit' => 'px',
|
| 103 |
+
'min' => 0,
|
| 104 |
+
'max' => 100,
|
| 105 |
+
],
|
| 106 |
+
]),
|
| 107 |
+
'responsive' => true,
|
| 108 |
+
'sync' => 'live',
|
| 109 |
+
],
|
| 110 |
+
|
| 111 |
+
blocksy_rand_md5() => [
|
| 112 |
+
'type' => 'ct-divider',
|
| 113 |
+
],
|
| 114 |
+
|
| 115 |
+
'trending_block_visibility' => [
|
| 116 |
+
'label' => __( 'Container Visibility', 'blc' ),
|
| 117 |
+
'type' => 'ct-visibility',
|
| 118 |
+
'design' => 'block',
|
| 119 |
+
'sync' => 'live',
|
| 120 |
+
|
| 121 |
+
'value' => [
|
| 122 |
+
'desktop' => true,
|
| 123 |
+
'tablet' => true,
|
| 124 |
+
'mobile' => false,
|
| 125 |
+
],
|
| 126 |
+
|
| 127 |
+
'choices' => blocksy_ordered_keys([
|
| 128 |
+
'desktop' => __( 'Desktop', 'blc' ),
|
| 129 |
+
'tablet' => __( 'Tablet', 'blc' ),
|
| 130 |
+
'mobile' => __( 'Mobile', 'blc' ),
|
| 131 |
+
]),
|
| 132 |
+
],
|
| 133 |
+
|
| 134 |
+
],
|
| 135 |
+
],
|
| 136 |
+
|
| 137 |
+
blocksy_rand_md5() => [
|
| 138 |
+
'title' => __( 'Design', 'blc' ),
|
| 139 |
+
'type' => 'tab',
|
| 140 |
+
'options' => [
|
| 141 |
+
|
| 142 |
+
'trendingBlockFontColor' => [
|
| 143 |
+
'label' => __( 'Font Color', 'blc' ),
|
| 144 |
+
'type' => 'ct-color-picker',
|
| 145 |
+
'design' => 'inline',
|
| 146 |
+
'sync' => 'live',
|
| 147 |
+
|
| 148 |
+
'value' => [
|
| 149 |
+
'default' => [
|
| 150 |
+
'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
|
| 151 |
+
],
|
| 152 |
+
|
| 153 |
+
'hover' => [
|
| 154 |
+
'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
|
| 155 |
+
],
|
| 156 |
+
],
|
| 157 |
+
|
| 158 |
+
'pickers' => [
|
| 159 |
+
[
|
| 160 |
+
'title' => __( 'Initial', 'blc' ),
|
| 161 |
+
'id' => 'default',
|
| 162 |
+
'inherit' => 'var(--color)'
|
| 163 |
+
],
|
| 164 |
+
|
| 165 |
+
[
|
| 166 |
+
'title' => __( 'Hover', 'blc' ),
|
| 167 |
+
'id' => 'hover',
|
| 168 |
+
'inherit' => 'var(--linkHoverColor)'
|
| 169 |
+
],
|
| 170 |
+
],
|
| 171 |
+
],
|
| 172 |
+
|
| 173 |
+
'trending_block_background' => [
|
| 174 |
+
'label' => __( 'Container Background', 'blc' ),
|
| 175 |
+
'type' => 'ct-background',
|
| 176 |
+
'design' => 'inline',
|
| 177 |
+
'divider' => 'top',
|
| 178 |
+
'sync' => 'live',
|
| 179 |
+
'value' => blocksy_background_default_value([
|
| 180 |
+
'backgroundColor' => [
|
| 181 |
+
'default' => [
|
| 182 |
+
'color' => '#e0e3e8',
|
| 183 |
+
],
|
| 184 |
+
],
|
| 185 |
+
])
|
| 186 |
+
],
|
| 187 |
+
|
| 188 |
+
],
|
| 189 |
+
],
|
| 190 |
+
]
|
| 191 |
+
]
|
| 192 |
+
]
|
| 193 |
+
];
|
framework/extensions/trending/extension.php
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
require_once dirname(__FILE__) . '/helpers.php';
|
| 4 |
+
|
| 5 |
+
class BlocksyExtensionTrending {
|
| 6 |
+
public function __construct() {
|
| 7 |
+
add_action('wp_enqueue_scripts', function () {
|
| 8 |
+
if (! function_exists('get_plugin_data')) {
|
| 9 |
+
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
$data = get_plugin_data(BLOCKSY__FILE__);
|
| 13 |
+
|
| 14 |
+
if (is_admin()) {
|
| 15 |
+
return;
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
wp_enqueue_style(
|
| 19 |
+
'blocksy-ext-trending-styles',
|
| 20 |
+
BLOCKSY_URL . 'framework/extensions/trending/static/bundle/main.css',
|
| 21 |
+
['ct-main-styles'],
|
| 22 |
+
$data['Version']
|
| 23 |
+
);
|
| 24 |
+
|
| 25 |
+
wp_enqueue_script(
|
| 26 |
+
'blocksy-ext-trending-scripts',
|
| 27 |
+
BLOCKSY_URL . 'framework/extensions/trending/static/bundle/main.js',
|
| 28 |
+
['ct-events'],
|
| 29 |
+
$data['Version'],
|
| 30 |
+
true
|
| 31 |
+
);
|
| 32 |
+
});
|
| 33 |
+
|
| 34 |
+
add_filter(
|
| 35 |
+
'blocksy_extensions_customizer_options',
|
| 36 |
+
function ($opts) {
|
| 37 |
+
$opts['trending_posts_ext'] = blc_call_fn(
|
| 38 |
+
[
|
| 39 |
+
'fn' => 'blocksy_get_options',
|
| 40 |
+
'default' => 'array'
|
| 41 |
+
],
|
| 42 |
+
dirname( __FILE__ ) . '/customizer.php',
|
| 43 |
+
[], false
|
| 44 |
+
);
|
| 45 |
+
|
| 46 |
+
return $opts;
|
| 47 |
+
}
|
| 48 |
+
);
|
| 49 |
+
|
| 50 |
+
add_action(
|
| 51 |
+
'blocksy:template:after',
|
| 52 |
+
function () {
|
| 53 |
+
echo blc_get_trending_block();
|
| 54 |
+
}
|
| 55 |
+
);
|
| 56 |
+
|
| 57 |
+
add_action(
|
| 58 |
+
'customize_preview_init',
|
| 59 |
+
function () {
|
| 60 |
+
if (! function_exists('get_plugin_data')) {
|
| 61 |
+
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
$data = get_plugin_data(BLOCKSY__FILE__);
|
| 65 |
+
|
| 66 |
+
wp_enqueue_script(
|
| 67 |
+
'blocksy-trending-customizer-sync',
|
| 68 |
+
BLOCKSY_URL . 'framework/extensions/trending/static/bundle/sync.js',
|
| 69 |
+
['customize-preview', 'ct-events', 'ct-customizer'],
|
| 70 |
+
$data['Version'],
|
| 71 |
+
true
|
| 72 |
+
);
|
| 73 |
+
}
|
| 74 |
+
);
|
| 75 |
+
|
| 76 |
+
add_action('blocksy:global-dynamic-css:enqueue', function ($args) {
|
| 77 |
+
blocksy_theme_get_dynamic_styles(array_merge([
|
| 78 |
+
'path' => dirname( __FILE__ ) . '/global.php',
|
| 79 |
+
'chunk' => 'global'
|
| 80 |
+
], $args));
|
| 81 |
+
}, 10, 3);
|
| 82 |
+
}
|
| 83 |
+
}
|
framework/extensions/trending/global.php
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
blc_call_fn(['fn' => 'blocksy_output_background_css'], [
|
| 4 |
+
'selector' => '.ct-trending-block',
|
| 5 |
+
'css' => $css,
|
| 6 |
+
'value' => get_theme_mod(
|
| 7 |
+
'trending_block_background',
|
| 8 |
+
blc_call_fn([
|
| 9 |
+
'fn' => 'blocksy_background_default_value',
|
| 10 |
+
'default' => null
|
| 11 |
+
], [
|
| 12 |
+
'backgroundColor' => [
|
| 13 |
+
'default' => [
|
| 14 |
+
'color' => '#e0e3e8'
|
| 15 |
+
],
|
| 16 |
+
],
|
| 17 |
+
])
|
| 18 |
+
)
|
| 19 |
+
]);
|
| 20 |
+
|
| 21 |
+
blc_call_fn(['fn' => 'blocksy_output_responsive'], [
|
| 22 |
+
'css' => $css,
|
| 23 |
+
'tablet_css' => $tablet_css,
|
| 24 |
+
'mobile_css' => $mobile_css,
|
| 25 |
+
'selector' => ".ct-trending-block",
|
| 26 |
+
'variableName' => 'padding',
|
| 27 |
+
'value' => get_theme_mod('trendingBlockContainerSpacing', [
|
| 28 |
+
'mobile' => '30px',
|
| 29 |
+
'tablet' => '30px',
|
| 30 |
+
'desktop' => '30px',
|
| 31 |
+
]),
|
| 32 |
+
'unit' => ''
|
| 33 |
+
]);
|
| 34 |
+
|
| 35 |
+
blc_call_fn(['fn' => 'blocksy_output_colors'], [
|
| 36 |
+
'value' => get_theme_mod('trendingBlockFontColor'),
|
| 37 |
+
'default' => [
|
| 38 |
+
'default' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
|
| 39 |
+
'hover' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
|
| 40 |
+
],
|
| 41 |
+
'css' => $css,
|
| 42 |
+
'variables' => [
|
| 43 |
+
'default' => [
|
| 44 |
+
'selector' => '.ct-trending-block',
|
| 45 |
+
'variable' => 'color'
|
| 46 |
+
],
|
| 47 |
+
|
| 48 |
+
'hover' => [
|
| 49 |
+
'selector' => '.ct-trending-block',
|
| 50 |
+
'variable' => 'linkHoverColor'
|
| 51 |
+
],
|
| 52 |
+
],
|
| 53 |
+
]);
|
framework/extensions/trending/helpers.php
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
add_action('wp_ajax_blocksy_get_trending_posts', 'blc_get_trending_posts');
|
| 4 |
+
add_action('wp_ajax_nopriv_blocksy_get_trending_posts', 'blc_get_trending_posts');
|
| 5 |
+
|
| 6 |
+
if (! function_exists('blc_get_trending_posts')) {
|
| 7 |
+
function blc_get_trending_posts() {
|
| 8 |
+
if (! isset($_REQUEST['page'])) {
|
| 9 |
+
wp_send_json_error();
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
$page = intval(sanitize_text_field($_REQUEST['page']));
|
| 13 |
+
|
| 14 |
+
if (! $page) {
|
| 15 |
+
wp_send_json_error();
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
wp_send_json_success([
|
| 19 |
+
'posts' => blc_get_trending_posts_value([
|
| 20 |
+
'paged' => $page
|
| 21 |
+
])
|
| 22 |
+
]);
|
| 23 |
+
}
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
if (! function_exists('blc_get_trending_posts_value')) {
|
| 27 |
+
function blc_get_trending_posts_value($args = []) {
|
| 28 |
+
$args = wp_parse_args(
|
| 29 |
+
$args,
|
| 30 |
+
[
|
| 31 |
+
'paged' => 1
|
| 32 |
+
]
|
| 33 |
+
);
|
| 34 |
+
|
| 35 |
+
$date_query = [];
|
| 36 |
+
|
| 37 |
+
$date_filter = get_theme_mod('trending_block_filter', 'all_time');
|
| 38 |
+
|
| 39 |
+
if ($date_filter && 'all_time' !== $date_filter) {
|
| 40 |
+
$days = [
|
| 41 |
+
'last_24_hours' => 1,
|
| 42 |
+
'last_7_days' => 7,
|
| 43 |
+
'last_month' => 30
|
| 44 |
+
][$date_filter];
|
| 45 |
+
|
| 46 |
+
if (! $days) {
|
| 47 |
+
$days = 30;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
$time = time() - (intval($days) * 24 * 60 * 60);
|
| 51 |
+
|
| 52 |
+
$date_query = array(
|
| 53 |
+
'after' => [
|
| 54 |
+
'year' => date('Y', $time),
|
| 55 |
+
'month' => date('n', $time),
|
| 56 |
+
'days' => date('j', $time),
|
| 57 |
+
],
|
| 58 |
+
'before' => [
|
| 59 |
+
'year' => date('Y'),
|
| 60 |
+
'month' => date('n'),
|
| 61 |
+
'days' => date('j'),
|
| 62 |
+
],
|
| 63 |
+
'inclusive' => true,
|
| 64 |
+
);
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
$post_type = get_theme_mod('trending_block_post_type', 'post');
|
| 68 |
+
|
| 69 |
+
if ($post_type === 'product' && !class_exists('WooCommerce')) {
|
| 70 |
+
$post_type = 'post';
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
$query = new WP_Query(
|
| 74 |
+
[
|
| 75 |
+
'post_type' => $post_type,
|
| 76 |
+
'order' => 'DESC',
|
| 77 |
+
'date_query' => $date_query,
|
| 78 |
+
'posts_per_page' => 4,
|
| 79 |
+
'orderby' => 'comment_count',
|
| 80 |
+
'paged' => $args['paged'],
|
| 81 |
+
'ignore_sticky_posts' => true,
|
| 82 |
+
'post_status' => 'publish'
|
| 83 |
+
]
|
| 84 |
+
);
|
| 85 |
+
|
| 86 |
+
if (! $query->have_posts()) {
|
| 87 |
+
return [
|
| 88 |
+
'posts' => [],
|
| 89 |
+
'is_last_page' => false
|
| 90 |
+
];
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
$result = [];
|
| 94 |
+
|
| 95 |
+
while ($query->have_posts()) {
|
| 96 |
+
$query->the_post();
|
| 97 |
+
|
| 98 |
+
$result[] = [
|
| 99 |
+
'id' => get_the_ID(),
|
| 100 |
+
'attachment_id' => get_post_thumbnail_id(),
|
| 101 |
+
'title' => get_the_title(),
|
| 102 |
+
'url' => get_permalink(),
|
| 103 |
+
'image' => blc_call_fn(['fn' => 'blocksy_image'], [
|
| 104 |
+
'attachment_id' => get_post_thumbnail_id(),
|
| 105 |
+
'size' => 'thumbnail',
|
| 106 |
+
'ratio' => '1/1',
|
| 107 |
+
'tag_name' => 'div',
|
| 108 |
+
])
|
| 109 |
+
];
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
$is_last = intval($query->max_num_pages) === intval($args['paged']);
|
| 113 |
+
|
| 114 |
+
wp_reset_postdata();
|
| 115 |
+
|
| 116 |
+
return [
|
| 117 |
+
'posts' => $result,
|
| 118 |
+
'is_last_page' => $is_last
|
| 119 |
+
];
|
| 120 |
+
}
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
if (! function_exists('blc_get_trending_block')) {
|
| 124 |
+
function blc_get_trending_block($forced = false) {
|
| 125 |
+
$result = blc_get_trending_posts_value();
|
| 126 |
+
|
| 127 |
+
if (empty($result['posts'])) {
|
| 128 |
+
return '';
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
ob_start();
|
| 132 |
+
|
| 133 |
+
$data_page = 'data-page="1"';
|
| 134 |
+
|
| 135 |
+
if ($result['is_last_page']) {
|
| 136 |
+
$data_page = '';
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
$class = 'ct-trending-block';
|
| 140 |
+
|
| 141 |
+
$class .= ' ' . blc_call_fn(
|
| 142 |
+
['fn' => 'blocksy_visibility_classes'],
|
| 143 |
+
get_theme_mod('trending_block_visibility', [
|
| 144 |
+
'desktop' => true,
|
| 145 |
+
'tablet' => true,
|
| 146 |
+
'mobile' => false,
|
| 147 |
+
])
|
| 148 |
+
);
|
| 149 |
+
|
| 150 |
+
?>
|
| 151 |
+
|
| 152 |
+
<section class="<?php echo $class ?>">
|
| 153 |
+
<div class="ct-container" <?php echo $data_page ?>>
|
| 154 |
+
<h5 class="ct-block-title">
|
| 155 |
+
<?php echo __('Trending now', 'blc') ?>
|
| 156 |
+
|
| 157 |
+
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 6 13.5 15.5 8.5 10.5 1 18"></polyline><polyline points="17 6 23 6 23 12"></polyline></svg>
|
| 158 |
+
|
| 159 |
+
<?php if (! $result['is_last_page']) { ?>
|
| 160 |
+
<span class="ct-arrow-left">
|
| 161 |
+
</span>
|
| 162 |
+
|
| 163 |
+
<span class="ct-arrow-right">
|
| 164 |
+
</span>
|
| 165 |
+
<?php } ?>
|
| 166 |
+
</h5>
|
| 167 |
+
|
| 168 |
+
<?php
|
| 169 |
+
foreach ($result['posts'] as $post) {
|
| 170 |
+
echo blocksy_html_tag(
|
| 171 |
+
'a',
|
| 172 |
+
[
|
| 173 |
+
'href' => $post['url']
|
| 174 |
+
],
|
| 175 |
+
|
| 176 |
+
$post['image'] . blocksy_html_tag(
|
| 177 |
+
'span',
|
| 178 |
+
[
|
| 179 |
+
'class' => 'ct-item-title',
|
| 180 |
+
],
|
| 181 |
+
$post['title']
|
| 182 |
+
)
|
| 183 |
+
);
|
| 184 |
+
}
|
| 185 |
+
|
| 186 |
+
?>
|
| 187 |
+
|
| 188 |
+
</div>
|
| 189 |
+
</section>
|
| 190 |
+
|
| 191 |
+
<?php
|
| 192 |
+
|
| 193 |
+
return ob_get_clean();
|
| 194 |
+
}
|
| 195 |
+
}
|
framework/extensions/trending/static/bundle/main.css
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* - v1.7.32
|
| 3 |
+
*
|
| 4 |
+
* Copyright (c) 2020
|
| 5 |
+
* Licensed GPLv2+
|
| 6 |
+
*/
|
| 7 |
+
|
framework/extensions/trending/static/bundle/main.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
| 1 |
+
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([function(t,e){t.exports=ctEvents},function(t,e,r){"use strict";r.r(e);var n=r(0),o=r.n(n);function a(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var c=function(t){return a(t.querySelectorAll(".ct-image-container.ct-lazy")).map((function(t){t.querySelector("img")&&(t.querySelector("img").setAttribute("src",t.querySelector("img").dataset.ctLazy),t.querySelector("img").dataset.ctLazySet&&t.querySelector("img").setAttribute("srcset",t.querySelector("img").dataset.ctLazySet)),t.classList.remove("ct-lazy"),t.classList.add("ct-lazy-loaded")}))};function l(t){return function(t){if(Array.isArray(t))return f(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||s(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,a=void 0;try{for(var i,c=t[Symbol.iterator]();!(n=(i=c.next()).done)&&(r.push(i.value),!e||r.length!==e);n=!0);}catch(t){o=!0,a=t}finally{try{n||null==c.return||c.return()}finally{if(o)throw a}}return r}(t,e)||s(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t,e){if(t){if("string"==typeof t)return f(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(t,e):void 0}}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function d(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?d(Object(r),!0).forEach((function(e){m(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function m(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var p,b={},v=function(t){return b[t]?new Promise((function(e){e(b[t]),window.ct_customizer_localizations||(b[t]=b[t].clone())})):new Promise((function(e){return fetch(t).then((function(r){e(r),window.ct_customizer_localizations||(b[t]=r.clone())}))}))},g=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if((t=y({el:null,action:null},t)).el&&t.action&&!t.el.classList.contains("ct-loading")){var e=parseInt(t.el.dataset.page,10);if(("prev"!==t.action||1!==e)&&!(t.el.querySelectorAll(".ct-container > a").length<4&&1===e||t.el.dataset.page.indexOf("last")>-1&&"next"===t.action)){t.el.classList.add("ct-loading");var r="prev"===t.action?e-1:e+1;Promise.all([new Promise((function(e){t.el.classList.add("ct-leave-active"),requestAnimationFrame((function(){t.el.classList.remove("ct-leave-active"),t.el.classList.add("ct-leave"),setTimeout((function(){return e()}),650)}))})),v("".concat(ct_localizations.ajax_url,"?action=blocksy_get_trending_posts&page=").concat(r)).then((function(t){return t.json()}))]).then((function(e){var n=u(e,2),o=(n[0],n[1]),a=o.success,i=o.data;if(a){var s=i.posts,f=s.is_last_page,d=s.posts;t.el.dataset.page="".concat(r).concat(f?":last":""),l(t.el.querySelectorAll("a")).map((function(t){return t.remove()})),d.map((function(e){return t.el.insertAdjacentHTML("beforeend",'<a href="'.concat(e.url,'">\n ').concat(e.image,'\n <span class="ct-item-title">\n ').concat(e.title,"\n </span>\n </a>"))})),setTimeout((function(){t.el.classList.remove("ct-leave"),t.el.classList.add("ct-enter-active"),requestAnimationFrame((function(){t.el.classList.remove("ct-enter-active"),t.el.classList.add("ct-active"),setTimeout((function(){t.el.classList.remove("ct-active"),t.el.classList.remove("ct-loading")}),650)}))}),50),c(t.el)}}))}}},S=function(){Array.from(document.querySelectorAll(".ct-trending-block [data-page]")).map((function(t){return function(t){t.hasListeners||(t.hasListeners=!0,t.querySelector(".ct-arrow-left").addEventListener("click",(function(e){e.preventDefault(),g({el:t,action:"prev"})})),t.querySelector(".ct-arrow-right").addEventListener("click",(function(e){e.preventDefault(),g({el:t,action:"next"})})))}(t)}))};p=function(){S()},/comp|inter|loaded/.test(document.readyState)?p():document.addEventListener("DOMContentLoaded",p,!1),o.a.on("blocksy:frontend:init",(function(){S()}))}]);
|
framework/extensions/trending/static/bundle/sync.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
| 1 |
+
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},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=1)}([function(e,t){e.exports=window.blocksyCustomizerSync},function(e,t,n){"use strict";n.r(t);var o,r=function(e){if([e.top,e.right,e.bottom,e.left].reduce((function(e,t){return!!e&&!("auto"!==t&&t&&t.toString().match(/\d/g))}),!0))return"CT_CSS_SKIP_RULE";var t=["auto"!==e.top&&e.top.toString().match(/\d/g)?e.top:0,"auto"!==e.right&&e.right.toString().match(/\d/g)?e.right:0,"auto"!==e.bottom&&e.bottom.toString().match(/\d/g)?e.bottom:0,"auto"!==e.left&&e.left.toString().match(/\d/g)?e.left:0];return t[0]===t[1]&&t[0]===t[2]&&t[0]===t[3]?t[0]:t[0]===t[2]&&t[1]===t[3]?"".concat(t[0]," ").concat(t[3]):t.join(" ")},c=function(e,t){var n=t.forcedOutput,o=void 0!==n&&n;if("CT_CSS_SKIP_RULE"===e)return"CT_CSS_SKIP_RULE";if("none"===e)return"none";if(!e.enable)return o?"none":"CT_CSS_SKIP_RULE";if(0===parseFloat(e.blur)&&0===parseFloat(e.spread)&&0===parseFloat(e.v_offset)&&0===parseFloat(e.h_offset))return o?"none":"CT_CSS_SKIP_RULE";var r=[];return e.inset&&r.push("inset"),r.push("".concat(e.h_offset,"px")),r.push("".concat(e.v_offset,"px")),0!==parseFloat(e.blur)&&(r.push("".concat(e.blur,"px")),0!==parseFloat(e.spread)&&r.push("".concat(e.spread,"px"))),0===parseFloat(e.blur)&&0!==parseFloat(e.spread)&&(r.push("".concat(e.blur,"px")),r.push("".concat(e.spread,"px"))),r.push(e.color.color),r.join(" ")},a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"desktop",o={desktop:"ct-main-styles-inline-css",tablet:"ct-main-styles-tablet-inline-css",mobile:"ct-main-styles-mobile-inline-css"},r=document.querySelector("style#".concat(o[n])),c=r.innerText,a="".concat(e["".concat(n,"_selector_prefix")]?"".concat(e["".concat(n,"_selector_prefix")]," "):"").concat(e.selector||":root"),i=null,l=c.match(i);0===c.trim().indexOf(a)?(i=new RegExp("".concat(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=c.match(i)):(i=new RegExp("\\}\\s*?".concat(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=c.match(i)),l||(0===(c="".concat(c," ").concat(a," { }")).trim().indexOf(a)?(i=new RegExp("".concat(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=c.match(i)):(i=new RegExp("\\}\\s*?".concat(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=c.match(i))),r.innerText=c.replace(i,l[0].indexOf("--".concat(e.variable,":"))>-1?l[0].replace(new RegExp("--".concat(e.variable,":[\\s\\S]*?;"),"gm"),t.indexOf("CT_CSS_SKIP_RULE")>-1||t.indexOf(e.variable)>-1?"":"--".concat(e.variable,": ").concat(t,";")):l[0].replace(new RegExp("".concat(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{"),"gm"),"".concat(a," {").concat(t.indexOf("CT_CSS_SKIP_RULE")>-1||t.indexOf(e.variable)>-1?"":"--".concat(e.variable,": ").concat(t,";"))))},i=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"desktop",o=(e.type||"").indexOf("color")>-1?t["color"===e.type?"default":e.type.split(":")[1]].color:t;"border"===(e.type||"")&&(o="none"===t.style?"none":"".concat(t.width,"px ").concat(t.style," ").concat(t.color.color)),"spacing"===(e.type||"")&&(o=r(t)),"box-shadow"===(e.type||"")&&(o=c(t,e)),a(e,"".concat(o).concat(e.unit||"").concat(e.important?" !important":""),n)},l=function(e,t){var n=t;t=e.extractValue?e.extractValue(t):t,e.whenDone&&e.whenDone(t,n),t=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e&&Object.keys(e).indexOf("desktop")>-1?t?e:e.desktop:t?{desktop:e,tablet:e,mobile:e}:e}(t,!!e.responsive),e.responsive?(e.enabled&&"no"===!wp.customize(e.enabled)()&&(t.mobile="0"+(e.unit?"":"px"),t.tablet="0"+(e.unit?"":"px"),t.desktop="0"+(e.unit?"":"px")),i(e,t.desktop,"desktop"),i(e,t.tablet,"tablet"),i(e,t.mobile,"mobile")):i(e,t)},s=n(0);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}o=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({trendingBlockContainerSpacing:{selector:".ct-trending-block",variable:"padding",responsive:!0,unit:""},trendingBlockFontColor:[{selector:".ct-trending-block",variable:"color",type:"color:default"},{selector:".ct-trending-block",variable:"linkHoverColor",type:"color:hover"}]},Object(s.handleBackgroundOptionFor)({id:"trending_block_background",selector:".ct-trending-block"})),wp.customize.bind("change",(function(e){return o[e.id]&&(Array.isArray(o[e.id])?o[e.id]:[o[e.id]]).map((function(t){return l(t,e())}))})),wp.customize("trending_block_visibility",(function(e){return e.bind((function(e){return Object(s.responsiveClassesFor)("trending_block_visibility",document.querySelector(".ct-trending-block"))}))}))}]);
|
framework/extensions/trending/static/js/main.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { onDocumentLoaded } from '../../../cookies-consent/static/js/helpers'
|
| 2 |
+
import ctEvents from 'ct-events'
|
| 3 |
+
import { mount } from './trending-block'
|
| 4 |
+
|
| 5 |
+
const initTrending = () => {
|
| 6 |
+
Array.from(
|
| 7 |
+
document.querySelectorAll('.ct-trending-block [data-page]')
|
| 8 |
+
).map(el => mount(el))
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
onDocumentLoaded(() => {
|
| 12 |
+
initTrending()
|
| 13 |
+
})
|
| 14 |
+
|
| 15 |
+
ctEvents.on('blocksy:frontend:init', () => {
|
| 16 |
+
initTrending()
|
| 17 |
+
})
|
framework/extensions/trending/static/js/sync.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { handleVariablesFor } from 'customizer-sync-helpers'
|
| 2 |
+
import {
|
| 3 |
+
handleBackgroundOptionFor,
|
| 4 |
+
responsiveClassesFor
|
| 5 |
+
} from 'blocksy-customizer-sync'
|
| 6 |
+
|
| 7 |
+
handleVariablesFor({
|
| 8 |
+
trendingBlockContainerSpacing: {
|
| 9 |
+
selector: '.ct-trending-block',
|
| 10 |
+
variable: 'padding',
|
| 11 |
+
responsive: true,
|
| 12 |
+
unit: ''
|
| 13 |
+
},
|
| 14 |
+
|
| 15 |
+
trendingBlockFontColor: [
|
| 16 |
+
{
|
| 17 |
+
selector: '.ct-trending-block',
|
| 18 |
+
variable: 'color',
|
| 19 |
+
type: 'color:default'
|
| 20 |
+
},
|
| 21 |
+
|
| 22 |
+
{
|
| 23 |
+
selector: '.ct-trending-block',
|
| 24 |
+
variable: 'linkHoverColor',
|
| 25 |
+
type: 'color:hover'
|
| 26 |
+
}
|
| 27 |
+
],
|
| 28 |
+
|
| 29 |
+
...handleBackgroundOptionFor({
|
| 30 |
+
id: 'trending_block_background',
|
| 31 |
+
selector: '.ct-trending-block'
|
| 32 |
+
})
|
| 33 |
+
})
|
| 34 |
+
|
| 35 |
+
wp.customize('trending_block_visibility', value =>
|
| 36 |
+
value.bind(to =>
|
| 37 |
+
responsiveClassesFor(
|
| 38 |
+
'trending_block_visibility',
|
| 39 |
+
document.querySelector('.ct-trending-block')
|
| 40 |
+
)
|
| 41 |
+
)
|
| 42 |
+
)
|
framework/extensions/trending/static/js/trending-block.js
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { markImagesAsLoaded } from '../../../cookies-consent/static/js/lazy-load-helpers'
|
| 2 |
+
|
| 3 |
+
const store = {}
|
| 4 |
+
|
| 5 |
+
const cachedFetch = url =>
|
| 6 |
+
store[url]
|
| 7 |
+
? new Promise(resolve => {
|
| 8 |
+
resolve(store[url])
|
| 9 |
+
if (!window.ct_customizer_localizations) {
|
| 10 |
+
store[url] = store[url].clone()
|
| 11 |
+
}
|
| 12 |
+
})
|
| 13 |
+
: new Promise(resolve =>
|
| 14 |
+
fetch(url).then(response => {
|
| 15 |
+
resolve(response)
|
| 16 |
+
|
| 17 |
+
if (!window.ct_customizer_localizations) {
|
| 18 |
+
store[url] = response.clone()
|
| 19 |
+
}
|
| 20 |
+
})
|
| 21 |
+
)
|
| 22 |
+
|
| 23 |
+
const loadPage = (args = {}) => {
|
| 24 |
+
args = {
|
| 25 |
+
el: null,
|
| 26 |
+
// prev | next
|
| 27 |
+
action: null,
|
| 28 |
+
|
| 29 |
+
...args
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
if (!args.el) {
|
| 33 |
+
return
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
if (!args.action) {
|
| 37 |
+
return
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
if (args.el.classList.contains('ct-loading')) {
|
| 41 |
+
return
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
let currentPage = parseInt(args.el.dataset.page, 10)
|
| 45 |
+
|
| 46 |
+
if (args.action === 'prev' && currentPage === 1) {
|
| 47 |
+
return
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
if (args.el.querySelectorAll('.ct-container > a').length < 4) {
|
| 51 |
+
if (currentPage === 1) {
|
| 52 |
+
return
|
| 53 |
+
}
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
if (args.el.dataset.page.indexOf('last') > -1) {
|
| 57 |
+
if (args.action === 'next') {
|
| 58 |
+
return
|
| 59 |
+
}
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
args.el.classList.add('ct-loading')
|
| 63 |
+
|
| 64 |
+
let newPage = args.action === 'prev' ? currentPage - 1 : currentPage + 1
|
| 65 |
+
|
| 66 |
+
Promise.all([
|
| 67 |
+
new Promise(resolve => {
|
| 68 |
+
args.el.classList.add('ct-leave-active')
|
| 69 |
+
requestAnimationFrame(() => {
|
| 70 |
+
args.el.classList.remove('ct-leave-active')
|
| 71 |
+
args.el.classList.add('ct-leave')
|
| 72 |
+
|
| 73 |
+
setTimeout(() => resolve(), 650)
|
| 74 |
+
})
|
| 75 |
+
}),
|
| 76 |
+
|
| 77 |
+
cachedFetch(
|
| 78 |
+
`${ct_localizations.ajax_url}?action=blocksy_get_trending_posts&page=${newPage}`
|
| 79 |
+
).then(response => response.json())
|
| 80 |
+
]).then(([_, { success, data }]) => {
|
| 81 |
+
if (!success) {
|
| 82 |
+
return
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
let {
|
| 86 |
+
posts: { is_last_page, posts }
|
| 87 |
+
} = data
|
| 88 |
+
|
| 89 |
+
args.el.dataset.page = `${newPage}${is_last_page ? ':last' : ''}`
|
| 90 |
+
;[...args.el.querySelectorAll('a')].map(el => el.remove())
|
| 91 |
+
|
| 92 |
+
posts.map(post =>
|
| 93 |
+
args.el.insertAdjacentHTML(
|
| 94 |
+
'beforeend',
|
| 95 |
+
`<a href="${post.url}">
|
| 96 |
+
${post.image}
|
| 97 |
+
<span class="ct-item-title">
|
| 98 |
+
${post.title}
|
| 99 |
+
</span>
|
| 100 |
+
</a>`
|
| 101 |
+
)
|
| 102 |
+
)
|
| 103 |
+
|
| 104 |
+
setTimeout(() => {
|
| 105 |
+
args.el.classList.remove('ct-leave')
|
| 106 |
+
args.el.classList.add('ct-enter-active')
|
| 107 |
+
|
| 108 |
+
requestAnimationFrame(() => {
|
| 109 |
+
args.el.classList.remove('ct-enter-active')
|
| 110 |
+
args.el.classList.add('ct-active')
|
| 111 |
+
|
| 112 |
+
setTimeout(() => {
|
| 113 |
+
args.el.classList.remove('ct-active')
|
| 114 |
+
args.el.classList.remove('ct-loading')
|
| 115 |
+
}, 650)
|
| 116 |
+
})
|
| 117 |
+
}, 50)
|
| 118 |
+
|
| 119 |
+
markImagesAsLoaded(args.el)
|
| 120 |
+
})
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
export const mount = el => {
|
| 124 |
+
if (el.hasListeners) {
|
| 125 |
+
return
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
el.hasListeners = true
|
| 129 |
+
|
| 130 |
+
el.querySelector('.ct-arrow-left').addEventListener('click', e => {
|
| 131 |
+
e.preventDefault()
|
| 132 |
+
loadPage({ el, action: 'prev' })
|
| 133 |
+
})
|
| 134 |
+
|
| 135 |
+
el.querySelector('.ct-arrow-right').addEventListener('click', e => {
|
| 136 |
+
e.preventDefault()
|
| 137 |
+
loadPage({ el, action: 'next' })
|
| 138 |
+
})
|
| 139 |
+
}
|
framework/extensions/trending/static/sass/main.scss
ADDED
|
File without changes
|
framework/extensions/widgets/static/bundle/main.css
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
/**
|
| 2 |
-
* - v1.
|
| 3 |
*
|
| 4 |
-
* Copyright (c)
|
| 5 |
* Licensed GPLv2+
|
| 6 |
*/
|
| 7 |
|
| 8 |
-
.ct-posts-widget ul
|
| 1 |
/**
|
| 2 |
+
* - v1.7.32
|
| 3 |
*
|
| 4 |
+
* Copyright (c) 2020
|
| 5 |
* Licensed GPLv2+
|
| 6 |
*/
|
| 7 |
|
| 8 |
+
.ct-posts-widget ul{--listItemSpacing: 20px}.ct-posts-widget ul a{display:var(--display, grid)}.ct-posts-widget ul .ct-image-container{align-self:start}.ct-posts-widget ul .ct-entry-content{align-self:center}.ct-posts-widget ul .ct-post-title{--fontSize: 15px;--lineHeight: 1.5;--fontWeight: 500;word-break:break-word}.ct-posts-widget ul .ct-entry-excerpt{margin-top:5px;font-size:13px;color:var(--color)}.ct-posts-widget ul .ct-entry-meta{color:var(--color)}.ct-posts-widget ul .ct-entry-meta span:not(:last-child):after{content:'/';margin:0 3px}.ct-posts-widget ul[data-type="rounded"] a,.ct-posts-widget ul[data-type="large-small"] a,.ct-posts-widget ul[data-type="small-thumbs"] a{grid-template-columns:25% 1fr;grid-column-gap:20px}.ct-posts-widget ul[data-type="no-thumbs"] a{--display: block}.ct-posts-widget ul[data-type="large-thumbs"]{--listItemSpacing: 25px}.ct-posts-widget ul[data-type="large-thumbs"] a{--display: block}.ct-posts-widget ul[data-type="large-thumbs"] a .ct-image-container{margin-bottom:12px}.ct-posts-widget ul[data-type="large-thumbs"] a .ct-post-title{--fontSize: 17px;--fontWeight: 600}.ct-posts-widget ul[data-type="large-small"] li:first-child{--listItemSpacing: 30px}.ct-posts-widget ul[data-type="large-small"] li:first-child a{--display: block}.ct-posts-widget ul[data-type="large-small"] li:first-child a .ct-image-container{margin-bottom:20px}.ct-posts-widget ul[data-type="large-small"] li:first-child a .ct-post-title{--fontSize: 17px;--fontWeight: 600}.ct-posts-widget ul[data-type="rounded"] .ct-image-container{overflow:hidden;border-radius:100%;-webkit-mask-image:-webkit-radial-gradient(white, black)}.ct-posts-widget ul[data-type="numbered"]{counter-reset:ct-counter}.ct-posts-widget ul[data-type="numbered"] a{grid-template-columns:34px 1fr;grid-column-gap:15px}.ct-posts-widget ul[data-type="numbered"] a:before{counter-increment:ct-counter;content:counter(ct-counter);display:flex;align-items:center;justify-content:center;width:34px;height:34px;font-size:12px;font-weight:700;border-radius:100%;border:1px solid #E5E5E5;transition:var(--transition)}.ct-posts-widget ul[data-type="numbered"] a:hover:before{color:#fff;border-color:var(--paletteColor1);background:var(--paletteColor1)}.ct-posts-widget ul[data-type="numbered"] .ct-post-title::before{content:'';display:block;height:0;width:0;margin-top:calc((1 - 1.65) * 0.5em)}.ct-quote-widget{--color: #fff;position:relative;min-height:250px;border-radius:7px;padding:70px 40px 60px 60px !important;background:var(--paletteColor1) !important}.ct-quote-widget:before{position:absolute;top:50px;left:35px;content:"”";font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;font-weight:bold;font-size:200px;line-height:150px;opacity:0.3;width:80px;height:80px;display:flex;justify-content:center;transform:rotate(180deg)}.ct-quote-widget .ct-quote-author{display:grid;grid-template-columns:40px 1fr;grid-column-gap:15px;align-items:center;margin-top:25px;--fontWeight: 500}.ct-quote-widget .ct-quote-author figure{max-width:40px;border-radius:100%}.ct-about-me-widget figure{margin-bottom:15px}.ct-about-me-widget figure[data-size="small"]{max-width:90px}.ct-about-me-widget figure[data-size="medium"]{max-width:140px}.ct-about-me-widget figure[data-shape="square"]{border-radius:2px}.ct-about-me-widget figure[data-shape="rounded"]{border-radius:100%}.ct-about-me-widget .ct-about-me-name{display:flex;flex-direction:column}.ct-about-me-widget .ct-about-me-name:not(:last-child){margin-bottom:15px}.ct-about-me-widget .ct-about-me-text:not(:last-child){margin-bottom:25px}.ct-about-me-widget .ct-about-me-link{font-size:13px;font-weight:normal}.ct-about-me-widget [data-alignment="center"]{text-align:center}.ct-about-me-widget [data-alignment="center"] .ct-social-box{justify-content:center}.ct-about-me-widget [data-alignment="right"]{text-align:right}.ct-about-me-widget [data-alignment="right"] .ct-social-box{justify-content:flex-end}.ct-about-me-widget [data-type="bordered"]{padding:35px 25px;border-radius:7px;background:#fff;border:1px dashed rgba(0,0,0,0.1)}.ct-facebook-like-box{overflow:hidden;--fbHeader: 0px;--fbFacepile: 0px}.ct-facebook-like-box .fb-page{display:flex;justify-content:center}.ct-facebook-like-box .fb-page[data-small-header="false"]{--fbHeader: 130px}.ct-facebook-like-box .fb-page[data-small-header="true"]{--fbHeader: 70px}.ct-facebook-like-box .fb-page[data-show-facepile="true"]{--fbFacepile: 84px}.ct-facebook-like-box .fb-page:not([data-tabs="timeline"]){min-height:calc(var(--fbHeader) + var(--fbFacepile))}.ct-facebook-like-box .fb-page[data-tabs="timeline"]{min-height:500px}.ct-facebook-like-box iframe{max-width:500px;margin:0 auto}[class*="ct-contact-info"] ul{--contentSpacing: 0}[class*="ct-contact-info"] li{display:grid;grid-template-columns:auto 1fr;grid-column-gap:15px;align-items:center}[class*="ct-contact-info"] .contact-info{display:flex;flex-direction:column;color:var(--color)}[class*="ct-contact-info"] .contact-title{font-weight:600}[class*="ct-contact-info"] .ct-contact-info-text{margin-bottom:20px}.ct-contact-info-widget{--listItemSpacing: 20px}.ct-contact-info-widget .contact-info{font-size:15px;line-height:1.4}.ct-socials-widget [data-icons-type*="solid"],.ct-about-me-widget [data-icons-type*="solid"],.ct-contact-info-widget [data-icons-type*="solid"]{--icon-color: rgba(100, 110, 119, 1);--icon-hover-color: #fff;--background-color: rgba(218, 222, 228, 0.3);--background-hover-color: var(--paletteColor1)}.ct-socials-widget [data-icons-type*="outline"],.ct-about-me-widget [data-icons-type*="outline"],.ct-contact-info-widget [data-icons-type*="outline"]{--icon-color: rgba(100, 110, 119, 1);--icon-hover-color: var(--paletteColor1);--background-color: rgba(218, 222, 228, 1);--background-hover-color: var(--paletteColor1)}
|
framework/extensions/widgets/static/sass/about-me.scss
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.ct-about-me-widget {
|
| 2 |
+
|
| 3 |
+
figure {
|
| 4 |
+
margin-bottom: 15px;
|
| 5 |
+
|
| 6 |
+
&[data-size="small"] {
|
| 7 |
+
max-width: 90px;
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
&[data-size="medium"] {
|
| 11 |
+
max-width: 140px;
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
&[data-shape="square"] {
|
| 15 |
+
border-radius: 2px;
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
&[data-shape="rounded"] {
|
| 19 |
+
border-radius: 100%;
|
| 20 |
+
}
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
.ct-about-me-name {
|
| 24 |
+
display: flex;
|
| 25 |
+
flex-direction: column;
|
| 26 |
+
|
| 27 |
+
&:not(:last-child) {
|
| 28 |
+
margin-bottom: 15px;
|
| 29 |
+
}
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
.ct-about-me-text {
|
| 33 |
+
&:not(:last-child) {
|
| 34 |
+
margin-bottom: 25px;
|
| 35 |
+
}
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
.ct-about-me-link {
|
| 39 |
+
font-size: 13px;
|
| 40 |
+
font-weight: normal;
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
// alignment
|
| 44 |
+
[data-alignment="center"] {
|
| 45 |
+
text-align: center;
|
| 46 |
+
|
| 47 |
+
.ct-social-box {
|
| 48 |
+
justify-content: center;
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
[data-alignment="right"] {
|
| 53 |
+
text-align: right;
|
| 54 |
+
|
| 55 |
+
.ct-social-box {
|
| 56 |
+
justify-content: flex-end;
|
| 57 |
+
}
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
// bordered
|
| 61 |
+
[data-type="bordered"] {
|
| 62 |
+
padding: 35px 25px;
|
| 63 |
+
border-radius: 7px;
|
| 64 |
+
background: #fff;
|
| 65 |
+
border: 1px dashed rgba(0, 0, 0, 0.1);
|
| 66 |
+
}
|
| 67 |
+
}
|
framework/extensions/widgets/static/sass/contact-info.scss
CHANGED
|
@@ -1,45 +1,38 @@
|
|
| 1 |
-
|
| 2 |
|
| 3 |
ul {
|
| 4 |
-
|
| 5 |
-
margin-top: 30px;
|
| 6 |
-
|
| 7 |
-
li {
|
| 8 |
-
display: flex;
|
| 9 |
-
align-items: center;
|
| 10 |
-
margin-bottom: 20px;
|
| 11 |
-
}
|
| 12 |
}
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
}
|
| 20 |
}
|
| 21 |
|
| 22 |
.contact-info {
|
| 23 |
display: flex;
|
| 24 |
flex-direction: column;
|
|
|
|
| 25 |
}
|
| 26 |
|
| 27 |
.contact-title {
|
| 28 |
font-weight: 600;
|
| 29 |
}
|
| 30 |
|
| 31 |
-
|
| 32 |
-
|
|
|
|
|
|
|
| 33 |
|
| 34 |
-
i {
|
| 35 |
-
background: rgba(218, 222, 228, 0.3);
|
| 36 |
-
transition: color 0.12s cubic-bezier(0.455, 0.03, 0.515, 0.955),
|
| 37 |
-
background 0.12s cubic-bezier(0.455, 0.03, 0.515, 0.955);
|
| 38 |
-
}
|
| 39 |
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
| 44 |
}
|
| 45 |
}
|
| 1 |
+
[class*="ct-contact-info"] {
|
| 2 |
|
| 3 |
ul {
|
| 4 |
+
--contentSpacing: 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
}
|
| 6 |
|
| 7 |
+
li {
|
| 8 |
+
display: grid;
|
| 9 |
+
grid-template-columns: auto 1fr;
|
| 10 |
+
grid-column-gap: 15px;
|
| 11 |
+
align-items: center;
|
|
|
|
| 12 |
}
|
| 13 |
|
| 14 |
.contact-info {
|
| 15 |
display: flex;
|
| 16 |
flex-direction: column;
|
| 17 |
+
color: var(--color);
|
| 18 |
}
|
| 19 |
|
| 20 |
.contact-title {
|
| 21 |
font-weight: 600;
|
| 22 |
}
|
| 23 |
|
| 24 |
+
.ct-contact-info-text {
|
| 25 |
+
margin-bottom: 20px;
|
| 26 |
+
}
|
| 27 |
+
}
|
| 28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
+
// widget
|
| 31 |
+
.ct-contact-info-widget {
|
| 32 |
+
--listItemSpacing: 20px;
|
| 33 |
+
|
| 34 |
+
.contact-info {
|
| 35 |
+
font-size: 15px;
|
| 36 |
+
line-height: 1.4;
|
| 37 |
}
|
| 38 |
}
|
framework/extensions/widgets/static/sass/facebook.scss
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.ct-facebook-like-box {
|
| 2 |
+
overflow: hidden;
|
| 3 |
+
|
| 4 |
+
--fbHeader: 0px;
|
| 5 |
+
--fbFacepile: 0px;
|
| 6 |
+
|
| 7 |
+
.fb-page {
|
| 8 |
+
display: flex;
|
| 9 |
+
justify-content: center;
|
| 10 |
+
|
| 11 |
+
&[data-small-header="false"] {
|
| 12 |
+
--fbHeader: 130px;
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
&[data-small-header="true"] {
|
| 16 |
+
--fbHeader: 70px;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
&[data-show-facepile="true"] {
|
| 20 |
+
--fbFacepile: 84px;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
&:not([data-tabs="timeline"]) {
|
| 24 |
+
min-height: calc(var(--fbHeader) + var(--fbFacepile));
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
&[data-tabs="timeline"] {
|
| 28 |
+
min-height: 500px;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
iframe {
|
| 34 |
+
max-width: 500px;
|
| 35 |
+
margin: 0 auto;
|
| 36 |
+
}
|
| 37 |
+
}
|
framework/extensions/widgets/static/sass/main.scss
CHANGED
|
@@ -1,4 +1,8 @@
|
|
| 1 |
@import '../../../../../static/sass/common-frontend';
|
| 2 |
|
| 3 |
@import 'posts';
|
|
|
|
|
|
|
|
|
|
| 4 |
@import 'contact-info';
|
|
|
| 1 |
@import '../../../../../static/sass/common-frontend';
|
| 2 |
|
| 3 |
@import 'posts';
|
| 4 |
+
@import 'quote';
|
| 5 |
+
@import 'about-me';
|
| 6 |
+
@import 'facebook';
|
| 7 |
@import 'contact-info';
|
| 8 |
+
@import 'social-icons';
|
framework/extensions/widgets/static/sass/posts.scss
CHANGED
|
@@ -1,49 +1,132 @@
|
|
| 1 |
-
.ct-posts-widget {
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
.ct-image-container {
|
| 8 |
-
|
|
|
|
| 9 |
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
}
|
| 20 |
|
| 21 |
-
.ct-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
display: flex;
|
| 23 |
-
|
| 24 |
justify-content: center;
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
word-break: break-word;
|
| 33 |
-
@include lhCrop(1.65);
|
| 34 |
-
}
|
| 35 |
}
|
| 36 |
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
margin: 0 3px;
|
| 43 |
-
}
|
| 44 |
-
}
|
| 45 |
}
|
| 46 |
}
|
| 47 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
}
|
| 49 |
-
}
|
| 1 |
+
.ct-posts-widget ul {
|
| 2 |
+
--listItemSpacing: 20px;
|
| 3 |
+
|
| 4 |
+
a {
|
| 5 |
+
display: var(--display, grid);
|
| 6 |
+
}
|
| 7 |
+
|
| 8 |
+
.ct-image-container {
|
| 9 |
+
align-self: start;
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
.ct-entry-content {
|
| 13 |
+
align-self: center;
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
.ct-post-title {
|
| 17 |
+
--fontSize: 15px;
|
| 18 |
+
--lineHeight: 1.5;
|
| 19 |
+
--fontWeight: 500;
|
| 20 |
+
word-break: break-word;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
.ct-entry-excerpt {
|
| 24 |
+
margin-top: 5px;
|
| 25 |
+
font-size: 13px;
|
| 26 |
+
color: var(--color);
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
.ct-entry-meta {
|
| 30 |
+
color: var(--color);
|
| 31 |
+
|
| 32 |
+
span:not(:last-child) {
|
| 33 |
+
&:after {
|
| 34 |
+
content: '/';
|
| 35 |
+
margin: 0 3px;
|
| 36 |
+
}
|
| 37 |
+
}
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
&[data-type="rounded"],
|
| 42 |
+
&[data-type="large-small"],
|
| 43 |
+
&[data-type="small-thumbs"] {
|
| 44 |
+
a {
|
| 45 |
+
grid-template-columns: 25% 1fr;
|
| 46 |
+
grid-column-gap: 20px;
|
| 47 |
+
}
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
&[data-type="no-thumbs"] a {
|
| 52 |
+
--display: block;
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
&[data-type="large-thumbs"] {
|
| 56 |
+
--listItemSpacing: 25px;
|
| 57 |
+
|
| 58 |
+
a {
|
| 59 |
+
--display: block;
|
| 60 |
|
| 61 |
.ct-image-container {
|
| 62 |
+
margin-bottom: 12px;
|
| 63 |
+
}
|
| 64 |
|
| 65 |
+
.ct-post-title {
|
| 66 |
+
--fontSize: 17px;
|
| 67 |
+
--fontWeight: 600;
|
| 68 |
+
}
|
| 69 |
+
}
|
| 70 |
+
}
|
| 71 |
|
| 72 |
+
&[data-type="large-small"] li:first-child {
|
| 73 |
+
--listItemSpacing: 30px;
|
| 74 |
+
|
| 75 |
+
a {
|
| 76 |
+
--display: block;
|
| 77 |
+
|
| 78 |
+
.ct-image-container {
|
| 79 |
+
margin-bottom: 20px;
|
| 80 |
}
|
| 81 |
|
| 82 |
+
.ct-post-title {
|
| 83 |
+
--fontSize: 17px;
|
| 84 |
+
--fontWeight: 600;
|
| 85 |
+
}
|
| 86 |
+
}
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
&[data-type="rounded"] {
|
| 90 |
+
.ct-image-container {
|
| 91 |
+
overflow: hidden;
|
| 92 |
+
border-radius: 100%;
|
| 93 |
+
-webkit-mask-image: -webkit-radial-gradient(white, black);
|
| 94 |
+
}
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
&[data-type="numbered"] {
|
| 98 |
+
counter-reset: ct-counter;
|
| 99 |
+
|
| 100 |
+
a {
|
| 101 |
+
grid-template-columns: 34px 1fr;
|
| 102 |
+
grid-column-gap: 15px;
|
| 103 |
+
|
| 104 |
+
&:before {
|
| 105 |
+
counter-increment: ct-counter;
|
| 106 |
+
content: counter(ct-counter);
|
| 107 |
display: flex;
|
| 108 |
+
align-items: center;
|
| 109 |
justify-content: center;
|
| 110 |
+
width: 34px;
|
| 111 |
+
height: 34px;
|
| 112 |
+
font-size: 12px;
|
| 113 |
+
font-weight: 700;
|
| 114 |
+
border-radius: 100%;
|
| 115 |
+
border: 1px solid #E5E5E5;
|
| 116 |
+
transition: var(--transition);
|
|
|
|
|
|
|
|
|
|
| 117 |
}
|
| 118 |
|
| 119 |
+
&:hover {
|
| 120 |
+
&:before {
|
| 121 |
+
color: #fff;
|
| 122 |
+
border-color: var(--paletteColor1);
|
| 123 |
+
background: var(--paletteColor1);
|
|
|
|
|
|
|
|
|
|
| 124 |
}
|
| 125 |
}
|
| 126 |
}
|
| 127 |
+
|
| 128 |
+
.ct-post-title {
|
| 129 |
+
@include lhCrop(1.65);
|
| 130 |
+
}
|
| 131 |
}
|
| 132 |
+
}
|
framework/extensions/widgets/static/sass/quote.scss
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.ct-quote-widget {
|
| 2 |
+
--color: #fff;
|
| 3 |
+
position: relative;
|
| 4 |
+
min-height: 250px;
|
| 5 |
+
border-radius: 7px;
|
| 6 |
+
padding: 70px 40px 60px 60px !important;
|
| 7 |
+
background: var(--paletteColor1) !important;
|
| 8 |
+
|
| 9 |
+
&:before {
|
| 10 |
+
position: absolute;
|
| 11 |
+
top: 50px;
|
| 12 |
+
left: 35px;
|
| 13 |
+
content: "”";
|
| 14 |
+
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
| 15 |
+
font-weight: bold;
|
| 16 |
+
font-size: 200px;
|
| 17 |
+
line-height: 150px;
|
| 18 |
+
opacity: 0.3;
|
| 19 |
+
width: 80px;
|
| 20 |
+
height: 80px;
|
| 21 |
+
display: flex;
|
| 22 |
+
justify-content: center;
|
| 23 |
+
transform: rotate(180deg);
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
.ct-quote-author {
|
| 27 |
+
display: grid;
|
| 28 |
+
grid-template-columns: 40px 1fr;
|
| 29 |
+
grid-column-gap: 15px;
|
| 30 |
+
align-items: center;
|
| 31 |
+
margin-top: 25px;
|
| 32 |
+
--fontWeight: 500;
|
| 33 |
+
|
| 34 |
+
figure {
|
| 35 |
+
max-width: 40px;
|
| 36 |
+
border-radius: 100%;
|
| 37 |
+
}
|
| 38 |
+
}
|
| 39 |
+
}
|
framework/extensions/widgets/static/sass/social-icons.scss
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.ct-socials-widget,
|
| 2 |
+
.ct-about-me-widget,
|
| 3 |
+
.ct-contact-info-widget {
|
| 4 |
+
|
| 5 |
+
// [data-icons-type*="simple"] {
|
| 6 |
+
// --icon-color: rgba(100, 110, 119, 1);
|
| 7 |
+
// --icon-hover-color: var(--paletteColor1);
|
| 8 |
+
// }
|
| 9 |
+
|
| 10 |
+
[data-icons-type*="solid"] {
|
| 11 |
+
--icon-color: rgba(100, 110, 119, 1);
|
| 12 |
+
--icon-hover-color: #fff;
|
| 13 |
+
--background-color: rgba(218, 222, 228, 0.3);
|
| 14 |
+
--background-hover-color: var(--paletteColor1);
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
[data-icons-type*="outline"] {
|
| 18 |
+
--icon-color: rgba(100, 110, 119, 1);
|
| 19 |
+
--icon-hover-color: var(--paletteColor1);
|
| 20 |
+
--background-color: rgba(218, 222, 228, 1);
|
| 21 |
+
--background-hover-color: var(--paletteColor1);
|
| 22 |
+
}
|
| 23 |
+
}
|
framework/extensions/widgets/widgets/ct-about-me/helpers.php
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
function blc_get_user_choices() {
|
| 4 |
+
global $wpdb;
|
| 5 |
+
|
| 6 |
+
$wp_user_search = $wpdb->get_results(
|
| 7 |
+
"SELECT ID, display_name FROM $wpdb->users ORDER BY ID"
|
| 8 |
+
);
|
| 9 |
+
|
| 10 |
+
$result = [];
|
| 11 |
+
|
| 12 |
+
foreach ($wp_user_search as $userid) {
|
| 13 |
+
$user_id = (int) $userid->ID;
|
| 14 |
+
$result[$user_id] = $userid->display_name;
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
return $result;
|
| 18 |
+
}
|
framework/extensions/widgets/widgets/ct-about-me/options.php
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* About me widget
|
| 4 |
+
*
|
| 5 |
+
* @copyright 2019-present Creative Themes
|
| 6 |
+
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
|
| 7 |
+
* @package Blocksy
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
require_once dirname( __FILE__ ) . '/helpers.php';
|
| 11 |
+
|
| 12 |
+
$options = [
|
| 13 |
+
'title' => [
|
| 14 |
+
'type' => 'text',
|
| 15 |
+
'label' => __( 'Title', 'blc' ),
|
| 16 |
+
'field_attr' => [ 'id' => 'widget-title' ],
|
| 17 |
+
'design' => 'inline',
|
| 18 |
+
'value' => __( 'About me', 'blc' ),
|
| 19 |
+
'disableRevertButton' => true,
|
| 20 |
+
],
|
| 21 |
+
|
| 22 |
+
'about_type' => [
|
| 23 |
+
'label' => __( 'Type', 'blc' ),
|
| 24 |
+
'type' => 'ct-radio',
|
| 25 |
+
'value' => 'simple',
|
| 26 |
+
'view' => 'radio',
|
| 27 |
+
'design' => 'inline',
|
| 28 |
+
'inline' => true,
|
| 29 |
+
'disableRevertButton' => true,
|
| 30 |
+
'choices' => [
|
| 31 |
+
'simple' => __( 'Simple', 'blc' ),
|
| 32 |
+
'bordered' => __( 'Boxed', 'blc' ),
|
| 33 |
+
],
|
| 34 |
+
],
|
| 35 |
+
|
| 36 |
+
'about_source' => [
|
| 37 |
+
'label' => __( 'Source', 'blc' ),
|
| 38 |
+
'type' => 'ct-radio',
|
| 39 |
+
'value' => 'from_wp',
|
| 40 |
+
'view' => 'radio',
|
| 41 |
+
'design' => 'inline',
|
| 42 |
+
'inline' => true,
|
| 43 |
+
'disableRevertButton' => true,
|
| 44 |
+
'choices' => [
|
| 45 |
+
'from_wp' => __( 'From WP', 'blc' ),
|
| 46 |
+
'custom' => __( 'Custom', 'blc' ),
|
| 47 |
+
],
|
| 48 |
+
],
|
| 49 |
+
|
| 50 |
+
blocksy_rand_md5() => [
|
| 51 |
+
'type' => 'ct-condition',
|
| 52 |
+
'condition' => [ 'about_source' => 'from_wp' ],
|
| 53 |
+
'options' => [
|
| 54 |
+
|
| 55 |
+
'wp_user' => [
|
| 56 |
+
'type' => 'ct-select',
|
| 57 |
+
'label' => __( 'User', 'blc' ),
|
| 58 |
+
'value' => array_keys(blc_get_user_choices())[0],
|
| 59 |
+
'design' => 'inline',
|
| 60 |
+
'choices' => blocksy_ordered_keys(blc_get_user_choices()),
|
| 61 |
+
],
|
| 62 |
+
|
| 63 |
+
]
|
| 64 |
+
],
|
| 65 |
+
|
| 66 |
+
blocksy_rand_md5() => [
|
| 67 |
+
'type' => 'ct-condition',
|
| 68 |
+
'condition' => [ 'about_source' => 'custom' ],
|
| 69 |
+
'options' => [
|
| 70 |
+
|
| 71 |
+
'about_avatar' => [
|
| 72 |
+
'label' => __('Avatar', 'blc'),
|
| 73 |
+
'type' => 'ct-image-uploader',
|
| 74 |
+
'design' => 'inline',
|
| 75 |
+
'value' => [ 'attachment_id' => null ],
|
| 76 |
+
'attr' => [ 'data-type' => 'no-frame' ],
|
| 77 |
+
],
|
| 78 |
+
|
| 79 |
+
'about_name' => [
|
| 80 |
+
'type' => 'text',
|
| 81 |
+
'label' => __( 'Name', 'blc' ),
|
| 82 |
+
'field_attr' => [ 'id' => 'widget-title' ],
|
| 83 |
+
'design' => 'inline',
|
| 84 |
+
'value' => __( 'John Doe', 'blc' ),
|
| 85 |
+
'disableRevertButton' => true,
|
| 86 |
+
],
|
| 87 |
+
|
| 88 |
+
'about_text' => [
|
| 89 |
+
'label' => __( 'Description', 'blc' ),
|
| 90 |
+
'type' => 'textarea',
|
| 91 |
+
'value' => '',
|
| 92 |
+
'design' => 'inline',
|
| 93 |
+
'disableRevertButton' => true,
|
| 94 |
+
],
|
| 95 |
+
],
|
| 96 |
+
],
|
| 97 |
+
|
| 98 |
+
'about_avatar_size' => [
|
| 99 |
+
'type' => 'text',
|
| 100 |
+
'label' => __( 'Avatar Size', 'blc' ),
|
| 101 |
+
'design' => 'inline',
|
| 102 |
+
'value' => 75,
|
| 103 |
+
'disableRevertButton' => true,
|
| 104 |
+
],
|
| 105 |
+
|
| 106 |
+
'about_avatar_size' => [
|
| 107 |
+
'label' => __( 'Avatar Size', 'blc' ),
|
| 108 |
+
'type' => 'ct-select',
|
| 109 |
+
'value' => 'small',
|
| 110 |
+
'design' => 'inline',
|
| 111 |
+
'disableRevertButton' => true,
|
| 112 |
+
'choices' => [
|
| 113 |
+
'small' => __( 'Small', 'blc' ),
|
| 114 |
+
'medium' => __( 'Medium', 'blc' ),
|
| 115 |
+
'large' => __( 'Large', 'blc' ),
|
| 116 |
+
],
|
| 117 |
+
],
|
| 118 |
+
|
| 119 |
+
'avatar_shape' => [
|
| 120 |
+
'label' => __( 'Avatar Shape', 'blc' ),
|
| 121 |
+
'type' => 'ct-radio',
|
| 122 |
+
'value' => 'rounded',
|
| 123 |
+
'view' => 'radio',
|
| 124 |
+
'design' => 'inline',
|
| 125 |
+
'inline' => true,
|
| 126 |
+
'disableRevertButton' => true,
|
| 127 |
+
'choices' => [
|
| 128 |
+
'rounded' => __( 'Rounded', 'blc' ),
|
| 129 |
+
'square' => __( 'Square', 'blc' ),
|
| 130 |
+
],
|
| 131 |
+
],
|
| 132 |
+
|
| 133 |
+
'about_alignment' => [
|
| 134 |
+
'type' => 'ct-radio',
|
| 135 |
+
'label' => __( 'Alignment', 'blocksy' ),
|
| 136 |
+
'value' => 'center',
|
| 137 |
+
'view' => 'text',
|
| 138 |
+
'attr' => [ 'data-type' => 'alignment' ],
|
| 139 |
+
'disableRevertButton' => true,
|
| 140 |
+
'design' => 'inline',
|
| 141 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 142 |
+
'choices' => [
|
| 143 |
+
'left' => '',
|
| 144 |
+
'center' => '',
|
| 145 |
+
'right' => '',
|
| 146 |
+
],
|
| 147 |
+
],
|
| 148 |
+
|
| 149 |
+
'about_socials' => [
|
| 150 |
+
'type' => 'ct-layers',
|
| 151 |
+
'label' => __( 'Social Channels', 'blc' ),
|
| 152 |
+
'manageable' => true,
|
| 153 |
+
'desc' => sprintf(
|
| 154 |
+
__( 'You can configure social URLs in %s.', 'blc' ),
|
| 155 |
+
sprintf(
|
| 156 |
+
'<a href="%s" target="_blank">%s</a>',
|
| 157 |
+
admin_url('/customize.php?autofocus[section]=social_accounts'),
|
| 158 |
+
__('Customizer', 'blc')
|
| 159 |
+
)
|
| 160 |
+
),
|
| 161 |
+
'value' => [
|
| 162 |
+
[
|
| 163 |
+
'id' => 'facebook',
|
| 164 |
+
'enabled' => true,
|
| 165 |
+
],
|
| 166 |
+
|
| 167 |
+
[
|
| 168 |
+
'id' => 'twitter',
|
| 169 |
+
'enabled' => true,
|
| 170 |
+
],
|
| 171 |
+
|
| 172 |
+
[
|
| 173 |
+
'id' => 'instagram',
|
| 174 |
+
'enabled' => true,
|
| 175 |
+
],
|
| 176 |
+
],
|
| 177 |
+
|
| 178 |
+
'settings' => blc_call_fn(
|
| 179 |
+
[
|
| 180 |
+
'fn' => 'blocksy_get_social_networks_list',
|
| 181 |
+
'default' => []
|
| 182 |
+
]
|
| 183 |
+
)
|
| 184 |
+
],
|
| 185 |
+
|
| 186 |
+
'about_social_icons_size' => [
|
| 187 |
+
'label' => __( 'Icons Size', 'blc' ),
|
| 188 |
+
'type' => 'ct-radio',
|
| 189 |
+
'value' => 'small',
|
| 190 |
+
'view' => 'text',
|
| 191 |
+
'design' => 'block',
|
| 192 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 193 |
+
'choices' => [
|
| 194 |
+
'small' => __( 'Small', 'blc' ),
|
| 195 |
+
'medium' => __( 'Medium', 'blc' ),
|
| 196 |
+
'large' => __( 'Large', 'blc' ),
|
| 197 |
+
],
|
| 198 |
+
],
|
| 199 |
+
|
| 200 |
+
'about_social_type' => [
|
| 201 |
+
'label' => __( 'Icons Shape Type', 'blc' ),
|
| 202 |
+
'type' => 'ct-radio',
|
| 203 |
+
'value' => 'rounded',
|
| 204 |
+
'view' => 'text',
|
| 205 |
+
'design' => 'block',
|
| 206 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 207 |
+
'choices' => [
|
| 208 |
+
'simple' => __( 'None', 'blc' ),
|
| 209 |
+
'rounded' => __( 'Rounded', 'blc' ),
|
| 210 |
+
'square' => __( 'Square', 'blc' ),
|
| 211 |
+
],
|
| 212 |
+
],
|
| 213 |
+
|
| 214 |
+
blocksy_rand_md5() => [
|
| 215 |
+
'type' => 'ct-condition',
|
| 216 |
+
'condition' => [ 'about_social_type' => '!simple' ],
|
| 217 |
+
'options' => [
|
| 218 |
+
|
| 219 |
+
'about_social_icons_fill' => [
|
| 220 |
+
'label' => __( 'Shape Fill Type', 'blc' ),
|
| 221 |
+
'type' => 'ct-radio',
|
| 222 |
+
'value' => 'outline',
|
| 223 |
+
'view' => 'text',
|
| 224 |
+
'design' => 'block',
|
| 225 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 226 |
+
'choices' => [
|
| 227 |
+
'solid' => __( 'Solid', 'blc' ),
|
| 228 |
+
'outline' => __( 'Outline', 'blc' ),
|
| 229 |
+
],
|
| 230 |
+
],
|
| 231 |
+
|
| 232 |
+
],
|
| 233 |
+
],
|
| 234 |
+
|
| 235 |
+
];
|
framework/extensions/widgets/widgets/ct-about-me/view.php
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* About me widget
|
| 4 |
+
*
|
| 5 |
+
* @copyright 2019-present Creative Themes
|
| 6 |
+
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
|
| 7 |
+
* @package Blocksy
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
// Widget title
|
| 12 |
+
$title = blocksy_default_akg( 'title', $atts, __( 'About me', 'blc' ) );
|
| 13 |
+
|
| 14 |
+
$about_source = blocksy_default_akg('about_source', $atts, 'from_wp');
|
| 15 |
+
$about_type = blocksy_default_akg('about_type', $atts, 'simple');
|
| 16 |
+
$alignment = blocksy_default_akg('about_alignment', $atts, 'center');
|
| 17 |
+
$avatar_size = blocksy_default_akg('about_avatar_size', $atts, 'small');
|
| 18 |
+
$avatar_shape = blocksy_default_akg('avatar_shape', $atts, 'rounded');
|
| 19 |
+
|
| 20 |
+
$sizes = [
|
| 21 |
+
'small' => 90,
|
| 22 |
+
'medium' => 140,
|
| 23 |
+
'large' => 200
|
| 24 |
+
];
|
| 25 |
+
|
| 26 |
+
$user_id = blocksy_akg('wp_user', $atts, null);
|
| 27 |
+
|
| 28 |
+
$image_output = blc_call_fn(['fn' => 'blocksy_image'], [
|
| 29 |
+
'attachment_id' => blocksy_default_akg('about_avatar/attachment_id', $atts, null),
|
| 30 |
+
'ratio' => '1/1',
|
| 31 |
+
'tag_name' => 'figure',
|
| 32 |
+
'size' => $avatar_size === 'small' ? 'thumb' : 'medium',
|
| 33 |
+
// 'lazyload' => false,
|
| 34 |
+
'html_atts' => [
|
| 35 |
+
'data-size' => $avatar_size,
|
| 36 |
+
'data-shape' => $avatar_shape,
|
| 37 |
+
]
|
| 38 |
+
]);
|
| 39 |
+
|
| 40 |
+
$about_name = blocksy_default_akg('about_name', $atts, __('John Doe', 'blc'));
|
| 41 |
+
$about_text = blocksy_default_akg('about_text', $atts, '');
|
| 42 |
+
|
| 43 |
+
if ($about_source === 'from_wp') {
|
| 44 |
+
if (! $user_id) {
|
| 45 |
+
require_once dirname( __FILE__ ) . '/helpers.php';
|
| 46 |
+
$user_id = array_keys(blc_get_user_choices())[0];
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
$image_output = blc_call_fn(
|
| 50 |
+
['fn' => 'blocksy_simple_image'],
|
| 51 |
+
get_avatar_url($user_id, [
|
| 52 |
+
/*
|
| 53 |
+
'size' => intval(
|
| 54 |
+
blocksy_default_akg('about_avatar_size', $atts, 75)
|
| 55 |
+
)
|
| 56 |
+
*/
|
| 57 |
+
'size' => $sizes[$avatar_size] * 2
|
| 58 |
+
]),
|
| 59 |
+
[
|
| 60 |
+
'tag_name' => 'figure',
|
| 61 |
+
'ratio' => '1/1',
|
| 62 |
+
'html_atts' => [
|
| 63 |
+
'data-size' => $avatar_size,
|
| 64 |
+
'data-shape' => $avatar_shape,
|
| 65 |
+
// 'style' => 'max-width: ' . blocksy_default_akg(
|
| 66 |
+
// 'about_avatar_size', $atts, 75
|
| 67 |
+
// ) . 'px'
|
| 68 |
+
]
|
| 69 |
+
]
|
| 70 |
+
);
|
| 71 |
+
|
| 72 |
+
$about_name = get_the_author_meta('display_name', $user_id);
|
| 73 |
+
$about_text = get_the_author_meta('description', $user_id);
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
$size = blocksy_default_akg('about_social_icons_size', $atts, 'small');
|
| 77 |
+
$type = blocksy_default_akg('about_social_type', $atts, 'rounded');
|
| 78 |
+
$fill = blocksy_default_akg('about_social_icons_fill', $atts, 'outline');
|
| 79 |
+
|
| 80 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
| 81 |
+
echo $before_widget;
|
| 82 |
+
|
| 83 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
| 84 |
+
echo $before_title . wp_kses_post( $title ) . $after_title;
|
| 85 |
+
?>
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
<section
|
| 89 |
+
data-type="<?php echo esc_attr($about_type) ?>"
|
| 90 |
+
data-alignment="<?php echo esc_attr($alignment) ?>">
|
| 91 |
+
|
| 92 |
+
<?php echo $image_output; ?>
|
| 93 |
+
|
| 94 |
+
<h6 class="ct-about-me-name">
|
| 95 |
+
<?php echo $about_name; ?>
|
| 96 |
+
|
| 97 |
+
<?php if ($about_source === 'from_wp') { ?>
|
| 98 |
+
<a href="<?php echo get_author_posts_url($user_id) ?>" class="ct-about-me-link">
|
| 99 |
+
<?php echo __('View Profile', 'blc') ?>
|
| 100 |
+
</a>
|
| 101 |
+
<?php } ?>
|
| 102 |
+
</h6>
|
| 103 |
+
|
| 104 |
+
<div class="ct-about-me-text"><?php echo $about_text; ?></div>
|
| 105 |
+
|
| 106 |
+
<?php
|
| 107 |
+
echo blc_call_fn(
|
| 108 |
+
['fn' => 'blocksy_social_icons'],
|
| 109 |
+
blocksy_default_akg(
|
| 110 |
+
'about_socials',
|
| 111 |
+
$atts,
|
| 112 |
+
[
|
| 113 |
+
[
|
| 114 |
+
'id' => 'facebook',
|
| 115 |
+
'enabled' => true,
|
| 116 |
+
],
|
| 117 |
+
|
| 118 |
+
[
|
| 119 |
+
'id' => 'twitter',
|
| 120 |
+
'enabled' => true,
|
| 121 |
+
],
|
| 122 |
+
|
| 123 |
+
[
|
| 124 |
+
'id' => 'instagram',
|
| 125 |
+
'enabled' => true,
|
| 126 |
+
],
|
| 127 |
+
]
|
| 128 |
+
),
|
| 129 |
+
|
| 130 |
+
[
|
| 131 |
+
'size' => $size,
|
| 132 |
+
'type' => $type,
|
| 133 |
+
'fill' => $fill
|
| 134 |
+
]
|
| 135 |
+
);
|
| 136 |
+
?>
|
| 137 |
+
</section>
|
| 138 |
+
|
| 139 |
+
<?php echo wp_kses_post($after_widget); ?>
|
framework/extensions/widgets/widgets/ct-about-me/widget.php
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* About me widget
|
| 4 |
+
*
|
| 5 |
+
* @copyright 2019-present Creative Themes
|
| 6 |
+
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
|
| 7 |
+
* @package Blocksy
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
class Blocksy_Widget_Ct_About_Me extends BlocksyWidgetFactory {
|
| 11 |
+
protected function get_config() {
|
| 12 |
+
return [
|
| 13 |
+
'name' => __('About Me', 'blc'),
|
| 14 |
+
'description' => __('About me', 'blc'),
|
| 15 |
+
'customize_selective_refresh' => true
|
| 16 |
+
];
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
public function get_path() {
|
| 20 |
+
return dirname(__FILE__);
|
| 21 |
+
}
|
| 22 |
+
}
|
framework/extensions/widgets/widgets/ct-advertisement/view.php
CHANGED
|
@@ -20,10 +20,14 @@ $ad_code = blocksy_default_akg( 'ad_code', $atts, '' );
|
|
| 20 |
// Ad link
|
| 21 |
$ad_link = blocksy_default_akg( 'ad_link', $atts, '' );
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
// Ad link target
|
| 24 |
$ad_link_target = blocksy_default_akg( 'ad_link_target', $atts, 'yes' );
|
| 25 |
|
| 26 |
-
$image_output =
|
| 27 |
'attachment_id' => blocksy_default_akg( 'ad_image/attachment_id', $atts, null ),
|
| 28 |
'ratio' => 'original',
|
| 29 |
'tag_name' => 'a',
|
|
@@ -40,7 +44,9 @@ $image_output = blocksy_image([
|
|
| 40 |
echo $before_widget;
|
| 41 |
|
| 42 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
| 43 |
-
|
|
|
|
|
|
|
| 44 |
|
| 45 |
?>
|
| 46 |
|
|
@@ -52,4 +58,4 @@ echo $before_title . wp_kses_post( $title ) . $after_title;
|
|
| 52 |
} ?>
|
| 53 |
</div>
|
| 54 |
|
| 55 |
-
<?php echo wp_kses_post(
|
| 20 |
// Ad link
|
| 21 |
$ad_link = blocksy_default_akg( 'ad_link', $atts, '' );
|
| 22 |
|
| 23 |
+
if (empty(trim($ad_link))) {
|
| 24 |
+
$ad_link = '#';
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
// Ad link target
|
| 28 |
$ad_link_target = blocksy_default_akg( 'ad_link_target', $atts, 'yes' );
|
| 29 |
|
| 30 |
+
$image_output = blc_call_fn(['fn' => 'blocksy_image'], [
|
| 31 |
'attachment_id' => blocksy_default_akg( 'ad_image/attachment_id', $atts, null ),
|
| 32 |
'ratio' => 'original',
|
| 33 |
'tag_name' => 'a',
|
| 44 |
echo $before_widget;
|
| 45 |
|
| 46 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
| 47 |
+
if (! empty(trim($title))) {
|
| 48 |
+
echo $before_title . wp_kses_post( $title ) . $after_title;
|
| 49 |
+
}
|
| 50 |
|
| 51 |
?>
|
| 52 |
|
| 58 |
} ?>
|
| 59 |
</div>
|
| 60 |
|
| 61 |
+
<?php echo wp_kses_post($after_widget); ?>
|
framework/extensions/widgets/widgets/ct-advertisement/widget.php
CHANGED
|
@@ -12,6 +12,7 @@ class Blocksy_Widget_Ct_Advertisement extends BlocksyWidgetFactory {
|
|
| 12 |
return [
|
| 13 |
'name' => __('Advertisement', 'blc'),
|
| 14 |
'description' => __('Advertisement', 'blc'),
|
|
|
|
| 15 |
];
|
| 16 |
}
|
| 17 |
|
| 12 |
return [
|
| 13 |
'name' => __('Advertisement', 'blc'),
|
| 14 |
'description' => __('Advertisement', 'blc'),
|
| 15 |
+
'customize_selective_refresh' => true
|
| 16 |
];
|
| 17 |
}
|
| 18 |
|
framework/extensions/widgets/widgets/ct-contact-info/options.php
CHANGED
|
@@ -79,11 +79,14 @@ $options = [
|
|
| 79 |
'label' => __('Link (optional)', 'blc'),
|
| 80 |
'design' => 'inline',
|
| 81 |
]
|
| 82 |
-
]
|
|
|
|
|
|
|
| 83 |
],
|
| 84 |
|
| 85 |
'phone' => [
|
| 86 |
'label' => __( 'Phone', 'blc' ),
|
|
|
|
| 87 |
'options' => [
|
| 88 |
|
| 89 |
'title' => [
|
|
@@ -112,6 +115,7 @@ $options = [
|
|
| 112 |
|
| 113 |
'mobile' => [
|
| 114 |
'label' => __( 'Mobile', 'blc' ),
|
|
|
|
| 115 |
'options' => [
|
| 116 |
'title' => [
|
| 117 |
'type' => 'text',
|
|
@@ -137,8 +141,37 @@ $options = [
|
|
| 137 |
]
|
| 138 |
],
|
| 139 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
'fax' => [
|
| 141 |
'label' => __( 'Fax', 'blc' ),
|
|
|
|
| 142 |
'options' => [
|
| 143 |
'title' => [
|
| 144 |
'type' => 'text',
|
|
@@ -166,6 +199,7 @@ $options = [
|
|
| 166 |
|
| 167 |
'email' => [
|
| 168 |
'label' => __( 'Email', 'blc' ),
|
|
|
|
| 169 |
'options' => [
|
| 170 |
'title' => [
|
| 171 |
'type' => 'text',
|
|
@@ -193,6 +227,7 @@ $options = [
|
|
| 193 |
|
| 194 |
'website' => [
|
| 195 |
'label' => __( 'Website', 'blc' ),
|
|
|
|
| 196 |
'options' => [
|
| 197 |
'title' => [
|
| 198 |
'type' => 'text',
|
|
@@ -214,20 +249,12 @@ $options = [
|
|
| 214 |
'value' => 'https://creativethemes.com',
|
| 215 |
'design' => 'inline',
|
| 216 |
],
|
| 217 |
-
|
| 218 |
]
|
| 219 |
],
|
| 220 |
],
|
| 221 |
],
|
| 222 |
|
| 223 |
-
'
|
| 224 |
-
'type' => 'ct-switch',
|
| 225 |
-
'label' => __( 'Open link in new tab', 'blc' ),
|
| 226 |
-
'value' => 'no',
|
| 227 |
-
'disableRevertButton' => true,
|
| 228 |
-
],
|
| 229 |
-
|
| 230 |
-
'contact_icons_size' => [
|
| 231 |
'label' => __( 'Icons Size', 'blc' ),
|
| 232 |
'type' => 'ct-radio',
|
| 233 |
'value' => 'medium',
|
|
@@ -241,15 +268,15 @@ $options = [
|
|
| 241 |
],
|
| 242 |
],
|
| 243 |
|
| 244 |
-
'
|
| 245 |
-
'label' => __( 'Icons Type', 'blc' ),
|
| 246 |
'type' => 'ct-radio',
|
| 247 |
'value' => 'rounded',
|
| 248 |
'view' => 'text',
|
| 249 |
'design' => 'block',
|
| 250 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 251 |
'choices' => [
|
| 252 |
-
'simple' => __( '
|
| 253 |
'rounded' => __( 'Rounded', 'blc' ),
|
| 254 |
'square' => __( 'Square', 'blc' ),
|
| 255 |
],
|
|
@@ -257,22 +284,29 @@ $options = [
|
|
| 257 |
|
| 258 |
blocksy_rand_md5() => [
|
| 259 |
'type' => 'ct-condition',
|
| 260 |
-
'condition' => [ '
|
| 261 |
'options' => [
|
| 262 |
|
| 263 |
-
'
|
| 264 |
-
'label' => __( '
|
| 265 |
'type' => 'ct-radio',
|
| 266 |
'value' => 'outline',
|
| 267 |
'view' => 'text',
|
| 268 |
'design' => 'block',
|
| 269 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 270 |
'choices' => [
|
| 271 |
-
'outline' => __( 'Outline', 'blc' ),
|
| 272 |
'solid' => __( 'Solid', 'blc' ),
|
|
|
|
| 273 |
],
|
| 274 |
],
|
| 275 |
|
| 276 |
],
|
| 277 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 278 |
];
|
| 79 |
'label' => __('Link (optional)', 'blc'),
|
| 80 |
'design' => 'inline',
|
| 81 |
]
|
| 82 |
+
],
|
| 83 |
+
|
| 84 |
+
'clone' => true
|
| 85 |
],
|
| 86 |
|
| 87 |
'phone' => [
|
| 88 |
'label' => __( 'Phone', 'blc' ),
|
| 89 |
+
'clone' => true,
|
| 90 |
'options' => [
|
| 91 |
|
| 92 |
'title' => [
|
| 115 |
|
| 116 |
'mobile' => [
|
| 117 |
'label' => __( 'Mobile', 'blc' ),
|
| 118 |
+
'clone' => true,
|
| 119 |
'options' => [
|
| 120 |
'title' => [
|
| 121 |
'type' => 'text',
|
| 141 |
]
|
| 142 |
],
|
| 143 |
|
| 144 |
+
'hours' => [
|
| 145 |
+
'label' => __( 'Work Hours', 'blc' ),
|
| 146 |
+
'clone' => true,
|
| 147 |
+
'options' => [
|
| 148 |
+
'title' => [
|
| 149 |
+
'type' => 'text',
|
| 150 |
+
'label' => __('Title', 'blc'),
|
| 151 |
+
'value' => __('Opening hours', 'blc'),
|
| 152 |
+
'design' => 'inline',
|
| 153 |
+
],
|
| 154 |
+
|
| 155 |
+
'content' => [
|
| 156 |
+
'type' => 'text',
|
| 157 |
+
'label' => __('Content', 'blc'),
|
| 158 |
+
'value' => '9AM - 5PM',
|
| 159 |
+
'design' => 'inline',
|
| 160 |
+
],
|
| 161 |
+
|
| 162 |
+
'link' => [
|
| 163 |
+
'type' => 'text',
|
| 164 |
+
'label' => __('Link (optional)', 'blc'),
|
| 165 |
+
'value' => '',
|
| 166 |
+
'design' => 'inline',
|
| 167 |
+
],
|
| 168 |
+
|
| 169 |
+
]
|
| 170 |
+
],
|
| 171 |
+
|
| 172 |
'fax' => [
|
| 173 |
'label' => __( 'Fax', 'blc' ),
|
| 174 |
+
'clone' => true,
|
| 175 |
'options' => [
|
| 176 |
'title' => [
|
| 177 |
'type' => 'text',
|
| 199 |
|
| 200 |
'email' => [
|
| 201 |
'label' => __( 'Email', 'blc' ),
|
| 202 |
+
'clone' => true,
|
| 203 |
'options' => [
|
| 204 |
'title' => [
|
| 205 |
'type' => 'text',
|
| 227 |
|
| 228 |
'website' => [
|
| 229 |
'label' => __( 'Website', 'blc' ),
|
| 230 |
+
'clone' => true,
|
| 231 |
'options' => [
|
| 232 |
'title' => [
|
| 233 |
'type' => 'text',
|
| 249 |
'value' => 'https://creativethemes.com',
|
| 250 |
'design' => 'inline',
|
| 251 |
],
|
|
|
|
| 252 |
]
|
| 253 |
],
|
| 254 |
],
|
| 255 |
],
|
| 256 |
|
| 257 |
+
'contacts_icons_size' => [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 258 |
'label' => __( 'Icons Size', 'blc' ),
|
| 259 |
'type' => 'ct-radio',
|
| 260 |
'value' => 'medium',
|
| 268 |
],
|
| 269 |
],
|
| 270 |
|
| 271 |
+
'contacts_icon_shape' => [
|
| 272 |
+
'label' => __( 'Icons Shape Type', 'blc' ),
|
| 273 |
'type' => 'ct-radio',
|
| 274 |
'value' => 'rounded',
|
| 275 |
'view' => 'text',
|
| 276 |
'design' => 'block',
|
| 277 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 278 |
'choices' => [
|
| 279 |
+
'simple' => __( 'None', 'blc' ),
|
| 280 |
'rounded' => __( 'Rounded', 'blc' ),
|
| 281 |
'square' => __( 'Square', 'blc' ),
|
| 282 |
],
|
| 284 |
|
| 285 |
blocksy_rand_md5() => [
|
| 286 |
'type' => 'ct-condition',
|
| 287 |
+
'condition' => [ 'contacts_icon_shape' => '!simple' ],
|
| 288 |
'options' => [
|
| 289 |
|
| 290 |
+
'contacts_icon_fill_type' => [
|
| 291 |
+
'label' => __( 'Shape Fill Type', 'blc' ),
|
| 292 |
'type' => 'ct-radio',
|
| 293 |
'value' => 'outline',
|
| 294 |
'view' => 'text',
|
| 295 |
'design' => 'block',
|
| 296 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 297 |
'choices' => [
|
|
|
|
| 298 |
'solid' => __( 'Solid', 'blc' ),
|
| 299 |
+
'outline' => __( 'Outline', 'blc' ),
|
| 300 |
],
|
| 301 |
],
|
| 302 |
|
| 303 |
],
|
| 304 |
],
|
| 305 |
+
|
| 306 |
+
'contact_link_target' => [
|
| 307 |
+
'type' => 'ct-switch',
|
| 308 |
+
'label' => __( 'Open link in new tab', 'blc' ),
|
| 309 |
+
'value' => 'no',
|
| 310 |
+
'disableRevertButton' => true,
|
| 311 |
+
],
|
| 312 |
];
|
framework/extensions/widgets/widgets/ct-contact-info/view.php
CHANGED
|
@@ -14,21 +14,6 @@ $title = blocksy_default_akg( 'title', $atts, __( 'Contact Info', 'blc' ) );
|
|
| 14 |
// Text
|
| 15 |
$text = blocksy_default_akg( 'contact_text', $atts, '' );
|
| 16 |
|
| 17 |
-
// Icons size
|
| 18 |
-
$icons_size = blocksy_default_akg( 'contact_icons_size', $atts, 'medium' );
|
| 19 |
-
|
| 20 |
-
// Icons type
|
| 21 |
-
$icons_type = blocksy_default_akg( 'contact_icons_type', $atts, 'rounded' );
|
| 22 |
-
|
| 23 |
-
// Icons fill type
|
| 24 |
-
$fill_type = blocksy_default_akg( 'contact_icons_fill', $atts, 'outline' );
|
| 25 |
-
|
| 26 |
-
$fill_type_output = '';
|
| 27 |
-
|
| 28 |
-
if ( $icons_type !== 'simple' ) {
|
| 29 |
-
$fill_type_output = '-' . $fill_type;
|
| 30 |
-
}
|
| 31 |
-
|
| 32 |
$contact_information = blocksy_default_akg(
|
| 33 |
'contact_information',
|
| 34 |
$atts,
|
|
@@ -58,40 +43,6 @@ $contact_information = blocksy_default_akg(
|
|
| 58 |
]
|
| 59 |
);
|
| 60 |
|
| 61 |
-
$svgs = [
|
| 62 |
-
'address' => '<svg width="20" height="20" viewBox="0 0 20 20"><path d="M10,0C6.1,0,3,3.1,3,7c0,4.5,6,11.8,6.2,12.1L10,20l0.8-0.9C11,18.8,17,11.5,17,7C17,3.1,13.9,0,10,0z M10,2c2.8,0,5,2.2,5,5c0,2.7-3.1,7.4-5,9.8C8.1,14.4,5,9.7,5,7C5,4.2,7.2,2,10,2zM10,4.5C8.6,4.5,7.5,5.6,7.5,7S8.6,9.5,10,9.5s2.5-1.1,2.5-2.5S11.4,4.5,10,4.5z"/></svg>',
|
| 63 |
-
|
| 64 |
-
'phone' => '<svg width="20" height="20" viewBox="0 0 20 20"><path d="M4.4,0C4,0,3.6,0.2,3.2,0.4l0,0l0,0L0.8,2.9l0,0C0,3.6-0.2,4.7,0.1,5.6c0,0,0,0,0,0c0.7,1.9,2.3,5.5,5.6,8.7c3.3,3.3,6.9,4.9,8.7,5.6h0c0.9,0.3,1.9,0.1,2.7-0.5l2.4-2.4c0.6-0.6,0.6-1.7,0-2.4l-3.1-3.1l0,0c-0.6-0.6-1.8-0.6-2.4,0l-1.5,1.5c-0.6-0.3-1.9-1-3.1-2.2C8,9.5,7.4,8.2,7.2,7.6l1.5-1.5c0.6-0.6,0.7-1.7,0-2.4l0,0L8.6,3.6L5.6,0.5l0,0l0,0C5.2,0.2,4.8,0,4.4,0zM4.4,1.5c0.1,0,0.1,0,0.2,0.1l3.1,3.1l0.1,0.1c0,0,0,0.1,0,0.2L5.7,6.9L5.3,7.3l0.2,0.5c0,0,0.9,2.4,2.7,4.1L8.4,12c1.8,1.6,3.9,2.5,3.9,2.5l0.5,0.2l2.3-2.3c0.1-0.1,0.1-0.1,0.2,0l3.1,3.1c0.1,0.1,0.1,0.1,0,0.2l-2.4,2.4c-0.4,0.3-0.7,0.4-1.2,0.2c-1.7-0.7-5.1-2.2-8.1-5.2c-3-3-4.6-6.5-5.2-8.2c-0.1-0.3,0-0.8,0.2-1l0,0l2.3-2.4C4.2,1.6,4.3,1.5,4.4,1.5z"/></svg>',
|
| 65 |
-
|
| 66 |
-
'mobile' => '<svg width="20" height="20" viewBox="0 0 20 20"><path d="M13.5,20H6.5c-1.6,0-2.9-1.3-2.9-2.9V2.9C3.5,1.3,4.8,0,6.5,0h7.1c1.6,0,2.9,1.3,2.9,2.9v14.1C16.5,18.7,15.2,20,13.5,20zM6.7,1.7C5.8,1.7,5,2.5,5,3.4v13.2c0,0.9,0.7,1.7,1.7,1.7h6.6c0.9,0,1.7-0.7,1.7-1.7V3.4c0-0.9-0.7-1.7-1.7-1.7H6.7z"/><path d="M11.2,4.4H8.8c-0.3,0-0.6-0.3-0.6-0.6s0.3-0.6,0.6-0.6h2.4c0.3,0,0.6,0.3,0.6,0.6S11.5,4.4,11.2,4.4z"/><circle cx="10" cy="15.7" r="1.2"/></svg>',
|
| 67 |
-
|
| 68 |
-
'fax' => '<svg width="20" height="20" viewBox="0 0 20 20"><path d="M17.5,5.8h-1.7v-4V0h-1.7H5.8H4.2v1.8v4H2.5C1.1,5.8,0,7,0,8.3v8.3h4.2V20h11.7v-3.3H20V8.3C20,7,18.9,5.8,17.5,5.8zM5.8,1.8h8.3v4H5.8V1.8zM14.2,18.3H5.8v-5h8.3V18.3zM18.3,15h-2.5v-3.3H4.2V15H1.7V8.3c0-0.5,0.4-0.8,0.8-0.8h15c0.5,0,0.8,0.4,0.8,0.8V15zM4.2,9.2c0,0.5-0.4,0.8-0.8,0.8S2.5,9.6,2.5,9.2s0.4-0.8,0.8-0.8S4.2,8.7,4.2,9.2z"/></svg>',
|
| 69 |
-
|
| 70 |
-
'email' => '<svg width="20" height="20" viewBox="0 0 20 20"><path d="M10,0C4.5,0,0,4.5,0,10s4.5,10,10,10h5v-2h-5c-4.4,0-8-3.6-8-8s3.6-8,8-8s8,3.6,8,8v1.5c0,0.8-0.7,1.5-1.5,1.5S15,12.3,15,11.5V10c0-2.7-2.3-5-5-5s-5,2.3-5,5s2.3,5,5,5c1.4,0,2.7-0.6,3.6-1.6c0.6,0.9,1.7,1.6,2.9,1.6c1.9,0,3.5-1.6,3.5-3.5V10C20,4.5,15.5,0,10,0zM10,7c1.7,0,3,1.3,3,3s-1.3,3-3,3s-3-1.3-3-3S8.3,7,10,7z"/></svg>',
|
| 71 |
-
|
| 72 |
-
'website' => '<svg width="20" height="20" viewBox="0 0 20 20"><path d="M9.3,0C4.4,0,0.4,4,0.4,8.9s4,8.9,8.9,8.9c0.8,0,1.5-0.1,2.2-0.3v-3.9c-0.6,1.7-1.4,2.7-2.2,2.7c-0.9,0-2-1.5-2.5-3.7h4.8
|
| 73 |
-
v-1.5h-5c-0.1-0.7-0.1-1.4-0.1-2.2c0-0.8,0.1-1.5,0.2-2.2h5.6c0.1,0.7,0.2,1.4,0.2,2.2c0,0.2,0,0.4,0,0.6c0.4-0.4,0.9-0.6,1.5-0.6c0-0.8,0-1.5-0.1-2.2h2.8c0.2,0.7,0.3,1.4,0.3,2.2c0,0.5-0.1,1-0.2,1.5l1.3,0.9c0.2-0.8,0.3-1.6,0.3-2.4C18.1,4,14.2,0,9.3,0zM9.3,1.5c0.9,0,2,1.5,2.5,3.7h-5C7.3,2.9,8.3,1.5,9.3,1.5zM6.3,2.1C5.9,2.9,5.5,4,5.2,5.2H2.8C3.6,3.8,4.9,2.7,6.3,2.1zM12.2,2.1c1.5,0.6,2.7,1.7,3.5,3.1h-2.3C13.1,4,12.7,2.9,12.2,2.1zM2.2,6.7h2.8C4.9,7.4,4.8,8.1,4.8,8.9c0,0.8,0.1,1.5,0.1,2.2H2.2C2,10.4,1.9,9.7,1.9,8.9C1.9,8.1,2,7.4,2.2,6.7z M13.7,10.4c-0.4,0-0.7,0.3-0.8,0.7c0,0,0,0.1,0,0.1v6.6c0,0.4,0.3,0.7,0.7,0.7c0.2,0,0.4-0.1,0.5-0.2l0,0l1.4-1.6l1.5,3c0.2,0.4,0.6,0.5,1,0.3c0.4-0.2,0.5-0.6,0.3-1l-1.5-3l2.2-0.4l0,0c0.3-0.1,0.5-0.4,0.5-0.7c0-0.3-0.1-0.5-0.3-0.6l0,0l-5.1-3.6C14.1,10.4,13.9,10.4,13.7,10.4zM2.9,12.6h2.3c0.3,1.2,0.7,2.3,1.1,3.1C4.9,15.1,3.7,14,2.9,12.6z"/></svg>',
|
| 74 |
-
];
|
| 75 |
-
|
| 76 |
-
$has_enabled_layer = false;
|
| 77 |
-
|
| 78 |
-
foreach ($contact_information as $single_layer) {
|
| 79 |
-
if ($single_layer['enabled']) {
|
| 80 |
-
$has_enabled_layer = true;
|
| 81 |
-
break;
|
| 82 |
-
}
|
| 83 |
-
}
|
| 84 |
-
|
| 85 |
-
// Link target
|
| 86 |
-
$target = blocksy_default_akg( 'contact_link_target', $atts, 'no' );
|
| 87 |
-
|
| 88 |
-
$data_target = '';
|
| 89 |
-
|
| 90 |
-
if ( $target !== 'no' ) {
|
| 91 |
-
$data_target = 'target="_blank"';
|
| 92 |
-
}
|
| 93 |
-
|
| 94 |
-
|
| 95 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
| 96 |
echo $before_widget;
|
| 97 |
|
|
@@ -100,47 +51,18 @@ echo $before_title . wp_kses_post( $title ) . $after_title;
|
|
| 100 |
|
| 101 |
?>
|
| 102 |
|
| 103 |
-
<?php if(
|
| 104 |
<div class="ct-contact-info-text">
|
| 105 |
<?php echo wp_kses_post($text) ?>
|
| 106 |
</div>
|
| 107 |
-
<?php }
|
| 108 |
-
|
| 109 |
-
<?php if ($has_enabled_layer) { ?>
|
| 110 |
-
|
| 111 |
-
<ul data-icons="<?php echo $icons_size . '-' . $icons_type . $fill_type_output ?>">
|
| 112 |
-
<?php foreach ($contact_information as $single_layer) { ?>
|
| 113 |
-
<li>
|
| 114 |
-
<i>
|
| 115 |
-
<?php echo $svgs[$single_layer['id']] ?>
|
| 116 |
-
</i>
|
| 117 |
-
|
| 118 |
-
<div class="contact-info">
|
| 119 |
-
<?php if (! empty(blocksy_akg('title', $single_layer, ''))) { ?>
|
| 120 |
-
<span class="contact-title">
|
| 121 |
-
<?php echo esc_html(blocksy_akg('title', $single_layer, '')) ?>
|
| 122 |
-
</span>
|
| 123 |
-
<?php } ?>
|
| 124 |
-
|
| 125 |
-
<?php if (! empty(blocksy_akg('content', $single_layer, ''))) { ?>
|
| 126 |
-
<span class="contact-text">
|
| 127 |
-
<?php if (! empty(blocksy_akg('link', $single_layer, ''))) { ?>
|
| 128 |
-
<a href="<?php echo blocksy_akg('link', $single_layer, '') ?>" <?php echo $data_target ?>>
|
| 129 |
-
<?php } ?>
|
| 130 |
-
|
| 131 |
-
<?php echo esc_html(blocksy_akg('content', $single_layer, '')) ?>
|
| 132 |
-
|
| 133 |
-
<?php if (! empty(blocksy_akg('link', $single_layer, ''))) { ?>
|
| 134 |
-
</a>
|
| 135 |
-
<?php } ?>
|
| 136 |
-
</span>
|
| 137 |
-
<?php } ?>
|
| 138 |
-
</div>
|
| 139 |
-
</li>
|
| 140 |
-
|
| 141 |
-
<?php } ?>
|
| 142 |
-
</ul>
|
| 143 |
|
| 144 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
|
| 146 |
-
|
| 14 |
// Text
|
| 15 |
$text = blocksy_default_akg( 'contact_text', $atts, '' );
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
$contact_information = blocksy_default_akg(
|
| 18 |
'contact_information',
|
| 19 |
$atts,
|
| 43 |
]
|
| 44 |
);
|
| 45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
| 47 |
echo $before_widget;
|
| 48 |
|
| 51 |
|
| 52 |
?>
|
| 53 |
|
| 54 |
+
<?php if (! empty($text)) { ?>
|
| 55 |
<div class="ct-contact-info-text">
|
| 56 |
<?php echo wp_kses_post($text) ?>
|
| 57 |
</div>
|
| 58 |
+
<?php }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
+
echo blc_call_fn(['fn' => 'blc_get_contacts_output'], [
|
| 61 |
+
'data' => $contact_information,
|
| 62 |
+
'link_target' => blocksy_default_akg('contact_link_target', $atts, 'no'),
|
| 63 |
+
'type' => blocksy_akg('contacts_icon_shape', $atts, 'rounded'),
|
| 64 |
+
'fill' => blocksy_akg('contacts_icon_fill_type', $atts, 'outline'),
|
| 65 |
+
'size' => blocksy_akg('contacts_icons_size', $atts, 'medium')
|
| 66 |
+
]);
|
| 67 |
|
| 68 |
+
echo wp_kses_post($after_widget);
|
framework/extensions/widgets/widgets/ct-contact-info/widget.php
CHANGED
|
@@ -12,6 +12,7 @@ class Blocksy_Widget_Ct_Contact_Info extends BlocksyWidgetFactory {
|
|
| 12 |
return [
|
| 13 |
'name' => __('Contact Info', 'blc'),
|
| 14 |
'description' => __('Contact info', 'blc'),
|
|
|
|
| 15 |
];
|
| 16 |
}
|
| 17 |
|
| 12 |
return [
|
| 13 |
'name' => __('Contact Info', 'blc'),
|
| 14 |
'description' => __('Contact info', 'blc'),
|
| 15 |
+
'customize_selective_refresh' => true
|
| 16 |
];
|
| 17 |
}
|
| 18 |
|
framework/extensions/widgets/widgets/ct-facebook/options.php
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Facebook widget
|
| 4 |
+
*
|
| 5 |
+
* @copyright 2019-present Creative Themes
|
| 6 |
+
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
|
| 7 |
+
* @package Blocksy
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
$options = [
|
| 11 |
+
'title' => [
|
| 12 |
+
'type' => 'text',
|
| 13 |
+
'label' => __( 'Title', 'blc' ),
|
| 14 |
+
'field_attr' => [ 'id' => 'widget-title' ],
|
| 15 |
+
'design' => 'inline',
|
| 16 |
+
'value' => __( 'Facebook', 'blc' ),
|
| 17 |
+
'disableRevertButton' => true,
|
| 18 |
+
],
|
| 19 |
+
|
| 20 |
+
'facebook_page_url' => [
|
| 21 |
+
'type' => 'text',
|
| 22 |
+
'label' => __( 'Page URL', 'blc' ),
|
| 23 |
+
'field_attr' => [ 'id' => 'widget-title' ],
|
| 24 |
+
'design' => 'inline',
|
| 25 |
+
'disableRevertButton' => true,
|
| 26 |
+
],
|
| 27 |
+
|
| 28 |
+
'facebook_faces' => [
|
| 29 |
+
'type' => 'ct-switch',
|
| 30 |
+
'label' => __( 'Profile Photos', 'blc' ),
|
| 31 |
+
'value' => 'yes',
|
| 32 |
+
],
|
| 33 |
+
|
| 34 |
+
'facebook_timeline' => [
|
| 35 |
+
'type' => 'ct-switch',
|
| 36 |
+
'label' => __( 'Timeline', 'blc' ),
|
| 37 |
+
'value' => 'no',
|
| 38 |
+
],
|
| 39 |
+
|
| 40 |
+
'facebook_cover' => [
|
| 41 |
+
'type' => 'ct-switch',
|
| 42 |
+
'label' => __( 'Cover Photo', 'blc' ),
|
| 43 |
+
'value' => 'no',
|
| 44 |
+
],
|
| 45 |
+
|
| 46 |
+
'facebook_small_header' => [
|
| 47 |
+
'type' => 'ct-switch',
|
| 48 |
+
'label' => __( 'Small Header', 'blc' ),
|
| 49 |
+
'value' => 'no',
|
| 50 |
+
],
|
| 51 |
+
|
| 52 |
+
];
|
framework/extensions/widgets/widgets/ct-facebook/view.php
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Facebook widget
|
| 4 |
+
*
|
| 5 |
+
* @copyright 2019-present Creative Themes
|
| 6 |
+
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
|
| 7 |
+
* @package Blocksy
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
// Widget title
|
| 12 |
+
$title = blocksy_default_akg( 'title', $atts, __( 'Facebook', 'blc' ) );
|
| 13 |
+
|
| 14 |
+
$url = blocksy_default_akg('facebook_page_url', $atts, '');
|
| 15 |
+
|
| 16 |
+
if (empty($url)) {
|
| 17 |
+
return;
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
$faces = blocksy_default_akg('facebook_faces', $atts, 'yes') === 'yes' ? 'true' : 'false';
|
| 21 |
+
$cover = blocksy_default_akg('facebook_cover', $atts, 'no') === 'yes' ? 'false' : 'true';
|
| 22 |
+
$header = blocksy_default_akg('facebook_small_header', $atts, 'no') === 'yes' ? 'true' : 'false';
|
| 23 |
+
$timeline = blocksy_default_akg('facebook_timeline', $atts, 'no') === 'yes' ? 'timeline' : '';
|
| 24 |
+
$posts = blocksy_default_akg('facebook_posts', $atts, 'no') === 'yes' ? 'true' : 'false';
|
| 25 |
+
|
| 26 |
+
$app_id = '';
|
| 27 |
+
|
| 28 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
| 29 |
+
echo $before_widget;
|
| 30 |
+
|
| 31 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
| 32 |
+
echo $before_title . wp_kses_post( $title ) . $after_title;
|
| 33 |
+
|
| 34 |
+
?>
|
| 35 |
+
|
| 36 |
+
<div class="ct-facebook-like-box">
|
| 37 |
+
<div class="fb-page"
|
| 38 |
+
data-href="<?php echo esc_url( $url ); ?>"
|
| 39 |
+
data-width="500"
|
| 40 |
+
data-hide-cover="<?php echo $cover; ?>"
|
| 41 |
+
data-show-facepile="<?php echo $faces; ?>"
|
| 42 |
+
data-small-header="<?php echo $header; ?>"
|
| 43 |
+
data-tabs="<?php echo $timeline; ?>"></div>
|
| 44 |
+
|
| 45 |
+
<div id="fb-root"></div>
|
| 46 |
+
|
| 47 |
+
<script>(function(d, s, id) {
|
| 48 |
+
var js, fjs = d.getElementsByTagName(s)[0];
|
| 49 |
+
if (d.getElementById(id)) return;
|
| 50 |
+
js = d.createElement(s); js.id = id;
|
| 51 |
+
js.src = 'https://connect.facebook.net/<?php echo esc_attr(get_locale()); ?>/sdk.js#xfbml=1&version=v3.2<?php
|
| 52 |
+
if ( ! empty( $app_id ) ) {
|
| 53 |
+
echo '&appId=' . esc_attr($app_id);
|
| 54 |
+
}
|
| 55 |
+
?>';
|
| 56 |
+
fjs.parentNode.insertBefore(js, fjs);
|
| 57 |
+
}(document, 'script', 'facebook-jssdk'));</script>
|
| 58 |
+
|
| 59 |
+
</div>
|
| 60 |
+
|
| 61 |
+
<?php echo wp_kses_post( $after_widget ); ?>
|
framework/extensions/widgets/widgets/ct-facebook/widget.php
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Facebook widget
|
| 4 |
+
*
|
| 5 |
+
* @copyright 2019-present Creative Themes
|
| 6 |
+
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
|
| 7 |
+
* @package Blocksy
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
class Blocksy_Widget_Ct_Facebook extends BlocksyWidgetFactory {
|
| 11 |
+
protected function get_config() {
|
| 12 |
+
return [
|
| 13 |
+
'name' => __('Facebook', 'blc'),
|
| 14 |
+
'description' => __('Facebook like box', 'blc'),
|
| 15 |
+
'customize_selective_refresh' => true
|
| 16 |
+
];
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
public function get_path() {
|
| 20 |
+
return dirname(__FILE__);
|
| 21 |
+
}
|
| 22 |
+
}
|
framework/extensions/widgets/widgets/ct-posts/options.php
CHANGED
|
@@ -7,77 +7,271 @@
|
|
| 7 |
* @package Blocksy
|
| 8 |
*/
|
| 9 |
|
| 10 |
-
$
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
'orderby' => 'name',
|
| 14 |
-
'order'
|
| 15 |
-
|
| 16 |
-
);
|
| 17 |
|
| 18 |
-
$category_choices = [
|
| 19 |
-
|
| 20 |
-
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
}
|
| 25 |
|
| 26 |
$options = [
|
| 27 |
-
|
| 28 |
-
'
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
],
|
| 34 |
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
'
|
| 39 |
-
'
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
],
|
| 48 |
|
| 49 |
-
|
| 50 |
-
'type' => 'ct-
|
| 51 |
-
'
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
'
|
| 59 |
-
'
|
| 60 |
-
'
|
| 61 |
-
'
|
| 62 |
-
|
| 63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
],
|
| 65 |
|
| 66 |
-
|
| 67 |
-
'type' => 'ct-
|
| 68 |
-
'
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
],
|
| 73 |
|
| 74 |
-
|
| 75 |
-
'type' => 'ct-
|
| 76 |
-
'
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
],
|
| 82 |
|
| 83 |
'display_date' => [
|
|
@@ -86,16 +280,33 @@ $options = [
|
|
| 86 |
'value' => 'no',
|
| 87 |
],
|
| 88 |
|
| 89 |
-
'
|
| 90 |
'type' => 'ct-switch',
|
| 91 |
-
'label' => __( 'Show
|
| 92 |
'value' => 'no',
|
| 93 |
],
|
| 94 |
|
| 95 |
-
'
|
| 96 |
'type' => 'ct-switch',
|
| 97 |
-
'label' => __( 'Show
|
| 98 |
'value' => 'no',
|
| 99 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
];
|
| 101 |
|
| 7 |
* @package Blocksy
|
| 8 |
*/
|
| 9 |
|
| 10 |
+
$all_post_types = [
|
| 11 |
+
'post' => __('Posts', 'blc'),
|
| 12 |
+
'page' => __('Pages', 'blc'),
|
| 13 |
+
];
|
| 14 |
+
|
| 15 |
+
if (function_exists('blocksy_manager')) {
|
| 16 |
+
$post_types = blocksy_manager()->post_types->get_supported_post_types();
|
| 17 |
+
|
| 18 |
+
foreach ($post_types as $single_post_type) {
|
| 19 |
+
$post_type_object = get_post_type_object($single_post_type);
|
| 20 |
+
|
| 21 |
+
if (! $post_type_object) {
|
| 22 |
+
continue;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
$all_post_types[$single_post_type] = $post_type_object->labels->singular_name;
|
| 26 |
+
}
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
$cpt_options = [];
|
| 30 |
+
|
| 31 |
+
foreach ($all_post_types as $custom_post_type => $label) {
|
| 32 |
+
if ($custom_post_type === 'page') {
|
| 33 |
+
continue;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
$opt_id = 'category';
|
| 37 |
+
$label = __('Category', 'blc');
|
| 38 |
+
$label_multiple = __('All categories', 'blc');
|
| 39 |
+
$taxonomy = 'category';
|
| 40 |
+
|
| 41 |
+
if ($custom_post_type !== 'post') {
|
| 42 |
+
$opt_id = $custom_post_type . '_taxonomy';
|
| 43 |
+
$label = __('Taxonomy', 'blc');
|
| 44 |
+
$label_multiple = __('All taxonomies', 'blc');
|
| 45 |
+
|
| 46 |
+
$taxonomies = get_object_taxonomies($custom_post_type);
|
| 47 |
+
|
| 48 |
+
if (count($taxonomies) > 0) {
|
| 49 |
+
$taxonomy = $taxonomies[0];
|
| 50 |
+
} else {
|
| 51 |
+
$taxonomy = 'nonexistent';
|
| 52 |
+
}
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
$categories = get_terms([
|
| 56 |
+
'taxonomy' => $taxonomy,
|
| 57 |
+
// 'post_type' => $custom_post_type,
|
| 58 |
'orderby' => 'name',
|
| 59 |
+
'order' => 'ASC',
|
| 60 |
+
'hide_empty' => false
|
| 61 |
+
]);
|
| 62 |
|
| 63 |
+
$category_choices = [
|
| 64 |
+
'all_categories' => $label_multiple
|
| 65 |
+
];
|
| 66 |
+
|
| 67 |
+
if (! is_wp_error($categories)) {
|
| 68 |
+
foreach ($categories as $category) {
|
| 69 |
+
$category_choices[$category->term_id] = $category->name;
|
| 70 |
+
}
|
| 71 |
+
}
|
| 72 |
|
| 73 |
+
$cpt_options[blocksy_rand_md5()] = [
|
| 74 |
+
'type' => 'ct-condition',
|
| 75 |
+
'condition' => [
|
| 76 |
+
'post_type_source' => $custom_post_type,
|
| 77 |
+
'post_source' => '!custom'
|
| 78 |
+
],
|
| 79 |
+
'options' => [
|
| 80 |
+
$opt_id => [
|
| 81 |
+
'type' => 'ct-select',
|
| 82 |
+
'label' => $label,
|
| 83 |
+
'value' => 'all_categories',
|
| 84 |
+
'choices' => blocksy_ordered_keys($category_choices),
|
| 85 |
+
'design' => 'inline',
|
| 86 |
+
],
|
| 87 |
+
]
|
| 88 |
+
];
|
| 89 |
}
|
| 90 |
|
| 91 |
$options = [
|
| 92 |
+
[
|
| 93 |
+
'title' => [
|
| 94 |
+
'type' => 'text',
|
| 95 |
+
'label' => __('Title', 'blc'),
|
| 96 |
+
'field_attr' => ['id' => 'widget-title'],
|
| 97 |
+
'design' => 'inline',
|
| 98 |
+
'value' => __('Posts', 'blc'),
|
| 99 |
+
],
|
| 100 |
+
|
| 101 |
+
'posts_type' => [
|
| 102 |
+
'type' => 'ct-select',
|
| 103 |
+
'label' => __('Widget Design', 'blc'),
|
| 104 |
+
'value' => 'small-thumbs',
|
| 105 |
+
'design' => 'inline',
|
| 106 |
+
'choices' => blocksy_ordered_keys(
|
| 107 |
+
[
|
| 108 |
+
'no-thumbs' => __( 'Without Thumbnails', 'blc' ),
|
| 109 |
+
'small-thumbs' => __( 'Small Thumbnails', 'blc' ),
|
| 110 |
+
'large-thumbs' => __( 'Large Thumbnails', 'blc' ),
|
| 111 |
+
'large-small' => __( 'First Thumbnail Large', 'blc' ),
|
| 112 |
+
'rounded' => __( 'Rounded Thumbnails', 'blc' ),
|
| 113 |
+
'numbered' => __( 'Numbered', 'blc' ),
|
| 114 |
+
]
|
| 115 |
+
),
|
| 116 |
+
],
|
| 117 |
+
|
| 118 |
+
'post_type_source' => [
|
| 119 |
+
'type' => 'ct-select',
|
| 120 |
+
'label' => __( 'Post Type', 'blc' ),
|
| 121 |
+
'value' => 'post',
|
| 122 |
+
'design' => 'inline',
|
| 123 |
+
'choices' => blocksy_ordered_keys($all_post_types)
|
| 124 |
+
],
|
| 125 |
+
|
| 126 |
+
blocksy_rand_md5() => [
|
| 127 |
+
'type' => 'ct-condition',
|
| 128 |
+
'condition' => ['post_type_source' => '!page'],
|
| 129 |
+
'options' => [
|
| 130 |
+
'post_source' => [
|
| 131 |
+
'type' => 'ct-select',
|
| 132 |
+
'label' => __( 'Source', 'blc' ),
|
| 133 |
+
'value' => 'categories',
|
| 134 |
+
'design' => 'inline',
|
| 135 |
+
'choices' => blocksy_ordered_keys(
|
| 136 |
+
[
|
| 137 |
+
'categories' => __('Taxonomies', 'blc'),
|
| 138 |
+
'custom' => __( 'Custom Query', 'blc' ),
|
| 139 |
+
]
|
| 140 |
+
),
|
| 141 |
+
],
|
| 142 |
+
],
|
| 143 |
+
],
|
| 144 |
+
|
| 145 |
+
blocksy_rand_md5() => [
|
| 146 |
+
'type' => 'ct-condition',
|
| 147 |
+
'condition' => ['post_type_source' => 'page'],
|
| 148 |
+
'options' => [
|
| 149 |
+
'page_source' => [
|
| 150 |
+
'type' => 'ct-select',
|
| 151 |
+
'label' => __('Source', 'blc'),
|
| 152 |
+
'value' => 'default',
|
| 153 |
+
'design' => 'inline',
|
| 154 |
+
'choices' => blocksy_ordered_keys(
|
| 155 |
+
[
|
| 156 |
+
'default' => __('Default', 'blc'),
|
| 157 |
+
'custom' => __('Custom Query', 'blc'),
|
| 158 |
+
]
|
| 159 |
+
),
|
| 160 |
+
],
|
| 161 |
+
],
|
| 162 |
+
],
|
| 163 |
],
|
| 164 |
|
| 165 |
+
$cpt_options,
|
| 166 |
+
|
| 167 |
+
blocksy_rand_md5() => [
|
| 168 |
+
'type' => 'ct-condition',
|
| 169 |
+
'condition' => [
|
| 170 |
+
'post_type_source' => '!page',
|
| 171 |
+
'post_source' => '!custom'
|
| 172 |
+
],
|
| 173 |
+
'options' => [
|
| 174 |
+
'type' => [
|
| 175 |
+
'type' => 'ct-select',
|
| 176 |
+
'label' => __( 'Sort by', 'blc' ),
|
| 177 |
+
'value' => 'commented',
|
| 178 |
+
'design' => 'inline',
|
| 179 |
+
'choices' => blocksy_ordered_keys(
|
| 180 |
+
[
|
| 181 |
+
'recent' => __( 'Recent', 'blc' ),
|
| 182 |
+
'commented' => __( 'Most Commented', 'blc' ),
|
| 183 |
+
]
|
| 184 |
+
),
|
| 185 |
+
],
|
| 186 |
+
|
| 187 |
+
'days' => [
|
| 188 |
+
'type' => 'ct-select',
|
| 189 |
+
'label' => __( 'Order by', 'blc' ),
|
| 190 |
+
'value' => 'all_time',
|
| 191 |
+
'design' => 'inline',
|
| 192 |
+
'choices' => blocksy_ordered_keys(
|
| 193 |
+
[
|
| 194 |
+
'all_time' => __( 'All Time', 'blc' ),
|
| 195 |
+
'7' => __( '1 Week', 'blc' ),
|
| 196 |
+
'30' => __( '1 Month', 'blc' ),
|
| 197 |
+
'90' => __( '3 Months', 'blc' ),
|
| 198 |
+
'180' => __( '6 Months', 'blc' ),
|
| 199 |
+
'360' => __( '1 Year', 'blc' ),
|
| 200 |
+
]
|
| 201 |
+
),
|
| 202 |
+
],
|
| 203 |
+
|
| 204 |
+
'posts_number' => [
|
| 205 |
+
'type' => 'ct-number',
|
| 206 |
+
'label' => __( 'Posts Count', 'blc' ),
|
| 207 |
+
'min' => 1,
|
| 208 |
+
'max' => 30,
|
| 209 |
+
'value' => 5,
|
| 210 |
+
'design' => 'inline',
|
| 211 |
+
],
|
| 212 |
+
],
|
| 213 |
],
|
| 214 |
|
| 215 |
+
blocksy_rand_md5() => [
|
| 216 |
+
'type' => 'ct-condition',
|
| 217 |
+
'condition' => [
|
| 218 |
+
'post_type_source' => '!page',
|
| 219 |
+
'post_source' => 'custom'
|
| 220 |
+
],
|
| 221 |
+
'options' => [
|
| 222 |
+
|
| 223 |
+
'post_id' => [
|
| 224 |
+
'label' => __( 'Posts ID', 'blocksy' ),
|
| 225 |
+
'type' => 'text',
|
| 226 |
+
'design' => 'inline',
|
| 227 |
+
'desc' => sprintf(
|
| 228 |
+
__('Separate posts ID by comma. How to find the %spost ID%s.', 'blocksy'),
|
| 229 |
+
'<a href="https://www.wpbeginner.com/beginners-guide/how-to-find-post-category-tag-comments-or-user-id-in-wordpress/" target="_blank">',
|
| 230 |
+
'</a>'
|
| 231 |
+
),
|
| 232 |
+
],
|
| 233 |
+
|
| 234 |
+
],
|
| 235 |
],
|
| 236 |
|
| 237 |
+
blocksy_rand_md5() => [
|
| 238 |
+
'type' => 'ct-condition',
|
| 239 |
+
'condition' => [
|
| 240 |
+
'post_type_source' => 'page',
|
| 241 |
+
'page_source' => 'custom'
|
| 242 |
+
],
|
| 243 |
+
'options' => [
|
| 244 |
+
|
| 245 |
+
'page_id' => [
|
| 246 |
+
'label' => __( 'Pages ID', 'blocksy' ),
|
| 247 |
+
'type' => 'text',
|
| 248 |
+
'design' => 'inline',
|
| 249 |
+
'desc' => sprintf(
|
| 250 |
+
__('Separate pages ID by comma. How to find the %spage ID%s.', 'blocksy'),
|
| 251 |
+
'<a href="https://www.wpbeginner.com/beginners-guide/how-to-find-post-category-tag-comments-or-user-id-in-wordpress/" target="_blank">',
|
| 252 |
+
'</a>'
|
| 253 |
+
),
|
| 254 |
+
],
|
| 255 |
+
|
| 256 |
+
],
|
| 257 |
],
|
| 258 |
|
| 259 |
+
blocksy_rand_md5() => [
|
| 260 |
+
'type' => 'ct-condition',
|
| 261 |
+
'condition' => [
|
| 262 |
+
'post_type_source' => 'page',
|
| 263 |
+
'page_source' => '!custom'
|
| 264 |
+
],
|
| 265 |
+
'options' => [
|
| 266 |
+
'page_number' => [
|
| 267 |
+
'type' => 'ct-number',
|
| 268 |
+
'label' => __( 'Pages Count', 'blc' ),
|
| 269 |
+
'min' => 1,
|
| 270 |
+
'max' => 30,
|
| 271 |
+
'value' => 5,
|
| 272 |
+
'design' => 'inline',
|
| 273 |
+
],
|
| 274 |
+
],
|
| 275 |
],
|
| 276 |
|
| 277 |
'display_date' => [
|
| 280 |
'value' => 'no',
|
| 281 |
],
|
| 282 |
|
| 283 |
+
'display_comments' => [
|
| 284 |
'type' => 'ct-switch',
|
| 285 |
+
'label' => __( 'Show Comments', 'blc' ),
|
| 286 |
'value' => 'no',
|
| 287 |
],
|
| 288 |
|
| 289 |
+
'display_excerpt' => [
|
| 290 |
'type' => 'ct-switch',
|
| 291 |
+
'label' => __( 'Show Excerpt', 'blc' ),
|
| 292 |
'value' => 'no',
|
| 293 |
],
|
| 294 |
+
|
| 295 |
+
blocksy_rand_md5() => [
|
| 296 |
+
'type' => 'ct-condition',
|
| 297 |
+
'condition' => [ 'display_excerpt' => 'yes' ],
|
| 298 |
+
'options' => [
|
| 299 |
+
|
| 300 |
+
'excerpt_lenght' => [
|
| 301 |
+
'type' => 'ct-number',
|
| 302 |
+
'label' => __( 'Excerpt Lenght', 'blc' ),
|
| 303 |
+
'min' => 5,
|
| 304 |
+
'max' => 30,
|
| 305 |
+
'value' => 10,
|
| 306 |
+
'design' => 'inline',
|
| 307 |
+
],
|
| 308 |
+
|
| 309 |
+
],
|
| 310 |
+
],
|
| 311 |
];
|
| 312 |
|
framework/extensions/widgets/widgets/ct-posts/view.php
CHANGED
|
@@ -7,49 +7,121 @@
|
|
| 7 |
* @package Blocksy
|
| 8 |
*/
|
| 9 |
|
| 10 |
-
$
|
| 11 |
-
|
| 12 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
-
|
|
|
|
| 15 |
|
| 16 |
-
if (
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
-
$
|
| 20 |
-
|
| 21 |
-
'before' => date( 'F jS, Y' ),
|
| 22 |
-
'inclusive' => true,
|
| 23 |
-
);
|
| 24 |
-
}
|
| 25 |
|
| 26 |
-
$
|
| 27 |
-
$
|
| 28 |
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
-
$query = new WP_Query(
|
| 32 |
-
[
|
| 33 |
-
'post_type' => 'post',
|
| 34 |
-
'order' => 'DESC',
|
| 35 |
-
'posts_per_page' => $items,
|
| 36 |
-
'date_query' => $date_query,
|
| 37 |
-
'cat' => $fw_cat_id,
|
| 38 |
-
'orderby' => ( 'recent' === $type ) ? 'post_date' : 'comment_count',
|
| 39 |
-
]
|
| 40 |
-
);
|
| 41 |
|
| 42 |
// Post thumbnail
|
| 43 |
-
$has_thumbnail =
|
| 44 |
-
$data_thumbnail = '';
|
| 45 |
|
| 46 |
-
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
| 48 |
}
|
| 49 |
|
| 50 |
// Post meta
|
| 51 |
$has_meta = blocksy_default_akg( 'display_date', $atts, 'no' ) === 'yes';
|
| 52 |
|
|
|
|
| 53 |
// Comments
|
| 54 |
$has_comments = blocksy_default_akg( 'display_comments', $atts, 'no' ) === 'yes';
|
| 55 |
|
|
@@ -65,49 +137,78 @@ echo $before_title . wp_kses_post( $title ) . $after_title;
|
|
| 65 |
?>
|
| 66 |
|
| 67 |
<?php if ( $query->have_posts() ) { ?>
|
| 68 |
-
<ul <?php echo
|
| 69 |
<?php while ( $query->have_posts() ) { ?>
|
| 70 |
<?php $query->the_post(); ?>
|
| 71 |
|
| 72 |
<li>
|
| 73 |
-
<?php
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
|
|
|
|
|
|
| 108 |
</div>
|
| 109 |
-
|
| 110 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
</li>
|
| 112 |
<?php } ?>
|
| 113 |
</ul>
|
| 7 |
* @package Blocksy
|
| 8 |
*/
|
| 9 |
|
| 10 |
+
$post_type = blocksy_default_akg('post_type_source', $atts, 'post');
|
| 11 |
+
|
| 12 |
+
$query_args = [
|
| 13 |
+
'order' => 'DESC',
|
| 14 |
+
'ignore_sticky_posts' => true,
|
| 15 |
+
'post_type' => $post_type
|
| 16 |
+
];
|
| 17 |
+
|
| 18 |
+
if ($post_type !== 'page') {
|
| 19 |
+
$source = blocksy_default_akg('post_source', $atts, 'categories');
|
| 20 |
+
|
| 21 |
+
if ($source === 'categories') {
|
| 22 |
+
$date_query = [];
|
| 23 |
+
|
| 24 |
+
$days = blocksy_default_akg('days', $atts, 'all_time');
|
| 25 |
+
|
| 26 |
+
if ($days && 'all_time' !== $days) {
|
| 27 |
+
$time = time() - (intval($days) * 24 * 60 * 60);
|
| 28 |
+
|
| 29 |
+
$date_query = [
|
| 30 |
+
'after' => date('F jS, Y', $time),
|
| 31 |
+
'before' => date('F jS, Y'),
|
| 32 |
+
'inclusive' => true,
|
| 33 |
+
];
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
$cat_option_id = 'category';
|
| 37 |
+
$taxonomy = 'category';
|
| 38 |
+
|
| 39 |
+
if ($post_type !== 'post') {
|
| 40 |
+
$cat_option_id = $post_type . '_taxonomy';
|
| 41 |
+
$taxonomies = get_object_taxonomies($post_type);
|
| 42 |
+
|
| 43 |
+
if (count($taxonomies) > 0) {
|
| 44 |
+
$taxonomy = $taxonomies[0];
|
| 45 |
+
}
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
$cat_id = blocksy_default_akg($cat_option_id, $atts, 'all_categories');
|
| 49 |
+
$cat_id = (empty($cat_id) || 'all_categories' === $cat_id) ? '' : $cat_id;
|
| 50 |
+
|
| 51 |
+
$query_args['orderby'] = ('recent' === blocksy_default_akg(
|
| 52 |
+
'type', $atts, 'recent'
|
| 53 |
+
)) ? 'post_date' : 'comment_count';
|
| 54 |
+
|
| 55 |
+
$query_args['date_query'] = $date_query;
|
| 56 |
+
|
| 57 |
+
if (! empty($cat_id)) {
|
| 58 |
+
$query_args['tax_query'] = [
|
| 59 |
+
[
|
| 60 |
+
'taxonomy' => $taxonomy,
|
| 61 |
+
'field' => 'term_id',
|
| 62 |
+
'terms' => [$cat_id]
|
| 63 |
+
]
|
| 64 |
+
];
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
$query_args['posts_per_page'] = intval(
|
| 68 |
+
blocksy_default_akg('posts_number', $atts, 5)
|
| 69 |
+
);
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
if ($source === 'custom') {
|
| 73 |
+
$post_id = blocksy_default_akg('post_id', $atts, '');
|
| 74 |
+
|
| 75 |
+
$query_args['orderby'] = 'post__in';
|
| 76 |
+
$query_args['post__in'] = ['__INEXISTING__'];
|
| 77 |
+
|
| 78 |
+
if (! empty(trim($post_id))) {
|
| 79 |
+
$query_args['post__in'] = explode(',', str_replace(' ', '', trim(
|
| 80 |
+
$post_id
|
| 81 |
+
)));
|
| 82 |
+
}
|
| 83 |
+
}
|
| 84 |
+
}
|
| 85 |
|
| 86 |
+
if ($post_type === 'page') {
|
| 87 |
+
$source = blocksy_default_akg('page_source', $atts, 'default');
|
| 88 |
|
| 89 |
+
if ($source === 'default') {
|
| 90 |
+
$query_args['posts_per_page'] = intval(
|
| 91 |
+
blocksy_default_akg('page_number', $atts, 5)
|
| 92 |
+
);
|
| 93 |
+
}
|
| 94 |
|
| 95 |
+
if ($source === 'custom') {
|
| 96 |
+
$post_id = blocksy_default_akg('page_id', $atts, '');
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
|
| 98 |
+
$query_args['orderby'] = 'post__in';
|
| 99 |
+
$query_args['post__in'] = ['__INEXISTING__'];
|
| 100 |
|
| 101 |
+
if (! empty(trim($post_id))) {
|
| 102 |
+
$query_args['post__in'] = explode(',', str_replace(' ', '', trim(
|
| 103 |
+
$post_id
|
| 104 |
+
)));
|
| 105 |
+
}
|
| 106 |
+
}
|
| 107 |
+
}
|
| 108 |
|
| 109 |
+
$query = new WP_Query($query_args);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
|
| 111 |
// Post thumbnail
|
| 112 |
+
$has_thumbnail = false;
|
|
|
|
| 113 |
|
| 114 |
+
$posts_type = blocksy_default_akg('posts_type', $atts, 'small-thumbs');
|
| 115 |
+
$type_output = 'data-type="' . esc_attr($posts_type) . '"';
|
| 116 |
+
|
| 117 |
+
if ($posts_type !== 'no-thumbs' && $posts_type !== 'numbered' ) {
|
| 118 |
+
$has_thumbnail = true;
|
| 119 |
}
|
| 120 |
|
| 121 |
// Post meta
|
| 122 |
$has_meta = blocksy_default_akg( 'display_date', $atts, 'no' ) === 'yes';
|
| 123 |
|
| 124 |
+
|
| 125 |
// Comments
|
| 126 |
$has_comments = blocksy_default_akg( 'display_comments', $atts, 'no' ) === 'yes';
|
| 127 |
|
| 137 |
?>
|
| 138 |
|
| 139 |
<?php if ( $query->have_posts() ) { ?>
|
| 140 |
+
<ul <?php echo $type_output ?>>
|
| 141 |
<?php while ( $query->have_posts() ) { ?>
|
| 142 |
<?php $query->the_post(); ?>
|
| 143 |
|
| 144 |
<li>
|
| 145 |
+
<a href="<?php echo esc_url( get_permalink() ); ?>">
|
| 146 |
+
<?php
|
| 147 |
+
if ( $has_thumbnail ) {
|
| 148 |
+
$size = 'thumbnail';
|
| 149 |
+
$ratio = '1/1';
|
| 150 |
+
|
| 151 |
+
if ( $posts_type === 'large-thumbs' ) {
|
| 152 |
+
$size = 'medium';
|
| 153 |
+
$ratio = '4/3';
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
if (
|
| 157 |
+
$posts_type === 'large-small'
|
| 158 |
+
&&
|
| 159 |
+
$query->current_post === 0
|
| 160 |
+
) {
|
| 161 |
+
$size = 'medium';
|
| 162 |
+
$ratio = '4/3';
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
echo wp_kses_post(
|
| 166 |
+
blc_call_fn(
|
| 167 |
+
['fn' => 'blocksy_image'],
|
| 168 |
+
[
|
| 169 |
+
'attachment_id' => get_post_thumbnail_id(),
|
| 170 |
+
'ratio' => $ratio,
|
| 171 |
+
'tag_name' => 'div',
|
| 172 |
+
'size' => $size,
|
| 173 |
+
]
|
| 174 |
+
)
|
| 175 |
+
);
|
| 176 |
+
}
|
| 177 |
+
?>
|
| 178 |
+
|
| 179 |
+
<div class="ct-entry-content">
|
| 180 |
+
<div class="ct-post-title">
|
| 181 |
+
<?php echo wp_kses_post(get_the_title()); ?>
|
| 182 |
</div>
|
| 183 |
+
|
| 184 |
+
<?php
|
| 185 |
+
if (blocksy_default_akg('display_excerpt', $atts, 'no') === 'yes') {
|
| 186 |
+
echo blocksy_entry_excerpt(
|
| 187 |
+
blocksy_default_akg('excerpt_lenght', $atts, '10'),
|
| 188 |
+
'ct-entry-excerpt',
|
| 189 |
+
get_the_ID()
|
| 190 |
+
);
|
| 191 |
+
}
|
| 192 |
+
?>
|
| 193 |
+
|
| 194 |
+
<?php if ( $has_meta || $has_comments ) { ?>
|
| 195 |
+
<div class="ct-entry-meta">
|
| 196 |
+
<?php if ( $has_meta ) { ?>
|
| 197 |
+
<span>
|
| 198 |
+
<?php echo esc_attr(get_the_time(get_option('date_format', 'M j, Y'))); ?>
|
| 199 |
+
|
| 200 |
+
</span>
|
| 201 |
+
<?php } ?>
|
| 202 |
+
|
| 203 |
+
<?php if ( $has_comments && get_comments_number() > 0 ) { ?>
|
| 204 |
+
<span>
|
| 205 |
+
<?php echo wp_kses_post( get_comments_number_text( '', '1 Comment', '% Comments' ) ); ?>
|
| 206 |
+
</span>
|
| 207 |
+
<?php } ?>
|
| 208 |
+
</div>
|
| 209 |
+
<?php } ?>
|
| 210 |
+
</div>
|
| 211 |
+
</a>
|
| 212 |
</li>
|
| 213 |
<?php } ?>
|
| 214 |
</ul>
|
framework/extensions/widgets/widgets/ct-posts/widget.php
CHANGED
|
@@ -12,6 +12,7 @@ class Blocksy_Widget_Ct_Posts extends BlocksyWidgetFactory {
|
|
| 12 |
return [
|
| 13 |
'name' => __('Posts', 'blc'),
|
| 14 |
'description' => __('Description', 'blc'),
|
|
|
|
| 15 |
];
|
| 16 |
}
|
| 17 |
|
| 12 |
return [
|
| 13 |
'name' => __('Posts', 'blc'),
|
| 14 |
'description' => __('Description', 'blc'),
|
| 15 |
+
'customize_selective_refresh' => true
|
| 16 |
];
|
| 17 |
}
|
| 18 |
|
framework/extensions/widgets/widgets/ct-quote/options.php
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Quote widget
|
| 4 |
+
*
|
| 5 |
+
* @copyright 2019-present Creative Themes
|
| 6 |
+
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
|
| 7 |
+
* @package Blocksy
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
$options = [
|
| 12 |
+
|
| 13 |
+
'title' => [
|
| 14 |
+
'type' => 'text',
|
| 15 |
+
'label' => __( 'Title', 'blc' ),
|
| 16 |
+
'field_attr' => [ 'id' => 'widget-title' ],
|
| 17 |
+
'design' => 'inline',
|
| 18 |
+
'value' => __( 'Quote', 'blc' ),
|
| 19 |
+
'disableRevertButton' => true,
|
| 20 |
+
],
|
| 21 |
+
|
| 22 |
+
'quote_text' => [
|
| 23 |
+
'label' => __( 'Quote text', 'blc' ),
|
| 24 |
+
'type' => 'textarea',
|
| 25 |
+
'value' => '',
|
| 26 |
+
'design' => 'inline',
|
| 27 |
+
'disableRevertButton' => true,
|
| 28 |
+
],
|
| 29 |
+
|
| 30 |
+
'quote_author' => [
|
| 31 |
+
'type' => 'text',
|
| 32 |
+
'label' => __( 'Author Name', 'blc' ),
|
| 33 |
+
'field_attr' => [ 'id' => 'widget-title' ],
|
| 34 |
+
'design' => 'inline',
|
| 35 |
+
'value' => __( 'John Doe', 'blc' ),
|
| 36 |
+
'disableRevertButton' => true,
|
| 37 |
+
],
|
| 38 |
+
|
| 39 |
+
'quote_has_by_label' => [
|
| 40 |
+
'type' => 'ct-switch',
|
| 41 |
+
'label' => __( 'Author Label', 'blc' ),
|
| 42 |
+
'value' => 'yes',
|
| 43 |
+
'disableRevertButton' => true,
|
| 44 |
+
],
|
| 45 |
+
|
| 46 |
+
'quote_avatar' => [
|
| 47 |
+
'label' => __('Author Avatar', 'blc'),
|
| 48 |
+
'type' => 'ct-image-uploader',
|
| 49 |
+
'design' => 'inline',
|
| 50 |
+
'value' => [ 'attachment_id' => null ],
|
| 51 |
+
'emptyLabel' => __('Select Image', 'blc'),
|
| 52 |
+
'filledLabel' => __('Change Image', 'blc'),
|
| 53 |
+
],
|
| 54 |
+
|
| 55 |
+
];
|
framework/extensions/widgets/widgets/ct-quote/view.php
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Quote widget
|
| 4 |
+
*
|
| 5 |
+
* @copyright 2019-present Creative Themes
|
| 6 |
+
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
|
| 7 |
+
* @package Blocksy
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
// Widget title
|
| 12 |
+
$title = blocksy_default_akg( 'title', $atts, __( 'Quote', 'blc' ) );
|
| 13 |
+
|
| 14 |
+
// Quote text
|
| 15 |
+
$quote_text = blocksy_default_akg( 'quote_text', $atts, '' );
|
| 16 |
+
|
| 17 |
+
// Quote author
|
| 18 |
+
$quote_author = blocksy_default_akg( 'quote_author', $atts, __( 'John Doe', 'blc' ) );
|
| 19 |
+
|
| 20 |
+
// Quote avatar
|
| 21 |
+
$image_output = blc_call_fn(['fn' => 'blocksy_image'], [
|
| 22 |
+
'attachment_id' => blocksy_default_akg( 'quote_avatar/attachment_id', $atts, null ),
|
| 23 |
+
'ratio' => '1/1',
|
| 24 |
+
'tag_name' => 'figure',
|
| 25 |
+
'size' => 'thumbnail'
|
| 26 |
+
]);
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
| 30 |
+
echo $before_widget;
|
| 31 |
+
|
| 32 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
| 33 |
+
if (! empty(trim($title))) {
|
| 34 |
+
echo $before_title . wp_kses_post( $title ) . $after_title;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
?>
|
| 38 |
+
|
| 39 |
+
<blockquote>
|
| 40 |
+
<?php echo $quote_text; ?>
|
| 41 |
+
</blockquote>
|
| 42 |
+
|
| 43 |
+
<div class="ct-quote-author">
|
| 44 |
+
<?php echo $image_output; ?>
|
| 45 |
+
|
| 46 |
+
<?php if (blocksy_default_akg('quote_has_by_label', $atts, 'yes') === 'yes') { ?>
|
| 47 |
+
<?php echo sprintf(
|
| 48 |
+
// translators: %s here is the author name
|
| 49 |
+
__('By %s', 'blc'),
|
| 50 |
+
$quote_author
|
| 51 |
+
) ?>
|
| 52 |
+
<?php } else { ?>
|
| 53 |
+
<?php echo $quote_author; ?>
|
| 54 |
+
<?php } ?>
|
| 55 |
+
</div>
|
| 56 |
+
|
| 57 |
+
<?php echo wp_kses_post( $after_widget ); ?>
|
framework/extensions/widgets/widgets/ct-quote/widget.php
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Quote widget
|
| 4 |
+
*
|
| 5 |
+
* @copyright 2019-present Creative Themes
|
| 6 |
+
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
|
| 7 |
+
* @package Blocksy
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
class Blocksy_Widget_Ct_Quote extends BlocksyWidgetFactory {
|
| 11 |
+
protected function get_config() {
|
| 12 |
+
return [
|
| 13 |
+
'name' => __('Quote', 'blc'),
|
| 14 |
+
'description' => __('Quote', 'blc'),
|
| 15 |
+
'customize_selective_refresh' => true
|
| 16 |
+
];
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
public function get_path() {
|
| 20 |
+
return dirname(__FILE__);
|
| 21 |
+
}
|
| 22 |
+
}
|
framework/extensions/widgets/widgets/ct-socials/options.php
CHANGED
|
@@ -42,66 +42,16 @@ $options = [
|
|
| 42 |
'enabled' => true,
|
| 43 |
],
|
| 44 |
|
| 45 |
-
[
|
| 46 |
-
'id' => 'gplus',
|
| 47 |
-
'enabled' => true,
|
| 48 |
-
],
|
| 49 |
-
|
| 50 |
[
|
| 51 |
'id' => 'instagram',
|
| 52 |
'enabled' => true,
|
| 53 |
],
|
| 54 |
],
|
| 55 |
|
| 56 |
-
'settings' => [
|
| 57 |
-
'
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
'twitter' => [
|
| 62 |
-
'label' => __( 'Twitter', 'blc' ),
|
| 63 |
-
],
|
| 64 |
-
|
| 65 |
-
'gplus' => [
|
| 66 |
-
'label' => __( 'Google Plus', 'blc' ),
|
| 67 |
-
],
|
| 68 |
-
|
| 69 |
-
'instagram' => [
|
| 70 |
-
'label' => __( 'Instagram', 'blc' ),
|
| 71 |
-
],
|
| 72 |
-
|
| 73 |
-
'pinterest' => [
|
| 74 |
-
'label' => __( 'Pinterest', 'blc' ),
|
| 75 |
-
],
|
| 76 |
-
|
| 77 |
-
'dribbble' => [
|
| 78 |
-
'label' => __( 'Dribbble', 'blc' ),
|
| 79 |
-
],
|
| 80 |
-
|
| 81 |
-
'linkedin' => [
|
| 82 |
-
'label' => __( 'LinkedIn', 'blc' ),
|
| 83 |
-
],
|
| 84 |
-
|
| 85 |
-
'medium' => [
|
| 86 |
-
'label' => __( 'Medium', 'blc' ),
|
| 87 |
-
],
|
| 88 |
-
|
| 89 |
-
'patreon' => [
|
| 90 |
-
'label' => __( 'Patreon', 'blc' ),
|
| 91 |
-
],
|
| 92 |
-
|
| 93 |
-
'vk' => [
|
| 94 |
-
'label' => __( 'VK', 'blc' ),
|
| 95 |
-
],
|
| 96 |
-
|
| 97 |
-
'youtube' => [
|
| 98 |
-
'label' => __( 'YouTube', 'blc' ),
|
| 99 |
-
],
|
| 100 |
-
|
| 101 |
-
'vimeo' => [
|
| 102 |
-
'label' => __( 'Vimeo', 'blc' ),
|
| 103 |
-
],
|
| 104 |
-
],
|
| 105 |
],
|
| 106 |
|
| 107 |
'social_icons_size' => [
|
|
@@ -119,14 +69,14 @@ $options = [
|
|
| 119 |
],
|
| 120 |
|
| 121 |
'social_type' => [
|
| 122 |
-
'label' => __( 'Icons Type', 'blc' ),
|
| 123 |
'type' => 'ct-radio',
|
| 124 |
'value' => 'simple',
|
| 125 |
'view' => 'text',
|
| 126 |
'design' => 'block',
|
| 127 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 128 |
'choices' => [
|
| 129 |
-
'simple' => __( '
|
| 130 |
'rounded' => __( 'Rounded', 'blc' ),
|
| 131 |
'square' => __( 'Square', 'blc' ),
|
| 132 |
],
|
|
@@ -138,15 +88,15 @@ $options = [
|
|
| 138 |
'options' => [
|
| 139 |
|
| 140 |
'social_icons_fill' => [
|
| 141 |
-
'label' => __( '
|
| 142 |
'type' => 'ct-radio',
|
| 143 |
'value' => 'outline',
|
| 144 |
'view' => 'text',
|
| 145 |
'design' => 'block',
|
| 146 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 147 |
'choices' => [
|
| 148 |
-
'outline' => __( 'Outline', 'blc' ),
|
| 149 |
'solid' => __( 'Solid', 'blc' ),
|
|
|
|
| 150 |
],
|
| 151 |
],
|
| 152 |
|
| 42 |
'enabled' => true,
|
| 43 |
],
|
| 44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
[
|
| 46 |
'id' => 'instagram',
|
| 47 |
'enabled' => true,
|
| 48 |
],
|
| 49 |
],
|
| 50 |
|
| 51 |
+
'settings' => blc_call_fn([
|
| 52 |
+
'fn' => 'blocksy_get_social_networks_list',
|
| 53 |
+
'default' => []
|
| 54 |
+
])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
],
|
| 56 |
|
| 57 |
'social_icons_size' => [
|
| 69 |
],
|
| 70 |
|
| 71 |
'social_type' => [
|
| 72 |
+
'label' => __( 'Icons Shape Type', 'blc' ),
|
| 73 |
'type' => 'ct-radio',
|
| 74 |
'value' => 'simple',
|
| 75 |
'view' => 'text',
|
| 76 |
'design' => 'block',
|
| 77 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 78 |
'choices' => [
|
| 79 |
+
'simple' => __( 'None', 'blc' ),
|
| 80 |
'rounded' => __( 'Rounded', 'blc' ),
|
| 81 |
'square' => __( 'Square', 'blc' ),
|
| 82 |
],
|
| 88 |
'options' => [
|
| 89 |
|
| 90 |
'social_icons_fill' => [
|
| 91 |
+
'label' => __( 'Shape Fill Type', 'blc' ),
|
| 92 |
'type' => 'ct-radio',
|
| 93 |
'value' => 'outline',
|
| 94 |
'view' => 'text',
|
| 95 |
'design' => 'block',
|
| 96 |
'setting' => [ 'transport' => 'postMessage' ],
|
| 97 |
'choices' => [
|
|
|
|
| 98 |
'solid' => __( 'Solid', 'blc' ),
|
| 99 |
+
'outline' => __( 'Outline', 'blc' ),
|
| 100 |
],
|
| 101 |
],
|
| 102 |
|
framework/extensions/widgets/widgets/ct-socials/view.php
CHANGED
|
@@ -20,7 +20,8 @@ $fill = blocksy_default_akg('social_icons_fill', $atts, 'outline');
|
|
| 20 |
* blocksy_social_icons() function is already properly escaped.
|
| 21 |
* Escaping it again here would cause SVG icons to not be outputed
|
| 22 |
*/
|
| 23 |
-
echo
|
|
|
|
| 24 |
blocksy_default_akg(
|
| 25 |
'socials',
|
| 26 |
$atts,
|
|
@@ -35,20 +36,17 @@ echo blocksy_social_icons(
|
|
| 35 |
'enabled' => true,
|
| 36 |
],
|
| 37 |
|
| 38 |
-
[
|
| 39 |
-
'id' => 'gplus',
|
| 40 |
-
'enabled' => true,
|
| 41 |
-
],
|
| 42 |
-
|
| 43 |
[
|
| 44 |
'id' => 'instagram',
|
| 45 |
'enabled' => true,
|
| 46 |
],
|
| 47 |
]
|
| 48 |
),
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
|
|
|
|
|
|
| 52 |
);
|
| 53 |
|
| 54 |
echo wp_kses_post($after_widget);
|
| 20 |
* blocksy_social_icons() function is already properly escaped.
|
| 21 |
* Escaping it again here would cause SVG icons to not be outputed
|
| 22 |
*/
|
| 23 |
+
echo blc_call_fn(
|
| 24 |
+
['fn' => 'blocksy_social_icons'],
|
| 25 |
blocksy_default_akg(
|
| 26 |
'socials',
|
| 27 |
$atts,
|
| 36 |
'enabled' => true,
|
| 37 |
],
|
| 38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
[
|
| 40 |
'id' => 'instagram',
|
| 41 |
'enabled' => true,
|
| 42 |
],
|
| 43 |
]
|
| 44 |
),
|
| 45 |
+
[
|
| 46 |
+
'size' => $size,
|
| 47 |
+
'fill' => $fill,
|
| 48 |
+
'type' => $type
|
| 49 |
+
]
|
| 50 |
);
|
| 51 |
|
| 52 |
echo wp_kses_post($after_widget);
|
framework/extensions/widgets/widgets/ct-socials/widget.php
CHANGED
|
@@ -13,6 +13,7 @@ class Blocksy_Widget_Ct_Socials extends BlocksyWidgetFactory {
|
|
| 13 |
return [
|
| 14 |
'name' => __('Social Icons', 'blc'),
|
| 15 |
'description' => __('Social channels icons', 'blc'),
|
|
|
|
| 16 |
];
|
| 17 |
}
|
| 18 |
|
| 13 |
return [
|
| 14 |
'name' => __('Social Icons', 'blc'),
|
| 15 |
'description' => __('Social channels icons', 'blc'),
|
| 16 |
+
'customize_selective_refresh' => true
|
| 17 |
];
|
| 18 |
}
|
| 19 |
|
framework/extensions/woocommerce-extra/config.php
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
$config = [
|
| 4 |
+
'name' => __('WooCommerce Extra', 'blc'),
|
| 5 |
+
'description' => __('WooCommerce extra functionality.', 'blc')
|
| 6 |
+
];
|
| 7 |
+
|
framework/extensions/woocommerce-extra/customizer.php
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
$options = [
|
| 4 |
+
'woocommerce_quickview_enabled' => [
|
| 5 |
+
'label' => __( 'Quick View', 'blc' ),
|
| 6 |
+
'type' => 'ct-switch',
|
| 7 |
+
'switch' => true,
|
| 8 |
+
'value' => 'yes',
|
| 9 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 10 |
+
'sync' => blc_call_fn([
|
| 11 |
+
'fn' => 'blocksy_sync_whole_page',
|
| 12 |
+
'default' => []
|
| 13 |
+
], [
|
| 14 |
+
'loader_selector' => '#primary.content-area .ct-open-quick-view'
|
| 15 |
+
]),
|
| 16 |
+
],
|
| 17 |
+
|
| 18 |
+
'woocommerce_quick_view_trigger' => [
|
| 19 |
+
'label' => __( 'Trigger Modal On', 'blocksy' ),
|
| 20 |
+
'type' => 'ct-select',
|
| 21 |
+
'value' => 'button',
|
| 22 |
+
'view' => 'text',
|
| 23 |
+
'design' => 'inline',
|
| 24 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 25 |
+
'choices' => blocksy_ordered_keys(
|
| 26 |
+
[
|
| 27 |
+
'button' => __( 'Button click', 'blocksy' ),
|
| 28 |
+
'image' => __( 'Image click', 'blocksy' ),
|
| 29 |
+
'card' => __( 'Card click', 'blocksy' ),
|
| 30 |
+
]
|
| 31 |
+
),
|
| 32 |
+
|
| 33 |
+
'sync' => blc_call_fn([
|
| 34 |
+
'fn' => 'blocksy_sync_whole_page',
|
| 35 |
+
'default' => []
|
| 36 |
+
], [
|
| 37 |
+
'loader_selector' => '#primary.content-area .ct-open-quick-view'
|
| 38 |
+
]),
|
| 39 |
+
],
|
| 40 |
+
|
| 41 |
+
blocksy_rand_md5() => [
|
| 42 |
+
'type' => 'ct-divider',
|
| 43 |
+
],
|
| 44 |
+
];
|
| 45 |
+
|
framework/extensions/woocommerce-extra/extension.php
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
require_once dirname( __FILE__ ) . '/helpers.php';
|
| 4 |
+
|
| 5 |
+
class BlocksyExtensionWoocommerceExtra {
|
| 6 |
+
public function __construct() {
|
| 7 |
+
add_action('blocksy:global-dynamic-css:enqueue', function ($args) {
|
| 8 |
+
|
| 9 |
+
blocksy_theme_get_dynamic_styles(array_merge([
|
| 10 |
+
'path' => dirname( __FILE__ ) . '/global.php',
|
| 11 |
+
'chunk' => 'woocommerce'
|
| 12 |
+
], $args));
|
| 13 |
+
|
| 14 |
+
}, 10, 3);
|
| 15 |
+
|
| 16 |
+
add_filter('blocksy-async-scripts-handles', function ($d) {
|
| 17 |
+
$d[] = 'blocksy-ext-woocommerce-extra-scripts';
|
| 18 |
+
return $d;
|
| 19 |
+
});
|
| 20 |
+
|
| 21 |
+
add_action('wp_enqueue_scripts', function () {
|
| 22 |
+
if (! function_exists('get_plugin_data')){
|
| 23 |
+
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
$data = get_plugin_data(BLOCKSY__FILE__);
|
| 27 |
+
|
| 28 |
+
if (is_admin()) return;
|
| 29 |
+
|
| 30 |
+
wp_enqueue_style(
|
| 31 |
+
'blocksy-ext-woocommerce-extra-styles',
|
| 32 |
+
BLOCKSY_URL . 'framework/extensions/woocommerce-extra/static/bundle/main.css',
|
| 33 |
+
['ct-main-styles'],
|
| 34 |
+
$data['Version']
|
| 35 |
+
);
|
| 36 |
+
|
| 37 |
+
wp_enqueue_script(
|
| 38 |
+
'blocksy-ext-woocommerce-extra-scripts',
|
| 39 |
+
BLOCKSY_URL . 'framework/extensions/woocommerce-extra/static/bundle/main.js',
|
| 40 |
+
[
|
| 41 |
+
'wc-single-product',
|
| 42 |
+
'wc-add-to-cart-variation',
|
| 43 |
+
'flexslider',
|
| 44 |
+
'ct-scripts',
|
| 45 |
+
// 'photoswipe-ui-default',
|
| 46 |
+
// 'photoswipe-default-skin',
|
| 47 |
+
// 'wc-single-product',
|
| 48 |
+
// 'wc-product-gallery-lightbox'
|
| 49 |
+
],
|
| 50 |
+
$data['Version'],
|
| 51 |
+
true
|
| 52 |
+
);
|
| 53 |
+
});
|
| 54 |
+
|
| 55 |
+
add_action(
|
| 56 |
+
'customize_preview_init',
|
| 57 |
+
function () {
|
| 58 |
+
if (! function_exists('get_plugin_data')){
|
| 59 |
+
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
$data = get_plugin_data(BLOCKSY__FILE__);
|
| 63 |
+
|
| 64 |
+
wp_enqueue_script(
|
| 65 |
+
'blocksy-woocommerce-extra-customizer-sync',
|
| 66 |
+
BLOCKSY_URL . 'framework/extensions/woocommerce-extra/static/bundle/sync.js',
|
| 67 |
+
[ 'customize-preview', 'ct-scripts', 'ct-events' ],
|
| 68 |
+
$data['Version'],
|
| 69 |
+
true
|
| 70 |
+
);
|
| 71 |
+
}
|
| 72 |
+
);
|
| 73 |
+
|
| 74 |
+
add_filter(
|
| 75 |
+
'blocksy_woo_card_options_elements',
|
| 76 |
+
function ($opts) {
|
| 77 |
+
$opts[] = blc_call_fn(
|
| 78 |
+
['fn' => 'blocksy_get_options'],
|
| 79 |
+
dirname( __FILE__ ) . '/customizer.php',
|
| 80 |
+
[], false
|
| 81 |
+
);
|
| 82 |
+
|
| 83 |
+
return $opts;
|
| 84 |
+
}
|
| 85 |
+
);
|
| 86 |
+
|
| 87 |
+
add_filter(
|
| 88 |
+
'blocksy_single_product_elements_end_customizer_options',
|
| 89 |
+
function ($opts) {
|
| 90 |
+
$opts['has_floating_bar'] = blc_call_fn(
|
| 91 |
+
['fn' => 'blocksy_get_options'],
|
| 92 |
+
dirname( __FILE__ ) . '/floating-cart.php',
|
| 93 |
+
[], false
|
| 94 |
+
);
|
| 95 |
+
|
| 96 |
+
return $opts;
|
| 97 |
+
}
|
| 98 |
+
);
|
| 99 |
+
}
|
| 100 |
+
}
|
framework/extensions/woocommerce-extra/floating-cart.php
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
$options = [
|
| 4 |
+
'label' => __( 'Floating Cart', 'blocksy' ),
|
| 5 |
+
'type' => 'ct-panel',
|
| 6 |
+
'switch' => true,
|
| 7 |
+
'value' => 'yes',
|
| 8 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 9 |
+
'inner-options' => [
|
| 10 |
+
|
| 11 |
+
'floatingBarFontColor' => [
|
| 12 |
+
'label' => __( 'Font Color', 'blocksy' ),
|
| 13 |
+
'type' => 'ct-color-picker',
|
| 14 |
+
'design' => 'inline',
|
| 15 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 16 |
+
'value' => [
|
| 17 |
+
'default' => [
|
| 18 |
+
'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
|
| 19 |
+
],
|
| 20 |
+
],
|
| 21 |
+
|
| 22 |
+
'pickers' => [
|
| 23 |
+
[
|
| 24 |
+
'title' => __( 'Initial', 'blocksy' ),
|
| 25 |
+
'id' => 'default',
|
| 26 |
+
'inherit' => 'var(--color)'
|
| 27 |
+
],
|
| 28 |
+
],
|
| 29 |
+
],
|
| 30 |
+
|
| 31 |
+
'floatingBarBackground' => [
|
| 32 |
+
'label' => __( 'Background Color', 'blocksy' ),
|
| 33 |
+
'type' => 'ct-color-picker',
|
| 34 |
+
'design' => 'inline',
|
| 35 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 36 |
+
'value' => [
|
| 37 |
+
'default' => [
|
| 38 |
+
'color' => '#ffffff',
|
| 39 |
+
],
|
| 40 |
+
],
|
| 41 |
+
|
| 42 |
+
'pickers' => [
|
| 43 |
+
[
|
| 44 |
+
'title' => __( 'Initial', 'blocksy' ),
|
| 45 |
+
'id' => 'default',
|
| 46 |
+
],
|
| 47 |
+
],
|
| 48 |
+
],
|
| 49 |
+
|
| 50 |
+
'floatingBarShadow' => [
|
| 51 |
+
'label' => __( 'Shadow', 'blocksy' ),
|
| 52 |
+
'type' => 'ct-box-shadow',
|
| 53 |
+
'responsive' => true,
|
| 54 |
+
'divider' => 'top',
|
| 55 |
+
'value' => blc_call_fn(['fn' => 'blocksy_box_shadow_value'], [
|
| 56 |
+
'enable' => true,
|
| 57 |
+
'h_offset' => 0,
|
| 58 |
+
'v_offset' => 10,
|
| 59 |
+
'blur' => 20,
|
| 60 |
+
'spread' => 0,
|
| 61 |
+
'inset' => false,
|
| 62 |
+
'color' => [
|
| 63 |
+
'color' => 'rgba(44,62,80,0.15)',
|
| 64 |
+
],
|
| 65 |
+
]),
|
| 66 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 67 |
+
],
|
| 68 |
+
|
| 69 |
+
'floatingBarVisibility' => [
|
| 70 |
+
'label' => __('Visibility', 'blocksy'),
|
| 71 |
+
'type' => 'ct-visibility',
|
| 72 |
+
'design' => 'block',
|
| 73 |
+
'divider' => 'top',
|
| 74 |
+
'setting' => ['transport' => 'postMessage'],
|
| 75 |
+
'allow_empty' => true,
|
| 76 |
+
|
| 77 |
+
'value' => [
|
| 78 |
+
'desktop' => true,
|
| 79 |
+
'tablet' => true,
|
| 80 |
+
'mobile' => false,
|
| 81 |
+
],
|
| 82 |
+
|
| 83 |
+
'choices' => blocksy_ordered_keys([
|
| 84 |
+
'desktop' => __( 'Desktop', 'blocksy' ),
|
| 85 |
+
'tablet' => __( 'Tablet', 'blocksy' ),
|
| 86 |
+
'mobile' => __( 'Mobile', 'blocksy' ),
|
| 87 |
+
]),
|
| 88 |
+
],
|
| 89 |
+
|
| 90 |
+
],
|
| 91 |
+
];
|
| 92 |
+
|
framework/extensions/woocommerce-extra/global.php
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
if (! function_exists('is_woocommerce')) {
|
| 4 |
+
return;
|
| 5 |
+
}
|
| 6 |
+
|
| 7 |
+
// Floating bar
|
| 8 |
+
blc_call_fn(['fn' => 'blocksy_output_colors'], [
|
| 9 |
+
'value' => get_theme_mod('floatingBarFontColor'),
|
| 10 |
+
'default' => [
|
| 11 |
+
'default' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
|
| 12 |
+
],
|
| 13 |
+
'css' => $css,
|
| 14 |
+
'variables' => [
|
| 15 |
+
'default' => [
|
| 16 |
+
'selector' => '.ct-floating-bar',
|
| 17 |
+
'variable' => 'color'
|
| 18 |
+
],
|
| 19 |
+
],
|
| 20 |
+
]);
|
| 21 |
+
|
| 22 |
+
blc_call_fn(['fn' => 'blocksy_output_colors'], [
|
| 23 |
+
'value' => get_theme_mod('floatingBarBackground'),
|
| 24 |
+
'default' => [
|
| 25 |
+
'default' => [ 'color' => '#ffffff' ],
|
| 26 |
+
],
|
| 27 |
+
'css' => $css,
|
| 28 |
+
'variables' => [
|
| 29 |
+
'default' => [
|
| 30 |
+
'selector' => '.ct-floating-bar',
|
| 31 |
+
'variable' => 'backgroundColor'
|
| 32 |
+
],
|
| 33 |
+
],
|
| 34 |
+
]);
|
| 35 |
+
|
| 36 |
+
blc_call_fn(['fn' => 'blocksy_output_box_shadow'], [
|
| 37 |
+
'css' => $css,
|
| 38 |
+
'tablet_css' => $tablet_css,
|
| 39 |
+
'mobile_css' => $mobile_css,
|
| 40 |
+
'selector' => '.ct-floating-bar',
|
| 41 |
+
'value' => get_theme_mod(
|
| 42 |
+
'floatingBarShadow',
|
| 43 |
+
blc_call_fn(['fn' => 'blocksy_box_shadow_value'], [
|
| 44 |
+
'enable' => true,
|
| 45 |
+
'h_offset' => 0,
|
| 46 |
+
'v_offset' => 10,
|
| 47 |
+
'blur' => 20,
|
| 48 |
+
'spread' => 0,
|
| 49 |
+
'inset' => false,
|
| 50 |
+
'color' => [
|
| 51 |
+
'color' => 'rgba(44,62,80,0.15)',
|
| 52 |
+
],
|
| 53 |
+
])
|
| 54 |
+
),
|
| 55 |
+
'responsive' => true
|
| 56 |
+
]);
|
| 57 |
+
|
| 58 |
+
blc_call_fn(['fn' => 'blocksy_output_responsive_switch'], [
|
| 59 |
+
'css' => $css,
|
| 60 |
+
'tablet_css' => $tablet_css,
|
| 61 |
+
'mobile_css' => $mobile_css,
|
| 62 |
+
'selector' => '.ct-floating-bar',
|
| 63 |
+
'on' => 'flex',
|
| 64 |
+
'off' => 'none',
|
| 65 |
+
'value' => get_theme_mod('floatingBarVisibility', [
|
| 66 |
+
'desktop' => true,
|
| 67 |
+
'tablet' => true,
|
| 68 |
+
'mobile' => false,
|
| 69 |
+
])
|
| 70 |
+
]);
|
framework/extensions/woocommerce-extra/helpers.php
ADDED
|
@@ -0,0 +1,281 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
add_action('wp_ajax_blocsky_get_woo_quick_view', 'blocksy_get_woocommerce_quickview');
|
| 4 |
+
add_action('wp_ajax_nopriv_blocsky_get_woo_quick_view', 'blocksy_get_woocommerce_quickview');
|
| 5 |
+
|
| 6 |
+
function blocksy_get_woocommerce_quickview() {
|
| 7 |
+
global $product;
|
| 8 |
+
global $post;
|
| 9 |
+
|
| 10 |
+
global $blocksy_is_quick_view;
|
| 11 |
+
|
| 12 |
+
$blocksy_is_quick_view = true;
|
| 13 |
+
|
| 14 |
+
$product = wc_get_product(sanitize_text_field( $_GET['product_id'] ));
|
| 15 |
+
|
| 16 |
+
$GLOBALS['product'] = $product;
|
| 17 |
+
|
| 18 |
+
$id = $product->get_id();
|
| 19 |
+
|
| 20 |
+
$post = get_post($id);
|
| 21 |
+
|
| 22 |
+
if (! $product) {
|
| 23 |
+
wp_send_json_error();
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
$is_in_stock = true;
|
| 27 |
+
|
| 28 |
+
if (! $product->managing_stock() && ! $product->is_in_stock()) {
|
| 29 |
+
$is_in_stock = false;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
$content = ob_start();
|
| 33 |
+
|
| 34 |
+
remove_filter(
|
| 35 |
+
'woocommerce_post_class',
|
| 36 |
+
'blocksy_woo_single_post_class',
|
| 37 |
+
999,
|
| 38 |
+
2
|
| 39 |
+
);
|
| 40 |
+
|
| 41 |
+
?>
|
| 42 |
+
|
| 43 |
+
<div id="quick-view-<?php echo esc_attr($id) ?>" data-behaviour="modal" class="ct-panel quick-view-modal">
|
| 44 |
+
<div class="content-container" data-align="middle">
|
| 45 |
+
<div <?php wc_product_class('ct-container ct-quick-view-card single-product', $product->get_id()) ?>>
|
| 46 |
+
|
| 47 |
+
<div class="close-button">
|
| 48 |
+
<span class="ct-trigger closed"><span></span></span>
|
| 49 |
+
</div>
|
| 50 |
+
|
| 51 |
+
<section>
|
| 52 |
+
<?php woocommerce_show_product_sale_flash() ?>
|
| 53 |
+
<?php woocommerce_show_product_images() ?>
|
| 54 |
+
|
| 55 |
+
<div class="entry-summary">
|
| 56 |
+
<?php
|
| 57 |
+
woocommerce_template_single_title();
|
| 58 |
+
woocommerce_template_single_price();
|
| 59 |
+
woocommerce_template_single_excerpt();
|
| 60 |
+
woocommerce_template_single_add_to_cart();
|
| 61 |
+
?>
|
| 62 |
+
|
| 63 |
+
<a href="<?php echo get_permalink($product->get_id()) ?>" class="ct-button ct-quick-more">
|
| 64 |
+
<?php echo __('Go to product page', 'blc') ?>
|
| 65 |
+
</a>
|
| 66 |
+
</div>
|
| 67 |
+
</section>
|
| 68 |
+
</div>
|
| 69 |
+
</div>
|
| 70 |
+
</div>
|
| 71 |
+
|
| 72 |
+
<?php
|
| 73 |
+
|
| 74 |
+
wp_send_json_success([
|
| 75 |
+
'quickview' => ob_get_clean()
|
| 76 |
+
]);
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
function blocksy_quick_view_attr() {
|
| 80 |
+
if (get_theme_mod('woocommerce_quickview_enabled', 'yes') !== 'yes') {
|
| 81 |
+
return [];
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
if (get_theme_mod('woocommerce_quick_view_trigger', 'button') === 'button') {
|
| 85 |
+
return [];
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
return [
|
| 89 |
+
'data-quick-view' => get_theme_mod('woocommerce_quick_view_trigger', 'button')
|
| 90 |
+
];
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
function blocksy_output_quick_view_link() {
|
| 94 |
+
global $product;
|
| 95 |
+
|
| 96 |
+
$id = $product->get_id();
|
| 97 |
+
|
| 98 |
+
if (
|
| 99 |
+
get_theme_mod('woocommerce_quickview_enabled', 'yes') === 'yes'
|
| 100 |
+
&&
|
| 101 |
+
get_theme_mod('woocommerce_quick_view_trigger', 'button') === 'button'
|
| 102 |
+
) {
|
| 103 |
+
return '<a href="#quick-view-' . $id . '" class="ct-open-quick-view" aria-label="' . __('Quick view', 'blocksy') . '"><span hidden>' . __('Quick view', 'blocksy') . '</span><svg width="16" height="16" viewBox="0 0 40 40"><path d="M39.6,18.6C34.9,11.5,29.2,5,20,5C10.8,5,5.1,11.5,0.4,18.6c-0.6,0.8-0.6,1.9,0,2.8C5.1,28.5,10.8,35,20,35s14.9-6.5,19.6-13.6C40.1,20.5,40.1,19.5,39.6,18.6z M20,30.7c-5.7,0-10.1-3-15.5-10.7C9.9,12.3,14.3,9.3,20,9.3s10.1,3,15.5,10.7C30.1,27.7,25.7,30.7,20,30.7zM25,20c0,2.8-2.2,5-5,5s-5-2.2-5-5s2.2-5,5-5C22.8,15,25,17.2,25,20z"/></svg></a>';
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
return '';
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
function blc_output_woo_floating_cart_cache() {
|
| 110 |
+
if (! is_customize_preview()) return;
|
| 111 |
+
|
| 112 |
+
blocksy_add_customizer_preview_cache(
|
| 113 |
+
blocksy_html_tag(
|
| 114 |
+
'div',
|
| 115 |
+
[ 'data-id' => 'blocksy-woo-floating-cart' ],
|
| 116 |
+
blocksy_woo_floating_cart(true)
|
| 117 |
+
)
|
| 118 |
+
);
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
function blocksy_woo_product_check_required_addons(
|
| 122 |
+
$product_id, $check_for_required = true
|
| 123 |
+
) {
|
| 124 |
+
if (! class_exists('WC_Product_Addons_Helper')) {
|
| 125 |
+
return false;
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
// No parent add-ons, but yes to global.
|
| 129 |
+
$addons = WC_Product_Addons_Helper::get_product_addons(
|
| 130 |
+
$product_id,
|
| 131 |
+
false,
|
| 132 |
+
false,
|
| 133 |
+
true
|
| 134 |
+
);
|
| 135 |
+
|
| 136 |
+
if ($addons && !empty($addons)) {
|
| 137 |
+
foreach ($addons as $addon) {
|
| 138 |
+
if (isset($addon['required']) && '1' == $addon['required']) {
|
| 139 |
+
return true;
|
| 140 |
+
}
|
| 141 |
+
}
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
return false;
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
function blocksy_woo_product_addons_change_text($text, $product = null) {
|
| 148 |
+
if (null === $product) {
|
| 149 |
+
global $product;
|
| 150 |
+
}
|
| 151 |
+
|
| 152 |
+
if (! is_a($product, 'WC_Product')) {
|
| 153 |
+
return $text;
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
return __('Select options', 'blc');
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
function blocksy_woo_floating_cart($forced = false) {
|
| 160 |
+
if (! function_exists('is_woocommerce')) {
|
| 161 |
+
return '';
|
| 162 |
+
}
|
| 163 |
+
|
| 164 |
+
global $product;
|
| 165 |
+
|
| 166 |
+
if (! is_product()) {
|
| 167 |
+
return '';
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
if (! $forced) {
|
| 171 |
+
blc_output_woo_floating_cart_cache();
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
if (get_theme_mod('has_floating_bar', 'yes') !== 'yes') {
|
| 175 |
+
if (! $forced) {
|
| 176 |
+
return '';
|
| 177 |
+
}
|
| 178 |
+
}
|
| 179 |
+
|
| 180 |
+
$image_output = blc_call_fn(['fn' => 'blocksy_image'], [
|
| 181 |
+
'attachment_id' => $product->get_image_id(),
|
| 182 |
+
'size' => 'woocommerce_gallery_thumbnail',
|
| 183 |
+
'ratio' => '1/1',
|
| 184 |
+
'lazyload' => false,
|
| 185 |
+
'tag_name' => 'div',
|
| 186 |
+
]);
|
| 187 |
+
|
| 188 |
+
ob_start();
|
| 189 |
+
|
| 190 |
+
?>
|
| 191 |
+
<div class="ct-floating-bar">
|
| 192 |
+
<div class="ct-container">
|
| 193 |
+
<section class="floating-bar-content">
|
| 194 |
+
<?php echo $image_output ?>
|
| 195 |
+
<div>
|
| 196 |
+
<?php the_title( '<h6 class="product_title entry-title">', '</h6>' ); ?>
|
| 197 |
+
<?php woocommerce_template_single_price(); ?>
|
| 198 |
+
</div>
|
| 199 |
+
</section>
|
| 200 |
+
|
| 201 |
+
<section class="floating-bar-actions">
|
| 202 |
+
<?php
|
| 203 |
+
woocommerce_template_single_price();
|
| 204 |
+
|
| 205 |
+
if (blocksy_woo_product_check_required_addons($product->get_id())) {
|
| 206 |
+
add_filter('woocommerce_product_add_to_cart_text', 'blocksy_woo_product_addons_change_text', 15);
|
| 207 |
+
woocommerce_template_loop_add_to_cart();
|
| 208 |
+
remove_filter('woocommerce_product_add_to_cart_text', 'blocksy_woo_product_addons_change_text', 15);
|
| 209 |
+
} else {
|
| 210 |
+
if ($product->is_type('simple')) {
|
| 211 |
+
global $wp_filter;
|
| 212 |
+
|
| 213 |
+
if (isset($wp_filter['woocommerce_before_add_to_cart_quantity'])) {
|
| 214 |
+
$old_before = $wp_filter['woocommerce_before_add_to_cart_quantity'];
|
| 215 |
+
}
|
| 216 |
+
|
| 217 |
+
if (isset($wp_filter['woocommerce_after_add_to_cart_quantity'])) {
|
| 218 |
+
$old = $wp_filter['woocommerce_after_add_to_cart_quantity'];
|
| 219 |
+
}
|
| 220 |
+
|
| 221 |
+
if (isset($wp_filter['woocommerce_before_add_to_cart_button'])) {
|
| 222 |
+
$old_button = $wp_filter['woocommerce_before_add_to_cart_button'];
|
| 223 |
+
}
|
| 224 |
+
if (isset($wp_filter['woocommerce_before_add_to_cart_form'])) {
|
| 225 |
+
$old_before_form = $wp_filter['woocommerce_before_add_to_cart_form'];
|
| 226 |
+
}
|
| 227 |
+
|
| 228 |
+
if (isset($wp_filter['woocommerce_after_add_to_cart_form'])) {
|
| 229 |
+
$old_after_form = $wp_filter['woocommerce_after_add_to_cart_form'];
|
| 230 |
+
}
|
| 231 |
+
|
| 232 |
+
if (isset($wp_filter['woocommerce_after_add_to_cart_button'])) {
|
| 233 |
+
$old_after_button = $wp_filter['woocommerce_after_add_to_cart_button'];
|
| 234 |
+
}
|
| 235 |
+
|
| 236 |
+
unset($wp_filter['woocommerce_before_add_to_cart_quantity']);
|
| 237 |
+
unset($wp_filter['woocommerce_after_add_to_cart_quantity']);
|
| 238 |
+
unset($wp_filter['woocommerce_before_add_to_cart_button']);
|
| 239 |
+
unset($wp_filter['woocommerce_before_add_to_cart_form']);
|
| 240 |
+
unset($wp_filter['woocommerce_after_add_to_cart_form']);
|
| 241 |
+
unset($wp_filter['woocommerce_after_add_to_cart_button']);
|
| 242 |
+
|
| 243 |
+
woocommerce_simple_add_to_cart();
|
| 244 |
+
|
| 245 |
+
if (isset($old_before)) {
|
| 246 |
+
$wp_filter['woocommerce_before_add_to_cart_quantity'] = $old_before;
|
| 247 |
+
}
|
| 248 |
+
|
| 249 |
+
if (isset($old)) {
|
| 250 |
+
$wp_filter['woocommerce_after_add_to_cart_quantity'] = $old;
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
if (isset($old_button)) {
|
| 254 |
+
$wp_filter['woocommerce_before_add_to_cart_button'] = $old_button;
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
if (isset($old_after_form)) {
|
| 258 |
+
$wp_filter['woocommerce_after_add_to_cart_form'] = $old_after_form;
|
| 259 |
+
}
|
| 260 |
+
|
| 261 |
+
if (isset($old_before_form)) {
|
| 262 |
+
$wp_filter['woocommerce_before_add_to_cart_form'] = $old_before_form;
|
| 263 |
+
}
|
| 264 |
+
|
| 265 |
+
if (isset($old_after_button)) {
|
| 266 |
+
$wp_filter['woocommerce_after_add_to_cart_button'] = $old_after_button;
|
| 267 |
+
}
|
| 268 |
+
} else {
|
| 269 |
+
woocommerce_template_loop_add_to_cart();
|
| 270 |
+
}
|
| 271 |
+
}
|
| 272 |
+
?>
|
| 273 |
+
</section>
|
| 274 |
+
</div>
|
| 275 |
+
</div>
|
| 276 |
+
<?php
|
| 277 |
+
|
| 278 |
+
return ob_get_clean();
|
| 279 |
+
}
|
| 280 |
+
|
| 281 |
+
|
framework/extensions/woocommerce-extra/readme.php
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<h2><?php echo __('Instructions', 'blc'); ?></h2>
|
| 2 |
+
|
| 3 |
+
<p>
|
| 4 |
+
<?php echo __('After installing and activating the WooCommerce Extra extension you will have these features:', 'blc') ?>
|
| 5 |
+
</p>
|
| 6 |
+
|
| 7 |
+
<ol class="ct-modal-list">
|
| 8 |
+
<li>
|
| 9 |
+
<h4><?php echo __('Product Quick View', 'blc') ?></h4>
|
| 10 |
+
<i>
|
| 11 |
+
<?php
|
| 12 |
+
echo sprintf(
|
| 13 |
+
__('Navigate to %s and enable or disable it.', 'blc'),
|
| 14 |
+
sprintf(
|
| 15 |
+
'<code>%s</code>',
|
| 16 |
+
__('Customizer ➝ WooCommerce ➝ Product Archives ➝ Card Options ➝ Quick View', 'blc')
|
| 17 |
+
)
|
| 18 |
+
);
|
| 19 |
+
?>
|
| 20 |
+
</i>
|
| 21 |
+
</li>
|
| 22 |
+
|
| 23 |
+
<li>
|
| 24 |
+
<h4><?php echo __('Floating Cart', 'blc') ?></h4>
|
| 25 |
+
<i>
|
| 26 |
+
<?php
|
| 27 |
+
echo sprintf(
|
| 28 |
+
__('Navigate to %s and enable or disable it.', 'blc'),
|
| 29 |
+
sprintf(
|
| 30 |
+
'<code>%s</code>',
|
| 31 |
+
__('Customizer ➝ WooCommerce ➝ Single Product ➝ Floating Cart', 'blc')
|
| 32 |
+
)
|
| 33 |
+
);
|
| 34 |
+
?>
|
| 35 |
+
</i>
|
| 36 |
+
</li>
|
| 37 |
+
</ol>
|
framework/extensions/woocommerce-extra/static/bundle/main.css
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* - v1.7.32
|
| 3 |
+
*
|
| 4 |
+
* Copyright (c) 2020
|
| 5 |
+
* Licensed GPLv2+
|
| 6 |
+
*/
|
| 7 |
+
|
| 8 |
+
[id*="quick-view"] [data-loader]{--loaderColor: #fff;--loaderSize: 60px;opacity:1;visibility:visible;-webkit-animation-play-state:running;animation-play-state:running}.ct-open-quick-view{--trigger-size: 36px;--linkInitialColor: var(--color);--linkHoverColor: #fff;position:absolute;z-index:2;display:flex;align-items:center;justify-content:center;width:var(--trigger-size);height:var(--trigger-size);opacity:0;transition:color 0.12s cubic-bezier(0.455, 0.03, 0.515, 0.955),opacity 0.12s cubic-bezier(0.455, 0.03, 0.515, 0.955)}.ct-open-quick-view:focus{opacity:1}.ct-open-quick-view:after{position:absolute;content:'';width:100%;height:100%;border-radius:100%;background:#fff;transition:transform 0.12s cubic-bezier(0.455, 0.03, 0.515, 0.955),background 0.12s cubic-bezier(0.455, 0.03, 0.515, 0.955)}.ct-open-quick-view:hover:after{background:var(--paletteColor1);transform:scale3d(1.1, 1.1, 1)}.ct-open-quick-view svg{position:relative;z-index:1;fill:currentColor}.ct-quick-view-card>section{position:relative;border-radius:7px;background:#fff;-webkit-mask-image:-webkit-radial-gradient(white, black)}@media (max-width: 689.98px){.ct-quick-view-card>section{overflow-y:auto;max-height:inherit}}.ct-quick-view-card .onsale{--badgeTop: 25px;--badgeLeft: 25px}.ct-quick-view-card .close-button{--top: 25px;--right: 25px;--triggerWidth: 14px;--closeButtonSize: 34px;--closeButtonRadius: 100%;--closeButtonColor: var(--color);--closeButtonBackground: #F2F2F2}.ct-quick-view-card .close-button:hover:before{transform:scale(1.15)}[id*="quick-view"]{--backgroundColor: rgba(18, 21, 25, 0.8)}[id*="quick-view"] .content-container{overflow:initial}[id*="quick-view"] .ct-container{--container-max-width: 1000px;min-height:200px;position:relative;border-radius:7px;box-shadow:0px 50px 100px 0px rgba(18,21,25,0.5)}@media (max-width: 689.98px){[id*="quick-view"] .ct-container{max-height:85vh}}@media (min-width: 690px){[id*="quick-view"] .ct-container{max-height:700px}}.ct-quick-view-card .ct-product-view{margin-bottom:0}.ct-quick-view-card .ct-product-view .ct-image-container{pointer-events:none}@media (max-width: 689.98px){.ct-quick-view-card .ct-product-view .ct-ratio{padding-bottom:100% !important}}@media (min-width: 690px){.ct-quick-view-card .ct-product-view{width:50%}}.ct-quick-view-card .flexy-pills[data-type="circle"]{position:absolute;z-index:2;left:0;right:0;bottom:20px;--flexyInitialPill: rgba(255, 255, 255, 0.6);--flexyActivePill: #fff}.ct-quick-view-card{position:relative}@media (max-width: 689.98px){.ct-quick-view-card .entry-summary{padding:6vw 6vw 0 6vw}.ct-quick-view-card .entry-summary:after{padding-bottom:6vw}}@media (min-width: 690px){.ct-quick-view-card .entry-summary{position:absolute;top:0;left:50%;right:0;z-index:1;height:100%;overflow-y:auto;padding:40px 40px 0 40px}.ct-quick-view-card .entry-summary:after{padding-bottom:40px}}.ct-quick-view-card .entry-summary:after{content:'';display:block}.ct-quick-view-card .entry-summary .product_title{padding-right:40px}.ct-quick-view-card .entry-summary form.cart{border-top-style:dashed;border-bottom:1px dashed rgba(224,229,235,0.8)}@media (max-width: 689.98px){.ct-quick-view-card .entry-summary form.cart{margin-bottom:30px;padding-bottom:30px}}@media (min-width: 690px){.ct-quick-view-card .entry-summary form.cart{margin-bottom:40px;padding-bottom:40px}}.ct-quick-view-card .ct-quick-more{--buttonMinHeight: 55px;--buttonTextInitialColor: var(--color);--buttonTextHoverColor: var(--color);--buttonInitialColor: rgba(224,229,235,0.6);--buttonHoverColor: rgba(224,229,235,1);width:100%}.ct-floating-bar{position:fixed;z-index:5;top:calc(var(--admin-bar, 0px) + var(--frame-size, 0px) + var(--headerStickyHeight, 0px));left:var(--frame-size, 0px);right:var(--frame-size, 0px);display:var(--visibility, flex);align-items:center;height:75px;color:var(--color);background:var(--backgroundColor);box-shadow:var(--box-shadow);opacity:0;visibility:hidden;transform:translateY(-75px);transition:opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease}.ct-floating-bar.ct-active{opacity:1;visibility:visible;transform:translateY(0)}.ct-floating-bar>div{display:grid;grid-template-columns:auto auto}.ct-floating-bar section{display:flex;align-items:center}.ct-floating-bar section p{--contentSpacing: 0}.ct-floating-bar section:last-child{justify-content:flex-end}.ct-floating-bar .ct-image-container{border-radius:3px}@media (max-width: 689.98px){.ct-floating-bar .ct-image-container{max-width:40px;margin-right:10px}}@media (min-width: 690px){.ct-floating-bar .ct-image-container{max-width:50px;margin-right:15px}}.ct-floating-bar .product_title{--fontWeight: 600;--headingColor: var(--color);margin-bottom:0}@media (max-width: 689.98px){.ct-floating-bar .product_title{--fontSize: 15px;--fontWeight: 500}}@media (max-width: 689.98px){.ct-floating-bar .price{font-size:12px}}@media (min-width: 690px){.ct-floating-bar .price{margin-right:15px}}.ct-floating-bar .stock{font-size:13px;font-weight:500;text-transform:uppercase;margin-right:15px}.ct-floating-bar .stock:before{content:'/';margin-right:10px}.ct-floating-bar form.cart{display:flex}.ct-floating-bar .quantity{--quantityHeight: 40px;width:80px;margin-right:10px}.ct-floating-bar .quantity input[type="number"]{--formFontSize: 13px}.ct-floating-bar .button,.ct-floating-bar .added_to_cart,.ct-floating-bar .single_add_to_cart_button{--buttonMinHeight: 40px;--padding: 0 15px}.ct-floating-bar .single_add_to_cart_button.added{display:none}@media (min-width: 690px){.floating-bar-content .price{display:none}}@media (max-width: 689.98px){.floating-bar-actions .price,.floating-bar-actions .quantity{display:none}.floating-bar-actions .added_to_cart,.floating-bar-actions .single_add_to_cart_button{--padding: 0 5px;--buttonShadow: none;--buttonTransform: none;min-width:40px;font-size:0 !important}.floating-bar-actions .added_to_cart:after,.floating-bar-actions .single_add_to_cart_button:after{font-family:'woo';font-size:15px;margin:0 !important}.floating-bar-actions .added_to_cart:after{content:'\e906'}.floating-bar-actions .single_add_to_cart_button:not(.loading):after{content:'\e909'}}
|
framework/extensions/woocommerce-extra/static/bundle/main.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
| 1 |
+
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=3)}([function(t,e){t.exports=ctEvents},function(t,e){t.exports=window.jQuery},function(t,e){t.exports=window.ctFrontend},function(t,e,n){"use strict";n.r(e);var r=n(1),o=n.n(r);function i(t){return function(t){if(Array.isArray(t))return c(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return c(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var a=function(){var t=document.querySelector(".ct-floating-bar");if(t){var e=!1,n=function(){var t=document.querySelector(".ct-floating-bar");if(document.querySelector(".single-product .single_add_to_cart_button")){var e=document.querySelector(".single-product .single_add_to_cart_button").getBoundingClientRect();t&&(window.scrollY>window.scrollY+e.top+e.height?t.classList.add("ct-active"):t.classList.remove("ct-active"))}};n(),window.addEventListener("scroll",(function(){e||(e=!0,requestAnimationFrame((function(){n(),e=!1})))}));var r=t.querySelector(".button:not(.single_add_to_cart_button):not(.product_type_external)");r&&r.addEventListener("click",(function(t){t.preventDefault();var e=window.scrollY,n=null;requestAnimationFrame((function t(r){n||(n=r);var o=r-n;if(document.querySelector(".single-product .single_add_to_cart_button")){var i,c,a,u=document.querySelector(".single-product .single_add_to_cart_button").getBoundingClientRect(),l=Math.max((i=o,c=e,a=-e,(i/=700/2)<1?a/2*i*i+c:-a/2*(--i*(i-2)-1)+c),window.scrollY+u.top);scrollTo(0,l),o<700&&requestAnimationFrame(t)}}))}))}},u=n(0),l=n.n(u),s=n(2);function d(t){return function(t){if(Array.isArray(t))return f(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return f(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var m={};l.a.on("blocksy:woo:floating-cart:init",(function(){a()}));var y,p=function(t){var e=t.e,n=t.el;if(!e.target.matches(".add_to_cart_button")&&!e.target.matches(".added_to_cart")){e.preventDefault();var r=Array.from(n.classList).find((function(t){return 0===t.indexOf("post-")})).split("-")[1],c="#quick-view-".concat(r);if(document.querySelector(c))l.a.trigger("ct:overlay:handle-click",{e:e,href:c,options:{clickOutside:!0}});else{var a,u='\n\t\t<div id="quick-view-'.concat(r,'" data-behaviour="modal" class="ct-panel quick-view-modal">\n\t\t\t<span data-loader="circles">\n\t\t\t\t<span></span>\n\t\t\t\t<span></span>\n\t\t\t\t<span></span>\n\t\t\t</span>\n\t\t</div>\n '),f=document.createElement("div");f.innerHTML=u,document.body.appendChild(f.firstElementChild),setTimeout((function(){l.a.trigger("ct:overlay:handle-click",{e:e,href:c,options:{skipScrollLock:!0,scrollContainer:s.getCurrentScreen&&"mobile"===Object(s.getCurrentScreen)()?document.querySelector(c).firstElementChild.lastElementChild.lastElementChild:null,clickOutside:!0,focus:!1}})}),100),(a="".concat(ct_localizations.ajax_url,"?action=blocsky_get_woo_quick_view&product_id=").concat(r),m[a]?new Promise((function(t){t(m[a]),m[a]=m[a].clone()})):new Promise((function(t){return fetch(a).then((function(e){t(e),m[a]=e.clone()}))}))).then((function(t){200===t.status&&t.json().then((function(t){var n=t.success,r=t.data;if(n){var a=document.createElement("div");a.innerHTML=r.quickview,function(t){i(t.querySelectorAll(".ct-image-container.ct-lazy")).map((function(t){t.querySelector("img")&&(t.querySelector("img").setAttribute("src",t.querySelector("img").dataset.ctLazy),t.querySelector("img").dataset.ctLazySet&&t.querySelector("img").setAttribute("srcset",t.querySelector("img").dataset.ctLazySet)),t.classList.remove("ct-lazy"),t.classList.add("ct-lazy-loaded")}))}(a),document.querySelector(c)&&(document.querySelector(c).innerHTML=a.firstElementChild.innerHTML);d(document.querySelectorAll("".concat(c," .variations_form"))).map((function(t){return o()(t).wc_variation_form()})),l.a.trigger("ct:custom-select:init"),l.a.trigger("ct:custom-select-allow:init"),l.a.trigger("ct:add-to-cart:update"),setTimeout((function(){o.a&&o.a.wcpaInit&&o.a.wcpaInit()}),50),setTimeout((function(){l.a.trigger("ct:overlay:handle-click",{e:e,href:c,options:{scrollContainer:s.getCurrentScreen&&"mobile"===Object(s.getCurrentScreen)()?document.querySelector(c).firstElementChild.lastElementChild.lastElementChild:null,clickOutside:!0,focus:!1,forceOpen:!0}}),setTimeout((function(){return l.a.trigger("ct:flexy:update")}))}),100)}}))}))}}},v=function(){a(),d(document.querySelectorAll('.ct-open-quick-view, [data-quick-view="image"] .ct-image-container')).map((function(t){t.hasQuickViewInit||(t.hasQuickViewInit=!0,t.addEventListener("click",(function(e){p({e:e,el:t.closest(".product")})})))})),d(document.querySelectorAll('[data-quick-view="card"] > *')).map((function(t){t.hasQuickViewInit||(t.hasQuickViewInit=!0,t.addEventListener("click",(function(e){p({e:e,el:t})})))}))};y=function(){v(),l.a.on("ct:quick-view:update",(function(){return v()})),l.a.on("ct:infinite-scroll:load",(function(){return v()})),l.a.on("blocksy:frontend:init",(function(){return v()})),l.a.on("ct:modal:closed",(function(t){if(t.closest(".quick-view-modal")){if(t.querySelector(".flexy-container")){var e=t.querySelector(".flexy-container").parentNode;e.flexy&&e.flexy.destroy&&e.flexy.destroy()}setTimeout((function(){t.remove()}))}}))},/comp|inter|loaded/.test(document.readyState)?y():document.addEventListener("DOMContentLoaded",y,!1)}]);
|
framework/extensions/woocommerce-extra/static/bundle/sync.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
| 1 |
+
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e){t.exports=ctEvents},function(t,e){window.ctEvents=window.ctEvents||new function(){var t={},e=1,n=!1;function r(t,e){if("string"!=typeof t)return t;for(var n=t.replace(/\s\s+/g," ").trim().split(" "),r=n.length,o=Object.create(null),i=0;i<r;i++)o[n[i]]=e;return o}function o(t,e){for(var n={},r=Object.keys(t),o=r.length,i=0;i<o;i++){var c=r[i];n[c]=e(c,t[c])}return n}function i(t,r){function o(){return new Array(e).join("│ ")}n&&(void 0!==r?console.log("[Event] "+o()+t,"─",r):console.log("[Event] "+o()+t))}this.countAll=function(e){return t[e]},this.log=i,this.debug=function(t){return n=Boolean(t),this},this.on=function(e,c){return o(r(e,c),(function(e,r){(t[e]||(t[e]=[])).push(r),n&&i("✚ "+e)})),this},this.one=function(e,c){return o(r(e,c),(function(e,r){var o,c,a;(t[e]||(t[e]=[])).push((o=r,a=2,function(){return--a>0&&(c=o.apply(this,arguments)),a<=1&&(o=null),c})),n&&i("✚ ["+e+"]")})),this},this.off=function(e,c){return o(r(e,c),(function(e,r){t[e]&&(r?t[e].splice(t[e].indexOf(r)>>>0,1):t[e]=[],n&&i("✖ "+e))})),this},this.trigger=function(n,c){return o(r(n),(function(e){i("╭─ "+e,c),a(1);try{"fw:options:init"===e&&fw.options.startListeningToEvents(c.$elements||document.body),(t[e]||[]).map(n),(t.all||[]).map(n)}catch(t){if(console.log("%c [Events] Exception raised.","color: red; font-weight: bold;"),"undefined"==typeof console)throw t;console.error(t)}function n(t){t&&t.call(window,c)}a(-1),i("╰─ "+e,c)})),this;function a(t){void 0!==t&&(e+=t>0?1:-1),e<0&&(e=0)}},this.hasListeners=function(e){return!!t&&(t[e]||[]).length>0}}},function(t,e,n){"use strict";n.r(e);var r,o,i,c,a,l,u,s,f,p=function(t){if([t.top,t.right,t.bottom,t.left].reduce((function(t,e){return!!t&&!("auto"!==e&&e&&e.toString().match(/\d/g))}),!0))return"CT_CSS_SKIP_RULE";var e=["auto"!==t.top&&t.top.toString().match(/\d/g)?t.top:0,"auto"!==t.right&&t.right.toString().match(/\d/g)?t.right:0,"auto"!==t.bottom&&t.bottom.toString().match(/\d/g)?t.bottom:0,"auto"!==t.left&&t.left.toString().match(/\d/g)?t.left:0];return e[0]===e[1]&&e[0]===e[2]&&e[0]===e[3]?e[0]:e[0]===e[2]&&e[1]===e[3]?"".concat(e[0]," ").concat(e[3]):e.join(" ")},d=function(t,e){var n=e.forcedOutput,r=void 0!==n&&n;if("CT_CSS_SKIP_RULE"===t)return"CT_CSS_SKIP_RULE";if("none"===t)return"none";if(!t.enable)return r?"none":"CT_CSS_SKIP_RULE";if(0===parseFloat(t.blur)&&0===parseFloat(t.spread)&&0===parseFloat(t.v_offset)&&0===parseFloat(t.h_offset))return r?"none":"CT_CSS_SKIP_RULE";var o=[];return t.inset&&o.push("inset"),o.push("".concat(t.h_offset,"px")),o.push("".concat(t.v_offset,"px")),0!==parseFloat(t.blur)&&(o.push("".concat(t.blur,"px")),0!==parseFloat(t.spread)&&o.push("".concat(t.spread,"px"))),0===parseFloat(t.blur)&&0!==parseFloat(t.spread)&&(o.push("".concat(t.blur,"px")),o.push("".concat(t.spread,"px"))),o.push(t.color.color),o.join(" ")},b=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"desktop",r={desktop:"ct-main-styles-inline-css",tablet:"ct-main-styles-tablet-inline-css",mobile:"ct-main-styles-mobile-inline-css"},o=document.querySelector("style#".concat(r[n])),i=o.innerText,c="".concat(t["".concat(n,"_selector_prefix")]?"".concat(t["".concat(n,"_selector_prefix")]," "):"").concat(t.selector||":root"),a=null,l=i.match(a);0===i.trim().indexOf(c)?(a=new RegExp("".concat(c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=i.match(a)):(a=new RegExp("\\}\\s*?".concat(c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=i.match(a)),l||(0===(i="".concat(i," ").concat(c," { }")).trim().indexOf(c)?(a=new RegExp("".concat(c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=i.match(a)):(a=new RegExp("\\}\\s*?".concat(c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{[\\s\\S]*?}"),"gm"),l=i.match(a))),o.innerText=i.replace(a,l[0].indexOf("--".concat(t.variable,":"))>-1?l[0].replace(new RegExp("--".concat(t.variable,":[\\s\\S]*?;"),"gm"),e.indexOf("CT_CSS_SKIP_RULE")>-1||e.indexOf(t.variable)>-1?"":"--".concat(t.variable,": ").concat(e,";")):l[0].replace(new RegExp("".concat(c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s?{"),"gm"),"".concat(c," {").concat(e.indexOf("CT_CSS_SKIP_RULE")>-1||e.indexOf(t.variable)>-1?"":"--".concat(t.variable,": ").concat(e,";"))))},h=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"desktop",r=(t.type||"").indexOf("color")>-1?e["color"===t.type?"default":t.type.split(":")[1]].color:e;"border"===(t.type||"")&&(r="none"===e.style?"none":"".concat(e.width,"px ").concat(e.style," ").concat(e.color.color)),"spacing"===(t.type||"")&&(r=p(e)),"box-shadow"===(t.type||"")&&(r=d(e,t)),b(t,"".concat(r).concat(t.unit||"").concat(t.important?" !important":""),n)},g=function(t,e){var n=e;e=t.extractValue?t.extractValue(e):e,t.whenDone&&t.whenDone(e,n),e=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t&&Object.keys(t).indexOf("desktop")>-1?e?t:t.desktop:e?{desktop:t,tablet:t,mobile:t}:t}(e,!!t.responsive),t.responsive?(t.enabled&&"no"===!wp.customize(t.enabled)()&&(e.mobile="0"+(t.unit?"":"px"),e.tablet="0"+(t.unit?"":"px"),e.desktop="0"+(t.unit?"":"px")),h(t,e.desktop,"desktop"),h(t,e.tablet,"tablet"),h(t,e.mobile,"mobile")):h(t,e)};r={floatingBarFontColor:{selector:".ct-floating-bar",variable:"color",type:"color"},floatingBarBackground:{selector:".ct-floating-bar",variable:"backgroundColor",type:"color"},floatingBarShadow:{selector:".ct-floating-bar",type:"box-shadow",variable:"box-shadow",responsive:!0},floatingBarVisibility:(o={on:"flex",selector:".ct-floating-bar"},i=o.selector,c=o.variable,a=void 0===c?"visibility":c,l=o.on,u=void 0===l?"block":l,s=o.off,f=void 0===s?"none":s,{selector:i,variable:a,responsive:!0,extractValue:function(t){var e=t.mobile,n=t.tablet,r=t.desktop;return{mobile:e?u:f,tablet:n?u:f,desktop:r?u:f}}})},wp.customize.bind("change",(function(t){return r[t.id]&&(Array.isArray(r[t.id])?r[t.id]:[r[t.id]]).map((function(e){return g(e,t())}))}));n(1);var m=n(0),y=n.n(m);function v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(r=(c=a.next()).done)&&(n.push(c.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}(t,e)||w(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(t){return function(t){if(Array.isArray(t))return _(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||w(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(t,e){if(t){if("string"==typeof t)return _(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(t,e):void 0}}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function x(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function O(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?x(Object(n),!0).forEach((function(e){E(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function E(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var j=function(){var t=document.createElement("div");return t.innerHTML=document.querySelector(".ct-customizer-preview-cache-container").value,t},C=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";if(e||(e=j()),e.querySelector(".ct-customizer-preview-cache [data-".concat(n,'="').concat(t,'"]'))){var r=e.querySelector(".ct-customizer-preview-cache [data-".concat(n,'="').concat(t,'"]')).innerHTML,o=document.createElement("div");return o.innerHTML=r,o}},P=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=O({fragment_id:null,selector:null,parent_selector:null,strategy:"append",whenInserted:function(){},beforeInsert:function(t){},should_insert:!0},t);var e=document.querySelector(t.parent_selector);if(S(document.querySelectorAll("".concat(t.parent_selector," ").concat(t.selector))).map((function(t){return t.parentNode.removeChild(t)})),t.should_insert){var n=C(t.fragment_id);if(n){for(;n.firstElementChild;)if(t.beforeInsert(n.firstElementChild),"append"===t.strategy&&e.appendChild(n.firstElementChild),"firstChild"===t.strategy&&e.insertBefore(n.firstElementChild,e.firstElementChild),t.strategy.indexOf("maybeBefore")>-1){var r=t.strategy.split(":"),o=v(r,2),i=(o[0],o[1]);e.querySelector(i)?e.insertBefore(n.firstElementChild,e.querySelector(i)):e.appendChild(n.firstElementChild)}t.whenInserted()}}};!function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=O({id:null,fragment_id:null,selector:null,parent_selector:null,strategy:"append",whenInserted:function(){},beforeInsert:function(t){},watch:[]},t);var e=function(){var e=wp.customize(t.id)();P(O(O({},t),{},{should_insert:"yes"===e}))};wp.customize(t.id,(function(t){return t.bind((function(t){return e()}))})),t.watch.map((function(t){return wp.customize(t,(function(t){return t.bind((function(){return e()}))}))}))}({id:"has_floating_bar",strategy:"append",parent_selector:"body",selector:".ct-floating-bar",fragment_id:"blocksy-woo-floating-cart",whenInserted:function(){return y.a.trigger("blocksy:woo:floating-cart:init")}})}]);
|
framework/extensions/woocommerce-extra/static/js/floating-cart.js
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export const mountFloatingCart = () => {
|
| 2 |
+
var floatingCart = document.querySelector('.ct-floating-bar')
|
| 3 |
+
|
| 4 |
+
if (!floatingCart) return
|
| 5 |
+
|
| 6 |
+
// browser window scroll (in pixels) after which the "back to top" link is shown
|
| 7 |
+
// browser window scroll (in pixels) after which the "back to top" link opacity is reduced
|
| 8 |
+
var scrolling = false
|
| 9 |
+
|
| 10 |
+
const compute = () => {
|
| 11 |
+
var floatingCart = document.querySelector('.ct-floating-bar')
|
| 12 |
+
|
| 13 |
+
if (
|
| 14 |
+
!document.querySelector(
|
| 15 |
+
'.single-product .single_add_to_cart_button'
|
| 16 |
+
)
|
| 17 |
+
) {
|
| 18 |
+
return
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
const summary = document
|
| 22 |
+
.querySelector('.single-product .single_add_to_cart_button')
|
| 23 |
+
.getBoundingClientRect()
|
| 24 |
+
|
| 25 |
+
if (!floatingCart) return
|
| 26 |
+
|
| 27 |
+
window.scrollY > window.scrollY + summary.top + summary.height
|
| 28 |
+
? floatingCart.classList.add('ct-active')
|
| 29 |
+
: floatingCart.classList.remove('ct-active')
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
compute()
|
| 33 |
+
|
| 34 |
+
window.addEventListener('scroll', () => {
|
| 35 |
+
if (scrolling) return
|
| 36 |
+
|
| 37 |
+
scrolling = true
|
| 38 |
+
|
| 39 |
+
requestAnimationFrame(() => {
|
| 40 |
+
compute()
|
| 41 |
+
scrolling = false
|
| 42 |
+
})
|
| 43 |
+
})
|
| 44 |
+
|
| 45 |
+
const maybeButton = floatingCart.querySelector(
|
| 46 |
+
'.button:not(.single_add_to_cart_button):not(.product_type_external)'
|
| 47 |
+
)
|
| 48 |
+
|
| 49 |
+
if (maybeButton) {
|
| 50 |
+
maybeButton.addEventListener('click', event => {
|
| 51 |
+
event.preventDefault()
|
| 52 |
+
|
| 53 |
+
var start = window.scrollY
|
| 54 |
+
var currentTime = null
|
| 55 |
+
|
| 56 |
+
const animateScroll = timestamp => {
|
| 57 |
+
if (!currentTime) currentTime = timestamp
|
| 58 |
+
var progress = timestamp - currentTime
|
| 59 |
+
|
| 60 |
+
const easeInOutQuad = (t, b, c, d) => {
|
| 61 |
+
t /= d / 2
|
| 62 |
+
if (t < 1) return (c / 2) * t * t + b
|
| 63 |
+
t--
|
| 64 |
+
return (-c / 2) * (t * (t - 2) - 1) + b
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
if (
|
| 68 |
+
!document.querySelector(
|
| 69 |
+
'.single-product .single_add_to_cart_button'
|
| 70 |
+
)
|
| 71 |
+
) {
|
| 72 |
+
return
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
const summary = document
|
| 76 |
+
.querySelector('.single-product .single_add_to_cart_button')
|
| 77 |
+
.getBoundingClientRect()
|
| 78 |
+
|
| 79 |
+
var val = Math.max(
|
| 80 |
+
easeInOutQuad(progress, start, -start, 700),
|
| 81 |
+
window.scrollY + summary.top
|
| 82 |
+
)
|
| 83 |
+
|
| 84 |
+
scrollTo(0, val)
|
| 85 |
+
|
| 86 |
+
if (progress < 700) {
|
| 87 |
+
requestAnimationFrame(animateScroll)
|
| 88 |
+
}
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
requestAnimationFrame(animateScroll)
|
| 92 |
+
})
|
| 93 |
+
}
|
| 94 |
+
}
|
framework/extensions/woocommerce-extra/static/js/helpers.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export const handleResponsiveSwitch = ({
|
| 2 |
+
selector,
|
| 3 |
+
variable = 'visibility',
|
| 4 |
+
on = 'block',
|
| 5 |
+
off = 'none'
|
| 6 |
+
}) => ({
|
| 7 |
+
selector,
|
| 8 |
+
variable,
|
| 9 |
+
responsive: true,
|
| 10 |
+
extractValue: ({ mobile, tablet, desktop }) => ({
|
| 11 |
+
mobile: mobile ? on : off,
|
| 12 |
+
tablet: tablet ? on : off,
|
| 13 |
+
desktop: desktop ? on : off
|
| 14 |
+
})
|
| 15 |
+
})
|
framework/extensions/woocommerce-extra/static/js/main.js
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import $ from 'jquery'
|
| 2 |
+
import { markImagesAsLoaded } from '../../../cookies-consent/static/js/lazy-load-helpers'
|
| 3 |
+
import { onDocumentLoaded } from '../../../cookies-consent/static/js/helpers'
|
| 4 |
+
import { mountFloatingCart } from './floating-cart'
|
| 5 |
+
import ctEvents from 'ct-events'
|
| 6 |
+
import { getCurrentScreen } from 'blocksy-frontend'
|
| 7 |
+
|
| 8 |
+
const store = {}
|
| 9 |
+
|
| 10 |
+
const cachedFetch = url =>
|
| 11 |
+
store[url]
|
| 12 |
+
? new Promise(resolve => {
|
| 13 |
+
resolve(store[url])
|
| 14 |
+
store[url] = store[url].clone()
|
| 15 |
+
})
|
| 16 |
+
: new Promise(resolve =>
|
| 17 |
+
fetch(url).then(response => {
|
| 18 |
+
resolve(response)
|
| 19 |
+
store[url] = response.clone()
|
| 20 |
+
})
|
| 21 |
+
)
|
| 22 |
+
|
| 23 |
+
ctEvents.on('blocksy:woo:floating-cart:init', () => {
|
| 24 |
+
mountFloatingCart()
|
| 25 |
+
})
|
| 26 |
+
|
| 27 |
+
const openQuickViewFor = ({ e, el }) => {
|
| 28 |
+
if (e.target.matches('.add_to_cart_button')) {
|
| 29 |
+
return
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
if (e.target.matches('.added_to_cart')) {
|
| 33 |
+
return
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
e.preventDefault()
|
| 37 |
+
|
| 38 |
+
let productId = Array.from(el.classList)
|
| 39 |
+
.find(className => className.indexOf('post-') === 0)
|
| 40 |
+
.split('-')[1]
|
| 41 |
+
|
| 42 |
+
let href = `#quick-view-${productId}`
|
| 43 |
+
|
| 44 |
+
if (document.querySelector(href)) {
|
| 45 |
+
ctEvents.trigger('ct:overlay:handle-click', {
|
| 46 |
+
e,
|
| 47 |
+
href,
|
| 48 |
+
options: {
|
| 49 |
+
clickOutside: true
|
| 50 |
+
}
|
| 51 |
+
})
|
| 52 |
+
return
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
const loadingHtml = `
|
| 56 |
+
<div id="quick-view-${productId}" data-behaviour="modal" class="ct-panel quick-view-modal">
|
| 57 |
+
<span data-loader="circles">
|
| 58 |
+
<span></span>
|
| 59 |
+
<span></span>
|
| 60 |
+
<span></span>
|
| 61 |
+
</span>
|
| 62 |
+
</div>
|
| 63 |
+
`
|
| 64 |
+
|
| 65 |
+
const div = document.createElement('div')
|
| 66 |
+
|
| 67 |
+
div.innerHTML = loadingHtml
|
| 68 |
+
|
| 69 |
+
document.body.appendChild(div.firstElementChild)
|
| 70 |
+
|
| 71 |
+
setTimeout(() => {
|
| 72 |
+
ctEvents.trigger('ct:overlay:handle-click', {
|
| 73 |
+
e,
|
| 74 |
+
href,
|
| 75 |
+
options: {
|
| 76 |
+
skipScrollLock: true,
|
| 77 |
+
scrollContainer:
|
| 78 |
+
getCurrentScreen && getCurrentScreen() === 'mobile'
|
| 79 |
+
? document.querySelector(href).firstElementChild
|
| 80 |
+
.lastElementChild.lastElementChild
|
| 81 |
+
: null,
|
| 82 |
+
clickOutside: true,
|
| 83 |
+
focus: false
|
| 84 |
+
}
|
| 85 |
+
})
|
| 86 |
+
}, 100)
|
| 87 |
+
|
| 88 |
+
cachedFetch(
|
| 89 |
+
`${ct_localizations.ajax_url}?action=blocsky_get_woo_quick_view&product_id=${productId}`
|
| 90 |
+
).then(r => {
|
| 91 |
+
if (r.status === 200) {
|
| 92 |
+
r.json().then(({ success, data }) => {
|
| 93 |
+
if (!success) return
|
| 94 |
+
|
| 95 |
+
const div = document.createElement('div')
|
| 96 |
+
|
| 97 |
+
div.innerHTML = data.quickview
|
| 98 |
+
|
| 99 |
+
markImagesAsLoaded(div)
|
| 100 |
+
|
| 101 |
+
if (document.querySelector(href)) {
|
| 102 |
+
document.querySelector(href).innerHTML =
|
| 103 |
+
div.firstElementChild.innerHTML
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
const wc_single_product_params = {
|
| 107 |
+
i18n_required_rating_text: 'Please select a rating',
|
| 108 |
+
review_rating_required: 'yes',
|
| 109 |
+
flexslider: {
|
| 110 |
+
rtl: false,
|
| 111 |
+
animation: 'slide',
|
| 112 |
+
smoothHeight: true,
|
| 113 |
+
directionNav: false,
|
| 114 |
+
controlNav: 'thumbnails',
|
| 115 |
+
slideshow: false,
|
| 116 |
+
animationSpeed: 500,
|
| 117 |
+
animationLoop: false,
|
| 118 |
+
allowOneSlide: false
|
| 119 |
+
},
|
| 120 |
+
zoom_enabled: '',
|
| 121 |
+
zoom_options: [],
|
| 122 |
+
photoswipe_enabled: '1',
|
| 123 |
+
photoswipe_options: {
|
| 124 |
+
shareEl: false,
|
| 125 |
+
closeOnScroll: false,
|
| 126 |
+
history: false,
|
| 127 |
+
hideAnimationDuration: 0,
|
| 128 |
+
showAnimationDuration: 0
|
| 129 |
+
},
|
| 130 |
+
flexslider_enabled: '1'
|
| 131 |
+
}
|
| 132 |
+
;[
|
| 133 |
+
...document.querySelectorAll(`${href} .variations_form`)
|
| 134 |
+
].map(el => $(el).wc_variation_form())
|
| 135 |
+
|
| 136 |
+
ctEvents.trigger('ct:custom-select:init')
|
| 137 |
+
ctEvents.trigger('ct:custom-select-allow:init')
|
| 138 |
+
|
| 139 |
+
ctEvents.trigger('ct:add-to-cart:update')
|
| 140 |
+
|
| 141 |
+
setTimeout(() => {
|
| 142 |
+
if ($) {
|
| 143 |
+
$.wcpaInit && $.wcpaInit()
|
| 144 |
+
}
|
| 145 |
+
}, 50)
|
| 146 |
+
|
| 147 |
+
setTimeout(() => {
|
| 148 |
+
ctEvents.trigger('ct:overlay:handle-click', {
|
| 149 |
+
e,
|
| 150 |
+
href,
|
| 151 |
+
options: {
|
| 152 |
+
scrollContainer:
|
| 153 |
+
getCurrentScreen &&
|
| 154 |
+
getCurrentScreen() === 'mobile'
|
| 155 |
+
? document.querySelector(href)
|
| 156 |
+
.firstElementChild.lastElementChild
|
| 157 |
+
.lastElementChild
|
| 158 |
+
: null,
|
| 159 |
+
clickOutside: true,
|
| 160 |
+
focus: false,
|
| 161 |
+
forceOpen: true
|
| 162 |
+
}
|
| 163 |
+
})
|
| 164 |
+
setTimeout(() => ctEvents.trigger('ct:flexy:update'))
|
| 165 |
+
}, 100)
|
| 166 |
+
})
|
| 167 |
+
}
|
| 168 |
+
})
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
const mount = () => {
|
| 172 |
+
mountFloatingCart()
|
| 173 |
+
;[
|
| 174 |
+
...document.querySelectorAll(
|
| 175 |
+
'.ct-open-quick-view, [data-quick-view="image"] .ct-image-container'
|
| 176 |
+
)
|
| 177 |
+
].map(el => {
|
| 178 |
+
if (el.hasQuickViewInit) return
|
| 179 |
+
el.hasQuickViewInit = true
|
| 180 |
+
|
| 181 |
+
el.addEventListener('click', e => {
|
| 182 |
+
openQuickViewFor({ e, el: el.closest('.product') })
|
| 183 |
+
})
|
| 184 |
+
})
|
| 185 |
+
;[...document.querySelectorAll('[data-quick-view="card"] > *')].map(el => {
|
| 186 |
+
if (el.hasQuickViewInit) return
|
| 187 |
+
el.hasQuickViewInit = true
|
| 188 |
+
|
| 189 |
+
el.addEventListener('click', e => {
|
| 190 |
+
openQuickViewFor({ e, el })
|
| 191 |
+
})
|
| 192 |
+
})
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
onDocumentLoaded(() => {
|
| 196 |
+
mount()
|
| 197 |
+
ctEvents.on('ct:quick-view:update', () => mount())
|
| 198 |
+
ctEvents.on('ct:infinite-scroll:load', () => mount())
|
| 199 |
+
ctEvents.on('blocksy:frontend:init', () => mount())
|
| 200 |
+
|
| 201 |
+
ctEvents.on('ct:modal:closed', modalContainer => {
|
| 202 |
+
if (!modalContainer.closest('.quick-view-modal')) {
|
| 203 |
+
return
|
| 204 |
+
}
|
| 205 |
+
|
| 206 |
+
if (modalContainer.querySelector('.flexy-container')) {
|
| 207 |
+
const flexyEl = modalContainer.querySelector('.flexy-container')
|
| 208 |
+
.parentNode
|
| 209 |
+
|
| 210 |
+
flexyEl.flexy && flexyEl.flexy.destroy && flexyEl.flexy.destroy()
|
| 211 |
+
}
|
| 212 |
+
|
| 213 |
+
setTimeout(() => {
|
| 214 |
+
modalContainer.remove()
|
| 215 |
+
})
|
| 216 |
+
})
|
| 217 |
+
})
|
framework/extensions/woocommerce-extra/static/js/sync.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import './variables'
|
| 2 |
+
import '../../../cookies-consent/static/js/ct-events'
|
| 3 |
+
import ctEvents from 'ct-events'
|
| 4 |
+
|
| 5 |
+
import {
|
| 6 |
+
checkAndReplace,
|
| 7 |
+
responsiveClassesFor
|
| 8 |
+
} from '../../../cookies-consent/static/js/sync/helpers'
|
| 9 |
+
|
| 10 |
+
checkAndReplace({
|
| 11 |
+
id: 'has_floating_bar',
|
| 12 |
+
strategy: 'append',
|
| 13 |
+
|
| 14 |
+
parent_selector: 'body',
|
| 15 |
+
selector: '.ct-floating-bar',
|
| 16 |
+
fragment_id: 'blocksy-woo-floating-cart',
|
| 17 |
+
|
| 18 |
+
whenInserted: () => ctEvents.trigger('blocksy:woo:floating-cart:init')
|
| 19 |
+
})
|
framework/extensions/woocommerce-extra/static/js/variables.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { handleVariablesFor } from 'customizer-sync-helpers'
|
| 2 |
+
import { handleResponsiveSwitch } from './helpers'
|
| 3 |
+
|
| 4 |
+
handleVariablesFor({
|
| 5 |
+
floatingBarFontColor: {
|
| 6 |
+
selector: '.ct-floating-bar',
|
| 7 |
+
variable: 'color',
|
| 8 |
+
type: 'color'
|
| 9 |
+
},
|
| 10 |
+
|
| 11 |
+
floatingBarBackground: {
|
| 12 |
+
selector: '.ct-floating-bar',
|
| 13 |
+
variable: 'backgroundColor',
|
| 14 |
+
type: 'color'
|
| 15 |
+
},
|
| 16 |
+
|
| 17 |
+
floatingBarShadow: {
|
| 18 |
+
selector: '.ct-floating-bar',
|
| 19 |
+
type: 'box-shadow',
|
| 20 |
+
variable: 'box-shadow',
|
| 21 |
+
responsive: true
|
| 22 |
+
},
|
| 23 |
+
|
| 24 |
+
floatingBarVisibility: handleResponsiveSwitch({
|
| 25 |
+
on: 'flex',
|
| 26 |
+
selector: '.ct-floating-bar'
|
| 27 |
+
})
|
| 28 |
+
})
|
framework/extensions/woocommerce-extra/static/sass/floating-bar/main.scss
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.ct-floating-bar {
|
| 2 |
+
position: fixed;
|
| 3 |
+
z-index: 5;
|
| 4 |
+
top: calc(var(--admin-bar, 0px) + var(--frame-size, 0px) + var(--headerStickyHeight, 0px));
|
| 5 |
+
left: var(--frame-size, 0px);
|
| 6 |
+
right: var(--frame-size, 0px);
|
| 7 |
+
display: var(--visibility, flex);
|
| 8 |
+
align-items: center;
|
| 9 |
+
height: 75px;
|
| 10 |
+
color: var(--color);
|
| 11 |
+
background: var(--backgroundColor);
|
| 12 |
+
box-shadow: var(--box-shadow);
|
| 13 |
+
opacity: 0;
|
| 14 |
+
visibility: hidden;
|
| 15 |
+
transform: translateY(-75px);
|
| 16 |
+
transition: opacity 0.2s ease,
|
| 17 |
+
transform 0.2s ease,
|
| 18 |
+
visibility 0.2s ease;
|
| 19 |
+
|
| 20 |
+
&.ct-active {
|
| 21 |
+
opacity: 1;
|
| 22 |
+
visibility: visible;
|
| 23 |
+
transform: translateY(0);
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
> div {
|
| 27 |
+
display: grid;
|
| 28 |
+
// grid-template-columns: repeat(2, 1fr);
|
| 29 |
+
grid-template-columns: auto auto;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
section {
|
| 33 |
+
display: flex;
|
| 34 |
+
align-items: center;
|
| 35 |
+
|
| 36 |
+
p {
|
| 37 |
+
--contentSpacing: 0;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
&:last-child {
|
| 41 |
+
justify-content: flex-end;
|
| 42 |
+
}
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
.ct-image-container {
|
| 46 |
+
border-radius: 3px;
|
| 47 |
+
|
| 48 |
+
@include media-breakpoint-down (sm) {
|
| 49 |
+
max-width: 40px;
|
| 50 |
+
margin-right: 10px;
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
@include media-breakpoint-up (md) {
|
| 54 |
+
max-width: 50px;
|
| 55 |
+
margin-right: 15px;
|
| 56 |
+
}
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
.product_title {
|
| 60 |
+
--fontWeight: 600;
|
| 61 |
+
--headingColor: var(--color);
|
| 62 |
+
margin-bottom: 0;
|
| 63 |
+
|
| 64 |
+
@include media-breakpoint-down (sm) {
|
| 65 |
+
--fontSize: 15px;
|
| 66 |
+
--fontWeight: 500;
|
| 67 |
+
}
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
.price {
|
| 71 |
+
@include media-breakpoint-down (sm) {
|
| 72 |
+
font-size: 12px;
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
@include media-breakpoint-up (md) {
|
| 76 |
+
margin-right: 15px;
|
| 77 |
+
}
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
.stock {
|
| 81 |
+
font-size: 13px;
|
| 82 |
+
font-weight: 500;
|
| 83 |
+
text-transform: uppercase;
|
| 84 |
+
margin-right: 15px;
|
| 85 |
+
|
| 86 |
+
&:before {
|
| 87 |
+
content: '/';
|
| 88 |
+
margin-right: 10px;
|
| 89 |
+
}
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
form.cart {
|
| 93 |
+
display: flex;
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
.quantity {
|
| 97 |
+
--quantityHeight: 40px;
|
| 98 |
+
width: 80px;
|
| 99 |
+
margin-right: 10px;
|
| 100 |
+
|
| 101 |
+
input[type="number"] {
|
| 102 |
+
--formFontSize: 13px;
|
| 103 |
+
}
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
.button,
|
| 107 |
+
.added_to_cart,
|
| 108 |
+
.single_add_to_cart_button {
|
| 109 |
+
--buttonMinHeight: 40px;
|
| 110 |
+
--padding: 0 15px;
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
.single_add_to_cart_button.added {
|
| 114 |
+
display: none;
|
| 115 |
+
}
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
|
| 119 |
+
@include media-breakpoint-up (md) {
|
| 120 |
+
.floating-bar-content .price {
|
| 121 |
+
display: none;
|
| 122 |
+
}
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
@include media-breakpoint-down (sm) {
|
| 126 |
+
.floating-bar-actions {
|
| 127 |
+
|
| 128 |
+
.price,
|
| 129 |
+
.quantity {
|
| 130 |
+
display: none;
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
.added_to_cart,
|
| 134 |
+
.single_add_to_cart_button {
|
| 135 |
+
--padding: 0 5px;
|
| 136 |
+
--buttonShadow: none;
|
| 137 |
+
--buttonTransform: none;
|
| 138 |
+
min-width: 40px;
|
| 139 |
+
font-size: 0 !important;
|
| 140 |
+
|
| 141 |
+
&:after {
|
| 142 |
+
font-family: 'woo';
|
| 143 |
+
font-size: 15px;
|
| 144 |
+
margin: 0 !important;
|
| 145 |
+
}
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
.added_to_cart:after {
|
| 149 |
+
content: '\e906';
|
| 150 |
+
}
|
| 151 |
+
|
| 152 |
+
.single_add_to_cart_button:not(.loading):after {
|
| 153 |
+
content: '\e909';
|
| 154 |
+
}
|
| 155 |
+
}
|
| 156 |
+
}
|
framework/extensions/woocommerce-extra/static/sass/main.scss
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
@import '../../../../../static/sass/common-frontend';
|
| 2 |
+
@import 'quick-view/main';
|
| 3 |
+
@import 'floating-bar/main';
|
framework/extensions/woocommerce-extra/static/sass/quick-view/main.scss
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
@import 'quick-view-loader';
|
| 2 |
+
@import 'quick-view-button';
|
| 3 |
+
|
| 4 |
+
@import 'quick-view-card';
|
| 5 |
+
|
| 6 |
+
@import 'quick-view-modal';
|
| 7 |
+
@import 'quick-view-gallery';
|
| 8 |
+
@import 'quick-view-summary';
|
framework/extensions/woocommerce-extra/static/sass/quick-view/quick-view-button.scss
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.ct-open-quick-view {
|
| 2 |
+
--trigger-size: 36px;
|
| 3 |
+
--linkInitialColor: var(--color);
|
| 4 |
+
--linkHoverColor: #fff;
|
| 5 |
+
|
| 6 |
+
position: absolute;
|
| 7 |
+
z-index: 2;
|
| 8 |
+
display: flex;
|
| 9 |
+
align-items: center;
|
| 10 |
+
justify-content: center;
|
| 11 |
+
width: var(--trigger-size);
|
| 12 |
+
height: var(--trigger-size);
|
| 13 |
+
opacity: 0;
|
| 14 |
+
transition: color 0.12s cubic-bezier(0.455, 0.03, 0.515, 0.955),
|
| 15 |
+
opacity 0.12s cubic-bezier(0.455, 0.03, 0.515, 0.955);
|
| 16 |
+
|
| 17 |
+
&:focus {
|
| 18 |
+
opacity: 1;
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
&:after {
|
| 22 |
+
position: absolute;
|
| 23 |
+
content: '';
|
| 24 |
+
width: 100%;
|
| 25 |
+
height: 100%;
|
| 26 |
+
border-radius: 100%;
|
| 27 |
+
background: #fff;
|
| 28 |
+
transition: transform 0.12s cubic-bezier(0.455, 0.03, 0.515, 0.955),
|
| 29 |
+
background 0.12s cubic-bezier(0.455, 0.03, 0.515, 0.955);
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
&:hover {
|
| 33 |
+
&:after {
|
| 34 |
+
background: var(--paletteColor1);
|
| 35 |
+
transform: scale3d(1.1, 1.1, 1);
|
| 36 |
+
}
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
svg {
|
| 40 |
+
position: relative;
|
| 41 |
+
z-index: 1;
|
| 42 |
+
fill: currentColor;
|
| 43 |
+
}
|
| 44 |
+
}
|
framework/extensions/woocommerce-extra/static/sass/quick-view/quick-view-card.scss
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.ct-quick-view-card {
|
| 2 |
+
|
| 3 |
+
> section {
|
| 4 |
+
position: relative;
|
| 5 |
+
border-radius: 7px;
|
| 6 |
+
background: #fff;
|
| 7 |
+
-webkit-mask-image: -webkit-radial-gradient(white, black);
|
| 8 |
+
|
| 9 |
+
@include media-breakpoint-down (sm) {
|
| 10 |
+
overflow-y: auto;
|
| 11 |
+
max-height: inherit;
|
| 12 |
+
}
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
// onsale badge
|
| 17 |
+
.onsale {
|
| 18 |
+
--badgeTop: 25px;
|
| 19 |
+
--badgeLeft: 25px;
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
// close button
|
| 24 |
+
.close-button {
|
| 25 |
+
--top: 25px;
|
| 26 |
+
--right: 25px;
|
| 27 |
+
--triggerWidth: 14px;
|
| 28 |
+
--closeButtonSize: 34px;
|
| 29 |
+
--closeButtonRadius: 100%;
|
| 30 |
+
--closeButtonColor: var(--color);
|
| 31 |
+
--closeButtonBackground: #F2F2F2;
|
| 32 |
+
|
| 33 |
+
&:hover {
|
| 34 |
+
&:before {
|
| 35 |
+
transform: scale(1.15);
|
| 36 |
+
}
|
| 37 |
+
}
|
| 38 |
+
}
|
| 39 |
+
}
|
framework/extensions/woocommerce-extra/static/sass/quick-view/quick-view-gallery.scss
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.ct-quick-view-card {
|
| 2 |
+
|
| 3 |
+
.ct-product-view {
|
| 4 |
+
margin-bottom: 0;
|
| 5 |
+
|
| 6 |
+
.ct-image-container {
|
| 7 |
+
pointer-events: none;
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
@include media-breakpoint-down (sm) {
|
| 11 |
+
.ct-ratio {
|
| 12 |
+
padding-bottom: 100% !important;
|
| 13 |
+
}
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
@include media-breakpoint-up (md) {
|
| 17 |
+
width: 50%;
|
| 18 |
+
}
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
// flexy
|
| 22 |
+
.flexy-pills[data-type="circle"] {
|
| 23 |
+
position: absolute;
|
| 24 |
+
z-index: 2;
|
| 25 |
+
left: 0;
|
| 26 |
+
right: 0;
|
| 27 |
+
bottom: 20px;
|
| 28 |
+
|
| 29 |
+
--flexyInitialPill: rgba(255, 255, 255, 0.6);
|
| 30 |
+
--flexyActivePill: #fff;
|
| 31 |
+
}
|
| 32 |
+
}
|
framework/extensions/woocommerce-extra/static/sass/quick-view/quick-view-loader.scss
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[id*="quick-view"] {
|
| 2 |
+
[data-loader] {
|
| 3 |
+
--loaderColor: #fff;
|
| 4 |
+
--loaderSize: 60px;
|
| 5 |
+
|
| 6 |
+
opacity: 1;
|
| 7 |
+
visibility: visible;
|
| 8 |
+
animation-play-state: running;
|
| 9 |
+
}
|
| 10 |
+
}
|
framework/extensions/woocommerce-extra/static/sass/quick-view/quick-view-modal.scss
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[id*="quick-view"] {
|
| 2 |
+
--backgroundColor: rgba(18, 21, 25, 0.8);
|
| 3 |
+
|
| 4 |
+
.content-container {
|
| 5 |
+
overflow: initial;
|
| 6 |
+
}
|
| 7 |
+
|
| 8 |
+
.ct-container {
|
| 9 |
+
--container-max-width: 1000px;
|
| 10 |
+
min-height: 200px;
|
| 11 |
+
position: relative;
|
| 12 |
+
border-radius: 7px;
|
| 13 |
+
box-shadow: 0px 50px 100px 0px rgba(18, 21, 25, 0.5);
|
| 14 |
+
|
| 15 |
+
@include media-breakpoint-down (sm) {
|
| 16 |
+
max-height: 85vh;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
@include media-breakpoint-up (md) {
|
| 20 |
+
max-height: 700px;
|
| 21 |
+
}
|
| 22 |
+
}
|
| 23 |
+
}
|
framework/extensions/woocommerce-extra/static/sass/quick-view/quick-view-summary.scss
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.ct-quick-view-card {
|
| 2 |
+
position: relative;
|
| 3 |
+
|
| 4 |
+
.entry-summary {
|
| 5 |
+
@include media-breakpoint-down (sm) {
|
| 6 |
+
padding: 6vw 6vw 0 6vw;
|
| 7 |
+
|
| 8 |
+
&:after {
|
| 9 |
+
padding-bottom: 6vw;
|
| 10 |
+
}
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
@include media-breakpoint-up (md) {
|
| 14 |
+
position: absolute;
|
| 15 |
+
top: 0;
|
| 16 |
+
left: 50%;
|
| 17 |
+
right: 0;
|
| 18 |
+
z-index: 1;
|
| 19 |
+
height: 100%;
|
| 20 |
+
overflow-y: auto;
|
| 21 |
+
padding: 40px 40px 0 40px;
|
| 22 |
+
|
| 23 |
+
&:after {
|
| 24 |
+
padding-bottom: 40px;
|
| 25 |
+
}
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
&:after {
|
| 29 |
+
content: '';
|
| 30 |
+
display: block;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
.product_title {
|
| 34 |
+
padding-right: 40px;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
form.cart {
|
| 38 |
+
border-top-style: dashed;
|
| 39 |
+
border-bottom: 1px dashed rgba(224, 229, 235, 0.8);
|
| 40 |
+
|
| 41 |
+
@include media-breakpoint-down (sm) {
|
| 42 |
+
margin-bottom: 30px;
|
| 43 |
+
padding-bottom: 30px;
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
@include media-breakpoint-up (md) {
|
| 47 |
+
margin-bottom: 40px;
|
| 48 |
+
padding-bottom: 40px;
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
.ct-quick-more {
|
| 55 |
+
--buttonMinHeight: 55px;
|
| 56 |
+
--buttonTextInitialColor: var(--color);
|
| 57 |
+
--buttonTextHoverColor: var(--color);
|
| 58 |
+
--buttonInitialColor: rgba(224,229,235,0.6);
|
| 59 |
+
--buttonHoverColor: rgba(224,229,235,1);
|
| 60 |
+
|
| 61 |
+
width: 100%;
|
| 62 |
+
}
|
| 63 |
+
}
|
framework/features/conditions-manager.php
ADDED
|
@@ -0,0 +1,455 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
namespace Blocksy;
|
| 4 |
+
|
| 5 |
+
class ConditionsManager {
|
| 6 |
+
public function __construct() {
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
public function condition_matches($rules = []) {
|
| 10 |
+
if (empty($rules)) {
|
| 11 |
+
return false;
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
$all_includes = array_filter($rules, function ($el) {
|
| 15 |
+
return $el['type'] === 'include';
|
| 16 |
+
});
|
| 17 |
+
|
| 18 |
+
$all_excludes = array_filter($rules, function ($el) {
|
| 19 |
+
return $el['type'] === 'exclude';
|
| 20 |
+
});
|
| 21 |
+
|
| 22 |
+
$resolved_includes = array_filter($all_includes, function ($el) {
|
| 23 |
+
return $this->resolve_single_condition($el);
|
| 24 |
+
});
|
| 25 |
+
|
| 26 |
+
$resolved_excludes = array_filter($all_excludes, function ($el) {
|
| 27 |
+
return $this->resolve_single_condition($el);
|
| 28 |
+
});
|
| 29 |
+
|
| 30 |
+
// If at least one exclusion is true -- return false
|
| 31 |
+
if (! empty($resolved_excludes)) {
|
| 32 |
+
return false;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
if (empty($all_includes)) {
|
| 36 |
+
return true;
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
if (! empty($all_includes)) {
|
| 40 |
+
// If at least one inclusion is true - return true
|
| 41 |
+
if (! empty($resolved_includes)) {
|
| 42 |
+
return true;
|
| 43 |
+
}
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
return false;
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
public function resolve_single_condition($rule) {
|
| 50 |
+
if ($rule['rule'] === 'everywhere') {
|
| 51 |
+
return true;
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
if ($rule['rule'] === 'singulars') {
|
| 55 |
+
return is_singular();
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
if ($rule['rule'] === 'archives') {
|
| 59 |
+
return is_archive();
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
if ($rule['rule'] === '404') {
|
| 63 |
+
return is_404();
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
if ($rule['rule'] === 'search') {
|
| 67 |
+
return is_search();
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
if ($rule['rule'] === 'blog') {
|
| 71 |
+
return !is_front_page() && is_home();
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
if ($rule['rule'] === 'front_page') {
|
| 75 |
+
return is_front_page();
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
if ($rule['rule'] === 'date') {
|
| 79 |
+
return is_date();
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
if ($rule['rule'] === 'author') {
|
| 83 |
+
return is_author();
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
if ($rule['rule'] === 'woo_shop') {
|
| 87 |
+
return function_exists('is_shop') && is_shop();
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
if ($rule['rule'] === 'single_post') {
|
| 91 |
+
return is_singular('post');
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
if ($rule['rule'] === 'all_post_archives') {
|
| 95 |
+
return is_post_type_archive('post');
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
if ($rule['rule'] === 'post_categories') {
|
| 99 |
+
return is_category();
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
if ($rule['rule'] === 'post_tags') {
|
| 103 |
+
return is_tag();
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
if ($rule['rule'] === 'single_page') {
|
| 107 |
+
return is_singular('page');
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
if ($rule['rule'] === 'single_product') {
|
| 111 |
+
return function_exists('is_product') && is_product();
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
if ($rule['rule'] === 'all_product_archives') {
|
| 115 |
+
if (function_exists('is_shop')) {
|
| 116 |
+
return is_shop() || is_product_tag() || is_product_category();
|
| 117 |
+
}
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
if ($rule['rule'] === 'all_product_categories') {
|
| 121 |
+
if (function_exists('is_shop')) {
|
| 122 |
+
return is_product_category();
|
| 123 |
+
}
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
if ($rule['rule'] === 'all_product_tags') {
|
| 127 |
+
if (function_exists('is_shop')) {
|
| 128 |
+
return is_product_tag();
|
| 129 |
+
}
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
if ($rule['rule'] === 'user_logged_in') {
|
| 133 |
+
return is_user_logged_in();
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
if ($rule['rule'] === 'user_logged_out') {
|
| 137 |
+
return !is_user_logged_in();
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
if (strpos($rule['rule'], 'user_role_') !== false) {
|
| 141 |
+
if (! is_user_logged_in()) {
|
| 142 |
+
return false;
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
return in_array(
|
| 146 |
+
str_replace('user_role_', '', $rule['rule']),
|
| 147 |
+
get_userdata(wp_get_current_user()->ID)->roles
|
| 148 |
+
);
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
if (strpos($rule['rule'], 'post_type_single_') !== false) {
|
| 152 |
+
return is_singular(str_replace(
|
| 153 |
+
'post_type_single_',
|
| 154 |
+
'',
|
| 155 |
+
$rule['rule']
|
| 156 |
+
));
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
if (strpos($rule['rule'], 'post_type_archive_') !== false) {
|
| 160 |
+
return is_archive(str_replace(
|
| 161 |
+
'post_type_archive_',
|
| 162 |
+
'',
|
| 163 |
+
$rule['rule']
|
| 164 |
+
));
|
| 165 |
+
}
|
| 166 |
+
|
| 167 |
+
if (
|
| 168 |
+
$rule['rule'] === 'post_ids'
|
| 169 |
+
||
|
| 170 |
+
$rule['rule'] === 'page_ids'
|
| 171 |
+
||
|
| 172 |
+
$rule['rule'] === 'custom_post_type_ids'
|
| 173 |
+
) {
|
| 174 |
+
$is_blocksy_page = blocksy_is_page();
|
| 175 |
+
|
| 176 |
+
if (is_singular() || $is_blocksy_page) {
|
| 177 |
+
$post_id = get_the_ID();
|
| 178 |
+
|
| 179 |
+
if ($is_blocksy_page) {
|
| 180 |
+
$post_id = $is_blocksy_page;
|
| 181 |
+
}
|
| 182 |
+
|
| 183 |
+
global $post;
|
| 184 |
+
|
| 185 |
+
if (
|
| 186 |
+
isset($rule['payload'])
|
| 187 |
+
&&
|
| 188 |
+
isset($rule['payload']['post_id'])
|
| 189 |
+
&&
|
| 190 |
+
$post_id
|
| 191 |
+
&&
|
| 192 |
+
intval($post_id) === intval($rule['payload']['post_id'])
|
| 193 |
+
) {
|
| 194 |
+
return true;
|
| 195 |
+
}
|
| 196 |
+
}
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
if ($rule['rule'] === 'taxonomy_ids') {
|
| 200 |
+
if (is_tax() || is_category() || is_tag()) {
|
| 201 |
+
$tax_id = get_queried_object_id();
|
| 202 |
+
|
| 203 |
+
if (
|
| 204 |
+
isset($rule['payload'])
|
| 205 |
+
&&
|
| 206 |
+
isset($rule['payload']['taxonomy_id'])
|
| 207 |
+
&&
|
| 208 |
+
$tax_id
|
| 209 |
+
&&
|
| 210 |
+
intval($tax_id) === intval($rule['payload']['taxonomy_id'])
|
| 211 |
+
) {
|
| 212 |
+
return true;
|
| 213 |
+
}
|
| 214 |
+
}
|
| 215 |
+
}
|
| 216 |
+
|
| 217 |
+
return false;
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
public function get_all_rules() {
|
| 221 |
+
$has_woo = class_exists('WooCommerce');
|
| 222 |
+
|
| 223 |
+
$cpts = [];
|
| 224 |
+
|
| 225 |
+
$custom_post_types = array_diff(
|
| 226 |
+
get_post_types(['public' => true]),
|
| 227 |
+
[
|
| 228 |
+
'post',
|
| 229 |
+
'page',
|
| 230 |
+
'attachment',
|
| 231 |
+
'documentation',
|
| 232 |
+
'ct_content_block',
|
| 233 |
+
'product'
|
| 234 |
+
]
|
| 235 |
+
);
|
| 236 |
+
|
| 237 |
+
foreach ($custom_post_types as $custom_post_type) {
|
| 238 |
+
$post_type_object = get_post_type_object($custom_post_type);
|
| 239 |
+
|
| 240 |
+
$cpts[] = [
|
| 241 |
+
'id' => 'post_type_single_' . $custom_post_type,
|
| 242 |
+
'title' => sprintf(
|
| 243 |
+
__('%s Single', 'blc'),
|
| 244 |
+
$post_type_object->labels->singular_name
|
| 245 |
+
)
|
| 246 |
+
];
|
| 247 |
+
|
| 248 |
+
$cpts[] = [
|
| 249 |
+
'id' => 'post_type_archive_' . $custom_post_type,
|
| 250 |
+
'title' => sprintf(
|
| 251 |
+
__('%s Archive', 'blc'),
|
| 252 |
+
$post_type_object->labels->singular_name
|
| 253 |
+
)
|
| 254 |
+
];
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
return array_merge([
|
| 258 |
+
[
|
| 259 |
+
'title' => '',
|
| 260 |
+
'rules' => [
|
| 261 |
+
[
|
| 262 |
+
'id' => 'everywhere',
|
| 263 |
+
'title' => __('Entire Website', 'blc')
|
| 264 |
+
]
|
| 265 |
+
]
|
| 266 |
+
],
|
| 267 |
+
[
|
| 268 |
+
'title' => __('Basic', 'blc'),
|
| 269 |
+
'rules' => [
|
| 270 |
+
[
|
| 271 |
+
'id' => 'singulars',
|
| 272 |
+
'title' => __('Singulars', 'blc')
|
| 273 |
+
],
|
| 274 |
+
|
| 275 |
+
[
|
| 276 |
+
'id' => 'archives',
|
| 277 |
+
'title' => __('Archives', 'blc')
|
| 278 |
+
]
|
| 279 |
+
]
|
| 280 |
+
],
|
| 281 |
+
|
| 282 |
+
[
|
| 283 |
+
'title' => __('Posts', 'blc'),
|
| 284 |
+
'rules' => [
|
| 285 |
+
[
|
| 286 |
+
'id' => 'single_post',
|
| 287 |
+
'title' => __('Single Post', 'blc')
|
| 288 |
+
],
|
| 289 |
+
|
| 290 |
+
[
|
| 291 |
+
'id' => 'all_post_archives',
|
| 292 |
+
'title' => __('All Post Archives', 'blc')
|
| 293 |
+
],
|
| 294 |
+
|
| 295 |
+
[
|
| 296 |
+
'id' => 'post_categories',
|
| 297 |
+
'title' => __('Post Categories', 'blc')
|
| 298 |
+
],
|
| 299 |
+
|
| 300 |
+
[
|
| 301 |
+
'id' => 'post_tags',
|
| 302 |
+
'title' => __('Post Tags', 'blc')
|
| 303 |
+
],
|
| 304 |
+
]
|
| 305 |
+
],
|
| 306 |
+
|
| 307 |
+
[
|
| 308 |
+
'title' => __('Pages', 'blc'),
|
| 309 |
+
'rules' => [
|
| 310 |
+
[
|
| 311 |
+
'id' => 'single_page',
|
| 312 |
+
'title' => __('Single Page', 'blc')
|
| 313 |
+
],
|
| 314 |
+
]
|
| 315 |
+
],
|
| 316 |
+
],
|
| 317 |
+
|
| 318 |
+
$has_woo ? [
|
| 319 |
+
[
|
| 320 |
+
'title' => __('WooCommerce', 'blc'),
|
| 321 |
+
'rules' => [
|
| 322 |
+
[
|
| 323 |
+
'id' => 'woo_shop',
|
| 324 |
+
'title' => __('Shop Home', 'blc')
|
| 325 |
+
],
|
| 326 |
+
|
| 327 |
+
[
|
| 328 |
+
'id' => 'single_product',
|
| 329 |
+
'title' => __('Single Product', 'blc')
|
| 330 |
+
],
|
| 331 |
+
|
| 332 |
+
[
|
| 333 |
+
'id' => 'all_product_archives',
|
| 334 |
+
'title' => __('Product Archives', 'blc')
|
| 335 |
+
],
|
| 336 |
+
|
| 337 |
+
[
|
| 338 |
+
'id' => 'all_product_categories',
|
| 339 |
+
'title' => __('Product Categories', 'blc')
|
| 340 |
+
],
|
| 341 |
+
|
| 342 |
+
[
|
| 343 |
+
'id' => 'all_product_tags',
|
| 344 |
+
'title' => __('Product Tags', 'blc')
|
| 345 |
+
],
|
| 346 |
+
]
|
| 347 |
+
]
|
| 348 |
+
] : [],
|
| 349 |
+
|
| 350 |
+
count($cpts) > 0 ? [
|
| 351 |
+
[
|
| 352 |
+
'title' => __('Custom Post Types', 'blc'),
|
| 353 |
+
'rules' => $cpts
|
| 354 |
+
]
|
| 355 |
+
] : [],
|
| 356 |
+
|
| 357 |
+
[
|
| 358 |
+
[
|
| 359 |
+
'title' => __('Specific', 'blc'),
|
| 360 |
+
'rules' => [
|
| 361 |
+
[
|
| 362 |
+
'id' => 'post_ids',
|
| 363 |
+
'title' => __('Post ID', 'blc')
|
| 364 |
+
],
|
| 365 |
+
|
| 366 |
+
[
|
| 367 |
+
'id' => 'page_ids',
|
| 368 |
+
'title' => __('Page ID', 'blc')
|
| 369 |
+
],
|
| 370 |
+
|
| 371 |
+
[
|
| 372 |
+
'id' => 'custom_post_type_ids',
|
| 373 |
+
'title' => __('Custom Post Type ID', 'blc')
|
| 374 |
+
],
|
| 375 |
+
|
| 376 |
+
[
|
| 377 |
+
'id' => 'taxonomy_ids',
|
| 378 |
+
'title' => __('Taxonomy ID', 'blc')
|
| 379 |
+
],
|
| 380 |
+
]
|
| 381 |
+
],
|
| 382 |
+
|
| 383 |
+
[
|
| 384 |
+
'title' => __('Other Pages', 'blc'),
|
| 385 |
+
'rules' => [
|
| 386 |
+
[
|
| 387 |
+
'id' => '404',
|
| 388 |
+
'title' => __('404', 'blc')
|
| 389 |
+
],
|
| 390 |
+
|
| 391 |
+
[
|
| 392 |
+
'id' => 'search',
|
| 393 |
+
'title' => __('Search', 'blc')
|
| 394 |
+
],
|
| 395 |
+
|
| 396 |
+
[
|
| 397 |
+
'id' => 'blog',
|
| 398 |
+
'title' => __('Blog', 'blc')
|
| 399 |
+
],
|
| 400 |
+
|
| 401 |
+
[
|
| 402 |
+
'id' => 'front_page',
|
| 403 |
+
'title' => __('Front Page', 'blc')
|
| 404 |
+
],
|
| 405 |
+
|
| 406 |
+
/*
|
| 407 |
+
[
|
| 408 |
+
'id' => 'date',
|
| 409 |
+
'title' => __('Date', 'blc')
|
| 410 |
+
],
|
| 411 |
+
*/
|
| 412 |
+
|
| 413 |
+
[
|
| 414 |
+
'id' => 'author',
|
| 415 |
+
'title' => __('Author', 'blc')
|
| 416 |
+
],
|
| 417 |
+
],
|
| 418 |
+
],
|
| 419 |
+
|
| 420 |
+
[
|
| 421 |
+
'title' => __('User Auth', 'blc'),
|
| 422 |
+
'rules' => [
|
| 423 |
+
[
|
| 424 |
+
'id' => 'user_logged_in',
|
| 425 |
+
'title' => __('User Logged In', 'blc')
|
| 426 |
+
],
|
| 427 |
+
|
| 428 |
+
[
|
| 429 |
+
'id' => 'user_logged_out',
|
| 430 |
+
'title' => __('User Logged Out', 'blc')
|
| 431 |
+
],
|
| 432 |
+
]
|
| 433 |
+
],
|
| 434 |
+
|
| 435 |
+
[
|
| 436 |
+
'title' => __('User Roles', 'blc'),
|
| 437 |
+
'rules' => $this->get_user_roles_rules()
|
| 438 |
+
]
|
| 439 |
+
]);
|
| 440 |
+
}
|
| 441 |
+
|
| 442 |
+
private function get_user_roles_rules() {
|
| 443 |
+
$result = [];
|
| 444 |
+
|
| 445 |
+
foreach (get_editable_roles() as $role_id => $role_info) {
|
| 446 |
+
$result[] = [
|
| 447 |
+
'id' => 'user_role_' . $role_id,
|
| 448 |
+
'title' => $role_info['name']
|
| 449 |
+
];
|
| 450 |
+
}
|
| 451 |
+
|
| 452 |
+
return $result;
|
| 453 |
+
}
|
| 454 |
+
}
|
| 455 |
+
|
framework/features/demo-install.php
ADDED
|
@@ -0,0 +1,340 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
namespace Blocksy;
|
| 4 |
+
|
| 5 |
+
class DemoInstall {
|
| 6 |
+
protected $ajax_actions = [
|
| 7 |
+
'blocksy_demo_export',
|
| 8 |
+
'blocksy_demo_list',
|
| 9 |
+
'blocksy_demo_install_child_theme',
|
| 10 |
+
'blocksy_demo_activate_plugins',
|
| 11 |
+
'blocksy_demo_fake_step',
|
| 12 |
+
'blocksy_demo_erase_content',
|
| 13 |
+
'blocksy_demo_install_widgets',
|
| 14 |
+
'blocksy_demo_install_options',
|
| 15 |
+
'blocksy_demo_install_content',
|
| 16 |
+
'blocksy_demo_register_current_demo',
|
| 17 |
+
'blocksy_demo_deregister_current_demo',
|
| 18 |
+
'blocksy_demo_deactivate_plugins',
|
| 19 |
+
'blocksy_demo_install_finish',
|
| 20 |
+
|
| 21 |
+
// 'blocksy_extension_activate',
|
| 22 |
+
// 'blocksy_extension_deactivate',
|
| 23 |
+
];
|
| 24 |
+
|
| 25 |
+
public function has_mock() {
|
| 26 |
+
return true;
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
public function __construct() {
|
| 30 |
+
$this->attach_ajax_actions();
|
| 31 |
+
|
| 32 |
+
add_filter(
|
| 33 |
+
'blocksy_dashboard_localizations',
|
| 34 |
+
function ($d) {
|
| 35 |
+
$d['has_demo_install'] = apply_filters(
|
| 36 |
+
'blocksy_ext_demo_install_enabled',
|
| 37 |
+
'yes'
|
| 38 |
+
);
|
| 39 |
+
|
| 40 |
+
return $d;
|
| 41 |
+
}
|
| 42 |
+
);
|
| 43 |
+
|
| 44 |
+
// add_filter( 'woocommerce_enable_setup_wizard', '__return_false' );
|
| 45 |
+
// add_filter( 'woocommerce_show_admin_notice', '__return_false' );
|
| 46 |
+
// add_filter( 'woocommerce_prevent_automatic_wizard_redirect', '__return_false' );
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
public function blocksy_demo_install_child_theme() {
|
| 50 |
+
$m = new DemoInstallChildThemeInstaller();
|
| 51 |
+
$m->import();
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
public function blocksy_demo_erase_content() {
|
| 55 |
+
$plugins = new DemoInstallContentEraser();
|
| 56 |
+
$plugins->import();
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
public function blocksy_demo_install_widgets() {
|
| 60 |
+
$plugins = new DemoInstallWidgetsInstaller();
|
| 61 |
+
$plugins->import();
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
public function blocksy_demo_install_options() {
|
| 65 |
+
$plugins = new DemoInstallOptionsInstaller();
|
| 66 |
+
$plugins->import();
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
public function blocksy_demo_install_content() {
|
| 70 |
+
$plugins = new DemoInstallContentInstaller();
|
| 71 |
+
$plugins->import();
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
public function blocksy_demo_activate_plugins() {
|
| 75 |
+
$plugins = new DemoInstallPluginsInstaller();
|
| 76 |
+
$plugins->import();
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
public function blocksy_demo_fake_step() {
|
| 80 |
+
$plugins = new DemoInstallFakeContentEraser();
|
| 81 |
+
$plugins->import();
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
public function blocksy_demo_register_current_demo() {
|
| 85 |
+
$this->start_streaming();
|
| 86 |
+
|
| 87 |
+
if (! isset($_REQUEST['demo_name']) || !$_REQUEST['demo_name']) {
|
| 88 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 89 |
+
'action' => 'complete',
|
| 90 |
+
'error' => 'No demo name passed.',
|
| 91 |
+
]);
|
| 92 |
+
|
| 93 |
+
exit;
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
$demo_name = explode(':', $_REQUEST['demo_name']);
|
| 97 |
+
|
| 98 |
+
if (! isset($demo_name[1])) {
|
| 99 |
+
$demo_name[1] = '';
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
$demo = $demo_name[0];
|
| 103 |
+
$builder = $demo_name[1];
|
| 104 |
+
|
| 105 |
+
$this->set_current_demo($demo . ':' . $builder);
|
| 106 |
+
|
| 107 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 108 |
+
'action' => 'complete',
|
| 109 |
+
'error' => false
|
| 110 |
+
]);
|
| 111 |
+
|
| 112 |
+
exit;
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
public function blocksy_demo_deregister_current_demo() {
|
| 116 |
+
$this->start_streaming();
|
| 117 |
+
|
| 118 |
+
update_option('blocksy_ext_demos_current_demo', null);
|
| 119 |
+
|
| 120 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 121 |
+
'action' => 'complete',
|
| 122 |
+
'error' => false
|
| 123 |
+
]);
|
| 124 |
+
|
| 125 |
+
exit;
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
public function blocksy_demo_deactivate_plugins() {
|
| 129 |
+
$plugins = new DemoInstallPluginsUninstaller();
|
| 130 |
+
$plugins->import();
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
public function blocksy_demo_install_finish() {
|
| 134 |
+
$finish = new DemoInstallFinalActions();
|
| 135 |
+
$finish->import();
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
public function get_current_demo() {
|
| 139 |
+
return get_option('blocksy_ext_demos_current_demo', null);
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
public function set_current_demo($demo) {
|
| 143 |
+
update_option('blocksy_ext_demos_current_demo', [
|
| 144 |
+
'demo' => $demo
|
| 145 |
+
]);
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
public function fetch_single_demo($args = []) {
|
| 149 |
+
$args = wp_parse_args(
|
| 150 |
+
$args,
|
| 151 |
+
[
|
| 152 |
+
'demo' => $args['demo'],
|
| 153 |
+
'builder' => '',
|
| 154 |
+
'field' => ''
|
| 155 |
+
]
|
| 156 |
+
);
|
| 157 |
+
|
| 158 |
+
$request = wp_remote_get('https://demo.creativethemes.com/?' . http_build_query([
|
| 159 |
+
'route' => 'get_single',
|
| 160 |
+
'demo' => $args['demo'] . ':' . $args['builder'],
|
| 161 |
+
'field' => $args['field']
|
| 162 |
+
]));
|
| 163 |
+
|
| 164 |
+
if (is_wp_error($request)) {
|
| 165 |
+
return false;
|
| 166 |
+
}
|
| 167 |
+
|
| 168 |
+
$body = wp_remote_retrieve_body( $request );
|
| 169 |
+
|
| 170 |
+
$body = json_decode($body, true);
|
| 171 |
+
|
| 172 |
+
if (! $body) {
|
| 173 |
+
return false;
|
| 174 |
+
}
|
| 175 |
+
|
| 176 |
+
return $body;
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
public function fetch_all_demos() {
|
| 180 |
+
$request = wp_remote_get('https://demo.creativethemes.com/?route=get_all');
|
| 181 |
+
// $request = wp_remote_get('https://demo.creativethemes.BROKEN/?route=get_all');
|
| 182 |
+
|
| 183 |
+
if (is_wp_error($request)) {
|
| 184 |
+
return false;
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
$body = wp_remote_retrieve_body($request);
|
| 188 |
+
|
| 189 |
+
$body = json_decode($body, true);
|
| 190 |
+
|
| 191 |
+
if (! $body) {
|
| 192 |
+
return false;
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
return $body;
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
public function blocksy_demo_list() {
|
| 199 |
+
$demos = $this->fetch_all_demos();
|
| 200 |
+
|
| 201 |
+
if (! $demos) {
|
| 202 |
+
wp_send_json_error();
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
$plugins = [
|
| 206 |
+
'coblocks' => false,
|
| 207 |
+
'contact-form-7' => false,
|
| 208 |
+
'woocommerce' => false,
|
| 209 |
+
'brizy' => false,
|
| 210 |
+
'elementor' => false,
|
| 211 |
+
];
|
| 212 |
+
|
| 213 |
+
foreach ($plugins as $plugin_name => $status) {
|
| 214 |
+
$plugins_manager = $this->get_plugins_manager();
|
| 215 |
+
|
| 216 |
+
$path = $plugins_manager->is_plugin_installed( $plugin_name );
|
| 217 |
+
|
| 218 |
+
if ($path) {
|
| 219 |
+
if ($plugins_manager->is_plugin_active($path)) {
|
| 220 |
+
$plugins[$plugin_name] = true;
|
| 221 |
+
}
|
| 222 |
+
}
|
| 223 |
+
}
|
| 224 |
+
|
| 225 |
+
$has_demo_error = false;
|
| 226 |
+
|
| 227 |
+
if (! extension_loaded('xml') && ! extension_loaded('simplexml')) {
|
| 228 |
+
$has_demo_error = __("Your PHP installation doesn't have support for XML. Please install the <i>xml</i> or <i>simplexml</i> PHP extension in order to be able to install starter sites. You might need to contact your hosting provider to assist you in doing so.", 'blc');
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
+
wp_send_json_success([
|
| 232 |
+
'demos' => $demos,
|
| 233 |
+
'active_plugins' => $plugins,
|
| 234 |
+
'current_installed_demo' => $this->get_current_demo(),
|
| 235 |
+
'demo_error' => $has_demo_error
|
| 236 |
+
]);
|
| 237 |
+
}
|
| 238 |
+
|
| 239 |
+
public function blocksy_demo_export() {
|
| 240 |
+
if (! current_user_can('edit_theme_options')) {
|
| 241 |
+
wp_send_json_error();
|
| 242 |
+
}
|
| 243 |
+
|
| 244 |
+
global $wp_customize;
|
| 245 |
+
|
| 246 |
+
$name = sanitize_text_field($_REQUEST['name']);
|
| 247 |
+
$builder = sanitize_text_field($_REQUEST['builder']);
|
| 248 |
+
$plugins = sanitize_text_field($_REQUEST['plugins']);
|
| 249 |
+
$url = sanitize_text_field($_REQUEST['url']);
|
| 250 |
+
$is_pro = sanitize_text_field($_REQUEST['is_pro']) === 'true';
|
| 251 |
+
|
| 252 |
+
$plugins = explode(',', preg_replace('/\s+/', '', $plugins));
|
| 253 |
+
|
| 254 |
+
$options_data = new DemoInstallOptionsExport();
|
| 255 |
+
|
| 256 |
+
$widgets_data = new DemoInstallWidgetsExport();
|
| 257 |
+
$widgets_data = $widgets_data->export();
|
| 258 |
+
|
| 259 |
+
add_filter(
|
| 260 |
+
'export_wp_all_post_types',
|
| 261 |
+
function ($post_types) {
|
| 262 |
+
$post_types['wpforms'] = 'wpforms';
|
| 263 |
+
return $post_types;
|
| 264 |
+
}
|
| 265 |
+
);
|
| 266 |
+
|
| 267 |
+
$content_data = new DemoInstallContentExport();
|
| 268 |
+
$content_data = $content_data->export();
|
| 269 |
+
|
| 270 |
+
wp_send_json_success([
|
| 271 |
+
'demo' => [
|
| 272 |
+
'name' => $name,
|
| 273 |
+
'options' => $options_data->export(),
|
| 274 |
+
'widgets' => $widgets_data,
|
| 275 |
+
'content' => $content_data,
|
| 276 |
+
|
| 277 |
+
'pages_ids_options' => $options_data->export_pages_ids_options(),
|
| 278 |
+
'created_at' => date('d-m-Y'),
|
| 279 |
+
|
| 280 |
+
'url' => $url,
|
| 281 |
+
'is_pro' => !!$is_pro,
|
| 282 |
+
'builder' => $builder,
|
| 283 |
+
'plugins' => $plugins
|
| 284 |
+
]
|
| 285 |
+
]);
|
| 286 |
+
}
|
| 287 |
+
|
| 288 |
+
public function attach_ajax_actions() {
|
| 289 |
+
foreach ($this->ajax_actions as $action) {
|
| 290 |
+
add_action(
|
| 291 |
+
'wp_ajax_' . $action,
|
| 292 |
+
[ $this, $action ]
|
| 293 |
+
);
|
| 294 |
+
}
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
public function get_plugins_manager() {
|
| 298 |
+
if (! class_exists('Blocksy_Plugin_Manager')) {
|
| 299 |
+
require_once get_template_directory() . '/admin/dashboard/plugins/ct-plugin-manager.php';
|
| 300 |
+
}
|
| 301 |
+
|
| 302 |
+
return new \Blocksy_Plugin_Manager();
|
| 303 |
+
}
|
| 304 |
+
|
| 305 |
+
public function start_streaming() {
|
| 306 |
+
// Turn off PHP output compression
|
| 307 |
+
// $previous = error_reporting(error_reporting() ^ E_WARNING);
|
| 308 |
+
ini_set('output_buffering', 'off');
|
| 309 |
+
ini_set('zlib.output_compression', false);
|
| 310 |
+
// error_reporting( $previous );
|
| 311 |
+
// error_reporting(0);
|
| 312 |
+
|
| 313 |
+
if ($GLOBALS['is_nginx']) {
|
| 314 |
+
// Setting this header instructs Nginx to disable fastcgi_buffering
|
| 315 |
+
// and disable gzip for this request.
|
| 316 |
+
header('X-Accel-Buffering: no');
|
| 317 |
+
header('Content-Encoding: none');
|
| 318 |
+
}
|
| 319 |
+
|
| 320 |
+
// Start the event stream.
|
| 321 |
+
header('Content-Type: text/event-stream, charset=UTF-8');
|
| 322 |
+
|
| 323 |
+
flush();
|
| 324 |
+
|
| 325 |
+
// 2KB padding for IE
|
| 326 |
+
echo ':' . str_repeat( ' ', 2048 ) . "\n\n";
|
| 327 |
+
// Time to run the import!
|
| 328 |
+
set_time_limit( 0 );
|
| 329 |
+
// Ensure we're not buffered.
|
| 330 |
+
wp_ob_end_flush_all();
|
| 331 |
+
}
|
| 332 |
+
|
| 333 |
+
public function emit_sse_message( $data ) {
|
| 334 |
+
echo "event: message\n";
|
| 335 |
+
echo 'data: ' . wp_json_encode( $data ) . "\n\n";
|
| 336 |
+
// Extra padding.
|
| 337 |
+
echo ':' . str_repeat( ' ', 2048 ) . "\n\n";
|
| 338 |
+
flush();
|
| 339 |
+
}
|
| 340 |
+
}
|
framework/features/demo-install/child-theme.php
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
namespace Blocksy;
|
| 4 |
+
|
| 5 |
+
class DemoInstallChildThemeInstaller {
|
| 6 |
+
public function import() {
|
| 7 |
+
Plugin::instance()->demo->start_streaming();
|
| 8 |
+
|
| 9 |
+
if (! current_user_can('edit_theme_options')) {
|
| 10 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 11 |
+
'action' => 'complete',
|
| 12 |
+
'error' => 'No permission.',
|
| 13 |
+
]);
|
| 14 |
+
|
| 15 |
+
exit;
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
$theme = wp_get_theme();
|
| 19 |
+
|
| 20 |
+
if (is_child_theme()) {
|
| 21 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 22 |
+
'action' => 'complete',
|
| 23 |
+
'error' => false,
|
| 24 |
+
]);
|
| 25 |
+
|
| 26 |
+
exit;
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
$name = $theme . ' Child';
|
| 30 |
+
$slug = sanitize_title($name);
|
| 31 |
+
|
| 32 |
+
$path = get_theme_root() . '/' . $slug;
|
| 33 |
+
|
| 34 |
+
WP_Filesystem();
|
| 35 |
+
global $wp_filesystem;
|
| 36 |
+
|
| 37 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 38 |
+
'action' => 'import_install_child',
|
| 39 |
+
'error' => false,
|
| 40 |
+
]);
|
| 41 |
+
|
| 42 |
+
if (! $wp_filesystem->exists($path)) {
|
| 43 |
+
$wp_filesystem->mkdir( $path );
|
| 44 |
+
|
| 45 |
+
$wp_filesystem->put_contents(
|
| 46 |
+
$path . '/style.css',
|
| 47 |
+
$this->get_style_css()
|
| 48 |
+
);
|
| 49 |
+
|
| 50 |
+
$wp_filesystem->put_contents(
|
| 51 |
+
$path . '/functions.php',
|
| 52 |
+
$this->get_functions_php()
|
| 53 |
+
);
|
| 54 |
+
|
| 55 |
+
$this->make_screenshot($path);
|
| 56 |
+
$allowed_themes = get_option('allowedthemes');
|
| 57 |
+
$allowed_themes[$slug] = true;
|
| 58 |
+
|
| 59 |
+
update_option('allowedthemes', $allowed_themes);
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 63 |
+
'action' => 'import_activate_child',
|
| 64 |
+
'error' => false,
|
| 65 |
+
]);
|
| 66 |
+
|
| 67 |
+
switch_theme($slug);
|
| 68 |
+
|
| 69 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 70 |
+
'action' => 'complete',
|
| 71 |
+
'error' => false,
|
| 72 |
+
]);
|
| 73 |
+
|
| 74 |
+
exit;
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
private function get_style_css() {
|
| 78 |
+
return '/**
|
| 79 |
+
* Theme Name: Blocksy Child
|
| 80 |
+
* Description: Blocksy Child theme
|
| 81 |
+
* Author: Creative Themes
|
| 82 |
+
* Template: blocksy
|
| 83 |
+
* Text Domain: blocksy
|
| 84 |
+
*/';
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
private function get_functions_php() {
|
| 88 |
+
return "<?php
|
| 89 |
+
|
| 90 |
+
if (! defined('WP_DEBUG')) {
|
| 91 |
+
die( 'Direct access forbidden.' );
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
add_action( 'wp_enqueue_scripts', function () {
|
| 95 |
+
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
|
| 96 |
+
});
|
| 97 |
+
";
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
private function make_screenshot($path) {
|
| 101 |
+
$base_path = get_parent_theme_file_path();
|
| 102 |
+
|
| 103 |
+
global $wp_filesystem;
|
| 104 |
+
|
| 105 |
+
if ($wp_filesystem->exists($base_path . '/screenshot.png')) {
|
| 106 |
+
$screenshot = $base_path . '/screenshot.png';
|
| 107 |
+
$screenshot_ext = 'png';
|
| 108 |
+
} elseif ($wp_filesystem->exists($base_path . '/screenshot.jpg')) {
|
| 109 |
+
$screenshot = $base_path . '/screenshot.jpg';
|
| 110 |
+
$screenshot_ext = 'jpg';
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
if (! empty($screenshot) && $wp_filesystem->exists($screenshot)) {
|
| 114 |
+
$copied = $wp_filesystem->copy(
|
| 115 |
+
$screenshot,
|
| 116 |
+
$path . '/screenshot.' . $screenshot_ext
|
| 117 |
+
);
|
| 118 |
+
}
|
| 119 |
+
}
|
| 120 |
+
}
|
| 121 |
+
|
framework/features/demo-install/content-eraser.php
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
namespace Blocksy;
|
| 4 |
+
|
| 5 |
+
class DemoInstallContentEraser {
|
| 6 |
+
public function import() {
|
| 7 |
+
Plugin::instance()->demo->start_streaming();
|
| 8 |
+
|
| 9 |
+
if (! current_user_can('edit_theme_options')) {
|
| 10 |
+
/*
|
| 11 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 12 |
+
'action' => 'complete',
|
| 13 |
+
'error' => 'No permission.',
|
| 14 |
+
]);
|
| 15 |
+
|
| 16 |
+
exit;
|
| 17 |
+
*/
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
$this->reset_widgets_data();
|
| 21 |
+
$this->reset_customizer();
|
| 22 |
+
$this->erase_default_pages();
|
| 23 |
+
$this->reset_previous_posts();
|
| 24 |
+
$this->reset_previous_terms();
|
| 25 |
+
$this->reset_menus();
|
| 26 |
+
|
| 27 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 28 |
+
'action' => 'complete',
|
| 29 |
+
'error' => false,
|
| 30 |
+
]);
|
| 31 |
+
|
| 32 |
+
exit;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
private function reset_previous_posts() {
|
| 36 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 37 |
+
'action' => 'erase_previous_posts',
|
| 38 |
+
'error' => false,
|
| 39 |
+
]);
|
| 40 |
+
|
| 41 |
+
global $wpdb;
|
| 42 |
+
|
| 43 |
+
$post_ids = $wpdb->get_col(
|
| 44 |
+
"SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key='blocksy_demos_imported_post'"
|
| 45 |
+
);
|
| 46 |
+
|
| 47 |
+
foreach ($post_ids as $post_id) {
|
| 48 |
+
wp_delete_post($post_id, true);
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
private function reset_previous_terms() {
|
| 53 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 54 |
+
'action' => 'erase_previous_terms',
|
| 55 |
+
'error' => false,
|
| 56 |
+
]);
|
| 57 |
+
|
| 58 |
+
global $wpdb;
|
| 59 |
+
|
| 60 |
+
$term_ids = $wpdb->get_col(
|
| 61 |
+
"SELECT term_id FROM {$wpdb->termmeta} WHERE meta_key='blocksy_demos_imported_term'"
|
| 62 |
+
);
|
| 63 |
+
|
| 64 |
+
foreach ($term_ids as $term_id) {
|
| 65 |
+
if (! $term_id) {
|
| 66 |
+
continue;
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
$term = get_term($term_id);
|
| 70 |
+
|
| 71 |
+
if (! $term) continue;
|
| 72 |
+
|
| 73 |
+
wp_delete_term($term_id, $term->taxonomy);
|
| 74 |
+
}
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
private function erase_default_pages() {
|
| 78 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 79 |
+
'action' => 'erase_default_pages',
|
| 80 |
+
'error' => false,
|
| 81 |
+
]);
|
| 82 |
+
|
| 83 |
+
$sample_page = get_page_by_path('sample-page', OBJECT, 'page');
|
| 84 |
+
$hello_world_post = get_page_by_path('hello-world', OBJECT, 'post');
|
| 85 |
+
|
| 86 |
+
if ($sample_page) {
|
| 87 |
+
wp_delete_post($sample_page->ID, true);
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
if ($hello_world_post) {
|
| 91 |
+
wp_delete_post($hello_world_post->ID, true);
|
| 92 |
+
}
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
private function reset_customizer() {
|
| 96 |
+
global $wp_customize;
|
| 97 |
+
|
| 98 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 99 |
+
'action' => 'erase_customizer_settings',
|
| 100 |
+
'error' => false,
|
| 101 |
+
]);
|
| 102 |
+
|
| 103 |
+
if (! $wp_customize) {
|
| 104 |
+
return;
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
$settings = $wp_customize->settings();
|
| 108 |
+
|
| 109 |
+
foreach ($settings as $single_setting) {
|
| 110 |
+
if ('theme_mod' !== $single_setting->type) {
|
| 111 |
+
continue;
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
remove_theme_mod( $single_setting->id );
|
| 115 |
+
}
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
private function reset_widgets_data() {
|
| 119 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 120 |
+
'action' => 'erase_widgets_data',
|
| 121 |
+
'error' => false,
|
| 122 |
+
]);
|
| 123 |
+
|
| 124 |
+
$sidebars_widgets = get_option('sidebars_widgets', array());
|
| 125 |
+
|
| 126 |
+
if (! isset($sidebars_widgets['wp_inactive_widgets'])) {
|
| 127 |
+
$sidebars_widgets['wp_inactive_widgets'] = [];
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
foreach ($sidebars_widgets as $sidebar_id => $widgets) {
|
| 131 |
+
if (! $widgets) continue;
|
| 132 |
+
if ($sidebar_id === 'wp_inactive_widgets') {
|
| 133 |
+
continue;
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
if ($sidebar_id === 'array_version') {
|
| 137 |
+
continue;
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
foreach ($widgets as $widget_id) {
|
| 141 |
+
$sidebars_widgets['wp_inactive_widgets'][] = $widget_id;
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
$sidebars_widgets[$sidebar_id] = [];
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
update_option('sidebars_widgets', $sidebars_widgets);
|
| 148 |
+
unset($sidebars_widgets['array_version']);
|
| 149 |
+
set_theme_mod('sidebars_widgets', [
|
| 150 |
+
'time' => time(),
|
| 151 |
+
'data' => $sidebars_widgets
|
| 152 |
+
]);
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
private function reset_menus() {
|
| 156 |
+
return;
|
| 157 |
+
|
| 158 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 159 |
+
'action' => 'erase_menus_data',
|
| 160 |
+
'error' => false,
|
| 161 |
+
]);
|
| 162 |
+
|
| 163 |
+
$menus = get_terms('nav_menu', ['hide_empty' => false]);
|
| 164 |
+
|
| 165 |
+
foreach ($menus as $single_menu) {
|
| 166 |
+
if (! isset($single_menu->term_id)) {
|
| 167 |
+
continue;
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
wp_delete_nav_menu($single_menu->term_id);
|
| 171 |
+
}
|
| 172 |
+
}
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
|
framework/features/demo-install/content-export.php
ADDED
|
@@ -0,0 +1,663 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
namespace Blocksy;
|
| 4 |
+
|
| 5 |
+
class DemoInstallContentExport {
|
| 6 |
+
public function export() {
|
| 7 |
+
/**
|
| 8 |
+
* Version number for the export format.
|
| 9 |
+
*
|
| 10 |
+
* Bump this when something changes that might affect compatibility.
|
| 11 |
+
*
|
| 12 |
+
* @since 2.5.0
|
| 13 |
+
*/
|
| 14 |
+
define( 'WXR_VERSION', '1.2' );
|
| 15 |
+
|
| 16 |
+
/**
|
| 17 |
+
* Generates the WXR export file for download.
|
| 18 |
+
*
|
| 19 |
+
* Default behavior is to export all content, however, note that post content will only
|
| 20 |
+
* be exported for post types with the `can_export` argument enabled. Any posts with the
|
| 21 |
+
* 'auto-draft' status will be skipped.
|
| 22 |
+
*
|
| 23 |
+
* @since 2.1.0
|
| 24 |
+
*
|
| 25 |
+
* @global wpdb $wpdb WordPress database abstraction object.
|
| 26 |
+
* @global WP_Post $post Global `$post`.
|
| 27 |
+
*
|
| 28 |
+
* @param array $args {
|
| 29 |
+
* Optional. Arguments for generating the WXR export file for download. Default empty array.
|
| 30 |
+
*
|
| 31 |
+
* @type string $content Type of content to export. If set, only the post content of this post type
|
| 32 |
+
* will be exported. Accepts 'all', 'post', 'page', 'attachment', or a defined
|
| 33 |
+
* custom post. If an invalid custom post type is supplied, every post type for
|
| 34 |
+
* which `can_export` is enabled will be exported instead. If a valid custom post
|
| 35 |
+
* type is supplied but `can_export` is disabled, then 'posts' will be exported
|
| 36 |
+
* instead. When 'all' is supplied, only post types with `can_export` enabled will
|
| 37 |
+
* be exported. Default 'all'.
|
| 38 |
+
* @type string $author Author to export content for. Only used when `$content` is 'post', 'page', or
|
| 39 |
+
* 'attachment'. Accepts false (all) or a specific author ID. Default false (all).
|
| 40 |
+
* @type string $category Category (slug) to export content for. Used only when `$content` is 'post'. If
|
| 41 |
+
* set, only post content assigned to `$category` will be exported. Accepts false
|
| 42 |
+
* or a specific category slug. Default is false (all categories).
|
| 43 |
+
* @type string $start_date Start date to export content from. Expected date format is 'Y-m-d'. Used only
|
| 44 |
+
* when `$content` is 'post', 'page' or 'attachment'. Default false (since the
|
| 45 |
+
* beginning of time).
|
| 46 |
+
* @type string $end_date End date to export content to. Expected date format is 'Y-m-d'. Used only when
|
| 47 |
+
* `$content` is 'post', 'page' or 'attachment'. Default false (latest publish date).
|
| 48 |
+
* @type string $status Post status to export posts for. Used only when `$content` is 'post' or 'page'.
|
| 49 |
+
* Accepts false (all statuses except 'auto-draft'), or a specific status, i.e.
|
| 50 |
+
* 'publish', 'pending', 'draft', 'auto-draft', 'future', 'private', 'inherit', or
|
| 51 |
+
* 'trash'. Default false (all statuses except 'auto-draft').
|
| 52 |
+
* }
|
| 53 |
+
*/
|
| 54 |
+
global $wpdb, $post;
|
| 55 |
+
|
| 56 |
+
$defaults = array(
|
| 57 |
+
'content' => 'all',
|
| 58 |
+
'author' => false,
|
| 59 |
+
'category' => false,
|
| 60 |
+
'start_date' => false,
|
| 61 |
+
'end_date' => false,
|
| 62 |
+
'status' => false,
|
| 63 |
+
);
|
| 64 |
+
$args = wp_parse_args( $args, $defaults );
|
| 65 |
+
|
| 66 |
+
/**
|
| 67 |
+
* Fires at the beginning of an export, before any headers are sent.
|
| 68 |
+
*
|
| 69 |
+
* @since 2.3.0
|
| 70 |
+
*
|
| 71 |
+
* @param array $args An array of export arguments.
|
| 72 |
+
*/
|
| 73 |
+
do_action( 'export_wp', $args );
|
| 74 |
+
|
| 75 |
+
$sitename = sanitize_key( get_bloginfo( 'name' ) );
|
| 76 |
+
if ( ! empty( $sitename ) ) {
|
| 77 |
+
$sitename .= '.';
|
| 78 |
+
}
|
| 79 |
+
$date = date( 'Y-m-d' );
|
| 80 |
+
$wp_filename = $sitename . 'WordPress.' . $date . '.xml';
|
| 81 |
+
/**
|
| 82 |
+
* Filters the export filename.
|
| 83 |
+
*
|
| 84 |
+
* @since 4.4.0
|
| 85 |
+
*
|
| 86 |
+
* @param string $wp_filename The name of the file for download.
|
| 87 |
+
* @param string $sitename The site name.
|
| 88 |
+
* @param string $date Today's date, formatted.
|
| 89 |
+
*/
|
| 90 |
+
$filename = apply_filters( 'export_wp_filename', $wp_filename, $sitename, $date );
|
| 91 |
+
|
| 92 |
+
// header( 'Content-Description: File Transfer' );
|
| 93 |
+
// header( 'Content-Disposition: attachment; filename=' . $filename );
|
| 94 |
+
// header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );
|
| 95 |
+
|
| 96 |
+
if ( 'all' != $args['content'] && post_type_exists( $args['content'] ) ) {
|
| 97 |
+
$ptype = get_post_type_object( $args['content'] );
|
| 98 |
+
if ( ! $ptype->can_export ) {
|
| 99 |
+
$args['content'] = 'post';
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
$where = $wpdb->prepare( "{$wpdb->posts}.post_type = %s", $args['content'] );
|
| 103 |
+
} else {
|
| 104 |
+
$post_types = apply_filters('export_wp_all_post_types', get_post_types( array( 'can_export' => true ) ));
|
| 105 |
+
$esses = array_fill( 0, count( $post_types ), '%s' );
|
| 106 |
+
$where = $wpdb->prepare( "{$wpdb->posts}.post_type IN (" . implode( ',', $esses ) . ')', $post_types );
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
if ( $args['status'] && ( 'post' == $args['content'] || 'page' == $args['content'] ) ) {
|
| 110 |
+
$where .= $wpdb->prepare( " AND {$wpdb->posts}.post_status = %s", $args['status'] );
|
| 111 |
+
} else {
|
| 112 |
+
$where .= " AND {$wpdb->posts}.post_status != 'auto-draft'";
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
$join = '';
|
| 116 |
+
if ( $args['category'] && 'post' == $args['content'] ) {
|
| 117 |
+
if ( $term = term_exists( $args['category'], 'category' ) ) {
|
| 118 |
+
$join = "INNER JOIN {$wpdb->term_relationships} ON ({$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id)";
|
| 119 |
+
$where .= $wpdb->prepare( " AND {$wpdb->term_relationships}.term_taxonomy_id = %d", $term['term_taxonomy_id'] );
|
| 120 |
+
}
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
if ( 'post' == $args['content'] || 'page' == $args['content'] || 'attachment' == $args['content'] ) {
|
| 124 |
+
if ( $args['author'] ) {
|
| 125 |
+
$where .= $wpdb->prepare( " AND {$wpdb->posts}.post_author = %d", $args['author'] );
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
if ( $args['start_date'] ) {
|
| 129 |
+
$where .= $wpdb->prepare( " AND {$wpdb->posts}.post_date >= %s", date( 'Y-m-d', strtotime( $args['start_date'] ) ) );
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
if ( $args['end_date'] ) {
|
| 133 |
+
$where .= $wpdb->prepare( " AND {$wpdb->posts}.post_date < %s", date( 'Y-m-d', strtotime( '+1 month', strtotime( $args['end_date'] ) ) ) );
|
| 134 |
+
}
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
// Grab a snapshot of post IDs, just in case it changes during the export.
|
| 138 |
+
$post_ids = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} $join WHERE $where" );
|
| 139 |
+
|
| 140 |
+
/*
|
| 141 |
+
* Get the requested terms ready, empty unless posts filtered by category
|
| 142 |
+
* or all content.
|
| 143 |
+
*/
|
| 144 |
+
$cats = $tags = $terms = array();
|
| 145 |
+
if ( isset( $term ) && $term ) {
|
| 146 |
+
$cat = get_term( $term['term_id'], 'category' );
|
| 147 |
+
$cats = array( $cat->term_id => $cat );
|
| 148 |
+
unset( $term, $cat );
|
| 149 |
+
} elseif ( 'all' == $args['content'] ) {
|
| 150 |
+
$categories = (array) get_categories( array( 'get' => 'all' ) );
|
| 151 |
+
$tags = (array) get_tags( array( 'get' => 'all' ) );
|
| 152 |
+
|
| 153 |
+
$custom_taxonomies = get_taxonomies( array( '_builtin' => false ) );
|
| 154 |
+
$custom_terms = (array) get_terms( $custom_taxonomies, array( 'get' => 'all' ) );
|
| 155 |
+
|
| 156 |
+
// Put categories in order with no child going before its parent.
|
| 157 |
+
while ( $cat = array_shift( $categories ) ) {
|
| 158 |
+
if ( $cat->parent == 0 || isset( $cats[ $cat->parent ] ) ) {
|
| 159 |
+
$cats[ $cat->term_id ] = $cat;
|
| 160 |
+
} else {
|
| 161 |
+
$categories[] = $cat;
|
| 162 |
+
}
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
// Put terms in order with no child going before its parent.
|
| 166 |
+
while ( $t = array_shift( $custom_terms ) ) {
|
| 167 |
+
if ( $t->parent == 0 || isset( $terms[ $t->parent ] ) ) {
|
| 168 |
+
$terms[ $t->term_id ] = $t;
|
| 169 |
+
} else {
|
| 170 |
+
$custom_terms[] = $t;
|
| 171 |
+
}
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
unset( $categories, $custom_taxonomies, $custom_terms );
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
/**
|
| 178 |
+
* Wrap given string in XML CDATA tag.
|
| 179 |
+
*
|
| 180 |
+
* @since 2.1.0
|
| 181 |
+
*
|
| 182 |
+
* @param string $str String to wrap in XML CDATA tag.
|
| 183 |
+
* @return string
|
| 184 |
+
*/
|
| 185 |
+
function wxr_cdata( $str ) {
|
| 186 |
+
if ( ! seems_utf8( $str ) ) {
|
| 187 |
+
$str = utf8_encode( $str );
|
| 188 |
+
}
|
| 189 |
+
// $str = ent2ncr(esc_html($str));
|
| 190 |
+
$str = '<![CDATA[' . str_replace( ']]>', ']]]]><![CDATA[>', $str ) . ']]>';
|
| 191 |
+
|
| 192 |
+
return $str;
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
/**
|
| 196 |
+
* Return the URL of the site
|
| 197 |
+
*
|
| 198 |
+
* @since 2.5.0
|
| 199 |
+
*
|
| 200 |
+
* @return string Site URL.
|
| 201 |
+
*/
|
| 202 |
+
function wxr_site_url() {
|
| 203 |
+
if ( is_multisite() ) {
|
| 204 |
+
// Multisite: the base URL.
|
| 205 |
+
return network_home_url();
|
| 206 |
+
} else {
|
| 207 |
+
// WordPress (single site): the blog URL.
|
| 208 |
+
return get_bloginfo_rss( 'url' );
|
| 209 |
+
}
|
| 210 |
+
}
|
| 211 |
+
|
| 212 |
+
/**
|
| 213 |
+
* Output a cat_name XML tag from a given category object
|
| 214 |
+
*
|
| 215 |
+
* @since 2.1.0
|
| 216 |
+
*
|
| 217 |
+
* @param object $category Category Object
|
| 218 |
+
*/
|
| 219 |
+
function wxr_cat_name( $category ) {
|
| 220 |
+
if ( empty( $category->name ) ) {
|
| 221 |
+
return;
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
echo '<wp:cat_name>' . wxr_cdata( $category->name ) . "</wp:cat_name>\n";
|
| 225 |
+
}
|
| 226 |
+
|
| 227 |
+
/**
|
| 228 |
+
* Output a category_description XML tag from a given category object
|
| 229 |
+
*
|
| 230 |
+
* @since 2.1.0
|
| 231 |
+
*
|
| 232 |
+
* @param object $category Category Object
|
| 233 |
+
*/
|
| 234 |
+
function wxr_category_description( $category ) {
|
| 235 |
+
if ( empty( $category->description ) ) {
|
| 236 |
+
return;
|
| 237 |
+
}
|
| 238 |
+
|
| 239 |
+
echo '<wp:category_description>' . wxr_cdata( $category->description ) . "</wp:category_description>\n";
|
| 240 |
+
}
|
| 241 |
+
|
| 242 |
+
/**
|
| 243 |
+
* Output a tag_name XML tag from a given tag object
|
| 244 |
+
*
|
| 245 |
+
* @since 2.3.0
|
| 246 |
+
*
|
| 247 |
+
* @param object $tag Tag Object
|
| 248 |
+
*/
|
| 249 |
+
function wxr_tag_name( $tag ) {
|
| 250 |
+
if ( empty( $tag->name ) ) {
|
| 251 |
+
return;
|
| 252 |
+
}
|
| 253 |
+
|
| 254 |
+
echo '<wp:tag_name>' . wxr_cdata( $tag->name ) . "</wp:tag_name>\n";
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
/**
|
| 258 |
+
* Output a tag_description XML tag from a given tag object
|
| 259 |
+
*
|
| 260 |
+
* @since 2.3.0
|
| 261 |
+
*
|
| 262 |
+
* @param object $tag Tag Object
|
| 263 |
+
*/
|
| 264 |
+
function wxr_tag_description( $tag ) {
|
| 265 |
+
if ( empty( $tag->description ) ) {
|
| 266 |
+
return;
|
| 267 |
+
}
|
| 268 |
+
|
| 269 |
+
echo '<wp:tag_description>' . wxr_cdata( $tag->description ) . "</wp:tag_description>\n";
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
/**
|
| 273 |
+
* Output a term_name XML tag from a given term object
|
| 274 |
+
*
|
| 275 |
+
* @since 2.9.0
|
| 276 |
+
*
|
| 277 |
+
* @param object $term Term Object
|
| 278 |
+
*/
|
| 279 |
+
function wxr_term_name( $term ) {
|
| 280 |
+
if ( empty( $term->name ) ) {
|
| 281 |
+
return;
|
| 282 |
+
}
|
| 283 |
+
|
| 284 |
+
echo '<wp:term_name>' . wxr_cdata( $term->name ) . "</wp:term_name>\n";
|
| 285 |
+
}
|
| 286 |
+
|
| 287 |
+
/**
|
| 288 |
+
* Output a term_description XML tag from a given term object
|
| 289 |
+
*
|
| 290 |
+
* @since 2.9.0
|
| 291 |
+
*
|
| 292 |
+
* @param object $term Term Object
|
| 293 |
+
*/
|
| 294 |
+
function wxr_term_description( $term ) {
|
| 295 |
+
if ( empty( $term->description ) ) {
|
| 296 |
+
return;
|
| 297 |
+
}
|
| 298 |
+
|
| 299 |
+
echo "\t\t<wp:term_description>" . wxr_cdata( $term->description ) . "</wp:term_description>\n";
|
| 300 |
+
}
|
| 301 |
+
|
| 302 |
+
/**
|
| 303 |
+
* Output term meta XML tags for a given term object.
|
| 304 |
+
*
|
| 305 |
+
* @since 4.6.0
|
| 306 |
+
*
|
| 307 |
+
* @param WP_Term $term Term object.
|
| 308 |
+
*/
|
| 309 |
+
function wxr_term_meta( $term ) {
|
| 310 |
+
global $wpdb;
|
| 311 |
+
|
| 312 |
+
$termmeta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->termmeta WHERE term_id = %d", $term->term_id ) );
|
| 313 |
+
|
| 314 |
+
foreach ( $termmeta as $meta ) {
|
| 315 |
+
/**
|
| 316 |
+
* Filters whether to selectively skip term meta used for WXR exports.
|
| 317 |
+
*
|
| 318 |
+
* Returning a truthy value to the filter will skip the current meta
|
| 319 |
+
* object from being exported.
|
| 320 |
+
*
|
| 321 |
+
* @since 4.6.0
|
| 322 |
+
*
|
| 323 |
+
* @param bool $skip Whether to skip the current piece of term meta. Default false.
|
| 324 |
+
* @param string $meta_key Current meta key.
|
| 325 |
+
* @param object $meta Current meta object.
|
| 326 |
+
*/
|
| 327 |
+
if ( ! apply_filters( 'wxr_export_skip_termmeta', false, $meta->meta_key, $meta ) ) {
|
| 328 |
+
printf( "\t\t<wp:termmeta>\n\t\t\t<wp:meta_key>%s</wp:meta_key>\n\t\t\t<wp:meta_value>%s</wp:meta_value>\n\t\t</wp:termmeta>\n", wxr_cdata( $meta->meta_key ), wxr_cdata( $meta->meta_value ) );
|
| 329 |
+
}
|
| 330 |
+
}
|
| 331 |
+
}
|
| 332 |
+
|
| 333 |
+
/**
|
| 334 |
+
* Output list of authors with posts
|
| 335 |
+
*
|
| 336 |
+
* @since 3.1.0
|
| 337 |
+
*
|
| 338 |
+
* @global wpdb $wpdb WordPress database abstraction object.
|
| 339 |
+
*
|
| 340 |
+
* @param int[] $post_ids Optional. Array of post IDs to filter the query by.
|
| 341 |
+
*/
|
| 342 |
+
function wxr_authors_list( array $post_ids = null ) {
|
| 343 |
+
global $wpdb;
|
| 344 |
+
|
| 345 |
+
if ( ! empty( $post_ids ) ) {
|
| 346 |
+
$post_ids = array_map( 'absint', $post_ids );
|
| 347 |
+
$and = 'AND ID IN ( ' . implode( ', ', $post_ids ) . ')';
|
| 348 |
+
} else {
|
| 349 |
+
$and = '';
|
| 350 |
+
}
|
| 351 |
+
|
| 352 |
+
$authors = array();
|
| 353 |
+
$results = $wpdb->get_results( "SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_status != 'auto-draft' $and" );
|
| 354 |
+
foreach ( (array) $results as $result ) {
|
| 355 |
+
$authors[] = get_userdata( $result->post_author );
|
| 356 |
+
}
|
| 357 |
+
|
| 358 |
+
$authors = array_filter( $authors );
|
| 359 |
+
|
| 360 |
+
foreach ( $authors as $author ) {
|
| 361 |
+
echo "\t<wp:author>";
|
| 362 |
+
echo '<wp:author_id>' . intval( $author->ID ) . '</wp:author_id>';
|
| 363 |
+
echo '<wp:author_login>' . wxr_cdata( $author->user_login ) . '</wp:author_login>';
|
| 364 |
+
echo '<wp:author_email>' . wxr_cdata( $author->user_email ) . '</wp:author_email>';
|
| 365 |
+
echo '<wp:author_display_name>' . wxr_cdata( $author->display_name ) . '</wp:author_display_name>';
|
| 366 |
+
echo '<wp:author_first_name>' . wxr_cdata( $author->first_name ) . '</wp:author_first_name>';
|
| 367 |
+
echo '<wp:author_last_name>' . wxr_cdata( $author->last_name ) . '</wp:author_last_name>';
|
| 368 |
+
echo "</wp:author>\n";
|
| 369 |
+
}
|
| 370 |
+
}
|
| 371 |
+
|
| 372 |
+
/**
|
| 373 |
+
* Output all navigation menu terms
|
| 374 |
+
*
|
| 375 |
+
* @since 3.1.0
|
| 376 |
+
*/
|
| 377 |
+
function wxr_nav_menu_terms() {
|
| 378 |
+
$nav_menus = wp_get_nav_menus();
|
| 379 |
+
if ( empty( $nav_menus ) || ! is_array( $nav_menus ) ) {
|
| 380 |
+
return;
|
| 381 |
+
}
|
| 382 |
+
|
| 383 |
+
foreach ( $nav_menus as $menu ) {
|
| 384 |
+
echo "\t<wp:term>";
|
| 385 |
+
echo '<wp:term_id>' . intval( $menu->term_id ) . '</wp:term_id>';
|
| 386 |
+
echo '<wp:term_taxonomy>nav_menu</wp:term_taxonomy>';
|
| 387 |
+
echo '<wp:term_slug>' . wxr_cdata( $menu->slug ) . '</wp:term_slug>';
|
| 388 |
+
wxr_term_name( $menu );
|
| 389 |
+
echo "</wp:term>\n";
|
| 390 |
+
}
|
| 391 |
+
}
|
| 392 |
+
|
| 393 |
+
/**
|
| 394 |
+
* Output list of taxonomy terms, in XML tag format, associated with a post
|
| 395 |
+
*
|
| 396 |
+
* @since 2.3.0
|
| 397 |
+
*/
|
| 398 |
+
function wxr_post_taxonomy() {
|
| 399 |
+
$post = get_post();
|
| 400 |
+
|
| 401 |
+
$taxonomies = get_object_taxonomies( $post->post_type );
|
| 402 |
+
if ( empty( $taxonomies ) ) {
|
| 403 |
+
return;
|
| 404 |
+
}
|
| 405 |
+
$terms = wp_get_object_terms( $post->ID, $taxonomies );
|
| 406 |
+
|
| 407 |
+
foreach ( (array) $terms as $term ) {
|
| 408 |
+
echo "\t\t<category domain=\"{$term->taxonomy}\" nicename=\"{$term->slug}\">" . wxr_cdata( $term->name ) . "</category>\n";
|
| 409 |
+
}
|
| 410 |
+
}
|
| 411 |
+
|
| 412 |
+
/**
|
| 413 |
+
* @param bool $return_me
|
| 414 |
+
* @param string $meta_key
|
| 415 |
+
* @return bool
|
| 416 |
+
*/
|
| 417 |
+
add_filter( 'wxr_export_skip_postmeta', function ($return_me, $meta_key) {
|
| 418 |
+
if ( '_edit_lock' == $meta_key ) {
|
| 419 |
+
$return_me = true;
|
| 420 |
+
}
|
| 421 |
+
|
| 422 |
+
return $return_me;
|
| 423 |
+
}, 10, 2 );
|
| 424 |
+
|
| 425 |
+
ob_start();
|
| 426 |
+
|
| 427 |
+
echo '<?xml version="1.0" encoding="' . get_bloginfo( 'charset' ) . "\" ?>\n";
|
| 428 |
+
|
| 429 |
+
?>
|
| 430 |
+
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
|
| 431 |
+
<!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
|
| 432 |
+
<!-- You may use this file to transfer that content from one site to another. -->
|
| 433 |
+
<!-- This file is not intended to serve as a complete backup of your site. -->
|
| 434 |
+
|
| 435 |
+
<!-- To import this information into a WordPress site follow these steps: -->
|
| 436 |
+
<!-- 1. Log in to that site as an administrator. -->
|
| 437 |
+
<!-- 2. Go to Tools: Import in the WordPress admin panel. -->
|
| 438 |
+
<!-- 3. Install the "WordPress" importer from the list. -->
|
| 439 |
+
<!-- 4. Activate & Run Importer. -->
|
| 440 |
+
<!-- 5. Upload this file using the form provided on that page. -->
|
| 441 |
+
<!-- 6. You will first be asked to map the authors in this export file to users -->
|
| 442 |
+
<!-- on the site. For each author, you may choose to map to an -->
|
| 443 |
+
<!-- existing user on the site or to create a new user. -->
|
| 444 |
+
<!-- 7. WordPress will then import each of the posts, pages, comments, categories, etc. -->
|
| 445 |
+
<!-- contained in this file into your site. -->
|
| 446 |
+
|
| 447 |
+
<?php the_generator( 'export' ); ?>
|
| 448 |
+
<rss version="2.0"
|
| 449 |
+
xmlns:excerpt="http://wordpress.org/export/<?php echo WXR_VERSION; ?>/excerpt/"
|
| 450 |
+
xmlns:content="http://purl.org/rss/1.0/modules/content/"
|
| 451 |
+
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
|
| 452 |
+
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
| 453 |
+
xmlns:wp="http://wordpress.org/export/<?php echo WXR_VERSION; ?>/"
|
| 454 |
+
>
|
| 455 |
+
|
| 456 |
+
<channel>
|
| 457 |
+
<title><?php bloginfo_rss( 'name' ); ?></title>
|
| 458 |
+
<link><?php bloginfo_rss( 'url' ); ?></link>
|
| 459 |
+
<description><?php bloginfo_rss( 'description' ); ?></description>
|
| 460 |
+
<pubDate><?php echo date( 'D, d M Y H:i:s +0000' ); ?></pubDate>
|
| 461 |
+
<language><?php bloginfo_rss( 'language' ); ?></language>
|
| 462 |
+
<wp:wxr_version><?php echo WXR_VERSION; ?></wp:wxr_version>
|
| 463 |
+
<wp:base_site_url><?php echo wxr_site_url(); ?></wp:base_site_url>
|
| 464 |
+
<wp:base_blog_url><?php bloginfo_rss( 'url' ); ?></wp:base_blog_url>
|
| 465 |
+
|
| 466 |
+
<?php wxr_authors_list( $post_ids ); ?>
|
| 467 |
+
|
| 468 |
+
<?php foreach ( $cats as $c ) : ?>
|
| 469 |
+
<wp:category>
|
| 470 |
+
<wp:term_id><?php echo intval( $c->term_id ); ?></wp:term_id>
|
| 471 |
+
<wp:category_nicename><?php echo wxr_cdata( $c->slug ); ?></wp:category_nicename>
|
| 472 |
+
<wp:category_parent><?php echo wxr_cdata( $c->parent ? $cats[ $c->parent ]->slug : '' ); ?></wp:category_parent>
|
| 473 |
+
<?php
|
| 474 |
+
wxr_cat_name( $c );
|
| 475 |
+
wxr_category_description( $c );
|
| 476 |
+
wxr_term_meta( $c );
|
| 477 |
+
?>
|
| 478 |
+
</wp:category>
|
| 479 |
+
<?php endforeach; ?>
|
| 480 |
+
<?php foreach ( $tags as $t ) : ?>
|
| 481 |
+
<wp:tag>
|
| 482 |
+
<wp:term_id><?php echo intval( $t->term_id ); ?></wp:term_id>
|
| 483 |
+
<wp:tag_slug><?php echo wxr_cdata( $t->slug ); ?></wp:tag_slug>
|
| 484 |
+
<?php
|
| 485 |
+
wxr_tag_name( $t );
|
| 486 |
+
wxr_tag_description( $t );
|
| 487 |
+
wxr_term_meta( $t );
|
| 488 |
+
?>
|
| 489 |
+
</wp:tag>
|
| 490 |
+
<?php endforeach; ?>
|
| 491 |
+
<?php foreach ( $terms as $t ) : ?>
|
| 492 |
+
<wp:term>
|
| 493 |
+
<wp:term_id><?php echo wxr_cdata( $t->term_id ); ?></wp:term_id>
|
| 494 |
+
<wp:term_taxonomy><?php echo wxr_cdata( $t->taxonomy ); ?></wp:term_taxonomy>
|
| 495 |
+
<wp:term_slug><?php echo wxr_cdata( $t->slug ); ?></wp:term_slug>
|
| 496 |
+
<wp:term_parent><?php echo wxr_cdata( $t->parent ? $terms[ $t->parent ]->slug : '' ); ?></wp:term_parent>
|
| 497 |
+
<?php
|
| 498 |
+
wxr_term_name( $t );
|
| 499 |
+
wxr_term_description( $t );
|
| 500 |
+
wxr_term_meta( $t );
|
| 501 |
+
?>
|
| 502 |
+
</wp:term>
|
| 503 |
+
<?php endforeach; ?>
|
| 504 |
+
<?php
|
| 505 |
+
if ( 'all' == $args['content'] ) {
|
| 506 |
+
wxr_nav_menu_terms();}
|
| 507 |
+
?>
|
| 508 |
+
|
| 509 |
+
<?php
|
| 510 |
+
/** This action is documented in wp-includes/feed-rss2.php */
|
| 511 |
+
do_action( 'rss2_head' );
|
| 512 |
+
?>
|
| 513 |
+
|
| 514 |
+
<?php
|
| 515 |
+
if ( $post_ids ) {
|
| 516 |
+
/**
|
| 517 |
+
* @global WP_Query $wp_query
|
| 518 |
+
*/
|
| 519 |
+
global $wp_query;
|
| 520 |
+
|
| 521 |
+
// Fake being in the loop.
|
| 522 |
+
$wp_query->in_the_loop = true;
|
| 523 |
+
|
| 524 |
+
// Fetch 20 posts at a time rather than loading the entire table into memory.
|
| 525 |
+
while ( $next_posts = array_splice( $post_ids, 0, 20 ) ) {
|
| 526 |
+
$where = 'WHERE ID IN (' . join( ',', $next_posts ) . ')';
|
| 527 |
+
$posts = $wpdb->get_results( "SELECT * FROM {$wpdb->posts} $where" );
|
| 528 |
+
|
| 529 |
+
// Begin Loop.
|
| 530 |
+
foreach ( $posts as $post ) {
|
| 531 |
+
setup_postdata( $post );
|
| 532 |
+
|
| 533 |
+
/** This filter is documented in wp-includes/feed.php */
|
| 534 |
+
$title = apply_filters( 'the_title_rss', $post->post_title );
|
| 535 |
+
|
| 536 |
+
/**
|
| 537 |
+
* Filters the post content used for WXR exports.
|
| 538 |
+
*
|
| 539 |
+
* @since 2.5.0
|
| 540 |
+
*
|
| 541 |
+
* @param string $post_content Content of the current post.
|
| 542 |
+
*/
|
| 543 |
+
$content = wxr_cdata( apply_filters( 'the_content_export', $post->post_content ) );
|
| 544 |
+
|
| 545 |
+
/**
|
| 546 |
+
* Filters the post excerpt used for WXR exports.
|
| 547 |
+
*
|
| 548 |
+
* @since 2.6.0
|
| 549 |
+
*
|
| 550 |
+
* @param string $post_excerpt Excerpt for the current post.
|
| 551 |
+
*/
|
| 552 |
+
$excerpt = wxr_cdata( apply_filters( 'the_excerpt_export', $post->post_excerpt ) );
|
| 553 |
+
|
| 554 |
+
$is_sticky = is_sticky( $post->ID ) ? 1 : 0;
|
| 555 |
+
?>
|
| 556 |
+
<item>
|
| 557 |
+
<title><?php echo $title; ?></title>
|
| 558 |
+
<link><?php the_permalink_rss(); ?></link>
|
| 559 |
+
<pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate>
|
| 560 |
+
<dc:creator><?php echo wxr_cdata( get_the_author_meta( 'login' ) ); ?></dc:creator>
|
| 561 |
+
<guid isPermaLink="false"><?php the_guid(); ?></guid>
|
| 562 |
+
<description></description>
|
| 563 |
+
<content:encoded><?php echo $content; ?></content:encoded>
|
| 564 |
+
<excerpt:encoded><?php echo $excerpt; ?></excerpt:encoded>
|
| 565 |
+
<wp:post_id><?php echo intval( $post->ID ); ?></wp:post_id>
|
| 566 |
+
<wp:post_date><?php echo wxr_cdata( $post->post_date ); ?></wp:post_date>
|
| 567 |
+
<wp:post_date_gmt><?php echo wxr_cdata( $post->post_date_gmt ); ?></wp:post_date_gmt>
|
| 568 |
+
<wp:comment_status><?php echo wxr_cdata( $post->comment_status ); ?></wp:comment_status>
|
| 569 |
+
<wp:ping_status><?php echo wxr_cdata( $post->ping_status ); ?></wp:ping_status>
|
| 570 |
+
<wp:post_name><?php echo wxr_cdata( $post->post_name ); ?></wp:post_name>
|
| 571 |
+
<wp:status><?php echo wxr_cdata( $post->post_status ); ?></wp:status>
|
| 572 |
+
<wp:post_parent><?php echo intval( $post->post_parent ); ?></wp:post_parent>
|
| 573 |
+
<wp:menu_order><?php echo intval( $post->menu_order ); ?></wp:menu_order>
|
| 574 |
+
<wp:post_type><?php echo wxr_cdata( $post->post_type ); ?></wp:post_type>
|
| 575 |
+
<wp:post_password><?php echo wxr_cdata( $post->post_password ); ?></wp:post_password>
|
| 576 |
+
<wp:is_sticky><?php echo intval( $is_sticky ); ?></wp:is_sticky>
|
| 577 |
+
<?php if ( $post->post_type == 'attachment' ) : ?>
|
| 578 |
+
<wp:attachment_url><?php echo wxr_cdata( wp_get_attachment_url( $post->ID ) ); ?></wp:attachment_url>
|
| 579 |
+
<?php endif; ?>
|
| 580 |
+
<?php wxr_post_taxonomy(); ?>
|
| 581 |
+
<?php
|
| 582 |
+
$postmeta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE post_id = %d", $post->ID ) );
|
| 583 |
+
foreach ( $postmeta as $meta ) :
|
| 584 |
+
/**
|
| 585 |
+
* Filters whether to selectively skip post meta used for WXR exports.
|
| 586 |
+
*
|
| 587 |
+
* Returning a truthy value to the filter will skip the current meta
|
| 588 |
+
* object from being exported.
|
| 589 |
+
*
|
| 590 |
+
* @since 3.3.0
|
| 591 |
+
*
|
| 592 |
+
* @param bool $skip Whether to skip the current post meta. Default false.
|
| 593 |
+
* @param string $meta_key Current meta key.
|
| 594 |
+
* @param object $meta Current meta object.
|
| 595 |
+
*/
|
| 596 |
+
if ( apply_filters( 'wxr_export_skip_postmeta', false, $meta->meta_key, $meta ) ) {
|
| 597 |
+
continue;
|
| 598 |
+
}
|
| 599 |
+
?>
|
| 600 |
+
<wp:postmeta>
|
| 601 |
+
<wp:meta_key><?php echo wxr_cdata( $meta->meta_key ); ?></wp:meta_key>
|
| 602 |
+
<wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>
|
| 603 |
+
</wp:postmeta>
|
| 604 |
+
<?php
|
| 605 |
+
endforeach;
|
| 606 |
+
|
| 607 |
+
$_comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved <> 'spam'", $post->ID ) );
|
| 608 |
+
$comments = array_map( 'get_comment', $_comments );
|
| 609 |
+
foreach ( $comments as $c ) :
|
| 610 |
+
?>
|
| 611 |
+
<wp:comment>
|
| 612 |
+
<wp:comment_id><?php echo intval( $c->comment_ID ); ?></wp:comment_id>
|
| 613 |
+
<wp:comment_author><?php echo wxr_cdata( $c->comment_author ); ?></wp:comment_author>
|
| 614 |
+
<wp:comment_author_email><?php echo wxr_cdata( $c->comment_author_email ); ?></wp:comment_author_email>
|
| 615 |
+
<wp:comment_author_url><?php echo esc_url_raw( $c->comment_author_url ); ?></wp:comment_author_url>
|
| 616 |
+
<wp:comment_author_IP><?php echo wxr_cdata( $c->comment_author_IP ); ?></wp:comment_author_IP>
|
| 617 |
+
<wp:comment_date><?php echo wxr_cdata( $c->comment_date ); ?></wp:comment_date>
|
| 618 |
+
<wp:comment_date_gmt><?php echo wxr_cdata( $c->comment_date_gmt ); ?></wp:comment_date_gmt>
|
| 619 |
+
<wp:comment_content><?php echo wxr_cdata( $c->comment_content ); ?></wp:comment_content>
|
| 620 |
+
<wp:comment_approved><?php echo wxr_cdata( $c->comment_approved ); ?></wp:comment_approved>
|
| 621 |
+
<wp:comment_type><?php echo wxr_cdata( $c->comment_type ); ?></wp:comment_type>
|
| 622 |
+
<wp:comment_parent><?php echo intval( $c->comment_parent ); ?></wp:comment_parent>
|
| 623 |
+
<wp:comment_user_id><?php echo intval( $c->user_id ); ?></wp:comment_user_id>
|
| 624 |
+
<?php
|
| 625 |
+
$c_meta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->commentmeta WHERE comment_id = %d", $c->comment_ID ) );
|
| 626 |
+
foreach ( $c_meta as $meta ) :
|
| 627 |
+
/**
|
| 628 |
+
* Filters whether to selectively skip comment meta used for WXR exports.
|
| 629 |
+
*
|
| 630 |
+
* Returning a truthy value to the filter will skip the current meta
|
| 631 |
+
* object from being exported.
|
| 632 |
+
*
|
| 633 |
+
* @since 4.0.0
|
| 634 |
+
*
|
| 635 |
+
* @param bool $skip Whether to skip the current comment meta. Default false.
|
| 636 |
+
* @param string $meta_key Current meta key.
|
| 637 |
+
* @param object $meta Current meta object.
|
| 638 |
+
*/
|
| 639 |
+
if ( apply_filters( 'wxr_export_skip_commentmeta', false, $meta->meta_key, $meta ) ) {
|
| 640 |
+
continue;
|
| 641 |
+
}
|
| 642 |
+
?>
|
| 643 |
+
<wp:commentmeta>
|
| 644 |
+
<wp:meta_key><?php echo wxr_cdata( $meta->meta_key ); ?></wp:meta_key>
|
| 645 |
+
<wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>
|
| 646 |
+
</wp:commentmeta>
|
| 647 |
+
<?php endforeach; ?>
|
| 648 |
+
</wp:comment>
|
| 649 |
+
<?php endforeach; ?>
|
| 650 |
+
</item>
|
| 651 |
+
<?php
|
| 652 |
+
}
|
| 653 |
+
}
|
| 654 |
+
}
|
| 655 |
+
?>
|
| 656 |
+
</channel>
|
| 657 |
+
</rss>
|
| 658 |
+
<?php
|
| 659 |
+
return ob_get_clean();
|
| 660 |
+
}
|
| 661 |
+
}
|
| 662 |
+
|
| 663 |
+
|
framework/features/demo-install/content-installer.php
ADDED
|
@@ -0,0 +1,416 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
namespace Blocksy;
|
| 4 |
+
|
| 5 |
+
class DemoInstallContentInstaller {
|
| 6 |
+
protected $has_streaming = true;
|
| 7 |
+
protected $demo_name = null;
|
| 8 |
+
|
| 9 |
+
public function __construct($args = []) {
|
| 10 |
+
$args = wp_parse_args($args, [
|
| 11 |
+
'has_streaming' => true,
|
| 12 |
+
'demo_name' => null
|
| 13 |
+
]);
|
| 14 |
+
|
| 15 |
+
if (
|
| 16 |
+
!$args['demo_name']
|
| 17 |
+
&&
|
| 18 |
+
isset($_REQUEST['demo_name'])
|
| 19 |
+
&&
|
| 20 |
+
$_REQUEST['demo_name']
|
| 21 |
+
) {
|
| 22 |
+
$args['demo_name'] = $_REQUEST['demo_name'];
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
$this->has_streaming = $args['has_streaming'];
|
| 26 |
+
$this->demo_name = $args['demo_name'];
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
public function import() {
|
| 30 |
+
if ($this->has_streaming) {
|
| 31 |
+
Plugin::instance()->demo->start_streaming();
|
| 32 |
+
|
| 33 |
+
if (! current_user_can('edit_theme_options')) {
|
| 34 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 35 |
+
'action' => 'complete',
|
| 36 |
+
'error' => 'No permission.',
|
| 37 |
+
]);
|
| 38 |
+
|
| 39 |
+
exit;
|
| 40 |
+
}
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
if (class_exists('\Elementor\Compatibility')) {
|
| 44 |
+
remove_filter('wp_import_post_meta', [
|
| 45 |
+
'\Elementor\Compatibility',
|
| 46 |
+
'on_wp_import_post_meta'
|
| 47 |
+
]);
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
add_action(
|
| 51 |
+
'blocksy_wp_import_insert_term',
|
| 52 |
+
function($term_id) {
|
| 53 |
+
$this->track_term_insert($term_id);
|
| 54 |
+
$this->send_update('term');
|
| 55 |
+
},
|
| 56 |
+
10,
|
| 57 |
+
1
|
| 58 |
+
);
|
| 59 |
+
|
| 60 |
+
add_action(
|
| 61 |
+
'wp_import_insert_term',
|
| 62 |
+
function($t) {
|
| 63 |
+
$term_id = $t['term_id'];
|
| 64 |
+
$this->track_term_insert($term_id);
|
| 65 |
+
$this->send_update('term');
|
| 66 |
+
},
|
| 67 |
+
10,
|
| 68 |
+
1
|
| 69 |
+
);
|
| 70 |
+
|
| 71 |
+
add_filter(
|
| 72 |
+
'wp_import_post_meta',
|
| 73 |
+
function($meta, $post_id, $post) {
|
| 74 |
+
$this->track_post_insert($post_id);
|
| 75 |
+
|
| 76 |
+
if (get_post_type($post_id) === 'attachment') {
|
| 77 |
+
$this->send_update('media');
|
| 78 |
+
} else {
|
| 79 |
+
$this->send_update('post');
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
$wp_importer = get_plugins( '/wordpress-importer' );
|
| 83 |
+
|
| 84 |
+
if (! empty($wp_importer)) {
|
| 85 |
+
$wp_importer_version = $wp_importer['wordpress-importer.php']['Version'];
|
| 86 |
+
|
| 87 |
+
if (! empty($wp_importer_version)) {
|
| 88 |
+
if (version_compare($wp_importer_version, '0.7', '>=')) {
|
| 89 |
+
foreach ($meta as &$m) {
|
| 90 |
+
if ('_elementor_data' === $m['key']) {
|
| 91 |
+
$m['value'] = wp_slash($m['value']);
|
| 92 |
+
break;
|
| 93 |
+
}
|
| 94 |
+
}
|
| 95 |
+
}
|
| 96 |
+
}
|
| 97 |
+
} else {
|
| 98 |
+
foreach ($meta as &$m) {
|
| 99 |
+
if ('_elementor_data' === $m['key']) {
|
| 100 |
+
$m['value'] = wp_slash($m['value']);
|
| 101 |
+
break;
|
| 102 |
+
}
|
| 103 |
+
}
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
return $meta;
|
| 107 |
+
},
|
| 108 |
+
10,
|
| 109 |
+
3
|
| 110 |
+
);
|
| 111 |
+
|
| 112 |
+
add_action(
|
| 113 |
+
'wp_import_insert_post',
|
| 114 |
+
function ($post_id, $old_post_id) {
|
| 115 |
+
Plugin::instance()->header->patch_conditions(
|
| 116 |
+
intval($post_id),
|
| 117 |
+
intval($old_post_id)
|
| 118 |
+
);
|
| 119 |
+
},
|
| 120 |
+
10, 2
|
| 121 |
+
);
|
| 122 |
+
|
| 123 |
+
add_filter(
|
| 124 |
+
'wp_import_term_meta',
|
| 125 |
+
function( $meta, $term_id, $post ) {
|
| 126 |
+
$this->track_term_insert($term_id);
|
| 127 |
+
$this->send_update('term');
|
| 128 |
+
|
| 129 |
+
return $meta;
|
| 130 |
+
},
|
| 131 |
+
10,
|
| 132 |
+
3
|
| 133 |
+
);
|
| 134 |
+
|
| 135 |
+
add_action(
|
| 136 |
+
'wp_import_insert_comment',
|
| 137 |
+
function($comment_id, $comment, $comment_post_id, $post) {
|
| 138 |
+
$this->send_update('comment');
|
| 139 |
+
},
|
| 140 |
+
10,
|
| 141 |
+
4
|
| 142 |
+
);
|
| 143 |
+
|
| 144 |
+
if ($this->has_streaming) {
|
| 145 |
+
if (! $this->demo_name) {
|
| 146 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 147 |
+
'action' => 'complete',
|
| 148 |
+
'error' => 'No demo name passed.',
|
| 149 |
+
]);
|
| 150 |
+
exit;
|
| 151 |
+
}
|
| 152 |
+
}
|
| 153 |
+
|
| 154 |
+
$demo_name = explode(':', $this->demo_name);
|
| 155 |
+
|
| 156 |
+
if (! isset($demo_name[1])) {
|
| 157 |
+
$demo_name[1] = '';
|
| 158 |
+
}
|
| 159 |
+
|
| 160 |
+
$demo = $demo_name[0];
|
| 161 |
+
$builder = $demo_name[1];
|
| 162 |
+
|
| 163 |
+
$url = 'https://demo.creativethemes.com/?' . http_build_query([
|
| 164 |
+
'route' => 'get_single_xml',
|
| 165 |
+
'demo' => $demo . ':' . $builder
|
| 166 |
+
]);
|
| 167 |
+
|
| 168 |
+
$wp_import = new \Blocksy_WP_Import();
|
| 169 |
+
$import_data = $wp_import->parse($url);
|
| 170 |
+
|
| 171 |
+
if ($this->has_streaming) {
|
| 172 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 173 |
+
'action' => 'get_content_preliminary_data',
|
| 174 |
+
'url' => $url,
|
| 175 |
+
'our_data' => blc_load_xml_file($url),
|
| 176 |
+
'data' => $import_data,
|
| 177 |
+
]);
|
| 178 |
+
}
|
| 179 |
+
|
| 180 |
+
$wp_import->get_authors_from_import($import_data);
|
| 181 |
+
|
| 182 |
+
unset($import_data);
|
| 183 |
+
|
| 184 |
+
$author_data = [];
|
| 185 |
+
|
| 186 |
+
foreach ($wp_import->authors as $wxr_author) {
|
| 187 |
+
$author = new \stdClass();
|
| 188 |
+
|
| 189 |
+
// Always in the WXR
|
| 190 |
+
$author->user_login = $wxr_author['author_login'];
|
| 191 |
+
|
| 192 |
+
// Should be in the WXR; no guarantees
|
| 193 |
+
if (isset($wxr_author['author_email'])) {
|
| 194 |
+
$author->user_email = $wxr_author['author_email'];
|
| 195 |
+
}
|
| 196 |
+
|
| 197 |
+
if (isset($wxr_author['author_display_name'])) {
|
| 198 |
+
$author->display_name = $wxr_author['author_display_name'];
|
| 199 |
+
}
|
| 200 |
+
|
| 201 |
+
if (isset($wxr_author['author_first_name'])) {
|
| 202 |
+
$author->first_name = $wxr_author['author_first_name'];
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
if (isset($wxr_author['author_last_name'])) {
|
| 206 |
+
$author->last_name = $wxr_author['author_last_name'];
|
| 207 |
+
}
|
| 208 |
+
|
| 209 |
+
$author_data[] = $author;
|
| 210 |
+
}
|
| 211 |
+
|
| 212 |
+
// Build the author mapping
|
| 213 |
+
$author_mapping = $this->process_author_mapping( 'skip', $author_data );
|
| 214 |
+
|
| 215 |
+
$author_in = wp_list_pluck($author_mapping, 'old_user_login');
|
| 216 |
+
$author_out = wp_list_pluck($author_mapping, 'new_user_login');
|
| 217 |
+
unset($author_mapping, $author_data);
|
| 218 |
+
|
| 219 |
+
// $user_select needs to be an array of user IDs
|
| 220 |
+
$user_select = [];
|
| 221 |
+
$invalid_user_select = [];
|
| 222 |
+
|
| 223 |
+
foreach ($author_out as $author_login) {
|
| 224 |
+
$user = get_user_by('login', $author_login);
|
| 225 |
+
|
| 226 |
+
if ($user) {
|
| 227 |
+
$user_select[] = $user->ID;
|
| 228 |
+
} else {
|
| 229 |
+
$invalid_user_select[] = $author_login;
|
| 230 |
+
}
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
if (! empty($invalid_user_select)) {
|
| 234 |
+
# return new WP_Error( 'invalid-author-mapping', sprintf( 'These user_logins are invalid: %s', implode( ',', $invalid_user_select ) ) );
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
unset($author_out);
|
| 238 |
+
|
| 239 |
+
$wp_import->fetch_attachments = true;
|
| 240 |
+
|
| 241 |
+
$_GET['import'] = 'wordpress';
|
| 242 |
+
$_GET['step'] = 2;
|
| 243 |
+
|
| 244 |
+
$_POST['imported_authors'] = $author_in;
|
| 245 |
+
$_POST['user_map'] = $user_select;
|
| 246 |
+
$_POST['fetch_attachments'] = $wp_import->fetch_attachments;
|
| 247 |
+
|
| 248 |
+
ob_start();
|
| 249 |
+
$wp_import->import( $url );
|
| 250 |
+
ob_end_clean();
|
| 251 |
+
|
| 252 |
+
if ($this->has_streaming) {
|
| 253 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 254 |
+
'action' => 'test_terms',
|
| 255 |
+
'error' => false,
|
| 256 |
+
'terms' => $wp_import->processed_terms
|
| 257 |
+
]);
|
| 258 |
+
}
|
| 259 |
+
|
| 260 |
+
if (class_exists('Blocksy_Customizer_Builder')) {
|
| 261 |
+
$header_builder = new \Blocksy_Customizer_Builder();
|
| 262 |
+
$header_builder->patch_header_value_for($wp_import->processed_terms);
|
| 263 |
+
}
|
| 264 |
+
|
| 265 |
+
$this->clean_plugins_cache();
|
| 266 |
+
$this->assign_pages_ids($demo, $builder);
|
| 267 |
+
|
| 268 |
+
if ($this->has_streaming) {
|
| 269 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 270 |
+
'action' => 'complete',
|
| 271 |
+
'error' => false
|
| 272 |
+
]);
|
| 273 |
+
|
| 274 |
+
exit;
|
| 275 |
+
}
|
| 276 |
+
}
|
| 277 |
+
|
| 278 |
+
public function track_post_insert($post_id) {
|
| 279 |
+
update_post_meta($post_id, 'blocksy_demos_imported_post', true);
|
| 280 |
+
}
|
| 281 |
+
|
| 282 |
+
public function track_term_insert($term_id) {
|
| 283 |
+
update_term_meta($term_id, 'blocksy_demos_imported_term', true);
|
| 284 |
+
}
|
| 285 |
+
|
| 286 |
+
public function send_update($kind = null) {
|
| 287 |
+
if ($this->has_streaming) {
|
| 288 |
+
ob_end_clean();
|
| 289 |
+
|
| 290 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 291 |
+
'action' => 'content_installer_progress',
|
| 292 |
+
'kind' => $kind,
|
| 293 |
+
'error' => false,
|
| 294 |
+
]);
|
| 295 |
+
|
| 296 |
+
ob_start();
|
| 297 |
+
}
|
| 298 |
+
}
|
| 299 |
+
|
| 300 |
+
public function clean_plugins_cache() {
|
| 301 |
+
if ($this->has_streaming) {
|
| 302 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 303 |
+
'action' => 'cleanup_plugins_cache',
|
| 304 |
+
'error' => false,
|
| 305 |
+
]);
|
| 306 |
+
}
|
| 307 |
+
|
| 308 |
+
if (class_exists('\Elementor\Plugin')) {
|
| 309 |
+
\Elementor\Plugin::$instance->posts_css_manager->clear_cache();
|
| 310 |
+
}
|
| 311 |
+
|
| 312 |
+
if (is_callable('FLBuilderModel::delete_asset_cache_for_all_posts')) {
|
| 313 |
+
\FLBuilderModel::delete_asset_cache_for_all_posts();
|
| 314 |
+
}
|
| 315 |
+
}
|
| 316 |
+
|
| 317 |
+
public function assign_pages_ids($demo, $builder) {
|
| 318 |
+
if ($this->has_streaming) {
|
| 319 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 320 |
+
'action' => 'cleanup_plugins_cache',
|
| 321 |
+
'error' => false,
|
| 322 |
+
]);
|
| 323 |
+
}
|
| 324 |
+
|
| 325 |
+
$demo_content = Plugin::instance()->demo->fetch_single_demo([
|
| 326 |
+
'demo' => $demo,
|
| 327 |
+
'builder' => $builder,
|
| 328 |
+
'field' => 'content'
|
| 329 |
+
]);
|
| 330 |
+
|
| 331 |
+
if (! isset($demo_content['pages_ids_options'])) {
|
| 332 |
+
if ($this->has_streaming) {
|
| 333 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 334 |
+
'action' => 'complete',
|
| 335 |
+
'error' => __('Downloaded demo is corrupted.'),
|
| 336 |
+
]);
|
| 337 |
+
|
| 338 |
+
exit;
|
| 339 |
+
}
|
| 340 |
+
}
|
| 341 |
+
|
| 342 |
+
foreach ($demo_content['pages_ids_options'] as $option_id => $page_title) {
|
| 343 |
+
if (strpos($option_id, 'woocommerce') !== false) {
|
| 344 |
+
if (! class_exists('WooCommerce')) {
|
| 345 |
+
continue;
|
| 346 |
+
}
|
| 347 |
+
}
|
| 348 |
+
|
| 349 |
+
$page = get_page_by_title($page_title);
|
| 350 |
+
|
| 351 |
+
if (isset($page) && $page->ID) {
|
| 352 |
+
update_option($option_id, $page->ID);
|
| 353 |
+
}
|
| 354 |
+
}
|
| 355 |
+
}
|
| 356 |
+
|
| 357 |
+
private function process_author_mapping( $authors_arg, $author_data ) {
|
| 358 |
+
switch ($authors_arg) {
|
| 359 |
+
// Create authors if they don't yet exist; maybe match on email or user_login
|
| 360 |
+
case 'create':
|
| 361 |
+
return $this->create_authors_for_mapping($author_data);
|
| 362 |
+
// Skip any sort of author mapping
|
| 363 |
+
case 'skip':
|
| 364 |
+
return array();
|
| 365 |
+
default:
|
| 366 |
+
return new WP_Error( 'invalid-argument', "'authors' argument is invalid." );
|
| 367 |
+
}
|
| 368 |
+
}
|
| 369 |
+
|
| 370 |
+
private function create_authors_for_mapping( $author_data ) {
|
| 371 |
+
$author_mapping = array();
|
| 372 |
+
foreach ($author_data as $author) {
|
| 373 |
+
if (isset($author->user_email)) {
|
| 374 |
+
$user = get_user_by('email', $author->user_email);
|
| 375 |
+
|
| 376 |
+
if ($user instanceof WP_User) {
|
| 377 |
+
$author_mapping[] = [
|
| 378 |
+
'old_user_login' => $author->user_login,
|
| 379 |
+
'new_user_login' => $user->user_login,
|
| 380 |
+
];
|
| 381 |
+
continue;
|
| 382 |
+
}
|
| 383 |
+
}
|
| 384 |
+
|
| 385 |
+
$user = get_user_by('login', $author->user_login);
|
| 386 |
+
|
| 387 |
+
if ($user instanceof WP_User) {
|
| 388 |
+
$author_mapping[] = [
|
| 389 |
+
'old_user_login' => $author->user_login,
|
| 390 |
+
'new_user_login' => $user->user_login,
|
| 391 |
+
];
|
| 392 |
+
continue;
|
| 393 |
+
}
|
| 394 |
+
$user = array(
|
| 395 |
+
'user_login' => '',
|
| 396 |
+
'user_email' => '',
|
| 397 |
+
'user_pass' => wp_generate_password(),
|
| 398 |
+
);
|
| 399 |
+
|
| 400 |
+
$user = array_merge($user, (array) $author);
|
| 401 |
+
$user_id = wp_insert_user($user);
|
| 402 |
+
|
| 403 |
+
if (is_wp_error($user_id)) {
|
| 404 |
+
return $user_id;
|
| 405 |
+
}
|
| 406 |
+
|
| 407 |
+
$user = get_user_by( 'id', $user_id );
|
| 408 |
+
$author_mapping[] = [
|
| 409 |
+
'old_user_login' => $author->user_login,
|
| 410 |
+
'new_user_login' => $user->user_login,
|
| 411 |
+
];
|
| 412 |
+
}
|
| 413 |
+
return $author_mapping;
|
| 414 |
+
}
|
| 415 |
+
}
|
| 416 |
+
|
framework/features/demo-install/fake-content-eraser.php
ADDED
|
@@ -0,0 +1,273 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
namespace Blocksy;
|
| 4 |
+
|
| 5 |
+
class DemoInstallFakeContentEraser {
|
| 6 |
+
public function import() {
|
| 7 |
+
Plugin::instance()->demo->start_streaming();
|
| 8 |
+
|
| 9 |
+
if (! current_user_can('edit_theme_options')) {
|
| 10 |
+
/*
|
| 11 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 12 |
+
'action' => 'complete',
|
| 13 |
+
'error' => 'No permission.',
|
| 14 |
+
]);
|
| 15 |
+
|
| 16 |
+
exit;
|
| 17 |
+
*/
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
if (class_exists('WC_REST_System_Status_Tools_V2_Controller')) {
|
| 21 |
+
define('WP_CLI', true);
|
| 22 |
+
|
| 23 |
+
$s = new \WC_REST_System_Status_Tools_V2_Controller();
|
| 24 |
+
|
| 25 |
+
$s->execute_tool('clear_transients');
|
| 26 |
+
if (function_exists('wc_update_product_lookup_tables')) {
|
| 27 |
+
wc_update_product_lookup_tables();
|
| 28 |
+
}
|
| 29 |
+
$s->execute_tool('clear_transients');
|
| 30 |
+
$s->execute_tool('db_update_routine');
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
// $this->reset_widgets_data();
|
| 34 |
+
// $this->reset_customizer();
|
| 35 |
+
// $this->erase_default_pages();
|
| 36 |
+
// $this->reset_previous_posts();
|
| 37 |
+
// $this->reset_previous_terms();
|
| 38 |
+
// $this->reset_menus();
|
| 39 |
+
|
| 40 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 41 |
+
'action' => 'complete',
|
| 42 |
+
'error' => false,
|
| 43 |
+
]);
|
| 44 |
+
|
| 45 |
+
exit;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
private function reset_previous_posts() {
|
| 49 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 50 |
+
'action' => 'erase_previous_posts',
|
| 51 |
+
'error' => false,
|
| 52 |
+
]);
|
| 53 |
+
|
| 54 |
+
global $wpdb;
|
| 55 |
+
|
| 56 |
+
$post_ids = $wpdb->get_col(
|
| 57 |
+
"SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key='blocksy_demos_imported_post'"
|
| 58 |
+
);
|
| 59 |
+
|
| 60 |
+
foreach ($post_ids as $post_id) {
|
| 61 |
+
wp_delete_post($post_id, true);
|
| 62 |
+
}
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
private function reset_previous_terms() {
|
| 66 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 67 |
+
'action' => 'erase_previous_terms',
|
| 68 |
+
'error' => false,
|
| 69 |
+
]);
|
| 70 |
+
|
| 71 |
+
global $wpdb;
|
| 72 |
+
|
| 73 |
+
$term_ids = $wpdb->get_col(
|
| 74 |
+
"SELECT term_id FROM {$wpdb->termmeta} WHERE meta_key='blocksy_demos_imported_term'"
|
| 75 |
+
);
|
| 76 |
+
|
| 77 |
+
foreach ($term_ids as $term_id) {
|
| 78 |
+
if (! $term_id) {
|
| 79 |
+
continue;
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
$term = get_term($term_id);
|
| 83 |
+
|
| 84 |
+
if (! $term) continue;
|
| 85 |
+
|
| 86 |
+
wp_delete_term($term_id, $term->taxonomy);
|
| 87 |
+
}
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
private function erase_default_pages() {
|
| 91 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 92 |
+
'action' => 'erase_default_pages',
|
| 93 |
+
'error' => false,
|
| 94 |
+
]);
|
| 95 |
+
|
| 96 |
+
$sample_page = get_page_by_path('sample-page', OBJECT, 'page');
|
| 97 |
+
$hello_world_post = get_page_by_path('hello-world', OBJECT, 'post');
|
| 98 |
+
|
| 99 |
+
if ($sample_page) {
|
| 100 |
+
wp_delete_post($sample_page->ID, true);
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
if ($hello_world_post) {
|
| 104 |
+
wp_delete_post($hello_world_post->ID, true);
|
| 105 |
+
}
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
private function reset_customizer() {
|
| 109 |
+
global $wp_customize;
|
| 110 |
+
|
| 111 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 112 |
+
'action' => 'erase_customizer_settings',
|
| 113 |
+
'error' => false,
|
| 114 |
+
]);
|
| 115 |
+
|
| 116 |
+
if (! $wp_customize) {
|
| 117 |
+
return;
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
$settings = $wp_customize->settings();
|
| 121 |
+
|
| 122 |
+
foreach ($settings as $single_setting) {
|
| 123 |
+
if ('theme_mod' !== $single_setting->type) {
|
| 124 |
+
continue;
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
remove_theme_mod( $single_setting->id );
|
| 128 |
+
}
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
private function reset_widgets_data() {
|
| 132 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 133 |
+
'action' => 'erase_widgets_data',
|
| 134 |
+
'error' => false,
|
| 135 |
+
]);
|
| 136 |
+
|
| 137 |
+
$sidebars_widgets = get_option('sidebars_widgets', array());
|
| 138 |
+
|
| 139 |
+
if (! isset($sidebars_widgets['wp_inactive_widgets'])) {
|
| 140 |
+
$sidebars_widgets['wp_inactive_widgets'] = [];
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
foreach ($sidebars_widgets as $sidebar_id => $widgets) {
|
| 144 |
+
if (! $widgets) continue;
|
| 145 |
+
if ($sidebar_id === 'wp_inactive_widgets') {
|
| 146 |
+
continue;
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
+
if ($sidebar_id === 'array_version') {
|
| 150 |
+
continue;
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
foreach ($widgets as $widget_key => $widget_data) {
|
| 154 |
+
list(
|
| 155 |
+
$name, $option_index, $sidebar_id, $sidebar_index
|
| 156 |
+
) = $this->get_widget_data($widget_data);
|
| 157 |
+
|
| 158 |
+
if ($sidebar_id === 'wp_inactive_widgets') {
|
| 159 |
+
continue;
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
$this->move_sidebar_widget(
|
| 163 |
+
$widget_data,
|
| 164 |
+
$sidebar_id,
|
| 165 |
+
'wp_inactive_widgets',
|
| 166 |
+
$sidebar_index,
|
| 167 |
+
0
|
| 168 |
+
);
|
| 169 |
+
}
|
| 170 |
+
}
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
private function get_widget_data( $widget_id ) {
|
| 174 |
+
$parts = explode('-', $widget_id);
|
| 175 |
+
$option_index = array_pop($parts);
|
| 176 |
+
$name = implode('-', $parts);
|
| 177 |
+
$sidebar_id = false;
|
| 178 |
+
$sidebar_index = false;
|
| 179 |
+
$all_widgets = $this->wp_get_sidebars_widgets();
|
| 180 |
+
|
| 181 |
+
foreach ($all_widgets as $s_id => &$widgets) {
|
| 182 |
+
$key = array_search($widget_id, $widgets, true);
|
| 183 |
+
|
| 184 |
+
if (false !== $key) {
|
| 185 |
+
$sidebar_id = $s_id;
|
| 186 |
+
$sidebar_index = $key;
|
| 187 |
+
break;
|
| 188 |
+
}
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
return [$name, $option_index, $sidebar_id, $sidebar_index];
|
| 192 |
+
}
|
| 193 |
+
|
| 194 |
+
private function move_sidebar_widget(
|
| 195 |
+
$widget_id,
|
| 196 |
+
$current_sidebar_id,
|
| 197 |
+
$new_sidebar_id,
|
| 198 |
+
$current_index, $new_index
|
| 199 |
+
) {
|
| 200 |
+
$all_widgets = $this->wp_get_sidebars_widgets();
|
| 201 |
+
$needs_placement = true;
|
| 202 |
+
|
| 203 |
+
// Existing widget
|
| 204 |
+
if ($current_sidebar_id && !is_null($current_index)) {
|
| 205 |
+
$widgets = $all_widgets[$current_sidebar_id];
|
| 206 |
+
if ($current_sidebar_id !== $new_sidebar_id) {
|
| 207 |
+
unset($widgets[$current_index]);
|
| 208 |
+
} else {
|
| 209 |
+
$part = array_splice($widgets, $current_index, 1);
|
| 210 |
+
array_splice($widgets, $new_index, 0, $part);
|
| 211 |
+
$needs_placement = false;
|
| 212 |
+
}
|
| 213 |
+
|
| 214 |
+
$all_widgets[$current_sidebar_id] = array_values($widgets);
|
| 215 |
+
}
|
| 216 |
+
|
| 217 |
+
if ($needs_placement) {
|
| 218 |
+
$widgets = !empty($all_widgets[$new_sidebar_id]) ? $all_widgets[$new_sidebar_id] : [];
|
| 219 |
+
$before = array_slice($widgets, 0, $new_index, true);
|
| 220 |
+
$after = array_slice($widgets, $new_index, count($widgets), true);
|
| 221 |
+
$widgets = array_merge($before, [$widget_id], $after);
|
| 222 |
+
$all_widgets[$new_sidebar_id] = array_values($widgets);
|
| 223 |
+
}
|
| 224 |
+
|
| 225 |
+
update_option('sidebars_widgets', $all_widgets);
|
| 226 |
+
|
| 227 |
+
$widgets = get_theme_mod('sidebars_widgets');
|
| 228 |
+
|
| 229 |
+
if (! $widgets) {
|
| 230 |
+
$widgets = [];
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
set_theme_mod('sidebars_widgets', array_merge(
|
| 234 |
+
$widgets,
|
| 235 |
+
[
|
| 236 |
+
'time' => time(),
|
| 237 |
+
'data' => $all_widgets
|
| 238 |
+
]
|
| 239 |
+
));
|
| 240 |
+
}
|
| 241 |
+
|
| 242 |
+
private function wp_get_sidebars_widgets() {
|
| 243 |
+
$sidebars_widgets = get_option('sidebars_widgets', []);
|
| 244 |
+
|
| 245 |
+
if (is_array($sidebars_widgets) && isset($sidebars_widgets['array_version'])) {
|
| 246 |
+
unset($sidebars_widgets['array_version']);
|
| 247 |
+
}
|
| 248 |
+
|
| 249 |
+
return $sidebars_widgets;
|
| 250 |
+
}
|
| 251 |
+
|
| 252 |
+
private function reset_menus() {
|
| 253 |
+
return;
|
| 254 |
+
|
| 255 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 256 |
+
'action' => 'erase_menus_data',
|
| 257 |
+
'error' => false,
|
| 258 |
+
]);
|
| 259 |
+
|
| 260 |
+
$menus = get_terms('nav_menu', ['hide_empty' => false]);
|
| 261 |
+
|
| 262 |
+
foreach ($menus as $single_menu) {
|
| 263 |
+
if (! isset($single_menu->term_id)) {
|
| 264 |
+
continue;
|
| 265 |
+
}
|
| 266 |
+
|
| 267 |
+
wp_delete_nav_menu($single_menu->term_id);
|
| 268 |
+
}
|
| 269 |
+
}
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
|
| 273 |
+
|
framework/features/demo-install/install-finish.php
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
namespace Blocksy;
|
| 4 |
+
|
| 5 |
+
class DemoInstallFinalActions {
|
| 6 |
+
public function import() {
|
| 7 |
+
Plugin::instance()->demo->start_streaming();
|
| 8 |
+
|
| 9 |
+
if (! current_user_can('edit_theme_options')) {
|
| 10 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 11 |
+
'action' => 'complete',
|
| 12 |
+
'error' => false,
|
| 13 |
+
]);
|
| 14 |
+
exit;
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
$this->replace_urls();
|
| 18 |
+
|
| 19 |
+
do_action('blocksy:dynamic-css:regenere_css_files');
|
| 20 |
+
Plugin::instance()->cache_manager->run_cache_purge();
|
| 21 |
+
|
| 22 |
+
if (class_exists('WC_REST_System_Status_Tools_V2_Controller')) {
|
| 23 |
+
define('WP_CLI', true);
|
| 24 |
+
|
| 25 |
+
$s = new \WC_REST_System_Status_Tools_V2_Controller();
|
| 26 |
+
|
| 27 |
+
$s->execute_tool('clear_transients');
|
| 28 |
+
if (function_exists('wc_update_product_lookup_tables')) {
|
| 29 |
+
wc_update_product_lookup_tables();
|
| 30 |
+
}
|
| 31 |
+
$s->execute_tool('clear_transients');
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
$this->handle_brizy_posts();
|
| 35 |
+
|
| 36 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 37 |
+
'action' => 'complete',
|
| 38 |
+
'error' => false,
|
| 39 |
+
]);
|
| 40 |
+
exit;
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
/**
|
| 44 |
+
* Replace elementor URLs
|
| 45 |
+
*/
|
| 46 |
+
public function replace_urls() {
|
| 47 |
+
$current_demo = Plugin::instance()->demo->get_current_demo();
|
| 48 |
+
|
| 49 |
+
if (! $current_demo) {
|
| 50 |
+
return;
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
if (! isset($current_demo['demo'])) {
|
| 54 |
+
return;
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
$demo_name = explode(':', $current_demo['demo']);
|
| 58 |
+
|
| 59 |
+
if (! isset($demo_name[1])) {
|
| 60 |
+
$demo_name[1] = '';
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
$demo = $demo_name[0];
|
| 64 |
+
$builder = $demo_name[1];
|
| 65 |
+
|
| 66 |
+
$demo_content = Plugin::instance()->demo->fetch_single_demo([
|
| 67 |
+
'demo' => $demo,
|
| 68 |
+
'builder' => $builder
|
| 69 |
+
]);
|
| 70 |
+
|
| 71 |
+
if (! $demo_content) {
|
| 72 |
+
return;
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
if (! isset($demo_content['url'])) {
|
| 76 |
+
return;
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
$from = $demo_content['url'];
|
| 80 |
+
|
| 81 |
+
$to = get_site_url();
|
| 82 |
+
|
| 83 |
+
$wp_uploads = wp_upload_dir();
|
| 84 |
+
|
| 85 |
+
if (isset($wp_uploads['baseurl'])) {
|
| 86 |
+
$from .= '/wp-content/uploads';
|
| 87 |
+
$to = $wp_uploads['baseurl'];
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
$from = trim($from);
|
| 91 |
+
$to = trim($to);
|
| 92 |
+
|
| 93 |
+
if (
|
| 94 |
+
! filter_var($from, FILTER_VALIDATE_URL)
|
| 95 |
+
||
|
| 96 |
+
! filter_var($to, FILTER_VALIDATE_URL)
|
| 97 |
+
) {
|
| 98 |
+
return;
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
global $wpdb;
|
| 102 |
+
|
| 103 |
+
// @codingStandardsIgnoreStart cannot use `$wpdb->prepare` because it remove's the backslashes
|
| 104 |
+
$wpdb->query(
|
| 105 |
+
"UPDATE {$wpdb->postmeta} " .
|
| 106 |
+
"SET `meta_value` = REPLACE(`meta_value`, '" . str_replace( '/', '\\\/', $from ) . "', '" . str_replace( '/', '\\\/', $to ) . "') " .
|
| 107 |
+
"WHERE `meta_key` = '_elementor_data' AND `meta_value` LIKE '[%' ;"
|
| 108 |
+
); // meta_value LIKE '[%' are json formatted
|
| 109 |
+
// @codingStandardsIgnoreEnd
|
| 110 |
+
|
| 111 |
+
$option_keys = $wpdb->get_results(
|
| 112 |
+
$wpdb->prepare(
|
| 113 |
+
"SELECT option_name from {$wpdb->options} WHERE `option_value` LIKE %s;",
|
| 114 |
+
'%%' . $from . '%%'
|
| 115 |
+
)
|
| 116 |
+
);
|
| 117 |
+
|
| 118 |
+
foreach ($option_keys as $single_key) {
|
| 119 |
+
update_option($single_key->option_name, json_decode(str_replace(
|
| 120 |
+
str_replace('/', '\\/', $from),
|
| 121 |
+
str_replace('/', '\\/', $to),
|
| 122 |
+
json_encode(get_option($single_key->option_name))
|
| 123 |
+
), true));
|
| 124 |
+
}
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
private function handle_brizy_posts() {
|
| 128 |
+
if (! is_callable('Brizy_Editor_Storage_Common::instance')) {
|
| 129 |
+
return;
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
$post_types = \Brizy_Editor_Storage_Common::instance()->get('post-types');
|
| 133 |
+
|
| 134 |
+
if (empty($post_types) && ! is_array($post_types)) {
|
| 135 |
+
return;
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
$post_ids = $this->get_pages($post_types);
|
| 139 |
+
|
| 140 |
+
if (empty($post_ids) && ! is_array($post_ids)) {
|
| 141 |
+
return;
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
foreach ($post_ids as $post_id) {
|
| 145 |
+
$this->import_single_post($post_id);
|
| 146 |
+
}
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
+
public function import_single_post($post_id = 0) {
|
| 150 |
+
$is_brizy_post = get_post_meta($post_id, 'brizy_post_uid', true);
|
| 151 |
+
|
| 152 |
+
if (! $is_brizy_post) {
|
| 153 |
+
return;
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
$post = \Brizy_Editor_Post::get((int) $post_id);
|
| 157 |
+
$editor_data = $post->get_editor_data();
|
| 158 |
+
|
| 159 |
+
$post->set_editor_data( $editor_data );
|
| 160 |
+
$post->set_editor_version(BRIZY_EDITOR_VERSION);
|
| 161 |
+
$post->set_needs_compile(true);
|
| 162 |
+
$post->saveStorage();
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
private function get_pages($post_types = array()) {
|
| 166 |
+
if (! $post_types) {
|
| 167 |
+
return null;
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
$args = array(
|
| 171 |
+
'post_type' => $post_types,
|
| 172 |
+
|
| 173 |
+
// Query performance optimization.
|
| 174 |
+
'fields' => 'ids',
|
| 175 |
+
'no_found_rows' => true,
|
| 176 |
+
'post_status' => 'publish',
|
| 177 |
+
'posts_per_page' => -1,
|
| 178 |
+
);
|
| 179 |
+
|
| 180 |
+
$query = new \WP_Query($args);
|
| 181 |
+
|
| 182 |
+
if (! $query->have_posts()) {
|
| 183 |
+
return null;
|
| 184 |
+
}
|
| 185 |
+
|
| 186 |
+
return $query->posts;
|
| 187 |
+
}
|
| 188 |
+
}
|
| 189 |
+
|
framework/features/demo-install/options-export.php
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
namespace Blocksy;
|
| 4 |
+
|
| 5 |
+
class DemoInstallOptionsExport {
|
| 6 |
+
public function get_exported_options_keys() {
|
| 7 |
+
return [
|
| 8 |
+
'blocksy_ext_mailchimp_credentials',
|
| 9 |
+
'blocksy_active_extensions'
|
| 10 |
+
];
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
private $core_options = array(
|
| 14 |
+
'blogname',
|
| 15 |
+
'blogdescription',
|
| 16 |
+
// 'show_on_front',
|
| 17 |
+
// 'page_on_front',
|
| 18 |
+
// 'page_for_posts',
|
| 19 |
+
);
|
| 20 |
+
|
| 21 |
+
private $page_ids = [
|
| 22 |
+
'woocommerce_shop_page_id',
|
| 23 |
+
'woocommerce_cart_page_id',
|
| 24 |
+
'woocommerce_checkout_page_id',
|
| 25 |
+
'woocommerce_pay_page_id',
|
| 26 |
+
'woocommerce_thanks_page_id',
|
| 27 |
+
'woocommerce_myaccount_page_id',
|
| 28 |
+
'woocommerce_edit_address_page_id',
|
| 29 |
+
'woocommerce_view_order_page_id',
|
| 30 |
+
'woocommerce_change_password_page_id',
|
| 31 |
+
'woocommerce_logout_page_id',
|
| 32 |
+
'woocommerce_lost_password_page_id',
|
| 33 |
+
'page_on_front',
|
| 34 |
+
'page_for_posts'
|
| 35 |
+
];
|
| 36 |
+
|
| 37 |
+
public function export() {
|
| 38 |
+
$theme = get_stylesheet();
|
| 39 |
+
$template = get_template();
|
| 40 |
+
$charset = get_option( 'blog_charset' );
|
| 41 |
+
$mods = get_theme_mods();
|
| 42 |
+
|
| 43 |
+
$data = [
|
| 44 |
+
'template' => $template,
|
| 45 |
+
'mods' => $mods ? $mods : [],
|
| 46 |
+
'options' => []
|
| 47 |
+
];
|
| 48 |
+
|
| 49 |
+
global $wp_customize;
|
| 50 |
+
|
| 51 |
+
// Get options from the Customizer API.
|
| 52 |
+
$settings = $wp_customize->settings();
|
| 53 |
+
|
| 54 |
+
foreach ($settings as $key => $setting) {
|
| 55 |
+
if ('option' == $setting->type) {
|
| 56 |
+
if ('widget_' === substr(strtolower($key), 0, 7)) {
|
| 57 |
+
continue;
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
if ('sidebars_' === substr(strtolower($key), 0, 9)) {
|
| 61 |
+
continue;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
if (in_array($key, $this->core_options)) {
|
| 65 |
+
continue;
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
$data['options'][$key] = $setting->value();
|
| 69 |
+
}
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
$option_keys = $this->get_exported_options_keys();
|
| 73 |
+
|
| 74 |
+
foreach ($option_keys as $option_key) {
|
| 75 |
+
$data['options'][$option_key] = get_option($option_key);
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
if (function_exists('wp_get_custom_css_post')) {
|
| 79 |
+
$data['wp_css'] = wp_get_custom_css();
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
return $data;
|
| 83 |
+
|
| 84 |
+
return serialize($data);
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
public function export_pages_ids_options() {
|
| 88 |
+
$result = [];
|
| 89 |
+
|
| 90 |
+
foreach ($this->page_ids as $single_page_id) {
|
| 91 |
+
$id = get_option($single_page_id, null);
|
| 92 |
+
|
| 93 |
+
$title = false;
|
| 94 |
+
|
| 95 |
+
if ($id) {
|
| 96 |
+
$title = get_the_title($id);
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
$result[$single_page_id] = $title;
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
return $result;
|
| 103 |
+
}
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
|
framework/features/demo-install/options-import.php
ADDED
|
@@ -0,0 +1,319 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
namespace Blocksy;
|
| 4 |
+
|
| 5 |
+
class DemoInstallOptionsInstaller {
|
| 6 |
+
protected $has_streaming = true;
|
| 7 |
+
protected $demo_name = null;
|
| 8 |
+
|
| 9 |
+
public function __construct($args = []) {
|
| 10 |
+
$args = wp_parse_args($args, [
|
| 11 |
+
'has_streaming' => true,
|
| 12 |
+
'demo_name' => null
|
| 13 |
+
]);
|
| 14 |
+
|
| 15 |
+
if (
|
| 16 |
+
!$args['demo_name']
|
| 17 |
+
&&
|
| 18 |
+
isset($_REQUEST['demo_name'])
|
| 19 |
+
&&
|
| 20 |
+
$_REQUEST['demo_name']
|
| 21 |
+
) {
|
| 22 |
+
$args['demo_name'] = $_REQUEST['demo_name'];
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
$this->has_streaming = $args['has_streaming'];
|
| 26 |
+
$this->demo_name = $args['demo_name'];
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
public function import() {
|
| 30 |
+
if ($this->has_streaming) {
|
| 31 |
+
Plugin::instance()->demo->start_streaming();
|
| 32 |
+
|
| 33 |
+
if (! current_user_can('edit_theme_options')) {
|
| 34 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 35 |
+
'action' => 'complete',
|
| 36 |
+
'error' => 'No permission.',
|
| 37 |
+
]);
|
| 38 |
+
|
| 39 |
+
exit;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
if (! $this->demo_name) {
|
| 43 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 44 |
+
'action' => 'complete',
|
| 45 |
+
'error' => 'No demo name passed.',
|
| 46 |
+
]);
|
| 47 |
+
exit;
|
| 48 |
+
}
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
$demo_name = explode(':', $this->demo_name);
|
| 52 |
+
|
| 53 |
+
if (! isset($demo_name[1])) {
|
| 54 |
+
$demo_name[1] = '';
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
$demo = $demo_name[0];
|
| 58 |
+
$builder = $demo_name[1];
|
| 59 |
+
|
| 60 |
+
if ($this->has_streaming) {
|
| 61 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 62 |
+
'action' => 'download_demo_options',
|
| 63 |
+
'error' => false,
|
| 64 |
+
]);
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
$demo_content = Plugin::instance()->demo->fetch_single_demo([
|
| 68 |
+
'demo' => $demo,
|
| 69 |
+
'builder' => $builder,
|
| 70 |
+
'field' => 'options'
|
| 71 |
+
]);
|
| 72 |
+
|
| 73 |
+
if (! isset($demo_content['options']) && $this->has_streaming) {
|
| 74 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 75 |
+
'action' => 'complete',
|
| 76 |
+
'error' => __('Downloaded demo is corrupted.'),
|
| 77 |
+
]);
|
| 78 |
+
|
| 79 |
+
exit;
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
if ($this->has_streaming) {
|
| 83 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 84 |
+
'action' => 'import_mods_images',
|
| 85 |
+
'error' => false,
|
| 86 |
+
]);
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
$options = $demo_content['options'];
|
| 90 |
+
$options['mods'] = $this->import_images(
|
| 91 |
+
$demo_content,
|
| 92 |
+
$options['mods']
|
| 93 |
+
);
|
| 94 |
+
|
| 95 |
+
if ($this->has_streaming) {
|
| 96 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 97 |
+
'action' => 'import_customizer_options',
|
| 98 |
+
'error' => false,
|
| 99 |
+
]);
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
global $wp_customize;
|
| 103 |
+
|
| 104 |
+
do_action('customize_save', $wp_customize);
|
| 105 |
+
|
| 106 |
+
foreach ($options['mods'] as $key => $val) {
|
| 107 |
+
if ($key === 'nav_menu_locations') continue;
|
| 108 |
+
if ($key === 'sidebars_widgets') continue;
|
| 109 |
+
|
| 110 |
+
do_action('customize_save_' . $key, $wp_customize);
|
| 111 |
+
set_theme_mod($key, $val);
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
do_action('customize_save_after', $wp_customize);
|
| 115 |
+
|
| 116 |
+
foreach ($options['options'] as $key => $val) {
|
| 117 |
+
if ($key === 'blocksy_active_extensions') {
|
| 118 |
+
if ($val && is_array($val)) {
|
| 119 |
+
if ($this->has_streaming) {
|
| 120 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 121 |
+
'action' => 'activate_required_extensions',
|
| 122 |
+
'error' => false,
|
| 123 |
+
]);
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
foreach ($val as $single_extension) {
|
| 127 |
+
Plugin::instance()->extensions->activate_extension(
|
| 128 |
+
$single_extension
|
| 129 |
+
);
|
| 130 |
+
}
|
| 131 |
+
}
|
| 132 |
+
} else {
|
| 133 |
+
if (
|
| 134 |
+
strpos($key, 'woocommerce') !== false
|
| 135 |
+
&&
|
| 136 |
+
$key !== 'woocommerce_thumbnail_cropping'
|
| 137 |
+
) {
|
| 138 |
+
if (empty(get_option($key))) {
|
| 139 |
+
update_option($key, $val);
|
| 140 |
+
} else {
|
| 141 |
+
add_option($key, $val);
|
| 142 |
+
}
|
| 143 |
+
} else {
|
| 144 |
+
update_option($key, $val);
|
| 145 |
+
}
|
| 146 |
+
}
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
+
/*
|
| 150 |
+
$all = get_option('sidebars_widgets');
|
| 151 |
+
$all['sidebar-1'] = [];
|
| 152 |
+
update_option('sidebars_widgets', $all);
|
| 153 |
+
|
| 154 |
+
$all = get_theme_mod('sidebars_widgets');
|
| 155 |
+
|
| 156 |
+
if ($all) {
|
| 157 |
+
$all['data']['sidebar-1'] = [];
|
| 158 |
+
set_theme_mod('sidebars_widgets', $all);
|
| 159 |
+
}
|
| 160 |
+
*/
|
| 161 |
+
|
| 162 |
+
if (
|
| 163 |
+
function_exists('wp_update_custom_css_post')
|
| 164 |
+
&&
|
| 165 |
+
isset($options['wp_css'])
|
| 166 |
+
&&
|
| 167 |
+
$options['wp_css']
|
| 168 |
+
) {
|
| 169 |
+
wp_update_custom_css_post($options['wp_css']);
|
| 170 |
+
}
|
| 171 |
+
|
| 172 |
+
if ($this->has_streaming) {
|
| 173 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 174 |
+
'action' => 'complete',
|
| 175 |
+
'error' => false,
|
| 176 |
+
]);
|
| 177 |
+
|
| 178 |
+
exit;
|
| 179 |
+
}
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
private function import_images($demo_content, $mods) {
|
| 183 |
+
foreach ( $mods as $key => $val ) {
|
| 184 |
+
if ($this->is_image_url($val)) {
|
| 185 |
+
$data = $this->sideload_image($val);
|
| 186 |
+
|
| 187 |
+
if (! is_wp_error($data)) {
|
| 188 |
+
$mods[$key] = $data->url;
|
| 189 |
+
|
| 190 |
+
// Handle header image controls.
|
| 191 |
+
if (isset($mods[$key . '_data'])) {
|
| 192 |
+
$mods[$key . '_data'] = $data;
|
| 193 |
+
|
| 194 |
+
update_post_meta(
|
| 195 |
+
$data->attachment_id,
|
| 196 |
+
'_wp_attachment_is_custom_header',
|
| 197 |
+
get_stylesheet()
|
| 198 |
+
);
|
| 199 |
+
}
|
| 200 |
+
}
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
if ($key === 'custom_logo' && $val) {
|
| 204 |
+
$maybe_url = $this->sideload_image_for_url(
|
| 205 |
+
$demo_content['url'],
|
| 206 |
+
$val
|
| 207 |
+
);
|
| 208 |
+
|
| 209 |
+
if ($maybe_url) {
|
| 210 |
+
$data = $this->sideload_image($maybe_url);
|
| 211 |
+
$mods[$key] = $data->attachment_id;
|
| 212 |
+
}
|
| 213 |
+
}
|
| 214 |
+
|
| 215 |
+
if (
|
| 216 |
+
is_array($val)
|
| 217 |
+
&&
|
| 218 |
+
isset($val['attachment_id'])
|
| 219 |
+
&&
|
| 220 |
+
$val['attachment_id']
|
| 221 |
+
) {
|
| 222 |
+
$maybe_url = $this->sideload_image_for_url(
|
| 223 |
+
$demo_content['url'],
|
| 224 |
+
$val['attachment_id']
|
| 225 |
+
);
|
| 226 |
+
|
| 227 |
+
if ($maybe_url) {
|
| 228 |
+
$data = $this->sideload_image($maybe_url);
|
| 229 |
+
$mods[$key]['attachment_id'] = $data->attachment_id;
|
| 230 |
+
}
|
| 231 |
+
}
|
| 232 |
+
}
|
| 233 |
+
|
| 234 |
+
return $mods;
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
public function sideload_image_for_url($url, $id) {
|
| 238 |
+
$url = rtrim($url,"/") . '/wp-json/wp/v2/media/' . $id;
|
| 239 |
+
|
| 240 |
+
$request = wp_remote_get($url);
|
| 241 |
+
|
| 242 |
+
if (is_wp_error($request)) {
|
| 243 |
+
return false;
|
| 244 |
+
}
|
| 245 |
+
|
| 246 |
+
$body = wp_remote_retrieve_body($request);
|
| 247 |
+
|
| 248 |
+
$body = json_decode($body, true);
|
| 249 |
+
|
| 250 |
+
if (! $body) {
|
| 251 |
+
return false;
|
| 252 |
+
}
|
| 253 |
+
|
| 254 |
+
if (! isset($body['source_url'])) {
|
| 255 |
+
return false;
|
| 256 |
+
}
|
| 257 |
+
|
| 258 |
+
return $body['source_url'];
|
| 259 |
+
}
|
| 260 |
+
|
| 261 |
+
private function sideload_image($file) {
|
| 262 |
+
$data = new \stdClass();
|
| 263 |
+
|
| 264 |
+
if (! function_exists('media_handle_sideload')) {
|
| 265 |
+
require_once( ABSPATH . 'wp-admin/includes/media.php' );
|
| 266 |
+
require_once( ABSPATH . 'wp-admin/includes/file.php' );
|
| 267 |
+
require_once( ABSPATH . 'wp-admin/includes/image.php' );
|
| 268 |
+
}
|
| 269 |
+
|
| 270 |
+
if (empty($file)) {
|
| 271 |
+
return $data;
|
| 272 |
+
}
|
| 273 |
+
|
| 274 |
+
// Set variables for storage, fix file filename for query strings.
|
| 275 |
+
preg_match('/[^\?]+\.(jpe?g|jpe|gif|png)\b/i', $file, $matches);
|
| 276 |
+
|
| 277 |
+
$file_array = [];
|
| 278 |
+
$file_array['name'] = basename($matches[0]);
|
| 279 |
+
|
| 280 |
+
// Download file to temp location.
|
| 281 |
+
$file_array['tmp_name'] = download_url($file);
|
| 282 |
+
|
| 283 |
+
// If error storing temporarily, return the error.
|
| 284 |
+
if (is_wp_error($file_array['tmp_name'])) {
|
| 285 |
+
return $file_array['tmp_name'];
|
| 286 |
+
}
|
| 287 |
+
|
| 288 |
+
// Do the validation and storage stuff.
|
| 289 |
+
$id = media_handle_sideload($file_array, 0);
|
| 290 |
+
|
| 291 |
+
// If error storing permanently, unlink.
|
| 292 |
+
if (is_wp_error($id)) {
|
| 293 |
+
@unlink($file_array['tmp_name']);
|
| 294 |
+
return $id;
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
// Build the object to return.
|
| 298 |
+
$meta = wp_get_attachment_metadata($id);
|
| 299 |
+
$data->attachment_id = $id;
|
| 300 |
+
$data->url = wp_get_attachment_url($id);
|
| 301 |
+
$data->thumbnail_url = wp_get_attachment_thumb_url($id);
|
| 302 |
+
$data->height = $meta['height'];
|
| 303 |
+
$data->width = $meta['width'];
|
| 304 |
+
|
| 305 |
+
return $data;
|
| 306 |
+
}
|
| 307 |
+
|
| 308 |
+
private function is_image_url($string = '') {
|
| 309 |
+
if (is_string($string)) {
|
| 310 |
+
if (preg_match('/\.(jpg|jpeg|png|gif)/i', $string)) {
|
| 311 |
+
return true;
|
| 312 |
+
}
|
| 313 |
+
}
|
| 314 |
+
|
| 315 |
+
return false;
|
| 316 |
+
}
|
| 317 |
+
}
|
| 318 |
+
|
| 319 |
+
|
framework/features/demo-install/parsers.php
ADDED
|
@@ -0,0 +1,701 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* WordPress eXtended RSS file parser implementations
|
| 5 |
+
*
|
| 6 |
+
* @package WordPress
|
| 7 |
+
* @subpackage Importer
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
/**
|
| 11 |
+
* WordPress Importer class for managing parsing of WXR files.
|
| 12 |
+
*/
|
| 13 |
+
class WXR_Parser {
|
| 14 |
+
function parse( $file ) {
|
| 15 |
+
// Attempt to use proper XML parsers first
|
| 16 |
+
if ( extension_loaded( 'simplexml' ) ) {
|
| 17 |
+
$parser = new WXR_Parser_SimpleXML;
|
| 18 |
+
$result = $parser->parse( $file );
|
| 19 |
+
|
| 20 |
+
// If SimpleXML succeeds or this is an invalid WXR file then return the results
|
| 21 |
+
if ( ! is_wp_error( $result ) || 'SimpleXML_parse_error' != $result->get_error_code() )
|
| 22 |
+
return $result;
|
| 23 |
+
} else if ( extension_loaded( 'xml' ) ) {
|
| 24 |
+
$parser = new WXR_Parser_XML;
|
| 25 |
+
$result = $parser->parse( $file );
|
| 26 |
+
|
| 27 |
+
// If XMLParser succeeds or this is an invalid WXR file then return the results
|
| 28 |
+
if ( ! is_wp_error( $result ) || 'XML_parse_error' != $result->get_error_code() )
|
| 29 |
+
return $result;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
// We have a malformed XML file, so display the error and fallthrough to regex
|
| 33 |
+
if ( isset($result) && defined('IMPORT_DEBUG') && IMPORT_DEBUG ) {
|
| 34 |
+
echo '<pre>';
|
| 35 |
+
if ( 'SimpleXML_parse_error' == $result->get_error_code() ) {
|
| 36 |
+
foreach ( $result->get_error_data() as $error )
|
| 37 |
+
echo $error->line . ':' . $error->column . ' ' . esc_html( $error->message ) . "\n";
|
| 38 |
+
} else if ( 'XML_parse_error' == $result->get_error_code() ) {
|
| 39 |
+
$error = $result->get_error_data();
|
| 40 |
+
echo $error[0] . ':' . $error[1] . ' ' . esc_html( $error[2] );
|
| 41 |
+
}
|
| 42 |
+
echo '</pre>';
|
| 43 |
+
echo '<p><strong>' . __( 'There was an error when reading this WXR file', 'wordpress-importer' ) . '</strong><br />';
|
| 44 |
+
echo __( 'Details are shown above. The importer will now try again with a different parser...', 'wordpress-importer' ) . '</p>';
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
// use regular expressions if nothing else available or this is bad XML
|
| 48 |
+
$parser = new WXR_Parser_Regex;
|
| 49 |
+
return $parser->parse( $file );
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
/**
|
| 54 |
+
* WXR Parser that makes use of the SimpleXML PHP extension.
|
| 55 |
+
*/
|
| 56 |
+
class WXR_Parser_SimpleXML {
|
| 57 |
+
function parse( $file ) {
|
| 58 |
+
$authors = $posts = $categories = $tags = $terms = array();
|
| 59 |
+
|
| 60 |
+
$internal_errors = libxml_use_internal_errors(true);
|
| 61 |
+
|
| 62 |
+
$dom = new DOMDocument;
|
| 63 |
+
$old_value = null;
|
| 64 |
+
if ( function_exists( 'libxml_disable_entity_loader' ) ) {
|
| 65 |
+
$old_value = libxml_disable_entity_loader( true );
|
| 66 |
+
}
|
| 67 |
+
$success = $dom->loadXML(blc_load_xml_file($file));
|
| 68 |
+
|
| 69 |
+
if (! is_null($old_value)) {
|
| 70 |
+
libxml_disable_entity_loader( $old_value );
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
if ( ! $success || isset( $dom->doctype ) ) {
|
| 74 |
+
return new WP_Error( 'SimpleXML_parse_error', __( 'There was an error when reading this WXR file', 'wordpress-importer' ), libxml_get_errors() );
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
$xml = simplexml_import_dom( $dom );
|
| 78 |
+
unset( $dom );
|
| 79 |
+
|
| 80 |
+
// halt if loading produces an error
|
| 81 |
+
if ( ! $xml )
|
| 82 |
+
return new WP_Error( 'SimpleXML_parse_error', __( 'There was an error when reading this WXR file', 'wordpress-importer' ), libxml_get_errors() );
|
| 83 |
+
|
| 84 |
+
$wxr_version = $xml->xpath('/rss/channel/wp:wxr_version');
|
| 85 |
+
if ( ! $wxr_version )
|
| 86 |
+
return new WP_Error( 'WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) );
|
| 87 |
+
|
| 88 |
+
$wxr_version = (string) trim( $wxr_version[0] );
|
| 89 |
+
// confirm that we are dealing with the correct file format
|
| 90 |
+
if ( ! preg_match( '/^\d+\.\d+$/', $wxr_version ) )
|
| 91 |
+
return new WP_Error( 'WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) );
|
| 92 |
+
|
| 93 |
+
$base_url = $xml->xpath('/rss/channel/wp:base_site_url');
|
| 94 |
+
$base_url = (string) trim( $base_url[0] );
|
| 95 |
+
|
| 96 |
+
$namespaces = $xml->getDocNamespaces();
|
| 97 |
+
if ( ! isset( $namespaces['wp'] ) )
|
| 98 |
+
$namespaces['wp'] = 'http://wordpress.org/export/1.1/';
|
| 99 |
+
if ( ! isset( $namespaces['excerpt'] ) )
|
| 100 |
+
$namespaces['excerpt'] = 'http://wordpress.org/export/1.1/excerpt/';
|
| 101 |
+
|
| 102 |
+
// grab authors
|
| 103 |
+
foreach ( $xml->xpath('/rss/channel/wp:author') as $author_arr ) {
|
| 104 |
+
$a = $author_arr->children( $namespaces['wp'] );
|
| 105 |
+
$login = (string) $a->author_login;
|
| 106 |
+
$authors[$login] = array(
|
| 107 |
+
'author_id' => (int) $a->author_id,
|
| 108 |
+
'author_login' => $login,
|
| 109 |
+
'author_email' => (string) $a->author_email,
|
| 110 |
+
'author_display_name' => (string) $a->author_display_name,
|
| 111 |
+
'author_first_name' => (string) $a->author_first_name,
|
| 112 |
+
'author_last_name' => (string) $a->author_last_name
|
| 113 |
+
);
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
// grab cats, tags and terms
|
| 117 |
+
foreach ( $xml->xpath('/rss/channel/wp:category') as $term_arr ) {
|
| 118 |
+
$t = $term_arr->children( $namespaces['wp'] );
|
| 119 |
+
$category = array(
|
| 120 |
+
'term_id' => (int) $t->term_id,
|
| 121 |
+
'category_nicename' => (string) $t->category_nicename,
|
| 122 |
+
'category_parent' => (string) $t->category_parent,
|
| 123 |
+
'cat_name' => (string) $t->cat_name,
|
| 124 |
+
'category_description' => (string) $t->category_description
|
| 125 |
+
);
|
| 126 |
+
|
| 127 |
+
foreach ( $t->termmeta as $meta ) {
|
| 128 |
+
$category['termmeta'][] = array(
|
| 129 |
+
'key' => (string) $meta->meta_key,
|
| 130 |
+
'value' => (string) $meta->meta_value
|
| 131 |
+
);
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
+
$categories[] = $category;
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
foreach ( $xml->xpath('/rss/channel/wp:tag') as $term_arr ) {
|
| 138 |
+
$t = $term_arr->children( $namespaces['wp'] );
|
| 139 |
+
$tag = array(
|
| 140 |
+
'term_id' => (int) $t->term_id,
|
| 141 |
+
'tag_slug' => (string) $t->tag_slug,
|
| 142 |
+
'tag_name' => (string) $t->tag_name,
|
| 143 |
+
'tag_description' => (string) $t->tag_description
|
| 144 |
+
);
|
| 145 |
+
|
| 146 |
+
foreach ( $t->termmeta as $meta ) {
|
| 147 |
+
$tag['termmeta'][] = array(
|
| 148 |
+
'key' => (string) $meta->meta_key,
|
| 149 |
+
'value' => (string) $meta->meta_value
|
| 150 |
+
);
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
$tags[] = $tag;
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
foreach ( $xml->xpath('/rss/channel/wp:term') as $term_arr ) {
|
| 157 |
+
$t = $term_arr->children( $namespaces['wp'] );
|
| 158 |
+
$term = array(
|
| 159 |
+
'term_id' => (int) $t->term_id,
|
| 160 |
+
'term_taxonomy' => (string) $t->term_taxonomy,
|
| 161 |
+
'slug' => (string) $t->term_slug,
|
| 162 |
+
'term_parent' => (string) $t->term_parent,
|
| 163 |
+
'term_name' => (string) $t->term_name,
|
| 164 |
+
'term_description' => (string) $t->term_description
|
| 165 |
+
);
|
| 166 |
+
|
| 167 |
+
foreach ( $t->termmeta as $meta ) {
|
| 168 |
+
$term['termmeta'][] = array(
|
| 169 |
+
'key' => (string) $meta->meta_key,
|
| 170 |
+
'value' => (string) $meta->meta_value
|
| 171 |
+
);
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
$terms[] = $term;
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
// grab posts
|
| 178 |
+
foreach ( $xml->channel->item as $item ) {
|
| 179 |
+
$post = array(
|
| 180 |
+
'post_title' => (string) $item->title,
|
| 181 |
+
'guid' => (string) $item->guid,
|
| 182 |
+
);
|
| 183 |
+
|
| 184 |
+
$dc = $item->children( 'http://purl.org/dc/elements/1.1/' );
|
| 185 |
+
$post['post_author'] = (string) $dc->creator;
|
| 186 |
+
|
| 187 |
+
$content = $item->children( 'http://purl.org/rss/1.0/modules/content/' );
|
| 188 |
+
$excerpt = $item->children( $namespaces['excerpt'] );
|
| 189 |
+
$post['post_content'] = (string) $content->encoded;
|
| 190 |
+
$post['post_excerpt'] = (string) $excerpt->encoded;
|
| 191 |
+
|
| 192 |
+
$wp = $item->children( $namespaces['wp'] );
|
| 193 |
+
$post['post_id'] = (int) $wp->post_id;
|
| 194 |
+
$post['post_date'] = (string) $wp->post_date;
|
| 195 |
+
$post['post_date_gmt'] = (string) $wp->post_date_gmt;
|
| 196 |
+
$post['comment_status'] = (string) $wp->comment_status;
|
| 197 |
+
$post['ping_status'] = (string) $wp->ping_status;
|
| 198 |
+
$post['post_name'] = (string) $wp->post_name;
|
| 199 |
+
$post['status'] = (string) $wp->status;
|
| 200 |
+
$post['post_parent'] = (int) $wp->post_parent;
|
| 201 |
+
$post['menu_order'] = (int) $wp->menu_order;
|
| 202 |
+
$post['post_type'] = (string) $wp->post_type;
|
| 203 |
+
$post['post_password'] = (string) $wp->post_password;
|
| 204 |
+
$post['is_sticky'] = (int) $wp->is_sticky;
|
| 205 |
+
|
| 206 |
+
if ( isset($wp->attachment_url) )
|
| 207 |
+
$post['attachment_url'] = (string) $wp->attachment_url;
|
| 208 |
+
|
| 209 |
+
foreach ( $item->category as $c ) {
|
| 210 |
+
$att = $c->attributes();
|
| 211 |
+
if ( isset( $att['nicename'] ) )
|
| 212 |
+
$post['terms'][] = array(
|
| 213 |
+
'name' => (string) $c,
|
| 214 |
+
'slug' => (string) $att['nicename'],
|
| 215 |
+
'domain' => (string) $att['domain']
|
| 216 |
+
);
|
| 217 |
+
}
|
| 218 |
+
|
| 219 |
+
foreach ( $wp->postmeta as $meta ) {
|
| 220 |
+
$post['postmeta'][] = array(
|
| 221 |
+
'key' => (string) $meta->meta_key,
|
| 222 |
+
'value' => (string) $meta->meta_value
|
| 223 |
+
);
|
| 224 |
+
}
|
| 225 |
+
|
| 226 |
+
foreach ( $wp->comment as $comment ) {
|
| 227 |
+
$meta = array();
|
| 228 |
+
if ( isset( $comment->commentmeta ) ) {
|
| 229 |
+
foreach ( $comment->commentmeta as $m ) {
|
| 230 |
+
$meta[] = array(
|
| 231 |
+
'key' => (string) $m->meta_key,
|
| 232 |
+
'value' => (string) $m->meta_value
|
| 233 |
+
);
|
| 234 |
+
}
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
$post['comments'][] = array(
|
| 238 |
+
'comment_id' => (int) $comment->comment_id,
|
| 239 |
+
'comment_author' => (string) $comment->comment_author,
|
| 240 |
+
'comment_author_email' => (string) $comment->comment_author_email,
|
| 241 |
+
'comment_author_IP' => (string) $comment->comment_author_IP,
|
| 242 |
+
'comment_author_url' => (string) $comment->comment_author_url,
|
| 243 |
+
'comment_date' => (string) $comment->comment_date,
|
| 244 |
+
'comment_date_gmt' => (string) $comment->comment_date_gmt,
|
| 245 |
+
'comment_content' => (string) $comment->comment_content,
|
| 246 |
+
'comment_approved' => (string) $comment->comment_approved,
|
| 247 |
+
'comment_type' => (string) $comment->comment_type,
|
| 248 |
+
'comment_parent' => (string) $comment->comment_parent,
|
| 249 |
+
'comment_user_id' => (int) $comment->comment_user_id,
|
| 250 |
+
'commentmeta' => $meta,
|
| 251 |
+
);
|
| 252 |
+
}
|
| 253 |
+
|
| 254 |
+
$posts[] = $post;
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
return array(
|
| 258 |
+
'authors' => $authors,
|
| 259 |
+
'posts' => $posts,
|
| 260 |
+
'categories' => $categories,
|
| 261 |
+
'tags' => $tags,
|
| 262 |
+
'terms' => $terms,
|
| 263 |
+
'base_url' => $base_url,
|
| 264 |
+
'version' => $wxr_version
|
| 265 |
+
);
|
| 266 |
+
}
|
| 267 |
+
}
|
| 268 |
+
|
| 269 |
+
/**
|
| 270 |
+
* WXR Parser that makes use of the XML Parser PHP extension.
|
| 271 |
+
*/
|
| 272 |
+
class WXR_Parser_XML {
|
| 273 |
+
var $wp_tags = array(
|
| 274 |
+
'wp:post_id', 'wp:post_date', 'wp:post_date_gmt', 'wp:comment_status', 'wp:ping_status', 'wp:attachment_url',
|
| 275 |
+
'wp:status', 'wp:post_name', 'wp:post_parent', 'wp:menu_order', 'wp:post_type', 'wp:post_password',
|
| 276 |
+
'wp:is_sticky', 'wp:term_id', 'wp:category_nicename', 'wp:category_parent', 'wp:cat_name', 'wp:category_description',
|
| 277 |
+
'wp:tag_slug', 'wp:tag_name', 'wp:tag_description', 'wp:term_taxonomy', 'wp:term_parent',
|
| 278 |
+
'wp:term_name', 'wp:term_description', 'wp:author_id', 'wp:author_login', 'wp:author_email', 'wp:author_display_name',
|
| 279 |
+
'wp:author_first_name', 'wp:author_last_name',
|
| 280 |
+
);
|
| 281 |
+
var $wp_sub_tags = array(
|
| 282 |
+
'wp:comment_id', 'wp:comment_author', 'wp:comment_author_email', 'wp:comment_author_url',
|
| 283 |
+
'wp:comment_author_IP', 'wp:comment_date', 'wp:comment_date_gmt', 'wp:comment_content',
|
| 284 |
+
'wp:comment_approved', 'wp:comment_type', 'wp:comment_parent', 'wp:comment_user_id',
|
| 285 |
+
);
|
| 286 |
+
|
| 287 |
+
function parse( $file ) {
|
| 288 |
+
$this->wxr_version = $this->in_post = $this->cdata = $this->data = $this->sub_data = $this->in_tag = $this->in_sub_tag = false;
|
| 289 |
+
$this->authors = $this->posts = $this->term = $this->category = $this->tag = array();
|
| 290 |
+
|
| 291 |
+
$xml = xml_parser_create( 'UTF-8' );
|
| 292 |
+
xml_parser_set_option( $xml, XML_OPTION_SKIP_WHITE, 1 );
|
| 293 |
+
xml_parser_set_option( $xml, XML_OPTION_CASE_FOLDING, 0 );
|
| 294 |
+
xml_set_object( $xml, $this );
|
| 295 |
+
xml_set_character_data_handler( $xml, 'cdata' );
|
| 296 |
+
xml_set_element_handler( $xml, 'tag_open', 'tag_close' );
|
| 297 |
+
|
| 298 |
+
if ( ! xml_parse( $xml, blc_load_xml_file($file), true ) ) {
|
| 299 |
+
$current_line = xml_get_current_line_number( $xml );
|
| 300 |
+
$current_column = xml_get_current_column_number( $xml );
|
| 301 |
+
$error_code = xml_get_error_code( $xml );
|
| 302 |
+
$error_string = xml_error_string( $error_code );
|
| 303 |
+
return new WP_Error( 'XML_parse_error', 'There was an error when reading this WXR file', array( $current_line, $current_column, $error_string ) );
|
| 304 |
+
}
|
| 305 |
+
xml_parser_free( $xml );
|
| 306 |
+
|
| 307 |
+
if ( ! preg_match( '/^\d+\.\d+$/', $this->wxr_version ) )
|
| 308 |
+
return new WP_Error( 'WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) );
|
| 309 |
+
|
| 310 |
+
return array(
|
| 311 |
+
'authors' => $this->authors,
|
| 312 |
+
'posts' => $this->posts,
|
| 313 |
+
'categories' => $this->category,
|
| 314 |
+
'tags' => $this->tag,
|
| 315 |
+
'terms' => $this->term,
|
| 316 |
+
'base_url' => $this->base_url,
|
| 317 |
+
'version' => $this->wxr_version
|
| 318 |
+
);
|
| 319 |
+
}
|
| 320 |
+
|
| 321 |
+
function tag_open( $parse, $tag, $attr ) {
|
| 322 |
+
if ( in_array( $tag, $this->wp_tags ) ) {
|
| 323 |
+
$this->in_tag = substr( $tag, 3 );
|
| 324 |
+
return;
|
| 325 |
+
}
|
| 326 |
+
|
| 327 |
+
if ( in_array( $tag, $this->wp_sub_tags ) ) {
|
| 328 |
+
$this->in_sub_tag = substr( $tag, 3 );
|
| 329 |
+
return;
|
| 330 |
+
}
|
| 331 |
+
|
| 332 |
+
switch ( $tag ) {
|
| 333 |
+
case 'category':
|
| 334 |
+
if ( isset($attr['domain'], $attr['nicename']) ) {
|
| 335 |
+
$this->sub_data['domain'] = $attr['domain'];
|
| 336 |
+
$this->sub_data['slug'] = $attr['nicename'];
|
| 337 |
+
}
|
| 338 |
+
break;
|
| 339 |
+
case 'item': $this->in_post = true;
|
| 340 |
+
case 'title': if ( $this->in_post ) $this->in_tag = 'post_title'; break;
|
| 341 |
+
case 'guid': $this->in_tag = 'guid'; break;
|
| 342 |
+
case 'dc:creator': $this->in_tag = 'post_author'; break;
|
| 343 |
+
case 'content:encoded': $this->in_tag = 'post_content'; break;
|
| 344 |
+
case 'excerpt:encoded': $this->in_tag = 'post_excerpt'; break;
|
| 345 |
+
|
| 346 |
+
case 'wp:term_slug': $this->in_tag = 'slug'; break;
|
| 347 |
+
case 'wp:meta_key': $this->in_sub_tag = 'key'; break;
|
| 348 |
+
case 'wp:meta_value': $this->in_sub_tag = 'value'; break;
|
| 349 |
+
}
|
| 350 |
+
}
|
| 351 |
+
|
| 352 |
+
function cdata( $parser, $cdata ) {
|
| 353 |
+
if ( ! trim( $cdata ) )
|
| 354 |
+
return;
|
| 355 |
+
|
| 356 |
+
if ( false !== $this->in_tag || false !== $this->in_sub_tag ) {
|
| 357 |
+
$this->cdata .= $cdata;
|
| 358 |
+
} else {
|
| 359 |
+
$this->cdata .= trim( $cdata );
|
| 360 |
+
}
|
| 361 |
+
}
|
| 362 |
+
|
| 363 |
+
function tag_close( $parser, $tag ) {
|
| 364 |
+
switch ( $tag ) {
|
| 365 |
+
case 'wp:comment':
|
| 366 |
+
unset( $this->sub_data['key'], $this->sub_data['value'] ); // remove meta sub_data
|
| 367 |
+
if ( ! empty( $this->sub_data ) )
|
| 368 |
+
$this->data['comments'][] = $this->sub_data;
|
| 369 |
+
$this->sub_data = false;
|
| 370 |
+
break;
|
| 371 |
+
case 'wp:commentmeta':
|
| 372 |
+
$this->sub_data['commentmeta'][] = array(
|
| 373 |
+
'key' => $this->sub_data['key'],
|
| 374 |
+
'value' => $this->sub_data['value']
|
| 375 |
+
);
|
| 376 |
+
break;
|
| 377 |
+
case 'category':
|
| 378 |
+
if ( ! empty( $this->sub_data ) ) {
|
| 379 |
+
$this->sub_data['name'] = $this->cdata;
|
| 380 |
+
$this->data['terms'][] = $this->sub_data;
|
| 381 |
+
}
|
| 382 |
+
$this->sub_data = false;
|
| 383 |
+
break;
|
| 384 |
+
case 'wp:postmeta':
|
| 385 |
+
if ( ! empty( $this->sub_data ) )
|
| 386 |
+
$this->data['postmeta'][] = $this->sub_data;
|
| 387 |
+
$this->sub_data = false;
|
| 388 |
+
break;
|
| 389 |
+
case 'item':
|
| 390 |
+
$this->posts[] = $this->data;
|
| 391 |
+
$this->data = false;
|
| 392 |
+
break;
|
| 393 |
+
case 'wp:category':
|
| 394 |
+
case 'wp:tag':
|
| 395 |
+
case 'wp:term':
|
| 396 |
+
$n = substr( $tag, 3 );
|
| 397 |
+
array_push( $this->$n, $this->data );
|
| 398 |
+
$this->data = false;
|
| 399 |
+
break;
|
| 400 |
+
case 'wp:author':
|
| 401 |
+
if ( ! empty($this->data['author_login']) )
|
| 402 |
+
$this->authors[$this->data['author_login']] = $this->data;
|
| 403 |
+
$this->data = false;
|
| 404 |
+
break;
|
| 405 |
+
case 'wp:base_site_url':
|
| 406 |
+
$this->base_url = $this->cdata;
|
| 407 |
+
break;
|
| 408 |
+
case 'wp:wxr_version':
|
| 409 |
+
$this->wxr_version = $this->cdata;
|
| 410 |
+
break;
|
| 411 |
+
|
| 412 |
+
default:
|
| 413 |
+
if ( $this->in_sub_tag ) {
|
| 414 |
+
$this->sub_data[$this->in_sub_tag] = ! empty( $this->cdata ) ? $this->cdata : '';
|
| 415 |
+
$this->in_sub_tag = false;
|
| 416 |
+
} else if ( $this->in_tag ) {
|
| 417 |
+
$this->data[$this->in_tag] = ! empty( $this->cdata ) ? $this->cdata : '';
|
| 418 |
+
$this->in_tag = false;
|
| 419 |
+
}
|
| 420 |
+
}
|
| 421 |
+
|
| 422 |
+
$this->cdata = false;
|
| 423 |
+
}
|
| 424 |
+
}
|
| 425 |
+
|
| 426 |
+
/**
|
| 427 |
+
* WXR Parser that uses regular expressions. Fallback for installs without an XML parser.
|
| 428 |
+
*/
|
| 429 |
+
class WXR_Parser_Regex {
|
| 430 |
+
var $authors = array();
|
| 431 |
+
var $posts = array();
|
| 432 |
+
var $categories = array();
|
| 433 |
+
var $tags = array();
|
| 434 |
+
var $terms = array();
|
| 435 |
+
var $base_url = '';
|
| 436 |
+
|
| 437 |
+
function __construct() {
|
| 438 |
+
$this->has_gzip = is_callable( 'gzopen' );
|
| 439 |
+
}
|
| 440 |
+
|
| 441 |
+
function parse( $file ) {
|
| 442 |
+
$wxr_version = $in_multiline = false;
|
| 443 |
+
|
| 444 |
+
$multiline_content = '';
|
| 445 |
+
|
| 446 |
+
$multiline_tags = array(
|
| 447 |
+
'item' => array( 'posts', array( $this, 'process_post' ) ),
|
| 448 |
+
'wp:category' => array( 'categories', array( $this, 'process_category' ) ),
|
| 449 |
+
'wp:tag' => array( 'tags', array( $this, 'process_tag' ) ),
|
| 450 |
+
'wp:term' => array( 'terms', array( $this, 'process_term' ) ),
|
| 451 |
+
);
|
| 452 |
+
|
| 453 |
+
$fp = $this->fopen( $file, 'r' );
|
| 454 |
+
if ( $fp ) {
|
| 455 |
+
while ( ! $this->feof( $fp ) ) {
|
| 456 |
+
$importline = rtrim( $this->fgets( $fp ) );
|
| 457 |
+
|
| 458 |
+
if ( ! $wxr_version && preg_match( '|<wp:wxr_version>(\d+\.\d+)</wp:wxr_version>|', $importline, $version ) )
|
| 459 |
+
$wxr_version = $version[1];
|
| 460 |
+
|
| 461 |
+
if ( false !== strpos( $importline, '<wp:base_site_url>' ) ) {
|
| 462 |
+
preg_match( '|<wp:base_site_url>(.*?)</wp:base_site_url>|is', $importline, $url );
|
| 463 |
+
$this->base_url = $url[1];
|
| 464 |
+
continue;
|
| 465 |
+
}
|
| 466 |
+
|
| 467 |
+
if ( false !== strpos( $importline, '<wp:author>' ) ) {
|
| 468 |
+
preg_match( '|<wp:author>(.*?)</wp:author>|is', $importline, $author );
|
| 469 |
+
$a = $this->process_author( $author[1] );
|
| 470 |
+
$this->authors[$a['author_login']] = $a;
|
| 471 |
+
continue;
|
| 472 |
+
}
|
| 473 |
+
|
| 474 |
+
foreach ( $multiline_tags as $tag => $handler ) {
|
| 475 |
+
// Handle multi-line tags on a singular line
|
| 476 |
+
if ( preg_match( '|<' . $tag . '>(.*?)</' . $tag . '>|is', $importline, $matches ) ) {
|
| 477 |
+
$this->{$handler[0]}[] = call_user_func( $handler[1], $matches[1] );
|
| 478 |
+
|
| 479 |
+
} elseif ( false !== ( $pos = strpos( $importline, "<$tag>" ) ) ) {
|
| 480 |
+
// Take note of any content after the opening tag
|
| 481 |
+
$multiline_content = trim( substr( $importline, $pos + strlen( $tag ) + 2 ) );
|
| 482 |
+
|
| 483 |
+
// We don't want to have this line added to `$is_multiline` below.
|
| 484 |
+
$importline = '';
|
| 485 |
+
$in_multiline = $tag;
|
| 486 |
+
|
| 487 |
+
} elseif ( false !== ( $pos = strpos( $importline, "</$tag>" ) ) ) {
|
| 488 |
+
$in_multiline = false;
|
| 489 |
+
$multiline_content .= trim( substr( $importline, 0, $pos ) );
|
| 490 |
+
|
| 491 |
+
$this->{$handler[0]}[] = call_user_func( $handler[1], $multiline_content );
|
| 492 |
+
}
|
| 493 |
+
}
|
| 494 |
+
|
| 495 |
+
if ( $in_multiline && $importline ) {
|
| 496 |
+
$multiline_content .= $importline . "\n";
|
| 497 |
+
}
|
| 498 |
+
}
|
| 499 |
+
|
| 500 |
+
$this->fclose($fp);
|
| 501 |
+
}
|
| 502 |
+
|
| 503 |
+
if ( ! $wxr_version )
|
| 504 |
+
return new WP_Error( 'WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) );
|
| 505 |
+
|
| 506 |
+
return array(
|
| 507 |
+
'authors' => $this->authors,
|
| 508 |
+
'posts' => $this->posts,
|
| 509 |
+
'categories' => $this->categories,
|
| 510 |
+
'tags' => $this->tags,
|
| 511 |
+
'terms' => $this->terms,
|
| 512 |
+
'base_url' => $this->base_url,
|
| 513 |
+
'version' => $wxr_version
|
| 514 |
+
);
|
| 515 |
+
}
|
| 516 |
+
|
| 517 |
+
function get_tag( $string, $tag ) {
|
| 518 |
+
preg_match( "|<$tag.*?>(.*?)</$tag>|is", $string, $return );
|
| 519 |
+
if ( isset( $return[1] ) ) {
|
| 520 |
+
if ( substr( $return[1], 0, 9 ) == '<![CDATA[' ) {
|
| 521 |
+
if ( strpos( $return[1], ']]]]><![CDATA[>' ) !== false ) {
|
| 522 |
+
preg_match_all( '|<!\[CDATA\[(.*?)\]\]>|s', $return[1], $matches );
|
| 523 |
+
$return = '';
|
| 524 |
+
foreach( $matches[1] as $match )
|
| 525 |
+
$return .= $match;
|
| 526 |
+
} else {
|
| 527 |
+
$return = preg_replace( '|^<!\[CDATA\[(.*)\]\]>$|s', '$1', $return[1] );
|
| 528 |
+
}
|
| 529 |
+
} else {
|
| 530 |
+
$return = $return[1];
|
| 531 |
+
}
|
| 532 |
+
} else {
|
| 533 |
+
$return = '';
|
| 534 |
+
}
|
| 535 |
+
return $return;
|
| 536 |
+
}
|
| 537 |
+
|
| 538 |
+
function process_category( $c ) {
|
| 539 |
+
return array(
|
| 540 |
+
'term_id' => $this->get_tag( $c, 'wp:term_id' ),
|
| 541 |
+
'cat_name' => $this->get_tag( $c, 'wp:cat_name' ),
|
| 542 |
+
'category_nicename' => $this->get_tag( $c, 'wp:category_nicename' ),
|
| 543 |
+
'category_parent' => $this->get_tag( $c, 'wp:category_parent' ),
|
| 544 |
+
'category_description' => $this->get_tag( $c, 'wp:category_description' ),
|
| 545 |
+
);
|
| 546 |
+
}
|
| 547 |
+
|
| 548 |
+
function process_tag( $t ) {
|
| 549 |
+
return array(
|
| 550 |
+
'term_id' => $this->get_tag( $t, 'wp:term_id' ),
|
| 551 |
+
'tag_name' => $this->get_tag( $t, 'wp:tag_name' ),
|
| 552 |
+
'tag_slug' => $this->get_tag( $t, 'wp:tag_slug' ),
|
| 553 |
+
'tag_description' => $this->get_tag( $t, 'wp:tag_description' ),
|
| 554 |
+
);
|
| 555 |
+
}
|
| 556 |
+
|
| 557 |
+
function process_term( $t ) {
|
| 558 |
+
return array(
|
| 559 |
+
'term_id' => $this->get_tag( $t, 'wp:term_id' ),
|
| 560 |
+
'term_taxonomy' => $this->get_tag( $t, 'wp:term_taxonomy' ),
|
| 561 |
+
'slug' => $this->get_tag( $t, 'wp:term_slug' ),
|
| 562 |
+
'term_parent' => $this->get_tag( $t, 'wp:term_parent' ),
|
| 563 |
+
'term_name' => $this->get_tag( $t, 'wp:term_name' ),
|
| 564 |
+
'term_description' => $this->get_tag( $t, 'wp:term_description' ),
|
| 565 |
+
);
|
| 566 |
+
}
|
| 567 |
+
|
| 568 |
+
function process_author( $a ) {
|
| 569 |
+
return array(
|
| 570 |
+
'author_id' => $this->get_tag( $a, 'wp:author_id' ),
|
| 571 |
+
'author_login' => $this->get_tag( $a, 'wp:author_login' ),
|
| 572 |
+
'author_email' => $this->get_tag( $a, 'wp:author_email' ),
|
| 573 |
+
'author_display_name' => $this->get_tag( $a, 'wp:author_display_name' ),
|
| 574 |
+
'author_first_name' => $this->get_tag( $a, 'wp:author_first_name' ),
|
| 575 |
+
'author_last_name' => $this->get_tag( $a, 'wp:author_last_name' ),
|
| 576 |
+
);
|
| 577 |
+
}
|
| 578 |
+
|
| 579 |
+
function process_post( $post ) {
|
| 580 |
+
$post_id = $this->get_tag( $post, 'wp:post_id' );
|
| 581 |
+
$post_title = $this->get_tag( $post, 'title' );
|
| 582 |
+
$post_date = $this->get_tag( $post, 'wp:post_date' );
|
| 583 |
+
$post_date_gmt = $this->get_tag( $post, 'wp:post_date_gmt' );
|
| 584 |
+
$comment_status = $this->get_tag( $post, 'wp:comment_status' );
|
| 585 |
+
$ping_status = $this->get_tag( $post, 'wp:ping_status' );
|
| 586 |
+
$status = $this->get_tag( $post, 'wp:status' );
|
| 587 |
+
$post_name = $this->get_tag( $post, 'wp:post_name' );
|
| 588 |
+
$post_parent = $this->get_tag( $post, 'wp:post_parent' );
|
| 589 |
+
$menu_order = $this->get_tag( $post, 'wp:menu_order' );
|
| 590 |
+
$post_type = $this->get_tag( $post, 'wp:post_type' );
|
| 591 |
+
$post_password = $this->get_tag( $post, 'wp:post_password' );
|
| 592 |
+
$is_sticky = $this->get_tag( $post, 'wp:is_sticky' );
|
| 593 |
+
$guid = $this->get_tag( $post, 'guid' );
|
| 594 |
+
$post_author = $this->get_tag( $post, 'dc:creator' );
|
| 595 |
+
|
| 596 |
+
$post_excerpt = $this->get_tag( $post, 'excerpt:encoded' );
|
| 597 |
+
$post_excerpt = preg_replace_callback( '|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_excerpt );
|
| 598 |
+
$post_excerpt = str_replace( '<br>', '<br />', $post_excerpt );
|
| 599 |
+
$post_excerpt = str_replace( '<hr>', '<hr />', $post_excerpt );
|
| 600 |
+
|
| 601 |
+
$post_content = $this->get_tag( $post, 'content:encoded' );
|
| 602 |
+
$post_content = preg_replace_callback( '|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content );
|
| 603 |
+
$post_content = str_replace( '<br>', '<br />', $post_content );
|
| 604 |
+
$post_content = str_replace( '<hr>', '<hr />', $post_content );
|
| 605 |
+
|
| 606 |
+
$postdata = compact( 'post_id', 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_excerpt',
|
| 607 |
+
'post_title', 'status', 'post_name', 'comment_status', 'ping_status', 'guid', 'post_parent',
|
| 608 |
+
'menu_order', 'post_type', 'post_password', 'is_sticky'
|
| 609 |
+
);
|
| 610 |
+
|
| 611 |
+
$attachment_url = $this->get_tag( $post, 'wp:attachment_url' );
|
| 612 |
+
if ( $attachment_url )
|
| 613 |
+
$postdata['attachment_url'] = $attachment_url;
|
| 614 |
+
|
| 615 |
+
preg_match_all( '|<category domain="([^"]+?)" nicename="([^"]+?)">(.+?)</category>|is', $post, $terms, PREG_SET_ORDER );
|
| 616 |
+
foreach ( $terms as $t ) {
|
| 617 |
+
$post_terms[] = array(
|
| 618 |
+
'slug' => $t[2],
|
| 619 |
+
'domain' => $t[1],
|
| 620 |
+
'name' => str_replace( array( '<![CDATA[', ']]>' ), '', $t[3] ),
|
| 621 |
+
);
|
| 622 |
+
}
|
| 623 |
+
if ( ! empty( $post_terms ) ) $postdata['terms'] = $post_terms;
|
| 624 |
+
|
| 625 |
+
preg_match_all( '|<wp:comment>(.+?)</wp:comment>|is', $post, $comments );
|
| 626 |
+
$comments = $comments[1];
|
| 627 |
+
if ( $comments ) {
|
| 628 |
+
foreach ( $comments as $comment ) {
|
| 629 |
+
preg_match_all( '|<wp:commentmeta>(.+?)</wp:commentmeta>|is', $comment, $commentmeta );
|
| 630 |
+
$commentmeta = $commentmeta[1];
|
| 631 |
+
$c_meta = array();
|
| 632 |
+
foreach ( $commentmeta as $m ) {
|
| 633 |
+
$c_meta[] = array(
|
| 634 |
+
'key' => $this->get_tag( $m, 'wp:meta_key' ),
|
| 635 |
+
'value' => $this->get_tag( $m, 'wp:meta_value' ),
|
| 636 |
+
);
|
| 637 |
+
}
|
| 638 |
+
|
| 639 |
+
$post_comments[] = array(
|
| 640 |
+
'comment_id' => $this->get_tag( $comment, 'wp:comment_id' ),
|
| 641 |
+
'comment_author' => $this->get_tag( $comment, 'wp:comment_author' ),
|
| 642 |
+
'comment_author_email' => $this->get_tag( $comment, 'wp:comment_author_email' ),
|
| 643 |
+
'comment_author_IP' => $this->get_tag( $comment, 'wp:comment_author_IP' ),
|
| 644 |
+
'comment_author_url' => $this->get_tag( $comment, 'wp:comment_author_url' ),
|
| 645 |
+
'comment_date' => $this->get_tag( $comment, 'wp:comment_date' ),
|
| 646 |
+
'comment_date_gmt' => $this->get_tag( $comment, 'wp:comment_date_gmt' ),
|
| 647 |
+
'comment_content' => $this->get_tag( $comment, 'wp:comment_content' ),
|
| 648 |
+
'comment_approved' => $this->get_tag( $comment, 'wp:comment_approved' ),
|
| 649 |
+
'comment_type' => $this->get_tag( $comment, 'wp:comment_type' ),
|
| 650 |
+
'comment_parent' => $this->get_tag( $comment, 'wp:comment_parent' ),
|
| 651 |
+
'comment_user_id' => $this->get_tag( $comment, 'wp:comment_user_id' ),
|
| 652 |
+
'commentmeta' => $c_meta,
|
| 653 |
+
);
|
| 654 |
+
}
|
| 655 |
+
}
|
| 656 |
+
if ( ! empty( $post_comments ) ) $postdata['comments'] = $post_comments;
|
| 657 |
+
|
| 658 |
+
preg_match_all( '|<wp:postmeta>(.+?)</wp:postmeta>|is', $post, $postmeta );
|
| 659 |
+
$postmeta = $postmeta[1];
|
| 660 |
+
if ( $postmeta ) {
|
| 661 |
+
foreach ( $postmeta as $p ) {
|
| 662 |
+
$post_postmeta[] = array(
|
| 663 |
+
'key' => $this->get_tag( $p, 'wp:meta_key' ),
|
| 664 |
+
'value' => $this->get_tag( $p, 'wp:meta_value' ),
|
| 665 |
+
);
|
| 666 |
+
}
|
| 667 |
+
}
|
| 668 |
+
if ( ! empty( $post_postmeta ) ) $postdata['postmeta'] = $post_postmeta;
|
| 669 |
+
|
| 670 |
+
return $postdata;
|
| 671 |
+
}
|
| 672 |
+
|
| 673 |
+
function _normalize_tag( $matches ) {
|
| 674 |
+
return '<' . strtolower( $matches[1] );
|
| 675 |
+
}
|
| 676 |
+
|
| 677 |
+
function fopen( $filename, $mode = 'r' ) {
|
| 678 |
+
if ( $this->has_gzip )
|
| 679 |
+
return gzopen( $filename, $mode );
|
| 680 |
+
return fopen( $filename, $mode );
|
| 681 |
+
}
|
| 682 |
+
|
| 683 |
+
function feof( $fp ) {
|
| 684 |
+
if ( $this->has_gzip )
|
| 685 |
+
return gzeof( $fp );
|
| 686 |
+
return feof( $fp );
|
| 687 |
+
}
|
| 688 |
+
|
| 689 |
+
function fgets( $fp, $len = 8192 ) {
|
| 690 |
+
if ( $this->has_gzip )
|
| 691 |
+
return gzgets( $fp, $len );
|
| 692 |
+
return fgets( $fp, $len );
|
| 693 |
+
}
|
| 694 |
+
|
| 695 |
+
function fclose( $fp ) {
|
| 696 |
+
if ( $this->has_gzip )
|
| 697 |
+
return gzclose( $fp );
|
| 698 |
+
return fclose( $fp );
|
| 699 |
+
}
|
| 700 |
+
}
|
| 701 |
+
|
framework/features/demo-install/plugins-uninstaller.php
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
namespace Blocksy;
|
| 4 |
+
|
| 5 |
+
class DemoInstallPluginsUninstaller {
|
| 6 |
+
public function import() {
|
| 7 |
+
Plugin::instance()->demo->start_streaming();
|
| 8 |
+
|
| 9 |
+
if (! current_user_can('edit_theme_options')) {
|
| 10 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 11 |
+
'action' => 'complete',
|
| 12 |
+
'error' => false,
|
| 13 |
+
]);
|
| 14 |
+
|
| 15 |
+
exit;
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
if (! isset($_REQUEST['plugins']) || !$_REQUEST['plugins']) {
|
| 19 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 20 |
+
'action' => 'complete',
|
| 21 |
+
'error' => false,
|
| 22 |
+
]);
|
| 23 |
+
|
| 24 |
+
exit;
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
$plugins = explode(':', $_REQUEST['plugins']);
|
| 28 |
+
|
| 29 |
+
$plugins_manager = Plugin::instance()->demo->get_plugins_manager();
|
| 30 |
+
|
| 31 |
+
foreach ($plugins as $single_plugin) {
|
| 32 |
+
$plugins_manager->plugin_deactivation($single_plugin);
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 36 |
+
'action' => 'complete',
|
| 37 |
+
'error' => false,
|
| 38 |
+
]);
|
| 39 |
+
|
| 40 |
+
exit;
|
| 41 |
+
}
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
|
framework/features/demo-install/required-plugins.php
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
namespace Blocksy;
|
| 4 |
+
|
| 5 |
+
class DemoInstallPluginsInstaller {
|
| 6 |
+
protected $has_streaming = true;
|
| 7 |
+
protected $plugins = null;
|
| 8 |
+
|
| 9 |
+
public function __construct($args = []) {
|
| 10 |
+
$args = wp_parse_args($args, [
|
| 11 |
+
'has_streaming' => true,
|
| 12 |
+
'plugins' => null
|
| 13 |
+
]);
|
| 14 |
+
|
| 15 |
+
if (
|
| 16 |
+
!$args['plugins']
|
| 17 |
+
&&
|
| 18 |
+
isset($_REQUEST['plugins'])
|
| 19 |
+
&&
|
| 20 |
+
$_REQUEST['plugins']
|
| 21 |
+
) {
|
| 22 |
+
$args['plugins'] = $_REQUEST['plugins'];
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
$this->has_streaming = $args['has_streaming'];
|
| 26 |
+
$this->plugins = $args['plugins'];
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
public function import() {
|
| 30 |
+
if ($this->has_streaming) {
|
| 31 |
+
Plugin::instance()->demo->start_streaming();
|
| 32 |
+
|
| 33 |
+
if (! current_user_can('edit_theme_options')) {
|
| 34 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 35 |
+
'action' => 'complete',
|
| 36 |
+
'error' => false,
|
| 37 |
+
]);
|
| 38 |
+
exit;
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
if (! isset($_REQUEST['plugins']) || !$_REQUEST['plugins']) {
|
| 42 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 43 |
+
'action' => 'complete',
|
| 44 |
+
'error' => false,
|
| 45 |
+
]);
|
| 46 |
+
exit;
|
| 47 |
+
}
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
$plugins = explode(':', $this->plugins);
|
| 51 |
+
|
| 52 |
+
$plugins_manager = Plugin::instance()->demo->get_plugins_manager();
|
| 53 |
+
|
| 54 |
+
foreach ($plugins as $single_plugin) {
|
| 55 |
+
if ($this->has_streaming) {
|
| 56 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 57 |
+
'action' => 'install_plugin',
|
| 58 |
+
'name' => $single_plugin
|
| 59 |
+
]);
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
$plugins_manager->prepare_install($single_plugin);
|
| 63 |
+
echo $single_plugin;
|
| 64 |
+
|
| 65 |
+
if ($this->has_streaming) {
|
| 66 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 67 |
+
'action' => 'activate_plugin',
|
| 68 |
+
'name' => $single_plugin
|
| 69 |
+
]);
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
$plugins_manager->plugin_activation($single_plugin);
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
if ($this->has_streaming) {
|
| 76 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 77 |
+
'action' => 'complete',
|
| 78 |
+
'error' => false,
|
| 79 |
+
]);
|
| 80 |
+
|
| 81 |
+
exit;
|
| 82 |
+
}
|
| 83 |
+
}
|
| 84 |
+
}
|
| 85 |
+
|
framework/features/demo-install/widgets-export.php
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
namespace Blocksy;
|
| 4 |
+
|
| 5 |
+
class DemoInstallWidgetsExport {
|
| 6 |
+
public function export() {
|
| 7 |
+
$available_widgets = $this->available_widgets();
|
| 8 |
+
|
| 9 |
+
$widget_instances = array();
|
| 10 |
+
|
| 11 |
+
foreach ( $available_widgets as $widget_data ) {
|
| 12 |
+
$instances = get_option('widget_' . $widget_data['id_base']);
|
| 13 |
+
|
| 14 |
+
if (! empty($instances)) {
|
| 15 |
+
foreach ($instances as $instance_id => $instance_data) {
|
| 16 |
+
if (is_numeric($instance_id)) {
|
| 17 |
+
$unique_instance_id = $widget_data['id_base'] . '-' . $instance_id;
|
| 18 |
+
$widget_instances[ $unique_instance_id ] = $instance_data;
|
| 19 |
+
}
|
| 20 |
+
}
|
| 21 |
+
}
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
$sidebars_widgets = get_option('sidebars_widgets');
|
| 25 |
+
$sidebars_widget_instances = [];
|
| 26 |
+
|
| 27 |
+
foreach ($sidebars_widgets as $sidebar_id => $widget_ids) {
|
| 28 |
+
if ('wp_inactive_widgets' === $sidebar_id) {
|
| 29 |
+
continue;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
if (! is_array($widget_ids) || empty($widget_ids)) {
|
| 33 |
+
continue;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
foreach ($widget_ids as $widget_id) {
|
| 37 |
+
if (isset($widget_instances[$widget_id])) {
|
| 38 |
+
$sidebars_widget_instances[$sidebar_id][$widget_id] = $widget_instances[$widget_id];
|
| 39 |
+
}
|
| 40 |
+
}
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
return wp_json_encode($sidebars_widget_instances);
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
public function available_widgets() {
|
| 47 |
+
global $wp_registered_widget_controls;
|
| 48 |
+
|
| 49 |
+
$widget_controls = $wp_registered_widget_controls;
|
| 50 |
+
|
| 51 |
+
$available_widgets = array();
|
| 52 |
+
|
| 53 |
+
foreach ($widget_controls as $widget) {
|
| 54 |
+
// No duplicates.
|
| 55 |
+
if (
|
| 56 |
+
! empty($widget['id_base'])
|
| 57 |
+
&&
|
| 58 |
+
! isset($available_widgets[$widget['id_base']])
|
| 59 |
+
) {
|
| 60 |
+
$available_widgets[$widget['id_base']]['id_base'] = $widget['id_base'];
|
| 61 |
+
$available_widgets[$widget['id_base']]['name'] = $widget['name'];
|
| 62 |
+
}
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
return $available_widgets;
|
| 66 |
+
}
|
| 67 |
+
}
|
framework/features/demo-install/widgets-import.php
ADDED
|
@@ -0,0 +1,277 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
namespace Blocksy;
|
| 4 |
+
|
| 5 |
+
class DemoInstallWidgetsInstaller {
|
| 6 |
+
protected $has_streaming = true;
|
| 7 |
+
protected $demo_name = null;
|
| 8 |
+
|
| 9 |
+
public function __construct($args = []) {
|
| 10 |
+
$args = wp_parse_args($args, [
|
| 11 |
+
'has_streaming' => true,
|
| 12 |
+
'demo_name' => null
|
| 13 |
+
]);
|
| 14 |
+
|
| 15 |
+
if (
|
| 16 |
+
!$args['demo_name']
|
| 17 |
+
&&
|
| 18 |
+
isset($_REQUEST['demo_name'])
|
| 19 |
+
&&
|
| 20 |
+
$_REQUEST['demo_name']
|
| 21 |
+
) {
|
| 22 |
+
$args['demo_name'] = $_REQUEST['demo_name'];
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
$this->has_streaming = $args['has_streaming'];
|
| 26 |
+
$this->demo_name = $args['demo_name'];
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
public function import() {
|
| 30 |
+
if ($this->has_streaming) {
|
| 31 |
+
Plugin::instance()->demo->start_streaming();
|
| 32 |
+
|
| 33 |
+
if (! current_user_can('edit_theme_options')) {
|
| 34 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 35 |
+
'action' => 'complete',
|
| 36 |
+
'error' => 'No permission.',
|
| 37 |
+
]);
|
| 38 |
+
|
| 39 |
+
exit;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
if (! $this->demo_name) {
|
| 43 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 44 |
+
'action' => 'complete',
|
| 45 |
+
'error' => 'No demo name passed.',
|
| 46 |
+
]);
|
| 47 |
+
exit;
|
| 48 |
+
}
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
$demo_name = explode(':', $this->demo_name);
|
| 52 |
+
|
| 53 |
+
if (! isset($demo_name[1])) {
|
| 54 |
+
$demo_name[1] = '';
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
$demo = $demo_name[0];
|
| 58 |
+
$builder = $demo_name[1];
|
| 59 |
+
|
| 60 |
+
if ($this->has_streaming) {
|
| 61 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 62 |
+
'action' => 'download_demo_widgets',
|
| 63 |
+
'error' => false,
|
| 64 |
+
]);
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
$demo_content = Plugin::instance()->demo->fetch_single_demo([
|
| 68 |
+
'demo' => $demo,
|
| 69 |
+
'builder' => $builder,
|
| 70 |
+
'field' => 'widgets'
|
| 71 |
+
]);
|
| 72 |
+
|
| 73 |
+
if ($this->has_streaming) {
|
| 74 |
+
if (! isset($demo_content['widgets'])) {
|
| 75 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 76 |
+
'action' => 'complete',
|
| 77 |
+
'demo' => $demo,
|
| 78 |
+
'error' => __('Downloaded demo is corrupted.'),
|
| 79 |
+
]);
|
| 80 |
+
|
| 81 |
+
exit;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 85 |
+
'action' => 'apply_demo_widgets',
|
| 86 |
+
'error' => false,
|
| 87 |
+
]);
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
$data = json_decode(json_encode($demo_content['widgets']));
|
| 91 |
+
|
| 92 |
+
$result = $this->import_data($data);
|
| 93 |
+
|
| 94 |
+
if ($this->has_streaming) {
|
| 95 |
+
Plugin::instance()->demo->emit_sse_message([
|
| 96 |
+
'action' => 'complete',
|
| 97 |
+
'data' => $result,
|
| 98 |
+
'error' => false,
|
| 99 |
+
]);
|
| 100 |
+
|
| 101 |
+
exit;
|
| 102 |
+
}
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
private function import_data($data) {
|
| 106 |
+
if (empty($data) || !is_object($data)) {
|
| 107 |
+
return false;
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
$sidebars_widgets = get_option('sidebars_widgets');
|
| 111 |
+
|
| 112 |
+
if (! $sidebars_widgets) {
|
| 113 |
+
$sidebars_widgets = [];
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
foreach ($data as $sidebar_id => $widgets) {
|
| 117 |
+
if ('wp_inactive_widgets' === $sidebar_id) {
|
| 118 |
+
continue;
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
$result = $this->handle_single_sidebar($sidebar_id, $widgets);
|
| 122 |
+
|
| 123 |
+
foreach ($result as $widget_id) {
|
| 124 |
+
$sidebars_widgets[$sidebar_id][] = $widget_id;
|
| 125 |
+
}
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
update_option('sidebars_widgets', $sidebars_widgets);
|
| 129 |
+
unset($sidebars_widgets['array_version']);
|
| 130 |
+
set_theme_mod('sidebars_widgets', [
|
| 131 |
+
'time' => time(),
|
| 132 |
+
'data' => $sidebars_widgets
|
| 133 |
+
]);
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
private function handle_single_sidebar($sidebar_id, $widgets) {
|
| 137 |
+
global $wp_registered_sidebars;
|
| 138 |
+
|
| 139 |
+
$available_widgets = $this->available_widgets();
|
| 140 |
+
|
| 141 |
+
$widget_instances = [];
|
| 142 |
+
|
| 143 |
+
foreach ($available_widgets as $widget_data) {
|
| 144 |
+
$widget_instances[$widget_data['id_base']] = get_option(
|
| 145 |
+
'widget_' . $widget_data['id_base']
|
| 146 |
+
);
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
+
if (! isset($wp_registered_sidebars[$sidebar_id])) {
|
| 150 |
+
$sidebar_id = 'wp_inactive_widgets';
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
$result = [];
|
| 154 |
+
|
| 155 |
+
foreach ($widgets as $widget_instance_id => $widget) {
|
| 156 |
+
$id_base = preg_replace('/-[0-9]+$/', '', $widget_instance_id);
|
| 157 |
+
$instance_id_number = str_replace($id_base . '-', '', $widget_instance_id);
|
| 158 |
+
|
| 159 |
+
// Does site support this widget?
|
| 160 |
+
if (! isset($available_widgets[$id_base])) {
|
| 161 |
+
continue;
|
| 162 |
+
}
|
| 163 |
+
|
| 164 |
+
// Convert multidimensional objects to multidimensional arrays
|
| 165 |
+
// Some plugins like Jetpack Widget Visibility store settings
|
| 166 |
+
// as multidimensional arrays Without this, they are imported as
|
| 167 |
+
// objects and cause fatal error on Widgets page If this creates
|
| 168 |
+
// problems for plugins that do actually intend settings in
|
| 169 |
+
// objects then may need to consider other
|
| 170 |
+
// approach: https://wordpress.org/support/topic/problem-with-array-of-arrays
|
| 171 |
+
// It is probably much more likely that arrays are used than objects, however.
|
| 172 |
+
$widget = json_decode(wp_json_encode($widget), true);
|
| 173 |
+
|
| 174 |
+
/**
|
| 175 |
+
* Does widget with identical settings already exist in same sidebar?
|
| 176 |
+
* Skip identical widget.
|
| 177 |
+
*/
|
| 178 |
+
/*
|
| 179 |
+
if (isset($widget_instances[$id_base])) {
|
| 180 |
+
// Get existing widgets in this sidebar.
|
| 181 |
+
$sidebar_widgets = isset(
|
| 182 |
+
$sidebars_widgets[$sidebar_id]
|
| 183 |
+
) ? $sidebars_widgets[$sidebar_id] : [];
|
| 184 |
+
|
| 185 |
+
// Loop widgets with ID base.
|
| 186 |
+
$single_widget_instances = ! empty(
|
| 187 |
+
$widget_instances[$id_base]
|
| 188 |
+
) ? $widget_instances[$id_base] : [];
|
| 189 |
+
|
| 190 |
+
$is_in_same_sidebar_with_same_id = false;
|
| 191 |
+
|
| 192 |
+
foreach ($single_widget_instances as $check_id => $check_widget) {
|
| 193 |
+
// Is widget in same sidebar and has identical settings?
|
| 194 |
+
if (
|
| 195 |
+
in_array("$id_base-$check_id", $sidebar_widgets, true)
|
| 196 |
+
&&
|
| 197 |
+
(array) $widget === $check_widget
|
| 198 |
+
) {
|
| 199 |
+
$is_in_same_sidebar_with_same_id = true;
|
| 200 |
+
}
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
if ($is_in_same_sidebar_with_same_id) {
|
| 204 |
+
continue;
|
| 205 |
+
}
|
| 206 |
+
}
|
| 207 |
+
*/
|
| 208 |
+
|
| 209 |
+
// Add widget instance
|
| 210 |
+
// All instances for that widget ID base, get fresh every time.
|
| 211 |
+
global $wpdb;
|
| 212 |
+
|
| 213 |
+
$single_widget_instances = maybe_unserialize(
|
| 214 |
+
$wpdb->get_row(
|
| 215 |
+
$wpdb->prepare(
|
| 216 |
+
"SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1",
|
| 217 |
+
'widget_' . $id_base
|
| 218 |
+
)
|
| 219 |
+
)->option_value
|
| 220 |
+
);
|
| 221 |
+
|
| 222 |
+
if (empty($single_widget_instances)) {
|
| 223 |
+
$single_widget_instances = [
|
| 224 |
+
'_multiwidget' => 1,
|
| 225 |
+
];
|
| 226 |
+
}
|
| 227 |
+
|
| 228 |
+
$new_instance_id_number = 1;
|
| 229 |
+
|
| 230 |
+
while (true) {
|
| 231 |
+
if (! isset($single_widget_instances[$new_instance_id_number])) {
|
| 232 |
+
break;
|
| 233 |
+
}
|
| 234 |
+
|
| 235 |
+
$new_instance_id_number++;
|
| 236 |
+
}
|
| 237 |
+
|
| 238 |
+
// Add it.
|
| 239 |
+
$single_widget_instances[$new_instance_id_number] = $widget;
|
| 240 |
+
|
| 241 |
+
if (isset($single_widget_instances['_multiwidget'])) {
|
| 242 |
+
$multiwidget = $single_widget_instances['_multiwidget'];
|
| 243 |
+
unset($single_widget_instances['_multiwidget']);
|
| 244 |
+
$single_widget_instances['_multiwidget'] = $multiwidget;
|
| 245 |
+
}
|
| 246 |
+
|
| 247 |
+
update_option('widget_' . $id_base, $single_widget_instances, false);
|
| 248 |
+
|
| 249 |
+
$new_instance_id = $id_base . '-' . $new_instance_id_number;
|
| 250 |
+
|
| 251 |
+
$result[] = $new_instance_id;
|
| 252 |
+
}
|
| 253 |
+
|
| 254 |
+
return $result;
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
private function available_widgets() {
|
| 258 |
+
global $wp_registered_widget_controls;
|
| 259 |
+
|
| 260 |
+
$widget_controls = $wp_registered_widget_controls;
|
| 261 |
+
$available_widgets = [];
|
| 262 |
+
|
| 263 |
+
foreach ($widget_controls as $widget) {
|
| 264 |
+
if (
|
| 265 |
+
!empty($widget['id_base'])
|
| 266 |
+
&&
|
| 267 |
+
!isset($available_widgets[$widget['id_base']])
|
| 268 |
+
) {
|
| 269 |
+
$available_widgets[$widget['id_base']]['id_base'] = $widget['id_base'];
|
| 270 |
+
$available_widgets[$widget['id_base']]['name'] = $widget['name'];
|
| 271 |
+
}
|
| 272 |
+
}
|
| 273 |
+
|
| 274 |
+
return $available_widgets;
|
| 275 |
+
}
|
| 276 |
+
}
|
| 277 |
+
|
framework/features/demo-install/wp-importer.php
ADDED
|
@@ -0,0 +1,1345 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/** Display verbose errors */
|
| 4 |
+
define( 'IMPORT_DEBUG', false );
|
| 5 |
+
// Load Importer API
|
| 6 |
+
require_once ABSPATH . 'wp-admin/includes/import.php';
|
| 7 |
+
|
| 8 |
+
if ( ! class_exists( 'WP_Importer' ) ) {
|
| 9 |
+
$class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php';
|
| 10 |
+
if ( file_exists( $class_wp_importer ) )
|
| 11 |
+
require $class_wp_importer;
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
// include WXR file parsers
|
| 15 |
+
require dirname( __FILE__ ) . '/parsers.php';
|
| 16 |
+
|
| 17 |
+
function blc_load_xml_file($url) {
|
| 18 |
+
set_time_limit(100);
|
| 19 |
+
|
| 20 |
+
if (ini_get('allow_url_fopen') == true) {
|
| 21 |
+
return file_get_contents($url, false, stream_context_create([
|
| 22 |
+
"ssl" => [
|
| 23 |
+
"verify_peer"=>false,
|
| 24 |
+
"verify_peer_name"=>false,
|
| 25 |
+
]
|
| 26 |
+
]));
|
| 27 |
+
} else if (function_exists('curl_init')) {
|
| 28 |
+
$curl = curl_init($url);
|
| 29 |
+
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
| 30 |
+
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
| 31 |
+
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
| 32 |
+
|
| 33 |
+
$result = curl_exec($curl);
|
| 34 |
+
curl_close($curl);
|
| 35 |
+
|
| 36 |
+
return $result;
|
| 37 |
+
} else {
|
| 38 |
+
throw new Exception("Can't load data.");
|
| 39 |
+
}
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
if ( ! function_exists( 'wp_slash_strings_only' ) ) {
|
| 43 |
+
/**
|
| 44 |
+
* Adds slashes to only string values in an array of values.
|
| 45 |
+
*
|
| 46 |
+
* Compat for WordPress < 5.3.0.
|
| 47 |
+
*
|
| 48 |
+
* @since 0.7.0
|
| 49 |
+
*
|
| 50 |
+
* @param mixed $value Scalar or array of scalars.
|
| 51 |
+
* @return mixed Slashes $value
|
| 52 |
+
*/
|
| 53 |
+
function wp_slash_strings_only( $value ) {
|
| 54 |
+
return map_deep( $value, 'addslashes_strings_only' );
|
| 55 |
+
}
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
if ( ! function_exists( 'addslashes_strings_only' ) ) {
|
| 59 |
+
/**
|
| 60 |
+
* Adds slashes only if the provided value is a string.
|
| 61 |
+
*
|
| 62 |
+
* Compat for WordPress < 5.3.0.
|
| 63 |
+
*
|
| 64 |
+
* @since 0.7.0
|
| 65 |
+
*
|
| 66 |
+
* @param mixed $value
|
| 67 |
+
* @return mixed
|
| 68 |
+
*/
|
| 69 |
+
function addslashes_strings_only( $value ) {
|
| 70 |
+
return is_string( $value ) ? addslashes( $value ) : $value;
|
| 71 |
+
}
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
if ( ! function_exists( 'map_deep' ) ) {
|
| 75 |
+
/**
|
| 76 |
+
* Maps a function to all non-iterable elements of an array or an object.
|
| 77 |
+
*
|
| 78 |
+
* Compat for WordPress < 4.4.0.
|
| 79 |
+
*
|
| 80 |
+
* @since 0.7.0
|
| 81 |
+
*
|
| 82 |
+
* @param mixed $value The array, object, or scalar.
|
| 83 |
+
* @param callable $callback The function to map onto $value.
|
| 84 |
+
* @return mixed The value with the callback applied to all non-arrays and non-objects inside it.
|
| 85 |
+
*/
|
| 86 |
+
function map_deep( $value, $callback ) {
|
| 87 |
+
if ( is_array( $value ) ) {
|
| 88 |
+
foreach ( $value as $index => $item ) {
|
| 89 |
+
$value[ $index ] = map_deep( $item, $callback );
|
| 90 |
+
}
|
| 91 |
+
} elseif ( is_object( $value ) ) {
|
| 92 |
+
$object_vars = get_object_vars( $value );
|
| 93 |
+
foreach ( $object_vars as $property_name => $property_value ) {
|
| 94 |
+
$value->$property_name = map_deep( $property_value, $callback );
|
| 95 |
+
}
|
| 96 |
+
} else {
|
| 97 |
+
$value = call_user_func( $callback, $value );
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
return $value;
|
| 101 |
+
}
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
/**
|
| 105 |
+
* WordPress Importer class for managing the import process of a WXR file
|
| 106 |
+
*
|
| 107 |
+
* @package WordPress
|
| 108 |
+
* @subpackage Importer
|
| 109 |
+
*/
|
| 110 |
+
if ( class_exists( 'WP_Importer' ) ) {
|
| 111 |
+
class Blocksy_WP_Import extends WP_Importer {
|
| 112 |
+
var $max_wxr_version = 1.2; // max. supported WXR version
|
| 113 |
+
|
| 114 |
+
var $id; // WXR attachment ID
|
| 115 |
+
|
| 116 |
+
// information to import from WXR file
|
| 117 |
+
var $version;
|
| 118 |
+
var $authors = array();
|
| 119 |
+
var $posts = array();
|
| 120 |
+
var $terms = array();
|
| 121 |
+
var $categories = array();
|
| 122 |
+
var $tags = array();
|
| 123 |
+
var $base_url = '';
|
| 124 |
+
|
| 125 |
+
// mappings from old information to new
|
| 126 |
+
var $processed_authors = array();
|
| 127 |
+
var $author_mapping = array();
|
| 128 |
+
var $processed_terms = array();
|
| 129 |
+
var $processed_posts = array();
|
| 130 |
+
var $post_orphans = array();
|
| 131 |
+
var $processed_menu_items = array();
|
| 132 |
+
var $menu_item_orphans = array();
|
| 133 |
+
var $missing_menu_items = array();
|
| 134 |
+
|
| 135 |
+
var $fetch_attachments = false;
|
| 136 |
+
var $url_remap = array();
|
| 137 |
+
var $featured_images = array();
|
| 138 |
+
|
| 139 |
+
/**
|
| 140 |
+
* Registered callback function for the WordPress Importer
|
| 141 |
+
*
|
| 142 |
+
* Manages the three separate stages of the WXR import process
|
| 143 |
+
*/
|
| 144 |
+
function dispatch() {
|
| 145 |
+
$this->header();
|
| 146 |
+
|
| 147 |
+
$step = empty( $_GET['step'] ) ? 0 : (int) $_GET['step'];
|
| 148 |
+
switch ( $step ) {
|
| 149 |
+
case 0:
|
| 150 |
+
$this->greet();
|
| 151 |
+
break;
|
| 152 |
+
case 1:
|
| 153 |
+
check_admin_referer( 'import-upload' );
|
| 154 |
+
if ( $this->handle_upload() )
|
| 155 |
+
$this->import_options();
|
| 156 |
+
break;
|
| 157 |
+
case 2:
|
| 158 |
+
check_admin_referer( 'import-wordpress' );
|
| 159 |
+
$this->fetch_attachments = ( ! empty( $_POST['fetch_attachments'] ) && $this->allow_fetch_attachments() );
|
| 160 |
+
$this->id = (int) $_POST['import_id'];
|
| 161 |
+
$file = get_attached_file( $this->id );
|
| 162 |
+
set_time_limit(0);
|
| 163 |
+
$this->import( $file );
|
| 164 |
+
break;
|
| 165 |
+
}
|
| 166 |
+
|
| 167 |
+
$this->footer();
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
/**
|
| 171 |
+
* The main controller for the actual import stage.
|
| 172 |
+
*
|
| 173 |
+
* @param string $file Path to the WXR file for importing
|
| 174 |
+
*/
|
| 175 |
+
function import( $file ) {
|
| 176 |
+
add_filter( 'import_post_meta_key', array( $this, 'is_valid_meta_key' ) );
|
| 177 |
+
add_filter( 'http_request_timeout', array( &$this, 'bump_request_timeout' ) );
|
| 178 |
+
|
| 179 |
+
$this->import_start( $file );
|
| 180 |
+
|
| 181 |
+
$this->get_author_mapping();
|
| 182 |
+
|
| 183 |
+
wp_suspend_cache_invalidation( true );
|
| 184 |
+
$this->process_categories();
|
| 185 |
+
$this->process_tags();
|
| 186 |
+
$this->process_terms();
|
| 187 |
+
$this->process_posts();
|
| 188 |
+
wp_suspend_cache_invalidation( false );
|
| 189 |
+
|
| 190 |
+
// update incorrect/missing information in the DB
|
| 191 |
+
$this->backfill_parents();
|
| 192 |
+
$this->backfill_attachment_urls();
|
| 193 |
+
$this->remap_featured_images();
|
| 194 |
+
|
| 195 |
+
$this->import_end();
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
/**
|
| 199 |
+
* Parses the WXR file and prepares us for the task of processing parsed data
|
| 200 |
+
*
|
| 201 |
+
* @param string $file Path to the WXR file for importing
|
| 202 |
+
*/
|
| 203 |
+
function import_start( $file ) {
|
| 204 |
+
if ( ! is_file($file) ) {
|
| 205 |
+
/*
|
| 206 |
+
echo '<p><strong>' . __( 'Sorry, there has been an error.', 'wordpress-importer' ) . '</strong><br />';
|
| 207 |
+
echo __( 'The file does not exist, please try again.', 'wordpress-importer' ) . '</p>';
|
| 208 |
+
$this->footer();
|
| 209 |
+
die();
|
| 210 |
+
*/
|
| 211 |
+
}
|
| 212 |
+
|
| 213 |
+
$import_data = $this->parse( $file );
|
| 214 |
+
|
| 215 |
+
if ( is_wp_error( $import_data ) ) {
|
| 216 |
+
echo '<p><strong>' . __( 'Sorry, there has been an error.', 'wordpress-importer' ) . '</strong><br />';
|
| 217 |
+
echo esc_html( $import_data->get_error_message() ) . '</p>';
|
| 218 |
+
$this->footer();
|
| 219 |
+
die();
|
| 220 |
+
}
|
| 221 |
+
|
| 222 |
+
$this->version = $import_data['version'];
|
| 223 |
+
$this->get_authors_from_import( $import_data );
|
| 224 |
+
$this->posts = $import_data['posts'];
|
| 225 |
+
$this->terms = $import_data['terms'];
|
| 226 |
+
$this->categories = $import_data['categories'];
|
| 227 |
+
$this->tags = $import_data['tags'];
|
| 228 |
+
$this->base_url = esc_url( $import_data['base_url'] );
|
| 229 |
+
|
| 230 |
+
wp_defer_term_counting( true );
|
| 231 |
+
wp_defer_comment_counting( true );
|
| 232 |
+
|
| 233 |
+
do_action( 'import_start' );
|
| 234 |
+
}
|
| 235 |
+
|
| 236 |
+
/**
|
| 237 |
+
* Performs post-import cleanup of files and the cache
|
| 238 |
+
*/
|
| 239 |
+
function import_end() {
|
| 240 |
+
wp_import_cleanup( $this->id );
|
| 241 |
+
|
| 242 |
+
wp_cache_flush();
|
| 243 |
+
foreach ( get_taxonomies() as $tax ) {
|
| 244 |
+
delete_option( "{$tax}_children" );
|
| 245 |
+
_get_term_hierarchy( $tax );
|
| 246 |
+
}
|
| 247 |
+
|
| 248 |
+
wp_defer_term_counting( false );
|
| 249 |
+
wp_defer_comment_counting( false );
|
| 250 |
+
|
| 251 |
+
echo '<p>' . __( 'All done.', 'wordpress-importer' ) . ' <a href="' . admin_url() . '">' . __( 'Have fun!', 'wordpress-importer' ) . '</a>' . '</p>';
|
| 252 |
+
echo '<p>' . __( 'Remember to update the passwords and roles of imported users.', 'wordpress-importer' ) . '</p>';
|
| 253 |
+
|
| 254 |
+
do_action( 'import_end' );
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
/**
|
| 258 |
+
* Handles the WXR upload and initial parsing of the file to prepare for
|
| 259 |
+
* displaying author import options
|
| 260 |
+
*
|
| 261 |
+
* @return bool False if error uploading or invalid file, true otherwise
|
| 262 |
+
*/
|
| 263 |
+
function handle_upload() {
|
| 264 |
+
$file = wp_import_handle_upload();
|
| 265 |
+
|
| 266 |
+
if ( isset( $file['error'] ) ) {
|
| 267 |
+
echo '<p><strong>' . __( 'Sorry, there has been an error.', 'wordpress-importer' ) . '</strong><br />';
|
| 268 |
+
echo esc_html( $file['error'] ) . '</p>';
|
| 269 |
+
return false;
|
| 270 |
+
} else if ( ! file_exists( $file['file'] ) ) {
|
| 271 |
+
echo '<p><strong>' . __( 'Sorry, there has been an error.', 'wordpress-importer' ) . '</strong><br />';
|
| 272 |
+
printf( __( 'The export file could not be found at <code>%s</code>. It is likely that this was caused by a permissions problem.', 'wordpress-importer' ), esc_html( $file['file'] ) );
|
| 273 |
+
echo '</p>';
|
| 274 |
+
return false;
|
| 275 |
+
}
|
| 276 |
+
|
| 277 |
+
$this->id = (int) $file['id'];
|
| 278 |
+
$import_data = $this->parse( $file['file'] );
|
| 279 |
+
if ( is_wp_error( $import_data ) ) {
|
| 280 |
+
echo '<p><strong>' . __( 'Sorry, there has been an error.', 'wordpress-importer' ) . '</strong><br />';
|
| 281 |
+
echo esc_html( $import_data->get_error_message() ) . '</p>';
|
| 282 |
+
return false;
|
| 283 |
+
}
|
| 284 |
+
|
| 285 |
+
$this->version = $import_data['version'];
|
| 286 |
+
if ( $this->version > $this->max_wxr_version ) {
|
| 287 |
+
echo '<div class="error"><p><strong>';
|
| 288 |
+
printf( __( 'This WXR file (version %s) may not be supported by this version of the importer. Please consider updating.', 'wordpress-importer' ), esc_html($import_data['version']) );
|
| 289 |
+
echo '</strong></p></div>';
|
| 290 |
+
}
|
| 291 |
+
|
| 292 |
+
$this->get_authors_from_import( $import_data );
|
| 293 |
+
|
| 294 |
+
return true;
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
/**
|
| 298 |
+
* Retrieve authors from parsed WXR data
|
| 299 |
+
*
|
| 300 |
+
* Uses the provided author information from WXR 1.1 files
|
| 301 |
+
* or extracts info from each post for WXR 1.0 files
|
| 302 |
+
*
|
| 303 |
+
* @param array $import_data Data returned by a WXR parser
|
| 304 |
+
*/
|
| 305 |
+
function get_authors_from_import( $import_data ) {
|
| 306 |
+
if ( ! empty( $import_data['authors'] ) ) {
|
| 307 |
+
$this->authors = $import_data['authors'];
|
| 308 |
+
// no author information, grab it from the posts
|
| 309 |
+
} else {
|
| 310 |
+
foreach ( $import_data['posts'] as $post ) {
|
| 311 |
+
$login = sanitize_user( $post['post_author'], true );
|
| 312 |
+
if ( empty( $login ) ) {
|
| 313 |
+
printf( __( 'Failed to import author %s. Their posts will be attributed to the current user.', 'wordpress-importer' ), esc_html( $post['post_author'] ) );
|
| 314 |
+
echo '<br />';
|
| 315 |
+
continue;
|
| 316 |
+
}
|
| 317 |
+
|
| 318 |
+
if ( ! isset($this->authors[$login]) )
|
| 319 |
+
$this->authors[$login] = array(
|
| 320 |
+
'author_login' => $login,
|
| 321 |
+
'author_display_name' => $post['post_author']
|
| 322 |
+
);
|
| 323 |
+
}
|
| 324 |
+
}
|
| 325 |
+
}
|
| 326 |
+
|
| 327 |
+
/**
|
| 328 |
+
* Display pre-import options, author importing/mapping and option to
|
| 329 |
+
* fetch attachments
|
| 330 |
+
*/
|
| 331 |
+
function import_options() {
|
| 332 |
+
$j = 0;
|
| 333 |
+
?>
|
| 334 |
+
<form action="<?php echo admin_url( 'admin.php?import=wordpress&step=2' ); ?>" method="post">
|
| 335 |
+
<?php wp_nonce_field( 'import-wordpress' ); ?>
|
| 336 |
+
<input type="hidden" name="import_id" value="<?php echo $this->id; ?>" />
|
| 337 |
+
|
| 338 |
+
<?php if ( ! empty( $this->authors ) ) : ?>
|
| 339 |
+
<h3><?php _e( 'Assign Authors', 'wordpress-importer' ); ?></h3>
|
| 340 |
+
<p><?php _e( 'To make it simpler for you to edit and save the imported content, you may want to reassign the author of the imported item to an existing user of this site, such as your primary administrator account.', 'wordpress-importer' ); ?></p>
|
| 341 |
+
<?php if ( $this->allow_create_users() ) : ?>
|
| 342 |
+
<p><?php printf( __( 'If a new user is created by WordPress, a new password will be randomly generated and the new user’s role will be set as %s. Manually changing the new user’s details will be necessary.', 'wordpress-importer' ), esc_html( get_option('default_role') ) ); ?></p>
|
| 343 |
+
<?php endif; ?>
|
| 344 |
+
<ol id="authors">
|
| 345 |
+
<?php foreach ( $this->authors as $author ) : ?>
|
| 346 |
+
<li><?php $this->author_select( $j++, $author ); ?></li>
|
| 347 |
+
<?php endforeach; ?>
|
| 348 |
+
</ol>
|
| 349 |
+
<?php endif; ?>
|
| 350 |
+
|
| 351 |
+
<?php if ( $this->allow_fetch_attachments() ) : ?>
|
| 352 |
+
<h3><?php _e( 'Import Attachments', 'wordpress-importer' ); ?></h3>
|
| 353 |
+
<p>
|
| 354 |
+
<input type="checkbox" value="1" name="fetch_attachments" id="import-attachments" />
|
| 355 |
+
<label for="import-attachments"><?php _e( 'Download and import file attachments', 'wordpress-importer' ); ?></label>
|
| 356 |
+
</p>
|
| 357 |
+
<?php endif; ?>
|
| 358 |
+
|
| 359 |
+
<p class="submit"><input type="submit" class="button" value="<?php esc_attr_e( 'Submit', 'wordpress-importer' ); ?>" /></p>
|
| 360 |
+
</form>
|
| 361 |
+
<?php
|
| 362 |
+
}
|
| 363 |
+
|
| 364 |
+
/**
|
| 365 |
+
* Display import options for an individual author. That is, either create
|
| 366 |
+
* a new user based on import info or map to an existing user
|
| 367 |
+
*
|
| 368 |
+
* @param int $n Index for each author in the form
|
| 369 |
+
* @param array $author Author information, e.g. login, display name, email
|
| 370 |
+
*/
|
| 371 |
+
function author_select( $n, $author ) {
|
| 372 |
+
_e( 'Import author:', 'wordpress-importer' );
|
| 373 |
+
echo ' <strong>' . esc_html( $author['author_display_name'] );
|
| 374 |
+
if ( $this->version != '1.0' ) echo ' (' . esc_html( $author['author_login'] ) . ')';
|
| 375 |
+
echo '</strong><br />';
|
| 376 |
+
|
| 377 |
+
if ( $this->version != '1.0' )
|
| 378 |
+
echo '<div style="margin-left:18px">';
|
| 379 |
+
|
| 380 |
+
$create_users = $this->allow_create_users();
|
| 381 |
+
if ( $create_users ) {
|
| 382 |
+
if ( $this->version != '1.0' ) {
|
| 383 |
+
_e( 'or create new user with login name:', 'wordpress-importer' );
|
| 384 |
+
$value = '';
|
| 385 |
+
} else {
|
| 386 |
+
_e( 'as a new user:', 'wordpress-importer' );
|
| 387 |
+
$value = esc_attr( sanitize_user( $author['author_login'], true ) );
|
| 388 |
+
}
|
| 389 |
+
|
| 390 |
+
echo ' <input type="text" name="user_new['.$n.']" value="'. $value .'" /><br />';
|
| 391 |
+
}
|
| 392 |
+
|
| 393 |
+
if ( ! $create_users && $this->version == '1.0' ) {
|
| 394 |
+
_e( 'assign posts to an existing user:', 'wordpress-importer' );
|
| 395 |
+
} else {
|
| 396 |
+
_e( 'or assign posts to an existing user:', 'wordpress-importer' );
|
| 397 |
+
}
|
| 398 |
+
|
| 399 |
+
wp_dropdown_users( array(
|
| 400 |
+
'name' => "user_map[$n]",
|
| 401 |
+
'multi' => true,
|
| 402 |
+
'show_option_all' => __( '- Select -', 'wordpress-importer' ),
|
| 403 |
+
'show' => 'display_name_with_login',
|
| 404 |
+
) );
|
| 405 |
+
|
| 406 |
+
echo '<input type="hidden" name="imported_authors['.$n.']" value="' . esc_attr( $author['author_login'] ) . '" />';
|
| 407 |
+
|
| 408 |
+
if ( $this->version != '1.0' )
|
| 409 |
+
echo '</div>';
|
| 410 |
+
}
|
| 411 |
+
|
| 412 |
+
/**
|
| 413 |
+
* Map old author logins to local user IDs based on decisions made
|
| 414 |
+
* in import options form. Can map to an existing user, create a new user
|
| 415 |
+
* or falls back to the current user in case of error with either of the previous
|
| 416 |
+
*/
|
| 417 |
+
function get_author_mapping() {
|
| 418 |
+
if ( ! isset( $_POST['imported_authors'] ) )
|
| 419 |
+
return;
|
| 420 |
+
|
| 421 |
+
$create_users = $this->allow_create_users();
|
| 422 |
+
|
| 423 |
+
foreach ( (array) $_POST['imported_authors'] as $i => $old_login ) {
|
| 424 |
+
// Multisite adds strtolower to sanitize_user. Need to sanitize here to stop breakage in process_posts.
|
| 425 |
+
$santized_old_login = sanitize_user( $old_login, true );
|
| 426 |
+
$old_id = isset( $this->authors[$old_login]['author_id'] ) ? intval($this->authors[$old_login]['author_id']) : false;
|
| 427 |
+
|
| 428 |
+
if ( ! empty( $_POST['user_map'][$i] ) ) {
|
| 429 |
+
$user = get_userdata( intval($_POST['user_map'][$i]) );
|
| 430 |
+
if ( isset( $user->ID ) ) {
|
| 431 |
+
if ( $old_id )
|
| 432 |
+
$this->processed_authors[$old_id] = $user->ID;
|
| 433 |
+
$this->author_mapping[$santized_old_login] = $user->ID;
|
| 434 |
+
}
|
| 435 |
+
} else if ( $create_users ) {
|
| 436 |
+
if ( ! empty($_POST['user_new'][$i]) ) {
|
| 437 |
+
$user_id = wp_create_user( $_POST['user_new'][$i], wp_generate_password() );
|
| 438 |
+
} else if ( $this->version != '1.0' ) {
|
| 439 |
+
$user_data = array(
|
| 440 |
+
'user_login' => $old_login,
|
| 441 |
+
'user_pass' => wp_generate_password(),
|
| 442 |
+
'user_email' => isset( $this->authors[$old_login]['author_email'] ) ? $this->authors[$old_login]['author_email'] : '',
|
| 443 |
+
'display_name' => $this->authors[$old_login]['author_display_name'],
|
| 444 |
+
'first_name' => isset( $this->authors[$old_login]['author_first_name'] ) ? $this->authors[$old_login]['author_first_name'] : '',
|
| 445 |
+
'last_name' => isset( $this->authors[$old_login]['author_last_name'] ) ? $this->authors[$old_login]['author_last_name'] : '',
|
| 446 |
+
);
|
| 447 |
+
$user_id = wp_insert_user( $user_data );
|
| 448 |
+
}
|
| 449 |
+
|
| 450 |
+
if ( ! is_wp_error( $user_id ) ) {
|
| 451 |
+
if ( $old_id )
|
| 452 |
+
$this->processed_authors[$old_id] = $user_id;
|
| 453 |
+
$this->author_mapping[$santized_old_login] = $user_id;
|
| 454 |
+
} else {
|
| 455 |
+
printf( __( 'Failed to create new user for %s. Their posts will be attributed to the current user.', 'wordpress-importer' ), esc_html($this->authors[$old_login]['author_display_name']) );
|
| 456 |
+
if ( defined('IMPORT_DEBUG') && IMPORT_DEBUG )
|
| 457 |
+
echo ' ' . $user_id->get_error_message();
|
| 458 |
+
echo '<br />';
|
| 459 |
+
}
|
| 460 |
+
}
|
| 461 |
+
|
| 462 |
+
// failsafe: if the user_id was invalid, default to the current user
|
| 463 |
+
if ( ! isset( $this->author_mapping[$santized_old_login] ) ) {
|
| 464 |
+
if ( $old_id )
|
| 465 |
+
$this->processed_authors[$old_id] = (int) get_current_user_id();
|
| 466 |
+
$this->author_mapping[$santized_old_login] = (int) get_current_user_id();
|
| 467 |
+
}
|
| 468 |
+
}
|
| 469 |
+
}
|
| 470 |
+
|
| 471 |
+
/**
|
| 472 |
+
* Create new categories based on import information
|
| 473 |
+
*
|
| 474 |
+
* Doesn't create a new category if its slug already exists
|
| 475 |
+
*/
|
| 476 |
+
function process_categories() {
|
| 477 |
+
$this->categories = apply_filters( 'wp_import_categories', $this->categories );
|
| 478 |
+
|
| 479 |
+
if ( empty( $this->categories ) )
|
| 480 |
+
return;
|
| 481 |
+
|
| 482 |
+
foreach ( $this->categories as $cat ) {
|
| 483 |
+
// if the category already exists leave it alone
|
| 484 |
+
$term_id = term_exists( $cat['category_nicename'], 'category' );
|
| 485 |
+
if ( $term_id ) {
|
| 486 |
+
if ( is_array($term_id) ) $term_id = $term_id['term_id'];
|
| 487 |
+
if ( isset($cat['term_id']) )
|
| 488 |
+
$this->processed_terms[intval($cat['term_id'])] = (int) $term_id;
|
| 489 |
+
continue;
|
| 490 |
+
}
|
| 491 |
+
|
| 492 |
+
$category_parent = empty( $cat['category_parent'] ) ? 0 : category_exists( $cat['category_parent'] );
|
| 493 |
+
$category_description = isset( $cat['category_description'] ) ? $cat['category_description'] : '';
|
| 494 |
+
$catarr = array(
|
| 495 |
+
'category_nicename' => $cat['category_nicename'],
|
| 496 |
+
'category_parent' => $category_parent,
|
| 497 |
+
'cat_name' => $cat['cat_name'],
|
| 498 |
+
'category_description' => $category_description
|
| 499 |
+
);
|
| 500 |
+
$catarr = wp_slash( $catarr );
|
| 501 |
+
|
| 502 |
+
$id = wp_insert_category( $catarr );
|
| 503 |
+
if ( ! is_wp_error( $id ) && $id > 0 ) {
|
| 504 |
+
if ( isset($cat['term_id']) )
|
| 505 |
+
$this->processed_terms[intval($cat['term_id'])] = $id;
|
| 506 |
+
} else {
|
| 507 |
+
printf( __( 'Failed to import category %s', 'wordpress-importer' ), esc_html($cat['category_nicename']) );
|
| 508 |
+
if ( defined('IMPORT_DEBUG') && IMPORT_DEBUG )
|
| 509 |
+
echo ': ' . $id->get_error_message();
|
| 510 |
+
echo '<br />';
|
| 511 |
+
continue;
|
| 512 |
+
}
|
| 513 |
+
|
| 514 |
+
$this->process_termmeta( $cat, $id );
|
| 515 |
+
|
| 516 |
+
// TODO: added action
|
| 517 |
+
do_action('blocksy_wp_import_insert_term', $cat['term_id']);
|
| 518 |
+
}
|
| 519 |
+
|
| 520 |
+
unset( $this->categories );
|
| 521 |
+
}
|
| 522 |
+
|
| 523 |
+
/**
|
| 524 |
+
* Create new post tags based on import information
|
| 525 |
+
*
|
| 526 |
+
* Doesn't create a tag if its slug already exists
|
| 527 |
+
*/
|
| 528 |
+
function process_tags() {
|
| 529 |
+
$this->tags = apply_filters( 'wp_import_tags', $this->tags );
|
| 530 |
+
|
| 531 |
+
if ( empty( $this->tags ) )
|
| 532 |
+
return;
|
| 533 |
+
|
| 534 |
+
foreach ( $this->tags as $tag ) {
|
| 535 |
+
// if the tag already exists leave it alone
|
| 536 |
+
$term_id = term_exists( $tag['tag_slug'], 'post_tag' );
|
| 537 |
+
if ( $term_id ) {
|
| 538 |
+
if ( is_array($term_id) ) $term_id = $term_id['term_id'];
|
| 539 |
+
if ( isset($tag['term_id']) )
|
| 540 |
+
$this->processed_terms[intval($tag['term_id'])] = (int) $term_id;
|
| 541 |
+
continue;
|
| 542 |
+
}
|
| 543 |
+
|
| 544 |
+
$tag = wp_slash( $tag );
|
| 545 |
+
$tag_desc = isset( $tag['tag_description'] ) ? $tag['tag_description'] : '';
|
| 546 |
+
$tagarr = array( 'slug' => $tag['tag_slug'], 'description' => $tag_desc );
|
| 547 |
+
|
| 548 |
+
$id = wp_insert_term( $tag['tag_name'], 'post_tag', $tagarr );
|
| 549 |
+
if ( ! is_wp_error( $id ) ) {
|
| 550 |
+
if ( isset($tag['term_id']) )
|
| 551 |
+
$this->processed_terms[intval($tag['term_id'])] = $id['term_id'];
|
| 552 |
+
} else {
|
| 553 |
+
printf( __( 'Failed to import post tag %s', 'wordpress-importer' ), esc_html($tag['tag_name']) );
|
| 554 |
+
if ( defined('IMPORT_DEBUG') && IMPORT_DEBUG )
|
| 555 |
+
echo ': ' . $id->get_error_message();
|
| 556 |
+
echo '<br />';
|
| 557 |
+
continue;
|
| 558 |
+
}
|
| 559 |
+
|
| 560 |
+
$this->process_termmeta( $tag, $id['term_id'] );
|
| 561 |
+
|
| 562 |
+
// TODO: added action
|
| 563 |
+
do_action('blocksy_wp_import_insert_term', $id['term_id']);
|
| 564 |
+
}
|
| 565 |
+
|
| 566 |
+
unset( $this->tags );
|
| 567 |
+
}
|
| 568 |
+
|
| 569 |
+
/**
|
| 570 |
+
* Create new terms based on import information
|
| 571 |
+
*
|
| 572 |
+
* Doesn't create a term its slug already exists
|
| 573 |
+
*/
|
| 574 |
+
function process_terms() {
|
| 575 |
+
$this->terms = apply_filters( 'wp_import_terms', $this->terms );
|
| 576 |
+
|
| 577 |
+
if ( empty( $this->terms ) )
|
| 578 |
+
return;
|
| 579 |
+
|
| 580 |
+
foreach ( $this->terms as $term ) {
|
| 581 |
+
// if the term already exists in the correct taxonomy leave it alone
|
| 582 |
+
$term_id = term_exists( $term['slug'], $term['term_taxonomy'] );
|
| 583 |
+
|
| 584 |
+
if ( $term_id ) {
|
| 585 |
+
if ( is_array($term_id) ) $term_id = $term_id['term_id'];
|
| 586 |
+
if ( isset($term['term_id']) )
|
| 587 |
+
$this->processed_terms[intval($term['term_id'])] = (int) $term_id;
|
| 588 |
+
continue;
|
| 589 |
+
}
|
| 590 |
+
|
| 591 |
+
if ( empty( $term['term_parent'] ) ) {
|
| 592 |
+
$parent = 0;
|
| 593 |
+
} else {
|
| 594 |
+
$parent = term_exists( $term['term_parent'], $term['term_taxonomy'] );
|
| 595 |
+
if ( is_array( $parent ) ) $parent = $parent['term_id'];
|
| 596 |
+
}
|
| 597 |
+
$term = wp_slash( $term );
|
| 598 |
+
$description = isset( $term['term_description'] ) ? $term['term_description'] : '';
|
| 599 |
+
$termarr = array( 'slug' => $term['slug'], 'description' => $description, 'parent' => intval($parent) );
|
| 600 |
+
|
| 601 |
+
$id = wp_insert_term( $term['term_name'], $term['term_taxonomy'], $termarr );
|
| 602 |
+
if ( ! is_wp_error( $id ) ) {
|
| 603 |
+
if ( isset($term['term_id']) )
|
| 604 |
+
$this->processed_terms[intval($term['term_id'])] = $id['term_id'];
|
| 605 |
+
} else {
|
| 606 |
+
printf( __( 'Failed to import %s %s', 'wordpress-importer' ), esc_html($term['term_taxonomy']), esc_html($term['term_name']) );
|
| 607 |
+
if ( defined('IMPORT_DEBUG') && IMPORT_DEBUG )
|
| 608 |
+
echo ': ' . $id->get_error_message();
|
| 609 |
+
echo '<br />';
|
| 610 |
+
continue;
|
| 611 |
+
}
|
| 612 |
+
|
| 613 |
+
$this->process_termmeta( $term, $id['term_id'] );
|
| 614 |
+
|
| 615 |
+
// TODO: added action
|
| 616 |
+
do_action('blocksy_wp_import_insert_term', $id['term_id']);
|
| 617 |
+
}
|
| 618 |
+
|
| 619 |
+
unset( $this->terms );
|
| 620 |
+
}
|
| 621 |
+
|
| 622 |
+
/**
|
| 623 |
+
* Add metadata to imported term.
|
| 624 |
+
*
|
| 625 |
+
* @since 0.6.2
|
| 626 |
+
*
|
| 627 |
+
* @param array $term Term data from WXR import.
|
| 628 |
+
* @param int $term_id ID of the newly created term.
|
| 629 |
+
*/
|
| 630 |
+
protected function process_termmeta( $term, $term_id ) {
|
| 631 |
+
if ( ! isset( $term['termmeta'] ) ) {
|
| 632 |
+
$term['termmeta'] = array();
|
| 633 |
+
}
|
| 634 |
+
|
| 635 |
+
/**
|
| 636 |
+
* Filters the metadata attached to an imported term.
|
| 637 |
+
*
|
| 638 |
+
* @since 0.6.2
|
| 639 |
+
*
|
| 640 |
+
* @param array $termmeta Array of term meta.
|
| 641 |
+
* @param int $term_id ID of the newly created term.
|
| 642 |
+
* @param array $term Term data from the WXR import.
|
| 643 |
+
*/
|
| 644 |
+
$term['termmeta'] = apply_filters( 'wp_import_term_meta', $term['termmeta'], $term_id, $term );
|
| 645 |
+
|
| 646 |
+
if ( empty( $term['termmeta'] ) ) {
|
| 647 |
+
return;
|
| 648 |
+
}
|
| 649 |
+
|
| 650 |
+
foreach ( $term['termmeta'] as $meta ) {
|
| 651 |
+
/**
|
| 652 |
+
* Filters the meta key for an imported piece of term meta.
|
| 653 |
+
*
|
| 654 |
+
* @since 0.6.2
|
| 655 |
+
*
|
| 656 |
+
* @param string $meta_key Meta key.
|
| 657 |
+
* @param int $term_id ID of the newly created term.
|
| 658 |
+
* @param array $term Term data from the WXR import.
|
| 659 |
+
*/
|
| 660 |
+
$key = apply_filters( 'import_term_meta_key', $meta['key'], $term_id, $term );
|
| 661 |
+
if ( ! $key ) {
|
| 662 |
+
continue;
|
| 663 |
+
}
|
| 664 |
+
|
| 665 |
+
// Export gets meta straight from the DB so could have a serialized string
|
| 666 |
+
$value = maybe_unserialize( $meta['value'] );
|
| 667 |
+
|
| 668 |
+
add_term_meta($term_id, wp_slash($key), $value);
|
| 669 |
+
|
| 670 |
+
/**
|
| 671 |
+
* Fires after term meta is imported.
|
| 672 |
+
*
|
| 673 |
+
* @since 0.6.2
|
| 674 |
+
*
|
| 675 |
+
* @param int $term_id ID of the newly created term.
|
| 676 |
+
* @param string $key Meta key.
|
| 677 |
+
* @param mixed $value Meta value.
|
| 678 |
+
*/
|
| 679 |
+
do_action( 'import_term_meta', $term_id, $key, $value );
|
| 680 |
+
}
|
| 681 |
+
}
|
| 682 |
+
|
| 683 |
+
/**
|
| 684 |
+
* Create new posts based on import information
|
| 685 |
+
*
|
| 686 |
+
* Posts marked as having a parent which doesn't exist will become top level items.
|
| 687 |
+
* Doesn't create a new post if: the post type doesn't exist, the given post ID
|
| 688 |
+
* is already noted as imported or a post with the same title and date already exists.
|
| 689 |
+
* Note that new/updated terms, comments and meta are imported for the last of the above.
|
| 690 |
+
*/
|
| 691 |
+
function process_posts() {
|
| 692 |
+
$this->posts = apply_filters( 'wp_import_posts', $this->posts );
|
| 693 |
+
|
| 694 |
+
foreach ( $this->posts as $post ) {
|
| 695 |
+
$post = apply_filters( 'wp_import_post_data_raw', $post );
|
| 696 |
+
|
| 697 |
+
if ( ! post_type_exists( $post['post_type'] ) ) {
|
| 698 |
+
printf( __( 'Failed to import “%s”: Invalid post type %s', 'wordpress-importer' ),
|
| 699 |
+
esc_html($post['post_title']), esc_html($post['post_type']) );
|
| 700 |
+
echo '<br />';
|
| 701 |
+
do_action( 'wp_import_post_exists', $post );
|
| 702 |
+
continue;
|
| 703 |
+
}
|
| 704 |
+
|
| 705 |
+
if ( isset( $this->processed_posts[$post['post_id']] ) && ! empty( $post['post_id'] ) )
|
| 706 |
+
continue;
|
| 707 |
+
|
| 708 |
+
if ( $post['status'] == 'auto-draft' )
|
| 709 |
+
continue;
|
| 710 |
+
|
| 711 |
+
if ( 'nav_menu_item' == $post['post_type'] ) {
|
| 712 |
+
$this->process_menu_item( $post );
|
| 713 |
+
continue;
|
| 714 |
+
}
|
| 715 |
+
|
| 716 |
+
$post_type_object = get_post_type_object( $post['post_type'] );
|
| 717 |
+
|
| 718 |
+
$post_exists = post_exists( $post['post_title'], '', $post['post_date'] );
|
| 719 |
+
|
| 720 |
+
/**
|
| 721 |
+
* Filter ID of the existing post corresponding to post currently importing.
|
| 722 |
+
*
|
| 723 |
+
* Return 0 to force the post to be imported. Filter the ID to be something else
|
| 724 |
+
* to override which existing post is mapped to the imported post.
|
| 725 |
+
*
|
| 726 |
+
* @see post_exists()
|
| 727 |
+
* @since 0.6.2
|
| 728 |
+
*
|
| 729 |
+
* @param int $post_exists Post ID, or 0 if post did not exist.
|
| 730 |
+
* @param array $post The post array to be inserted.
|
| 731 |
+
*/
|
| 732 |
+
if ($post['post_type'] !== 'brizy-project') {
|
| 733 |
+
$post_exists = apply_filters( 'wp_import_existing_post', $post_exists, $post );
|
| 734 |
+
} else {
|
| 735 |
+
if (class_exists('Brizy_Editor_Project')) {
|
| 736 |
+
$currentProject = Brizy_Editor_Project::get();
|
| 737 |
+
$currentProjectGlobals = $currentProject->getDecodedData();
|
| 738 |
+
$currentProjectPostId = $currentProject->getWpPost()->ID;
|
| 739 |
+
$currentProjectStorage = Brizy_Editor_Storage_Project::instance( $currentProjectPostId );
|
| 740 |
+
|
| 741 |
+
$projectMeta = null;
|
| 742 |
+
|
| 743 |
+
foreach ( $post['postmeta'] as $meta ) {
|
| 744 |
+
if ( $meta['key'] == 'brizy-project' ) {
|
| 745 |
+
$projectMeta = maybe_unserialize( $meta['value'] );
|
| 746 |
+
break;
|
| 747 |
+
}
|
| 748 |
+
}
|
| 749 |
+
|
| 750 |
+
if ($projectMeta) {
|
| 751 |
+
$projectData = json_decode( base64_decode( $projectMeta['data'] ) );
|
| 752 |
+
|
| 753 |
+
// create project data backup
|
| 754 |
+
$data = $currentProjectStorage->get_storage();
|
| 755 |
+
update_post_meta( $currentProjectPostId, 'brizy-project-import-backup-' . md5( time() ), $data );
|
| 756 |
+
//---------------------------------------------------------
|
| 757 |
+
|
| 758 |
+
$currentProject->setDataAsJson( json_encode( $projectData ) );
|
| 759 |
+
$currentProject->saveStorage();
|
| 760 |
+
|
| 761 |
+
$post_exists = $currentProjectPostId;
|
| 762 |
+
}
|
| 763 |
+
}
|
| 764 |
+
}
|
| 765 |
+
|
| 766 |
+
if ( $post_exists && get_post_type( $post_exists ) == $post['post_type'] ) {
|
| 767 |
+
printf( __('%s “%s” already exists.', 'wordpress-importer'), $post_type_object->labels->singular_name, esc_html($post['post_title']) );
|
| 768 |
+
echo '<br />';
|
| 769 |
+
$comment_post_ID = $post_id = $post_exists;
|
| 770 |
+
$this->processed_posts[ intval( $post['post_id'] ) ] = intval( $post_exists );
|
| 771 |
+
} else {
|
| 772 |
+
$post_parent = (int) $post['post_parent'];
|
| 773 |
+
if ( $post_parent ) {
|
| 774 |
+
// if we already know the parent, map it to the new local ID
|
| 775 |
+
if ( isset( $this->processed_posts[$post_parent] ) ) {
|
| 776 |
+
$post_parent = $this->processed_posts[$post_parent];
|
| 777 |
+
// otherwise record the parent for later
|
| 778 |
+
} else {
|
| 779 |
+
$this->post_orphans[intval($post['post_id'])] = $post_parent;
|
| 780 |
+
$post_parent = 0;
|
| 781 |
+
}
|
| 782 |
+
}
|
| 783 |
+
|
| 784 |
+
// map the post author
|
| 785 |
+
$author = sanitize_user( $post['post_author'], true );
|
| 786 |
+
if ( isset( $this->author_mapping[$author] ) )
|
| 787 |
+
$author = $this->author_mapping[$author];
|
| 788 |
+
else
|
| 789 |
+
$author = (int) get_current_user_id();
|
| 790 |
+
|
| 791 |
+
$postdata = array(
|
| 792 |
+
'import_id' => $post['post_id'], 'post_author' => $author, 'post_date' => $post['post_date'],
|
| 793 |
+
'post_date_gmt' => $post['post_date_gmt'], 'post_content' => $post['post_content'],
|
| 794 |
+
'post_excerpt' => $post['post_excerpt'], 'post_title' => $post['post_title'],
|
| 795 |
+
'post_status' => $post['status'], 'post_name' => $post['post_name'],
|
| 796 |
+
'comment_status' => $post['comment_status'], 'ping_status' => $post['ping_status'],
|
| 797 |
+
'guid' => $post['guid'], 'post_parent' => $post_parent, 'menu_order' => $post['menu_order'],
|
| 798 |
+
'post_type' => $post['post_type'], 'post_password' => $post['post_password']
|
| 799 |
+
);
|
| 800 |
+
|
| 801 |
+
$original_post_ID = $post['post_id'];
|
| 802 |
+
$postdata = apply_filters( 'wp_import_post_data_processed', $postdata, $post );
|
| 803 |
+
|
| 804 |
+
$postdata = wp_slash( $postdata );
|
| 805 |
+
|
| 806 |
+
if ( 'attachment' == $postdata['post_type'] ) {
|
| 807 |
+
$remote_url = ! empty($post['attachment_url']) ? $post['attachment_url'] : $post['guid'];
|
| 808 |
+
|
| 809 |
+
// try to use _wp_attached file for upload folder placement to ensure the same location as the export site
|
| 810 |
+
// e.g. location is 2003/05/image.jpg but the attachment post_date is 2010/09, see media_handle_upload()
|
| 811 |
+
$postdata['upload_date'] = $post['post_date'];
|
| 812 |
+
if ( isset( $post['postmeta'] ) ) {
|
| 813 |
+
foreach( $post['postmeta'] as $meta ) {
|
| 814 |
+
if ( $meta['key'] == '_wp_attached_file' ) {
|
| 815 |
+
if ( preg_match( '%^[0-9]{4}/[0-9]{2}%', $meta['value'], $matches ) )
|
| 816 |
+
$postdata['upload_date'] = $matches[0];
|
| 817 |
+
break;
|
| 818 |
+
}
|
| 819 |
+
}
|
| 820 |
+
}
|
| 821 |
+
|
| 822 |
+
$comment_post_ID = $post_id = $this->process_attachment( $postdata, $remote_url );
|
| 823 |
+
} else {
|
| 824 |
+
$comment_post_ID = $post_id = wp_insert_post( $postdata, true );
|
| 825 |
+
do_action( 'wp_import_insert_post', $post_id, $original_post_ID, $postdata, $post );
|
| 826 |
+
}
|
| 827 |
+
|
| 828 |
+
if ( is_wp_error( $post_id ) ) {
|
| 829 |
+
printf( __( 'Failed to import %s “%s”', 'wordpress-importer' ),
|
| 830 |
+
$post_type_object->labels->singular_name, esc_html($post['post_title']) );
|
| 831 |
+
if ( defined('IMPORT_DEBUG') && IMPORT_DEBUG )
|
| 832 |
+
echo ': ' . $post_id->get_error_message();
|
| 833 |
+
echo '<br />';
|
| 834 |
+
continue;
|
| 835 |
+
}
|
| 836 |
+
|
| 837 |
+
if ( $post['is_sticky'] == 1 )
|
| 838 |
+
stick_post( $post_id );
|
| 839 |
+
}
|
| 840 |
+
|
| 841 |
+
// map pre-import ID to local ID
|
| 842 |
+
$this->processed_posts[intval($post['post_id'])] = (int) $post_id;
|
| 843 |
+
|
| 844 |
+
if ( ! isset( $post['terms'] ) )
|
| 845 |
+
$post['terms'] = array();
|
| 846 |
+
|
| 847 |
+
$post['terms'] = apply_filters( 'wp_import_post_terms', $post['terms'], $post_id, $post );
|
| 848 |
+
|
| 849 |
+
// add categories, tags and other terms
|
| 850 |
+
if ( ! empty( $post['terms'] ) ) {
|
| 851 |
+
$terms_to_set = array();
|
| 852 |
+
foreach ( $post['terms'] as $term ) {
|
| 853 |
+
// back compat with WXR 1.0 map 'tag' to 'post_tag'
|
| 854 |
+
$taxonomy = ( 'tag' == $term['domain'] ) ? 'post_tag' : $term['domain'];
|
| 855 |
+
$term_exists = term_exists( $term['slug'], $taxonomy );
|
| 856 |
+
$term_id = is_array( $term_exists ) ? $term_exists['term_id'] : $term_exists;
|
| 857 |
+
if ( ! $term_id ) {
|
| 858 |
+
$t = wp_insert_term( $term['name'], $taxonomy, array( 'slug' => $term['slug'] ) );
|
| 859 |
+
if ( ! is_wp_error( $t ) ) {
|
| 860 |
+
$term_id = $t['term_id'];
|
| 861 |
+
do_action( 'wp_import_insert_term', $t, $term, $post_id, $post );
|
| 862 |
+
} else {
|
| 863 |
+
printf( __( 'Failed to import %s %s', 'wordpress-importer' ), esc_html($taxonomy), esc_html($term['name']) );
|
| 864 |
+
if ( defined('IMPORT_DEBUG') && IMPORT_DEBUG )
|
| 865 |
+
echo ': ' . $t->get_error_message();
|
| 866 |
+
echo '<br />';
|
| 867 |
+
do_action( 'wp_import_insert_term_failed', $t, $term, $post_id, $post );
|
| 868 |
+
continue;
|
| 869 |
+
}
|
| 870 |
+
}
|
| 871 |
+
$terms_to_set[$taxonomy][] = intval( $term_id );
|
| 872 |
+
}
|
| 873 |
+
|
| 874 |
+
foreach ( $terms_to_set as $tax => $ids ) {
|
| 875 |
+
$tt_ids = wp_set_post_terms( $post_id, $ids, $tax );
|
| 876 |
+
do_action( 'wp_import_set_post_terms', $tt_ids, $ids, $tax, $post_id, $post );
|
| 877 |
+
}
|
| 878 |
+
unset( $post['terms'], $terms_to_set );
|
| 879 |
+
}
|
| 880 |
+
|
| 881 |
+
if ( ! isset( $post['comments'] ) )
|
| 882 |
+
$post['comments'] = array();
|
| 883 |
+
|
| 884 |
+
$post['comments'] = apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post );
|
| 885 |
+
|
| 886 |
+
// add/update comments
|
| 887 |
+
if ( ! empty( $post['comments'] ) ) {
|
| 888 |
+
$num_comments = 0;
|
| 889 |
+
$inserted_comments = array();
|
| 890 |
+
foreach ( $post['comments'] as $comment ) {
|
| 891 |
+
$comment_id = $comment['comment_id'];
|
| 892 |
+
$newcomments[$comment_id]['comment_post_ID'] = $comment_post_ID;
|
| 893 |
+
$newcomments[$comment_id]['comment_author'] = $comment['comment_author'];
|
| 894 |
+
$newcomments[$comment_id]['comment_author_email'] = $comment['comment_author_email'];
|
| 895 |
+
$newcomments[$comment_id]['comment_author_IP'] = $comment['comment_author_IP'];
|
| 896 |
+
$newcomments[$comment_id]['comment_author_url'] = $comment['comment_author_url'];
|
| 897 |
+
$newcomments[$comment_id]['comment_date'] = $comment['comment_date'];
|
| 898 |
+
$newcomments[$comment_id]['comment_date_gmt'] = $comment['comment_date_gmt'];
|
| 899 |
+
$newcomments[$comment_id]['comment_content'] = $comment['comment_content'];
|
| 900 |
+
$newcomments[$comment_id]['comment_approved'] = $comment['comment_approved'];
|
| 901 |
+
$newcomments[$comment_id]['comment_type'] = $comment['comment_type'];
|
| 902 |
+
$newcomments[$comment_id]['comment_parent'] = $comment['comment_parent'];
|
| 903 |
+
$newcomments[$comment_id]['commentmeta'] = isset( $comment['commentmeta'] ) ? $comment['commentmeta'] : array();
|
| 904 |
+
if ( isset( $this->processed_authors[$comment['comment_user_id']] ) )
|
| 905 |
+
$newcomments[$comment_id]['user_id'] = $this->processed_authors[$comment['comment_user_id']];
|
| 906 |
+
}
|
| 907 |
+
ksort( $newcomments );
|
| 908 |
+
|
| 909 |
+
foreach ( $newcomments as $key => $comment ) {
|
| 910 |
+
// if this is a new post we can skip the comment_exists() check
|
| 911 |
+
if ( ! $post_exists || ! comment_exists( $comment['comment_author'], $comment['comment_date'] ) ) {
|
| 912 |
+
if ( isset( $inserted_comments[$comment['comment_parent']] ) )
|
| 913 |
+
$comment['comment_parent'] = $inserted_comments[$comment['comment_parent']];
|
| 914 |
+
$comment = wp_slash( $comment );
|
| 915 |
+
$comment = wp_filter_comment( $comment );
|
| 916 |
+
$inserted_comments[$key] = wp_insert_comment( $comment );
|
| 917 |
+
do_action( 'wp_import_insert_comment', $inserted_comments[$key], $comment, $comment_post_ID, $post );
|
| 918 |
+
|
| 919 |
+
foreach( $comment['commentmeta'] as $meta ) {
|
| 920 |
+
$value = maybe_unserialize( $meta['value'] );
|
| 921 |
+
add_comment_meta( $inserted_comments[$key], $meta['key'], $value );
|
| 922 |
+
}
|
| 923 |
+
|
| 924 |
+
$num_comments++;
|
| 925 |
+
}
|
| 926 |
+
}
|
| 927 |
+
unset( $newcomments, $inserted_comments, $post['comments'] );
|
| 928 |
+
}
|
| 929 |
+
|
| 930 |
+
if ( ! isset( $post['postmeta'] ) )
|
| 931 |
+
$post['postmeta'] = array();
|
| 932 |
+
|
| 933 |
+
$post['postmeta'] = apply_filters( 'wp_import_post_meta', $post['postmeta'], $post_id, $post );
|
| 934 |
+
|
| 935 |
+
// add/update post meta
|
| 936 |
+
if ( ! empty( $post['postmeta'] ) ) {
|
| 937 |
+
foreach ( $post['postmeta'] as $meta ) {
|
| 938 |
+
$key = apply_filters( 'import_post_meta_key', $meta['key'], $post_id, $post );
|
| 939 |
+
$value = false;
|
| 940 |
+
|
| 941 |
+
if ( '_edit_last' == $key ) {
|
| 942 |
+
if ( isset( $this->processed_authors[intval($meta['value'])] ) )
|
| 943 |
+
$value = $this->processed_authors[intval($meta['value'])];
|
| 944 |
+
else
|
| 945 |
+
$key = false;
|
| 946 |
+
}
|
| 947 |
+
|
| 948 |
+
if ( $key ) {
|
| 949 |
+
// export gets meta straight from the DB so could have a serialized string
|
| 950 |
+
if (! $value) {
|
| 951 |
+
$value = maybe_unserialize( $meta['value'] );
|
| 952 |
+
}
|
| 953 |
+
|
| 954 |
+
// add_post_meta($post_id, wp_slash($key), wp_slash_strings_only($value));
|
| 955 |
+
add_post_meta($post_id, wp_slash($key), $value);
|
| 956 |
+
|
| 957 |
+
do_action('import_post_meta', $post_id, $key, $value);
|
| 958 |
+
|
| 959 |
+
// if the post has a featured image, take note of this in case of remap
|
| 960 |
+
if ( '_thumbnail_id' == $key )
|
| 961 |
+
$this->featured_images[$post_id] = (int) $value;
|
| 962 |
+
}
|
| 963 |
+
}
|
| 964 |
+
}
|
| 965 |
+
}
|
| 966 |
+
|
| 967 |
+
unset( $this->posts );
|
| 968 |
+
}
|
| 969 |
+
|
| 970 |
+
/**
|
| 971 |
+
* Attempt to create a new menu item from import data
|
| 972 |
+
*
|
| 973 |
+
* Fails for draft, orphaned menu items and those without an associated nav_menu
|
| 974 |
+
* or an invalid nav_menu term. If the post type or term object which the menu item
|
| 975 |
+
* represents doesn't exist then the menu item will not be imported (waits until the
|
| 976 |
+
* end of the import to retry again before discarding).
|
| 977 |
+
*
|
| 978 |
+
* @param array $item Menu item details from WXR file
|
| 979 |
+
*/
|
| 980 |
+
function process_menu_item( $item ) {
|
| 981 |
+
// skip draft, orphaned menu items
|
| 982 |
+
if ( 'draft' == $item['status'] )
|
| 983 |
+
return;
|
| 984 |
+
|
| 985 |
+
$menu_slug = false;
|
| 986 |
+
if ( isset($item['terms']) ) {
|
| 987 |
+
// loop through terms, assume first nav_menu term is correct menu
|
| 988 |
+
foreach ( $item['terms'] as $term ) {
|
| 989 |
+
if ( 'nav_menu' == $term['domain'] ) {
|
| 990 |
+
$menu_slug = $term['slug'];
|
| 991 |
+
break;
|
| 992 |
+
}
|
| 993 |
+
}
|
| 994 |
+
}
|
| 995 |
+
|
| 996 |
+
// no nav_menu term associated with this menu item
|
| 997 |
+
if ( ! $menu_slug ) {
|
| 998 |
+
_e( 'Menu item skipped due to missing menu slug', 'wordpress-importer' );
|
| 999 |
+
echo '<br />';
|
| 1000 |
+
return;
|
| 1001 |
+
}
|
| 1002 |
+
|
| 1003 |
+
$menu_id = term_exists( $menu_slug, 'nav_menu' );
|
| 1004 |
+
if ( ! $menu_id ) {
|
| 1005 |
+
printf( __( 'Menu item skipped due to invalid menu slug: %s', 'wordpress-importer' ), esc_html( $menu_slug ) );
|
| 1006 |
+
echo '<br />';
|
| 1007 |
+
return;
|
| 1008 |
+
} else {
|
| 1009 |
+
$menu_id = is_array( $menu_id ) ? $menu_id['term_id'] : $menu_id;
|
| 1010 |
+
}
|
| 1011 |
+
|
| 1012 |
+
foreach ( $item['postmeta'] as $meta )
|
| 1013 |
+
${$meta['key']} = $meta['value'];
|
| 1014 |
+
|
| 1015 |
+
if ( 'taxonomy' == $_menu_item_type && isset( $this->processed_terms[intval($_menu_item_object_id)] ) ) {
|
| 1016 |
+
$_menu_item_object_id = $this->processed_terms[intval($_menu_item_object_id)];
|
| 1017 |
+
} else if ( 'post_type' == $_menu_item_type && isset( $this->processed_posts[intval($_menu_item_object_id)] ) ) {
|
| 1018 |
+
$_menu_item_object_id = $this->processed_posts[intval($_menu_item_object_id)];
|
| 1019 |
+
} else if ( 'custom' != $_menu_item_type ) {
|
| 1020 |
+
// associated object is missing or not imported yet, we'll retry later
|
| 1021 |
+
$this->missing_menu_items[] = $item;
|
| 1022 |
+
return;
|
| 1023 |
+
}
|
| 1024 |
+
|
| 1025 |
+
if ( isset( $this->processed_menu_items[intval($_menu_item_menu_item_parent)] ) ) {
|
| 1026 |
+
$_menu_item_menu_item_parent = $this->processed_menu_items[intval($_menu_item_menu_item_parent)];
|
| 1027 |
+
} else if ( $_menu_item_menu_item_parent ) {
|
| 1028 |
+
$this->menu_item_orphans[intval($item['post_id'])] = (int) $_menu_item_menu_item_parent;
|
| 1029 |
+
$_menu_item_menu_item_parent = 0;
|
| 1030 |
+
}
|
| 1031 |
+
|
| 1032 |
+
// wp_update_nav_menu_item expects CSS classes as a space separated string
|
| 1033 |
+
$_menu_item_classes = maybe_unserialize( $_menu_item_classes );
|
| 1034 |
+
if ( is_array( $_menu_item_classes ) )
|
| 1035 |
+
$_menu_item_classes = implode( ' ', $_menu_item_classes );
|
| 1036 |
+
|
| 1037 |
+
$args = array(
|
| 1038 |
+
'menu-item-object-id' => $_menu_item_object_id,
|
| 1039 |
+
'menu-item-object' => $_menu_item_object,
|
| 1040 |
+
'menu-item-parent-id' => $_menu_item_menu_item_parent,
|
| 1041 |
+
'menu-item-position' => intval( $item['menu_order'] ),
|
| 1042 |
+
'menu-item-type' => $_menu_item_type,
|
| 1043 |
+
'menu-item-title' => $item['post_title'],
|
| 1044 |
+
'menu-item-url' => $_menu_item_url,
|
| 1045 |
+
'menu-item-description' => $item['post_content'],
|
| 1046 |
+
'menu-item-attr-title' => $item['post_excerpt'],
|
| 1047 |
+
'menu-item-target' => $_menu_item_target,
|
| 1048 |
+
'menu-item-classes' => $_menu_item_classes,
|
| 1049 |
+
'menu-item-xfn' => $_menu_item_xfn,
|
| 1050 |
+
'menu-item-status' => $item['status']
|
| 1051 |
+
);
|
| 1052 |
+
|
| 1053 |
+
$id = wp_update_nav_menu_item( $menu_id, 0, $args );
|
| 1054 |
+
if ( $id && ! is_wp_error( $id ) )
|
| 1055 |
+
$this->processed_menu_items[intval($item['post_id'])] = (int) $id;
|
| 1056 |
+
}
|
| 1057 |
+
|
| 1058 |
+
/**
|
| 1059 |
+
* If fetching attachments is enabled then attempt to create a new attachment
|
| 1060 |
+
*
|
| 1061 |
+
* @param array $post Attachment post details from WXR
|
| 1062 |
+
* @param string $url URL to fetch attachment from
|
| 1063 |
+
* @return int|WP_Error Post ID on success, WP_Error otherwise
|
| 1064 |
+
*/
|
| 1065 |
+
function process_attachment( $post, $url ) {
|
| 1066 |
+
if ( ! $this->fetch_attachments )
|
| 1067 |
+
return new WP_Error( 'attachment_processing_error',
|
| 1068 |
+
__( 'Fetching attachments is not enabled', 'wordpress-importer' ) );
|
| 1069 |
+
|
| 1070 |
+
// if the URL is absolute, but does not contain address, then upload it assuming base_site_url
|
| 1071 |
+
if ( preg_match( '|^/[\w\W]+$|', $url ) )
|
| 1072 |
+
$url = rtrim( $this->base_url, '/' ) . $url;
|
| 1073 |
+
|
| 1074 |
+
$upload = $this->fetch_remote_file( $url, $post );
|
| 1075 |
+
if ( is_wp_error( $upload ) )
|
| 1076 |
+
return $upload;
|
| 1077 |
+
|
| 1078 |
+
if ( $info = wp_check_filetype( $upload['file'] ) )
|
| 1079 |
+
$post['post_mime_type'] = $info['type'];
|
| 1080 |
+
else
|
| 1081 |
+
return new WP_Error( 'attachment_processing_error', __('Invalid file type', 'wordpress-importer') );
|
| 1082 |
+
|
| 1083 |
+
$post['guid'] = $upload['url'];
|
| 1084 |
+
|
| 1085 |
+
// as per wp-admin/includes/upload.php
|
| 1086 |
+
$post_id = wp_insert_attachment( $post, $upload['file'] );
|
| 1087 |
+
wp_update_attachment_metadata( $post_id, wp_generate_attachment_metadata( $post_id, $upload['file'] ) );
|
| 1088 |
+
|
| 1089 |
+
// remap resized image URLs, works by stripping the extension and remapping the URL stub.
|
| 1090 |
+
if ( preg_match( '!^image/!', $info['type'] ) ) {
|
| 1091 |
+
$parts = pathinfo( $url );
|
| 1092 |
+
$name = basename( $parts['basename'], ".{$parts['extension']}" ); // PATHINFO_FILENAME in PHP 5.2
|
| 1093 |
+
|
| 1094 |
+
$parts_new = pathinfo( $upload['url'] );
|
| 1095 |
+
$name_new = basename( $parts_new['basename'], ".{$parts_new['extension']}" );
|
| 1096 |
+
|
| 1097 |
+
$this->url_remap[$parts['dirname'] . '/' . $name] = $parts_new['dirname'] . '/' . $name_new;
|
| 1098 |
+
}
|
| 1099 |
+
|
| 1100 |
+
return $post_id;
|
| 1101 |
+
}
|
| 1102 |
+
|
| 1103 |
+
/**
|
| 1104 |
+
* Attempt to download a remote file attachment
|
| 1105 |
+
*
|
| 1106 |
+
* @param string $url URL of item to fetch
|
| 1107 |
+
* @param array $post Attachment details
|
| 1108 |
+
* @return array|WP_Error Local file location details on success, WP_Error otherwise
|
| 1109 |
+
*/
|
| 1110 |
+
function fetch_remote_file( $url, $post ) {
|
| 1111 |
+
// extract the file name and extension from the url
|
| 1112 |
+
$file_name = basename( $url );
|
| 1113 |
+
|
| 1114 |
+
// get placeholder file in the upload dir with a unique, sanitized filename
|
| 1115 |
+
$upload = wp_upload_bits( $file_name, 0, '', $post['upload_date'] );
|
| 1116 |
+
if ( $upload['error'] )
|
| 1117 |
+
return new WP_Error( 'upload_dir_error', $upload['error'] );
|
| 1118 |
+
|
| 1119 |
+
// fetch the remote url and write it to the placeholder file
|
| 1120 |
+
$remote_response = wp_safe_remote_get( $url, array(
|
| 1121 |
+
'timeout' => 300,
|
| 1122 |
+
'stream' => true,
|
| 1123 |
+
'filename' => $upload['file'],
|
| 1124 |
+
) );
|
| 1125 |
+
|
| 1126 |
+
$headers = wp_remote_retrieve_headers( $remote_response );
|
| 1127 |
+
|
| 1128 |
+
// request failed
|
| 1129 |
+
if ( ! $headers ) {
|
| 1130 |
+
@unlink( $upload['file'] );
|
| 1131 |
+
return new WP_Error( 'import_file_error', __('Remote server did not respond', 'wordpress-importer') );
|
| 1132 |
+
}
|
| 1133 |
+
|
| 1134 |
+
$remote_response_code = wp_remote_retrieve_response_code( $remote_response );
|
| 1135 |
+
|
| 1136 |
+
// make sure the fetch was successful
|
| 1137 |
+
if ( $remote_response_code != '200' ) {
|
| 1138 |
+
@unlink( $upload['file'] );
|
| 1139 |
+
return new WP_Error( 'import_file_error', sprintf( __('Remote server returned error response %1$d %2$s', 'wordpress-importer'), esc_html($remote_response_code), get_status_header_desc($remote_response_code) ) );
|
| 1140 |
+
}
|
| 1141 |
+
|
| 1142 |
+
$filesize = filesize( $upload['file'] );
|
| 1143 |
+
|
| 1144 |
+
if ( isset( $headers['content-length'] ) && $filesize != $headers['content-length'] ) {
|
| 1145 |
+
@unlink( $upload['file'] );
|
| 1146 |
+
return new WP_Error( 'import_file_error', __('Remote file is incorrect size', 'wordpress-importer') );
|
| 1147 |
+
}
|
| 1148 |
+
|
| 1149 |
+
if ( 0 == $filesize ) {
|
| 1150 |
+
@unlink( $upload['file'] );
|
| 1151 |
+
return new WP_Error( 'import_file_error', __('Zero size file downloaded', 'wordpress-importer') );
|
| 1152 |
+
}
|
| 1153 |
+
|
| 1154 |
+
$max_size = (int) $this->max_attachment_size();
|
| 1155 |
+
if ( ! empty( $max_size ) && $filesize > $max_size ) {
|
| 1156 |
+
@unlink( $upload['file'] );
|
| 1157 |
+
return new WP_Error( 'import_file_error', sprintf(__('Remote file is too large, limit is %s', 'wordpress-importer'), size_format($max_size) ) );
|
| 1158 |
+
}
|
| 1159 |
+
|
| 1160 |
+
// keep track of the old and new urls so we can substitute them later
|
| 1161 |
+
$this->url_remap[$url] = $upload['url'];
|
| 1162 |
+
$this->url_remap[$post['guid']] = $upload['url']; // r13735, really needed?
|
| 1163 |
+
// keep track of the destination if the remote url is redirected somewhere else
|
| 1164 |
+
if ( isset($headers['x-final-location']) && $headers['x-final-location'] != $url )
|
| 1165 |
+
$this->url_remap[$headers['x-final-location']] = $upload['url'];
|
| 1166 |
+
|
| 1167 |
+
return $upload;
|
| 1168 |
+
}
|
| 1169 |
+
|
| 1170 |
+
/**
|
| 1171 |
+
* Attempt to associate posts and menu items with previously missing parents
|
| 1172 |
+
*
|
| 1173 |
+
* An imported post's parent may not have been imported when it was first created
|
| 1174 |
+
* so try again. Similarly for child menu items and menu items which were missing
|
| 1175 |
+
* the object (e.g. post) they represent in the menu
|
| 1176 |
+
*/
|
| 1177 |
+
function backfill_parents() {
|
| 1178 |
+
global $wpdb;
|
| 1179 |
+
|
| 1180 |
+
// find parents for post orphans
|
| 1181 |
+
foreach ( $this->post_orphans as $child_id => $parent_id ) {
|
| 1182 |
+
$local_child_id = $local_parent_id = false;
|
| 1183 |
+
if ( isset( $this->processed_posts[$child_id] ) )
|
| 1184 |
+
$local_child_id = $this->processed_posts[$child_id];
|
| 1185 |
+
if ( isset( $this->processed_posts[$parent_id] ) )
|
| 1186 |
+
$local_parent_id = $this->processed_posts[$parent_id];
|
| 1187 |
+
|
| 1188 |
+
if ( $local_child_id && $local_parent_id ) {
|
| 1189 |
+
$wpdb->update( $wpdb->posts, array( 'post_parent' => $local_parent_id ), array( 'ID' => $local_child_id ), '%d', '%d' );
|
| 1190 |
+
clean_post_cache( $local_child_id );
|
| 1191 |
+
}
|
| 1192 |
+
}
|
| 1193 |
+
|
| 1194 |
+
// all other posts/terms are imported, retry menu items with missing associated object
|
| 1195 |
+
$missing_menu_items = $this->missing_menu_items;
|
| 1196 |
+
foreach ( $missing_menu_items as $item )
|
| 1197 |
+
$this->process_menu_item( $item );
|
| 1198 |
+
|
| 1199 |
+
// find parents for menu item orphans
|
| 1200 |
+
foreach ( $this->menu_item_orphans as $child_id => $parent_id ) {
|
| 1201 |
+
$local_child_id = $local_parent_id = 0;
|
| 1202 |
+
if ( isset( $this->processed_menu_items[$child_id] ) )
|
| 1203 |
+
$local_child_id = $this->processed_menu_items[$child_id];
|
| 1204 |
+
if ( isset( $this->processed_menu_items[$parent_id] ) )
|
| 1205 |
+
$local_parent_id = $this->processed_menu_items[$parent_id];
|
| 1206 |
+
|
| 1207 |
+
if ( $local_child_id && $local_parent_id )
|
| 1208 |
+
update_post_meta( $local_child_id, '_menu_item_menu_item_parent', (int) $local_parent_id );
|
| 1209 |
+
}
|
| 1210 |
+
}
|
| 1211 |
+
|
| 1212 |
+
/**
|
| 1213 |
+
* Use stored mapping information to update old attachment URLs
|
| 1214 |
+
*/
|
| 1215 |
+
function backfill_attachment_urls() {
|
| 1216 |
+
global $wpdb;
|
| 1217 |
+
// make sure we do the longest urls first, in case one is a substring of another
|
| 1218 |
+
uksort( $this->url_remap, array(&$this, 'cmpr_strlen') );
|
| 1219 |
+
|
| 1220 |
+
foreach ( $this->url_remap as $from_url => $to_url ) {
|
| 1221 |
+
// remap urls in post_content
|
| 1222 |
+
$wpdb->query( $wpdb->prepare("UPDATE {$wpdb->posts} SET post_content = REPLACE(post_content, %s, %s)", $from_url, $to_url) );
|
| 1223 |
+
// remap enclosure urls
|
| 1224 |
+
$result = $wpdb->query( $wpdb->prepare("UPDATE {$wpdb->postmeta} SET meta_value = REPLACE(meta_value, %s, %s) WHERE meta_key='enclosure'", $from_url, $to_url) );
|
| 1225 |
+
}
|
| 1226 |
+
}
|
| 1227 |
+
|
| 1228 |
+
/**
|
| 1229 |
+
* Update _thumbnail_id meta to new, imported attachment IDs
|
| 1230 |
+
*/
|
| 1231 |
+
function remap_featured_images() {
|
| 1232 |
+
// cycle through posts that have a featured image
|
| 1233 |
+
foreach ( $this->featured_images as $post_id => $value ) {
|
| 1234 |
+
if ( isset( $this->processed_posts[$value] ) ) {
|
| 1235 |
+
$new_id = $this->processed_posts[$value];
|
| 1236 |
+
// only update if there's a difference
|
| 1237 |
+
if ( $new_id != $value )
|
| 1238 |
+
update_post_meta( $post_id, '_thumbnail_id', $new_id );
|
| 1239 |
+
}
|
| 1240 |
+
}
|
| 1241 |
+
}
|
| 1242 |
+
|
| 1243 |
+
/**
|
| 1244 |
+
* Parse a WXR file
|
| 1245 |
+
*
|
| 1246 |
+
* @param string $file Path to WXR file for parsing
|
| 1247 |
+
* @return array Information gathered from the WXR file
|
| 1248 |
+
*/
|
| 1249 |
+
function parse( $file ) {
|
| 1250 |
+
$parser = new WXR_Parser();
|
| 1251 |
+
return $parser->parse( $file );
|
| 1252 |
+
}
|
| 1253 |
+
|
| 1254 |
+
// Display import page title
|
| 1255 |
+
function header() {
|
| 1256 |
+
echo '<div class="wrap">';
|
| 1257 |
+
echo '<h2>' . __( 'Import WordPress', 'wordpress-importer' ) . '</h2>';
|
| 1258 |
+
|
| 1259 |
+
$updates = get_plugin_updates();
|
| 1260 |
+
$basename = plugin_basename(__FILE__);
|
| 1261 |
+
if ( isset( $updates[$basename] ) ) {
|
| 1262 |
+
$update = $updates[$basename];
|
| 1263 |
+
echo '<div class="error"><p><strong>';
|
| 1264 |
+
printf( __( 'A new version of this importer is available. Please update to version %s to ensure compatibility with newer export files.', 'wordpress-importer' ), $update->update->new_version );
|
| 1265 |
+
echo '</strong></p></div>';
|
| 1266 |
+
}
|
| 1267 |
+
}
|
| 1268 |
+
|
| 1269 |
+
// Close div.wrap
|
| 1270 |
+
function footer() {
|
| 1271 |
+
echo '</div>';
|
| 1272 |
+
}
|
| 1273 |
+
|
| 1274 |
+
/**
|
| 1275 |
+
* Display introductory text and file upload form
|
| 1276 |
+
*/
|
| 1277 |
+
function greet() {
|
| 1278 |
+
echo '<div class="narrow">';
|
| 1279 |
+
echo '<p>'.__( 'Howdy! Upload your WordPress eXtended RSS (WXR) file and we’ll import the posts, pages, comments, custom fields, categories, and tags into this site.', 'wordpress-importer' ).'</p>';
|
| 1280 |
+
echo '<p>'.__( 'Choose a WXR (.xml) file to upload, then click Upload file and import.', 'wordpress-importer' ).'</p>';
|
| 1281 |
+
wp_import_upload_form( 'admin.php?import=wordpress&step=1' );
|
| 1282 |
+
echo '</div>';
|
| 1283 |
+
}
|
| 1284 |
+
|
| 1285 |
+
/**
|
| 1286 |
+
* Decide if the given meta key maps to information we will want to import
|
| 1287 |
+
*
|
| 1288 |
+
* @param string $key The meta key to check
|
| 1289 |
+
* @return string|bool The key if we do want to import, false if not
|
| 1290 |
+
*/
|
| 1291 |
+
function is_valid_meta_key( $key ) {
|
| 1292 |
+
// skip attachment metadata since we'll regenerate it from scratch
|
| 1293 |
+
// skip _edit_lock as not relevant for import
|
| 1294 |
+
if ( in_array( $key, array( '_wp_attached_file', '_wp_attachment_metadata', '_edit_lock' ) ) )
|
| 1295 |
+
return false;
|
| 1296 |
+
return $key;
|
| 1297 |
+
}
|
| 1298 |
+
|
| 1299 |
+
/**
|
| 1300 |
+
* Decide whether or not the importer is allowed to create users.
|
| 1301 |
+
* Default is true, can be filtered via import_allow_create_users
|
| 1302 |
+
*
|
| 1303 |
+
* @return bool True if creating users is allowed
|
| 1304 |
+
*/
|
| 1305 |
+
function allow_create_users() {
|
| 1306 |
+
return apply_filters( 'import_allow_create_users', true );
|
| 1307 |
+
}
|
| 1308 |
+
|
| 1309 |
+
/**
|
| 1310 |
+
* Decide whether or not the importer should attempt to download attachment files.
|
| 1311 |
+
* Default is true, can be filtered via import_allow_fetch_attachments. The choice
|
| 1312 |
+
* made at the import options screen must also be true, false here hides that checkbox.
|
| 1313 |
+
*
|
| 1314 |
+
* @return bool True if downloading attachments is allowed
|
| 1315 |
+
*/
|
| 1316 |
+
function allow_fetch_attachments() {
|
| 1317 |
+
return apply_filters( 'import_allow_fetch_attachments', true );
|
| 1318 |
+
}
|
| 1319 |
+
|
| 1320 |
+
/**
|
| 1321 |
+
* Decide what the maximum file size for downloaded attachments is.
|
| 1322 |
+
* Default is 0 (unlimited), can be filtered via import_attachment_size_limit
|
| 1323 |
+
*
|
| 1324 |
+
* @return int Maximum attachment file size to import
|
| 1325 |
+
*/
|
| 1326 |
+
function max_attachment_size() {
|
| 1327 |
+
return apply_filters( 'import_attachment_size_limit', 0 );
|
| 1328 |
+
}
|
| 1329 |
+
|
| 1330 |
+
/**
|
| 1331 |
+
* Added to http_request_timeout filter to force timeout at 60 seconds during import
|
| 1332 |
+
* @return int 60
|
| 1333 |
+
*/
|
| 1334 |
+
function bump_request_timeout( $val ) {
|
| 1335 |
+
return 60;
|
| 1336 |
+
}
|
| 1337 |
+
|
| 1338 |
+
// return the difference in length between two strings
|
| 1339 |
+
function cmpr_strlen( $a, $b ) {
|
| 1340 |
+
return strlen($b) - strlen($a);
|
| 1341 |
+
}
|
| 1342 |
+
}
|
| 1343 |
+
|
| 1344 |
+
} // class_exists( 'WP_Importer' )
|
| 1345 |
+
|
framework/features/dynamic-css.php
ADDED
|
@@ -0,0 +1,270 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
namespace Blocksy;
|
| 4 |
+
|
| 5 |
+
class DynamicCss {
|
| 6 |
+
public function __construct() {
|
| 7 |
+
add_filter(
|
| 8 |
+
'blocksy:dynamic-css:has_files_cache',
|
| 9 |
+
function ($r) {
|
| 10 |
+
if (is_customize_preview()) {
|
| 11 |
+
if (! wp_doing_ajax()) {
|
| 12 |
+
return false;
|
| 13 |
+
}
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
if (! $this->should_use_files()) {
|
| 17 |
+
return false;
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
$theme_paths = $this->maybe_prepare_theme_uploads_path();
|
| 21 |
+
|
| 22 |
+
if (! $theme_paths) {
|
| 23 |
+
return false;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
foreach ($this->get_chunks() as $chunk) {
|
| 27 |
+
if (! $chunk['enabled']) {
|
| 28 |
+
continue;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
$file = $theme_paths['css_path'] . '/' . $chunk['filename'];
|
| 32 |
+
|
| 33 |
+
if (! file_exists($file)) {
|
| 34 |
+
return false;
|
| 35 |
+
}
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
return true;
|
| 39 |
+
}
|
| 40 |
+
);
|
| 41 |
+
|
| 42 |
+
add_filter(
|
| 43 |
+
'blocksy_performance_end_customizer_options',
|
| 44 |
+
function ($opts) {
|
| 45 |
+
$opts['dynamic_css_file'] = [
|
| 46 |
+
'label' => __( 'Dynamic CSS Output', 'blc' ),
|
| 47 |
+
'type' => 'ct-radio',
|
| 48 |
+
'value' => 'file',
|
| 49 |
+
'view' => 'text',
|
| 50 |
+
'desc' => __( 'The strategy of outputing the dynamic CSS. File - all the CSS code will be placed in a static file, otherwise it will be placed inline in head.', 'blc' ),
|
| 51 |
+
'choices' => [
|
| 52 |
+
'file' => __( 'File', 'blc' ),
|
| 53 |
+
'inline' => __( 'Inline', 'blc' ),
|
| 54 |
+
],
|
| 55 |
+
];
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
$opts[blocksy_rand_md5()] = [
|
| 59 |
+
'type' => 'ct-divider',
|
| 60 |
+
];
|
| 61 |
+
|
| 62 |
+
$opts['emoji_scripts'] = [
|
| 63 |
+
'label' => __( 'Emojis Script', 'blc' ),
|
| 64 |
+
'type' => 'ct-switch',
|
| 65 |
+
'value' => 'no',
|
| 66 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 67 |
+
'desc' => __( 'Disable WordPress emojis script if you don\'t use them in order to improve the performance. ', 'blc' )
|
| 68 |
+
];
|
| 69 |
+
|
| 70 |
+
$opts[blocksy_rand_md5()] = [
|
| 71 |
+
'type' => 'ct-divider',
|
| 72 |
+
];
|
| 73 |
+
|
| 74 |
+
return $opts;
|
| 75 |
+
}
|
| 76 |
+
);
|
| 77 |
+
|
| 78 |
+
add_action('updated_option', function($option_name, $old_value, $value) {
|
| 79 |
+
if ('active_plugins' === $option_name) {
|
| 80 |
+
$this->generate_css_files();
|
| 81 |
+
}
|
| 82 |
+
}, 10, 3);
|
| 83 |
+
|
| 84 |
+
add_action('customize_save_after', function () {
|
| 85 |
+
$this->generate_css_files();
|
| 86 |
+
});
|
| 87 |
+
|
| 88 |
+
add_action('blocksy:dynamic-css:regenere_css_files', function () {
|
| 89 |
+
$this->generate_css_files();
|
| 90 |
+
});
|
| 91 |
+
|
| 92 |
+
$this->enqueue_dynamic_css();
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
public function should_use_files() {
|
| 96 |
+
return get_theme_mod('dynamic_css_file', 'file') === 'file';
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
public function get_chunks() {
|
| 100 |
+
return [
|
| 101 |
+
[
|
| 102 |
+
'filename' => 'global.css',
|
| 103 |
+
'context' => 'files:global',
|
| 104 |
+
'enabled' => true
|
| 105 |
+
],
|
| 106 |
+
];
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
public function enqueue_dynamic_css() {
|
| 110 |
+
if (is_admin()) {
|
| 111 |
+
return;
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
if (
|
| 115 |
+
! function_exists('blocksy_has_css_in_files')
|
| 116 |
+
||
|
| 117 |
+
! blocksy_has_css_in_files()
|
| 118 |
+
) {
|
| 119 |
+
return;
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
$theme_paths = $this->maybe_prepare_theme_uploads_path();
|
| 123 |
+
|
| 124 |
+
if (! $theme_paths) {
|
| 125 |
+
return;
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
foreach ($this->get_chunks() as $chunk) {
|
| 129 |
+
if (! $chunk['enabled']) {
|
| 130 |
+
continue;
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
$file = $theme_paths['css_path'] . '/' . $chunk['filename'];
|
| 134 |
+
$url = $theme_paths['css_url'] . '/' . $chunk['filename'];
|
| 135 |
+
|
| 136 |
+
wp_enqueue_style(
|
| 137 |
+
'blocksy-dynamic-' . pathinfo($chunk['filename'], PATHINFO_FILENAME),
|
| 138 |
+
set_url_scheme($url),
|
| 139 |
+
[],
|
| 140 |
+
substr((string) filemtime($file), -5, 5)
|
| 141 |
+
);
|
| 142 |
+
}
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
public function generate_css_files() {
|
| 146 |
+
if (! $this->should_use_files()) {
|
| 147 |
+
return false;
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
$theme_paths = $this->maybe_prepare_theme_uploads_path([
|
| 151 |
+
'should_generate' => true
|
| 152 |
+
]);
|
| 153 |
+
|
| 154 |
+
if (! $theme_paths) {
|
| 155 |
+
return false;
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
$chunks = $this->get_chunks();
|
| 159 |
+
|
| 160 |
+
foreach ($chunks as $chunk) {
|
| 161 |
+
if (! $chunk['enabled']) {
|
| 162 |
+
continue;
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
$file = $theme_paths['css_path'] . '/' . $chunk['filename'];
|
| 166 |
+
$url = $theme_paths['css_url'] . '/' . $chunk['filename'];
|
| 167 |
+
|
| 168 |
+
if (function_exists('blocksy_get_dynamic_css_file_content')) {
|
| 169 |
+
$this->wp_filesystem->put_contents(
|
| 170 |
+
$file,
|
| 171 |
+
blocksy_get_dynamic_css_file_content(['context' => $chunk['context']])
|
| 172 |
+
);
|
| 173 |
+
}
|
| 174 |
+
}
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
private function maybe_prepare_theme_uploads_path($args = []) {
|
| 178 |
+
$args = wp_parse_args($args, [
|
| 179 |
+
'should_generate' => false,
|
| 180 |
+
]);
|
| 181 |
+
|
| 182 |
+
require_once (ABSPATH . '/wp-admin/includes/file.php');
|
| 183 |
+
WP_Filesystem();
|
| 184 |
+
|
| 185 |
+
global $wp_filesystem;
|
| 186 |
+
|
| 187 |
+
$this->wp_filesystem = $wp_filesystem;
|
| 188 |
+
$uploads = wp_upload_dir();
|
| 189 |
+
|
| 190 |
+
// Theme folders in `uploads` directory.
|
| 191 |
+
$folders_in_uploads = array(
|
| 192 |
+
'base' => 'blocksy',
|
| 193 |
+
'css' => 'blocksy/css'
|
| 194 |
+
);
|
| 195 |
+
|
| 196 |
+
foreach($folders_in_uploads as $folder => $path) {
|
| 197 |
+
// Server path.
|
| 198 |
+
$theme_paths[
|
| 199 |
+
$folder . '_path'
|
| 200 |
+
] = $uploads['basedir'] . '/' . $path;
|
| 201 |
+
|
| 202 |
+
// URL.
|
| 203 |
+
$theme_paths[
|
| 204 |
+
$folder . '_url'
|
| 205 |
+
] = $uploads['baseurl'] . '/' . $path;
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
// Custom css file.
|
| 209 |
+
|
| 210 |
+
if (! $this->has_direct_access()) {
|
| 211 |
+
return false;
|
| 212 |
+
}
|
| 213 |
+
|
| 214 |
+
if (null === $this->wp_filesystem) {
|
| 215 |
+
return false;
|
| 216 |
+
}
|
| 217 |
+
|
| 218 |
+
if ($args['should_generate']) {
|
| 219 |
+
foreach(array_keys($folders_in_uploads) as $folder) {
|
| 220 |
+
$path = $theme_paths[$folder . '_path'];
|
| 221 |
+
$parent = dirname($path);
|
| 222 |
+
|
| 223 |
+
if ($this->wp_filesystem->is_writable($parent)) {
|
| 224 |
+
if (! $this->wp_filesystem->is_dir($path)) {
|
| 225 |
+
$this->wp_filesystem->mkdir($path);
|
| 226 |
+
}
|
| 227 |
+
}
|
| 228 |
+
}
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
+
return $theme_paths;
|
| 232 |
+
}
|
| 233 |
+
|
| 234 |
+
public function has_direct_access( $context = null ) {
|
| 235 |
+
require_once ABSPATH . 'wp-admin/includes/file.php';
|
| 236 |
+
WP_Filesystem();
|
| 237 |
+
|
| 238 |
+
/** @var WP_Filesystem_Base $wp_filesystem */
|
| 239 |
+
global $wp_filesystem;
|
| 240 |
+
|
| 241 |
+
if ($wp_filesystem) {
|
| 242 |
+
if ($wp_filesystem->method !== 'direct') {
|
| 243 |
+
if ( is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->get_error_code() ) {
|
| 244 |
+
return true;
|
| 245 |
+
} else {
|
| 246 |
+
return $wp_filesystem->method === 'direct';
|
| 247 |
+
}
|
| 248 |
+
} else {
|
| 249 |
+
return true;
|
| 250 |
+
}
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
if ( get_filesystem_method( [], $context ) === 'direct' ) {
|
| 254 |
+
ob_start();
|
| 255 |
+
|
| 256 |
+
{
|
| 257 |
+
$creds = request_filesystem_credentials( admin_url(), '', false, $context, null );
|
| 258 |
+
}
|
| 259 |
+
|
| 260 |
+
ob_end_clean();
|
| 261 |
+
|
| 262 |
+
if ( WP_Filesystem( $creds ) ) {
|
| 263 |
+
return true;
|
| 264 |
+
}
|
| 265 |
+
}
|
| 266 |
+
|
| 267 |
+
return false;
|
| 268 |
+
}
|
| 269 |
+
}
|
| 270 |
+
|
framework/features/google-analytics.php
CHANGED
|
@@ -4,12 +4,13 @@ namespace Blocksy;
|
|
| 4 |
|
| 5 |
class GoogleAnalytics {
|
| 6 |
public function __construct() {
|
| 7 |
-
|
| 8 |
add_filter(
|
| 9 |
-
'
|
| 10 |
[$this, 'generate_google_analytics_opts']
|
| 11 |
);
|
| 12 |
|
|
|
|
|
|
|
| 13 |
add_action('print_footer_scripts', function () {
|
| 14 |
if (is_admin()) return;
|
| 15 |
|
|
@@ -21,8 +22,7 @@ class GoogleAnalytics {
|
|
| 21 |
|
| 22 |
$analytics_id = get_theme_mod('analytics_id', '');
|
| 23 |
|
| 24 |
-
if (empty($analytics_id))
|
| 25 |
-
|
| 26 |
?>
|
| 27 |
|
| 28 |
<!-- Google Analytics -->
|
|
@@ -40,43 +40,69 @@ class GoogleAnalytics {
|
|
| 40 |
<!-- End Google Analytics -->
|
| 41 |
|
| 42 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
});
|
| 44 |
}
|
| 45 |
|
| 46 |
public function generate_google_analytics_opts($options) {
|
| 47 |
-
$options[
|
| 48 |
-
'
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
'
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
];
|
| 81 |
|
| 82 |
return $options;
|
| 4 |
|
| 5 |
class GoogleAnalytics {
|
| 6 |
public function __construct() {
|
|
|
|
| 7 |
add_filter(
|
| 8 |
+
'blocksy_engagement_general_start_customizer_options',
|
| 9 |
[$this, 'generate_google_analytics_opts']
|
| 10 |
);
|
| 11 |
|
| 12 |
+
if (is_admin()) return;
|
| 13 |
+
|
| 14 |
add_action('print_footer_scripts', function () {
|
| 15 |
if (is_admin()) return;
|
| 16 |
|
| 22 |
|
| 23 |
$analytics_id = get_theme_mod('analytics_id', '');
|
| 24 |
|
| 25 |
+
if (! empty($analytics_id)) {
|
|
|
|
| 26 |
?>
|
| 27 |
|
| 28 |
<!-- Google Analytics -->
|
| 40 |
<!-- End Google Analytics -->
|
| 41 |
|
| 42 |
<?php
|
| 43 |
+
};
|
| 44 |
+
|
| 45 |
+
$analytics_v4_id = get_theme_mod('analytics_v4_id', '');
|
| 46 |
+
|
| 47 |
+
if (! empty($analytics_v4_id)) {
|
| 48 |
+
?>
|
| 49 |
+
|
| 50 |
+
<!-- Global site tag (gtag.js) - Google Analytics v4 -->
|
| 51 |
+
<script async src="https://www.googletagmanager.com/gtag/js?id=<?php echo $analytics_v4_id ?>"></script>
|
| 52 |
+
<script>
|
| 53 |
+
window.dataLayer = window.dataLayer || [];
|
| 54 |
+
function gtag(){dataLayer.push(arguments);}
|
| 55 |
+
gtag('js', new Date());
|
| 56 |
+
|
| 57 |
+
gtag('config', '<?php echo $analytics_v4_id?>');
|
| 58 |
+
</script>
|
| 59 |
+
<!-- End Google Analytics v4 -->
|
| 60 |
+
|
| 61 |
+
<?php
|
| 62 |
+
};
|
| 63 |
+
|
| 64 |
+
|
| 65 |
});
|
| 66 |
}
|
| 67 |
|
| 68 |
public function generate_google_analytics_opts($options) {
|
| 69 |
+
$options[] = [
|
| 70 |
+
'analytics_id' => [
|
| 71 |
+
'label' => __( 'Google Analytics', 'blc' ),
|
| 72 |
+
'type' => 'text',
|
| 73 |
+
'design' => 'block',
|
| 74 |
+
'divider' => 'bottom',
|
| 75 |
+
'value' => '',
|
| 76 |
+
'desc' => __( 'Insert your Google Analytics tracking ID.', 'blc' ),
|
| 77 |
+
'disableRevertButton' => true,
|
| 78 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 79 |
+
],
|
| 80 |
+
|
| 81 |
+
'analytics_v4_id' => [
|
| 82 |
+
'label' => __( 'Google Analytics v4', 'blc' ),
|
| 83 |
+
'type' => 'text',
|
| 84 |
+
'design' => 'block',
|
| 85 |
+
'divider' => 'bottom',
|
| 86 |
+
'value' => '',
|
| 87 |
+
'desc' => sprintf(
|
| 88 |
+
__(
|
| 89 |
+
'Insert your Google Analytics v4 tracking ID. Instructions on how to activate this for your site can be found %shere%s.',
|
| 90 |
+
'blc'
|
| 91 |
+
),
|
| 92 |
+
'<a href="https://support.google.com/analytics/answer/9744165?hl=en">',
|
| 93 |
+
'</a>'
|
| 94 |
+
),
|
| 95 |
+
'disableRevertButton' => true,
|
| 96 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 97 |
+
],
|
| 98 |
+
|
| 99 |
+
'ip_anonymization' => [
|
| 100 |
+
'label' => __( 'IP Anonymization', 'blc' ),
|
| 101 |
+
'type' => 'ct-switch',
|
| 102 |
+
'value' => 'no',
|
| 103 |
+
'desc' => __( 'Enable Google Analytics IP anonymization feature <a href="https://developers.google.com/analytics/devguides/collection/gtagjs/ip-anonymization">(more info)</a>.', 'blc' ),
|
| 104 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 105 |
+
],
|
| 106 |
];
|
| 107 |
|
| 108 |
return $options;
|
framework/features/header.php
ADDED
|
@@ -0,0 +1,520 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
namespace Blocksy;
|
| 4 |
+
|
| 5 |
+
class HeaderAdditions {
|
| 6 |
+
private $has_transparent_header = '__DEFAULT__';
|
| 7 |
+
private $has_sticky_header = '__DEFAULT__';
|
| 8 |
+
|
| 9 |
+
public function __construct() {
|
| 10 |
+
add_action(
|
| 11 |
+
'customize_controls_enqueue_scripts',
|
| 12 |
+
function () {
|
| 13 |
+
$this->enqueue_static();
|
| 14 |
+
}
|
| 15 |
+
);
|
| 16 |
+
|
| 17 |
+
add_action(
|
| 18 |
+
'admin_enqueue_scripts',
|
| 19 |
+
function () {
|
| 20 |
+
$this->enqueue_static();
|
| 21 |
+
},
|
| 22 |
+
50
|
| 23 |
+
);
|
| 24 |
+
|
| 25 |
+
add_filter('blocksy:header:device-wrapper-attr', function ($attr, $device) {
|
| 26 |
+
$transparent_result = $this->current_screen_has_transparent();
|
| 27 |
+
|
| 28 |
+
if (! $transparent_result) {
|
| 29 |
+
return $attr;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
if (in_array($device, $transparent_result)) {
|
| 33 |
+
$attr['data-transparent'] = '';
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
return $attr;
|
| 37 |
+
}, 10, 2);
|
| 38 |
+
|
| 39 |
+
add_filter('blocksy:header:item-template-args', function ($args) {
|
| 40 |
+
$args['has_transparent_header'] = $this->current_screen_has_transparent();
|
| 41 |
+
$args['has_sticky_header'] = $this->current_screen_has_sticky();
|
| 42 |
+
|
| 43 |
+
return $args;
|
| 44 |
+
});
|
| 45 |
+
|
| 46 |
+
add_filter('blocksy:header:row-wrapper-attr', function ($attr, $row, $device) {
|
| 47 |
+
$current_section = blocksy_manager()->header_builder->get_current_section();
|
| 48 |
+
|
| 49 |
+
if (! isset($current_section['settings'])) {
|
| 50 |
+
$current_section['settings'] = [];
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
$atts = $current_section['settings'];
|
| 54 |
+
|
| 55 |
+
$transparent_result = $this->current_screen_has_transparent();
|
| 56 |
+
|
| 57 |
+
if ($transparent_result) {
|
| 58 |
+
if (in_array($device, $transparent_result)) {
|
| 59 |
+
$attr['data-transparent-row'] = 'yes';
|
| 60 |
+
}
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
return $attr;
|
| 64 |
+
}, 10, 3);
|
| 65 |
+
|
| 66 |
+
add_filter(
|
| 67 |
+
'blocksy:header:rows-render',
|
| 68 |
+
function ($custom_content, $rows, $device) {
|
| 69 |
+
$sticky_result = $this->current_screen_has_sticky();
|
| 70 |
+
|
| 71 |
+
if (! $sticky_result) {
|
| 72 |
+
return $custom_content;
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
if (! in_array($device, $sticky_result['devices'])) {
|
| 76 |
+
return $custom_content;
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
$start_html = '<div class="ct-sticky-container">';
|
| 80 |
+
$start_html .= '<div data-sticky="' . $sticky_result['effect'] . '">';
|
| 81 |
+
|
| 82 |
+
$end_html = '</div></div>';
|
| 83 |
+
|
| 84 |
+
if (
|
| 85 |
+
$sticky_result['behaviour'] === 'top_middle'
|
| 86 |
+
&&
|
| 87 |
+
(
|
| 88 |
+
isset($rows['top-row'])
|
| 89 |
+
||
|
| 90 |
+
isset($rows['middle-row'])
|
| 91 |
+
)
|
| 92 |
+
) {
|
| 93 |
+
if (isset($rows['top-row'])) {
|
| 94 |
+
$rows['top-row'] = $start_html . $rows['top-row'];
|
| 95 |
+
} else {
|
| 96 |
+
$rows['middle-row'] = $start_html . $rows['middle-row'];
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
if (isset($rows['middle-row'])) {
|
| 100 |
+
$rows['middle-row'] = $rows['middle-row'] . $end_html;
|
| 101 |
+
} else {
|
| 102 |
+
$rows['top-row'] = $rows['top-row'] . $end_html;
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
return implode('', array_values($rows));
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
if (
|
| 109 |
+
$sticky_result['behaviour'] === 'middle_bottom'
|
| 110 |
+
&&
|
| 111 |
+
(
|
| 112 |
+
isset($rows['middle-row'])
|
| 113 |
+
||
|
| 114 |
+
isset($rows['bottom-row'])
|
| 115 |
+
)
|
| 116 |
+
) {
|
| 117 |
+
if (isset($rows['middle-row'])) {
|
| 118 |
+
$rows['middle-row'] = $start_html . $rows['middle-row'];
|
| 119 |
+
} else {
|
| 120 |
+
$rows['bottom-row'] = $start_html . $rows['bottom-row'];
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
if (isset($rows['bottom-row'])) {
|
| 124 |
+
$rows['bottom-row'] = $rows['bottom-row'] . $end_html;
|
| 125 |
+
} else {
|
| 126 |
+
$rows['middle-row'] = $rows['middle-row'] . $end_html;
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
return implode('', array_values($rows));
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
if (
|
| 133 |
+
$sticky_result['behaviour'] === 'middle'
|
| 134 |
+
&&
|
| 135 |
+
isset($rows['middle-row'])
|
| 136 |
+
) {
|
| 137 |
+
$rows['middle-row'] = $start_html . $rows['middle-row'] . $end_html;
|
| 138 |
+
return implode('', array_values($rows));
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
if (
|
| 142 |
+
$sticky_result['behaviour'] === 'bottom'
|
| 143 |
+
&&
|
| 144 |
+
isset($rows['bottom-row'])
|
| 145 |
+
) {
|
| 146 |
+
$rows['bottom-row'] = $start_html . $rows['bottom-row'] . $end_html;
|
| 147 |
+
return implode('', array_values($rows));
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
if (
|
| 151 |
+
$sticky_result['behaviour'] === 'top'
|
| 152 |
+
&&
|
| 153 |
+
isset($rows['top-row'])
|
| 154 |
+
) {
|
| 155 |
+
$rows['top-row'] = $start_html . $rows['top-row'] . $end_html;
|
| 156 |
+
return implode('', array_values($rows));
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
if (
|
| 160 |
+
$sticky_result['behaviour'] === 'entire_header'
|
| 161 |
+
) {
|
| 162 |
+
return $start_html . implode('', array_values($rows)) . $end_html;
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
return null;
|
| 166 |
+
},
|
| 167 |
+
10, 3
|
| 168 |
+
);
|
| 169 |
+
|
| 170 |
+
add_filter('blocksy:header:dynamic-styles-args', function ($args) {
|
| 171 |
+
$args['has_transparent_header'] = $this->current_screen_has_transparent(false);
|
| 172 |
+
$args['has_sticky_header'] = $this->current_screen_has_sticky();
|
| 173 |
+
|
| 174 |
+
return $args;
|
| 175 |
+
});
|
| 176 |
+
|
| 177 |
+
add_filter('blocksy:header:default_value', function ($value, $header_builder) {
|
| 178 |
+
$value['sections'][] = $header_builder->get_structure_for([
|
| 179 |
+
'id' => 'ct-custom-transparent',
|
| 180 |
+
'name' => __('Transparent', 'blocksy'),
|
| 181 |
+
'mode' => 'placements',
|
| 182 |
+
'settings' => [
|
| 183 |
+
'is_absolute' => 'yes'
|
| 184 |
+
],
|
| 185 |
+
'items' => [
|
| 186 |
+
'desktop' => [
|
| 187 |
+
'middle-row' => [
|
| 188 |
+
'start' => ['logo'],
|
| 189 |
+
'end' => ['menu', 'search']
|
| 190 |
+
]
|
| 191 |
+
],
|
| 192 |
+
|
| 193 |
+
'mobile' => [
|
| 194 |
+
'middle-row' => [
|
| 195 |
+
'start' => ['logo'],
|
| 196 |
+
'end' => ['trigger']
|
| 197 |
+
],
|
| 198 |
+
|
| 199 |
+
'offcanvas' => [
|
| 200 |
+
'start' => [
|
| 201 |
+
'mobile-menu',
|
| 202 |
+
]
|
| 203 |
+
]
|
| 204 |
+
]
|
| 205 |
+
]
|
| 206 |
+
]);
|
| 207 |
+
|
| 208 |
+
return $value;
|
| 209 |
+
}, 10, 2);
|
| 210 |
+
|
| 211 |
+
add_filter('blocksy:header:items-paths', function ($paths) {
|
| 212 |
+
$paths[] = dirname(__FILE__) . '/header/items';
|
| 213 |
+
return $paths;
|
| 214 |
+
});
|
| 215 |
+
|
| 216 |
+
add_action('wp_footer', function () {
|
| 217 |
+
if (! class_exists('Blocksy_Header_Builder_Render')) {
|
| 218 |
+
return;
|
| 219 |
+
}
|
| 220 |
+
|
| 221 |
+
$render = new \Blocksy_Header_Builder_Render();
|
| 222 |
+
|
| 223 |
+
if (! $render->contains_item('account')) {
|
| 224 |
+
return;
|
| 225 |
+
}
|
| 226 |
+
|
| 227 |
+
echo blc_call_fn(
|
| 228 |
+
['fn' => 'blocksy_render_view'],
|
| 229 |
+
dirname(__FILE__) . '/header/account-modal.php'
|
| 230 |
+
);
|
| 231 |
+
});
|
| 232 |
+
|
| 233 |
+
add_filter('blocksy:header:settings', function ($opt) {
|
| 234 |
+
$opt = blc_call_fn(
|
| 235 |
+
[
|
| 236 |
+
'fn' => 'blocksy_get_options',
|
| 237 |
+
'default' => 'array'
|
| 238 |
+
],
|
| 239 |
+
dirname( __FILE__ ) . '/header/header-options.php',
|
| 240 |
+
[], false
|
| 241 |
+
);
|
| 242 |
+
|
| 243 |
+
return $opt;
|
| 244 |
+
});
|
| 245 |
+
}
|
| 246 |
+
|
| 247 |
+
public function enqueue_static() {
|
| 248 |
+
if (! function_exists('get_plugin_data')) {
|
| 249 |
+
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
|
| 250 |
+
}
|
| 251 |
+
|
| 252 |
+
global $wp_customize;
|
| 253 |
+
|
| 254 |
+
$data = get_plugin_data(BLOCKSY__FILE__);
|
| 255 |
+
|
| 256 |
+
$deps = ['ct-options-scripts'];
|
| 257 |
+
|
| 258 |
+
$current_screen = get_current_screen();
|
| 259 |
+
|
| 260 |
+
if ($current_screen && $current_screen->id === 'customize') {
|
| 261 |
+
$deps = ['ct-customizer-controls'];
|
| 262 |
+
}
|
| 263 |
+
|
| 264 |
+
wp_enqueue_script(
|
| 265 |
+
'blocksy-admin-scripts',
|
| 266 |
+
BLOCKSY_URL . 'static/bundle/options.js',
|
| 267 |
+
$deps,
|
| 268 |
+
$data['Version'],
|
| 269 |
+
true
|
| 270 |
+
);
|
| 271 |
+
|
| 272 |
+
$conditions_manager = new ConditionsManager();
|
| 273 |
+
|
| 274 |
+
$localize = array_merge(
|
| 275 |
+
[
|
| 276 |
+
'all_condition_rules' => $conditions_manager->get_all_rules(),
|
| 277 |
+
'ajax_url' => admin_url('admin-ajax.php'),
|
| 278 |
+
'rest_url' => get_rest_url(),
|
| 279 |
+
]
|
| 280 |
+
);
|
| 281 |
+
|
| 282 |
+
wp_localize_script(
|
| 283 |
+
'blocksy-admin-scripts',
|
| 284 |
+
'blocksy_admin',
|
| 285 |
+
$localize
|
| 286 |
+
);
|
| 287 |
+
|
| 288 |
+
wp_enqueue_style(
|
| 289 |
+
'blocksy-styles',
|
| 290 |
+
BLOCKSY_URL . 'static/bundle/options.css',
|
| 291 |
+
[],
|
| 292 |
+
$data['Version']
|
| 293 |
+
);
|
| 294 |
+
}
|
| 295 |
+
|
| 296 |
+
public function current_screen_has_transparent($check_conditions = true) {
|
| 297 |
+
if (true || $this->has_transparent_header === '__DEFAULT__' || ! $check_conditions) {
|
| 298 |
+
$current_section = blocksy_manager()->header_builder->get_current_section();
|
| 299 |
+
|
| 300 |
+
if (! isset($current_section['settings'])) {
|
| 301 |
+
$current_section['settings'] = [];
|
| 302 |
+
}
|
| 303 |
+
|
| 304 |
+
$atts = $current_section['settings'];
|
| 305 |
+
|
| 306 |
+
if (blocksy_akg('has_transparent_header', $atts, 'no') === 'no') {
|
| 307 |
+
$this->has_transparent_header = false;
|
| 308 |
+
return false;
|
| 309 |
+
}
|
| 310 |
+
|
| 311 |
+
$transparent_behaviour = blocksy_akg(
|
| 312 |
+
'transparent_behaviour',
|
| 313 |
+
$atts,
|
| 314 |
+
[
|
| 315 |
+
'desktop' => true,
|
| 316 |
+
'tablet' => true,
|
| 317 |
+
'mobile' => true,
|
| 318 |
+
]
|
| 319 |
+
);
|
| 320 |
+
|
| 321 |
+
$transparent_result = [];
|
| 322 |
+
|
| 323 |
+
foreach ($transparent_behaviour as $device => $value) {
|
| 324 |
+
if (! $value) {
|
| 325 |
+
continue;
|
| 326 |
+
}
|
| 327 |
+
|
| 328 |
+
$transparent_result[] = $device;
|
| 329 |
+
}
|
| 330 |
+
|
| 331 |
+
$conditions_manager = new \Blocksy\ConditionsManager();
|
| 332 |
+
|
| 333 |
+
$this->has_transparent_header = false;
|
| 334 |
+
|
| 335 |
+
if (
|
| 336 |
+
count($transparent_result) > 0
|
| 337 |
+
&&
|
| 338 |
+
(
|
| 339 |
+
(
|
| 340 |
+
$current_section['id'] === 'type-1'
|
| 341 |
+
&&
|
| 342 |
+
$conditions_manager->condition_matches(blocksy_akg(
|
| 343 |
+
'transparent_conditions',
|
| 344 |
+
$atts,
|
| 345 |
+
[
|
| 346 |
+
[
|
| 347 |
+
'type' => 'include',
|
| 348 |
+
'rule' => 'everywhere'
|
| 349 |
+
],
|
| 350 |
+
|
| 351 |
+
[
|
| 352 |
+
'type' => 'exclude',
|
| 353 |
+
'rule' => '404'
|
| 354 |
+
],
|
| 355 |
+
|
| 356 |
+
[
|
| 357 |
+
'type' => 'exclude',
|
| 358 |
+
'rule' => 'search'
|
| 359 |
+
],
|
| 360 |
+
|
| 361 |
+
[
|
| 362 |
+
'type' => 'exclude',
|
| 363 |
+
'rule' => 'archives'
|
| 364 |
+
]
|
| 365 |
+
]
|
| 366 |
+
))
|
| 367 |
+
) || (
|
| 368 |
+
$current_section['id'] !== 'type-1'
|
| 369 |
+
) || !$check_conditions
|
| 370 |
+
)
|
| 371 |
+
) {
|
| 372 |
+
$this->has_transparent_header = $transparent_result;
|
| 373 |
+
}
|
| 374 |
+
}
|
| 375 |
+
|
| 376 |
+
return $this->has_transparent_header;
|
| 377 |
+
}
|
| 378 |
+
|
| 379 |
+
public function current_screen_has_sticky() {
|
| 380 |
+
if ($this->has_sticky_header === '__DEFAULT__') {
|
| 381 |
+
$current_section = blocksy_manager()->header_builder->get_current_section();
|
| 382 |
+
|
| 383 |
+
if (! isset($current_section['settings'])) {
|
| 384 |
+
$current_section['settings'] = [];
|
| 385 |
+
}
|
| 386 |
+
|
| 387 |
+
$atts = $current_section['settings'];
|
| 388 |
+
|
| 389 |
+
if (blocksy_akg('has_sticky_header', $atts, 'no') === 'no') {
|
| 390 |
+
$this->has_sticky_header = false;
|
| 391 |
+
return $this->has_sticky_header;
|
| 392 |
+
}
|
| 393 |
+
|
| 394 |
+
$atts = $current_section['settings'];
|
| 395 |
+
|
| 396 |
+
$sticky_behaviour = blocksy_akg(
|
| 397 |
+
'sticky_behaviour',
|
| 398 |
+
$atts,
|
| 399 |
+
[
|
| 400 |
+
'desktop' => true,
|
| 401 |
+
'mobile' => true,
|
| 402 |
+
]
|
| 403 |
+
);
|
| 404 |
+
|
| 405 |
+
$sticky_result = [
|
| 406 |
+
'devices' => [],
|
| 407 |
+
|
| 408 |
+
// top
|
| 409 |
+
// middle
|
| 410 |
+
// bottom
|
| 411 |
+
// middle_bottom
|
| 412 |
+
// entire_header
|
| 413 |
+
// 'behaviour' => 'middle_bottom'
|
| 414 |
+
// 'behaviour' => 'middle'
|
| 415 |
+
// 'behaviour' => 'middle_bottom'
|
| 416 |
+
'behaviour' => blocksy_akg('sticky_rows', $atts, 'middle'),
|
| 417 |
+
'effect' => blocksy_akg('sticky_effect', $atts, 'shrink')
|
| 418 |
+
];
|
| 419 |
+
|
| 420 |
+
foreach ($sticky_behaviour as $device => $value) {
|
| 421 |
+
if (! $value) {
|
| 422 |
+
continue;
|
| 423 |
+
}
|
| 424 |
+
|
| 425 |
+
$sticky_result['devices'][] = $device;
|
| 426 |
+
}
|
| 427 |
+
|
| 428 |
+
$this->has_sticky_header = $sticky_result;
|
| 429 |
+
}
|
| 430 |
+
|
| 431 |
+
return $this->has_sticky_header;
|
| 432 |
+
}
|
| 433 |
+
|
| 434 |
+
public function patch_conditions($post_id, $old_post_id) {
|
| 435 |
+
$conditions = $this->get_conditions();
|
| 436 |
+
|
| 437 |
+
foreach ($conditions as $index => $single_condition) {
|
| 438 |
+
$particular_conditions = $single_condition['conditions'];
|
| 439 |
+
|
| 440 |
+
foreach ($particular_conditions as $nested_index => $single_particular_condition) {
|
| 441 |
+
if (
|
| 442 |
+
(
|
| 443 |
+
$single_particular_condition['rule'] === 'page_ids'
|
| 444 |
+
||
|
| 445 |
+
$single_particular_condition['rule'] === 'post_ids'
|
| 446 |
+
) && (
|
| 447 |
+
isset($single_particular_condition['payload'])
|
| 448 |
+
&&
|
| 449 |
+
isset($single_particular_condition['payload']['post_id'])
|
| 450 |
+
&&
|
| 451 |
+
intval(
|
| 452 |
+
$single_particular_condition['payload']['post_id']
|
| 453 |
+
) === $old_post_id
|
| 454 |
+
)
|
| 455 |
+
) {
|
| 456 |
+
$particular_conditions[$nested_index]['payload']['post_id'] = $post_id;
|
| 457 |
+
}
|
| 458 |
+
}
|
| 459 |
+
|
| 460 |
+
$conditions[$index]['conditions'] = $particular_conditions;
|
| 461 |
+
}
|
| 462 |
+
|
| 463 |
+
$this->set_conditions($conditions);
|
| 464 |
+
|
| 465 |
+
$section_value = blocksy_manager()->header_builder->get_section_value();
|
| 466 |
+
|
| 467 |
+
foreach ($section_value['sections'] as $index => $current_section) {
|
| 468 |
+
if (! isset($current_section['settings'])) {
|
| 469 |
+
continue;
|
| 470 |
+
}
|
| 471 |
+
|
| 472 |
+
if (! isset($current_section['settings']['transparent_conditions'])) {
|
| 473 |
+
continue;
|
| 474 |
+
}
|
| 475 |
+
|
| 476 |
+
foreach ($current_section['settings']['transparent_conditions'] as $cond_index => $single_condition) {
|
| 477 |
+
$particular_conditions = $single_condition;
|
| 478 |
+
|
| 479 |
+
if (
|
| 480 |
+
(
|
| 481 |
+
$single_condition['rule'] === 'page_ids'
|
| 482 |
+
||
|
| 483 |
+
$single_condition['rule'] === 'post_ids'
|
| 484 |
+
) && (
|
| 485 |
+
isset($single_condition['payload'])
|
| 486 |
+
&&
|
| 487 |
+
isset($single_condition['payload']['post_id'])
|
| 488 |
+
&&
|
| 489 |
+
intval(
|
| 490 |
+
$single_condition['payload']['post_id']
|
| 491 |
+
) === $old_post_id
|
| 492 |
+
)
|
| 493 |
+
) {
|
| 494 |
+
$single_condition['payload']['post_id'] = $post_id;
|
| 495 |
+
}
|
| 496 |
+
|
| 497 |
+
$section_value['sections'][$index]['settings'][
|
| 498 |
+
'transparent_conditions'
|
| 499 |
+
][$cond_index] = $single_condition;
|
| 500 |
+
}
|
| 501 |
+
}
|
| 502 |
+
|
| 503 |
+
set_theme_mod('header_placements', $section_value);
|
| 504 |
+
}
|
| 505 |
+
|
| 506 |
+
public function get_conditions() {
|
| 507 |
+
$option = get_theme_mod('blocksy_premium_header_conditions', []);
|
| 508 |
+
|
| 509 |
+
if (empty($option)) {
|
| 510 |
+
return [];
|
| 511 |
+
}
|
| 512 |
+
|
| 513 |
+
return $option;
|
| 514 |
+
}
|
| 515 |
+
|
| 516 |
+
public function set_conditions($conditions) {
|
| 517 |
+
set_theme_mod('blocksy_premium_header_conditions', $conditions);
|
| 518 |
+
}
|
| 519 |
+
}
|
| 520 |
+
|
framework/features/header/account-modal.php
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
$users_can_register = get_option('users_can_register');
|
| 4 |
+
// $users_can_register = true;
|
| 5 |
+
|
| 6 |
+
?>
|
| 7 |
+
|
| 8 |
+
<div id="account-modal" class="ct-panel" data-behaviour="modal">
|
| 9 |
+
<div class="close-button">
|
| 10 |
+
<span class="ct-trigger closed">
|
| 11 |
+
<span></span>
|
| 12 |
+
</span>
|
| 13 |
+
</div>
|
| 14 |
+
|
| 15 |
+
<div class="content-container" data-align="middle">
|
| 16 |
+
<div class="ct-account-form">
|
| 17 |
+
<?php if ($users_can_register) { ?>
|
| 18 |
+
<ul>
|
| 19 |
+
<li class="active ct-login">
|
| 20 |
+
<?php echo __('Login', 'blc') ?>
|
| 21 |
+
</li>
|
| 22 |
+
|
| 23 |
+
<li class="ct-register">
|
| 24 |
+
<?php echo __('Sign Up', 'blc') ?>
|
| 25 |
+
</li>
|
| 26 |
+
</ul>
|
| 27 |
+
<?php } ?>
|
| 28 |
+
|
| 29 |
+
<section class="ct-login-form active">
|
| 30 |
+
<?php //wp_login_form([]); ?>
|
| 31 |
+
|
| 32 |
+
<form name="loginform" id="loginform" action="<?php echo wp_login_url() ?>" method="post">
|
| 33 |
+
<?php do_action('woocommerce_login_form_start'); ?>
|
| 34 |
+
|
| 35 |
+
<p class="login-username">
|
| 36 |
+
<label for="user_login"><?php echo __('Email Address', 'blc') ?></label>
|
| 37 |
+
<input type="text" name="log" id="user_login" class="input" value="" size="20">
|
| 38 |
+
</p>
|
| 39 |
+
|
| 40 |
+
<p class="login-password">
|
| 41 |
+
<label for="user_pass"><?php echo __('Password', 'blc') ?></label>
|
| 42 |
+
<input type="password" name="pwd" id="user_pass" class="input" value="" size="20">
|
| 43 |
+
</p>
|
| 44 |
+
|
| 45 |
+
<p class="login-remember col-2">
|
| 46 |
+
<label>
|
| 47 |
+
<input name="rememberme" type="checkbox" id="rememberme" value="forever">
|
| 48 |
+
<?php echo __('Remember Me', 'blc') ?>
|
| 49 |
+
</label>
|
| 50 |
+
|
| 51 |
+
<a href="<?php echo wp_lostpassword_url() ?>" class="ct-forgot-password">
|
| 52 |
+
<?php echo __('Forgot Password?', 'blc') ?>
|
| 53 |
+
</a>
|
| 54 |
+
</p>
|
| 55 |
+
|
| 56 |
+
<p class="login-submit">
|
| 57 |
+
<button name="wp-submit" class="ct-button">
|
| 58 |
+
<?php echo __('Log In', 'blc') ?>
|
| 59 |
+
</button>
|
| 60 |
+
|
| 61 |
+
<input type="hidden" name="redirect_to" value="<?php echo blocksy_current_url() ?>">
|
| 62 |
+
</p>
|
| 63 |
+
|
| 64 |
+
<?php do_action('woocommerce_login_form_end'); ?>
|
| 65 |
+
</form>
|
| 66 |
+
</section>
|
| 67 |
+
|
| 68 |
+
<?php if ($users_can_register) { ?>
|
| 69 |
+
<section class="ct-register-form">
|
| 70 |
+
|
| 71 |
+
<form name="registerform" id="registerform" action="<?php echo wp_registration_url() ?>" method="post" novalidate="novalidate">
|
| 72 |
+
<?php do_action('woocommerce_register_form_start') ?>
|
| 73 |
+
|
| 74 |
+
<p>
|
| 75 |
+
<label for="user_login_register"><?php echo __('Username', 'blc') ?></label>
|
| 76 |
+
<input type="text" name="user_login" id="user_login_register" class="input" value="" size="20" autocapitalize="off">
|
| 77 |
+
</p>
|
| 78 |
+
|
| 79 |
+
<p>
|
| 80 |
+
<label for="user_email"><?php echo __('Email', 'blc') ?></label>
|
| 81 |
+
<input type="email" name="user_email" id="user_email" class="input" value="" size="25">
|
| 82 |
+
</p>
|
| 83 |
+
|
| 84 |
+
<p id="reg_passmail">
|
| 85 |
+
<?php echo __('Registration confirmation will be emailed to you', 'blc') ?>
|
| 86 |
+
</p>
|
| 87 |
+
|
| 88 |
+
<p>
|
| 89 |
+
<button name="wp-submit" class="ct-button">
|
| 90 |
+
<?php echo __('Register', 'blc') ?>
|
| 91 |
+
</button>
|
| 92 |
+
|
| 93 |
+
<input type="hidden" name="redirect_to" value="<?php echo blocksy_current_url() ?>">
|
| 94 |
+
</p>
|
| 95 |
+
|
| 96 |
+
<?php do_action('woocommerce_register_form_end') ?>
|
| 97 |
+
</form>
|
| 98 |
+
|
| 99 |
+
</section>
|
| 100 |
+
<?php } ?>
|
| 101 |
+
|
| 102 |
+
<section class="ct-forgot-password-form">
|
| 103 |
+
<form name="lostpasswordform" id="lostpasswordform" action="<?php echo wp_lostpassword_url() ?>" method="post">
|
| 104 |
+
<p>
|
| 105 |
+
<label for="user_login_forgot"><?php echo __('Username or Email Address', 'blc')?></label>
|
| 106 |
+
<input type="text" name="user_login" id="user_login_forgot" class="input" value="" size="20" autocapitalize="off" required>
|
| 107 |
+
</p>
|
| 108 |
+
|
| 109 |
+
<p>
|
| 110 |
+
<button name="wp-submit" class="ct-button">
|
| 111 |
+
<?php echo __('Get New Password', 'blc') ?>
|
| 112 |
+
</button>
|
| 113 |
+
|
| 114 |
+
<input type="hidden" name="redirect_to" value="<?php echo blocksy_current_url() ?>">
|
| 115 |
+
</p>
|
| 116 |
+
</form>
|
| 117 |
+
|
| 118 |
+
<a href="<?php echo wp_login_url() ?>" class="ct-back-to-login ct-login">
|
| 119 |
+
← <?php echo __('Back to login', 'blc') ?>
|
| 120 |
+
</a>
|
| 121 |
+
</section>
|
| 122 |
+
</div>
|
| 123 |
+
</div>
|
| 124 |
+
</div>
|
| 125 |
+
|
framework/features/header/header-options.php
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
$options = [
|
| 4 |
+
|
| 5 |
+
'has_sticky_header' => [
|
| 6 |
+
'label' => __( 'Sticky Functionality', 'blc' ),
|
| 7 |
+
'type' => 'ct-switch',
|
| 8 |
+
'value' => 'no',
|
| 9 |
+
|
| 10 |
+
'sync' => [
|
| 11 |
+
'id' => 'header_placements_1'
|
| 12 |
+
]
|
| 13 |
+
],
|
| 14 |
+
|
| 15 |
+
blocksy_rand_md5() => [
|
| 16 |
+
'type' => 'ct-condition',
|
| 17 |
+
'condition' => [ 'has_sticky_header' => 'yes' ],
|
| 18 |
+
'options' => [
|
| 19 |
+
|
| 20 |
+
'sticky_rows' => [
|
| 21 |
+
'label' => false,
|
| 22 |
+
'type' => 'ct-image-picker',
|
| 23 |
+
'value' => 'middle',
|
| 24 |
+
'design' => 'block',
|
| 25 |
+
'sync' => [
|
| 26 |
+
'id' => 'header_placements_1'
|
| 27 |
+
],
|
| 28 |
+
|
| 29 |
+
'choices' => [
|
| 30 |
+
'middle' => [
|
| 31 |
+
'src' => blocksy_image_picker_url('sticky-main.svg'),
|
| 32 |
+
'title' => __('Only Main Row', 'blocksy'),
|
| 33 |
+
],
|
| 34 |
+
|
| 35 |
+
'top_middle' => [
|
| 36 |
+
'src' => blocksy_image_picker_url('sticky-top-main.svg'),
|
| 37 |
+
'title' => __('Top & Main Row', 'blocksy'),
|
| 38 |
+
],
|
| 39 |
+
|
| 40 |
+
'entire_header' => [
|
| 41 |
+
'src' => blocksy_image_picker_url('sticky-all.svg'),
|
| 42 |
+
'title' => __('All Rows', 'blocksy'),
|
| 43 |
+
],
|
| 44 |
+
|
| 45 |
+
'middle_bottom' => [
|
| 46 |
+
'src' => blocksy_image_picker_url('sticky-main-bottom.svg'),
|
| 47 |
+
'title' => __('Main & Bottom Row', 'blocksy'),
|
| 48 |
+
],
|
| 49 |
+
|
| 50 |
+
'top' => [
|
| 51 |
+
'src' => blocksy_image_picker_url('sticky-top.svg'),
|
| 52 |
+
'title' => __('Only Top Row', 'blocksy'),
|
| 53 |
+
],
|
| 54 |
+
|
| 55 |
+
'bottom' => [
|
| 56 |
+
'src' => blocksy_image_picker_url('sticky-bottom.svg'),
|
| 57 |
+
'title' => __('Only Bottom Row', 'blocksy'),
|
| 58 |
+
],
|
| 59 |
+
],
|
| 60 |
+
],
|
| 61 |
+
|
| 62 |
+
'sticky_effect' => [
|
| 63 |
+
'label' => __('Sticky Effect', 'blc' ),
|
| 64 |
+
'type' => 'ct-select',
|
| 65 |
+
'value' => 'shrink',
|
| 66 |
+
'design' => 'block',
|
| 67 |
+
'sync' => [
|
| 68 |
+
'id' => 'header_placements_1'
|
| 69 |
+
],
|
| 70 |
+
'choices' => blocksy_ordered_keys([
|
| 71 |
+
'shrink' => __('Default', 'blc'),
|
| 72 |
+
'slide' => __('Slide Down', 'blc'),
|
| 73 |
+
'fade' => __('Fade', 'blc'),
|
| 74 |
+
]),
|
| 75 |
+
],
|
| 76 |
+
|
| 77 |
+
'sticky_behaviour' => [
|
| 78 |
+
'label' => __( 'Enable on', 'blc' ),
|
| 79 |
+
'type' => 'ct-visibility',
|
| 80 |
+
'design' => 'block',
|
| 81 |
+
'sync' => 'live',
|
| 82 |
+
'value' => [
|
| 83 |
+
'desktop' => true,
|
| 84 |
+
// 'tablet' => true,
|
| 85 |
+
'mobile' => true,
|
| 86 |
+
],
|
| 87 |
+
|
| 88 |
+
'choices' => blocksy_ordered_keys([
|
| 89 |
+
'desktop' => __('Desktop', 'blc'),
|
| 90 |
+
// 'tablet' => __('Tablet', 'blc'),
|
| 91 |
+
'mobile' => __('Mobile', 'blc'),
|
| 92 |
+
]),
|
| 93 |
+
],
|
| 94 |
+
],
|
| 95 |
+
],
|
| 96 |
+
|
| 97 |
+
blocksy_rand_md5() => [
|
| 98 |
+
'type' => 'ct-divider',
|
| 99 |
+
],
|
| 100 |
+
|
| 101 |
+
'has_transparent_header' => [
|
| 102 |
+
'label' => __( 'Transparent Functionality', 'blc' ),
|
| 103 |
+
'type' => 'ct-switch',
|
| 104 |
+
'value' => 'no',
|
| 105 |
+
'sync' => [
|
| 106 |
+
'id' => 'header_placements_1'
|
| 107 |
+
]
|
| 108 |
+
],
|
| 109 |
+
|
| 110 |
+
blocksy_rand_md5() => [
|
| 111 |
+
'type' => 'ct-condition',
|
| 112 |
+
'condition' => [
|
| 113 |
+
'has_transparent_header' => 'yes',
|
| 114 |
+
'id' => 'type-1'
|
| 115 |
+
],
|
| 116 |
+
'options' => [
|
| 117 |
+
'transparent_conditions' => [
|
| 118 |
+
'type' => 'blocksy-display-condition',
|
| 119 |
+
'value' => [
|
| 120 |
+
[
|
| 121 |
+
'type' => 'include',
|
| 122 |
+
'rule' => 'everywhere'
|
| 123 |
+
],
|
| 124 |
+
|
| 125 |
+
[
|
| 126 |
+
'type' => 'exclude',
|
| 127 |
+
'rule' => '404'
|
| 128 |
+
],
|
| 129 |
+
|
| 130 |
+
[
|
| 131 |
+
'type' => 'exclude',
|
| 132 |
+
'rule' => 'search'
|
| 133 |
+
],
|
| 134 |
+
|
| 135 |
+
[
|
| 136 |
+
'type' => 'exclude',
|
| 137 |
+
'rule' => 'archives'
|
| 138 |
+
]
|
| 139 |
+
],
|
| 140 |
+
'label' => __( 'Display Conditions', 'blc' ),
|
| 141 |
+
'display' => 'modal',
|
| 142 |
+
'design' => 'block',
|
| 143 |
+
// 'divider' => 'top',
|
| 144 |
+
'sync' => [
|
| 145 |
+
'id' => 'header_placements_1'
|
| 146 |
+
]
|
| 147 |
+
],
|
| 148 |
+
]
|
| 149 |
+
],
|
| 150 |
+
|
| 151 |
+
blocksy_rand_md5() => [
|
| 152 |
+
'type' => 'ct-condition',
|
| 153 |
+
'condition' => [ 'has_transparent_header' => 'yes' ],
|
| 154 |
+
'options' => [
|
| 155 |
+
'transparent_behaviour' => [
|
| 156 |
+
'label' => __( 'Enable on', 'blc' ),
|
| 157 |
+
'type' => 'ct-visibility',
|
| 158 |
+
'design' => 'block',
|
| 159 |
+
'sync' => 'live',
|
| 160 |
+
'value' => [
|
| 161 |
+
'desktop' => true,
|
| 162 |
+
// 'tablet' => true,
|
| 163 |
+
'mobile' => true,
|
| 164 |
+
],
|
| 165 |
+
|
| 166 |
+
'choices' => blocksy_ordered_keys([
|
| 167 |
+
'desktop' => __('Desktop', 'blc'),
|
| 168 |
+
// 'tablet' => __('Tablet', 'blc'),
|
| 169 |
+
'mobile' => __('Mobile', 'blc'),
|
| 170 |
+
]),
|
| 171 |
+
],
|
| 172 |
+
|
| 173 |
+
],
|
| 174 |
+
],
|
| 175 |
+
|
| 176 |
+
];
|
| 177 |
+
|
framework/features/header/items/account/config.php
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
$config = [
|
| 4 |
+
'name' => __('Account', 'blocksy'),
|
| 5 |
+
|
| 6 |
+
/*
|
| 7 |
+
'typography_keys' => ['siteTitle', 'siteTagline'],
|
| 8 |
+
'selective_refresh' => [
|
| 9 |
+
'logo_type',
|
| 10 |
+
'blogname',
|
| 11 |
+
'custom_logo',
|
| 12 |
+
'has_mobile_logo',
|
| 13 |
+
'mobile_header_logo',
|
| 14 |
+
'has_tagline',
|
| 15 |
+
'site_description_wrapper',
|
| 16 |
+
'site_title_wrapper'
|
| 17 |
+
],
|
| 18 |
+
|
| 19 |
+
'translation_keys' => [
|
| 20 |
+
['key' => 'blogname']
|
| 21 |
+
]
|
| 22 |
+
*/
|
| 23 |
+
];
|
| 24 |
+
|
framework/features/header/items/account/dynamic-styles.php
ADDED
|
@@ -0,0 +1,277 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
if (! isset($root_selector)) {
|
| 4 |
+
$root_selector = ['.ct-header-account'];
|
| 5 |
+
}
|
| 6 |
+
|
| 7 |
+
// Icon size
|
| 8 |
+
blocksy_output_responsive([
|
| 9 |
+
'css' => $css,
|
| 10 |
+
'tablet_css' => $tablet_css,
|
| 11 |
+
'mobile_css' => $mobile_css,
|
| 12 |
+
'selector' => blc_call_fn([
|
| 13 |
+
'fn' => 'blocksy_assemble_selector',
|
| 14 |
+
'default' => $root_selector
|
| 15 |
+
], $root_selector),
|
| 16 |
+
'variableName' => 'icon-size',
|
| 17 |
+
'value' => blocksy_akg('accountHeaderIconSize', $atts, [
|
| 18 |
+
'mobile' => 15,
|
| 19 |
+
'tablet' => 15,
|
| 20 |
+
'desktop' => 15,
|
| 21 |
+
])
|
| 22 |
+
]);
|
| 23 |
+
|
| 24 |
+
// Avatar size
|
| 25 |
+
blocksy_output_responsive([
|
| 26 |
+
'css' => $css,
|
| 27 |
+
'tablet_css' => $tablet_css,
|
| 28 |
+
'mobile_css' => $mobile_css,
|
| 29 |
+
'selector' => blc_call_fn([
|
| 30 |
+
'fn' => 'blocksy_assemble_selector',
|
| 31 |
+
'default' => $root_selector
|
| 32 |
+
], $root_selector),
|
| 33 |
+
'variableName' => 'avatar-size',
|
| 34 |
+
'value' => blocksy_akg('accountHeaderAvatarSize', $atts, [
|
| 35 |
+
'mobile' => 22,
|
| 36 |
+
'tablet' => 22,
|
| 37 |
+
'desktop' => 22,
|
| 38 |
+
])
|
| 39 |
+
]);
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
// Modal background
|
| 43 |
+
blocksy_output_background_css([
|
| 44 |
+
'selector' => blc_call_fn([
|
| 45 |
+
'fn' => 'blocksy_assemble_selector',
|
| 46 |
+
'default' => $root_selector
|
| 47 |
+
], blc_call_fn([
|
| 48 |
+
'fn' => 'blocksy_mutate_selector',
|
| 49 |
+
], [
|
| 50 |
+
'selector' => [$root_selector[0]],
|
| 51 |
+
'operation' => 'suffix',
|
| 52 |
+
'to_add' => '#account-modal'
|
| 53 |
+
])),
|
| 54 |
+
'css' => $css,
|
| 55 |
+
'value' => blocksy_akg('accountHeaderBackground', $atts,
|
| 56 |
+
blocksy_background_default_value([
|
| 57 |
+
'backgroundColor' => [
|
| 58 |
+
'default' => [
|
| 59 |
+
'color' => 'rgba(18, 21, 25, 0.7)'
|
| 60 |
+
],
|
| 61 |
+
],
|
| 62 |
+
])
|
| 63 |
+
)
|
| 64 |
+
]);
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
// Item margin
|
| 68 |
+
blocksy_output_spacing([
|
| 69 |
+
'css' => $css,
|
| 70 |
+
'tablet_css' => $tablet_css,
|
| 71 |
+
'mobile_css' => $mobile_css,
|
| 72 |
+
'selector' => blc_call_fn([
|
| 73 |
+
'fn' => 'blocksy_assemble_selector',
|
| 74 |
+
'default' => $root_selector
|
| 75 |
+
], $root_selector),
|
| 76 |
+
'important' => true,
|
| 77 |
+
'value' => blocksy_default_akg(
|
| 78 |
+
'accountHeaderMargin', $atts,
|
| 79 |
+
blocksy_spacing_value([
|
| 80 |
+
'linked' => true,
|
| 81 |
+
])
|
| 82 |
+
)
|
| 83 |
+
]);
|
| 84 |
+
|
| 85 |
+
// default state
|
| 86 |
+
blocksy_output_colors([
|
| 87 |
+
'value' => blocksy_akg('accountHeaderColor', $atts),
|
| 88 |
+
'default' => [
|
| 89 |
+
'default' => [ 'color' => 'var(--color)' ],
|
| 90 |
+
'hover' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
|
| 91 |
+
],
|
| 92 |
+
'css' => $css,
|
| 93 |
+
'tablet_css' => $tablet_css,
|
| 94 |
+
'mobile_css' => $mobile_css,
|
| 95 |
+
'variables' => [
|
| 96 |
+
'default' => [
|
| 97 |
+
'selector' => blc_call_fn([
|
| 98 |
+
'fn' => 'blocksy_assemble_selector',
|
| 99 |
+
'default' => $root_selector
|
| 100 |
+
], $root_selector),
|
| 101 |
+
'variable' => 'linkInitialColor'
|
| 102 |
+
],
|
| 103 |
+
|
| 104 |
+
'hover' => [
|
| 105 |
+
'selector' => blc_call_fn([
|
| 106 |
+
'fn' => 'blocksy_assemble_selector',
|
| 107 |
+
'default' => $root_selector
|
| 108 |
+
], $root_selector),
|
| 109 |
+
'variable' => 'linkHoverColor'
|
| 110 |
+
],
|
| 111 |
+
],
|
| 112 |
+
'responsive' => true
|
| 113 |
+
]);
|
| 114 |
+
|
| 115 |
+
// transparent state
|
| 116 |
+
if (isset($has_transparent_header) && $has_transparent_header) {
|
| 117 |
+
blocksy_output_colors([
|
| 118 |
+
'value' => blocksy_akg('transparentAccountHeaderColor', $atts),
|
| 119 |
+
'default' => [
|
| 120 |
+
'default' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
|
| 121 |
+
'hover' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
|
| 122 |
+
],
|
| 123 |
+
'css' => $css,
|
| 124 |
+
'tablet_css' => $tablet_css,
|
| 125 |
+
'mobile_css' => $mobile_css,
|
| 126 |
+
|
| 127 |
+
'variables' => [
|
| 128 |
+
'default' => [
|
| 129 |
+
'selector' => blc_call_fn([
|
| 130 |
+
'fn' => 'blocksy_assemble_selector',
|
| 131 |
+
'default' => $root_selector
|
| 132 |
+
], blc_call_fn([
|
| 133 |
+
'fn' => 'blocksy_mutate_selector',
|
| 134 |
+
], [
|
| 135 |
+
'selector' => $root_selector,
|
| 136 |
+
'to_add' => '[data-transparent-row="yes"]'
|
| 137 |
+
])),
|
| 138 |
+
'variable' => 'linkInitialColor'
|
| 139 |
+
],
|
| 140 |
+
|
| 141 |
+
'hover' => [
|
| 142 |
+
'selector' => blc_call_fn([
|
| 143 |
+
'fn' => 'blocksy_assemble_selector',
|
| 144 |
+
'default' => $root_selector
|
| 145 |
+
], blc_call_fn([
|
| 146 |
+
'fn' => 'blocksy_mutate_selector',
|
| 147 |
+
], [
|
| 148 |
+
'selector' => $root_selector,
|
| 149 |
+
'to_add' => '[data-transparent-row="yes"]'
|
| 150 |
+
])),
|
| 151 |
+
'variable' => 'linkHoverColor'
|
| 152 |
+
],
|
| 153 |
+
],
|
| 154 |
+
'responsive' => true
|
| 155 |
+
]);
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
// sticky state
|
| 159 |
+
if (isset($has_sticky_header) && $has_sticky_header) {
|
| 160 |
+
blocksy_output_colors([
|
| 161 |
+
'value' => blocksy_akg('stickyAccountHeaderColor', $atts),
|
| 162 |
+
'default' => [
|
| 163 |
+
'default' => ['color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT')],
|
| 164 |
+
'hover' => ['color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT')],
|
| 165 |
+
],
|
| 166 |
+
'css' => $css,
|
| 167 |
+
'tablet_css' => $tablet_css,
|
| 168 |
+
'mobile_css' => $mobile_css,
|
| 169 |
+
|
| 170 |
+
'variables' => [
|
| 171 |
+
'default' => [
|
| 172 |
+
'selector' => blc_call_fn([
|
| 173 |
+
'fn' => 'blocksy_assemble_selector',
|
| 174 |
+
'default' => $root_selector
|
| 175 |
+
], blc_call_fn([
|
| 176 |
+
'fn' => 'blocksy_mutate_selector',
|
| 177 |
+
], [
|
| 178 |
+
'selector' => $root_selector,
|
| 179 |
+
'to_add' => '[data-sticky*="yes"]'
|
| 180 |
+
])),
|
| 181 |
+
'variable' => 'linkInitialColor'
|
| 182 |
+
],
|
| 183 |
+
|
| 184 |
+
'hover' => [
|
| 185 |
+
'selector' => blc_call_fn([
|
| 186 |
+
'fn' => 'blocksy_assemble_selector',
|
| 187 |
+
'default' => $root_selector
|
| 188 |
+
], blc_call_fn([
|
| 189 |
+
'fn' => 'blocksy_mutate_selector',
|
| 190 |
+
], [
|
| 191 |
+
'selector' => $root_selector,
|
| 192 |
+
'to_add' => '[data-sticky*="yes"]'
|
| 193 |
+
])),
|
| 194 |
+
'variable' => 'linkHoverColor'
|
| 195 |
+
],
|
| 196 |
+
],
|
| 197 |
+
'responsive' => true
|
| 198 |
+
]);
|
| 199 |
+
}
|
| 200 |
+
|
| 201 |
+
blocksy_output_colors([
|
| 202 |
+
'value' => blocksy_akg('account_close_button_color', $atts),
|
| 203 |
+
'default' => [
|
| 204 |
+
'default' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
|
| 205 |
+
'hover' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
|
| 206 |
+
],
|
| 207 |
+
'css' => $css,
|
| 208 |
+
|
| 209 |
+
'variables' => [
|
| 210 |
+
'default' => [
|
| 211 |
+
'selector' => blc_call_fn([
|
| 212 |
+
'fn' => 'blocksy_assemble_selector',
|
| 213 |
+
'default' => $root_selector
|
| 214 |
+
], blc_call_fn([
|
| 215 |
+
'fn' => 'blocksy_mutate_selector',
|
| 216 |
+
], [
|
| 217 |
+
'selector' => [$root_selector[0]],
|
| 218 |
+
'operation' => 'suffix',
|
| 219 |
+
'to_add' => '#account-modal .close-button'
|
| 220 |
+
])),
|
| 221 |
+
'variable' => 'closeButtonColor'
|
| 222 |
+
],
|
| 223 |
+
|
| 224 |
+
'hover' => [
|
| 225 |
+
'selector' => blc_call_fn([
|
| 226 |
+
'fn' => 'blocksy_assemble_selector',
|
| 227 |
+
'default' => $root_selector
|
| 228 |
+
], blc_call_fn([
|
| 229 |
+
'fn' => 'blocksy_mutate_selector',
|
| 230 |
+
], [
|
| 231 |
+
'selector' => [$root_selector[0]],
|
| 232 |
+
'operation' => 'suffix',
|
| 233 |
+
'to_add' => '#account-modal .close-button'
|
| 234 |
+
])),
|
| 235 |
+
'variable' => 'closeButtonHoverColor'
|
| 236 |
+
]
|
| 237 |
+
],
|
| 238 |
+
]);
|
| 239 |
+
|
| 240 |
+
blocksy_output_colors([
|
| 241 |
+
'value' => blocksy_akg('account_close_button_shape_color', $atts),
|
| 242 |
+
'default' => [
|
| 243 |
+
'default' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
|
| 244 |
+
'hover' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
|
| 245 |
+
],
|
| 246 |
+
'css' => $css,
|
| 247 |
+
|
| 248 |
+
'variables' => [
|
| 249 |
+
'default' => [
|
| 250 |
+
'selector' => blc_call_fn([
|
| 251 |
+
'fn' => 'blocksy_assemble_selector',
|
| 252 |
+
'default' => $root_selector
|
| 253 |
+
], blc_call_fn([
|
| 254 |
+
'fn' => 'blocksy_mutate_selector',
|
| 255 |
+
], [
|
| 256 |
+
'selector' => [$root_selector[0]],
|
| 257 |
+
'operation' => 'suffix',
|
| 258 |
+
'to_add' => '#account-modal .close-button'
|
| 259 |
+
])),
|
| 260 |
+
'variable' => 'closeButtonBackground'
|
| 261 |
+
],
|
| 262 |
+
|
| 263 |
+
'hover' => [
|
| 264 |
+
'selector' => blc_call_fn([
|
| 265 |
+
'fn' => 'blocksy_assemble_selector',
|
| 266 |
+
'default' => $root_selector
|
| 267 |
+
], blc_call_fn([
|
| 268 |
+
'fn' => 'blocksy_mutate_selector',
|
| 269 |
+
], [
|
| 270 |
+
'selector' => [$root_selector[0]],
|
| 271 |
+
'operation' => 'suffix',
|
| 272 |
+
'to_add' => '#account-modal .close-button'
|
| 273 |
+
])),
|
| 274 |
+
'variable' => 'closeButtonHoverBackground'
|
| 275 |
+
]
|
| 276 |
+
],
|
| 277 |
+
]);
|
framework/features/header/items/account/options.php
ADDED
|
@@ -0,0 +1,388 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
$options = [
|
| 4 |
+
blocksy_rand_md5() => [
|
| 5 |
+
'title' => __( 'General', 'blc' ),
|
| 6 |
+
'type' => 'tab',
|
| 7 |
+
'options' => [
|
| 8 |
+
|
| 9 |
+
blocksy_rand_md5() => [
|
| 10 |
+
'type' => 'ct-title',
|
| 11 |
+
'label' => __( 'Login State', 'blc' ),
|
| 12 |
+
],
|
| 13 |
+
|
| 14 |
+
'login_style' => [
|
| 15 |
+
'label' => false,
|
| 16 |
+
'type' => 'ct-checkboxes',
|
| 17 |
+
'design' => 'block',
|
| 18 |
+
'view' => 'text',
|
| 19 |
+
'disableRevertButton' => true,
|
| 20 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 21 |
+
'value' => [
|
| 22 |
+
'icon' => true,
|
| 23 |
+
'label' => false,
|
| 24 |
+
],
|
| 25 |
+
|
| 26 |
+
'choices' => blocksy_ordered_keys([
|
| 27 |
+
'icon' => __( 'Icon', 'blc' ),
|
| 28 |
+
'label' => __( 'Label', 'blc' ),
|
| 29 |
+
]),
|
| 30 |
+
],
|
| 31 |
+
|
| 32 |
+
blocksy_rand_md5() => [
|
| 33 |
+
'type' => 'ct-condition',
|
| 34 |
+
'condition' => [ 'login_style/icon' => true ],
|
| 35 |
+
'options' => [
|
| 36 |
+
|
| 37 |
+
'accountHeaderIconSize' => [
|
| 38 |
+
'label' => __( 'Icon Size', 'blc' ),
|
| 39 |
+
'type' => 'ct-slider',
|
| 40 |
+
'min' => 5,
|
| 41 |
+
'max' => 50,
|
| 42 |
+
'value' => 15,
|
| 43 |
+
'responsive' => true,
|
| 44 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 45 |
+
],
|
| 46 |
+
|
| 47 |
+
],
|
| 48 |
+
],
|
| 49 |
+
|
| 50 |
+
blocksy_rand_md5() => [
|
| 51 |
+
'type' => 'ct-condition',
|
| 52 |
+
'condition' => [ 'login_style/label' => true ],
|
| 53 |
+
'options' => [
|
| 54 |
+
|
| 55 |
+
'login_label' => [
|
| 56 |
+
'label' => __('Label', 'blc'),
|
| 57 |
+
'type' => 'text',
|
| 58 |
+
'design' => 'inline',
|
| 59 |
+
'disableRevertButton' => true,
|
| 60 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 61 |
+
'value' => __('Login', 'blc')
|
| 62 |
+
],
|
| 63 |
+
|
| 64 |
+
],
|
| 65 |
+
],
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
blocksy_rand_md5() => [
|
| 69 |
+
'type' => 'ct-title',
|
| 70 |
+
'label' => __( 'Logged In State', 'blc' ),
|
| 71 |
+
],
|
| 72 |
+
|
| 73 |
+
'loggedin_style' => [
|
| 74 |
+
'label' => false,
|
| 75 |
+
'type' => 'ct-checkboxes',
|
| 76 |
+
'design' => 'block',
|
| 77 |
+
'view' => 'text',
|
| 78 |
+
'disableRevertButton' => true,
|
| 79 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 80 |
+
'value' => [
|
| 81 |
+
'avatar' => true,
|
| 82 |
+
'label' => false,
|
| 83 |
+
],
|
| 84 |
+
|
| 85 |
+
'choices' => blocksy_ordered_keys([
|
| 86 |
+
'avatar' => __( 'Avatar', 'blc' ),
|
| 87 |
+
'label' => __( 'Label', 'blc' ),
|
| 88 |
+
]),
|
| 89 |
+
],
|
| 90 |
+
|
| 91 |
+
blocksy_rand_md5() => [
|
| 92 |
+
'type' => 'ct-condition',
|
| 93 |
+
'condition' => [ 'loggedin_style/avatar' => true ],
|
| 94 |
+
'options' => [
|
| 95 |
+
|
| 96 |
+
'accountHeaderAvatarSize' => [
|
| 97 |
+
'label' => __( 'Avatar Size', 'blc' ),
|
| 98 |
+
'type' => 'ct-slider',
|
| 99 |
+
'min' => 10,
|
| 100 |
+
'max' => 40,
|
| 101 |
+
'value' => 18,
|
| 102 |
+
'responsive' => true,
|
| 103 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 104 |
+
],
|
| 105 |
+
|
| 106 |
+
],
|
| 107 |
+
],
|
| 108 |
+
|
| 109 |
+
blocksy_rand_md5() => [
|
| 110 |
+
'type' => 'ct-condition',
|
| 111 |
+
'condition' => [ 'loggedin_style/label' => true ],
|
| 112 |
+
'options' => [
|
| 113 |
+
|
| 114 |
+
'loggedin_label' => [
|
| 115 |
+
'label' => __('Label'),
|
| 116 |
+
'type' => 'text',
|
| 117 |
+
'design' => 'inline',
|
| 118 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 119 |
+
'value' => __('My Account', 'blc')
|
| 120 |
+
],
|
| 121 |
+
|
| 122 |
+
],
|
| 123 |
+
],
|
| 124 |
+
|
| 125 |
+
'account_link' => [
|
| 126 |
+
'label' => __( 'Action', 'blc' ),
|
| 127 |
+
'type' => 'ct-select',
|
| 128 |
+
'value' => 'profile',
|
| 129 |
+
'view' => 'text',
|
| 130 |
+
'design' => 'inline',
|
| 131 |
+
'desc' => __( 'Set the action you want to make when clicking on the element whyile you are logged in.', 'blc' ),
|
| 132 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 133 |
+
'choices' => blocksy_ordered_keys(
|
| 134 |
+
[
|
| 135 |
+
'profile' => __( 'Profile Page', 'blc' ),
|
| 136 |
+
'dashboard' => __( 'Dashboard Page', 'blc' ),
|
| 137 |
+
'logout' => __( 'Logout', 'blc' ),
|
| 138 |
+
'custom' => __( 'Custom Page', 'blc' ),
|
| 139 |
+
]
|
| 140 |
+
),
|
| 141 |
+
],
|
| 142 |
+
|
| 143 |
+
blocksy_rand_md5() => [
|
| 144 |
+
'type' => 'ct-condition',
|
| 145 |
+
'condition' => [ 'account_link' => 'custom' ],
|
| 146 |
+
'options' => [
|
| 147 |
+
|
| 148 |
+
'account_custom_page' => [
|
| 149 |
+
'label' => __( 'Custom Page Link', 'blc' ),
|
| 150 |
+
'type' => 'text',
|
| 151 |
+
'design' => 'inline',
|
| 152 |
+
'disableRevertButton' => true,
|
| 153 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 154 |
+
'value' => ''
|
| 155 |
+
],
|
| 156 |
+
|
| 157 |
+
],
|
| 158 |
+
],
|
| 159 |
+
|
| 160 |
+
],
|
| 161 |
+
],
|
| 162 |
+
|
| 163 |
+
blocksy_rand_md5() => [
|
| 164 |
+
'title' => __( 'Design', 'blc' ),
|
| 165 |
+
'type' => 'tab',
|
| 166 |
+
'options' => [
|
| 167 |
+
|
| 168 |
+
blocksy_rand_md5() => [
|
| 169 |
+
'type' => 'ct-labeled-group',
|
| 170 |
+
'label' => __( 'Content Color', 'blc' ),
|
| 171 |
+
'responsive' => true,
|
| 172 |
+
'choices' => [
|
| 173 |
+
[
|
| 174 |
+
'id' => 'accountHeaderColor',
|
| 175 |
+
'label' => __('Default State', 'blc')
|
| 176 |
+
],
|
| 177 |
+
|
| 178 |
+
[
|
| 179 |
+
'id' => 'transparentAccountHeaderColor',
|
| 180 |
+
'label' => __('Transparent State', 'blc'),
|
| 181 |
+
'condition' => [
|
| 182 |
+
'builderSettings/has_transparent_header' => 'yes',
|
| 183 |
+
],
|
| 184 |
+
],
|
| 185 |
+
|
| 186 |
+
[
|
| 187 |
+
'id' => 'stickyAccountHeaderColor',
|
| 188 |
+
'label' => __('Sticky State', 'blc'),
|
| 189 |
+
'condition' => [
|
| 190 |
+
'builderSettings/has_sticky_header' => 'yes',
|
| 191 |
+
],
|
| 192 |
+
],
|
| 193 |
+
],
|
| 194 |
+
'options' => [
|
| 195 |
+
|
| 196 |
+
'accountHeaderColor' => [
|
| 197 |
+
'label' => __( 'Content Color', 'blc' ),
|
| 198 |
+
'type' => 'ct-color-picker',
|
| 199 |
+
'design' => 'block:right',
|
| 200 |
+
'responsive' => true,
|
| 201 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 202 |
+
|
| 203 |
+
'value' => [
|
| 204 |
+
'default' => [
|
| 205 |
+
'color' => 'var(--color)',
|
| 206 |
+
],
|
| 207 |
+
|
| 208 |
+
'hover' => [
|
| 209 |
+
'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
|
| 210 |
+
],
|
| 211 |
+
],
|
| 212 |
+
|
| 213 |
+
'pickers' => [
|
| 214 |
+
[
|
| 215 |
+
'title' => __( 'Initial', 'blc' ),
|
| 216 |
+
'id' => 'default',
|
| 217 |
+
],
|
| 218 |
+
|
| 219 |
+
[
|
| 220 |
+
'title' => __( 'Hover', 'blc' ),
|
| 221 |
+
'id' => 'hover',
|
| 222 |
+
'inherit' => 'var(--linkHoverColor)'
|
| 223 |
+
],
|
| 224 |
+
],
|
| 225 |
+
],
|
| 226 |
+
|
| 227 |
+
'transparentAccountHeaderColor' => [
|
| 228 |
+
'label' => __( 'Content Color', 'blc' ),
|
| 229 |
+
'type' => 'ct-color-picker',
|
| 230 |
+
'design' => 'block:right',
|
| 231 |
+
'responsive' => true,
|
| 232 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 233 |
+
|
| 234 |
+
'value' => [
|
| 235 |
+
'default' => [
|
| 236 |
+
'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
|
| 237 |
+
],
|
| 238 |
+
|
| 239 |
+
'hover' => [
|
| 240 |
+
'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
|
| 241 |
+
],
|
| 242 |
+
],
|
| 243 |
+
|
| 244 |
+
'pickers' => [
|
| 245 |
+
[
|
| 246 |
+
'title' => __( 'Initial', 'blc' ),
|
| 247 |
+
'id' => 'default',
|
| 248 |
+
],
|
| 249 |
+
|
| 250 |
+
[
|
| 251 |
+
'title' => __( 'Hover', 'blc' ),
|
| 252 |
+
'id' => 'hover',
|
| 253 |
+
],
|
| 254 |
+
],
|
| 255 |
+
],
|
| 256 |
+
|
| 257 |
+
'stickyAccountHeaderColor' => [
|
| 258 |
+
'label' => __( 'Content Color', 'blc' ),
|
| 259 |
+
'type' => 'ct-color-picker',
|
| 260 |
+
'design' => 'block:right',
|
| 261 |
+
'responsive' => true,
|
| 262 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 263 |
+
|
| 264 |
+
'value' => [
|
| 265 |
+
'default' => [
|
| 266 |
+
'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
|
| 267 |
+
],
|
| 268 |
+
|
| 269 |
+
'hover' => [
|
| 270 |
+
'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
|
| 271 |
+
],
|
| 272 |
+
],
|
| 273 |
+
|
| 274 |
+
'pickers' => [
|
| 275 |
+
[
|
| 276 |
+
'title' => __( 'Initial', 'blc' ),
|
| 277 |
+
'id' => 'default',
|
| 278 |
+
],
|
| 279 |
+
|
| 280 |
+
[
|
| 281 |
+
'title' => __( 'Hover', 'blc' ),
|
| 282 |
+
'id' => 'hover',
|
| 283 |
+
],
|
| 284 |
+
],
|
| 285 |
+
],
|
| 286 |
+
|
| 287 |
+
],
|
| 288 |
+
],
|
| 289 |
+
|
| 290 |
+
blocksy_rand_md5() => [
|
| 291 |
+
'type' => 'ct-divider',
|
| 292 |
+
],
|
| 293 |
+
|
| 294 |
+
'accountHeaderMargin' => [
|
| 295 |
+
'label' => __( 'Item Margin', 'blc' ),
|
| 296 |
+
'type' => 'ct-spacing',
|
| 297 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 298 |
+
'value' => blocksy_spacing_value([
|
| 299 |
+
'linked' => true,
|
| 300 |
+
]),
|
| 301 |
+
'responsive' => true
|
| 302 |
+
],
|
| 303 |
+
|
| 304 |
+
blocksy_rand_md5() => [
|
| 305 |
+
'type' => 'ct-divider',
|
| 306 |
+
],
|
| 307 |
+
|
| 308 |
+
'account_close_button_color' => [
|
| 309 |
+
'label' => __( 'Close Icon Color', 'blc' ),
|
| 310 |
+
'type' => 'ct-color-picker',
|
| 311 |
+
'design' => 'inline',
|
| 312 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 313 |
+
|
| 314 |
+
'value' => [
|
| 315 |
+
'default' => [
|
| 316 |
+
'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
|
| 317 |
+
],
|
| 318 |
+
|
| 319 |
+
'hover' => [
|
| 320 |
+
'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
|
| 321 |
+
],
|
| 322 |
+
],
|
| 323 |
+
|
| 324 |
+
'pickers' => [
|
| 325 |
+
[
|
| 326 |
+
'title' => __( 'Initial', 'blc' ),
|
| 327 |
+
'id' => 'default',
|
| 328 |
+
'inherit' => 'rgba(255, 255, 255, 0.7)'
|
| 329 |
+
],
|
| 330 |
+
|
| 331 |
+
[
|
| 332 |
+
'title' => __( 'Hover', 'blc' ),
|
| 333 |
+
'id' => 'hover',
|
| 334 |
+
'inherit' => '#ffffff'
|
| 335 |
+
],
|
| 336 |
+
],
|
| 337 |
+
],
|
| 338 |
+
|
| 339 |
+
'account_close_button_shape_color' => [
|
| 340 |
+
'label' => __( 'Close Icon Background', 'blc' ),
|
| 341 |
+
'type' => 'ct-color-picker',
|
| 342 |
+
'design' => 'inline',
|
| 343 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 344 |
+
|
| 345 |
+
'value' => [
|
| 346 |
+
'default' => [
|
| 347 |
+
'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
|
| 348 |
+
],
|
| 349 |
+
|
| 350 |
+
'hover' => [
|
| 351 |
+
'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
|
| 352 |
+
],
|
| 353 |
+
],
|
| 354 |
+
|
| 355 |
+
'pickers' => [
|
| 356 |
+
[
|
| 357 |
+
'title' => __( 'Initial', 'blc' ),
|
| 358 |
+
'id' => 'default',
|
| 359 |
+
'inherit' => 'rgba(0, 0, 0, 0.5)'
|
| 360 |
+
],
|
| 361 |
+
|
| 362 |
+
[
|
| 363 |
+
'title' => __( 'Hover', 'blc' ),
|
| 364 |
+
'id' => 'hover',
|
| 365 |
+
'inherit' => 'rgba(0, 0, 0, 0.5)'
|
| 366 |
+
],
|
| 367 |
+
],
|
| 368 |
+
],
|
| 369 |
+
|
| 370 |
+
'accountHeaderBackground' => [
|
| 371 |
+
'label' => __( 'Modal Backdrop', 'blc' ),
|
| 372 |
+
'type' => 'ct-background',
|
| 373 |
+
'design' => 'inline',
|
| 374 |
+
'divider' => 'top',
|
| 375 |
+
'setting' => [ 'transport' => 'postMessage' ],
|
| 376 |
+
'value' => blocksy_background_default_value([
|
| 377 |
+
'backgroundColor' => [
|
| 378 |
+
'default' => [
|
| 379 |
+
'color' => 'rgba(18, 21, 25, 0.7)'
|
| 380 |
+
],
|
| 381 |
+
],
|
| 382 |
+
])
|
| 383 |
+
],
|
| 384 |
+
|
| 385 |
+
],
|
| 386 |
+
],
|
| 387 |
+
];
|
| 388 |
+
|
framework/features/header/items/account/sync.js
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import ctEvents from 'ct-events'
|
| 2 |
+
import {
|
| 3 |
+
updateAndSaveEl,
|
| 4 |
+
handleBackgroundOptionFor,
|
| 5 |
+
assembleSelector,
|
| 6 |
+
mutateSelector,
|
| 7 |
+
getRootSelectorFor,
|
| 8 |
+
} from 'blocksy-customizer-sync'
|
| 9 |
+
import { markImagesAsLoaded } from '../../../../extensions/cookies-consent/static/js/lazy-load-helpers'
|
| 10 |
+
|
| 11 |
+
/*
|
| 12 |
+
selector: assembleSelector(
|
| 13 |
+
mutateSelector({
|
| 14 |
+
selector: getRootSelectorFor({ itemId }),
|
| 15 |
+
operation: 'suffix',
|
| 16 |
+
to_add: '.ct-button',
|
| 17 |
+
})
|
| 18 |
+
),
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
ctEvents.on(
|
| 22 |
+
'ct:header:sync:collect-variable-descriptors',
|
| 23 |
+
(variableDescriptors) => {
|
| 24 |
+
variableDescriptors['account'] = ({ itemId }) => ({
|
| 25 |
+
accountHeaderIconSize: {
|
| 26 |
+
selector: assembleSelector(getRootSelectorFor({ itemId })),
|
| 27 |
+
|
| 28 |
+
variable: 'icon-size',
|
| 29 |
+
responsive: true,
|
| 30 |
+
unit: 'px',
|
| 31 |
+
},
|
| 32 |
+
|
| 33 |
+
accountHeaderAvatarSize: {
|
| 34 |
+
selector: assembleSelector(getRootSelectorFor({ itemId })),
|
| 35 |
+
variable: 'avatar-size',
|
| 36 |
+
responsive: true,
|
| 37 |
+
unit: 'px',
|
| 38 |
+
},
|
| 39 |
+
|
| 40 |
+
...handleBackgroundOptionFor({
|
| 41 |
+
id: 'accountHeaderBackground',
|
| 42 |
+
selector: '#account-modal',
|
| 43 |
+
|
| 44 |
+
selector: assembleSelector(
|
| 45 |
+
mutateSelector({
|
| 46 |
+
selector: [getRootSelectorFor({ itemId })[0]],
|
| 47 |
+
operation: 'suffix',
|
| 48 |
+
to_add: '#account-modal',
|
| 49 |
+
})
|
| 50 |
+
),
|
| 51 |
+
}),
|
| 52 |
+
|
| 53 |
+
accountHeaderMargin: {
|
| 54 |
+
selector: assembleSelector(getRootSelectorFor({ itemId })),
|
| 55 |
+
type: 'spacing',
|
| 56 |
+
variable: 'margin',
|
| 57 |
+
responsive: true,
|
| 58 |
+
important: true,
|
| 59 |
+
},
|
| 60 |
+
|
| 61 |
+
// default state
|
| 62 |
+
accountHeaderColor: [
|
| 63 |
+
{
|
| 64 |
+
selector: assembleSelector(getRootSelectorFor({ itemId })),
|
| 65 |
+
variable: 'linkInitialColor',
|
| 66 |
+
type: 'color:default',
|
| 67 |
+
responsive: true,
|
| 68 |
+
},
|
| 69 |
+
|
| 70 |
+
{
|
| 71 |
+
selector: assembleSelector(getRootSelectorFor({ itemId })),
|
| 72 |
+
variable: 'linkHoverColor',
|
| 73 |
+
type: 'color:hover',
|
| 74 |
+
responsive: true,
|
| 75 |
+
},
|
| 76 |
+
],
|
| 77 |
+
|
| 78 |
+
// transparent state
|
| 79 |
+
transparentAccountHeaderColor: [
|
| 80 |
+
{
|
| 81 |
+
selector: assembleSelector(
|
| 82 |
+
mutateSelector({
|
| 83 |
+
selector: getRootSelectorFor({ itemId }),
|
| 84 |
+
operation: 'between',
|
| 85 |
+
to_add: '[data-transparent-row="yes"]',
|
| 86 |
+
})
|
| 87 |
+
),
|
| 88 |
+
|
| 89 |
+
variable: 'linkInitialColor',
|
| 90 |
+
type: 'color:default',
|
| 91 |
+
responsive: true,
|
| 92 |
+
},
|
| 93 |
+
|
| 94 |
+
{
|
| 95 |
+
selector: assembleSelector(
|
| 96 |
+
mutateSelector({
|
| 97 |
+
selector: getRootSelectorFor({ itemId }),
|
| 98 |
+
operation: 'between',
|
| 99 |
+
to_add: '[data-transparent-row="yes"]',
|
| 100 |
+
})
|
| 101 |
+
),
|
| 102 |
+
|
| 103 |
+
variable: 'linkHoverColor',
|
| 104 |
+
type: 'color:hover',
|
| 105 |
+
responsive: true,
|
| 106 |
+
},
|
| 107 |
+
],
|
| 108 |
+
|
| 109 |
+
// sticky state
|
| 110 |
+
stickyAccountHeaderColor: [
|
| 111 |
+
{
|
| 112 |
+
selector: assembleSelector(
|
| 113 |
+
mutateSelector({
|
| 114 |
+
selector: getRootSelectorFor({ itemId }),
|
| 115 |
+
operation: 'between',
|
| 116 |
+
to_add: '[data-sticky*="yes"]',
|
| 117 |
+
})
|
| 118 |
+
),
|
| 119 |
+
variable: 'linkInitialColor',
|
| 120 |
+
type: 'color:default',
|
| 121 |
+
responsive: true,
|
| 122 |
+
},
|
| 123 |
+
|
| 124 |
+
{
|
| 125 |
+
selector: assembleSelector(
|
| 126 |
+
mutateSelector({
|
| 127 |
+
selector: getRootSelectorFor({ itemId }),
|
| 128 |
+
operation: 'between',
|
| 129 |
+
to_add: '[data-sticky*="yes"]',
|
| 130 |
+
})
|
| 131 |
+
),
|
| 132 |
+
variable: 'linkHoverColor',
|
| 133 |
+
type: 'color:hover',
|
| 134 |
+
responsive: true,
|
| 135 |
+
},
|
| 136 |
+
],
|
| 137 |
+
})
|
| 138 |
+
}
|
| 139 |
+
)
|
| 140 |
+
|
| 141 |
+
ctEvents.on(
|
| 142 |
+
'ct:header:sync:item:account',
|
| 143 |
+
({ values: { loggedin_style, loggedin_label }, optionId, optionValue }) => {
|
| 144 |
+
const selector = '[data-id="account"]'
|
| 145 |
+
|
| 146 |
+
if (optionId === 'loggedin_style' || optionId === 'loggedin_label') {
|
| 147 |
+
updateAndSaveEl(selector, (el) => {
|
| 148 |
+
;[...el.querySelectorAll('.ct-label')].map((label) => {
|
| 149 |
+
label.removeAttribute('hidden')
|
| 150 |
+
|
| 151 |
+
if (!loggedin_style.label) {
|
| 152 |
+
label.hidden = true
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
label.innerHTML = loggedin_label
|
| 156 |
+
})
|
| 157 |
+
;[...el.querySelectorAll('.ct-image-container')].map((img) => {
|
| 158 |
+
img.removeAttribute('hidden')
|
| 159 |
+
|
| 160 |
+
if (!loggedin_style.avatar) {
|
| 161 |
+
img.hidden = true
|
| 162 |
+
}
|
| 163 |
+
|
| 164 |
+
markImagesAsLoaded(img.parentNode)
|
| 165 |
+
})
|
| 166 |
+
})
|
| 167 |
+
}
|
| 168 |
+
}
|
| 169 |
+
)
|
framework/features/header/items/account/view.php
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
$current_user_id = get_current_user_id();
|
| 4 |
+
|
| 5 |
+
$avatar_html = '';
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
$link = get_edit_profile_url();
|
| 9 |
+
$account_link = blocksy_akg('account_link', $atts, 'profile');
|
| 10 |
+
|
| 11 |
+
if ($account_link === 'dashboard') {
|
| 12 |
+
$link = admin_url();
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
if ($account_link === 'logout') {
|
| 16 |
+
$link = wp_logout_url(blocksy_current_url());
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
if ($account_link === 'custom') {
|
| 20 |
+
$link = blocksy_akg('account_custom_page', $atts, '');
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
$class = 'ct-header-account';
|
| 24 |
+
|
| 25 |
+
if ($current_user_id) {
|
| 26 |
+
$class .= ' ct-logged-in';
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
$loggedin_style = blocksy_akg('loggedin_style', $atts, [
|
| 30 |
+
'avatar' => true,
|
| 31 |
+
'label' => false
|
| 32 |
+
]);
|
| 33 |
+
|
| 34 |
+
$login_style = blocksy_akg('login_style', $atts, [
|
| 35 |
+
'icon' => true,
|
| 36 |
+
'label' => false
|
| 37 |
+
]);
|
| 38 |
+
|
| 39 |
+
$loggedin_label = blocksy_akg('loggedin_label', $atts, __('Label', 'blc'));
|
| 40 |
+
$login_label = blocksy_akg('login_label', $atts, __('Label', 'blc'));
|
| 41 |
+
|
| 42 |
+
if ($current_user_id) {
|
| 43 |
+
|
| 44 |
+
$avatar_html = blocksy_simple_image(
|
| 45 |
+
get_avatar_url(
|
| 46 |
+
$current_user_id,
|
| 47 |
+
[
|
| 48 |
+
'size' => 44
|
| 49 |
+
]
|
| 50 |
+
),
|
| 51 |
+
[
|
| 52 |
+
'html_atts' => is_customize_preview() && ! $loggedin_style['avatar'] ? [
|
| 53 |
+
'hidden' => ''
|
| 54 |
+
] : [],
|
| 55 |
+
|
| 56 |
+
'img_atts' => [
|
| 57 |
+
'width' => 22,
|
| 58 |
+
'height' => 22
|
| 59 |
+
]
|
| 60 |
+
]
|
| 61 |
+
);
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
?>
|
| 65 |
+
|
| 66 |
+
<div
|
| 67 |
+
class="<?php echo $class ?>"
|
| 68 |
+
<?php echo blocksy_attr_to_html($attr) ?>>
|
| 69 |
+
|
| 70 |
+
<?php if ($current_user_id) { ?>
|
| 71 |
+
<a href="<?php echo $link ?>" aria-label="<?php echo __('Account', 'blc') ?>">
|
| 72 |
+
<?php if ($loggedin_style['avatar'] || is_customize_preview()) { ?>
|
| 73 |
+
<?php echo $avatar_html ?>
|
| 74 |
+
<?php } ?>
|
| 75 |
+
|
| 76 |
+
<?php if ($loggedin_style['label'] || is_customize_preview()) { ?>
|
| 77 |
+
<span class="ct-label" <?php echo !$loggedin_style['label'] ? 'hidden' : ''?>>
|
| 78 |
+
<?php echo $loggedin_label; ?>
|
| 79 |
+
</span>
|
| 80 |
+
<?php } ?>
|
| 81 |
+
</a>
|
| 82 |
+
<?php } ?>
|
| 83 |
+
|
| 84 |
+
<?php if (! $current_user_id) { ?>
|
| 85 |
+
<a href="#account-modal">
|
| 86 |
+
<?php if ($login_style['icon']) { ?>
|
| 87 |
+
<svg width="15" height="15" viewBox="0 0 20 20">
|
| 88 |
+
<path d="M10 0C4.5 0 0 4.5 0 10s4.5 10 10 10 10-4.5 10-10S15.5 0 10 0zm0 2c4.4 0 8 3.6 8 8 0 1.6-.5 3.1-1.3 4.3l-.8-.6C14.4 12.5 11.5 12 10 12s-4.4.5-5.9 1.7l-.8.6C2.5 13.1 2 11.6 2 10c0-4.4 3.6-8 8-8zm0 1.8C8.2 3.8 6.8 5.2 6.8 7c0 1.8 1.5 3.3 3.2 3.3s3.2-1.5 3.2-3.3c0-1.8-1.4-3.2-3.2-3.2zm0 1.9c.7 0 1.2.6 1.2 1.2 0 .7-.6 1.2-1.2 1.2S8.8 7.7 8.8 7c0-.7.5-1.3 1.2-1.3zm0 8.3c3.1 0 4.8 1.2 5.5 1.8-1.4 1.3-3.3 2.2-5.5 2.2s-4.1-.9-5.5-2.2c.7-.6 2.4-1.8 5.5-1.8zm-5.9 1.3c.1.1.2.3.4.4-.2-.1-.3-.2-.4-.4zm11.8.1c-.1.1-.2.2-.3.4.1-.2.2-.3.3-.4z"/>
|
| 89 |
+
</svg>
|
| 90 |
+
<?php } ?>
|
| 91 |
+
|
| 92 |
+
<?php if ($login_style['label'] | is_customize_preview()) { ?>
|
| 93 |
+
<span class="ct-label" <?php echo ! $login_style['label'] ? 'hidden' : ''?>>
|
| 94 |
+
<?php echo $login_label; ?>
|
| 95 |
+
</span>
|
| 96 |
+
<?php } ?>
|
| 97 |
+
</a>
|
| 98 |
+
<?php } ?>
|
| 99 |
+
</div>
|
| 100 |
+
|
| 101 |
+
|
framework/features/opengraph-meta-data.php
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
namespace Blocksy;
|
| 4 |
+
|
| 5 |
+
class OpenGraphMetaData {
|
| 6 |
+
public function __construct() {
|
| 7 |
+
add_filter(
|
| 8 |
+
'blocksy_engagement_general_end_customizer_options',
|
| 9 |
+
function ($opts) {
|
| 10 |
+
|
| 11 |
+
$opts[] = [
|
| 12 |
+
blocksy_rand_md5() => [
|
| 13 |
+
'type' => 'ct-divider',
|
| 14 |
+
],
|
| 15 |
+
|
| 16 |
+
'enable_opengraph' => [
|
| 17 |
+
'label' => __( 'Opengraph Meta Data', 'blc' ),
|
| 18 |
+
'type' => 'ct-switch',
|
| 19 |
+
'value' => 'no',
|
| 20 |
+
'desc' => __( 'Display a preview image and text excerpt when a link to your site is shared.', 'blc' ),
|
| 21 |
+
],
|
| 22 |
+
|
| 23 |
+
blocksy_rand_md5() => [
|
| 24 |
+
'type' => 'ct-condition',
|
| 25 |
+
'condition' => [ 'enable_opengraph' => 'yes' ],
|
| 26 |
+
'options' => [
|
| 27 |
+
|
| 28 |
+
'opengraph_facebook_page_url' => [
|
| 29 |
+
'label' => __( 'Facebook Page URL', 'blc' ),
|
| 30 |
+
'type' => 'text',
|
| 31 |
+
'design' => 'inline',
|
| 32 |
+
'value' => ''
|
| 33 |
+
],
|
| 34 |
+
|
| 35 |
+
'opengraph_facebook_app_id' => [
|
| 36 |
+
'label' => __( 'Facebook App ID', 'blc' ),
|
| 37 |
+
'type' => 'text',
|
| 38 |
+
'design' => 'inline',
|
| 39 |
+
'value' => ''
|
| 40 |
+
],
|
| 41 |
+
|
| 42 |
+
'opengraph_twitter_username' => [
|
| 43 |
+
'label' => __( 'Twitter Username', 'blc' ),
|
| 44 |
+
'type' => 'text',
|
| 45 |
+
'design' => 'inline',
|
| 46 |
+
'value' => ''
|
| 47 |
+
],
|
| 48 |
+
|
| 49 |
+
],
|
| 50 |
+
],
|
| 51 |
+
];
|
| 52 |
+
|
| 53 |
+
return $opts;
|
| 54 |
+
}
|
| 55 |
+
);
|
| 56 |
+
|
| 57 |
+
add_action('wp_head', array($this, 'output_meta_tags'), 1 );
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
public function output_meta_tags() {
|
| 61 |
+
if (defined('WPSEO_VERSION')) {
|
| 62 |
+
return;
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
if (defined('RANK_MATH_FILE')) {
|
| 66 |
+
return;
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
if (get_theme_mod('enable_opengraph', 'no') !== 'yes') {
|
| 70 |
+
return;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
$facebook_url = get_theme_mod('opengraph_facebook_page_url', '');
|
| 74 |
+
|
| 75 |
+
add_filter('jetpack_disable_twitter_cards', '__return_true', 999999);
|
| 76 |
+
add_filter('jetpack_enable_open_graph', '__return_false', 999999);
|
| 77 |
+
add_filter('jetpack_enable_opengraph', '__return_false', 999999);
|
| 78 |
+
|
| 79 |
+
// Type
|
| 80 |
+
if (is_front_page() || is_home()) {
|
| 81 |
+
$type = 'website';
|
| 82 |
+
} else if (is_singular()) {
|
| 83 |
+
$type = 'article';
|
| 84 |
+
} else {
|
| 85 |
+
$type = 'object';
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
if (is_singular()) {
|
| 89 |
+
$title = get_the_title();
|
| 90 |
+
} else {
|
| 91 |
+
$title = get_the_archive_title();
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
// Description
|
| 95 |
+
if (is_category() || is_tag() || is_tax()) {
|
| 96 |
+
$description = wp_strip_all_tags(term_description());
|
| 97 |
+
} else if (is_singular()) {
|
| 98 |
+
$description = wp_strip_all_tags(blocksy_entry_excerpt(40));
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
// Image
|
| 102 |
+
$image = '';
|
| 103 |
+
$has_img = false;
|
| 104 |
+
|
| 105 |
+
if (function_exists('is_product_category') && is_product_category()) {
|
| 106 |
+
global $wp_query;
|
| 107 |
+
|
| 108 |
+
$cat = $wp_query->get_queried_object();
|
| 109 |
+
$thumbnail_id = get_term_meta($cat->term_id, 'thumbnail_id', true);
|
| 110 |
+
$get_image = wp_get_attachment_url($thumbnail_id);
|
| 111 |
+
|
| 112 |
+
if ($get_image) {
|
| 113 |
+
$image = $get_image;
|
| 114 |
+
$has_img = true;
|
| 115 |
+
}
|
| 116 |
+
} else if (is_singular()) {
|
| 117 |
+
$get_image = wp_get_attachment_image_src(
|
| 118 |
+
get_post_thumbnail_id(get_the_ID()),
|
| 119 |
+
'full'
|
| 120 |
+
);
|
| 121 |
+
|
| 122 |
+
if ($get_image) {
|
| 123 |
+
$image = $get_image[0];
|
| 124 |
+
}
|
| 125 |
+
$has_img = true;
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
// Post author
|
| 129 |
+
if ($facebook_url) {
|
| 130 |
+
$author = $facebook_url;
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
// Facebook publisher URL
|
| 134 |
+
if (! empty($facebook_url)) {
|
| 135 |
+
$publisher = $facebook_url;
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
$fb_app_id = get_theme_mod('opengraph_facebook_app_id', '');
|
| 139 |
+
|
| 140 |
+
$twitter_handle = '@' . str_replace('@', '', get_theme_mod('opengraph_twitter_username'));
|
| 141 |
+
|
| 142 |
+
$output = $this->get_open_graph_tag('property', 'og:type', trim($type));
|
| 143 |
+
$output .= $this->get_open_graph_tag('property', 'og:title', trim($title));
|
| 144 |
+
|
| 145 |
+
if (isset($description) && ! empty($description)) {
|
| 146 |
+
$output .= $this->get_open_graph_tag('property', 'og:description', trim($description));
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
+
if ($has_img && $get_image) {
|
| 150 |
+
$output .= $this->get_open_graph_tag('property', 'og:image', trim($image));
|
| 151 |
+
$output .= $this->get_open_graph_tag('property', 'og:image:width', absint($get_image[1]));
|
| 152 |
+
$output .= $this->get_open_graph_tag('property', 'og:image:height', absint($get_image[2]));
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
$output .= $this->get_open_graph_tag('property', 'og:url', trim(get_permalink()));
|
| 156 |
+
$output .= $this->get_open_graph_tag('property', 'og:site_name', trim(get_bloginfo('name')));
|
| 157 |
+
|
| 158 |
+
if (is_singular() && ! is_front_page()) {
|
| 159 |
+
if (isset($author) && !empty($author)) {
|
| 160 |
+
$output .= $this->get_open_graph_tag('property', 'article:author', trim($author));
|
| 161 |
+
}
|
| 162 |
+
|
| 163 |
+
if (is_singular('post')) {
|
| 164 |
+
$output .= $this->get_open_graph_tag('property', 'article:published_time', trim(get_post_time('c')));
|
| 165 |
+
$output .= $this->get_open_graph_tag('property', 'article:modified_time', trim(get_post_modified_time('c')));
|
| 166 |
+
$output .= $this->get_open_graph_tag('property', 'og:updated_time', trim(get_post_modified_time('c')));
|
| 167 |
+
}
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
if (is_singular()) {
|
| 171 |
+
$tags = get_the_tags();
|
| 172 |
+
|
| 173 |
+
if (! is_wp_error($tags) && (is_array($tags) && $tags !== [])) {
|
| 174 |
+
foreach ($tags as $tag) {
|
| 175 |
+
$output .= $this->get_open_graph_tag('property', 'article:tag', trim($tag->name));
|
| 176 |
+
}
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
$terms = get_the_category();
|
| 180 |
+
|
| 181 |
+
if (! is_wp_error($terms) && (is_array($terms) && $terms !== array())) {
|
| 182 |
+
// We can only show one section here, so we take the first one.
|
| 183 |
+
$output .= $this->get_open_graph_tag('property', 'article:section', trim($terms[0]->name));
|
| 184 |
+
}
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
if (isset($publisher) && ! empty($publisher)) {
|
| 188 |
+
$output .= $this->get_open_graph_tag('property', 'article:publisher', trim($publisher));
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
if (isset($fb_app_id) && ! empty($fb_app_id)) {
|
| 192 |
+
$output .= $this->get_open_graph_tag('property', 'fb:app_id', trim($fb_app_id));
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
// Twitter
|
| 196 |
+
$output .= $this->get_open_graph_tag('name', 'twitter:title', trim($title));
|
| 197 |
+
|
| 198 |
+
if (isset($description) && !empty($description)) {
|
| 199 |
+
$output .= $this->get_open_graph_tag('name', 'twitter:description', trim($description));
|
| 200 |
+
}
|
| 201 |
+
|
| 202 |
+
if ($has_img) {
|
| 203 |
+
$output .= $this->get_open_graph_tag('name', 'twitter:card', 'summary_large_image');
|
| 204 |
+
$output .= $this->get_open_graph_tag('name', 'twitter:image', trim($image));
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
if (isset($twitter_handle) && ! empty($twitter_handle) && strlen($twitter_handle) > 1) {
|
| 208 |
+
$output .= $this->get_open_graph_tag('name', 'twitter:site', trim($twitter_handle));
|
| 209 |
+
$output .= $this->get_open_graph_tag('name', 'twitter:creator', trim($twitter_handle));
|
| 210 |
+
}
|
| 211 |
+
|
| 212 |
+
echo $output;
|
| 213 |
+
}
|
| 214 |
+
|
| 215 |
+
private function get_open_graph_tag($attr, $property, $content) {
|
| 216 |
+
return blocksy_html_tag(
|
| 217 |
+
'meta',
|
| 218 |
+
[
|
| 219 |
+
$attr => $property,
|
| 220 |
+
'content' => $content
|
| 221 |
+
]
|
| 222 |
+
) . "\n";
|
| 223 |
+
}
|
| 224 |
+
}
|
framework/helpers/blocksy-integration.php
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
function blc_call_fn($args = [], ...$params) {
|
| 4 |
+
$args = wp_parse_args(
|
| 5 |
+
$args,
|
| 6 |
+
[
|
| 7 |
+
'fn' => null,
|
| 8 |
+
|
| 9 |
+
// string | null | array
|
| 10 |
+
'default' => ''
|
| 11 |
+
]
|
| 12 |
+
);
|
| 13 |
+
|
| 14 |
+
if (! $args['fn']) {
|
| 15 |
+
throw new Error('$fn must be specified!');
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
if (! function_exists($args['fn'])) {
|
| 19 |
+
return $args['default'];
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
return call_user_func($args['fn'], ...$params);
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
/**
|
| 26 |
+
* Recursively find a key's value in array
|
| 27 |
+
*
|
| 28 |
+
* @param string $keys 'a/b/c' path.
|
| 29 |
+
* @param array|object $array_or_object array to extract from.
|
| 30 |
+
* @param null|mixed $default_value defualt value.
|
| 31 |
+
*
|
| 32 |
+
* @return null|mixed
|
| 33 |
+
*/
|
| 34 |
+
if (! function_exists('blocksy_akg')) {
|
| 35 |
+
function blocksy_akg($keys, $array_or_object, $default_value = null) {
|
| 36 |
+
if (! is_array($keys)) {
|
| 37 |
+
$keys = explode('/', (string) $keys);
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
$array_or_object = $array_or_object;
|
| 41 |
+
$key_or_property = array_shift($keys);
|
| 42 |
+
|
| 43 |
+
if (is_null($key_or_property)) {
|
| 44 |
+
return $default_value;
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
$is_object = is_object($array_or_object);
|
| 48 |
+
|
| 49 |
+
if ($is_object) {
|
| 50 |
+
if (! property_exists($array_or_object, $key_or_property)) {
|
| 51 |
+
return $default_value;
|
| 52 |
+
}
|
| 53 |
+
} else {
|
| 54 |
+
if (! is_array($array_or_object) || ! array_key_exists($key_or_property, $array_or_object)) {
|
| 55 |
+
return $default_value;
|
| 56 |
+
}
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
if (isset($keys[0])) { // not used count() for performance reasons.
|
| 60 |
+
if ($is_object) {
|
| 61 |
+
return blocksy_akg($keys, $array_or_object->{$key_or_property}, $default_value);
|
| 62 |
+
} else {
|
| 63 |
+
return blocksy_akg($keys, $array_or_object[$key_or_property], $default_value);
|
| 64 |
+
}
|
| 65 |
+
} else {
|
| 66 |
+
if ($is_object) {
|
| 67 |
+
return $array_or_object->{$key_or_property};
|
| 68 |
+
} else {
|
| 69 |
+
return $array_or_object[ $key_or_property ];
|
| 70 |
+
}
|
| 71 |
+
}
|
| 72 |
+
}
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
/**
|
| 76 |
+
* Generate a random ID.
|
| 77 |
+
*/
|
| 78 |
+
if (! function_exists('blocksy_rand_md5')) {
|
| 79 |
+
function blocksy_rand_md5() {
|
| 80 |
+
return md5(time() . '-' . uniqid(wp_rand(), true) . '-' . wp_rand());
|
| 81 |
+
}
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
/**
|
| 85 |
+
* Transform key-value pairs into ordered arrays.
|
| 86 |
+
*
|
| 87 |
+
* @param array $choices key-value pairs.
|
| 88 |
+
*/
|
| 89 |
+
if (! function_exists('blocksy_ordered_keys')) {
|
| 90 |
+
function blocksy_ordered_keys($choices, $args = []) {
|
| 91 |
+
if (isset($choices[0])) {
|
| 92 |
+
return $choices;
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
$args = wp_parse_args(
|
| 96 |
+
$args,
|
| 97 |
+
[
|
| 98 |
+
'additional' => []
|
| 99 |
+
]
|
| 100 |
+
);
|
| 101 |
+
|
| 102 |
+
$result = [];
|
| 103 |
+
|
| 104 |
+
foreach ($choices as $key => $val) {
|
| 105 |
+
$result[] = array_merge([
|
| 106 |
+
'key' => $key,
|
| 107 |
+
'value' => $val,
|
| 108 |
+
], $args['additional']);
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
return $result;
|
| 112 |
+
}
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
/**
|
| 116 |
+
* Extract a key from an array with defaults.
|
| 117 |
+
*
|
| 118 |
+
* @param string $keys 'a/b/c' path.
|
| 119 |
+
* @param array|object $array_or_object array to extract from.
|
| 120 |
+
* @param null|mixed $default_value defualt value.
|
| 121 |
+
*/
|
| 122 |
+
if (! function_exists('blocksy_default_akg')) {
|
| 123 |
+
function blocksy_default_akg($keys, $array_or_object, $default_value) {
|
| 124 |
+
return blocksy_akg($keys, $array_or_object, $default_value);
|
| 125 |
+
}
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
/**
|
| 129 |
+
* Generate html tag
|
| 130 |
+
*
|
| 131 |
+
* @param string $tag Tag name.
|
| 132 |
+
* @param array $attr Tag attributes.
|
| 133 |
+
* @param bool|string $end Append closing tag. Also accepts body content.
|
| 134 |
+
*
|
| 135 |
+
* @return string The tag's html
|
| 136 |
+
*/
|
| 137 |
+
if (! function_exists('blocksy_html_tag')) {
|
| 138 |
+
function blocksy_html_tag($tag, $attr = [], $end = false) {
|
| 139 |
+
$html = '<' . $tag . ' ' . blocksy_attr_to_html($attr);
|
| 140 |
+
|
| 141 |
+
if (true === $end) {
|
| 142 |
+
// <script></script>
|
| 143 |
+
$html .= '></' . $tag . '>';
|
| 144 |
+
} elseif (false === $end) {
|
| 145 |
+
// <br/>
|
| 146 |
+
$html .= '/>';
|
| 147 |
+
} else {
|
| 148 |
+
// <div>content</div>
|
| 149 |
+
$html .= '>' . $end . '</' . $tag . '>';
|
| 150 |
+
}
|
| 151 |
+
|
| 152 |
+
return $html;
|
| 153 |
+
}
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
/**
|
| 157 |
+
* Generate attributes string for html tag
|
| 158 |
+
*
|
| 159 |
+
* @param array $attr_array array('href' => '/', 'title' => 'Test').
|
| 160 |
+
*
|
| 161 |
+
* @return string 'href="/" title="Test"'
|
| 162 |
+
*/
|
| 163 |
+
if (! function_exists('blocksy_attr_to_html')) {
|
| 164 |
+
function blocksy_attr_to_html(array $attr_array) {
|
| 165 |
+
$html_attr = '';
|
| 166 |
+
|
| 167 |
+
foreach ($attr_array as $attr_name => $attr_val) {
|
| 168 |
+
if (false === $attr_val) {
|
| 169 |
+
continue;
|
| 170 |
+
}
|
| 171 |
+
|
| 172 |
+
$html_attr .= $attr_name . '="' . htmlspecialchars($attr_val) . '" ';
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
return $html_attr;
|
| 176 |
+
}
|
| 177 |
+
}
|
framework/helpers/helpers.php
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
function blc_get_ext($id) {
|
| 4 |
+
return \Blocksy\Plugin::instance()->extensions->get($id);
|
| 5 |
+
}
|
| 6 |
+
|
| 7 |
+
function blc_get_contacts_output($args = []) {
|
| 8 |
+
$args = wp_parse_args($args, [
|
| 9 |
+
'data' => [],
|
| 10 |
+
'link_target' => 'no',
|
| 11 |
+
'type' => 'rounded',
|
| 12 |
+
'fill' => 'outline',
|
| 13 |
+
'size' => ''
|
| 14 |
+
]);
|
| 15 |
+
|
| 16 |
+
$has_enabled_layer = false;
|
| 17 |
+
|
| 18 |
+
foreach ($args['data'] as $single_layer) {
|
| 19 |
+
if ($single_layer['enabled']) {
|
| 20 |
+
$has_enabled_layer = true;
|
| 21 |
+
break;
|
| 22 |
+
}
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
if (! $has_enabled_layer) {
|
| 26 |
+
return '';
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
$data_target = '';
|
| 30 |
+
|
| 31 |
+
if ($args['link_target'] !== 'no') {
|
| 32 |
+
$data_target = 'target="_blank"';
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
$svgs = [
|
| 36 |
+
'address' => '<svg width="18" height="18" viewBox="0 0 20 20"><path d="M10,0C6.1,0,3,3.1,3,7c0,4.5,6,11.8,6.2,12.1L10,20l0.8-0.9C11,18.8,17,11.5,17,7C17,3.1,13.9,0,10,0z M10,2c2.8,0,5,2.2,5,5c0,2.7-3.1,7.4-5,9.8C8.1,14.4,5,9.7,5,7C5,4.2,7.2,2,10,2zM10,4.5C8.6,4.5,7.5,5.6,7.5,7S8.6,9.5,10,9.5s2.5-1.1,2.5-2.5S11.4,4.5,10,4.5z"/></svg>',
|
| 37 |
+
|
| 38 |
+
'phone' => '<svg width="18" height="18" viewBox="0 0 20 20"><path d="M4.4,0C4,0,3.6,0.2,3.2,0.4l0,0l0,0L0.8,2.9l0,0C0,3.6-0.2,4.7,0.1,5.6c0,0,0,0,0,0c0.7,1.9,2.3,5.5,5.6,8.7c3.3,3.3,6.9,4.9,8.7,5.6h0c0.9,0.3,1.9,0.1,2.7-0.5l2.4-2.4c0.6-0.6,0.6-1.7,0-2.4l-3.1-3.1l0,0c-0.6-0.6-1.8-0.6-2.4,0l-1.5,1.5c-0.6-0.3-1.9-1-3.1-2.2C8,9.5,7.4,8.2,7.2,7.6l1.5-1.5c0.6-0.6,0.7-1.7,0-2.4l0,0L8.6,3.6L5.6,0.5l0,0l0,0C5.2,0.2,4.8,0,4.4,0zM4.4,1.5c0.1,0,0.1,0,0.2,0.1l3.1,3.1l0.1,0.1c0,0,0,0.1,0,0.2L5.7,6.9L5.3,7.3l0.2,0.5c0,0,0.9,2.4,2.7,4.1L8.4,12c1.8,1.6,3.9,2.5,3.9,2.5l0.5,0.2l2.3-2.3c0.1-0.1,0.1-0.1,0.2,0l3.1,3.1c0.1,0.1,0.1,0.1,0,0.2l-2.4,2.4c-0.4,0.3-0.7,0.4-1.2,0.2c-1.7-0.7-5.1-2.2-8.1-5.2c-3-3-4.6-6.5-5.2-8.2c-0.1-0.3,0-0.8,0.2-1l0,0l2.3-2.4C4.2,1.6,4.3,1.5,4.4,1.5z"/></svg>',
|
| 39 |
+
|
| 40 |
+
'mobile' => '<svg width="18" height="18" viewBox="0 0 20 20"><path d="M13.5,20H6.5c-1.6,0-2.9-1.3-2.9-2.9V2.9C3.5,1.3,4.8,0,6.5,0h7.1c1.6,0,2.9,1.3,2.9,2.9v14.1C16.5,18.7,15.2,20,13.5,20zM6.7,1.7C5.8,1.7,5,2.5,5,3.4v13.2c0,0.9,0.7,1.7,1.7,1.7h6.6c0.9,0,1.7-0.7,1.7-1.7V3.4c0-0.9-0.7-1.7-1.7-1.7H6.7z"/><path d="M11.2,4.4H8.8c-0.3,0-0.6-0.3-0.6-0.6s0.3-0.6,0.6-0.6h2.4c0.3,0,0.6,0.3,0.6,0.6S11.5,4.4,11.2,4.4z"/><circle cx="10" cy="15.7" r="1.2"/></svg>',
|
| 41 |
+
|
| 42 |
+
'hours' => '<svg width="18" height="18" viewBox="0 0 20 20"><path d="M10,0C4.5,0,0,4.5,0,10s4.5,10,10,10s10-4.5,10-10S15.5,0,10,0z M10,18.2c-4.5,0-8.2-3.7-8.2-8.2c0-4.5,3.7-8.2,8.2-8.2c4.5,0,8.2,3.7,8.2,8.2C18.2,14.5,14.5,18.2,10,18.2z M14.4,12.2c-0.2,0.3-0.5,0.5-0.8,0.5c-0.1,0-0.3,0-0.4-0.1l-3.6-1.8c-0.3-0.2-0.5-0.5-0.5-0.8V4.5C9.1,4,9.5,3.6,10,3.6s0.9,0.4,0.9,0.9v4.9L14,11C14.5,11.2,14.7,11.8,14.4,12.2z"/></svg>',
|
| 43 |
+
|
| 44 |
+
'fax' => '<svg width="18" height="18" viewBox="0 0 20 20"><path d="M17.5,5.8h-1.7v-4V0h-1.7H5.8H4.2v1.8v4H2.5C1.1,5.8,0,7,0,8.3v8.3h4.2V20h11.7v-3.3H20V8.3C20,7,18.9,5.8,17.5,5.8zM5.8,1.8h8.3v4H5.8V1.8zM14.2,18.3H5.8v-5h8.3V18.3zM18.3,15h-2.5v-3.3H4.2V15H1.7V8.3c0-0.5,0.4-0.8,0.8-0.8h15c0.5,0,0.8,0.4,0.8,0.8V15zM4.2,9.2c0,0.5-0.4,0.8-0.8,0.8S2.5,9.6,2.5,9.2s0.4-0.8,0.8-0.8S4.2,8.7,4.2,9.2z"/></svg>',
|
| 45 |
+
|
| 46 |
+
'email' => '<svg width="18" height="18" viewBox="0 0 20 20"><path d="M10,0C4.5,0,0,4.5,0,10s4.5,10,10,10h5v-2h-5c-4.4,0-8-3.6-8-8s3.6-8,8-8s8,3.6,8,8v1.5c0,0.8-0.7,1.5-1.5,1.5S15,12.3,15,11.5V10c0-2.7-2.3-5-5-5s-5,2.3-5,5s2.3,5,5,5c1.4,0,2.7-0.6,3.6-1.6c0.6,0.9,1.7,1.6,2.9,1.6c1.9,0,3.5-1.6,3.5-3.5V10C20,4.5,15.5,0,10,0zM10,7c1.7,0,3,1.3,3,3s-1.3,3-3,3s-3-1.3-3-3S8.3,7,10,7z"/></svg>',
|
| 47 |
+
|
| 48 |
+
'website' => '<svg width="18" height="18" viewBox="0 0 20 20"><path d="M9.3,0C4.4,0,0.4,4,0.4,8.9s4,8.9,8.9,8.9c0.8,0,1.5-0.1,2.2-0.3v-3.9c-0.6,1.7-1.4,2.7-2.2,2.7c-0.9,0-2-1.5-2.5-3.7h4.8
|
| 49 |
+
v-1.5h-5c-0.1-0.7-0.1-1.4-0.1-2.2c0-0.8,0.1-1.5,0.2-2.2h5.6c0.1,0.7,0.2,1.4,0.2,2.2c0,0.2,0,0.4,0,0.6c0.4-0.4,0.9-0.6,1.5-0.6c0-0.8,0-1.5-0.1-2.2h2.8c0.2,0.7,0.3,1.4,0.3,2.2c0,0.5-0.1,1-0.2,1.5l1.3,0.9c0.2-0.8,0.3-1.6,0.3-2.4C18.1,4,14.2,0,9.3,0zM9.3,1.5c0.9,0,2,1.5,2.5,3.7h-5C7.3,2.9,8.3,1.5,9.3,1.5zM6.3,2.1C5.9,2.9,5.5,4,5.2,5.2H2.8C3.6,3.8,4.9,2.7,6.3,2.1zM12.2,2.1c1.5,0.6,2.7,1.7,3.5,3.1h-2.3C13.1,4,12.7,2.9,12.2,2.1zM2.2,6.7h2.8C4.9,7.4,4.8,8.1,4.8,8.9c0,0.8,0.1,1.5,0.1,2.2H2.2C2,10.4,1.9,9.7,1.9,8.9C1.9,8.1,2,7.4,2.2,6.7z M13.7,10.4c-0.4,0-0.7,0.3-0.8,0.7c0,0,0,0.1,0,0.1v6.6c0,0.4,0.3,0.7,0.7,0.7c0.2,0,0.4-0.1,0.5-0.2l0,0l1.4-1.6l1.5,3c0.2,0.4,0.6,0.5,1,0.3c0.4-0.2,0.5-0.6,0.3-1l-1.5-3l2.2-0.4l0,0c0.3-0.1,0.5-0.4,0.5-0.7c0-0.3-0.1-0.5-0.3-0.6l0,0l-5.1-3.6C14.1,10.4,13.9,10.4,13.7,10.4zM2.9,12.6h2.3c0.3,1.2,0.7,2.3,1.1,3.1C4.9,15.1,3.7,14,2.9,12.6z"/></svg>',
|
| 50 |
+
];
|
| 51 |
+
|
| 52 |
+
$attr = [];
|
| 53 |
+
|
| 54 |
+
// if ($args['type'] !== 'simple') {
|
| 55 |
+
$attr['data-icons-type'] = $args['type'];
|
| 56 |
+
// }
|
| 57 |
+
|
| 58 |
+
if ($args['type'] !== 'simple' && ! empty($args['fill'])) {
|
| 59 |
+
$attr['data-icons-type'] .= ':' . $args['fill'];
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
if (! empty($args['size'])) {
|
| 63 |
+
$attr['data-icon-size'] = $args['size'];
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
ob_start(); ?>
|
| 67 |
+
|
| 68 |
+
<ul <?php echo blocksy_attr_to_html($attr) ?>>
|
| 69 |
+
<?php foreach ($args['data'] as $single_layer) { ?>
|
| 70 |
+
<li>
|
| 71 |
+
<span class="ct-icon-container">
|
| 72 |
+
<?php echo $svgs[$single_layer['id']] ?>
|
| 73 |
+
</span>
|
| 74 |
+
|
| 75 |
+
<div class="contact-info">
|
| 76 |
+
<?php if (! empty(blocksy_akg('title', $single_layer, ''))) { ?>
|
| 77 |
+
<span class="contact-title">
|
| 78 |
+
<?php echo esc_html(blocksy_akg('title', $single_layer, '')) ?>
|
| 79 |
+
</span>
|
| 80 |
+
<?php } ?>
|
| 81 |
+
|
| 82 |
+
<?php if (! empty(blocksy_akg('content', $single_layer, ''))) { ?>
|
| 83 |
+
<span class="contact-text">
|
| 84 |
+
<?php if (! empty(blocksy_akg('link', $single_layer, ''))) { ?>
|
| 85 |
+
<a href="<?php echo blocksy_akg('link', $single_layer, '') ?>" <?php echo $data_target ?>>
|
| 86 |
+
<?php } ?>
|
| 87 |
+
|
| 88 |
+
<?php echo blocksy_akg('content', $single_layer, '') ?>
|
| 89 |
+
|
| 90 |
+
<?php if (! empty(blocksy_akg('link', $single_layer, ''))) { ?>
|
| 91 |
+
</a>
|
| 92 |
+
<?php } ?>
|
| 93 |
+
</span>
|
| 94 |
+
<?php } ?>
|
| 95 |
+
</div>
|
| 96 |
+
</li>
|
| 97 |
+
<?php } ?>
|
| 98 |
+
</ul>
|
| 99 |
+
|
| 100 |
+
<?php
|
| 101 |
+
return ob_get_clean();
|
| 102 |
+
}
|
framework/theme-integration.php
CHANGED
|
@@ -22,27 +22,241 @@ class ThemeIntegration {
|
|
| 22 |
10, 2
|
| 23 |
);
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
add_filter('upload_mimes', function ($mimes) {
|
| 26 |
$mimes['svg'] = 'image/svg+xml';
|
|
|
|
| 27 |
return $mimes;
|
| 28 |
});
|
| 29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
add_action(
|
| 31 |
-
'
|
| 32 |
-
function (
|
| 33 |
-
|
| 34 |
-
$element->add_control('fix_columns_alignment', [
|
| 35 |
-
'type' => \Elementor\Controls_Manager::SWITCHER,
|
| 36 |
-
'label' => esc_html__( 'Columns Alignment Fix', 'blc' ),
|
| 37 |
-
// 'description' => esc_html__( 'It will remove the "weird" columns gap added by Elementor on the left and right side of each section (when `Columns Gap` is active). This helps you to have consistent content width without having to manually readjust it everytime you create sections with `Columns Gap`', 'blc' ),
|
| 38 |
-
'return_value' => 'fix',
|
| 39 |
-
'default' => '',
|
| 40 |
-
'separator' => 'before',
|
| 41 |
-
'prefix_class' => 'ct-columns-alignment-',
|
| 42 |
-
]);
|
| 43 |
|
| 44 |
-
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
);
|
| 47 |
}
|
| 48 |
}
|
| 22 |
10, 2
|
| 23 |
);
|
| 24 |
|
| 25 |
+
add_action('rest_api_init', function () {
|
| 26 |
+
return;
|
| 27 |
+
|
| 28 |
+
register_rest_field('post', 'images', [
|
| 29 |
+
'get_callback' => function () {
|
| 30 |
+
return wp_prepare_attachment_for_js($object->id);
|
| 31 |
+
},
|
| 32 |
+
'update_callback' => null,
|
| 33 |
+
'schema' => null,
|
| 34 |
+
]);
|
| 35 |
+
});
|
| 36 |
+
|
| 37 |
+
add_filter(
|
| 38 |
+
'user_contactmethods',
|
| 39 |
+
function ( $field ) {
|
| 40 |
+
$fields['facebook'] = __( 'Facebook', 'blc' );
|
| 41 |
+
$fields['twitter'] = __( 'Twitter', 'blc' );
|
| 42 |
+
$fields['linkedin'] = __( 'LinkedIn', 'blc' );
|
| 43 |
+
$fields['dribbble'] = __( 'Dribbble', 'blc' );
|
| 44 |
+
$fields['instagram'] = __( 'Instagram', 'blc' );
|
| 45 |
+
|
| 46 |
+
return $fields;
|
| 47 |
+
}
|
| 48 |
+
);
|
| 49 |
+
|
| 50 |
+
add_filter(
|
| 51 |
+
'wp_check_filetype_and_ext',
|
| 52 |
+
function ($data=null, $file=null, $filename=null, $mimes=null) {
|
| 53 |
+
if (strpos($filename, '.svg') !== false) {
|
| 54 |
+
$data['type'] = 'image/svg+xml';
|
| 55 |
+
$data['ext'] = 'svg';
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
return $data;
|
| 59 |
+
},
|
| 60 |
+
75, 4
|
| 61 |
+
);
|
| 62 |
+
|
| 63 |
add_filter('upload_mimes', function ($mimes) {
|
| 64 |
$mimes['svg'] = 'image/svg+xml';
|
| 65 |
+
|
| 66 |
return $mimes;
|
| 67 |
});
|
| 68 |
|
| 69 |
+
add_filter('wp_get_attachment_image_attributes', function ($attr, $attachment, $size = 'thumbnail') {
|
| 70 |
+
if (! isset($attachment->ID)) {
|
| 71 |
+
return $attr;
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
$mime = get_post_mime_type($attachment->ID);
|
| 75 |
+
|
| 76 |
+
if ('image/svg+xml' === $mime) {
|
| 77 |
+
$default_height = 100;
|
| 78 |
+
$default_width = 100;
|
| 79 |
+
|
| 80 |
+
$dimensions = $this->svg_dimensions(get_attached_file($attachment->ID));
|
| 81 |
+
|
| 82 |
+
if ($dimensions) {
|
| 83 |
+
$default_height = $dimensions['height'];
|
| 84 |
+
$default_width = $dimensions['width'];
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
$attr['height'] = $default_height;
|
| 88 |
+
$attr['width'] = $default_width;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
return $attr;
|
| 92 |
+
}, 10, 3);
|
| 93 |
+
|
| 94 |
+
add_filter('blocksy_changelogs_list', function ($changelogs) {
|
| 95 |
+
$changelog = null;
|
| 96 |
+
$access_type = get_filesystem_method();
|
| 97 |
+
|
| 98 |
+
if ($access_type === 'direct') {
|
| 99 |
+
$creds = request_filesystem_credentials(
|
| 100 |
+
site_url() . '/wp-admin/',
|
| 101 |
+
'', false, false,
|
| 102 |
+
[]
|
| 103 |
+
);
|
| 104 |
+
|
| 105 |
+
if ( WP_Filesystem($creds) ) {
|
| 106 |
+
global $wp_filesystem;
|
| 107 |
+
|
| 108 |
+
$readme = $wp_filesystem->get_contents(
|
| 109 |
+
BLOCKSY_PATH . '/readme.txt'
|
| 110 |
+
);
|
| 111 |
+
|
| 112 |
+
if ($readme) {
|
| 113 |
+
$readme = explode('== Changelog ==', $readme);
|
| 114 |
+
|
| 115 |
+
if (isset($readme[1])) {
|
| 116 |
+
$changelogs[] = [
|
| 117 |
+
'title' => __('Companion', 'blc'),
|
| 118 |
+
'changelog' => trim($readme[1])
|
| 119 |
+
];
|
| 120 |
+
}
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
if (
|
| 124 |
+
blc_fs()->is__premium_only()
|
| 125 |
+
&&
|
| 126 |
+
BLOCKSY_PATH . '/framework/premium/changelog.txt'
|
| 127 |
+
) {
|
| 128 |
+
$pro_changelog = $wp_filesystem->get_contents(
|
| 129 |
+
BLOCKSY_PATH . '/framework/premium/changelog.txt'
|
| 130 |
+
);
|
| 131 |
+
|
| 132 |
+
$changelogs[] = [
|
| 133 |
+
'title' => __('PRO', 'blc'),
|
| 134 |
+
'changelog' => trim($pro_changelog)
|
| 135 |
+
];
|
| 136 |
+
}
|
| 137 |
+
}
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
|
| 141 |
+
return $changelogs;
|
| 142 |
+
});
|
| 143 |
+
|
| 144 |
+
add_action('wp_enqueue_scripts', function () {
|
| 145 |
+
if (! function_exists('get_plugin_data')){
|
| 146 |
+
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
+
$data = get_plugin_data(BLOCKSY__FILE__);
|
| 150 |
+
|
| 151 |
+
if (is_admin()) return;
|
| 152 |
+
|
| 153 |
+
/*
|
| 154 |
+
wp_enqueue_style(
|
| 155 |
+
'blocksy-companion-styles',
|
| 156 |
+
BLOCKSY_URL . 'static/bundle/main.css',
|
| 157 |
+
['ct-main-styles'],
|
| 158 |
+
$data['Version']
|
| 159 |
+
);
|
| 160 |
+
*/
|
| 161 |
+
|
| 162 |
+
wp_enqueue_script(
|
| 163 |
+
'blocksy-companion-scripts',
|
| 164 |
+
BLOCKSY_URL . 'static/bundle/main.js',
|
| 165 |
+
['ct-scripts'],
|
| 166 |
+
$data['Version'],
|
| 167 |
+
true
|
| 168 |
+
);
|
| 169 |
+
|
| 170 |
+
$data = [
|
| 171 |
+
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
| 172 |
+
'public_url' => BLOCKSY_URL . 'framework/extensions/instagram/static/bundle/',
|
| 173 |
+
];
|
| 174 |
+
|
| 175 |
+
wp_localize_script(
|
| 176 |
+
'blocksy-ext-instagram-scripts',
|
| 177 |
+
'blocksy_ext_instagram_localization',
|
| 178 |
+
$data
|
| 179 |
+
);
|
| 180 |
+
});
|
| 181 |
+
|
| 182 |
add_action(
|
| 183 |
+
'customize_preview_init',
|
| 184 |
+
function () {
|
| 185 |
+
$data = get_plugin_data(BLOCKSY__FILE__);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 186 |
|
| 187 |
+
wp_enqueue_script(
|
| 188 |
+
'blocksy-companion-sync-scripts',
|
| 189 |
+
BLOCKSY_URL . 'static/bundle/sync.js',
|
| 190 |
+
['ct-events'],
|
| 191 |
+
$data['Version'],
|
| 192 |
+
true
|
| 193 |
+
);
|
| 194 |
+
}
|
| 195 |
+
);
|
| 196 |
+
|
| 197 |
+
if (get_theme_mod('emoji_scripts', 'no') !== 'yes') {
|
| 198 |
+
remove_action('wp_head', 'print_emoji_detection_script', 7);
|
| 199 |
+
remove_action('admin_print_scripts', 'print_emoji_detection_script');
|
| 200 |
+
remove_action('wp_print_styles', 'print_emoji_styles');
|
| 201 |
+
remove_action('admin_print_styles', 'print_emoji_styles');
|
| 202 |
+
remove_filter('the_content_feed', 'wp_staticize_emoji');
|
| 203 |
+
remove_filter('comment_text_rss', 'wp_staticize_emoji');
|
| 204 |
+
remove_filter('wp_mail', 'wp_staticize_emoji_for_email');
|
| 205 |
+
|
| 206 |
+
add_filter('tiny_mce_plugins', function ($plugins) {
|
| 207 |
+
if (is_array($plugins)) {
|
| 208 |
+
return array_diff($plugins, array('wpemoji'));
|
| 209 |
+
} else {
|
| 210 |
+
return array();
|
| 211 |
+
}
|
| 212 |
+
});
|
| 213 |
+
|
| 214 |
+
add_filter('wp_resource_hints', function ($urls, $relation_type) {
|
| 215 |
+
if ('dns-prefetch' === $relation_type) {
|
| 216 |
+
/** This filter is documented in wp-includes/formatting.php */
|
| 217 |
+
$emoji_svg_url = apply_filters('emoji_svg_url', 'https://s.w.org/images/core/emoji/2/svg/');
|
| 218 |
+
|
| 219 |
+
$urls = array_diff($urls, array($emoji_svg_url));
|
| 220 |
+
}
|
| 221 |
+
|
| 222 |
+
return $urls;
|
| 223 |
+
}, 10, 2);
|
| 224 |
+
}
|
| 225 |
+
}
|
| 226 |
+
|
| 227 |
+
protected function svg_dimensions( $svg ) {
|
| 228 |
+
$svg = @simplexml_load_file( $svg );
|
| 229 |
+
$width = 0;
|
| 230 |
+
$height = 0;
|
| 231 |
+
|
| 232 |
+
if ($svg) {
|
| 233 |
+
$attributes = $svg->attributes();
|
| 234 |
+
|
| 235 |
+
if (
|
| 236 |
+
isset($attributes->width, $attributes->height)
|
| 237 |
+
&&
|
| 238 |
+
is_numeric($attributes->width)
|
| 239 |
+
&&
|
| 240 |
+
is_numeric($attributes->height)
|
| 241 |
+
) {
|
| 242 |
+
$width = floatval($attributes->width);
|
| 243 |
+
$height = floatval($attributes->height);
|
| 244 |
+
} elseif (isset($attributes->viewBox)) {
|
| 245 |
+
$sizes = explode(' ', $attributes->viewBox);
|
| 246 |
+
|
| 247 |
+
if (isset($sizes[2], $sizes[3])) {
|
| 248 |
+
$width = floatval($sizes[2]);
|
| 249 |
+
$height = floatval($sizes[3]);
|
| 250 |
+
}
|
| 251 |
+
} else {
|
| 252 |
+
return false;
|
| 253 |
+
}
|
| 254 |
+
}
|
| 255 |
+
|
| 256 |
+
return array(
|
| 257 |
+
'width' => $width,
|
| 258 |
+
'height' => $height,
|
| 259 |
+
'orientation' => ($width > $height) ? 'landscape' : 'portrait'
|
| 260 |
);
|
| 261 |
}
|
| 262 |
}
|
framework/views/optin.php
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<div class="blocksy-fs-optin-wrapper">
|
| 2 |
+
|
| 3 |
+
<div class="ct-optin-svg">
|
| 4 |
+
<svg viewBox="0 0 1697 1036" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><path d="M328.96 166.92S291 43.03 237.11 16.03c-83.8-42-149.21 9.06-180.29 43.46C41.2 76.78 0 133.36 0 133.36l162.77 99.48 60.12-73.36 40.37 70.34 150.37 63.91 28.18-75.5-112.85-51.31z" id="a"/><path id="c" d="M44.24 0l12.11 45.4 40.22 4.62-15.53 33.36-35.01 28.91-35.23-2.86L.58 80.75l5.67-35.48z"/></defs><g fill="none" fill-rule="evenodd"><path fill="#F9D796" fill-rule="nonzero" d="M1500.63 698.82h112.48v269.02h-112.48z"/><path d="M342.03 347.82c82.467 0 149.32 66.853 149.32 149.32s-66.853 149.32-149.32 149.32" fill="#EAB874" fill-rule="nonzero"/><path d="M1265.19 329.71c0-92.375 74.885-167.26 167.26-167.26 92.375 0 167.26 74.885 167.26 167.26" fill="#F9D796" fill-rule="nonzero"/><path d="M722.1 779.25c0-92.375 74.885-167.26 167.26-167.26 92.375 0 167.26 74.885 167.26 167.26M909.6 337.69L765.95 122.3 622.3 337.69zM306.28 843.19L191.07 670.45 75.87 843.19zM1110.16 18.68l127.24 190.78 127.24-190.78z" fill="#EAB874" fill-rule="nonzero"/><path fill="#F9D796" fill-rule="nonzero" d="M284.07 0h112.48v269.02H284.07z"/><path d="M191.07 494.29c-81.988-.671-148.098-67.325-148.098-149.315s66.11-148.644 148.098-149.315" fill="#EAB874" fill-rule="nonzero"/><path stroke="#F7D99C" stroke-width="14" d="M610.6 40.91l-82.46 82.46M955.53 129.34l82.46 82.46M4.95 606.68l82.46 82.46M1580.64 415.49l82.46 82.46M756.87 405.89l82.46 82.46M99.41 5.29l82.45 82.46M725.44 866.39l-82.46 82.45M1576.35 5.29l-82.46 82.46"/><g transform="translate(44 264)"><ellipse fill="#AB8660" fill-rule="nonzero" cx="809.97" cy="763.18" rx="809.13" ry="7.83"/><path fill="#E09B8C" fill-rule="nonzero" d="M1652.78 422.57L1289 762.18h-139.44l363.79-339.61z"/><path fill="#FFF" fill-rule="nonzero" d="M1515.31 418.07L1134.48 10.14h127.13l380.81 407.93z"/><path d="M1259.65 14.64l372.41 398.93h-114.8L1144.84 14.64h114.82m3.91-9h-139.45l389.23 416.93h139.43L1263.56 5.64h.01z" fill="#F9D0B5" fill-rule="nonzero"/><path d="M745.54 315.39s30.79 12.91 44.3 28.14c13.51 15.23 22 48 22 48s-82 10.35-89.89-64" fill="#3361C2" fill-rule="nonzero"/><path fill="#162C56" fill-rule="nonzero" d="M70.97 679.93l-52.28 53.13 48.59 29.12h149.79l-79.75-42.44zM365.76 695.49l-33.45 66.69h191.46l-79.75-42.44z"/><path d="M158.72 731.57l179.92-179.82a108 108 0 0030.33-59.72l15.39-98.69 67.33 98.17-105.64 202.52 114.79 34 108.57-174.9c20.29-32.698 19.02-74.367-3.22-105.77l-91.13-128.52-162.78-99.48-35.07 55a145.45 145.45 0 00-22.52 69.21l-7.57 122.46L43.41 675.67l115.31 55.9z" fill="#72A065" fill-rule="nonzero"/><g transform="translate(312.21 86)"><mask id="b" fill="#fff"><use xlink:href="#a"/></mask><use fill="#FFBA5F" fill-rule="nonzero" xlink:href="#a"/><g mask="url(#b)" fill="#EA6F57" fill-rule="nonzero"><path d="M86.88 100.83l-30.01-45-30.01 45zM203.17 100.83l-30.01-45-30.01 45zM320.29 100.83l-30.01-45-30.01 45zM203.17 262.06l-30.01-45-30.01 45zM436.59 262.06l-30.01-45-30.01 45zM203.17 141.6l30.01 45 30.01-45zM86.46 141.6l30.01 45 30.01-45zM86.46-4l30.01 45 30.01-45z"/></g></g><path stroke="#3361C2" stroke-width="65" stroke-linecap="round" stroke-linejoin="round" d="M624.08 47.83l-80.96 67.74"/><path d="M569.19 131.42l4.89 2.76a44.45 44.45 0 0063.9-24.41l10.41-30.62c6.946-20.417-1.77-42.874-20.67-53.26-21.512-11.814-48.528-3.958-60.35 17.55l-15.31 27.87c-11.725 21.346-4.086 48.152 17.13 60.11z" fill="#3361C2" fill-rule="nonzero"/><rect fill="#3361C2" fill-rule="nonzero" transform="rotate(171.38 555.62 69.08)" x="539.28" y="48.106" width="32.68" height="41.95" rx="15.57"/><path stroke="#FFF" stroke-width="3" stroke-linecap="square" d="M549.21 60.75l6.66 17.86M624.69 81.93l-7.19 24.92-8.88-2.51"/><path d="M566.23 81.03l29.76-38.22 7.06-9.08a36.9 36.9 0 006 10.56c9.27 11.56 46.57 24.34 62.35 1.08 12.87-19-14.16-16.39-24.87-22.46-16.82-9.54-24.7-25.16-54.45-22.34-35.65 3.33-38.24 47.57-38.24 47.57s14.87.47 12.39 32.89zM572.63 133.41l-11.35-12.29.49 21.21z" fill="#24272D" fill-rule="nonzero"/><circle fill="#FFF" fill-rule="nonzero" cx="610.55" cy="79.94" r="4.57"/><circle fill="#FFF" fill-rule="nonzero" cx="635.64" cy="91.01" r="4.57"/><path stroke="#FFF" stroke-width="14" stroke-linecap="square" d="M482.28 316.25l-168.09-99.5"/><path d="M560.74 307.44s12.5-6.53 31.82-5l20.76 7.81s18.43 14.78-6.84 40.92-73.09 6.38-73.09 6.38" fill="#3361C2" fill-rule="nonzero"/><path d="M383.08 222.78l7.85 61.31a52 52 0 0033.4 42.13l114 42.53 28.24-79.09-87.83-33 2.46-73.63" fill="#FFBA5F" fill-rule="nonzero"/><path fill="#F9D0B5" fill-rule="nonzero" d="M1513.35 422.57l-363.79 339.61-389.22-416.92L1124.12 5.64z"/><path stroke="#1F2128" stroke-width="8" stroke-linecap="round" d="M609.44 291.27l-15.56 22.14"/><g transform="translate(597.74 183.12)"><mask id="d" fill="#fff"><use xlink:href="#c"/></mask><use fill="#FFBA5F" fill-rule="nonzero" xlink:href="#c"/><path fill="#EA6F57" fill-rule="nonzero" mask="url(#d)" d="M-15 27.85l52.21 78.28 52.2-78.28z"/></g><ellipse stroke="#1F2128" stroke-width="8" transform="rotate(-56.98 649.702 233.917)" cx="649.702" cy="233.917" rx="70.11" ry="41.03"/><path fill="#EA6F57" fill-rule="nonzero" d="M726.43 762.18l-35.1-52.64-35.11 52.64z"/><path fill="#3361C2" fill-rule="nonzero" d="M1044.84 762.18l-92.08-138.07-92.09 138.07z"/><path fill="#FFBA5F" fill-rule="nonzero" d="M792.91 582.42h75.16v179.76h-75.16z"/><path d="M771.2 762.18c0-56.952 46.168-103.12 103.12-103.12 56.952 0 103.12 46.168 103.12 103.12" fill="#72A065" fill-rule="nonzero"/><path d="M590.53 101.53s-2.35 9.23 7.31 13.78" fill="#FFF" fill-rule="nonzero"/><path stroke="#FFF" stroke-width="3" stroke-linecap="square" d="M515.21 268.68l-37.54-14.66-1.03-82.26M385.91 252.69l-3.82-57.64M257.28 490.34l-8.67-23.39 21.31-3.31M473.21 509.5l-19.87-17.8 27.53-13.77M387.38 364.73L376.5 434.5"/></g><g fill="#2B292D" fill-rule="nonzero"><path d="M1174.34 671.16l13.55-56.28-57.16 9.12zM1192.298 690.546l35.36-32.697 78.199 84.565-35.36 32.698zM1112.38 604.16a48.152 48.152 0 00-65.38-70.71l65.38 70.71z"/></g></g>
|
| 5 |
+
</svg>
|
| 6 |
+
</div>
|
framework/widgets-manager.php
CHANGED
|
@@ -27,11 +27,16 @@ class BlocksyWidgetFactory extends WP_Widget {
|
|
| 27 |
public static function register_all_widgets() {
|
| 28 |
$all_widgets = apply_filters('blocksy_widgets_paths', []);
|
| 29 |
|
| 30 |
-
foreach (
|
| 31 |
-
$prefix = basename(
|
| 32 |
|
| 33 |
include_once $widget . '/widget.php';
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
}
|
| 36 |
}
|
| 37 |
|
|
@@ -64,29 +69,30 @@ class BlocksyWidgetFactory extends WP_Widget {
|
|
| 64 |
$config = array_merge( $config, $this->get_config() );
|
| 65 |
}
|
| 66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
$this->prefix = $prefix;
|
| 68 |
|
| 69 |
parent::__construct(
|
| 70 |
false,
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
$
|
| 74 |
-
__(
|
| 75 |
-
'Default widget name',
|
| 76 |
-
'blocksy'
|
| 77 |
-
)
|
| 78 |
-
),
|
| 79 |
-
[
|
| 80 |
-
'description' => blocksy_akg(
|
| 81 |
-
'description',
|
| 82 |
-
$config,
|
| 83 |
-
__(
|
| 84 |
-
'Display online support infomation',
|
| 85 |
-
'blocksy'
|
| 86 |
-
)
|
| 87 |
-
),
|
| 88 |
'classname' => $prefix . '-widget',
|
| 89 |
-
]
|
| 90 |
);
|
| 91 |
}
|
| 92 |
|
|
@@ -98,14 +104,15 @@ class BlocksyWidgetFactory extends WP_Widget {
|
|
| 98 |
return;
|
| 99 |
}
|
| 100 |
|
| 101 |
-
$instance = blocksy_akg(
|
| 102 |
|
| 103 |
-
if (
|
| 104 |
$instance = [];
|
| 105 |
}
|
| 106 |
|
| 107 |
// @codingStandardsIgnoreLine
|
| 108 |
-
echo
|
|
|
|
| 109 |
$file_path,
|
| 110 |
array_merge(
|
| 111 |
[ 'atts' => $instance ],
|
|
@@ -120,9 +127,10 @@ class BlocksyWidgetFactory extends WP_Widget {
|
|
| 120 |
if ( file_exists( $this->get_path() . '/options.php' ) ) {
|
| 121 |
$options = blocksy_akg(
|
| 122 |
'options',
|
| 123 |
-
|
|
|
|
| 124 |
$this->get_path() . '/options.php',
|
| 125 |
-
[
|
| 126 |
)
|
| 127 |
);
|
| 128 |
}
|
|
@@ -133,7 +141,7 @@ class BlocksyWidgetFactory extends WP_Widget {
|
|
| 133 |
$this->options = [
|
| 134 |
'title' => [
|
| 135 |
'type' => 'text',
|
| 136 |
-
'label' => __( 'Widget Title', '
|
| 137 |
'field_attr' => [ 'id' => 'widget-title' ],
|
| 138 |
],
|
| 139 |
];
|
|
@@ -147,8 +155,8 @@ class BlocksyWidgetFactory extends WP_Widget {
|
|
| 147 |
* @param array $old_instance old widget values.
|
| 148 |
*/
|
| 149 |
public function update( $new_instance, $old_instance ) {
|
| 150 |
-
$new_instance[ $this->prefix ][
|
| 151 |
-
$new_instance[ $this->prefix ][
|
| 152 |
true
|
| 153 |
);
|
| 154 |
|
|
@@ -158,10 +166,11 @@ class BlocksyWidgetFactory extends WP_Widget {
|
|
| 158 |
public function form( $values ) {
|
| 159 |
$this->read_options();
|
| 160 |
|
| 161 |
-
echo
|
|
|
|
| 162 |
[
|
| 163 |
'options' => $this->options,
|
| 164 |
-
'values' => blocksy_akg(
|
| 165 |
'id_prefix' => 'ct-widget-options-' . $this->get_field_id(
|
| 166 |
$this->prefix
|
| 167 |
),
|
| 27 |
public static function register_all_widgets() {
|
| 28 |
$all_widgets = apply_filters('blocksy_widgets_paths', []);
|
| 29 |
|
| 30 |
+
foreach ($all_widgets as $widget) {
|
| 31 |
+
$prefix = basename($widget);
|
| 32 |
|
| 33 |
include_once $widget . '/widget.php';
|
| 34 |
+
|
| 35 |
+
$class_name = explode('-', $prefix);
|
| 36 |
+
$class_name = array_map('ucfirst', $class_name);
|
| 37 |
+
$class_name = implode('_', $class_name);
|
| 38 |
+
|
| 39 |
+
register_widget('Blocksy_Widget_' . $class_name);
|
| 40 |
}
|
| 41 |
}
|
| 42 |
|
| 69 |
$config = array_merge( $config, $this->get_config() );
|
| 70 |
}
|
| 71 |
|
| 72 |
+
$name = blocksy_akg(
|
| 73 |
+
'name',
|
| 74 |
+
$config,
|
| 75 |
+
__('Default widget name', 'blc')
|
| 76 |
+
);
|
| 77 |
+
|
| 78 |
+
$description = blocksy_akg(
|
| 79 |
+
'description',
|
| 80 |
+
$config,
|
| 81 |
+
__('Display online support infomation', 'blc')
|
| 82 |
+
);
|
| 83 |
+
|
| 84 |
+
unset($config['name']);
|
| 85 |
+
unset($config['description']);
|
| 86 |
+
|
| 87 |
$this->prefix = $prefix;
|
| 88 |
|
| 89 |
parent::__construct(
|
| 90 |
false,
|
| 91 |
+
' ' . $name,
|
| 92 |
+
array_merge([
|
| 93 |
+
'description' => $description,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
'classname' => $prefix . '-widget',
|
| 95 |
+
], $config)
|
| 96 |
);
|
| 97 |
}
|
| 98 |
|
| 104 |
return;
|
| 105 |
}
|
| 106 |
|
| 107 |
+
$instance = blocksy_akg('ct_options', $instance, []);
|
| 108 |
|
| 109 |
+
if (! $instance) {
|
| 110 |
$instance = [];
|
| 111 |
}
|
| 112 |
|
| 113 |
// @codingStandardsIgnoreLine
|
| 114 |
+
echo blc_call_fn(
|
| 115 |
+
['fn' => 'blocksy_render_view'],
|
| 116 |
$file_path,
|
| 117 |
array_merge(
|
| 118 |
[ 'atts' => $instance ],
|
| 127 |
if ( file_exists( $this->get_path() . '/options.php' ) ) {
|
| 128 |
$options = blocksy_akg(
|
| 129 |
'options',
|
| 130 |
+
blc_call_fn(
|
| 131 |
+
['fn' => 'blocksy_get_variables_from_file'],
|
| 132 |
$this->get_path() . '/options.php',
|
| 133 |
+
['options' => []]
|
| 134 |
)
|
| 135 |
);
|
| 136 |
}
|
| 141 |
$this->options = [
|
| 142 |
'title' => [
|
| 143 |
'type' => 'text',
|
| 144 |
+
'label' => __( 'Widget Title', 'blc' ),
|
| 145 |
'field_attr' => [ 'id' => 'widget-title' ],
|
| 146 |
],
|
| 147 |
];
|
| 155 |
* @param array $old_instance old widget values.
|
| 156 |
*/
|
| 157 |
public function update( $new_instance, $old_instance ) {
|
| 158 |
+
$new_instance[ $this->prefix ][ 'ct_options' ] = json_decode(
|
| 159 |
+
$new_instance[ $this->prefix ][ 'ct_options' ],
|
| 160 |
true
|
| 161 |
);
|
| 162 |
|
| 166 |
public function form( $values ) {
|
| 167 |
$this->read_options();
|
| 168 |
|
| 169 |
+
echo blc_call_fn(
|
| 170 |
+
['fn' => 'blocksy_output_options_panel'],
|
| 171 |
[
|
| 172 |
'options' => $this->options,
|
| 173 |
+
'values' => blocksy_akg('ct_options', $values),
|
| 174 |
'id_prefix' => 'ct-widget-options-' . $this->get_field_id(
|
| 175 |
$this->prefix
|
| 176 |
),
|
freemius-pricing/178afa6030e76635dbe835e111d2c507.png
ADDED
|
Binary file
|
freemius-pricing/27b5a722a5553d9de0170325267fccec.png
ADDED
|
Binary file
|
freemius-pricing/4375c4a3ddc6f637c2ab9a2d7220f91e.png
ADDED
|
Binary file
|
freemius-pricing/5480ed23b199531a8cbc05924f26952b.png
ADDED
|
Binary file
|
freemius-pricing/b4f3b958f4a019862d81b15f3f8eee3a.svg
ADDED
|
@@ -0,0 +1,402 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
| 2 |
+
<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
| 3 |
+
<svg version="1.1" id="Слой_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
| 4 |
+
width="250px" height="115.3px" viewBox="0 0 250 115.3" style="enable-background:new 0 0 250 115.3;" xml:space="preserve">
|
| 5 |
+
<style type="text/css">
|
| 6 |
+
.st0{fill:#969696;}
|
| 7 |
+
.st1{fill:#999999;}
|
| 8 |
+
.st2{fill:#FFFFFF;}
|
| 9 |
+
.st3{fill:#CCCCCC;}
|
| 10 |
+
.st4{fill:#72AF00;}
|
| 11 |
+
.st5{fill:#29ABE2;}
|
| 12 |
+
.st6{fill:#D4145A;}
|
| 13 |
+
.st7{fill:#333333;}
|
| 14 |
+
.st8{fill:#009ADE;}
|
| 15 |
+
.st9{fill:#002F87;}
|
| 16 |
+
.st10{fill-rule:evenodd;clip-rule:evenodd;fill:#FBB231;}
|
| 17 |
+
.st11{fill-rule:evenodd;clip-rule:evenodd;fill:#EC1B2E;}
|
| 18 |
+
.st12{fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;}
|
| 19 |
+
.st13{fill:#2FABF7;}
|
| 20 |
+
.st14{fill:#228FE0;}
|
| 21 |
+
.st15{fill:#0571C1;}
|
| 22 |
+
.st16{fill:#1174CE;}
|
| 23 |
+
.st17{fill:#1BCC38;}
|
| 24 |
+
.st18{fill:#E20E37;}
|
| 25 |
+
.st19{fill:#00579F;}
|
| 26 |
+
.st20{fill:#FAA61A;}
|
| 27 |
+
.st21{fill:#F4F4F4;}
|
| 28 |
+
.st22{fill:none;stroke:#969696;stroke-width:7;stroke-miterlimit:10;}
|
| 29 |
+
</style>
|
| 30 |
+
<g>
|
| 31 |
+
<g>
|
| 32 |
+
<path class="st4" d="M225.4,36c-1,0-1.4-0.5-1.2-1.6l0.5-2.8c0.2-1.1,0.9-1.6,1.9-1.6h3.9c1.1,0,1.5,0.5,1.3,1.6l-0.5,2.8
|
| 33 |
+
c-0.2,1.1-0.8,1.6-1.9,1.6H225.4z"/>
|
| 34 |
+
<path class="st4" d="M218.3,70.4c-1,0-1.4-0.5-1.2-1.6l0.5-2.8c0.2-1.1,0.9-1.6,1.9-1.6h3.9c1.1,0,1.5,0.5,1.3,1.6l-0.5,2.8
|
| 35 |
+
c-0.2,1.1-0.8,1.6-1.9,1.6H218.3z"/>
|
| 36 |
+
<path class="st7" d="M187.1,38h-3c-1,0-1.9,0.7-2,1.7l-2.8,15.9h-3l2.1-11.8c0.7-3.9-0.9-5.8-4.7-5.8h-21.5
|
| 37 |
+
c-3.8,0-6.1,1.9-6.7,5.8l-2.1,11.8h-6.6h-5.7c-0.9,0-1.2-0.4-1-1.2l0.3-1.8c0.3,0.2,0.8,0.3,1.2,0.3h5.3c3.6,0,6.1-1.9,6.7-5.7
|
| 38 |
+
l0.6-3.6c0.6-3.7-0.8-5.6-4.4-5.6h-8.5c-3.8,0-6,1.9-6.7,5.8l-2.1,11.9h-11.4c-0.9,0-1.2-0.4-1-1.2l0.3-1.8
|
| 39 |
+
c0.3,0.2,0.8,0.3,1.2,0.3h4.9c3.6,0,5.7-1.9,6.4-5.7l0.6-3.6c0.6-3.7-0.8-5.6-4.4-5.6h-7.1h-0.7h-6.8h-7.1H85.6l0.1-0.3
|
| 40 |
+
c0.2-1.1,0.9-1.7,1.9-1.7h3.1c1,0,1.8-0.7,1.9-1.6l0.8-4.3h-7.9c-1.8,0-3.3,0.5-4.5,1.5c-1.2,1-1.9,2.4-2.3,4.3l-4.7,26.6h7.2
|
| 41 |
+
l3.1-17.8h6.4l-3.1,17.8h7.2l3-16.6c0.1-0.8,0.5-1.2,1.2-1.2h4.3l0,0h1.4l-2.2,12.1c-0.5,3.2,1.6,5.8,4.8,5.8h19.9h8.2h6.6h1.8
|
| 42 |
+
h2.9c1.4,0,2.6-1,2.8-2.4l2.4-13.6c0.2-0.9,0.6-1.2,1.5-1.2h4.5l-2.7,15.9c-0.1,0.7,0.4,1.3,1.2,1.3h4.7c0.6,0,1.1-0.4,1.2-1
|
| 43 |
+
l2.9-16.3h4.6c0.9,0,1.2,0.4,1,1.2l-2.4,13.4c-0.2,1.1,0.5,2.2,1.6,2.5v0.1h0.6h4.4h5.4h3h0.4v-0.1c0.9-0.2,1.5-0.8,1.7-1.7
|
| 44 |
+
l3.6-20.3C189.3,39.2,188.4,38,187.1,38z M131.3,47.3l0.3-1.7c0.1-0.5,0.4-0.8,1-0.8h3c0.5,0,0.8,0.3,0.7,0.8l-0.3,1.7
|
| 45 |
+
c-0.1,0.5-0.4,0.8-1,0.8h-3C131.4,48.1,131.2,47.8,131.3,47.3z M111.5,47.3l0.3-1.7c0.1-0.5,0.4-0.8,1-0.8h2.6
|
| 46 |
+
c0.5,0,0.8,0.3,0.7,0.8l-0.3,1.7c-0.1,0.5-0.4,0.8-1,0.8h-2.6C111.6,48.1,111.4,47.8,111.5,47.3z"/>
|
| 47 |
+
<path class="st7" d="M214,38l-3.3,18.8c-0.6,3.8-2.9,5.7-6.6,5.7h-10.3c-3.9,0-5.5-1.8-4.8-5.5l3.3-19h7.2l-2.8,15.9
|
| 48 |
+
c-0.2,0.9,0.2,1.3,1,1.3h4.9c0.9,0,1.3-0.4,1.5-1.2l2.9-16H214z"/>
|
| 49 |
+
<path class="st5" d="M183,34.4l0.5-2.8c0.2-1.1,0.9-1.6,1.9-1.6h3.9c1.1,0,1.5,0.5,1.3,1.6l-0.5,2.8c-0.2,1.1-0.8,1.6-1.9,1.6
|
| 50 |
+
h-4.1C183.2,36,182.8,35.5,183,34.4z"/>
|
| 51 |
+
<path class="st6" d="M68.7,42.9l0.5-2.8c0.2-1.1,0.9-1.6,1.9-1.6h3.9c1.1,0,1.5,0.5,1.3,1.6l-0.5,2.8c-0.2,1.1-0.8,1.6-1.9,1.6
|
| 52 |
+
h-4.1C68.9,44.5,68.6,43.9,68.7,42.9z"/>
|
| 53 |
+
<path class="st7" d="M212.1,62.6l1.2-6.8h13.8c0.5,0,0.8-0.3,0.9-0.8l0.3-1.5c0.1-0.4-0.1-0.6-0.6-0.6h-9.2
|
| 54 |
+
c-1.9,0-3.1-0.4-3.7-1.3c-0.5-0.9-0.7-2.2-0.4-4l0.6-3.7c0.6-3.8,2.9-5.7,6.7-5.7h15.8l-1.2,6.8h-13.7c-0.5,0-0.8,0.3-0.9,0.8
|
| 55 |
+
l-0.3,1.5c-0.1,0.4,0.1,0.6,0.6,0.6h9.2c3.4,0,4.8,1.8,4.3,5.3l-0.6,3.8c-0.7,3.8-2.7,5.8-6.2,5.8L212.1,62.6L212.1,62.6z"/>
|
| 56 |
+
</g>
|
| 57 |
+
<g>
|
| 58 |
+
<path class="st0" d="M244.4,115.2H5.6c-3.1,0-5.6-2.5-5.6-5.6V14.1C0,11,2.5,8.5,5.6,8.5h34.7v0.7H5.6c-2.7,0-4.8,2.2-4.8,4.8
|
| 59 |
+
v95.6c0,2.7,2.2,4.8,4.8,4.8h238.9c2.7,0,4.8-2.2,4.8-4.8V14.1c0-2.7-2.2-4.8-4.8-4.8h-35.9V8.5h35.9c3.1,0,5.6,2.5,5.6,5.6v95.6
|
| 60 |
+
C250,112.7,247.5,115.2,244.4,115.2z"/>
|
| 61 |
+
</g>
|
| 62 |
+
<g>
|
| 63 |
+
<path class="st0" d="M51.3,13.2c-0.7-0.2-1.3-0.5-1.8-0.8l0.8-1.7c0.4,0.3,0.9,0.6,1.5,0.8c0.6,0.2,1.2,0.3,1.8,0.3
|
| 64 |
+
c0.7,0,1.1-0.1,1.4-0.3c0.3-0.2,0.5-0.5,0.5-0.8c0-0.2-0.1-0.4-0.3-0.6c-0.2-0.2-0.4-0.3-0.7-0.4c-0.3-0.1-0.7-0.2-1.2-0.3
|
| 65 |
+
c-0.8-0.2-1.4-0.4-1.9-0.5c-0.5-0.2-0.9-0.5-1.2-0.9C50,7.5,49.8,7,49.8,6.3c0-0.6,0.2-1.1,0.5-1.6c0.3-0.5,0.8-0.8,1.4-1.1
|
| 66 |
+
c0.6-0.3,1.4-0.4,2.3-0.4c0.6,0,1.3,0.1,1.9,0.2c0.6,0.2,1.1,0.4,1.6,0.7l-0.7,1.7c-0.9-0.5-1.8-0.8-2.8-0.8
|
| 67 |
+
c-0.6,0-1.1,0.1-1.4,0.3c-0.3,0.2-0.5,0.5-0.5,0.8c0,0.3,0.2,0.6,0.5,0.8c0.4,0.2,0.9,0.3,1.6,0.5C55,7.6,55.6,7.8,56.1,8
|
| 68 |
+
c0.5,0.2,0.9,0.5,1.2,0.9c0.3,0.4,0.5,0.9,0.5,1.6c0,0.6-0.2,1.1-0.5,1.6c-0.3,0.5-0.8,0.8-1.4,1.1c-0.6,0.3-1.4,0.4-2.3,0.4
|
| 69 |
+
C52.8,13.5,52.1,13.4,51.3,13.2z"/>
|
| 70 |
+
<path class="st0" d="M66.7,10.1h-5.8c0.1,0.5,0.4,0.8,0.7,1.1c0.4,0.3,0.9,0.4,1.4,0.4c0.4,0,0.8-0.1,1.1-0.2
|
| 71 |
+
c0.3-0.1,0.6-0.3,0.9-0.6l1.2,1.3c-0.7,0.8-1.8,1.2-3.2,1.2c-0.9,0-1.6-0.2-2.3-0.5c-0.7-0.3-1.2-0.8-1.5-1.4
|
| 72 |
+
c-0.4-0.6-0.5-1.3-0.5-2c0-0.7,0.2-1.4,0.5-2c0.4-0.6,0.8-1.1,1.5-1.4c0.6-0.3,1.3-0.5,2.1-0.5c0.7,0,1.4,0.2,2,0.5
|
| 73 |
+
c0.6,0.3,1.1,0.8,1.4,1.4c0.3,0.6,0.5,1.3,0.5,2.1C66.8,9.6,66.7,9.8,66.7,10.1z M61.5,7.7c-0.3,0.3-0.5,0.7-0.6,1.2h3.8
|
| 74 |
+
C64.6,8.3,64.4,8,64,7.7c-0.3-0.3-0.8-0.4-1.2-0.4C62.3,7.2,61.9,7.4,61.5,7.7z"/>
|
| 75 |
+
<path class="st0" d="M69.7,12.9c-0.6-0.3-1.2-0.8-1.5-1.4c-0.4-0.6-0.5-1.3-0.5-2c0-0.8,0.2-1.4,0.5-2c0.4-0.6,0.9-1.1,1.5-1.4
|
| 76 |
+
c0.6-0.3,1.4-0.5,2.2-0.5c0.8,0,1.5,0.2,2.1,0.5c0.6,0.3,1,0.8,1.3,1.4l-1.7,0.9c-0.4-0.7-1-1.1-1.7-1.1c-0.6,0-1.1,0.2-1.4,0.6
|
| 77 |
+
c-0.4,0.4-0.6,0.9-0.6,1.5c0,0.7,0.2,1.2,0.6,1.5c0.4,0.4,0.9,0.6,1.4,0.6c0.8,0,1.3-0.4,1.7-1.1l1.7,0.9
|
| 78 |
+
c-0.3,0.6-0.7,1.1-1.3,1.4c-0.6,0.3-1.3,0.5-2.1,0.5C71.1,13.4,70.4,13.3,69.7,12.9z"/>
|
| 79 |
+
<path class="st0" d="M84.3,5.7v7.6h-2.1v-0.9c-0.3,0.3-0.6,0.6-1.1,0.8c-0.4,0.2-0.8,0.3-1.3,0.3c-1,0-1.8-0.3-2.4-0.9
|
| 80 |
+
c-0.6-0.6-0.9-1.4-0.9-2.6V5.7h2.2v4c0,1.2,0.5,1.8,1.5,1.8c0.5,0,1-0.2,1.3-0.5c0.3-0.3,0.5-0.9,0.5-1.5V5.7H84.3z"/>
|
| 81 |
+
<path class="st0" d="M89.6,5.8c0.4-0.2,1-0.3,1.6-0.3v2c-0.2,0-0.4,0-0.5,0c-0.6,0-1.1,0.2-1.5,0.5c-0.4,0.4-0.5,0.9-0.5,1.6v3.6
|
| 82 |
+
h-2.2V5.7h2.1v1C88.8,6.3,89.1,6,89.6,5.8z"/>
|
| 83 |
+
<path class="st0" d="M99.8,10.1H94c0.1,0.5,0.4,0.8,0.7,1.1c0.4,0.3,0.9,0.4,1.4,0.4c0.4,0,0.8-0.1,1.1-0.2
|
| 84 |
+
c0.3-0.1,0.6-0.3,0.9-0.6l1.2,1.3c-0.7,0.8-1.8,1.2-3.2,1.2c-0.9,0-1.6-0.2-2.3-0.5c-0.7-0.3-1.2-0.8-1.5-1.4
|
| 85 |
+
c-0.4-0.6-0.5-1.3-0.5-2c0-0.7,0.2-1.4,0.5-2c0.4-0.6,0.8-1.1,1.5-1.4c0.6-0.3,1.3-0.5,2.1-0.5c0.7,0,1.4,0.2,2,0.5
|
| 86 |
+
c0.6,0.3,1.1,0.8,1.4,1.4c0.3,0.6,0.5,1.3,0.5,2.1C99.9,9.6,99.8,9.8,99.8,10.1z M94.6,7.7c-0.3,0.3-0.5,0.7-0.6,1.2h3.8
|
| 87 |
+
c-0.1-0.5-0.3-0.9-0.6-1.2c-0.3-0.3-0.8-0.4-1.2-0.4C95.4,7.2,95,7.4,94.6,7.7z"/>
|
| 88 |
+
<path class="st0" d="M111.8,6.1c0.6,0.3,1,0.8,1.4,1.4c0.3,0.6,0.5,1.3,0.5,2.1c0,0.8-0.2,1.5-0.5,2.1c-0.3,0.6-0.8,1.1-1.4,1.4
|
| 89 |
+
s-1.2,0.5-1.9,0.5c-1,0-1.7-0.3-2.3-0.9v3.6h-2.2V5.7h2.1v0.9c0.5-0.7,1.3-1,2.4-1C110.6,5.6,111.2,5.7,111.8,6.1z M110.9,11
|
| 90 |
+
c0.4-0.4,0.5-0.9,0.5-1.5c0-0.6-0.2-1.2-0.5-1.5c-0.4-0.4-0.8-0.6-1.4-0.6c-0.6,0-1,0.2-1.4,0.6c-0.4,0.4-0.5,0.9-0.5,1.5
|
| 91 |
+
c0,0.6,0.2,1.2,0.5,1.5c0.4,0.4,0.8,0.6,1.4,0.6C110.1,11.6,110.5,11.4,110.9,11z"/>
|
| 92 |
+
<path class="st0" d="M120.8,6.4c0.6,0.6,1,1.4,1,2.5v4.4h-2.1v-1c-0.4,0.7-1.2,1.1-2.3,1.1c-0.6,0-1.1-0.1-1.5-0.3
|
| 93 |
+
c-0.4-0.2-0.8-0.5-1-0.8c-0.2-0.4-0.3-0.7-0.3-1.2c0-0.7,0.3-1.3,0.8-1.7c0.5-0.4,1.4-0.6,2.5-0.6h1.8c0-0.5-0.1-0.9-0.4-1.1
|
| 94 |
+
c-0.3-0.3-0.7-0.4-1.3-0.4c-0.4,0-0.8,0.1-1.2,0.2c-0.4,0.1-0.7,0.3-1,0.5l-0.8-1.5c0.4-0.3,0.9-0.5,1.5-0.7
|
| 95 |
+
c0.6-0.2,1.2-0.2,1.8-0.2C119.3,5.6,120.2,5.8,120.8,6.4z M118.9,11.7c0.3-0.2,0.5-0.4,0.6-0.8v-0.8h-1.5c-0.9,0-1.4,0.3-1.4,0.9
|
| 96 |
+
c0,0.3,0.1,0.5,0.3,0.7c0.2,0.2,0.5,0.2,0.9,0.2C118.3,11.9,118.7,11.9,118.9,11.7z"/>
|
| 97 |
+
<path class="st0" d="M131.2,5.7l-3.5,8.1c-0.4,0.9-0.8,1.5-1.3,1.9c-0.5,0.4-1.1,0.5-1.9,0.5c-0.4,0-0.8-0.1-1.2-0.2
|
| 98 |
+
c-0.4-0.1-0.7-0.3-1-0.5l0.8-1.6c0.2,0.2,0.4,0.3,0.6,0.4c0.2,0.1,0.4,0.1,0.7,0.1c0.3,0,0.5-0.1,0.7-0.2c0.2-0.1,0.4-0.4,0.5-0.7
|
| 99 |
+
l0-0.1l-3.3-7.7h2.3l2.1,5.2l2.2-5.2H131.2z"/>
|
| 100 |
+
<path class="st0" d="M144.2,6.4c0.6,0.6,0.8,1.4,0.8,2.5v4.4h-2.2v-4c0-0.6-0.1-1.1-0.4-1.4c-0.3-0.3-0.6-0.4-1.1-0.4
|
| 101 |
+
c-0.5,0-0.9,0.2-1.2,0.5c-0.3,0.3-0.5,0.8-0.5,1.5v3.8h-2.2v-4c0-1.2-0.5-1.8-1.4-1.8c-0.5,0-0.9,0.2-1.2,0.5
|
| 102 |
+
c-0.3,0.3-0.5,0.8-0.5,1.5v3.8h-2.2V5.7h2.1v0.9c0.3-0.3,0.6-0.6,1-0.7c0.4-0.2,0.9-0.3,1.4-0.3c0.5,0,1,0.1,1.5,0.3
|
| 103 |
+
c0.4,0.2,0.8,0.5,1.1,0.9c0.3-0.4,0.7-0.7,1.2-0.9c0.5-0.2,1-0.3,1.6-0.3C142.9,5.6,143.6,5.8,144.2,6.4z"/>
|
| 104 |
+
<path class="st0" d="M154.6,10.1h-5.8c0.1,0.5,0.4,0.8,0.7,1.1c0.4,0.3,0.9,0.4,1.4,0.4c0.4,0,0.8-0.1,1.1-0.2
|
| 105 |
+
c0.3-0.1,0.6-0.3,0.9-0.6l1.2,1.3c-0.7,0.8-1.8,1.2-3.2,1.2c-0.9,0-1.6-0.2-2.3-0.5c-0.7-0.3-1.2-0.8-1.5-1.4
|
| 106 |
+
c-0.4-0.6-0.5-1.3-0.5-2c0-0.7,0.2-1.4,0.5-2c0.4-0.6,0.8-1.1,1.5-1.4c0.6-0.3,1.3-0.5,2.1-0.5c0.7,0,1.4,0.2,2,0.5
|
| 107 |
+
c0.6,0.3,1.1,0.8,1.4,1.4c0.3,0.6,0.5,1.3,0.5,2.1C154.6,9.6,154.6,9.8,154.6,10.1z M149.4,7.7c-0.3,0.3-0.5,0.7-0.6,1.2h3.8
|
| 108 |
+
c-0.1-0.5-0.3-0.9-0.6-1.2c-0.3-0.3-0.8-0.4-1.2-0.4C150.1,7.2,149.7,7.4,149.4,7.7z"/>
|
| 109 |
+
<path class="st0" d="M163,6.4c0.6,0.6,0.9,1.4,0.9,2.5v4.4h-2.2v-4c0-0.6-0.1-1.1-0.4-1.4c-0.3-0.3-0.6-0.4-1.2-0.4
|
| 110 |
+
c-0.6,0-1,0.2-1.3,0.5c-0.3,0.3-0.5,0.9-0.5,1.5v3.8h-2.2V5.7h2.1v0.9c0.3-0.3,0.7-0.6,1.1-0.7c0.4-0.2,0.9-0.3,1.4-0.3
|
| 111 |
+
C161.7,5.6,162.4,5.8,163,6.4z"/>
|
| 112 |
+
<path class="st0" d="M170.8,12.9c-0.2,0.2-0.5,0.3-0.8,0.4c-0.3,0.1-0.7,0.1-1,0.1c-0.9,0-1.6-0.2-2.1-0.7c-0.5-0.5-0.7-1.1-0.7-2
|
| 113 |
+
V7.6H165V5.8h1.2V4h2.2v1.9h1.9v1.7h-1.9v3.1c0,0.3,0.1,0.6,0.2,0.7c0.2,0.2,0.4,0.3,0.7,0.3c0.4,0,0.6-0.1,0.9-0.3L170.8,12.9z"
|
| 114 |
+
/>
|
| 115 |
+
<path class="st0" d="M172.8,13.2c-0.6-0.2-1.1-0.4-1.4-0.6l0.7-1.6c0.3,0.2,0.8,0.4,1.2,0.5c0.5,0.1,1,0.2,1.4,0.2
|
| 116 |
+
c0.9,0,1.4-0.2,1.4-0.7c0-0.2-0.1-0.4-0.4-0.5c-0.3-0.1-0.6-0.2-1.2-0.2c-0.6-0.1-1.1-0.2-1.5-0.3c-0.4-0.1-0.8-0.3-1.1-0.7
|
| 117 |
+
c-0.3-0.3-0.4-0.8-0.4-1.3c0-0.5,0.1-0.9,0.4-1.3c0.3-0.4,0.7-0.7,1.2-0.9c0.5-0.2,1.2-0.3,1.9-0.3c0.5,0,1.1,0.1,1.6,0.2
|
| 118 |
+
c0.5,0.1,1,0.3,1.3,0.5l-0.7,1.6c-0.7-0.4-1.4-0.6-2.2-0.6c-0.5,0-0.8,0.1-1.1,0.2c-0.2,0.1-0.4,0.3-0.4,0.5
|
| 119 |
+
c0,0.2,0.1,0.4,0.4,0.5c0.3,0.1,0.7,0.2,1.2,0.3c0.6,0.1,1.1,0.2,1.5,0.3c0.4,0.1,0.7,0.3,1,0.6c0.3,0.3,0.4,0.7,0.4,1.3
|
| 120 |
+
c0,0.5-0.1,0.9-0.4,1.3c-0.3,0.4-0.7,0.7-1.2,0.9c-0.5,0.2-1.2,0.3-1.9,0.3C174,13.4,173.4,13.4,172.8,13.2z"/>
|
| 121 |
+
<path class="st0" d="M190.1,6.1c0.6,0.3,1,0.8,1.4,1.4c0.3,0.6,0.5,1.3,0.5,2.1c0,0.8-0.2,1.5-0.5,2.1c-0.3,0.6-0.8,1.1-1.4,1.4
|
| 122 |
+
c-0.6,0.3-1.2,0.5-1.9,0.5c-1.1,0-1.9-0.3-2.4-1v0.9h-2.1V2.8h2.2v3.7c0.6-0.6,1.3-0.9,2.3-0.9C188.9,5.6,189.5,5.7,190.1,6.1z
|
| 123 |
+
M189.2,11c0.4-0.4,0.5-0.9,0.5-1.5c0-0.6-0.2-1.2-0.5-1.5c-0.4-0.4-0.8-0.6-1.4-0.6s-1,0.2-1.4,0.6c-0.4,0.4-0.5,0.9-0.5,1.5
|
| 124 |
+
c0,0.6,0.2,1.2,0.5,1.5c0.4,0.4,0.8,0.6,1.4,0.6S188.8,11.4,189.2,11z"/>
|
| 125 |
+
<path class="st0" d="M200.8,5.7l-3.5,8.1c-0.4,0.9-0.8,1.5-1.3,1.9c-0.5,0.4-1.1,0.5-1.9,0.5c-0.4,0-0.8-0.1-1.2-0.2
|
| 126 |
+
c-0.4-0.1-0.7-0.3-1-0.5l0.8-1.6c0.2,0.2,0.4,0.3,0.6,0.4c0.2,0.1,0.4,0.1,0.7,0.1c0.3,0,0.5-0.1,0.7-0.2c0.2-0.1,0.4-0.4,0.5-0.7
|
| 127 |
+
l0-0.1l-3.3-7.7h2.3l2.1,5.2l2.2-5.2H200.8z"/>
|
| 128 |
+
</g>
|
| 129 |
+
<path class="st4" d="M51,41.7h-2.3v-4.8c0-8.2-6.7-14.8-14.8-14.8S19,28.8,19,36.9v4.8h-2.3c-2.6,0-4.7,2.1-4.7,4.7v18.7
|
| 130 |
+
c0,2.6,2.1,4.7,4.7,4.7H51c2.6,0,4.7-2.1,4.7-4.7V46.4C55.7,43.8,53.6,41.7,51,41.7z M26.8,36.9c0-3.9,3.2-7,7-7s7,3.2,7,7v4.8
|
| 131 |
+
H26.8V36.9z M44.1,51L31.9,63.2c-0.4,0.4-1.1,0.4-1.5,0l-6.9-6.9c-0.4-0.4-0.4-1.1,0-1.5l1.5-1.5c0.4-0.4,1.1-0.4,1.5,0l4.6,4.6
|
| 132 |
+
l10-10c0.4-0.4,1.1-0.4,1.5,0l1.5,1.5C44.6,49.9,44.6,50.6,44.1,51z"/>
|
| 133 |
+
<g>
|
| 134 |
+
<g>
|
| 135 |
+
<g>
|
| 136 |
+
<g>
|
| 137 |
+
<path class="st8" d="M53.9,87h-4.8c-0.3,0-0.6,0.2-0.7,0.6l-2,12.4c0,0.2,0.2,0.5,0.4,0.5h2.5c0.2,0,0.4-0.2,0.5-0.4l0.6-3.5
|
| 138 |
+
c0.1-0.3,0.3-0.6,0.7-0.6h1.5c3.2,0,5-1.5,5.5-4.6c0.2-1.3,0-2.4-0.6-3.1C56.7,87.4,55.5,87,53.9,87z M54.5,91.5
|
| 139 |
+
c-0.3,1.7-1.6,1.7-2.9,1.7h-0.7l0.5-3.2c0-0.2,0.2-0.3,0.4-0.3h0.3c0.9,0,1.7,0,2.1,0.5C54.5,90.5,54.5,90.9,54.5,91.5z"/>
|
| 140 |
+
<path class="st9" d="M19.4,87h-4.8c-0.3,0-0.6,0.2-0.7,0.6l-2,12.4c0,0.2,0.2,0.5,0.4,0.5h2.3c0.3,0,0.6-0.2,0.7-0.6l0.5-3.3
|
| 141 |
+
c0.1-0.3,0.3-0.6,0.7-0.6h1.5c3.2,0,5-1.5,5.5-4.6c0.2-1.3,0-2.4-0.6-3.1C22.3,87.4,21,87,19.4,87z M20,91.5
|
| 142 |
+
c-0.3,1.7-1.6,1.7-2.9,1.7h-0.7l0.5-3.2c0-0.2,0.2-0.3,0.4-0.3h0.3c0.9,0,1.7,0,2.1,0.5C20,90.5,20.1,90.9,20,91.5z"/>
|
| 143 |
+
<path class="st9" d="M33.9,91.5h-2.3c-0.2,0-0.4,0.1-0.4,0.3l-0.1,0.6l-0.2-0.2c-0.5-0.7-1.6-1-2.7-1c-2.6,0-4.7,1.9-5.2,4.7
|
| 144 |
+
c-0.2,1.4,0.1,2.7,0.9,3.6c0.7,0.8,1.7,1.2,2.9,1.2c2.1,0,3.2-1.3,3.2-1.3l-0.1,0.6c0,0.2,0.2,0.5,0.4,0.5h2.1
|
| 145 |
+
c0.3,0,0.6-0.2,0.7-0.6l1.3-7.9C34.3,91.7,34.1,91.5,33.9,91.5z M30.6,96c-0.2,1.3-1.3,2.2-2.6,2.2c-0.7,0-1.2-0.2-1.6-0.6
|
| 146 |
+
c-0.3-0.4-0.5-1-0.4-1.6c0.2-1.3,1.3-2.2,2.6-2.2c0.7,0,1.2,0.2,1.5,0.6C30.6,94.7,30.8,95.3,30.6,96z"/>
|
| 147 |
+
<path class="st8" d="M68.3,91.5H66c-0.2,0-0.4,0.1-0.4,0.3l-0.1,0.6l-0.2-0.2c-0.5-0.7-1.6-1-2.7-1c-2.6,0-4.7,1.9-5.2,4.7
|
| 148 |
+
c-0.2,1.4,0.1,2.7,0.9,3.6c0.7,0.8,1.7,1.2,2.9,1.2c2.1,0,3.2-1.3,3.2-1.3l-0.1,0.6c0,0.2,0.2,0.5,0.4,0.5h2.1
|
| 149 |
+
c0.3,0,0.6-0.2,0.7-0.6l1.3-7.9C68.8,91.7,68.6,91.5,68.3,91.5z M65.1,96c-0.2,1.3-1.3,2.2-2.6,2.2c-0.7,0-1.2-0.2-1.6-0.6
|
| 150 |
+
c-0.3-0.4-0.5-1-0.4-1.6c0.2-1.3,1.3-2.2,2.6-2.2c0.7,0,1.2,0.2,1.5,0.6C65.1,94.7,65.2,95.3,65.1,96z"/>
|
| 151 |
+
<path class="st9" d="M46.2,91.5h-2.3c-0.2,0-0.4,0.1-0.6,0.3l-3.2,4.7l-1.4-4.5c-0.1-0.3-0.3-0.5-0.6-0.5h-2.3
|
| 152 |
+
c-0.3,0-0.5,0.3-0.4,0.5l2.6,7.5l-2.4,3.4c-0.2,0.3,0,0.6,0.3,0.6h2.3c0.2,0,0.4-0.1,0.6-0.3l7.7-11.2
|
| 153 |
+
C46.7,91.8,46.5,91.5,46.2,91.5z"/>
|
| 154 |
+
<path class="st8" d="M71.1,87.3l-2,12.6c0,0.2,0.2,0.5,0.4,0.5h2c0.3,0,0.6-0.2,0.7-0.6l2-12.4c0-0.2-0.2-0.5-0.4-0.5h-2.2
|
| 155 |
+
C71.3,87,71.1,87.1,71.1,87.3z"/>
|
| 156 |
+
</g>
|
| 157 |
+
</g>
|
| 158 |
+
</g>
|
| 159 |
+
</g>
|
| 160 |
+
<g>
|
| 161 |
+
<polygon class="st10" points="150.3,102.3 150.8,102.2 151.3,102.2 151.7,102.1 152.2,102.1 152.6,102 153,101.8 153.4,101.7
|
| 162 |
+
153.8,101.5 154.2,101.4 154.6,101.2 155,100.9 155.4,100.7 155.7,100.5 156.1,100.2 156.4,99.9 156.7,99.6 157,99.3 157.3,99
|
| 163 |
+
157.6,98.6 157.8,98.3 158,97.9 158.3,97.5 158.5,97.2 158.6,96.8 158.8,96.3 158.9,95.9 159.1,95.5 159.2,95.1 159.2,94.6
|
| 164 |
+
159.3,94.2 159.3,93.7 159.3,93.2 159.3,92.8 159.3,92.3 159.2,91.9 159.2,91.4 159.1,91 158.9,90.6 158.8,90.2 158.6,89.8
|
| 165 |
+
158.5,89.4 158.3,89 158,88.6 157.8,88.2 157.6,87.9 157.3,87.5 157,87.2 156.7,86.9 156.4,86.6 156.1,86.3 155.7,86.1
|
| 166 |
+
155.4,85.8 155,85.6 154.6,85.4 154.2,85.2 153.8,85 153.4,84.8 153,84.7 152.6,84.6 152.2,84.5 151.7,84.4 151.3,84.3
|
| 167 |
+
150.8,84.3 150.3,84.3 149.9,84.3 149.4,84.3 149,84.4 148.5,84.5 148.1,84.6 147.7,84.7 147.3,84.8 146.8,85 146.4,85.2
|
| 168 |
+
146.1,85.4 145.7,85.6 145.3,85.8 145,86.1 144.6,86.3 144.3,86.6 144,86.9 143.7,87.2 143.4,87.5 143.1,87.9 142.9,88.2
|
| 169 |
+
142.7,88.6 142.4,89 142.2,89.4 142.1,89.8 141.9,90.2 141.8,90.6 141.6,91 141.5,91.4 141.5,91.9 141.4,92.3 141.4,92.8
|
| 170 |
+
141.4,93.2 141.4,93.7 141.4,94.2 141.5,94.6 141.5,95.1 141.6,95.5 141.8,95.9 141.9,96.3 142.1,96.8 142.2,97.2 142.4,97.5
|
| 171 |
+
142.7,97.9 142.9,98.3 143.1,98.6 143.4,99 143.7,99.3 144,99.6 144.3,99.9 144.6,100.2 145,100.5 145.3,100.7 145.7,100.9
|
| 172 |
+
146.1,101.2 146.4,101.4 146.8,101.5 147.3,101.7 147.7,101.8 148.1,102 148.5,102.1 149,102.1 149.4,102.2 149.9,102.2
|
| 173 |
+
150.3,102.3 150.3,102.3 "/>
|
| 174 |
+
<polygon class="st11" points="138.3,102.3 138.8,102.2 139.2,102.2 139.7,102.1 140.1,102.1 140.6,102 141,101.8 141.4,101.7
|
| 175 |
+
141.8,101.5 142.2,101.4 142.6,101.2 143,100.9 143.3,100.7 143.7,100.5 144,100.2 144.3,99.9 144.7,99.6 145,99.3 145.2,99
|
| 176 |
+
145.5,98.6 145.8,98.3 146,97.9 146.2,97.5 146.4,97.2 146.6,96.8 146.7,96.3 146.9,95.9 147,95.5 147.1,95.1 147.2,94.6
|
| 177 |
+
147.2,94.2 147.3,93.7 147.3,93.2 147.3,92.8 147.2,92.3 147.2,91.9 147.1,91.4 147,91 146.9,90.6 146.7,90.2 146.6,89.8
|
| 178 |
+
146.4,89.4 146.2,89 146,88.6 145.8,88.2 145.5,87.9 145.2,87.5 145,87.2 144.7,86.9 144.3,86.6 144,86.3 143.7,86.1 143.3,85.8
|
| 179 |
+
143,85.6 142.6,85.4 142.2,85.2 141.8,85 141.4,84.8 141,84.7 140.6,84.6 140.1,84.5 139.7,84.4 139.2,84.3 138.8,84.3
|
| 180 |
+
138.3,84.3 137.8,84.3 137.4,84.3 136.9,84.4 136.5,84.5 136.1,84.6 135.6,84.7 135.2,84.8 134.8,85 134.4,85.2 134,85.4
|
| 181 |
+
133.6,85.6 133.3,85.8 132.9,86.1 132.6,86.3 132.3,86.6 131.9,86.9 131.6,87.2 131.4,87.5 131.1,87.9 130.8,88.2 130.6,88.6
|
| 182 |
+
130.4,89 130.2,89.4 130,89.8 129.9,90.2 129.7,90.6 129.6,91 129.5,91.4 129.4,91.9 129.3,92.3 129.3,92.8 129.3,93.2
|
| 183 |
+
129.3,93.7 129.3,94.2 129.4,94.6 129.5,95.1 129.6,95.5 129.7,95.9 129.9,96.3 130,96.8 130.2,97.2 130.4,97.5 130.6,97.9
|
| 184 |
+
130.8,98.3 131.1,98.6 131.4,99 131.6,99.3 131.9,99.6 132.3,99.9 132.6,100.2 132.9,100.5 133.3,100.7 133.6,100.9 134,101.2
|
| 185 |
+
134.4,101.4 134.8,101.5 135.2,101.7 135.6,101.8 136.1,102 136.5,102.1 136.9,102.1 137.4,102.2 137.8,102.2 138.3,102.3
|
| 186 |
+
138.3,102.3 "/>
|
| 187 |
+
<polygon class="st10" points="143.3,87.7 148,87.7 148,87.2 143.7,87.2 143.3,87.7 143.3,87.7 "/>
|
| 188 |
+
<polygon class="st10" points="142.6,88.8 148,88.8 148,88.3 142.8,88.3 142.6,88.8 142.6,88.8 "/>
|
| 189 |
+
<polygon class="st10" points="142,89.9 148,89.9 148,89.4 142.2,89.4 142,89.9 142,89.9 "/>
|
| 190 |
+
<polygon class="st10" points="141.7,91 148,91 148,90.5 141.8,90.5 141.7,91 141.7,91 "/>
|
| 191 |
+
<polygon class="st10" points="141.9,96.2 148.1,96.2 148.1,95.7 141.7,95.7 141.9,96.2 141.9,96.2 "/>
|
| 192 |
+
<polygon class="st10" points="142.3,97.3 148.1,97.3 148.1,96.8 142.1,96.8 142.3,97.3 142.3,97.3 "/>
|
| 193 |
+
<polygon class="st10" points="143,98.4 148.1,98.4 148.1,97.9 142.7,97.9 143,98.4 143,98.4 "/>
|
| 194 |
+
<polygon class="st10" points="143.9,99.5 148.1,99.5 148.1,99 143.4,99 143.9,99.5 143.9,99.5 "/>
|
| 195 |
+
<polygon class="st10" points="141.4,92.1 148,92.1 148,91.6 141.5,91.6 141.4,92.1 141.4,92.1 "/>
|
| 196 |
+
<polygon class="st10" points="145.5,95.1 148,95.1 148,94.6 145.6,94.6 145.5,95.1 145.5,95.1 "/>
|
| 197 |
+
<polygon class="st10" points="145.7,94.1 148,94.1 148,93.6 145.8,93.6 145.7,94.1 145.7,94.1 "/>
|
| 198 |
+
<polygon class="st10" points="141.3,93.6 141.9,93.6 141.9,94.1 141.3,94.1 141.3,93.6 141.3,93.6 "/>
|
| 199 |
+
<g>
|
| 200 |
+
<polygon class="st12" points="140.1,93 140,93 140,93 139.9,93 139.9,93 139.9,92.9 139.8,92.9 139.8,92.9 139.7,92.9
|
| 201 |
+
139.7,92.9 139.6,92.9 139.6,92.9 139.5,92.9 139.5,92.9 139.4,92.9 139.3,92.9 139.2,92.9 139.2,92.9 139.1,92.9 139.1,93
|
| 202 |
+
139,93 139,93 138.9,93 138.9,93.1 138.9,93.1 138.9,93.1 138.8,93.2 138.8,93.2 138.8,93.2 138.8,93.3 138.9,93.3 138.9,93.3
|
| 203 |
+
138.9,93.4 139,93.4 139,93.5 139.1,93.5 139.2,93.6 139.3,93.6 139.4,93.6 139.5,93.7 139.6,93.7 139.7,93.7 139.8,93.8
|
| 204 |
+
139.9,93.9 139.9,94 140,94.1 140,94.2 140,94.4 140,94.6 140,94.7 139.9,94.9 139.9,95 139.8,95.1 139.8,95.2 139.7,95.2
|
| 205 |
+
139.6,95.3 139.5,95.4 139.4,95.4 139.3,95.4 139.2,95.5 139.1,95.5 139,95.5 138.9,95.5 138.8,95.5 138.7,95.5 138.6,95.5
|
| 206 |
+
138.5,95.5 138.4,95.5 138.3,95.5 138.2,95.5 138.1,95.5 138,95.5 137.9,95.5 137.9,95.5 137.8,95.5 137.8,95.5 137.7,95.5
|
| 207 |
+
137.7,95.4 137.6,95.4 137.6,95.4 137.5,95.4 137.6,94.7 137.7,94.7 137.7,94.7 137.7,94.8 137.8,94.8 137.9,94.8 137.9,94.8
|
| 208 |
+
138,94.8 138.1,94.8 138.1,94.8 138.2,94.8 138.3,94.8 138.4,94.9 138.5,94.9 138.5,94.9 138.6,94.9 138.7,94.9 138.8,94.8
|
| 209 |
+
138.9,94.8 138.9,94.8 139,94.7 139,94.7 139,94.7 139,94.6 139.1,94.6 139.1,94.5 139,94.4 139,94.3 138.9,94.3 138.8,94.2
|
| 210 |
+
138.7,94.2 138.6,94.1 138.5,94.1 138.4,94 138.2,94 138.1,93.9 138,93.8 138,93.7 137.9,93.6 137.9,93.4 137.9,93.2 137.9,93.1
|
| 211 |
+
137.9,93 138,92.9 138,92.8 138,92.7 138.1,92.6 138.2,92.5 138.2,92.5 138.3,92.4 138.4,92.4 138.5,92.3 138.6,92.3 138.8,92.2
|
| 212 |
+
138.9,92.2 139.1,92.2 139.3,92.2 139.4,92.2 139.5,92.2 139.6,92.2 139.7,92.2 139.7,92.2 139.8,92.2 139.9,92.2 139.9,92.2
|
| 213 |
+
140,92.2 140,92.3 140.1,92.3 140.1,92.3 140.1,92.3 140.2,92.3 140.2,92.3 140.2,92.3 140.1,93 140.1,93 "/>
|
| 214 |
+
<polygon class="st12" points="140.8,91.5 141.6,91.5 141.5,92.3 142,92.3 141.9,93 141.3,92.9 141.1,94.6 141.1,94.7 141.1,94.7
|
| 215 |
+
141.1,94.8 141.1,94.8 141.2,94.8 141.3,94.9 141.3,94.9 141.4,94.9 141.5,94.9 141.5,94.9 141.6,94.9 141.6,94.8 141.7,94.8
|
| 216 |
+
141.7,94.8 141.7,94.8 141.7,94.8 141.6,95.4 141.6,95.4 141.6,95.4 141.5,95.4 141.5,95.4 141.5,95.4 141.5,95.4 141.5,95.5
|
| 217 |
+
141.4,95.5 141.4,95.5 141.4,95.5 141.3,95.5 141.3,95.5 141.3,95.5 141.2,95.5 141.2,95.5 141.1,95.5 140.9,95.5 140.8,95.5
|
| 218 |
+
140.6,95.5 140.6,95.5 140.5,95.5 140.4,95.4 140.3,95.4 140.3,95.4 140.3,95.3 140.2,95.3 140.2,95.2 140.2,95.2 140.2,95.1
|
| 219 |
+
140.2,95.1 140.2,95 140.2,94.9 140.2,94.8 140.8,91.5 140.8,91.5 "/>
|
| 220 |
+
<polygon class="st12" points="149.9,92.5 149.9,92.4 149.8,92.4 149.8,92.4 149.7,92.4 149.7,92.4 149.6,92.3 149.6,92.3
|
| 221 |
+
149.5,92.3 149.5,92.3 149.4,92.3 149.3,92.3 149.3,92.3 149.2,92.2 149.1,92.2 149.1,92.2 149,92.2 148.9,92.2 148.8,92.2
|
| 222 |
+
148.8,92.3 148.7,92.3 148.6,92.3 148.5,92.3 148.4,92.4 148.3,92.4 148.3,92.5 148.2,92.6 148.1,92.7 148,92.8 148,92.9
|
| 223 |
+
147.9,93.1 147.8,93.2 147.8,93.4 147.8,93.5 147.8,93.6 147.8,93.7 147.8,93.9 147.8,94 147.8,94.1 147.8,94.1 147.8,94.2
|
| 224 |
+
147.9,94.3 147.9,94.4 148,94.5 148.1,94.5 148.2,94.6 148.3,94.6 148.4,94.7 148.5,94.7 148.5,94.7 148.6,94.7 148.6,94.7
|
| 225 |
+
148.7,94.7 148.7,94.7 148.8,94.7 148.9,94.7 149,94.7 149,94.7 149.1,94.7 149.2,94.7 149.3,94.7 149.3,94.6 149.4,94.6
|
| 226 |
+
149.5,94.5 149.5,94.5 149.4,95.3 149.4,95.3 149.4,95.3 149.3,95.3 149.3,95.4 149.3,95.4 149.2,95.4 149.2,95.4 149.1,95.4
|
| 227 |
+
149.1,95.5 149,95.5 148.9,95.5 148.8,95.5 148.7,95.5 148.5,95.5 148.4,95.5 148.2,95.5 148.1,95.5 147.9,95.5 147.8,95.4
|
| 228 |
+
147.7,95.4 147.5,95.3 147.4,95.2 147.3,95.1 147.2,95 147.1,94.8 147,94.7 146.9,94.5 146.9,94.3 146.8,94.1 146.8,93.9
|
| 229 |
+
146.8,93.7 146.8,93.4 146.9,93.3 146.9,93.2 146.9,93 147,92.9 147,92.8 147,92.7 147.1,92.6 147.1,92.5 147.2,92.4 147.2,92.3
|
| 230 |
+
147.3,92.3 147.3,92.2 147.4,92.1 147.4,92 147.5,92 147.5,91.9 147.6,91.8 147.7,91.8 147.8,91.7 147.8,91.7 147.9,91.6
|
| 231 |
+
148,91.6 148.1,91.6 148.2,91.5 148.3,91.5 148.4,91.5 148.5,91.5 148.6,91.4 148.7,91.4 148.8,91.4 148.9,91.4 149,91.4
|
| 232 |
+
149.1,91.4 149.2,91.4 149.3,91.4 149.4,91.4 149.5,91.4 149.5,91.5 149.6,91.5 149.7,91.5 149.8,91.5 149.8,91.5 149.9,91.5
|
| 233 |
+
149.9,91.6 150,91.6 150,91.6 150,91.6 150,91.6 149.9,92.5 149.9,92.5 "/>
|
| 234 |
+
<path class="st12" d="M157.2,91.6l-0.2,1.2l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0
|
| 235 |
+
l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1
|
| 236 |
+
l-0.1,0.2l-0.1,0.2l0,0.2l0,0.2l0,0.2l0,0.2l0,0.2l0,0.2l0,0.1l0,0.1l0.1,0.1l0.1,0.1l0.1,0.1l0.1,0.1l0.1,0.1l0.1,0.1l0.1,0.1
|
| 237 |
+
l0.1,0l0.2,0h0.1l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1-0.1l0-0.1v0l-0.1,0.3h0.8
|
| 238 |
+
l0.7-4H157.2z M156.8,93.8L156.8,93.8l0,0.2l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l-0.1,0.1l-0.1,0.1l-0.1,0l-0.1,0
|
| 239 |
+
l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1-0.1l-0.1-0.1l-0.1-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1
|
| 240 |
+
l0-0.1l0-0.1l0.1-0.1l0.1-0.1l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0,0l0,0l0,0.1l0,0.1l0,0.1l0,0.1
|
| 241 |
+
l0,0.1l0,0.1L156.8,93.8L156.8,93.8z"/>
|
| 242 |
+
<path class="st12" d="M137.7,92.9L137.7,92.9l-0.1-0.2l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1,0l-0.1,0l-0.1,0
|
| 243 |
+
l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0h-0.1h-0.1h-0.1l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0
|
| 244 |
+
l-0.1,0l-0.2,0.7l0,0l0,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0h0.1l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0
|
| 245 |
+
l0.1,0l0,0l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0h0l0,0l0,0l-0.1,0h-0.1l-0.1,0l-0.1,0h-0.1h0l0,0l0,0l0,0l0,0l-0.1,0l-0.1,0
|
| 246 |
+
l-0.1,0l-0.1,0l0,0l0,0l0,0l0,0l0,0l0,0h0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1
|
| 247 |
+
l-0.1,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1v0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0.1,0.1l0.1,0l0.1,0l0.1,0
|
| 248 |
+
l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0,0l0,0l0,0l0,0.1l0,0.1
|
| 249 |
+
l0,0.1h0.8l0.1-0.7l0.3-1.6l0-0.1V93L137.7,92.9z M136.6,94.1L136.6,94.1l0,0.2l0,0.1l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0
|
| 250 |
+
l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l0,0l0,0l-0.1,0l0,0l0,0l0-0.1l0-0.1l0-0.1l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0
|
| 251 |
+
l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0.1,0l0,0h0h0l0,0l0,0l0,0l0,0V94.1L136.6,94.1L136.6,94.1z"/>
|
| 252 |
+
<polygon class="st12" points="131,95.5 130.2,95.5 130.8,91.5 132.3,91.5 132.4,93.9 133.4,91.5 134.9,91.5 134.2,95.5
|
| 253 |
+
133.4,95.5 133.9,92.5 133.9,92.5 132.6,95.5 131.7,95.5 131.7,95.4 131.7,95.1 131.6,94.6 131.6,94.1 131.6,93.5 131.6,93
|
| 254 |
+
131.5,92.7 131.5,92.5 131.5,92.5 131.5,92.5 131.5,92.5 131.5,92.5 131,95.5 131,95.5 "/>
|
| 255 |
+
<path class="st12" d="M152.7,92.9L152.7,92.9l-0.1-0.2l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1,0l-0.1,0l-0.1,0
|
| 256 |
+
l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0h-0.1h-0.1h-0.1l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0
|
| 257 |
+
l-0.1,0l-0.2,0.7l0,0l0,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0h0.1l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0
|
| 258 |
+
l0.1,0l0,0l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0h0l0,0l0,0l-0.1,0h-0.1l-0.1,0l-0.1,0h-0.1h0l0,0l0,0l0,0l-0.1,0l-0.1,0
|
| 259 |
+
l-0.1,0l-0.1,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0h0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1
|
| 260 |
+
l-0.1,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1v0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0.1,0.1l0.1,0l0.1,0l0.1,0
|
| 261 |
+
l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0,0l0,0l0,0v0.1l0,0.1l0,0.1
|
| 262 |
+
h0.8l0.1-0.7l0.3-1.6l0-0.1V93L152.7,92.9z M151.7,94.1L151.7,94.1l0,0.2l0,0.1l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l-0.1,0
|
| 263 |
+
l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l0,0l0,0l0-0.1l0-0.1l0-0.1l0-0.1l0,0l0,0l0,0l0,0l0,0l0,0l0,0
|
| 264 |
+
l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0h0l0,0l0,0l0,0l0,0L151.7,94.1L151.7,94.1L151.7,94.1z"/>
|
| 265 |
+
<polygon class="st12" points="152.6,95.5 153.5,95.5 153.5,95.5 153.8,93.8 153.8,93.7 153.8,93.7 153.9,93.6 153.9,93.5
|
| 266 |
+
153.9,93.5 153.9,93.4 154,93.3 154,93.3 154.1,93.2 154.1,93.2 154.2,93.1 154.3,93.1 154.4,93.1 154.5,93 154.6,93 154.7,93
|
| 267 |
+
154.7,93 154.8,93 154.8,93 154.8,93 154.9,92.2 154.8,92.2 154.8,92.3 154.7,92.3 154.6,92.3 154.5,92.3 154.5,92.3 154.4,92.4
|
| 268 |
+
154.4,92.4 154.3,92.5 154.2,92.5 154.2,92.5 154.2,92.6 154.1,92.6 154.1,92.7 154,92.8 154,92.8 154.1,92.3 153.2,92.3
|
| 269 |
+
152.6,95.5 152.6,95.5 152.6,95.5 "/>
|
| 270 |
+
<polygon class="st12" points="144.6,95.5 145.5,95.5 145.5,95.5 145.8,93.8 145.8,93.7 145.8,93.7 145.8,93.6 145.8,93.5
|
| 271 |
+
145.9,93.5 145.9,93.4 145.9,93.4 146,93.3 146,93.3 146.1,93.2 146.1,93.2 146.2,93.2 146.3,93.1 146.4,93.1 146.5,93.1
|
| 272 |
+
146.6,93.1 146.6,93.1 146.6,93.1 146.7,93.1 146.7,93.1 146.7,93.1 146.7,93.1 146.7,93.1 146.7,93.1 146.7,93.1 146.7,93
|
| 273 |
+
146.7,93 146.7,92.9 146.8,92.8 146.8,92.8 146.8,92.7 146.8,92.6 146.9,92.5 146.9,92.5 146.9,92.4 147,92.4 147,92.3 147,92.3
|
| 274 |
+
147,92.3 147,92.3 147,92.3 147,92.3 147,92.2 147,92.2 147,92.2 146.9,92.2 146.9,92.2 146.9,92.2 146.8,92.2 146.7,92.3
|
| 275 |
+
146.6,92.3 146.6,92.3 146.5,92.3 146.4,92.3 146.4,92.4 146.3,92.4 146.3,92.4 146.2,92.5 146.2,92.5 146.1,92.6 146.1,92.6
|
| 276 |
+
146,92.7 146,92.8 145.9,92.8 146.1,92.3 145.2,92.3 144.6,95.5 144.6,95.5 144.6,95.5 "/>
|
| 277 |
+
<path class="st12" d="M144.7,93.2l0-0.2l0-0.2l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1,0l-0.1,0l-0.1,0
|
| 278 |
+
l-0.1,0l-0.1,0l-0.2,0l-0.2,0l-0.2,0.1l-0.2,0.1l-0.2,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l0,0.1l0,0.1
|
| 279 |
+
l0,0.1l0,0.1l0,0.1l0,0.2l0,0.2l0,0.2l0.1,0.2l0.1,0.2l0.1,0.1l0.1,0.1l0.1,0.1l0.1,0.1l0.1,0.1l0.1,0.1l0.1,0l0.2,0l0.2,0l0.2,0
|
| 280 |
+
l0.1,0h0.1l0.1,0h0.1l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0.1-0.7l-0.1,0.1l-0.1,0l-0.1,0l-0.1,0
|
| 281 |
+
l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0h-0.1l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l0,0
|
| 282 |
+
l0,0l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0,0h0.5v0h1.4l0-0.2l0-0.3l0-0.2L144.7,93.2z M143.9,93.5h-0.7l0,0h-0.4
|
| 283 |
+
l0,0l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0,0l0,0l0,0l0,0l0,0l0,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0,0l0,0l0,0l0,0l0,0l0,0
|
| 284 |
+
l0,0l0,0l0,0.1l0,0.1l0,0.1l0,0.1L143.9,93.5L143.9,93.5z"/>
|
| 285 |
+
</g>
|
| 286 |
+
</g>
|
| 287 |
+
<g>
|
| 288 |
+
<polygon class="st13" points="168.8,89.4 170.4,89.4 169.6,87.5 "/>
|
| 289 |
+
<path class="st14" d="M187.7,87.8c-0.1-0.1-0.3-0.1-0.6-0.1h-1.4v1.1h1.4c0.2,0,0.4,0,0.6-0.1s0.2-0.3,0.2-0.5
|
| 290 |
+
C188,88,187.8,87.8,187.7,87.8z"/>
|
| 291 |
+
<path class="st15" d="M202.4,85.7v0.8l-0.4-0.8h-3.2v0.8l-0.4-0.8H194c-0.8,0-1.4,0.1-1.9,0.4v-0.4h-3.1v0.4
|
| 292 |
+
c-0.3-0.3-0.8-0.4-1.3-0.4h-11.1l-0.8,1.7l-0.8-1.7h-3.5v0.8l-0.4-0.8h-3l-1.4,3.2l-1.6,3.6h1.6h1.9l0.4-1.1h1l0.4,1.1h4v-0.8
|
| 293 |
+
l0.3,0.8h2l0.3-0.8v0.8h9.6v-1.8h0.1c0.1,0,0.1,0,0.1,0.2v1.5h5v-0.4c0.4,0.2,1,0.4,1.9,0.4h2.1l0.4-1.1h1l0.4,1.1h4v-1l0.6,1h3.2
|
| 294 |
+
v-6.8H202.4L202.4,85.7z M179.1,91.5H178v-3.8l-1.7,3.8h-1l-1.7-3.8v3.8h-2.3l-0.5-1h-2.3l-0.4,1.1h-1.3l2.1-4.9h1.7l1.9,4.6v-4.6
|
| 295 |
+
h1.9l1.5,3.3l1.4-3.3h1.9V91.5z M183.8,87.7h-2.7v0.9h2.6v1h-2.6v1h2.7v1H180v-4.9h3.9V87.7z M189,89.7c0.1,0.3,0.2,0.5,0.2,0.9v1
|
| 296 |
+
H188V91c0-0.3,0-0.7-0.2-1c-0.2-0.2-0.4-0.2-0.8-0.2h-1.2v1.8h-1.2v-4.9h2.6c0.6,0,1,0,1.4,0.2c0.3,0.2,0.6,0.6,0.6,1.1
|
| 297 |
+
c0,0.8-0.5,1.2-0.8,1.3C188.6,89.4,188.9,89.6,189,89.7z M191.1,91.5h-1.2v-4.9h1.2V91.5z M204.7,91.5H203l-2.2-3.7v3.7h-2.3
|
| 298 |
+
l-0.4-1h-2.4l-0.4,1.1h-1.3c-0.6,0-1.2-0.1-1.7-0.6c-0.4-0.4-0.6-1-0.6-1.9c0-0.7,0.1-1.4,0.6-1.9c0.3-0.4,1-0.6,1.7-0.6h1.1v1
|
| 299 |
+
H194c-0.4,0-0.6,0.1-0.9,0.3c-0.2,0.2-0.3,0.6-0.3,1.1c0,0.6,0.1,0.9,0.3,1.2c0.2,0.2,0.5,0.3,0.8,0.3h0.5l1.6-3.8h1.7l1.9,4.6
|
| 300 |
+
v-4.6h1.7l2,3.4v-3.4h1.2v4.8H204.7L204.7,91.5z"/>
|
| 301 |
+
<g>
|
| 302 |
+
<polygon class="st14" points="196,89.4 197.6,89.4 196.9,87.5 "/>
|
| 303 |
+
<polygon class="st14" points="184.3,99.4 184.3,95.4 182.5,97.4 "/>
|
| 304 |
+
</g>
|
| 305 |
+
<polygon class="st13" points="176.9,95.9 176.9,96.8 179.5,96.8 179.5,97.8 176.9,97.8 176.9,98.8 179.7,98.8 181.1,97.4
|
| 306 |
+
179.8,95.9 "/>
|
| 307 |
+
<path id="SVGCleanerId_0_3_" class="st14" d="M186.9,95.9h-1.4v1.2h1.5c0.4,0,0.7-0.2,0.7-0.6C187.6,96.1,187.3,95.9,186.9,95.9z"
|
| 308 |
+
/>
|
| 309 |
+
<path class="st15" d="M208.2,97.1V94h-0.8h-2.1c-0.6,0-1.1,0.1-1.4,0.4V94h-3.2c-0.5,0-1.1,0.1-1.4,0.4V94h-5.6v0.4
|
| 310 |
+
c-0.4-0.3-1.2-0.4-1.5-0.4h-3.7v0.4c-0.3-0.3-1.2-0.4-1.6-0.4h-4.1l-1,1l-0.9-1h-6.2v6.8h6.1l1-1l0.9,1h3.7v-1.6h0.5
|
| 311 |
+
c0.5,0,1.1,0,1.6-0.2v1.9h3.1V99h0.1c0.2,0,0.2,0,0.2,0.2v1.6h9.4c0.6,0,1.2-0.1,1.6-0.4v0.4h3c0.6,0,1.2-0.1,1.7-0.3l0,0
|
| 312 |
+
c0.7-0.4,1.1-1.2,1.1-2.1C208.6,97.9,208.5,97.4,208.2,97.1z M186.9,98.2h-1.4v1.7h-2.2l-1.4-1.6l-1.4,1.6h-4.6V95h4.6l1.4,1.6
|
| 313 |
+
l1.4-1.6h3.7c0.9,0,1.9,0.3,1.9,1.6C188.9,97.9,187.9,98.2,186.9,98.2z M193.8,97.9c0.1,0.2,0.2,0.5,0.2,0.9v1h-1.2v-0.6
|
| 314 |
+
c0-0.3,0-0.8-0.2-1c-0.1-0.2-0.4-0.2-0.8-0.2h-1.2v1.8h-1.2v-4.9h2.6c0.6,0,1,0,1.4,0.2c0.3,0.2,0.6,0.6,0.6,1.1
|
| 315 |
+
c0,0.8-0.5,1.2-0.8,1.3C193.5,97.6,193.7,97.8,193.8,97.9z M198.5,95.9h-2.7v0.9h2.6v1h-2.6v1h2.7v1h-3.9v-4.9h3.9V95.9z
|
| 316 |
+
M201.4,99.8h-2.2v-1h2.2c0.2,0,0.3,0,0.5-0.1c0.1-0.1,0.1-0.2,0.1-0.3c0-0.1-0.1-0.3-0.1-0.3c-0.1-0.1-0.2-0.1-0.4-0.1
|
| 317 |
+
c-1.1-0.1-2.4,0-2.4-1.5c0-0.7,0.4-1.4,1.7-1.4h2.3V96h-2.1c-0.2,0-0.3,0-0.5,0.1c-0.1,0.1-0.1,0.2-0.1,0.3c0,0.2,0.1,0.3,0.3,0.3
|
| 318 |
+
c0.1,0.1,0.3,0.1,0.4,0.1h0.6c0.6,0,1,0.1,1.3,0.4c0.2,0.2,0.3,0.6,0.3,1C203.2,99.3,202.6,99.8,201.4,99.8z M207.3,99.3
|
| 319 |
+
c-0.3,0.3-0.8,0.5-1.4,0.5h-2.2v-1h2.2c0.2,0,0.3,0,0.5-0.1c0.1-0.1,0.1-0.2,0.1-0.3c0-0.1-0.1-0.3-0.1-0.3
|
| 320 |
+
c-0.1-0.1-0.2-0.1-0.4-0.1c-1.1-0.1-2.4,0-2.4-1.5c0-0.7,0.4-1.4,1.7-1.4h2.3V96h-2.1c-0.2,0-0.3,0-0.5,0.1s-0.1,0.2-0.1,0.3
|
| 321 |
+
c0,0.2,0.1,0.3,0.3,0.3c0.1,0.1,0.3,0.1,0.4,0.1h0.6c0.6,0,1,0.1,1.3,0.4c0.1,0,0.1,0.1,0.1,0.1c0.2,0.3,0.3,0.6,0.3,1
|
| 322 |
+
C207.8,98.7,207.6,99,207.3,99.3z"/>
|
| 323 |
+
<path id="SVGCleanerId_1_3_" class="st14" d="M192.5,96.1c-0.1-0.1-0.3-0.1-0.6-0.1h-1.4v1.1h1.4c0.2,0,0.4,0,0.6-0.1
|
| 324 |
+
s0.2-0.3,0.2-0.5C192.8,96.3,192.7,96.1,192.5,96.1z"/>
|
| 325 |
+
<g>
|
| 326 |
+
<path class="st14" d="M187.7,87.8c-0.1-0.1-0.3-0.1-0.6-0.1h-1.4v1.1h1.4c0.2,0,0.4,0,0.6-0.1s0.2-0.3,0.2-0.5
|
| 327 |
+
C188,88,187.8,87.8,187.7,87.8z"/>
|
| 328 |
+
<polygon class="st14" points="196,89.4 197.6,89.4 196.9,87.5 "/>
|
| 329 |
+
<polygon class="st14" points="184.3,99.4 184.3,95.4 182.5,97.4 "/>
|
| 330 |
+
</g>
|
| 331 |
+
<g>
|
| 332 |
+
<path id="SVGCleanerId_0_2_" class="st14" d="M186.9,95.9h-1.4v1.2h1.5c0.4,0,0.7-0.2,0.7-0.6C187.6,96.1,187.3,95.9,186.9,95.9z
|
| 333 |
+
"/>
|
| 334 |
+
</g>
|
| 335 |
+
<g>
|
| 336 |
+
<path id="SVGCleanerId_1_2_" class="st14" d="M192.5,96.1c-0.1-0.1-0.3-0.1-0.6-0.1h-1.4v1.1h1.4c0.2,0,0.4,0,0.6-0.1
|
| 337 |
+
s0.2-0.3,0.2-0.5C192.8,96.3,192.7,96.1,192.5,96.1z"/>
|
| 338 |
+
</g>
|
| 339 |
+
<g>
|
| 340 |
+
<polygon class="st13" points="186.4,99.6 185.5,98.6 185.5,99.8 183.2,99.8 181.8,98.2 180.3,99.8 175.7,99.8 175.7,95 180.4,95
|
| 341 |
+
181.8,96.5 182.5,95.7 180.8,94 174.7,94 174.7,100.7 180.8,100.7 181.8,99.7 182.7,100.7 186.4,100.7 "/>
|
| 342 |
+
<polygon class="st13" points="179.3,92.5 178.4,91.5 178,91.5 178,91.1 176.9,90.1 176.2,91.5 175.3,91.5 173.6,87.7 173.6,91.5
|
| 343 |
+
171.3,91.5 170.8,90.5 168.4,90.5 168,91.5 166.7,91.5 168.8,86.7 170.5,86.7 172.4,91.3 172.4,86.7 173.5,86.7 172.5,85.7
|
| 344 |
+
171.5,85.7 171.5,86.5 171.1,85.7 168.1,85.7 166.7,88.9 165.1,92.5 166.7,92.5 168.7,92.5 169.1,91.4 170.1,91.4 170.6,92.5
|
| 345 |
+
174.4,92.5 174.4,91.6 174.8,92.5 176.8,92.5 177.1,91.6 177.1,92.5 "/>
|
| 346 |
+
<polygon class="st13" points="176.1,89.3 175,88.2 175.8,90 "/>
|
| 347 |
+
</g>
|
| 348 |
+
<g>
|
| 349 |
+
<path class="st14" d="M207.5,100.4c0.6-0.4,1-1.1,1.1-1.9l-1-1c0.1,0.2,0.1,0.4,0.1,0.7c0,0.4-0.1,0.8-0.4,1s-0.8,0.5-1.4,0.5
|
| 350 |
+
h-2.2v-1h2.2c0.2,0,0.3,0,0.5-0.1c0.1-0.1,0.1-0.2,0.1-0.3c0-0.1-0.1-0.3-0.1-0.3c-0.1-0.1-0.2-0.1-0.4-0.1
|
| 351 |
+
c-1.1-0.1-2.4,0-2.4-1.5c0-0.7,0.4-1.3,1.4-1.4l-0.8-0.8c-0.1,0.1-0.2,0.1-0.3,0.1v-0.4h-3.2c-0.5,0-1.1,0.1-1.4,0.4v-0.4h-5.7
|
| 352 |
+
v0.4c-0.4-0.3-1.2-0.4-1.5-0.4h-3.7v0.4c-0.3-0.3-1.2-0.4-1.6-0.4h-4.1l-1,1l-0.9-1h-0.8l2.1,2.1l1-1.1h3.7
|
| 353 |
+
c0.9,0,1.9,0.3,1.9,1.6c0,1.4-1,1.7-2,1.7h-1.4v1l1,1v-1h0.3c0.5,0,1.1,0,1.6-0.2v1.9h3.1v-1.8h0.1c0.2,0,0.2,0,0.2,0.2v1.6h9.4
|
| 354 |
+
c0.6,0,1.2-0.1,1.6-0.4v0.4h3C206.4,100.7,207,100.7,207.5,100.4L207.5,100.4z M193.8,97.9c0.1,0.2,0.2,0.5,0.2,0.9v1h-1.2v-0.6
|
| 355 |
+
c0-0.3,0-0.8-0.2-1c-0.1-0.2-0.4-0.2-0.8-0.2h-1.2v1.8h-1.2v-4.9h2.6c0.6,0,1,0,1.4,0.2c0.3,0.2,0.6,0.6,0.6,1.1
|
| 356 |
+
c0,0.8-0.5,1.2-0.8,1.3C193.5,97.6,193.7,97.8,193.8,97.9z M198.5,95.9h-2.7v0.9h2.6v1h-2.6v1h2.7v1h-3.9v-4.9h3.9V95.9z
|
| 357 |
+
M201.4,99.8h-2.2v-1h2.2c0.2,0,0.3,0,0.5-0.1c0.1-0.1,0.1-0.2,0.1-0.3c0-0.1-0.1-0.3-0.1-0.3c-0.1-0.1-0.2-0.1-0.4-0.1
|
| 358 |
+
c-1.1-0.1-2.4,0-2.4-1.5c0-0.7,0.4-1.4,1.7-1.4h2.3V96h-2.1c-0.2,0-0.3,0-0.5,0.1c-0.1,0.1-0.1,0.2-0.1,0.3
|
| 359 |
+
c0,0.2,0.1,0.3,0.3,0.3c0.1,0.1,0.3,0.1,0.4,0.1h0.6c0.6,0,1,0.1,1.3,0.4c0.2,0.2,0.3,0.6,0.3,1
|
| 360 |
+
C203.2,99.3,202.6,99.8,201.4,99.8z"/>
|
| 361 |
+
<path class="st14" d="M204.7,96.4c0,0.2,0.1,0.3,0.3,0.3c0.1,0.1,0.3,0.1,0.4,0.1h0.6c0.4,0,0.7,0.1,1,0.2l-1-1h-0.6
|
| 362 |
+
c-0.2,0-0.3,0-0.5,0.1C204.8,96.1,204.7,96.3,204.7,96.4z"/>
|
| 363 |
+
<polygon class="st14" points="202.3,92.3 202.4,92.5 202.5,92.5 "/>
|
| 364 |
+
<polygon class="st14" points="198.5,88.5 199.7,91.3 199.7,89.6 "/>
|
| 365 |
+
<path class="st14" d="M186.7,90.7h0.1c0.1,0,0.1,0,0.1,0.2v1.5h5v-0.4c0.4,0.2,1,0.4,1.9,0.4h2.1l0.4-1.1h1l0.4,1.1h4v-0.7l-1-1
|
| 366 |
+
v0.8h-2.3l-0.3-1.1h-2.4l-0.4,1.1h-1.3c-0.6,0-1.2-0.1-1.7-0.6c-0.4-0.4-0.6-1-0.6-1.9c0-0.7,0.1-1.4,0.6-1.9
|
| 367 |
+
c0.3-0.4,1-0.6,1.7-0.6h1.1v1H194c-0.4,0-0.6,0.1-0.9,0.3c-0.2,0.2-0.3,0.6-0.3,1.1c0,0.6,0.1,0.9,0.3,1.2
|
| 368 |
+
c0.2,0.2,0.5,0.3,0.8,0.3h0.5l1.6-3.8h0.7l-1-1h-1.8c-0.8,0-1.4,0.1-1.9,0.4v-0.4h-3v0.4c-0.3-0.3-0.8-0.4-1.3-0.4h-11.1
|
| 369 |
+
l-0.8,1.7l-0.8-1.7h-3l1,1h1.4l1.2,2.6l0.4,0.4l1.2-3h1.9v4.9h-1.2v-3.8l-1.2,2.8l2,2h7.9L186.7,90.7z M189.9,86.7h1.2v4.9h-1.2
|
| 370 |
+
V86.7z M183.8,87.7h-2.7v0.9h2.6v1h-2.6v1h2.7v1H180v-4.9h3.9V87.7z M185.8,91.5h-1.2v-4.9h2.6c0.6,0,1,0,1.4,0.2
|
| 371 |
+
c0.3,0.2,0.6,0.6,0.6,1.1c0,0.8-0.5,1.2-0.8,1.3c0.3,0.1,0.5,0.3,0.6,0.4c0.1,0.3,0.2,0.5,0.2,0.9v1h-1.2v-0.6c0-0.3,0-0.7-0.2-1
|
| 372 |
+
c-0.1-0.1-0.3-0.1-0.7-0.1h-1.2V91.5L185.8,91.5z"/>
|
| 373 |
+
</g>
|
| 374 |
+
</g>
|
| 375 |
+
<g>
|
| 376 |
+
<path class="st16" d="M217.5,85c-1.8,0-3.1,1.1-3.1,3.1v5.7c0.1,0.7,0.9,1.2,1.7,1.2c0.9,0,1.6-0.7,1.6-1.5v-2.9h2.5v2.9
|
| 377 |
+
c0,1.6-2,2.4-3.5,2.4c-0.9,0-1.7-0.3-2.3-0.7v6.3h4c1.4,0,3-1.3,3-3V85L217.5,85L217.5,85z"/>
|
| 378 |
+
<path class="st17" d="M231.5,95h1.7c0.4,0,0.9-0.4,0.9-0.9s-0.4-0.9-0.9-0.9h-1.7V95z"/>
|
| 379 |
+
<path class="st17" d="M233.5,85c-1.8,0-3.1,1.1-3.1,3.1v2.6h4.7c0.7,0,1.2,0.6,1.2,1.2s-0.6,1.2-1.2,1.2c0.7,0,1.3,0.5,1.3,1.2
|
| 380 |
+
s-0.6,1.2-1.3,1.2h-4.7v6h4c1.4,0,3-1.3,3-3V85L233.5,85L233.5,85z"/>
|
| 381 |
+
<g>
|
| 382 |
+
<path class="st17" d="M234.1,92.1c0-0.4-0.4-0.9-0.9-0.9h-1.7v1.7h1.7C233.7,92.9,234.1,92.5,234.1,92.1z"/>
|
| 383 |
+
</g>
|
| 384 |
+
<path class="st18" d="M225.4,85c-1.8,0-3.1,1.1-3.1,3.1v3.2c0.4-0.4,1-0.6,1.6-0.6h4.2v0.9c-1-0.2-2-0.3-2.4-0.3
|
| 385 |
+
c-1,0-1.9,0.9-1.9,1.9s0.9,1.9,1.9,1.9c0.5,0,1.4-0.1,2.4-0.3v0.8h-4.2c-0.6,0-1.2-0.2-1.6-0.6v6.7h4c1.4,0,3-1.3,3-3V85L225.4,85
|
| 386 |
+
L225.4,85z"/>
|
| 387 |
+
</g>
|
| 388 |
+
<g>
|
| 389 |
+
<g>
|
| 390 |
+
<g>
|
| 391 |
+
<path class="st19" d="M97.6,86.4L95.4,100h3.5l2.2-13.7H97.6z M108.2,91.9c-1.2-0.6-2-1-2-1.6c0-0.6,0.6-1.1,2-1.1
|
| 392 |
+
c1.1,0,2,0.2,2.6,0.5l0.3,0.1l0.5-2.9c-0.7-0.3-1.8-0.6-3.1-0.6c-3.5,0-5.9,1.8-5.9,4.4c0,1.9,1.7,3,3.1,3.6
|
| 393 |
+
c1.4,0.6,1.8,1.1,1.8,1.6c0,0.9-1.1,1.3-2.1,1.3c-1.4,0-2.2-0.2-3.3-0.7l-0.5-0.2l-0.5,3c0.8,0.4,2.3,0.7,3.9,0.7
|
| 394 |
+
c3.7,0,6.1-1.8,6.1-4.5C111.2,94,110.2,92.9,108.2,91.9z M120.6,86.4h-2.7c-0.8,0-1.5,0.2-1.8,1.1l-5.2,12.5h3.7l1-2.7h4.1
|
| 395 |
+
l0.5,2.7h3.2L120.6,86.4z M116.6,94.6c0.1,0,1.4-4.4,1.4-4.4l1.1,4.4C119.1,94.6,117.3,94.6,116.6,94.6z M92.5,86.4l-3.4,9.3
|
| 396 |
+
l-0.4-1.8c-0.6-2.1-2.6-4.4-4.8-5.5L87,100h3.7l5.5-13.6L92.5,86.4L92.5,86.4z"/>
|
| 397 |
+
</g>
|
| 398 |
+
</g>
|
| 399 |
+
<path class="st20" d="M87.5,88.1c-0.3-1-1.1-1.7-2.3-1.8h-5.4l-0.1,0.3c4.2,1,7.8,4.3,9,7.3L87.5,88.1z"/>
|
| 400 |
+
</g>
|
| 401 |
+
</g>
|
| 402 |
+
</svg>
|
freemius-pricing/c03f665db27af43971565560adfba594.png
ADDED
|
Binary file
|
freemius-pricing/cb5fc4f6ec7ada72e986f6e7dde365bf.png
ADDED
|
Binary file
|
freemius-pricing/dd89563360f0272635c8f0ab7d7f1402.png
ADDED
|
Binary file
|
freemius-pricing/e366d70661d8ad2493bd6afbd779f125.png
ADDED
|
Binary file
|
freemius-pricing/f3aac72a8e63997d6bb888f816457e9b.png
ADDED
|
Binary file
|
freemius-pricing/f928f1be99776af83e8e6be4baf8ffe7.svg
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
| 2 |
+
<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
| 3 |
+
<svg version="1.1" id="Слой_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
| 4 |
+
viewBox="0 0 1000 1000" style="enable-background:new 0 0 1000 1000;" xml:space="preserve">
|
| 5 |
+
<style type="text/css">
|
| 6 |
+
.st0{opacity:0.25;}
|
| 7 |
+
.st1{fill:#1FBC99;}
|
| 8 |
+
</style>
|
| 9 |
+
<g class="st0">
|
| 10 |
+
<g>
|
| 11 |
+
<path class="st1" d="M934.5,517.1c5.6-1.8,11.9,0.4,15.2,5.4c0.4-7.9,0.6-15.9,0.6-23.9l-20.8,6c-0.1,5.7-0.2,11.4-0.5,17.1
|
| 12 |
+
C930.2,519.6,931.8,518,934.5,517.1z"/>
|
| 13 |
+
<polygon class="st1" points="912.1,649.8 914,648.9 912,649.7 "/>
|
| 14 |
+
<path class="st1" d="M367.4,908.8c9.3,4.4,17.9-0.1,26.7-1c3.8-0.4,7.5-0.8,11.3-1.2c2.9-0.3,5.8-0.5,8.7-0.8
|
| 15 |
+
c-44.2-10.7-86.3-28.6-124.5-52.6l-1.6,4.5c0,0-0.1,0-0.1,0c-1-0.4-1.8-1-2.5-1.9l2.2-1.9l1.3-1.1c-50.6-32-94.5-75-127.8-126.7
|
| 16 |
+
l-20.8,6C193,816.6,272.6,879.4,364,912.4C365.1,911.2,366.2,910,367.4,908.8z"/>
|
| 17 |
+
<path class="st1" d="M754.9,859.2c-0.4-2,0.1-4.3,0.4-8.3c3.6,2.4,6.1,3.3,7.3,5c0.8,1,1.1,2.1,1,3.1
|
| 18 |
+
c39.3-27.6,73.4-61.1,101.3-99.1c-3.3-0.3-6.6-2.1-7.6-4.7c-1.4-3.5,1.1-9.2,4.7-10.6c0,0,0,0,0,0c-0.4-1.2,0-2.4,1.2-3.1
|
| 19 |
+
c1.3-0.8,3-0.4,3.7,0.8c0.4,0.6,0.4,1.5,0.1,2.3c2.2,0.7,4.3,2.3,5.2,4.4c0.1,0.1,0.1,0.2,0.2,0.4
|
| 20 |
+
c37.1-53.7,62.1-115.5,72.5-180.6c-0.7-0.3-1.3-0.5-1.7-1c-0.8-0.9-0.4-2,0.6-2.6c0.5-0.3,1.1-0.3,1.6-0.2
|
| 21 |
+
c0.4-2.7,0.8-5.4,1.1-8.1c-0.5,0.7-1.3,1.2-2.1,1.6c-2.4,1.1-7.2-0.8-8.5-3.5c-1.3-2.6,0.3-6.2,3.3-7.5c3.1-1.3,6.3-0.3,7.8,2.6
|
| 22 |
+
c0.1,0.2,0.2,0.3,0.2,0.5c0.5-4.6,1-9.2,1.4-13.8c-0.6,0.5-1.5,0.8-2.6,0.8c-3.3,2.7-7.3,1.9-10.8,2.4c-0.8,0.1-1.8-0.4-2.6-0.8
|
| 23 |
+
c-1.7-0.9-3.4-2.9-4.6-5.1c-8.1,99-51.5,191.8-121,261.3c0,0,0,0,0,0.1l-0.1,0c-48.3,48.3-109.2,85.5-179.5,105.8
|
| 24 |
+
c-68.4,19.7-137.7,21.1-202.7,7.2c-2.5,2.3-5.7,2.7-9,2.1c-4.9-0.9-9.2,0.1-13.4,2c-5.8,2.5-7.8,4.9-7.2,10
|
| 25 |
+
c75.4,20.9,157.4,21.9,238.1-1.3c45.6-13.1,87.5-33.1,124.7-58.3C756.5,862.3,755.3,861,754.9,859.2z M939.8,590.7
|
| 26 |
+
c-1.6-0.3-2.5-0.5-3.6-0.8C938,588.5,938,588.5,939.8,590.7z M929.9,614.7c0.4,0.1,0.9,0.1,1.2,0.3c0.2,0.2,0.1,0.7,0.1,1.4
|
| 27 |
+
c-0.7-0.3-1.3-0.3-1.4-0.6C929.7,615.5,929.9,615.1,929.9,614.7z M909.1,644.6l0.3-0.2l0.4-0.1c2.5-0.6,4.8,0.2,6.2,2.2
|
| 28 |
+
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0.1c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0v0c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0
|
| 29 |
+
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0.1v0
|
| 30 |
+
c0,0.1,0.1,0.1,0.1,0.2c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0.1,0,0.1l0.1,0.2l-2.8,1.2l0.1,0l-2,0.9l0,0
|
| 31 |
+
c-0.2,0.1-0.3,0.3-0.4,0.3l-0.1-0.1l-0.1,0c0,0,0.1,0,0.1,0.1c0,0-0.1,0-0.2,0l0,0l-0.1-0.4l-4.1-3.5
|
| 32 |
+
C907.7,645.6,908.3,645,909.1,644.6z M791.2,818.1c0.8-0.6,2.7-0.1,3.8,0.5c0.5,0.3,0.7,2.7,0.1,3.1c-0.9,0.7-2.4,0.5-4.5,0.9
|
| 33 |
+
C790.8,820.5,790.5,818.6,791.2,818.1z"/>
|
| 34 |
+
</g>
|
| 35 |
+
<g>
|
| 36 |
+
<path class="st1" d="M450.7,717.7c-0.4,0.1-0.7,0.7-1,1.1c0.6,0.4,1.2,0.7,1.9,1.1c0.2-0.5,0.4-1,0.6-1.4
|
| 37 |
+
C451.6,718.2,451,717.7,450.7,717.7z"/>
|
| 38 |
+
<path class="st1" d="M515.3,737.8L490.2,726l-1.7-27.7l-19,20.2l-5.9-1.5c3.3,8,1,16.8-5.1,19c-1,0.4-2,0.6-3.1,0.7l-13.2,20.7
|
| 39 |
+
c0.1,0.3,0.1,0.7,0.1,1c0,0,0,0,0,0c0,0,0,0.1,0,0.1l0,0l-0.7-0.1l-0.5,0.8l27.3-5.2l17.6,21.4l3.5-27.5L515.3,737.8z"/>
|
| 40 |
+
</g>
|
| 41 |
+
<g>
|
| 42 |
+
<polygon class="st1" points="570.2,694.7 570.2,694.7 568.1,695.7 "/>
|
| 43 |
+
<path class="st1" d="M612.1,728.8l4.5-1.1c0,0,0,0,0,0c0,0,0,0.1,0,0.1c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0.1,0,0.1l16.8-6.6
|
| 44 |
+
l-34.5-16.2l-1.3-20.9c-0.6-0.2-1.2-0.4-1.6-0.7c-2.3-1.6-2.4-4-0.5-5.7c0.5-0.5,1.1-0.7,1.6-0.8l-0.6-9.9l-26,27.6
|
| 45 |
+
c0.1,0.1,0.1,0.3,0.1,0.4c0,0,0,0.1,0,0.1c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0.1,0,0.1v0c0.2,0.8,0.1,1.7-0.2,2.5
|
| 46 |
+
l-3.8-1.6l-0.6,0.2l-1,0.5l0.7-0.3l-0.7,0.3l0.7-0.3l0,0l0,0l0.3-0.1l0,0l0.5-0.2l0,0l0,0l1.2-0.5l2.1-0.9l-36.3-9.4l18.3,33.4
|
| 47 |
+
l-20.5,32.1l37.4-7.1l24.2,29.4l4.8-37.8l14.4-5.7L612.1,728.8z M588.4,715.2l-4.6-3.8c0,0,0,0.1-0.1,0.1
|
| 48 |
+
c-0.1,0.1-0.1,0.3-0.1,0.3c0,0,0-0.2-0.1-0.5l5.7-1.3l0,0h0c0.1,0.3,0.1,0.7,0.2,1C589.7,713.1,589.1,714.4,588.4,715.2z
|
| 49 |
+
M593.2,730.4c-0.2,0.1-1.4-0.4-1.5-0.7c-0.2-0.7,0.1-1.5,0.2-2.7c1.2,0.7,1.9,1.1,2.6,1.6C594.1,729.2,593.8,729.9,593.2,730.4z"
|
| 50 |
+
/>
|
| 51 |
+
</g>
|
| 52 |
+
<path class="st1" d="M691.1,639.9l-19,20.2l-26.8-7l13.4,24.3l-14.9,23.4l27.3-5.2l0.4,0.5c0.2-1.6,0.7-3.5,1-6
|
| 53 |
+
c3.9,1.8,6.8,2.2,8.4,3.9c2.2,2.3,0.8,6.4-2.1,7.6c-0.8,0.3-1.5,0.5-2.2,0.5l12.3,14.9l3.5-27.5l25.8-10.1l-25.1-11.8L691.1,639.9z
|
| 54 |
+
M685.1,654.4l0.4,0.5l-0.2-0.2l0.2,0.2L685.1,654.4l-0.1,0l0.5,0.5c0,0-0.1,0.1-0.1,0.1c0,0,0,0,0,0l-0.6-0.5l-0.3,0.1l-0.2-0.5
|
| 55 |
+
l-3.4-2.9c0.2-0.2,0.4-0.4,0.6-0.6c0,0,0.1-0.1,0.1-0.1l0.6-0.6l0.5-0.2c2.8-1,5.3,0.1,6.5,2.6c0,0,0,0,0,0c0,0,0,0,0,0
|
| 56 |
+
c0.1,0.1,0.1,0.3,0.2,0.5L685.1,654.4z"/>
|
| 57 |
+
<path class="st1" d="M75.3,605.9l6.9,23.9l18-5.2l9.6,33.4c-4.2,2.4-8.5,4.3-12.9,5.5c-8.3,2.4-15.9-0.1-22.7-7.6
|
| 58 |
+
c-6.8-7.4-12.6-19.3-17.3-35.7c-4.6-15.9-5.2-29.3-1.8-40.2c3.4-10.9,10.2-17.9,20.5-20.8c7.2-2.1,15.6-1.9,25.2,0.5l2.2-24.6
|
| 59 |
+
c-12.3-2.9-24.2-2.7-35.8,0.6C48.3,541.2,35.6,552,29,568.3c-6.6,16.2-6.6,36,0.1,59.4c7,24.2,16.9,41.5,29.7,51.7
|
| 60 |
+
c12.8,10.2,27.7,12.9,44.6,8.1c14.2-4.1,26.8-10.6,37.9-19.7l-21.5-74.7L75.3,605.9z M51.9,563.3c-3.6-2.2-6.2-3.1-7.6-4.9
|
| 61 |
+
c-0.8-1,0.1-4.4,1.2-5.1c2.7-1.6,5.6-0.2,6.8,2.6C53,557.4,52.2,559.5,51.9,563.3z M108.3,669.5c-0.1-0.4-0.2-0.8-0.3-1.2
|
| 62 |
+
c0-0.1,0.5-0.3,0.6-0.2c0.3,0.3,0.6,0.6,0.8,1C109,669.2,108.7,669.3,108.3,669.5z"/>
|
| 63 |
+
<path class="st1" d="M213.9,495.8l-26.9,7.7l27.8,96.4c2.5,8.7,2.9,15.9,1.1,21.5c-1.8,5.6-5.5,9.2-11.2,10.9
|
| 64 |
+
c-8.4,2.4-15.2-0.3-20.4-8.3c-3.6,2.8-7.5,4.6-12.5,5c-5.3,0.4-7.5-2-5.7-6.8c1-2.6,3-5.7,5.4-6.6c2.6-1,5.4-1.3,8.2-1.2
|
| 65 |
+
c-0.5-1.4-1-3-1.5-4.6l-19.2-66.6c-1.8-0.4-3-0.4-3.9-1c-0.4-0.3-0.2-2.4,0.2-2.5c0.8-0.2,1.8-0.2,2.7,0l-7.4-25.7l-26.9,7.7
|
| 66 |
+
l15.3,53.3c1.2,0.6,2.1,1.2,2.7,2c1.8,2.1,1.6,4.6-0.4,6.1l9.3,32.4c5.1,17.7,12.7,30,22.9,36.9c10.2,6.9,22.5,8.2,37,4.1
|
| 67 |
+
c14.8-4.3,24.8-12.1,30-23.5c5.2-11.4,5.3-25.7,0.3-43.1L213.9,495.8z M208.1,543.9l-2.7,1c-0.4-1.1-0.7-1.4-0.7-1.4l2.6-5.3
|
| 68 |
+
c2.1,1.1,3,3.2,3.6,4.7L208.1,543.9z"/>
|
| 69 |
+
<path class="st1" d="M331.9,579.7l18.9,34.3l27.2-7.8l-78.2-135.7L263,481l3.2,83.2c0,0,0.1-0.1,0.1-0.1c2.6-2.9,8.6-2.7,11.9,0.3
|
| 70 |
+
c3.1,2.9,3.5,9.1,0.7,11.7c-2.8,2.6-7.9,2.1-11.2-1.1c-0.4-0.4-0.8-0.8-1.1-1.3l2.5,63.8l27.1-7.8l-2.2-39.1L331.9,579.7z
|
| 71 |
+
M343.3,593.3l0.2-0.1c0.7-0.1,1.5,0,2.2,0.3c0,0,0,0,0,0l0.4,0.2l0.2,0.2l-2,3.4l0.7,1.8l-0.5-1l0.1,0.3l0.2,0.8l-0.5-1.5l0-0.1
|
| 72 |
+
l0-0.1l0,0.1l0,0l-0.2,0.4l-0.6,1.1l0.8-1.6l0,0l-1.8-3.8L343.3,593.3z M320.6,529.5c0.9-0.1,1.8-0.2,2.8-0.3
|
| 73 |
+
c2.6-0.1,4.7,0.9,5.7,3.3c0.7,1.7,1.8,2.9,3.2,4.1c0.9,0.8,1.7,2,2.1,3.2c1.2,3.3-0.4,6.8-3.4,7.7c-4,1.3-7.9-0.3-9.3-3.9
|
| 74 |
+
c-0.5-1.2-0.9-2.4-1.4-3.8c-3.3,0.5-3.3,0.4-3.7-2.2c-0.1-1-0.3-2-0.3-3.1C316.2,531.6,317.7,529.9,320.6,529.5z M283.6,623.2
|
| 75 |
+
l-2,1.4l0,0l-0.4,0.3l0.4-0.3l-1.1-2.1c0,0,0,0,0,0v0c0,0,0,0,0,0l-1.4-2.7c2.4-1.3,5.3-0.5,6.8,1.7L283.6,623.2z M289.2,515
|
| 76 |
+
c-0.7-7.3-1.4-13.9-2.1-19.8c0.9,2.1,2.6,5.6,5.1,10.7c0.4,0.1,0.8,0.3,1.1,0.5c0.4,0.2,0.6,1.6,0.4,2.5c0.3,0.7,0.7,1.4,1.1,2.1
|
| 77 |
+
c4,7.8,6.5,12.7,7.6,14.6l5.8,10.4c0.2,0,0.5,0.1,0.7,0.1c-0.1,0.3-0.1,0.6-0.2,0.8l11.2,20.2l-22.3,6.4l1,0.3l0,0.2
|
| 78 |
+
c-0.2,0.6-0.4,1.2-0.7,1.6c-0.1,0.2-0.2,0.3-0.2,0.5l0,0l-3.6-1.5l-1.6,0.5c0-0.4,0-0.7-0.1-1.1l-0.2-0.1c0-0.1,0.1-0.3,0.2-0.4
|
| 79 |
+
C290.9,538.3,289.8,522.1,289.2,515z M296.6,579.1c2,4.2,0.5,6.5-3.7,9C291.6,583,292.7,580.6,296.6,579.1z"/>
|
| 80 |
+
<path class="st1" d="M461.4,557L461.4,557c0-0.1,0-0.1-0.1-0.2c-0.1-0.2-0.1-0.3-0.2-0.3c0,0,0-0.1,0-0.1l1.5-1.4l-28.4-34.2
|
| 81 |
+
c10.3-10.9,12.8-25.5,7.5-43.9c-4.2-14.6-10.9-24.4-20.1-29.5c-9.2-5-21.3-5.4-36.3-1.1l-35.4,10.2l7.1,24.5h0
|
| 82 |
+
c0.1-0.1,0.2-0.2,0.3-0.2c0.1-0.1,0.2-0.2,0.4-0.2c1.5-0.7,3.6-0.1,4.2,1.2c0.6,1.3,0.1,3.1-1.2,3.8c-0.2,0.1-0.4,0.2-0.6,0.2
|
| 83 |
+
c0,0-0.1,0-0.1,0c-0.2,0-0.3,0.1-0.5,0.1c0,0,0,0,0,0c-0.4,0-0.8-0.1-1.2-0.2l5.9,20.4l2.2-0.7c0.1,0.3,0.2,0.6,0.2,0.9
|
| 84 |
+
c0,0.1,0,0.2,0,0.3c0,0.2,0.1,0.4,0.1,0.6c0,0.1,0,0.3,0,0.4c0,0.1,0,0.3,0,0.4c0,0.1,0,0.3,0,0.4c0,0.1,0,0.2-0.1,0.3
|
| 85 |
+
c0,0.2-0.1,0.3-0.1,0.5c0,0.1,0,0.1-0.1,0.2c-0.2,0.6-0.5,1.2-0.9,1.7c0,0,0,0,0,0l7.9,27.4c0,0,0,0,0,0c0.2,0,0.5,0.1,0.8,0.1
|
| 86 |
+
c0,0.1-0.1,0.3-0.1,0.4c0,0,0,0.1,0,0.1c0,0,0,0,0,0.1c-0.1,0.4-0.2,0.6-0.3,0.8l17.9,62.2l27.1-7.8l-16.3-56.6l9.7-2.8l39.3,50
|
| 87 |
+
l29-8.3l-16.9-20.3L461.4,557z M367.6,465.7c-0.1-0.2-0.1-0.3-0.2-0.5c1.1-0.5,2.2-1,3.3-1.5c0.1,0.3,0.2,0.6,0.4,0.9
|
| 88 |
+
C369.9,465,368.8,465.4,367.6,465.7z M388,556.7c-0.2,0.1-0.6-0.2-0.8-0.3c0.1-0.3,0.2-0.7,0.4-0.8c0.2-0.1,0.6,0.1,1,0.3
|
| 89 |
+
C388.3,556.3,388.2,556.7,388,556.7z M397,585l0,0.4c0,0.2,0,0.3,0,0.5l0,5l-4.7-2.7l-1.1-0.9l0-1.5c0-0.3,0-0.7,0.1-1l0-0.3
|
| 90 |
+
c0,0,0,0,0-0.1c0,0,0-0.1,0-0.1c0,0,0,0,0,0v0l3.8-0.3l0.5,0l1.5-0.1c0,0.3,0,0.6,0,0.9C397,584.8,397,584.9,397,585z M415.1,503
|
| 91 |
+
c-1.7,4.4-5.8,7.5-12.2,9.4l-7,2l-11-38.1l-2,0.7l0.3,0.5l-0.6,0.3l-0.2-0.6l-0.3,0.1l-0.7-2.9l-1.1-2.1l0.5-0.3l0.5-0.1
|
| 92 |
+
c0.3,0,0.6-0.1,0.8,0c0.1,0,0.2,0,0.3,0c0.1,0,0.3,0,0.4,0c0.3,0,0.7,0.1,1,0.2c0,0,0,0,0,0l6.6-1.9c6.2-1.8,11.2-1.5,15,0.8
|
| 93 |
+
c3.9,2.3,6.9,7.2,9,14.6C416.6,492.8,416.8,498.6,415.1,503z M433.2,476.7c-0.5,0.3-1.5-0.3-2.3-0.6c0.2-0.7,0.5-1.5,0.8-2.6
|
| 94 |
+
c1,0.5,2.2,0.8,2.2,1.1C434,475.3,433.7,476.5,433.2,476.7z M460.6,577.8l0.2,0.8l-0.1-0.4l0.1,0.4l-0.2-0.7l0,0L460.6,577.8
|
| 95 |
+
L460.6,577.8L460.6,577.8l0.1,0.8L460.6,577.8l0.1,0.8l-0.2-1.1l-0.5-1.8l-0.8-2.9l0.9,2.9l-0.8-2.9c0.1,0,0.2-0.1,0.3-0.1
|
| 96 |
+
c0.1,0,0.2-0.1,0.4-0.1l0.4,3l-0.3-3c1.3-0.1,2.6,0.3,3.6,1.3l-3.1,3.6L460.6,577.8z"/>
|
| 97 |
+
<path class="st1" d="M506.8,529.2l37.9-10.9l18.9,34.3l27.2-7.8l-56.1-97.3l-1.6,0.3l0-0.1c-0.1-0.7-0.1-1.3-0.1-1.8
|
| 98 |
+
c0-0.2,0-0.3,0-0.5l-0.1-1l-20.4-35.4l-36.7,10.6l0.8,20c0.3,0,0.5,0.1,0.9,0.2c-0.3,0.7-0.4,1.3-0.6,1.4c-0.1,0-0.1,0-0.2,0
|
| 99 |
+
l1.1,27.9l2,0.4c-0.2,1.4-0.9,2.6-1.8,3.5l4,103.3l27.1-7.8L506.8,529.2z M526.4,522.7c-0.2,0-0.5,0-0.6-0.1c-0.1-0.1,0-0.4,0-0.6
|
| 100 |
+
c0.2,0,0.5,0,0.6,0.1C526.5,522.2,526.4,522.5,526.4,522.7z M541.7,492c-0.2-0.3-0.4-0.7-0.6-1c0.1,0,0.2-0.1,0.2-0.1
|
| 101 |
+
c0.3,0.3,0.5,0.6,0.8,0.9C541.9,491.8,541.8,491.9,541.7,492z M549.5,490.8c1.4-0.7,3.8,0.1,4.6,1.5c0.7,1.3,0,3.4-1.4,4.1
|
| 102 |
+
c-1.4,0.7-3.6,0.1-4.4-1.1C547.5,494,548.2,491.5,549.5,490.8z M539.3,479.9c0.1-0.1,0.1-0.2,0.2-0.4c0,0,0-0.1,0.1-0.1
|
| 103 |
+
c0.1-0.1,0.2-0.3,0.2-0.4c0,0,0,0,0,0l5.4,2.5c0,0,0,0,0,0l0,0c-0.1,0.2-0.2,0.4-0.3,0.6c-0.1,0.1-0.1,0.2-0.2,0.3l-0.2,0.3
|
| 104 |
+
l-2.6-1.4L539.3,479.9L539.3,479.9z M524.3,439.5c0.6-0.4,1.8-0.2,2.7,0c0.3,0.1,0.6,1.6,0.3,1.9c-0.5,0.6-1.5,0.7-3.1,1.4
|
| 105 |
+
C524.2,441.1,523.9,439.8,524.3,439.5z M517.7,458.9c1.8-3.1,4.7-4.4,8.3-4.3c3.3,0.1,5.3,2.4,6.9,4.8c1.3,1.9,0.4,3.9,0.1,6.1
|
| 106 |
+
c-2.2,0-3.8,0.3-5.3,2.2c-1.8,2.2-6.2,1.8-8.3,0C517.2,465.8,516.3,461.3,517.7,458.9z M484.4,473.7c-0.2-0.1-0.4-0.3-0.5-0.4
|
| 107 |
+
c-0.1-0.1,0.1-0.3,0.2-0.5c0.3,0.2,0.5,0.4,0.8,0.6C484.7,473.6,484.5,473.8,484.4,473.7z M492.7,472c-1.5,0.9-4,0.3-4.5-1.2
|
| 108 |
+
c-0.3-0.8,0.3-1.7,0.3-2.2c2.1-1.1,4.5-0.6,5.1,0.8C494.2,470.7,493.7,471.5,492.7,472z M505.3,503.7c-1.5-26.1-2.6-42.8-3.2-50
|
| 109 |
+
c-0.7-7.3-1.4-13.9-2.1-19.8c1.1,2.7,3.7,7.9,7.7,15.7c4,7.8,6.5,12.7,7.6,14.6l5.5,9.9c1-0.1,2,0.3,2.3,1.1
|
| 110 |
+
c0.2,0.5-0.2,1.1-0.3,1.5c-0.1,0.1-0.3,0.2-0.5,0.2l10.5,18.9l-21.2,6.1c0.7,0.2,1.3,0.4,1.9,0.8c0,0,0,0,0,0l0,0
|
| 111 |
+
c1.1,0.7,1.8,1.8,2.1,3.2c0,0,0,0,0,0c0,0,0,0,0,0c0,0.1,0,0.2,0.1,0.3c0,0.3,0.1,0.5,0.1,0.8l-2.9,0.1l-1,0
|
| 112 |
+
c-0.1,0.1-0.1,0.2-0.2,0.3c-0.1,0.1-0.3,0.3-0.4,0.4l-1.1-0.6l-0.2,0l0,0l-0.1,0l0,0l0.1,0v-0.1l-3.9-2.3c0,0,0,0,0-0.1
|
| 113 |
+
c0,0,0,0,0,0c0,0,0,0,0,0c0.1-0.2,0.3-0.4,0.4-0.6c0,0,0,0,0,0l0,0c0.2-0.3,0.5-0.6,0.7-0.8c0.1-0.1,0.1-0.1,0.2-0.2L505.3,503.7z"
|
| 114 |
+
/>
|
| 115 |
+
<path class="st1" d="M671.8,476.8l-1.1,0.3l-74.7-91.5l-33.3,9.6l41.9,145.6l14.4-4.1c0.4-3.8,3.2-5.3,8.3-6.2
|
| 116 |
+
c-0.2,1.6-0.5,3-1,4.1l3.4-1L606.9,454c-2.7-9.2-6-17.6-9.9-25.2l1.3-0.4l75.4,92.5l11.4-3.3l-0.5-1.5c0.1,0,0.1,0,0.2-0.1
|
| 117 |
+
c0.2-0.1,0.2-0.5,0.1-0.8c-0.1-0.1-0.1-0.2-0.2-0.2c0,0,0,0,0,0l2.9-5.1c1.1,0.7,2,1.7,2.6,3.1l0.1,0.3l0.1,0.3
|
| 118 |
+
c0.2,0.8,0.3,1.6,0.2,2.3l16-4.6l-11.6-40.2c-0.6,1.1-1.6,1.9-2.9,2.3h0c0,0-0.1,0-0.2,0c-0.1,0-0.2,0-0.3,0.1l-1-4.9l-0.2-1l0,0
|
| 119 |
+
c-0.2,0-0.3,0.1-0.4,0.2c0,0,0,0-0.1,0c-0.1,0.1-0.1,0.1-0.1,0.2c0,0,0-0.1,0-0.2l0.2-13.4l-25.6-88.7l-24.9,7.2l22.9,79.5
|
| 120 |
+
C665.6,462.1,668.6,470.2,671.8,476.8z M593.5,469.2c-0.2-0.1-0.5-0.1-0.6-0.2c-0.1-0.1,0-0.4,0-0.6c0.2,0,0.4,0,0.6-0.1
|
| 121 |
+
C593.5,468.6,593.5,468.9,593.5,469.2z M600.9,412.4l-0.8-2.9l-0.8-2.9l0.8,2.9l0.8,2.9L600.9,412.4z M604.6,409.2L604.6,409.2
|
| 122 |
+
C604.6,409.2,604.6,409.2,604.6,409.2c-0.7,1.6-1.9,2.7-3.6,3.2l-0.9-2.9l-0.8-2.9c0,0,0-0.2,0-0.5c-0.2-0.9-0.6-1.2-0.9-1.4
|
| 123 |
+
c-0.1,0-0.2-0.1-0.2-0.1l1.7-5.7c0,0,0,0,0.1,0c2.6,0.9,4.5,3.1,5.2,6.2l0.1,0.5C605.3,406.9,605.1,408.1,604.6,409.2z M624,439.8
|
| 124 |
+
c-2.9,1.3-7-0.3-8.6-3.3c-1.3-2.5,0.2-7,2.9-8.2c3.1-1.4,8.3,0.8,9.9,4.2C628.9,434.2,626.4,438.8,624,439.8z M647.4,473.3
|
| 125 |
+
c-0.5,0.7-1.9,1.2-2.6,0.9c-2.7-0.9-5.2-2-6.2-5.4c1-0.7,1.9-1.5,3-1.9c1.5-0.6,2.9-0.4,4,1.1c0.6,0.8,1.4,1.6,1.8,2.6
|
| 126 |
+
C647.6,471.4,647.8,472.7,647.4,473.3z M649.3,467.9c-0.2,0-0.5,0-0.6-0.1c-0.1-0.1,0-0.4,0-0.6c0.2,0,0.4,0,0.6,0.1
|
| 127 |
+
C649.3,467.6,649.3,467.8,649.3,467.9z M656.6,464.8C656.6,464.8,656.6,464.8,656.6,464.8L656.6,464.8
|
| 128 |
+
C656.6,464.9,656.6,464.9,656.6,464.8c-0.1,0.3-0.1,0.4-0.2,0.6l-1.8-0.8c1.2,2,0.9,2.3-1.7,2.8c0.4-0.9,0.8-1.9,1.2-3l-3.2-1.3
|
| 129 |
+
l0,0c0-0.1,0-0.2-0.1-0.5c-1.4-2.1-2.2-2-2.7-1.9c-0.2,0.1-0.4,0.1-0.5,0.2l-1.2-2.7l-1.2-2.7c0.4-0.2,0.9-0.4,1.4-0.5c0,0,0,0,0,0
|
| 130 |
+
c1.5-0.4,3.5-0.5,5.5,0.7c0,0,0,0,0,0c0,0,0,0,0,0c1.3,0.8,2.6,2,3.9,4l0.2,0.3l0.1,0.4C656.9,462.1,657,463.5,656.6,464.8z"/>
|
| 131 |
+
<path class="st1" d="M754.7,497.6l-0.1-2.2c0.9,0,2,0.1,3.2,0.6c0,0,0,0,0,0c0,0,0,0,0,0c0.3,0.1,0.5,0.3,0.8,0.4l19.5-5.6
|
| 132 |
+
L743,369.1l18-5.2c-3.3,0.2-6.5,0.5-9.7,0.7c-0.1,0-0.2,0-0.3,0c-0.5,0-1,0.1-1.5,0.1c-0.2,0-0.3,0-0.5,0c-0.5,0-0.9,0-1.4,0
|
| 133 |
+
c-0.2,0-0.4,0-0.6,0c-0.7,0-1.3,0-2,0c-3.1,0-6.3-0.9-7.1-4.8c-0.6-3.2,1.8-6.4,5.9-7.5c3.9-1,7.8-1.7,12.3-2.7
|
| 134 |
+
c0,0.3,0.1,0.6,0.2,0.9c0,0.1,0,0.1,0.1,0.2c0.1,0.2,0.1,0.5,0.2,0.7c0,0,0,0,0,0c1.7,3.9,6.5,6.7,4.4,12.3c0,0,0,0,0,0l9.8-2.8
|
| 135 |
+
l-6.9-23.8L717,350.8l2.3,1.2c0,0,0,0,0,0h0c-0.2,0.3-0.4,0.7-0.6,1l-0.2,0.4l0,0L716,352l-0.9-0.6l-33.7,9.7l6.9,23.8l27.9-8
|
| 136 |
+
l35.1,121.8L754.7,497.6z M708.8,359.6c-0.3-0.5-0.4-1.4-0.2-2c0.2-0.4,1.1-0.5,1.6-0.8c0.2,0.8,0.5,1.7,0.9,2.9
|
| 137 |
+
C709.9,359.7,709,359.9,708.8,359.6z M745.1,378c0,0.2,0,0.4,0,0.5v0c-0.2,1.9-1.2,3.5-2.7,4.3c-0.1,0.1-0.3,0.1-0.4,0.2l-2.1-5.4
|
| 138 |
+
v0L745.1,378L745.1,378z"/>
|
| 139 |
+
<g>
|
| 140 |
+
<path class="st1" d="M860.2,372.5l-35.7,10.3l-10-34.6L853,337l-6.7-23.4l-65.6,18.9l41.9,145.6l65.6-18.9l-1.6-5.7l-0.5-0.9
|
| 141 |
+
l-0.4,0.5c0,0,0,0,0,0v0c-0.3-0.3-0.6-0.6-0.9-0.9c-0.1-0.1-0.3-0.3-0.4-0.4c0,0,0,0,0,0l0.3-0.4c0,0,0-0.1,0-0.1l0,0v0l0.1,0
|
| 142 |
+
l0-0.1l0.8-1.1l-4.2-14.7l-38.5,11.1l-11.6-40.3l23.1-6.7c0-0.2,0-0.4,0-0.6c0.5,0.1,1.1,0.1,1.6,0.1l11.1-3.2L860.2,372.5z
|
| 143 |
+
M809.4,414.7l-3.8-1.3l4.9-3.6l1.6-1l1.7,1.1l1.1,0.4l0,0.4l2.4,1.6l-2,1.5l0.2,1.7l-5.8,0.5L809.4,414.7z M815.9,447L815.9,447
|
| 144 |
+
c-0.1-0.1-0.1-0.3-0.2-0.4c-0.1-0.2-0.2-0.4-0.3-0.6c0-0.1-0.1-0.2-0.1-0.2c0-0.1-0.1-0.1-0.1-0.2l1.1-0.9l1.1-1l2.2-1.9l0.1,0.2
|
| 145 |
+
c0.2,0.2,0.3,0.5,0.4,0.7c0,0,0,0,0,0l0,0c0.1,0.3,0.3,0.5,0.4,0.7c0.1,0.2,0.1,0.3,0.2,0.5l0,0L815.9,447z"/>
|
| 146 |
+
<path class="st1" d="M884.7,451.3l0.6-0.1l-0.2-0.3C885,451,884.8,451.1,884.7,451.3z"/>
|
| 147 |
+
</g>
|
| 148 |
+
<polygon class="st1" points="969.2,410.2 930.6,421.3 919,380.9 954.8,370.6 948,347.1 912.3,357.4 902.3,322.8 940.8,311.7
|
| 149 |
+
934.1,288.3 868.5,307.2 910.4,452.8 976,433.9 "/>
|
| 150 |
+
<path class="st1" d="M405.3,270.3l-0.3,0.1l21.7,10.3l1.4,22.6c0-0.3,0.1-0.6,0.2-0.8c0.4,0.1,0.9,0.1,1.2,0.3
|
| 151 |
+
c0.2,0.2,0.1,0.7,0.1,1.4c-0.7-0.3-1.3-0.3-1.4-0.6c0-0.1,0-0.1-0.1-0.2l0.9,15.4l26.1-27.7l4.5,1.2c-2.6-1.4-4.5-2.3-5.7-3.8
|
| 152 |
+
c-0.7-1,0.1-4.4,1.2-5.2c2.7-1.6,5.6-0.2,6.9,2.6c0.6,1.5-0.1,3.5-0.4,6.8l30.3,7.9l-6.8-12.5c-0.4,0.5-1,1-1.7,1.4
|
| 153 |
+
c-2.1,0.7-4.1,0.6-6-0.8c-0.6-0.4-1.3-1.4-1.2-2c0.4-2.1,1-4.1,1.7-6c0.2-0.5,1.3-0.8,2.1-0.8c0.2,0,0.4,0,0.6,0l-7-12.8l20.5-32.1
|
| 154 |
+
l-37.4,7.1l-24.2-29.4l-4.8,37.8l-35.5,13.9l12.4,5.9L405.3,270.3z M434.4,277.6c1.9-1.4,1.9-1.4,3.6,0.8
|
| 155 |
+
C436.5,278.1,435.6,277.9,434.4,277.6z M444.6,256.9c-1.4-0.7-2.5-0.9-3-1.6c-0.8-0.9-0.4-2,0.6-2.6c1-0.6,2.7-0.2,2.9,0.9
|
| 156 |
+
C445.2,254.5,444.8,255.4,444.6,256.9z M448.8,285.2c0.6,0.3,1.2,0.6,1.7,0.9c0.1,0.1-0.3,1.1-0.4,1.1c-0.6-0.1-1.2-0.4-1.8-0.6
|
| 157 |
+
C448.5,286.3,448.6,285.9,448.8,285.2z M437.6,235.1c3.1-1.3,6.3-0.3,7.8,2.6c1.7,3.2,0.5,6.9-2.7,8.4c-2.4,1.1-7.2-0.8-8.5-3.5
|
| 158 |
+
C433,240,434.6,236.3,437.6,235.1z M415.3,266c0.4,0.2,0.8,0.3,1.2,0.5c0.1,0.1-0.1,0.5-0.2,1c-0.5-0.2-0.9-0.3-1.3-0.5
|
| 159 |
+
C415.1,266.7,415.2,266.4,415.3,266z"/>
|
| 160 |
+
<path class="st1" d="M334.6,345.9l19-20.2l26.8,7l-13.3-24.3l15-23.4l-27.2,5.2l-17.6-21.4l-3.5,27.5l-25.8,10.1l25.1,11.8
|
| 161 |
+
L334.6,345.9z M351.1,302.9c0.8,0.9,0.6,3.2,0,4.4c-0.3,0.6-3.2,0.6-3.9-0.1c-1-1-1-2.8-1.9-5.6C348.2,302.1,350.4,302,351.1,302.9
|
| 162 |
+
z M339.5,298c0.2-0.2,1.1,0.4,2.3,0.8c-0.9,0.9-1.4,1.6-2.1,1.9c-0.3,0.2-0.9-0.4-1.4-0.7C338.7,299.4,339,298.5,339.5,298z"/>
|
| 163 |
+
<path class="st1" d="M568.4,269.9c0.1,0.1,0.2,0.3,0.2,0.6l14.5,3.8l-13.3-24.3l13.4-21l-1.6-0.2l2.1-0.6l1-1.5l-17.2,3.3
|
| 164 |
+
c0.1,0.3,0.2,0.6,0.3,0.9c-1,0.1-1.9,0.5-2.4,0.2c-0.2-0.1-0.3-0.3-0.4-0.6l-7.6,1.4l-17.6-21.4l-3.5,27.5l-25.8,10.1l25.1,11.8
|
| 165 |
+
l1.7,27.7l19-20.2l9,2.3C566.2,269.4,567.5,269.5,568.4,269.9z M538.7,241.2c0.9-0.7,2.1-0.3,2.5,0.7c0.3,0.6-0.1,1.5-0.2,2.9
|
| 166 |
+
c-1.4-0.7-2.5-0.9-3-1.5C537.7,242.9,538.1,241.6,538.7,241.2z M541.8,246.2c-0.1,0.3-0.3,0.6-0.5,0.9c0,0,0,0,0,0
|
| 167 |
+
c-0.1,0.1-0.1,0.2-0.2,0.3l-5.5-2.1c0.2-0.7,0.6-1.2,0.8-1.6c0.1-0.1,0.2-0.2,0.2-0.4l0,0L541.8,246.2
|
| 168 |
+
C541.8,246.2,541.8,246.2,541.8,246.2z M550.9,254.1c-0.5,1.8-1.6,3.2-3,4c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0h0
|
| 169 |
+
c-0.3,0.1-0.5,0.3-0.8,0.4c0,0-0.1,0-0.1,0.1l-1-2.8l-0.6-2.1c0,0,0,0,0,0c0,0-0.1,0-0.1,0l0-0.4l-0.1-0.4c0,0,0.1,0,0.1-0.1v-5.1
|
| 170 |
+
c4.7,0.1,5.7,3.3,5.9,5.2l0.1,0.6L550.9,254.1z M557.2,259.6c-0.2-0.3-0.4-0.6-0.6-1c-0.1-0.2-0.2-0.4-0.3-0.5c0,0,0.3,0.4,0.9,0.5
|
| 171 |
+
l0.8-2.9l0.8-2.9c0.3,0.1,0.6,0.2,0.8,0.4c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0
|
| 172 |
+
c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0l0,0l0,0
|
| 173 |
+
c0,0,0,0,0,0c0,0,0,0,0,0l0,0l0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0
|
| 174 |
+
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0v0c0,0,0,0,0,0v0c0,0,0,0,0,0c0,0,0,0,0,0s0,0,0,0v0c0,0,0,0,0,0s0,0,0,0
|
| 175 |
+
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0v0l0,0c0,0,0,0,0,0c0,0,0,0,0,0
|
| 176 |
+
c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0.6,0.6,0.9,1.2,1.2,1.7c0.1,0.2,0.2,0.3,0.3,0.5c0,0,0,0,0,0l-2.4,1.7L557.2,259.6z"/>
|
| 177 |
+
<g>
|
| 178 |
+
<path class="st1" d="M456,117.5c0.2,0.7,0.4,1.4,0.5,2c67.8-10,135-1.4,195.9,22.5c1.2-1.5,3-2.8,5.6-4c6.8-3.1,16.9-0.1,19.9,5.8
|
| 179 |
+
c1.1,2.2,1.1,5.8,0.3,9.4c31.8,15.3,61.5,34.8,88.1,58.3c0.3-0.4,0.6-0.7,1.1-0.9c1.5-0.7,3.6-0.1,4.3,1.2c0.6,1.2,0.1,2.9-1,3.6
|
| 180 |
+
c16,14.5,30.8,30.4,44.3,47.6l12-3.5C768,182.5,682.6,129.8,588.2,111.3c0.2,0.1,0.3,0.3,0.5,0.4c2.2,2.3,0.8,6.4-2.1,7.6
|
| 181 |
+
c-3.1,1.3-6,0.2-7.1-2.7c-0.6-1.8,0-3.9,0.5-6.9c-42.3-7.4-86.2-8-130.3-0.9C452.7,111.5,455,114.4,456,117.5z M685.1,144.4
|
| 182 |
+
c0.7,0.2,1.7,0.2,2,0.6c0.3,0.5,0,1.3-0.1,2.4c-1-0.4-1.9-0.5-2-0.9C684.7,145.8,685,145.1,685.1,144.4z M537.6,107
|
| 183 |
+
c0.4,0.2,0.8,0.3,1.2,0.5c0.1,0.1,0,0.6-0.1,0.6c-0.4,0.1-0.9,0-1.3,0C537.5,107.8,537.5,107.4,537.6,107z"/>
|
| 184 |
+
<path class="st1" d="M129.9,456c-3.2-3.1-4.6-13.5-2.1-16.3c1.1-1.3,2.9-2,4.9-2.2c7.3-44.3,22.4-86.8,44.1-125.5
|
| 185 |
+
c-1-0.1-1.8-0.3-2.5-0.7c-2.3-1.3-2.7-3.7-0.9-5.7c1.8-1.9,4.3-2,6-0.1c0.2,0.3,0.4,0.6,0.6,1c48.1-82.5,126.7-147.3,225.6-175.8
|
| 186 |
+
c15-4.3,30.1-7.7,45.1-10.1c-0.1-0.4-0.2-0.7-0.3-1.1c-0.9-2.9-4.4-6.3-8.9-9.1c-13.1,2.4-26.1,5.4-39.1,9.2
|
| 187 |
+
c-84.3,24.3-154.3,74.2-204,138.8l1,0.5c-0.1,0.3-0.3,0.6-0.4,0.9c-0.8,1.6-1.7,3.1-2.8,4.4c-0.7,0.9-1.5,1.7-2.3,2.5c0,0,0,0,0,0
|
| 188 |
+
l-0.9-1c-42.3,57.6-68.8,126.2-75.4,198.5l12-3.5c0.2-1.5,0.3-2.9,0.5-4.4C130,456.1,129.9,456.1,129.9,456z M134.9,403.2l1.8,1.9
|
| 189 |
+
v0l-2.1,2l-2.1,2l-1.8-1.9L134.9,403.2z"/>
|
| 190 |
+
</g>
|
| 191 |
+
<path class="st1" d="M725.5,833.5c0.1,0,0.1,0,0.2,0c0.5-0.3,1-0.7,1.5-1l-2.8-0.7c0.7-2.9,1.1-5.9,1.4-8.9l5.8,0.7
|
| 192 |
+
c-0.2,2.3-0.5,4.5-0.9,6.7c107.4-71,173.8-190.9,177.3-319.5l-11.7,3.4c-1.3,35-7.4,69.2-17.8,102c1.3,0,2.5,0.5,3.6,1.4
|
| 193 |
+
c2.2,1.9,2.4,4.4,1.9,6.9c-0.4,2-3,4.2-5,3.8c-1.4-0.3-2.8-0.9-4-1.7C840,727,763.9,811.5,660.7,854.6c0,0.3,0,0.6,0.1,0.9
|
| 194 |
+
c-0.6-0.1-1.1-0.2-1.5-0.3c-13.2,5.4-26.8,10.2-40.8,14.3c-163.7,47.2-333.3-19.4-424.3-153l-11.7,3.4
|
| 195 |
+
c54.3,81.4,136.7,139.2,229.7,163.5l4.3-2.9c0.1,0.2,0.2,0.4,0.3,0.5l0-0.1l1.8,3.2l2.9,0.3l-0.6,1.1c4.4,1,8.8,2,13.2,2.9
|
| 196 |
+
l-0.1-3.1c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0.1,0,0.1,0,0.2,0c0,0,0.1,0,0.1,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0
|
| 197 |
+
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0v0c0,0,0,0,0,0c0,0,0,0,0,0h0c0,0,0.1,0,0.1,0c0,0,0,0,0,0
|
| 198 |
+
c0,0,0,0,0,0c0,0,0,0,0,0c0.3,0.1,0.6,0.2,0.9,0.3l0,0c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0
|
| 199 |
+
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0.6,0.3,1.1,0.7,1.5,1c0.1,0.1,0.3,0.2,0.4,0.3l0.9,0.6
|
| 200 |
+
l0.3,1.1c0,0.2,0.1,0.3,0.1,0.5c58.8,11.1,121.1,8.9,182.5-8.8c37.5-10.8,72.2-26.7,103.6-46.7
|
| 201 |
+
C725.4,833.7,725.5,833.5,725.5,833.5z M874.3,655.5c-3.1,2.4-4.7,2.8-7,1.7C868.9,655,870.4,654.6,874.3,655.5z M837.2,711.5
|
| 202 |
+
c0.3,0.2,0.3,0.7,0.4,1.1c-0.4,0.1-0.9,0.4-1.1,0.2c-0.3-0.2-0.3-0.7-0.4-1.1C836.4,711.7,836.9,711.3,837.2,711.5z M407.5,874.8
|
| 203 |
+
c0,0.3,0,0.6,0,0.9c0,0.2,0,0.3,0,0.5l-5.8,0.5v0c0-0.1,0-0.1,0-0.2c-0.1-0.7,0-1.4,0-2l0-0.5v0l0,0l5.8,0.4L407.5,874.8z
|
| 204 |
+
M473.8,885.7l1.9,2.3c-0.5,0.4-0.8,0.8-0.9,1.3l-5.5-2.1c0.1-0.2,0.2-0.4,0.3-0.7c0,0,0,0,0,0v0c0.5-1.2,1.3-2.3,2.4-3.2l0.1-0.1
|
| 205 |
+
L473.8,885.7l1.9,2.3L473.8,885.7l-1.9-2.3L473.8,885.7z"/>
|
| 206 |
+
<path class="st1" d="M396.5,98.9c131.9-38,267.3-8,368.7,69.2c0.7-2.6,2.5-5,4.7-5.9c0,0,0,0,0,0c-0.4-1.2,0-2.4,1.2-3.1
|
| 207 |
+
c1.3-0.8,3-0.4,3.7,0.8c0.4,0.6,0.4,1.5,0.1,2.3c2.2,0.7,4.3,2.3,5.2,4.4c1.8,3.8,0.5,8.7-2.9,10.3c-0.2,0.1-0.5,0.2-0.8,0.3
|
| 208 |
+
c5.8,4.7,11.5,9.7,17,14.7c0.9-2.2,2.4-4.1,4.1-5.9c1-1.1,2.1-1.5,3.6-1.5c5.2,0.1,5.5,0.3,7.2,5.4c0.1,0.3,0.4,0.6,0.5,0.9
|
| 209 |
+
c0.2,0,0.4,0,0.6,0c-0.1-0.9-0.2-1.9-0.3-2.9c3,1.2,4.5,3.8,3.7,6.8c-0.1,0.3-0.2,0.5-0.3,0.8c2-0.7,4-1.8,6.3-2.7
|
| 210 |
+
c1,3.4,2.3,6.2,2.4,9c0.2,5.4-3.5,8.1-9.1,7.1c-0.5-0.1-1-0.2-1.5-0.3c13.6,13.9,26.3,28.9,38,44.8l21.1-6.1
|
| 211 |
+
C780.5,120.4,628.1,48.7,470.7,63.8c1.9,2.3,2,5.6,0.2,7.4c-2.5,2.4-7.9,2-10.5-0.8c-1.6-1.7-2.2-3.6-1.9-5.3
|
| 212 |
+
c-22.5,2.8-45.1,7.4-67.7,13.9c-11,3.2-21.8,6.7-32.3,10.7c0.1,1,0,2.1,0.2,3c-1.6,0-3.2,0-5.6,0c0-0.3,0-0.6-0.1-0.9
|
| 213 |
+
C227.1,140.7,135,243,95.4,364.7c1.4-0.5,2.9,0.2,3.9,1.7c0.9,1.5,1.2,3.4,2.2,6.7c-3.4-0.9-5.5-0.9-7-1.9
|
| 214 |
+
c-0.4-0.3-0.7-0.6-0.9-0.9c-5.4,17.4-9.7,35.1-12.9,53.2l0.3-0.5l-0.3,0.6c0,0.1,0,0.1,0,0.2L81,423l0.2,0.1
|
| 215 |
+
c0.5,0.4,0.9,0.8,1.3,1.3c0.7,0.9,1.1,2,1.4,3.4l0.1,0.5c0,1.7-0.3,3.2-1.1,4.3l-3.5-2.3c-2.4,15.2-4.1,30.5-5,46l21.1-6.1
|
| 216 |
+
C107.7,300.7,223.5,148.7,396.5,98.9z M749.4,142.3c0.2-1.2,1.4-1.3,2.5-1.2c1.2,0.1,2.3,0.3,4,0.4c-1.1,1.1-1.8,2.4-3,3.1
|
| 217 |
+
c-0.6,0.4-2,0.1-2.8-0.3C749.6,144.1,749.3,142.9,749.4,142.3z M745.2,129.2c0.3,0.2,0.3,0.7,0.4,1.1c-0.4,0.1-0.9,0.4-1.1,0.2
|
| 218 |
+
c-0.3-0.2-0.3-0.7-0.4-1.1C744.4,129.3,744.9,129,745.2,129.2z M723.5,130.8c1.2-0.5,3.1,0.2,3.6,1.3c0.5,1-0.8,3.4-2,3.8
|
| 219 |
+
c-1.4,0.4-2.2-0.4-2.8-1.5C721.4,133.1,722.1,131.3,723.5,130.8z M673,99.4c0.7-0.2,1.6,0.2,3,0.5c-0.6,1.4-0.8,2.4-1.4,3
|
| 220 |
+
c-0.6,0.6-2.2,0-2.5-1C671.6,100.8,671.8,99.7,673,99.4z M571.9,68.8l0-1l0.2,0c0.3,0,0.5,0,0.6,0c0,0,0,0,0,0l0,0.8l2.6-0.5
|
| 221 |
+
l-2.6,0.6l0,0l2.6-0.5l0,0c0.1,0.4,0.1,0.7,0.2,1.1v0c0,0,0,0,0,0c0,0,0,0,0,0v0c0,0.3,0,0.5,0.1,0.8l0.3,3.7l-3.5-0.1l-0.2-3
|
| 222 |
+
l0.1,3c-0.2,0-0.4,0-0.5,0l-0.1,0l0.1-2.9l-2,0.1l0,0l0,0l0-0.5c0-0.5-0.1-0.9-0.1-1.3L571.9,68.8L571.9,68.8l-2.2,0.4L571.9,68.8z
|
| 223 |
+
M230.9,174.4l1.8-0.4l-0.2-0.5c0,0,0,0,0,0c0.1,0,0.2-0.1,0.2-0.1c0,0,0.1,0,0.1,0h0l0.3,0.5l0.4-0.1l0,0l0.3-0.1l-0.3,0.1l0,0.7
|
| 224 |
+
l2.3,4c-0.3,0.2-0.7,0.4-1.1,0.6l-0.5,0.2l-0.5,0c-2.8,0.1-5-1.5-5.7-4.1c0-0.1-0.1-0.2-0.1-0.3L230.9,174.4z M91.5,418.1
|
| 225 |
+
c-0.2,0.1-1.4-0.4-1.5-0.7c-0.2-0.7,0.1-1.5,0.2-2.7c1.2,0.7,1.9,1.1,2.6,1.6C92.4,416.9,92.1,417.7,91.5,418.1z"/>
|
| 226 |
+
</g>
|
| 227 |
+
</svg>
|
freemius-pricing/fde48e4609a6ddc11d639fc2421f2afd.png
ADDED
|
Binary file
|
freemius-pricing/freemius-pricing.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.Freemius=n():e.Freemius=n()}(window,(function(){return function(e){var n={};function t(a){if(n[a])return n[a].exports;var i=n[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,t),i.l=!0,i.exports}return t.m=e,t.c=n,t.d=function(e,n,a){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:a})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(t.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var i in e)t.d(a,i,function(n){return e[n]}.bind(null,i));return a},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,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=35)}([function(e,n,t){"use strict";e.exports=t(20)},function(e,n,t){e.exports=t(30)()},function(e,n,t){"use strict";(function(e,a){
|
| 2 |
+
/*!
|
| 3 |
+
* Font Awesome Free 5.15.1 by @fontawesome - https://fontawesome.com
|
| 4 |
+
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
| 5 |
+
*/
|
| 6 |
+
function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,n){for(var t=0;t<n.length;t++){var a=n[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},a=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),a.forEach((function(n){r(e,n,t[n])}))}return e}function c(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=[],a=!0,i=!1,s=void 0;try{for(var r,o=e[Symbol.iterator]();!(a=(r=o.next()).done)&&(t.push(r.value),!n||t.length!==n);a=!0);}catch(e){i=!0,s=e}finally{try{a||null==o.return||o.return()}finally{if(i)throw s}}return t}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}t.d(n,"a",(function(){return Ee})),t.d(n,"b",(function(){return _e})),t.d(n,"c",(function(){return we}));var l=function(){},p={},f={},u={mark:l,measure:l};try{"undefined"!=typeof window&&(p=window),"undefined"!=typeof document&&(f=document),"undefined"!=typeof MutationObserver&&MutationObserver,"undefined"!=typeof performance&&(u=performance)}catch(e){}var d=(p.navigator||{}).userAgent,g=void 0===d?"":d,m=p,h=f,A=u,k=(m.document,!!h.documentElement&&!!h.head&&"function"==typeof h.addEventListener&&"function"==typeof h.createElement),y=(~g.indexOf("MSIE")||g.indexOf("Trident/"),function(){try{}catch(e){return!1}}(),[1,2,3,4,5,6,7,8,9,10]),b=y.concat([11,12,13,14,15,16,17,18,19,20]),_={GROUP:"group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},v=(["xs","sm","lg","fw","ul","li","border","pull-left","pull-right","spin","pulse","rotate-90","rotate-180","rotate-270","flip-horizontal","flip-vertical","flip-both","stack","stack-1x","stack-2x","inverse","layers","layers-text","layers-counter",_.GROUP,_.SWAP_OPACITY,_.PRIMARY,_.SECONDARY].concat(y.map((function(e){return"".concat(e,"x")}))).concat(b.map((function(e){return"w-".concat(e)}))),m.FontAwesomeConfig||{});if(h&&"function"==typeof h.querySelector){[["data-family-prefix","familyPrefix"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach((function(e){var n=c(e,2),t=n[0],a=n[1],i=function(e){return""===e||"false"!==e&&("true"===e||e)}(function(e){var n=h.querySelector("script["+e+"]");if(n)return n.getAttribute(e)}(t));null!=i&&(v[a]=i)}))}var w=o({},{familyPrefix:"fa",replacementClass:"svg-inline--fa",autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0},v);w.autoReplaceSvg||(w.observeMutations=!1);var E=o({},w);m.FontAwesomeConfig=E;var C=m||{};C.___FONT_AWESOME___||(C.___FONT_AWESOME___={}),C.___FONT_AWESOME___.styles||(C.___FONT_AWESOME___.styles={}),C.___FONT_AWESOME___.hooks||(C.___FONT_AWESOME___.hooks={}),C.___FONT_AWESOME___.shims||(C.___FONT_AWESOME___.shims=[]);var x=C.___FONT_AWESOME___,B=[];k&&((h.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(h.readyState)||h.addEventListener("DOMContentLoaded",(function e(){h.removeEventListener("DOMContentLoaded",e),1,B.map((function(e){return e()}))})));var S,T=function(){},P=void 0!==e&&void 0!==e.process&&"function"==typeof e.process.emit,N=void 0===a?setTimeout:a,M=[];function q(){for(var e=0;e<M.length;e++)M[e][0](M[e][1]);M=[],S=!1}function I(e,n){M.push([e,n]),S||(S=!0,N(q,0))}function O(e){var n=e.owner,t=n._state,a=n._data,i=e[t],s=e.then;if("function"==typeof i){t="fulfilled";try{a=i(a)}catch(e){j(s,e)}}z(s,a)||("fulfilled"===t&&L(s,a),"rejected"===t&&j(s,a))}function z(e,n){var t;try{if(e===n)throw new TypeError("A promises callback cannot return that same promise.");if(n&&("function"==typeof n||"object"===i(n))){var a=n.then;if("function"==typeof a)return a.call(n,(function(a){t||(t=!0,n===a?U(e,a):L(e,a))}),(function(n){t||(t=!0,j(e,n))})),!0}}catch(n){return t||j(e,n),!0}return!1}function L(e,n){e!==n&&z(e,n)||U(e,n)}function U(e,n){"pending"===e._state&&(e._state="settled",e._data=n,I(R,e))}function j(e,n){"pending"===e._state&&(e._state="settled",e._data=n,I(F,e))}function D(e){e._then=e._then.forEach(O)}function R(e){e._state="fulfilled",D(e)}function F(n){n._state="rejected",D(n),!n._handled&&P&&e.process.emit("unhandledRejection",n._data,n)}function Y(n){e.process.emit("rejectionHandled",n)}function Q(e){if("function"!=typeof e)throw new TypeError("Promise resolver "+e+" is not a function");if(this instanceof Q==!1)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._then=[],function(e,n){function t(e){j(n,e)}try{e((function(e){L(n,e)}),t)}catch(e){t(e)}}(e,this)}Q.prototype={constructor:Q,_state:"pending",_then:null,_data:void 0,_handled:!1,then:function(e,n){var t={owner:this,then:new this.constructor(T),fulfilled:e,rejected:n};return!n&&!e||this._handled||(this._handled=!0,"rejected"===this._state&&P&&I(Y,this)),"fulfilled"===this._state||"rejected"===this._state?I(O,t):this._then.push(t),t.then},catch:function(e){return this.then(null,e)}},Q.all=function(e){if(!Array.isArray(e))throw new TypeError("You must pass an array to Promise.all().");return new Q((function(n,t){var a=[],i=0;function s(e){return i++,function(t){a[e]=t,--i||n(a)}}for(var r,o=0;o<e.length;o++)(r=e[o])&&"function"==typeof r.then?r.then(s(o),t):a[o]=r;i||n(a)}))},Q.race=function(e){if(!Array.isArray(e))throw new TypeError("You must pass an array to Promise.race().");return new Q((function(n,t){for(var a,i=0;i<e.length;i++)(a=e[i])&&"function"==typeof a.then?a.then(n,t):n(a)}))},Q.resolve=function(e){return e&&"object"===i(e)&&e.constructor===Q?e:new Q((function(n){n(e)}))},Q.reject=function(e){return new Q((function(n,t){t(e)}))};var W={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function V(e){if(e&&k){var n=h.createElement("style");n.setAttribute("type","text/css"),n.innerHTML=e;for(var t=h.head.childNodes,a=null,i=t.length-1;i>-1;i--){var s=t[i],r=(s.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(r)>-1&&(a=s)}return h.head.insertBefore(n,a),e}}function H(){for(var e=12,n="";e-- >0;)n+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[62*Math.random()|0];return n}function $(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function X(e){return Object.keys(e||{}).reduce((function(n,t){return n+"".concat(t,": ").concat(e[t],";")}),"")}function K(e){return e.size!==W.size||e.x!==W.x||e.y!==W.y||e.rotate!==W.rotate||e.flipX||e.flipY}function Z(e){var n=e.transform,t=e.containerWidth,a=e.iconWidth,i={transform:"translate(".concat(t/2," 256)")},s="translate(".concat(32*n.x,", ").concat(32*n.y,") "),r="scale(".concat(n.size/16*(n.flipX?-1:1),", ").concat(n.size/16*(n.flipY?-1:1),") "),o="rotate(".concat(n.rotate," 0 0)");return{outer:i,inner:{transform:"".concat(s," ").concat(r," ").concat(o)},path:{transform:"translate(".concat(a/2*-1," -256)")}}}var G={x:0,y:0,width:"100%",height:"100%"};function J(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.attributes&&(e.attributes.fill||n)&&(e.attributes.fill="black"),e}function ee(e){var n=e.icons,t=n.main,a=n.mask,i=e.prefix,s=e.iconName,r=e.transform,c=e.symbol,l=e.title,p=e.maskId,f=e.titleId,u=e.extra,d=e.watchable,g=void 0!==d&&d,m=a.found?a:t,h=m.width,A=m.height,k="fak"===i,y=k?"":"fa-w-".concat(Math.ceil(h/A*16)),b=[E.replacementClass,s?"".concat(E.familyPrefix,"-").concat(s):"",y].filter((function(e){return-1===u.classes.indexOf(e)})).filter((function(e){return""!==e||!!e})).concat(u.classes).join(" "),_={children:[],attributes:o({},u.attributes,{"data-prefix":i,"data-icon":s,class:b,role:u.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(h," ").concat(A)})},v=k&&!~u.classes.indexOf("fa-fw")?{width:"".concat(h/A*16*.0625,"em")}:{};g&&(_.attributes["data-fa-i2svg"]=""),l&&_.children.push({tag:"title",attributes:{id:_.attributes["aria-labelledby"]||"title-".concat(f||H())},children:[l]});var w=o({},_,{prefix:i,iconName:s,main:t,mask:a,maskId:p,transform:r,symbol:c,styles:o({},v,u.styles)}),C=a.found&&t.found?function(e){var n,t=e.children,a=e.attributes,i=e.main,s=e.mask,r=e.maskId,c=e.transform,l=i.width,p=i.icon,f=s.width,u=s.icon,d=Z({transform:c,containerWidth:f,iconWidth:l}),g={tag:"rect",attributes:o({},G,{fill:"white"})},m=p.children?{children:p.children.map(J)}:{},h={tag:"g",attributes:o({},d.inner),children:[J(o({tag:p.tag,attributes:o({},p.attributes,d.path)},m))]},A={tag:"g",attributes:o({},d.outer),children:[h]},k="mask-".concat(r||H()),y="clip-".concat(r||H()),b={tag:"mask",attributes:o({},G,{id:k,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[g,A]},_={tag:"defs",children:[{tag:"clipPath",attributes:{id:y},children:(n=u,"g"===n.tag?n.children:[n])},b]};return t.push(_,{tag:"rect",attributes:o({fill:"currentColor","clip-path":"url(#".concat(y,")"),mask:"url(#".concat(k,")")},G)}),{children:t,attributes:a}}(w):function(e){var n=e.children,t=e.attributes,a=e.main,i=e.transform,s=X(e.styles);if(s.length>0&&(t.style=s),K(i)){var r=Z({transform:i,containerWidth:a.width,iconWidth:a.width});n.push({tag:"g",attributes:o({},r.outer),children:[{tag:"g",attributes:o({},r.inner),children:[{tag:a.icon.tag,children:a.icon.children,attributes:o({},a.icon.attributes,r.path)}]}]})}else n.push(a.icon);return{children:n,attributes:t}}(w),x=C.children,B=C.attributes;return w.children=x,w.attributes=B,c?function(e){var n=e.prefix,t=e.iconName,a=e.children,i=e.attributes,s=e.symbol;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:o({},i,{id:!0===s?"".concat(n,"-").concat(E.familyPrefix,"-").concat(t):s}),children:a}]}]}(w):function(e){var n=e.children,t=e.main,a=e.mask,i=e.attributes,s=e.styles,r=e.transform;if(K(r)&&t.found&&!a.found){var c={x:t.width/t.height/2,y:.5};i.style=X(o({},s,{"transform-origin":"".concat(c.x+r.x/16,"em ").concat(c.y+r.y/16,"em")}))}return[{tag:"svg",attributes:i,children:n}]}(w)}var ne=function(){},te=(E.measurePerformance&&A&&A.mark&&A.measure,function(e,n,t,a){var i,s,r,o=Object.keys(e),c=o.length,l=void 0!==a?function(e,n){return function(t,a,i,s){return e.call(n,t,a,i,s)}}(n,a):n;for(void 0===t?(i=1,r=e[o[0]]):(i=0,r=t);i<c;i++)r=l(r,e[s=o[i]],s,e);return r});function ae(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=t.skipHooks,i=void 0!==a&&a,s=Object.keys(n).reduce((function(e,t){var a=n[t];return!!a.icon?e[a.iconName]=a.icon:e[t]=a,e}),{});"function"!=typeof x.hooks.addPack||i?x.styles[e]=o({},x.styles[e]||{},s):x.hooks.addPack(e,s),"fas"===e&&ae("fa",n)}var ie=x.styles,se=x.shims,re=function(){var e=function(e){return te(ie,(function(n,t,a){return n[a]=te(t,e,{}),n}),{})};e((function(e,n,t){return n[3]&&(e[n[3]]=t),e})),e((function(e,n,t){var a=n[2];return e[t]=t,a.forEach((function(n){e[n]=t})),e}));var n="far"in ie;te(se,(function(e,t){var a=t[0],i=t[1],s=t[2];return"far"!==i||n||(i="fas"),e[a]={prefix:i,iconName:s},e}),{})};re();x.styles;function oe(e,n,t){if(e&&e[n]&&e[n][t])return{prefix:n,iconName:t,icon:e[n][t]}}function ce(e){var n=e.tag,t=e.attributes,a=void 0===t?{}:t,i=e.children,s=void 0===i?[]:i;return"string"==typeof e?$(e):"<".concat(n," ").concat(function(e){return Object.keys(e||{}).reduce((function(n,t){return n+"".concat(t,'="').concat($(e[t]),'" ')}),"").trim()}(a),">").concat(s.map(ce).join(""),"</").concat(n,">")}var le=function(e){var n={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return e?e.toLowerCase().split(" ").reduce((function(e,n){var t=n.toLowerCase().split("-"),a=t[0],i=t.slice(1).join("-");if(a&&"h"===i)return e.flipX=!0,e;if(a&&"v"===i)return e.flipY=!0,e;if(i=parseFloat(i),isNaN(i))return e;switch(a){case"grow":e.size=e.size+i;break;case"shrink":e.size=e.size-i;break;case"left":e.x=e.x-i;break;case"right":e.x=e.x+i;break;case"up":e.y=e.y-i;break;case"down":e.y=e.y+i;break;case"rotate":e.rotate=e.rotate+i}return e}),n):n};function pe(e){this.name="MissingIcon",this.message=e||"Icon unavailable",this.stack=(new Error).stack}pe.prototype=Object.create(Error.prototype),pe.prototype.constructor=pe;var fe={fill:"currentColor"},ue={attributeType:"XML",repeatCount:"indefinite",dur:"2s"},de={tag:"path",attributes:o({},fe,{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})},ge=o({},ue,{attributeName:"opacity"});o({},fe,{cx:"256",cy:"364",r:"28"}),o({},ue,{attributeName:"r",values:"28;14;28;28;14;28;"}),o({},ge,{values:"1;0;1;1;0;1;"}),o({},fe,{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),o({},ge,{values:"1;0;0;0;0;1;"}),o({},fe,{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),o({},ge,{values:"0;0;1;1;0;0;"}),x.styles;function me(e){var n=e[0],t=e[1],a=c(e.slice(4),1)[0];return{found:!0,width:n,height:t,icon:Array.isArray(a)?{tag:"g",attributes:{class:"".concat(E.familyPrefix,"-").concat(_.GROUP)},children:[{tag:"path",attributes:{class:"".concat(E.familyPrefix,"-").concat(_.SECONDARY),fill:"currentColor",d:a[0]}},{tag:"path",attributes:{class:"".concat(E.familyPrefix,"-").concat(_.PRIMARY),fill:"currentColor",d:a[1]}}]}:{tag:"path",attributes:{fill:"currentColor",d:a}}}}x.styles;function he(){var e="svg-inline--fa",n=E.familyPrefix,t=E.replacementClass,a='svg:not(:root).svg-inline--fa {\n overflow: visible;\n}\n\n.svg-inline--fa {\n display: inline-block;\n font-size: inherit;\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-lg {\n vertical-align: -0.225em;\n}\n.svg-inline--fa.fa-w-1 {\n width: 0.0625em;\n}\n.svg-inline--fa.fa-w-2 {\n width: 0.125em;\n}\n.svg-inline--fa.fa-w-3 {\n width: 0.1875em;\n}\n.svg-inline--fa.fa-w-4 {\n width: 0.25em;\n}\n.svg-inline--fa.fa-w-5 {\n width: 0.3125em;\n}\n.svg-inline--fa.fa-w-6 {\n width: 0.375em;\n}\n.svg-inline--fa.fa-w-7 {\n width: 0.4375em;\n}\n.svg-inline--fa.fa-w-8 {\n width: 0.5em;\n}\n.svg-inline--fa.fa-w-9 {\n width: 0.5625em;\n}\n.svg-inline--fa.fa-w-10 {\n width: 0.625em;\n}\n.svg-inline--fa.fa-w-11 {\n width: 0.6875em;\n}\n.svg-inline--fa.fa-w-12 {\n width: 0.75em;\n}\n.svg-inline--fa.fa-w-13 {\n width: 0.8125em;\n}\n.svg-inline--fa.fa-w-14 {\n width: 0.875em;\n}\n.svg-inline--fa.fa-w-15 {\n width: 0.9375em;\n}\n.svg-inline--fa.fa-w-16 {\n width: 1em;\n}\n.svg-inline--fa.fa-w-17 {\n width: 1.0625em;\n}\n.svg-inline--fa.fa-w-18 {\n width: 1.125em;\n}\n.svg-inline--fa.fa-w-19 {\n width: 1.1875em;\n}\n.svg-inline--fa.fa-w-20 {\n width: 1.25em;\n}\n.svg-inline--fa.fa-pull-left {\n margin-right: 0.3em;\n width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n margin-left: 0.3em;\n width: auto;\n}\n.svg-inline--fa.fa-border {\n height: 1.5em;\n}\n.svg-inline--fa.fa-li {\n width: 2em;\n}\n.svg-inline--fa.fa-fw {\n width: 1.25em;\n}\n\n.fa-layers svg.svg-inline--fa {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.fa-layers {\n display: inline-block;\n height: 1em;\n position: relative;\n text-align: center;\n vertical-align: -0.125em;\n width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter, .fa-layers-text {\n display: inline-block;\n position: absolute;\n text-align: center;\n}\n\n.fa-layers-text {\n left: 50%;\n top: 50%;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter {\n background-color: #ff253a;\n border-radius: 1em;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n color: #fff;\n height: 1.5em;\n line-height: 1;\n max-width: 5em;\n min-width: 1.5em;\n overflow: hidden;\n padding: 0.25em;\n right: 0;\n text-overflow: ellipsis;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n bottom: 0;\n right: 0;\n top: auto;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: bottom right;\n transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n bottom: 0;\n left: 0;\n right: auto;\n top: auto;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: bottom left;\n transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n right: 0;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-top-left {\n left: 0;\n right: auto;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top left;\n transform-origin: top left;\n}\n\n.fa-lg {\n font-size: 1.3333333333em;\n line-height: 0.75em;\n vertical-align: -0.0667em;\n}\n\n.fa-xs {\n font-size: 0.75em;\n}\n\n.fa-sm {\n font-size: 0.875em;\n}\n\n.fa-1x {\n font-size: 1em;\n}\n\n.fa-2x {\n font-size: 2em;\n}\n\n.fa-3x {\n font-size: 3em;\n}\n\n.fa-4x {\n font-size: 4em;\n}\n\n.fa-5x {\n font-size: 5em;\n}\n\n.fa-6x {\n font-size: 6em;\n}\n\n.fa-7x {\n font-size: 7em;\n}\n\n.fa-8x {\n font-size: 8em;\n}\n\n.fa-9x {\n font-size: 9em;\n}\n\n.fa-10x {\n font-size: 10em;\n}\n\n.fa-fw {\n text-align: center;\n width: 1.25em;\n}\n\n.fa-ul {\n list-style-type: none;\n margin-left: 2.5em;\n padding-left: 0;\n}\n.fa-ul > li {\n position: relative;\n}\n\n.fa-li {\n left: -2em;\n position: absolute;\n text-align: center;\n width: 2em;\n line-height: inherit;\n}\n\n.fa-border {\n border: solid 0.08em #eee;\n border-radius: 0.1em;\n padding: 0.2em 0.25em 0.15em;\n}\n\n.fa-pull-left {\n float: left;\n}\n\n.fa-pull-right {\n float: right;\n}\n\n.fa.fa-pull-left,\n.fas.fa-pull-left,\n.far.fa-pull-left,\n.fal.fa-pull-left,\n.fab.fa-pull-left {\n margin-right: 0.3em;\n}\n.fa.fa-pull-right,\n.fas.fa-pull-right,\n.far.fa-pull-right,\n.fal.fa-pull-right,\n.fab.fa-pull-right {\n margin-left: 0.3em;\n}\n\n.fa-spin {\n -webkit-animation: fa-spin 2s infinite linear;\n animation: fa-spin 2s infinite linear;\n}\n\n.fa-pulse {\n -webkit-animation: fa-spin 1s infinite steps(8);\n animation: fa-spin 1s infinite steps(8);\n}\n\n@-webkit-keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.fa-rotate-90 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";\n -webkit-transform: scale(-1, 1);\n transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n -webkit-transform: scale(1, -1);\n transform: scale(1, -1);\n}\n\n.fa-flip-both, .fa-flip-horizontal.fa-flip-vertical {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n -webkit-transform: scale(-1, -1);\n transform: scale(-1, -1);\n}\n\n:root .fa-rotate-90,\n:root .fa-rotate-180,\n:root .fa-rotate-270,\n:root .fa-flip-horizontal,\n:root .fa-flip-vertical,\n:root .fa-flip-both {\n -webkit-filter: none;\n filter: none;\n}\n\n.fa-stack {\n display: inline-block;\n height: 2em;\n position: relative;\n width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.svg-inline--fa.fa-stack-1x {\n height: 1em;\n width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n height: 2em;\n width: 2.5em;\n}\n\n.fa-inverse {\n color: #fff;\n}\n\n.sr-only {\n border: 0;\n clip: rect(0, 0, 0, 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n width: 1px;\n}\n\n.sr-only-focusable:active, .sr-only-focusable:focus {\n clip: auto;\n height: auto;\n margin: 0;\n overflow: visible;\n position: static;\n width: auto;\n}\n\n.svg-inline--fa .fa-primary {\n fill: var(--fa-primary-color, currentColor);\n opacity: 1;\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n fill: var(--fa-secondary-color, currentColor);\n opacity: 0.4;\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n opacity: 0.4;\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n opacity: 1;\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n fill: black;\n}\n\n.fad.fa-inverse {\n color: #fff;\n}';if("fa"!==n||t!==e){var i=new RegExp("\\.".concat("fa","\\-"),"g"),s=new RegExp("\\--".concat("fa","\\-"),"g"),r=new RegExp("\\.".concat(e),"g");a=a.replace(i,".".concat(n,"-")).replace(s,"--".concat(n,"-")).replace(r,".".concat(t))}return a}function Ae(){E.autoAddCss&&!ve&&(V(he()),ve=!0)}function ke(e,n){return Object.defineProperty(e,"abstract",{get:n}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map((function(e){return ce(e)}))}}),Object.defineProperty(e,"node",{get:function(){if(k){var n=h.createElement("div");return n.innerHTML=e.html,n.children}}}),e}function ye(e){var n=e.prefix,t=void 0===n?"fa":n,a=e.iconName;if(a)return oe(_e.definitions,t,a)||oe(x.styles,t,a)}var be,_e=new(function(){function e(){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),this.definitions={}}var n,t,a;return n=e,(t=[{key:"add",value:function(){for(var e=this,n=arguments.length,t=new Array(n),a=0;a<n;a++)t[a]=arguments[a];var i=t.reduce(this._pullDefinitions,{});Object.keys(i).forEach((function(n){e.definitions[n]=o({},e.definitions[n]||{},i[n]),ae(n,i[n]),re()}))}},{key:"reset",value:function(){this.definitions={}}},{key:"_pullDefinitions",value:function(e,n){var t=n.prefix&&n.iconName&&n.icon?{0:n}:n;return Object.keys(t).map((function(n){var a=t[n],i=a.prefix,s=a.iconName,r=a.icon;e[i]||(e[i]={}),e[i][s]=r})),e}}])&&s(n.prototype,t),a&&s(n,a),e}()),ve=!1,we={transform:function(e){return le(e)}},Ee=(be=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.transform,a=void 0===t?W:t,i=n.symbol,s=void 0!==i&&i,r=n.mask,c=void 0===r?null:r,l=n.maskId,p=void 0===l?null:l,f=n.title,u=void 0===f?null:f,d=n.titleId,g=void 0===d?null:d,m=n.classes,h=void 0===m?[]:m,A=n.attributes,k=void 0===A?{}:A,y=n.styles,b=void 0===y?{}:y;if(e){var _=e.prefix,v=e.iconName,w=e.icon;return ke(o({type:"icon"},e),(function(){return Ae(),E.autoA11y&&(u?k["aria-labelledby"]="".concat(E.replacementClass,"-title-").concat(g||H()):(k["aria-hidden"]="true",k.focusable="false")),ee({icons:{main:me(w),mask:c?me(c.icon):{found:!1,width:null,height:null,icon:{}}},prefix:_,iconName:v,transform:o({},W,a),symbol:s,title:u,maskId:p,titleId:g,extra:{attributes:k,styles:b,classes:h}})}))}},function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=(e||{}).icon?e:ye(e||{}),a=n.mask;return a&&(a=(a||{}).icon?a:ye(a||{})),be(t,o({},n,{mask:a}))})}).call(this,t(3),t(27).setImmediate)},function(e,n){var t;t=function(){return this}();try{t=t||new Function("return this")()}catch(e){"object"==typeof window&&(t=window)}e.exports=t},function(e,n,t){"use strict";
|
| 7 |
+
/*
|
| 8 |
+
object-assign
|
| 9 |
+
(c) Sindre Sorhus
|
| 10 |
+
@license MIT
|
| 11 |
+
*/var a=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;function r(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var n={},t=0;t<10;t++)n["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(n).map((function(e){return n[e]})).join(""))return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach((function(e){a[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},a)).join("")}catch(e){return!1}}()?Object.assign:function(e,n){for(var t,o,c=r(e),l=1;l<arguments.length;l++){for(var p in t=Object(arguments[l]))i.call(t,p)&&(c[p]=t[p]);if(a){o=a(t);for(var f=0;f<o.length;f++)s.call(t,o[f])&&(c[o[f]]=t[o[f]])}}return c}},function(e,n){var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var n=[],t=0;t<e.length;t++)n.push(255&e.charCodeAt(t));return n},bytesToString:function(e){for(var n=[],t=0;t<e.length;t++)n.push(String.fromCharCode(e[t]));return n.join("")}}};e.exports=t},function(e,n,t){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}}(),e.exports=t(21)},function(e,n,t){"use strict";e.exports=function(e){var n=[];return n.toString=function(){return this.map((function(n){var t=function(e,n){var t=e[1]||"",a=e[3];if(!a)return t;if(n&&"function"==typeof btoa){var i=(r=a,o=btoa(unescape(encodeURIComponent(JSON.stringify(r)))),c="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(o),"/*# ".concat(c," */")),s=a.sources.map((function(e){return"/*# sourceURL=".concat(a.sourceRoot||"").concat(e," */")}));return[t].concat(s).concat([i]).join("\n")}var r,o,c;return[t].join("\n")}(n,e);return n[2]?"@media ".concat(n[2]," {").concat(t,"}"):t})).join("")},n.i=function(e,t,a){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(a)for(var s=0;s<this.length;s++){var r=this[s][0];null!=r&&(i[r]=!0)}for(var o=0;o<e.length;o++){var c=[].concat(e[o]);a&&i[c[0]]||(t&&(c[2]?c[2]="".concat(t," and ").concat(c[2]):c[2]=t),n.push(c))}},n}},function(e,n,t){var a,i,s,r,o;a=t(32),i=t(5).utf8,s=t(33),r=t(5).bin,(o=function(e,n){e.constructor==String?e=n&&"binary"===n.encoding?r.stringToBytes(e):i.stringToBytes(e):s(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var t=a.bytesToWords(e),c=8*e.length,l=1732584193,p=-271733879,f=-1732584194,u=271733878,d=0;d<t.length;d++)t[d]=16711935&(t[d]<<8|t[d]>>>24)|4278255360&(t[d]<<24|t[d]>>>8);t[c>>>5]|=128<<c%32,t[14+(c+64>>>9<<4)]=c;var g=o._ff,m=o._gg,h=o._hh,A=o._ii;for(d=0;d<t.length;d+=16){var k=l,y=p,b=f,_=u;l=g(l,p,f,u,t[d+0],7,-680876936),u=g(u,l,p,f,t[d+1],12,-389564586),f=g(f,u,l,p,t[d+2],17,606105819),p=g(p,f,u,l,t[d+3],22,-1044525330),l=g(l,p,f,u,t[d+4],7,-176418897),u=g(u,l,p,f,t[d+5],12,1200080426),f=g(f,u,l,p,t[d+6],17,-1473231341),p=g(p,f,u,l,t[d+7],22,-45705983),l=g(l,p,f,u,t[d+8],7,1770035416),u=g(u,l,p,f,t[d+9],12,-1958414417),f=g(f,u,l,p,t[d+10],17,-42063),p=g(p,f,u,l,t[d+11],22,-1990404162),l=g(l,p,f,u,t[d+12],7,1804603682),u=g(u,l,p,f,t[d+13],12,-40341101),f=g(f,u,l,p,t[d+14],17,-1502002290),l=m(l,p=g(p,f,u,l,t[d+15],22,1236535329),f,u,t[d+1],5,-165796510),u=m(u,l,p,f,t[d+6],9,-1069501632),f=m(f,u,l,p,t[d+11],14,643717713),p=m(p,f,u,l,t[d+0],20,-373897302),l=m(l,p,f,u,t[d+5],5,-701558691),u=m(u,l,p,f,t[d+10],9,38016083),f=m(f,u,l,p,t[d+15],14,-660478335),p=m(p,f,u,l,t[d+4],20,-405537848),l=m(l,p,f,u,t[d+9],5,568446438),u=m(u,l,p,f,t[d+14],9,-1019803690),f=m(f,u,l,p,t[d+3],14,-187363961),p=m(p,f,u,l,t[d+8],20,1163531501),l=m(l,p,f,u,t[d+13],5,-1444681467),u=m(u,l,p,f,t[d+2],9,-51403784),f=m(f,u,l,p,t[d+7],14,1735328473),l=h(l,p=m(p,f,u,l,t[d+12],20,-1926607734),f,u,t[d+5],4,-378558),u=h(u,l,p,f,t[d+8],11,-2022574463),f=h(f,u,l,p,t[d+11],16,1839030562),p=h(p,f,u,l,t[d+14],23,-35309556),l=h(l,p,f,u,t[d+1],4,-1530992060),u=h(u,l,p,f,t[d+4],11,1272893353),f=h(f,u,l,p,t[d+7],16,-155497632),p=h(p,f,u,l,t[d+10],23,-1094730640),l=h(l,p,f,u,t[d+13],4,681279174),u=h(u,l,p,f,t[d+0],11,-358537222),f=h(f,u,l,p,t[d+3],16,-722521979),p=h(p,f,u,l,t[d+6],23,76029189),l=h(l,p,f,u,t[d+9],4,-640364487),u=h(u,l,p,f,t[d+12],11,-421815835),f=h(f,u,l,p,t[d+15],16,530742520),l=A(l,p=h(p,f,u,l,t[d+2],23,-995338651),f,u,t[d+0],6,-198630844),u=A(u,l,p,f,t[d+7],10,1126891415),f=A(f,u,l,p,t[d+14],15,-1416354905),p=A(p,f,u,l,t[d+5],21,-57434055),l=A(l,p,f,u,t[d+12],6,1700485571),u=A(u,l,p,f,t[d+3],10,-1894986606),f=A(f,u,l,p,t[d+10],15,-1051523),p=A(p,f,u,l,t[d+1],21,-2054922799),l=A(l,p,f,u,t[d+8],6,1873313359),u=A(u,l,p,f,t[d+15],10,-30611744),f=A(f,u,l,p,t[d+6],15,-1560198380),p=A(p,f,u,l,t[d+13],21,1309151649),l=A(l,p,f,u,t[d+4],6,-145523070),u=A(u,l,p,f,t[d+11],10,-1120210379),f=A(f,u,l,p,t[d+2],15,718787259),p=A(p,f,u,l,t[d+9],21,-343485551),l=l+k>>>0,p=p+y>>>0,f=f+b>>>0,u=u+_>>>0}return a.endian([l,p,f,u])})._ff=function(e,n,t,a,i,s,r){var o=e+(n&t|~n&a)+(i>>>0)+r;return(o<<s|o>>>32-s)+n},o._gg=function(e,n,t,a,i,s,r){var o=e+(n&a|t&~a)+(i>>>0)+r;return(o<<s|o>>>32-s)+n},o._hh=function(e,n,t,a,i,s,r){var o=e+(n^t^a)+(i>>>0)+r;return(o<<s|o>>>32-s)+n},o._ii=function(e,n,t,a,i,s,r){var o=e+(t^(n|~a))+(i>>>0)+r;return(o<<s|o>>>32-s)+n},o._blocksize=16,o._digestsize=16,e.exports=function(e,n){if(null==e)throw new Error("Illegal argument "+e);var t=a.wordsToBytes(o(e,n));return n&&n.asBytes?t:n&&n.asString?r.bytesToString(t):a.bytesToHex(t)}},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=[],i="M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z";n.definition={prefix:"fas",iconName:"arrow-left",icon:[448,512,a,"f060",i]},n.faArrowLeft=n.definition,n.prefix="fas",n.iconName="arrow-left",n.width=448,n.height=512,n.ligatures=a,n.unicode="f060",n.svgPathData=i},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=[],i="M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z";n.definition={prefix:"fas",iconName:"chevron-left",icon:[320,512,a,"f053",i]},n.faChevronLeft=n.definition,n.prefix="fas",n.iconName="chevron-left",n.width=320,n.height=512,n.ligatures=a,n.unicode="f053",n.svgPathData=i},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=[],i="M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z";n.definition={prefix:"fas",iconName:"arrow-right",icon:[448,512,a,"f061",i]},n.faArrowRight=n.definition,n.prefix="fas",n.iconName="arrow-right",n.width=448,n.height=512,n.ligatures=a,n.unicode="f061",n.svgPathData=i},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=[],i="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z";n.definition={prefix:"fas",iconName:"chevron-right",icon:[320,512,a,"f054",i]},n.faChevronRight=n.definition,n.prefix="fas",n.iconName="chevron-right",n.width=320,n.height=512,n.ligatures=a,n.unicode="f054",n.svgPathData=i},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=[],i="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z";n.definition={prefix:"fas",iconName:"check",icon:[512,512,a,"f00c",i]},n.faCheck=n.definition,n.prefix="fas",n.iconName="check",n.width=512,n.height=512,n.ligatures=a,n.unicode="f00c",n.svgPathData=i},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=[],i="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200z";n.definition={prefix:"far",iconName:"circle",icon:[512,512,a,"f111",i]},n.faCircle=n.definition,n.prefix="far",n.iconName="circle",n.width=512,n.height=512,n.ligatures=a,n.unicode="f111",n.svgPathData=i},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=[],i="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z";n.definition={prefix:"fas",iconName:"question-circle",icon:[512,512,a,"f059",i]},n.faQuestionCircle=n.definition,n.prefix="fas",n.iconName="question-circle",n.width=512,n.height=512,n.ligatures=a,n.unicode="f059",n.svgPathData=i},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=[],i="M464 256h-80v-64c0-35.3 28.7-64 64-64h8c13.3 0 24-10.7 24-24V56c0-13.3-10.7-24-24-24h-8c-88.4 0-160 71.6-160 160v240c0 26.5 21.5 48 48 48h128c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48zm-288 0H96v-64c0-35.3 28.7-64 64-64h8c13.3 0 24-10.7 24-24V56c0-13.3-10.7-24-24-24h-8C71.6 32 0 103.6 0 192v240c0 26.5 21.5 48 48 48h128c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48z";n.definition={prefix:"fas",iconName:"quote-left",icon:[512,512,a,"f10d",i]},n.faQuoteLeft=n.definition,n.prefix="fas",n.iconName="quote-left",n.width=512,n.height=512,n.ligatures=a,n.unicode="f10d",n.svgPathData=i},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=[],i="M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z";n.definition={prefix:"fas",iconName:"star",icon:[576,512,a,"f005",i]},n.faStar=n.definition,n.prefix="fas",n.iconName="star",n.width=576,n.height=512,n.ligatures=a,n.unicode="f005",n.svgPathData=i},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=[],i="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z";n.definition={prefix:"fas",iconName:"times-circle",icon:[512,512,a,"f057",i]},n.faTimesCircle=n.definition,n.prefix="fas",n.iconName="times-circle",n.width=512,n.height=512,n.ligatures=a,n.unicode="f057",n.svgPathData=i},function(e,n,t){let a=document.getElementById("fs_pricing_wrapper");a&&a.dataset&&a.dataset.publicUrl&&(t.p=a.dataset.publicUrl)},function(e,n,t){"use strict";
|
| 12 |
+
/** @license React v16.14.0
|
| 13 |
+
* react.production.min.js
|
| 14 |
+
*
|
| 15 |
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
| 16 |
+
*
|
| 17 |
+
* This source code is licensed under the MIT license found in the
|
| 18 |
+
* LICENSE file in the root directory of this source tree.
|
| 19 |
+
*/var a=t(4),i="function"==typeof Symbol&&Symbol.for,s=i?Symbol.for("react.element"):60103,r=i?Symbol.for("react.portal"):60106,o=i?Symbol.for("react.fragment"):60107,c=i?Symbol.for("react.strict_mode"):60108,l=i?Symbol.for("react.profiler"):60114,p=i?Symbol.for("react.provider"):60109,f=i?Symbol.for("react.context"):60110,u=i?Symbol.for("react.forward_ref"):60112,d=i?Symbol.for("react.suspense"):60113,g=i?Symbol.for("react.memo"):60115,m=i?Symbol.for("react.lazy"):60116,h="function"==typeof Symbol&&Symbol.iterator;function A(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,t=1;t<arguments.length;t++)n+="&args[]="+encodeURIComponent(arguments[t]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y={};function b(e,n,t){this.props=e,this.context=n,this.refs=y,this.updater=t||k}function _(){}function v(e,n,t){this.props=e,this.context=n,this.refs=y,this.updater=t||k}b.prototype.isReactComponent={},b.prototype.setState=function(e,n){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(A(85));this.updater.enqueueSetState(this,e,n,"setState")},b.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},_.prototype=b.prototype;var w=v.prototype=new _;w.constructor=v,a(w,b.prototype),w.isPureReactComponent=!0;var E={current:null},C=Object.prototype.hasOwnProperty,x={key:!0,ref:!0,__self:!0,__source:!0};function B(e,n,t){var a,i={},r=null,o=null;if(null!=n)for(a in void 0!==n.ref&&(o=n.ref),void 0!==n.key&&(r=""+n.key),n)C.call(n,a)&&!x.hasOwnProperty(a)&&(i[a]=n[a]);var c=arguments.length-2;if(1===c)i.children=t;else if(1<c){for(var l=Array(c),p=0;p<c;p++)l[p]=arguments[p+2];i.children=l}if(e&&e.defaultProps)for(a in c=e.defaultProps)void 0===i[a]&&(i[a]=c[a]);return{$$typeof:s,type:e,key:r,ref:o,props:i,_owner:E.current}}function S(e){return"object"==typeof e&&null!==e&&e.$$typeof===s}var T=/\/+/g,P=[];function N(e,n,t,a){if(P.length){var i=P.pop();return i.result=e,i.keyPrefix=n,i.func=t,i.context=a,i.count=0,i}return{result:e,keyPrefix:n,func:t,context:a,count:0}}function M(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>P.length&&P.push(e)}function q(e,n,t){return null==e?0:function e(n,t,a,i){var o=typeof n;"undefined"!==o&&"boolean"!==o||(n=null);var c=!1;if(null===n)c=!0;else switch(o){case"string":case"number":c=!0;break;case"object":switch(n.$$typeof){case s:case r:c=!0}}if(c)return a(i,n,""===t?"."+I(n,0):t),1;if(c=0,t=""===t?".":t+":",Array.isArray(n))for(var l=0;l<n.length;l++){var p=t+I(o=n[l],l);c+=e(o,p,a,i)}else if(null===n||"object"!=typeof n?p=null:p="function"==typeof(p=h&&n[h]||n["@@iterator"])?p:null,"function"==typeof p)for(n=p.call(n),l=0;!(o=n.next()).done;)c+=e(o=o.value,p=t+I(o,l++),a,i);else if("object"===o)throw a=""+n,Error(A(31,"[object Object]"===a?"object with keys {"+Object.keys(n).join(", ")+"}":a,""));return c}(e,"",n,t)}function I(e,n){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var n={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,(function(e){return n[e]}))}(e.key):n.toString(36)}function O(e,n){e.func.call(e.context,n,e.count++)}function z(e,n,t){var a=e.result,i=e.keyPrefix;e=e.func.call(e.context,n,e.count++),Array.isArray(e)?L(e,a,t,(function(e){return e})):null!=e&&(S(e)&&(e=function(e,n){return{$$typeof:s,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}(e,i+(!e.key||n&&n.key===e.key?"":(""+e.key).replace(T,"$&/")+"/")+t)),a.push(e))}function L(e,n,t,a,i){var s="";null!=t&&(s=(""+t).replace(T,"$&/")+"/"),q(e,z,n=N(n,s,a,i)),M(n)}var U={current:null};function j(){var e=U.current;if(null===e)throw Error(A(321));return e}var D={ReactCurrentDispatcher:U,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:E,IsSomeRendererActing:{current:!1},assign:a};n.Children={map:function(e,n,t){if(null==e)return e;var a=[];return L(e,a,null,n,t),a},forEach:function(e,n,t){if(null==e)return e;q(e,O,n=N(null,null,n,t)),M(n)},count:function(e){return q(e,(function(){return null}),null)},toArray:function(e){var n=[];return L(e,n,null,(function(e){return e})),n},only:function(e){if(!S(e))throw Error(A(143));return e}},n.Component=b,n.Fragment=o,n.Profiler=l,n.PureComponent=v,n.StrictMode=c,n.Suspense=d,n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=D,n.cloneElement=function(e,n,t){if(null==e)throw Error(A(267,e));var i=a({},e.props),r=e.key,o=e.ref,c=e._owner;if(null!=n){if(void 0!==n.ref&&(o=n.ref,c=E.current),void 0!==n.key&&(r=""+n.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(p in n)C.call(n,p)&&!x.hasOwnProperty(p)&&(i[p]=void 0===n[p]&&void 0!==l?l[p]:n[p])}var p=arguments.length-2;if(1===p)i.children=t;else if(1<p){l=Array(p);for(var f=0;f<p;f++)l[f]=arguments[f+2];i.children=l}return{$$typeof:s,type:e.type,key:r,ref:o,props:i,_owner:c}},n.createContext=function(e,n){return void 0===n&&(n=null),(e={$$typeof:f,_calculateChangedBits:n,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:p,_context:e},e.Consumer=e},n.createElement=B,n.createFactory=function(e){var n=B.bind(null,e);return n.type=e,n},n.createRef=function(){return{current:null}},n.forwardRef=function(e){return{$$typeof:u,render:e}},n.isValidElement=S,n.lazy=function(e){return{$$typeof:m,_ctor:e,_status:-1,_result:null}},n.memo=function(e,n){return{$$typeof:g,type:e,compare:void 0===n?null:n}},n.useCallback=function(e,n){return j().useCallback(e,n)},n.useContext=function(e,n){return j().useContext(e,n)},n.useDebugValue=function(){},n.useEffect=function(e,n){return j().useEffect(e,n)},n.useImperativeHandle=function(e,n,t){return j().useImperativeHandle(e,n,t)},n.useLayoutEffect=function(e,n){return j().useLayoutEffect(e,n)},n.useMemo=function(e,n){return j().useMemo(e,n)},n.useReducer=function(e,n,t){return j().useReducer(e,n,t)},n.useRef=function(e){return j().useRef(e)},n.useState=function(e){return j().useState(e)},n.version="16.14.0"},function(e,n,t){"use strict";
|
| 20 |
+
/** @license React v16.14.0
|
| 21 |
+
* react-dom.production.min.js
|
| 22 |
+
*
|
| 23 |
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
| 24 |
+
*
|
| 25 |
+
* This source code is licensed under the MIT license found in the
|
| 26 |
+
* LICENSE file in the root directory of this source tree.
|
| 27 |
+
*/var a=t(0),i=t(4),s=t(22);function r(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,t=1;t<arguments.length;t++)n+="&args[]="+encodeURIComponent(arguments[t]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!a)throw Error(r(227));function o(e,n,t,a,i,s,r,o,c){var l=Array.prototype.slice.call(arguments,3);try{n.apply(t,l)}catch(e){this.onError(e)}}var c=!1,l=null,p=!1,f=null,u={onError:function(e){c=!0,l=e}};function d(e,n,t,a,i,s,r,p,f){c=!1,l=null,o.apply(u,arguments)}var g=null,m=null,h=null;function A(e,n,t){var a=e.type||"unknown-event";e.currentTarget=h(t),function(e,n,t,a,i,s,o,u,g){if(d.apply(this,arguments),c){if(!c)throw Error(r(198));var m=l;c=!1,l=null,p||(p=!0,f=m)}}(a,n,void 0,e),e.currentTarget=null}var k=null,y={};function b(){if(k)for(var e in y){var n=y[e],t=k.indexOf(e);if(!(-1<t))throw Error(r(96,e));if(!v[t]){if(!n.extractEvents)throw Error(r(97,e));for(var a in v[t]=n,t=n.eventTypes){var i=void 0,s=t[a],o=n,c=a;if(w.hasOwnProperty(c))throw Error(r(99,c));w[c]=s;var l=s.phasedRegistrationNames;if(l){for(i in l)l.hasOwnProperty(i)&&_(l[i],o,c);i=!0}else s.registrationName?(_(s.registrationName,o,c),i=!0):i=!1;if(!i)throw Error(r(98,a,e))}}}}function _(e,n,t){if(E[e])throw Error(r(100,e));E[e]=n,C[e]=n.eventTypes[t].dependencies}var v=[],w={},E={},C={};function x(e){var n,t=!1;for(n in e)if(e.hasOwnProperty(n)){var a=e[n];if(!y.hasOwnProperty(n)||y[n]!==a){if(y[n])throw Error(r(102,n));y[n]=a,t=!0}}t&&b()}var B=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),S=null,T=null,P=null;function N(e){if(e=m(e)){if("function"!=typeof S)throw Error(r(280));var n=e.stateNode;n&&(n=g(n),S(e.stateNode,e.type,n))}}function M(e){T?P?P.push(e):P=[e]:T=e}function q(){if(T){var e=T,n=P;if(P=T=null,N(e),n)for(e=0;e<n.length;e++)N(n[e])}}function I(e,n){return e(n)}function O(e,n,t,a,i){return e(n,t,a,i)}function z(){}var L=I,U=!1,j=!1;function D(){null===T&&null===P||(z(),q())}function R(e,n,t){if(j)return e(n,t);j=!0;try{return L(e,n,t)}finally{j=!1,D()}}var F=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Y=Object.prototype.hasOwnProperty,Q={},W={};function V(e,n,t,a,i,s){this.acceptsBooleans=2===n||3===n||4===n,this.attributeName=a,this.attributeNamespace=i,this.mustUseProperty=t,this.propertyName=e,this.type=n,this.sanitizeURL=s}var H={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){H[e]=new V(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var n=e[0];H[n]=new V(n,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){H[e]=new V(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){H[e]=new V(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){H[e]=new V(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){H[e]=new V(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){H[e]=new V(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){H[e]=new V(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){H[e]=new V(e,5,!1,e.toLowerCase(),null,!1)}));var $=/[\-:]([a-z])/g;function X(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var n=e.replace($,X);H[n]=new V(n,1,!1,e,null,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var n=e.replace($,X);H[n]=new V(n,1,!1,e,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var n=e.replace($,X);H[n]=new V(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(e){H[e]=new V(e,1,!1,e.toLowerCase(),null,!1)})),H.xlinkHref=new V("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(e){H[e]=new V(e,1,!1,e.toLowerCase(),null,!0)}));var K=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Z(e,n,t,a){var i=H.hasOwnProperty(n)?H[n]:null;(null!==i?0===i.type:!a&&(2<n.length&&("o"===n[0]||"O"===n[0])&&("n"===n[1]||"N"===n[1])))||(function(e,n,t,a){if(null==n||function(e,n,t,a){if(null!==t&&0===t.type)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return!a&&(null!==t?!t.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,n,t,a))return!0;if(a)return!1;if(null!==t)switch(t.type){case 3:return!n;case 4:return!1===n;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}(n,t,i,a)&&(t=null),a||null===i?function(e){return!!Y.call(W,e)||!Y.call(Q,e)&&(F.test(e)?W[e]=!0:(Q[e]=!0,!1))}(n)&&(null===t?e.removeAttribute(n):e.setAttribute(n,""+t)):i.mustUseProperty?e[i.propertyName]=null===t?3!==i.type&&"":t:(n=i.attributeName,a=i.attributeNamespace,null===t?e.removeAttribute(n):(t=3===(i=i.type)||4===i&&!0===t?"":""+t,a?e.setAttributeNS(a,n,t):e.setAttribute(n,t))))}K.hasOwnProperty("ReactCurrentDispatcher")||(K.ReactCurrentDispatcher={current:null}),K.hasOwnProperty("ReactCurrentBatchConfig")||(K.ReactCurrentBatchConfig={suspense:null});var G=/^(.*)[\\\/]/,J="function"==typeof Symbol&&Symbol.for,ee=J?Symbol.for("react.element"):60103,ne=J?Symbol.for("react.portal"):60106,te=J?Symbol.for("react.fragment"):60107,ae=J?Symbol.for("react.strict_mode"):60108,ie=J?Symbol.for("react.profiler"):60114,se=J?Symbol.for("react.provider"):60109,re=J?Symbol.for("react.context"):60110,oe=J?Symbol.for("react.concurrent_mode"):60111,ce=J?Symbol.for("react.forward_ref"):60112,le=J?Symbol.for("react.suspense"):60113,pe=J?Symbol.for("react.suspense_list"):60120,fe=J?Symbol.for("react.memo"):60115,ue=J?Symbol.for("react.lazy"):60116,de=J?Symbol.for("react.block"):60121,ge="function"==typeof Symbol&&Symbol.iterator;function me(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=ge&&e[ge]||e["@@iterator"])?e:null}function he(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case te:return"Fragment";case ne:return"Portal";case ie:return"Profiler";case ae:return"StrictMode";case le:return"Suspense";case pe:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case re:return"Context.Consumer";case se:return"Context.Provider";case ce:var n=e.render;return n=n.displayName||n.name||"",e.displayName||(""!==n?"ForwardRef("+n+")":"ForwardRef");case fe:return he(e.type);case de:return he(e.render);case ue:if(e=1===e._status?e._result:null)return he(e)}return null}function Ae(e){var n="";do{e:switch(e.tag){case 3:case 4:case 6:case 7:case 10:case 9:var t="";break e;default:var a=e._debugOwner,i=e._debugSource,s=he(e.type);t=null,a&&(t=he(a.type)),a=s,s="",i?s=" (at "+i.fileName.replace(G,"")+":"+i.lineNumber+")":t&&(s=" (created by "+t+")"),t="\n in "+(a||"Unknown")+s}n+=t,e=e.return}while(e);return n}function ke(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function ye(e){var n=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===n||"radio"===n)}function be(e){e._valueTracker||(e._valueTracker=function(e){var n=ye(e)?"checked":"value",t=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),a=""+e[n];if(!e.hasOwnProperty(n)&&void 0!==t&&"function"==typeof t.get&&"function"==typeof t.set){var i=t.get,s=t.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return i.call(this)},set:function(e){a=""+e,s.call(this,e)}}),Object.defineProperty(e,n,{enumerable:t.enumerable}),{getValue:function(){return a},setValue:function(e){a=""+e},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}(e))}function _e(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var t=n.getValue(),a="";return e&&(a=ye(e)?e.checked?"true":"false":e.value),(e=a)!==t&&(n.setValue(e),!0)}function ve(e,n){var t=n.checked;return i({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=t?t:e._wrapperState.initialChecked})}function we(e,n){var t=null==n.defaultValue?"":n.defaultValue,a=null!=n.checked?n.checked:n.defaultChecked;t=ke(null!=n.value?n.value:t),e._wrapperState={initialChecked:a,initialValue:t,controlled:"checkbox"===n.type||"radio"===n.type?null!=n.checked:null!=n.value}}function Ee(e,n){null!=(n=n.checked)&&Z(e,"checked",n,!1)}function Ce(e,n){Ee(e,n);var t=ke(n.value),a=n.type;if(null!=t)"number"===a?(0===t&&""===e.value||e.value!=t)&&(e.value=""+t):e.value!==""+t&&(e.value=""+t);else if("submit"===a||"reset"===a)return void e.removeAttribute("value");n.hasOwnProperty("value")?Be(e,n.type,t):n.hasOwnProperty("defaultValue")&&Be(e,n.type,ke(n.defaultValue)),null==n.checked&&null!=n.defaultChecked&&(e.defaultChecked=!!n.defaultChecked)}function xe(e,n,t){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var a=n.type;if(!("submit"!==a&&"reset"!==a||void 0!==n.value&&null!==n.value))return;n=""+e._wrapperState.initialValue,t||n===e.value||(e.value=n),e.defaultValue=n}""!==(t=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==t&&(e.name=t)}function Be(e,n,t){"number"===n&&e.ownerDocument.activeElement===e||(null==t?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+t&&(e.defaultValue=""+t))}function Se(e,n){return e=i({children:void 0},n),(n=function(e){var n="";return a.Children.forEach(e,(function(e){null!=e&&(n+=e)})),n}(n.children))&&(e.children=n),e}function Te(e,n,t,a){if(e=e.options,n){n={};for(var i=0;i<t.length;i++)n["$"+t[i]]=!0;for(t=0;t<e.length;t++)i=n.hasOwnProperty("$"+e[t].value),e[t].selected!==i&&(e[t].selected=i),i&&a&&(e[t].defaultSelected=!0)}else{for(t=""+ke(t),n=null,i=0;i<e.length;i++){if(e[i].value===t)return e[i].selected=!0,void(a&&(e[i].defaultSelected=!0));null!==n||e[i].disabled||(n=e[i])}null!==n&&(n.selected=!0)}}function Pe(e,n){if(null!=n.dangerouslySetInnerHTML)throw Error(r(91));return i({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ne(e,n){var t=n.value;if(null==t){if(t=n.children,n=n.defaultValue,null!=t){if(null!=n)throw Error(r(92));if(Array.isArray(t)){if(!(1>=t.length))throw Error(r(93));t=t[0]}n=t}null==n&&(n=""),t=n}e._wrapperState={initialValue:ke(t)}}function Me(e,n){var t=ke(n.value),a=ke(n.defaultValue);null!=t&&((t=""+t)!==e.value&&(e.value=t),null==n.defaultValue&&e.defaultValue!==t&&(e.defaultValue=t)),null!=a&&(e.defaultValue=""+a)}function qe(e){var n=e.textContent;n===e._wrapperState.initialValue&&""!==n&&null!==n&&(e.value=n)}var Ie="http://www.w3.org/1999/xhtml",Oe="http://www.w3.org/2000/svg";function ze(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Le(e,n){return null==e||"http://www.w3.org/1999/xhtml"===e?ze(n):"http://www.w3.org/2000/svg"===e&&"foreignObject"===n?"http://www.w3.org/1999/xhtml":e}var Ue,je=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(n,t,a,i){MSApp.execUnsafeLocalFunction((function(){return e(n,t)}))}:e}((function(e,n){if(e.namespaceURI!==Oe||"innerHTML"in e)e.innerHTML=n;else{for((Ue=Ue||document.createElement("div")).innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=Ue.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}}));function De(e,n){if(n){var t=e.firstChild;if(t&&t===e.lastChild&&3===t.nodeType)return void(t.nodeValue=n)}e.textContent=n}function Re(e,n){var t={};return t[e.toLowerCase()]=n.toLowerCase(),t["Webkit"+e]="webkit"+n,t["Moz"+e]="moz"+n,t}var Fe={animationend:Re("Animation","AnimationEnd"),animationiteration:Re("Animation","AnimationIteration"),animationstart:Re("Animation","AnimationStart"),transitionend:Re("Transition","TransitionEnd")},Ye={},Qe={};function We(e){if(Ye[e])return Ye[e];if(!Fe[e])return e;var n,t=Fe[e];for(n in t)if(t.hasOwnProperty(n)&&n in Qe)return Ye[e]=t[n];return e}B&&(Qe=document.createElement("div").style,"AnimationEvent"in window||(delete Fe.animationend.animation,delete Fe.animationiteration.animation,delete Fe.animationstart.animation),"TransitionEvent"in window||delete Fe.transitionend.transition);var Ve=We("animationend"),He=We("animationiteration"),$e=We("animationstart"),Xe=We("transitionend"),Ke="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Ze=new("function"==typeof WeakMap?WeakMap:Map);function Ge(e){var n=Ze.get(e);return void 0===n&&(n=new Map,Ze.set(e,n)),n}function Je(e){var n=e,t=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do{0!=(1026&(n=e).effectTag)&&(t=n.return),e=n.return}while(e)}return 3===n.tag?t:null}function en(e){if(13===e.tag){var n=e.memoizedState;if(null===n&&(null!==(e=e.alternate)&&(n=e.memoizedState)),null!==n)return n.dehydrated}return null}function nn(e){if(Je(e)!==e)throw Error(r(188))}function tn(e){if(!(e=function(e){var n=e.alternate;if(!n){if(null===(n=Je(e)))throw Error(r(188));return n!==e?null:e}for(var t=e,a=n;;){var i=t.return;if(null===i)break;var s=i.alternate;if(null===s){if(null!==(a=i.return)){t=a;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===t)return nn(i),e;if(s===a)return nn(i),n;s=s.sibling}throw Error(r(188))}if(t.return!==a.return)t=i,a=s;else{for(var o=!1,c=i.child;c;){if(c===t){o=!0,t=i,a=s;break}if(c===a){o=!0,a=i,t=s;break}c=c.sibling}if(!o){for(c=s.child;c;){if(c===t){o=!0,t=s,a=i;break}if(c===a){o=!0,a=s,t=i;break}c=c.sibling}if(!o)throw Error(r(189))}}if(t.alternate!==a)throw Error(r(190))}if(3!==t.tag)throw Error(r(188));return t.stateNode.current===t?e:n}(e)))return null;for(var n=e;;){if(5===n.tag||6===n.tag)return n;if(n.child)n.child.return=n,n=n.child;else{if(n===e)break;for(;!n.sibling;){if(!n.return||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}}return null}function an(e,n){if(null==n)throw Error(r(30));return null==e?n:Array.isArray(e)?Array.isArray(n)?(e.push.apply(e,n),e):(e.push(n),e):Array.isArray(n)?[e].concat(n):[e,n]}function sn(e,n,t){Array.isArray(e)?e.forEach(n,t):e&&n.call(t,e)}var rn=null;function on(e){if(e){var n=e._dispatchListeners,t=e._dispatchInstances;if(Array.isArray(n))for(var a=0;a<n.length&&!e.isPropagationStopped();a++)A(e,n[a],t[a]);else n&&A(e,n,t);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function cn(e){if(null!==e&&(rn=an(rn,e)),e=rn,rn=null,e){if(sn(e,on),rn)throw Error(r(95));if(p)throw e=f,p=!1,f=null,e}}function ln(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}function pn(e){if(!B)return!1;var n=(e="on"+e)in document;return n||((n=document.createElement("div")).setAttribute(e,"return;"),n="function"==typeof n[e]),n}var fn=[];function un(e){e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>fn.length&&fn.push(e)}function dn(e,n,t,a){if(fn.length){var i=fn.pop();return i.topLevelType=e,i.eventSystemFlags=a,i.nativeEvent=n,i.targetInst=t,i}return{topLevelType:e,eventSystemFlags:a,nativeEvent:n,targetInst:t,ancestors:[]}}function gn(e){var n=e.targetInst,t=n;do{if(!t){e.ancestors.push(t);break}var a=t;if(3===a.tag)a=a.stateNode.containerInfo;else{for(;a.return;)a=a.return;a=3!==a.tag?null:a.stateNode.containerInfo}if(!a)break;5!==(n=t.tag)&&6!==n||e.ancestors.push(t),t=Bt(a)}while(t);for(t=0;t<e.ancestors.length;t++){n=e.ancestors[t];var i=ln(e.nativeEvent);a=e.topLevelType;var s=e.nativeEvent,r=e.eventSystemFlags;0===t&&(r|=64);for(var o=null,c=0;c<v.length;c++){var l=v[c];l&&(l=l.extractEvents(a,n,s,i,r))&&(o=an(o,l))}cn(o)}}function mn(e,n,t){if(!t.has(e)){switch(e){case"scroll":Xn(n,"scroll",!0);break;case"focus":case"blur":Xn(n,"focus",!0),Xn(n,"blur",!0),t.set("blur",null),t.set("focus",null);break;case"cancel":case"close":pn(e)&&Xn(n,e,!0);break;case"invalid":case"submit":case"reset":break;default:-1===Ke.indexOf(e)&&$n(e,n)}t.set(e,null)}}var hn,An,kn,yn=!1,bn=[],_n=null,vn=null,wn=null,En=new Map,Cn=new Map,xn=[],Bn="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput close cancel copy cut paste click change contextmenu reset submit".split(" "),Sn="focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture".split(" ");function Tn(e,n,t,a,i){return{blockedOn:e,topLevelType:n,eventSystemFlags:32|t,nativeEvent:i,container:a}}function Pn(e,n){switch(e){case"focus":case"blur":_n=null;break;case"dragenter":case"dragleave":vn=null;break;case"mouseover":case"mouseout":wn=null;break;case"pointerover":case"pointerout":En.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Cn.delete(n.pointerId)}}function Nn(e,n,t,a,i,s){return null===e||e.nativeEvent!==s?(e=Tn(n,t,a,i,s),null!==n&&(null!==(n=St(n))&&An(n)),e):(e.eventSystemFlags|=a,e)}function Mn(e){var n=Bt(e.target);if(null!==n){var t=Je(n);if(null!==t)if(13===(n=t.tag)){if(null!==(n=en(t)))return e.blockedOn=n,void s.unstable_runWithPriority(e.priority,(function(){kn(t)}))}else if(3===n&&t.stateNode.hydrate)return void(e.blockedOn=3===t.tag?t.stateNode.containerInfo:null)}e.blockedOn=null}function qn(e){if(null!==e.blockedOn)return!1;var n=Jn(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);if(null!==n){var t=St(n);return null!==t&&An(t),e.blockedOn=n,!1}return!0}function In(e,n,t){qn(e)&&t.delete(n)}function On(){for(yn=!1;0<bn.length;){var e=bn[0];if(null!==e.blockedOn){null!==(e=St(e.blockedOn))&&hn(e);break}var n=Jn(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);null!==n?e.blockedOn=n:bn.shift()}null!==_n&&qn(_n)&&(_n=null),null!==vn&&qn(vn)&&(vn=null),null!==wn&&qn(wn)&&(wn=null),En.forEach(In),Cn.forEach(In)}function zn(e,n){e.blockedOn===n&&(e.blockedOn=null,yn||(yn=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,On)))}function Ln(e){function n(n){return zn(n,e)}if(0<bn.length){zn(bn[0],e);for(var t=1;t<bn.length;t++){var a=bn[t];a.blockedOn===e&&(a.blockedOn=null)}}for(null!==_n&&zn(_n,e),null!==vn&&zn(vn,e),null!==wn&&zn(wn,e),En.forEach(n),Cn.forEach(n),t=0;t<xn.length;t++)(a=xn[t]).blockedOn===e&&(a.blockedOn=null);for(;0<xn.length&&null===(t=xn[0]).blockedOn;)Mn(t),null===t.blockedOn&&xn.shift()}var Un={},jn=new Map,Dn=new Map,Rn=["abort","abort",Ve,"animationEnd",He,"animationIteration",$e,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Xe,"transitionEnd","waiting","waiting"];function Fn(e,n){for(var t=0;t<e.length;t+=2){var a=e[t],i=e[t+1],s="on"+(i[0].toUpperCase()+i.slice(1));s={phasedRegistrationNames:{bubbled:s,captured:s+"Capture"},dependencies:[a],eventPriority:n},Dn.set(a,n),jn.set(a,s),Un[i]=s}}Fn("blur blur cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focus focus input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),Fn("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),Fn(Rn,2);for(var Yn="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),Qn=0;Qn<Yn.length;Qn++)Dn.set(Yn[Qn],0);var Wn=s.unstable_UserBlockingPriority,Vn=s.unstable_runWithPriority,Hn=!0;function $n(e,n){Xn(n,e,!1)}function Xn(e,n,t){var a=Dn.get(n);switch(void 0===a?2:a){case 0:a=Kn.bind(null,n,1,e);break;case 1:a=Zn.bind(null,n,1,e);break;default:a=Gn.bind(null,n,1,e)}t?e.addEventListener(n,a,!0):e.addEventListener(n,a,!1)}function Kn(e,n,t,a){U||z();var i=Gn,s=U;U=!0;try{O(i,e,n,t,a)}finally{(U=s)||D()}}function Zn(e,n,t,a){Vn(Wn,Gn.bind(null,e,n,t,a))}function Gn(e,n,t,a){if(Hn)if(0<bn.length&&-1<Bn.indexOf(e))e=Tn(null,e,n,t,a),bn.push(e);else{var i=Jn(e,n,t,a);if(null===i)Pn(e,a);else if(-1<Bn.indexOf(e))e=Tn(i,e,n,t,a),bn.push(e);else if(!function(e,n,t,a,i){switch(n){case"focus":return _n=Nn(_n,e,n,t,a,i),!0;case"dragenter":return vn=Nn(vn,e,n,t,a,i),!0;case"mouseover":return wn=Nn(wn,e,n,t,a,i),!0;case"pointerover":var s=i.pointerId;return En.set(s,Nn(En.get(s)||null,e,n,t,a,i)),!0;case"gotpointercapture":return s=i.pointerId,Cn.set(s,Nn(Cn.get(s)||null,e,n,t,a,i)),!0}return!1}(i,e,n,t,a)){Pn(e,a),e=dn(e,a,null,n);try{R(gn,e)}finally{un(e)}}}}function Jn(e,n,t,a){if(null!==(t=Bt(t=ln(a)))){var i=Je(t);if(null===i)t=null;else{var s=i.tag;if(13===s){if(null!==(t=en(i)))return t;t=null}else if(3===s){if(i.stateNode.hydrate)return 3===i.tag?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}e=dn(e,a,t,n);try{R(gn,e)}finally{un(e)}return null}var et={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},nt=["Webkit","ms","Moz","O"];function tt(e,n,t){return null==n||"boolean"==typeof n||""===n?"":t||"number"!=typeof n||0===n||et.hasOwnProperty(e)&&et[e]?(""+n).trim():n+"px"}function at(e,n){for(var t in e=e.style,n)if(n.hasOwnProperty(t)){var a=0===t.indexOf("--"),i=tt(t,n[t],a);"float"===t&&(t="cssFloat"),a?e.setProperty(t,i):e[t]=i}}Object.keys(et).forEach((function(e){nt.forEach((function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),et[n]=et[e]}))}));var it=i({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function st(e,n){if(n){if(it[e]&&(null!=n.children||null!=n.dangerouslySetInnerHTML))throw Error(r(137,e,""));if(null!=n.dangerouslySetInnerHTML){if(null!=n.children)throw Error(r(60));if("object"!=typeof n.dangerouslySetInnerHTML||!("__html"in n.dangerouslySetInnerHTML))throw Error(r(61))}if(null!=n.style&&"object"!=typeof n.style)throw Error(r(62,""))}}function rt(e,n){if(-1===e.indexOf("-"))return"string"==typeof n.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ot=Ie;function ct(e,n){var t=Ge(e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument);n=C[n];for(var a=0;a<n.length;a++)mn(n[a],e,t)}function lt(){}function pt(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(n){return e.body}}function ft(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ut(e,n){var t,a=ft(e);for(e=0;a;){if(3===a.nodeType){if(t=e+a.textContent.length,e<=n&&t>=n)return{node:a,offset:n-e};e=t}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=ft(a)}}function dt(){for(var e=window,n=pt();n instanceof e.HTMLIFrameElement;){try{var t="string"==typeof n.contentWindow.location.href}catch(e){t=!1}if(!t)break;n=pt((e=n.contentWindow).document)}return n}function gt(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&("input"===n&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===n||"true"===e.contentEditable)}var mt=null,ht=null;function At(e,n){switch(e){case"button":case"input":case"select":case"textarea":return!!n.autoFocus}return!1}function kt(e,n){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof n.children||"number"==typeof n.children||"object"==typeof n.dangerouslySetInnerHTML&&null!==n.dangerouslySetInnerHTML&&null!=n.dangerouslySetInnerHTML.__html}var yt="function"==typeof setTimeout?setTimeout:void 0,bt="function"==typeof clearTimeout?clearTimeout:void 0;function _t(e){for(;null!=e;e=e.nextSibling){var n=e.nodeType;if(1===n||3===n)break}return e}function vt(e){e=e.previousSibling;for(var n=0;e;){if(8===e.nodeType){var t=e.data;if("$"===t||"$!"===t||"$?"===t){if(0===n)return e;n--}else"/$"===t&&n++}e=e.previousSibling}return null}var wt=Math.random().toString(36).slice(2),Et="__reactInternalInstance$"+wt,Ct="__reactEventHandlers$"+wt,xt="__reactContainere$"+wt;function Bt(e){var n=e[Et];if(n)return n;for(var t=e.parentNode;t;){if(n=t[xt]||t[Et]){if(t=n.alternate,null!==n.child||null!==t&&null!==t.child)for(e=vt(e);null!==e;){if(t=e[Et])return t;e=vt(e)}return n}t=(e=t).parentNode}return null}function St(e){return!(e=e[Et]||e[xt])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function Tt(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(r(33))}function Pt(e){return e[Ct]||null}function Nt(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function Mt(e,n){var t=e.stateNode;if(!t)return null;var a=g(t);if(!a)return null;t=a[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(a=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!a;break e;default:e=!1}if(e)return null;if(t&&"function"!=typeof t)throw Error(r(231,n,typeof t));return t}function qt(e,n,t){(n=Mt(e,t.dispatchConfig.phasedRegistrationNames[n]))&&(t._dispatchListeners=an(t._dispatchListeners,n),t._dispatchInstances=an(t._dispatchInstances,e))}function It(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var n=e._targetInst,t=[];n;)t.push(n),n=Nt(n);for(n=t.length;0<n--;)qt(t[n],"captured",e);for(n=0;n<t.length;n++)qt(t[n],"bubbled",e)}}function Ot(e,n,t){e&&t&&t.dispatchConfig.registrationName&&(n=Mt(e,t.dispatchConfig.registrationName))&&(t._dispatchListeners=an(t._dispatchListeners,n),t._dispatchInstances=an(t._dispatchInstances,e))}function zt(e){e&&e.dispatchConfig.registrationName&&Ot(e._targetInst,null,e)}function Lt(e){sn(e,It)}var Ut=null,jt=null,Dt=null;function Rt(){if(Dt)return Dt;var e,n,t=jt,a=t.length,i="value"in Ut?Ut.value:Ut.textContent,s=i.length;for(e=0;e<a&&t[e]===i[e];e++);var r=a-e;for(n=1;n<=r&&t[a-n]===i[s-n];n++);return Dt=i.slice(e,1<n?1-n:void 0)}function Ft(){return!0}function Yt(){return!1}function Qt(e,n,t,a){for(var i in this.dispatchConfig=e,this._targetInst=n,this.nativeEvent=t,e=this.constructor.Interface)e.hasOwnProperty(i)&&((n=e[i])?this[i]=n(t):"target"===i?this.target=a:this[i]=t[i]);return this.isDefaultPrevented=(null!=t.defaultPrevented?t.defaultPrevented:!1===t.returnValue)?Ft:Yt,this.isPropagationStopped=Yt,this}function Wt(e,n,t,a){if(this.eventPool.length){var i=this.eventPool.pop();return this.call(i,e,n,t,a),i}return new this(e,n,t,a)}function Vt(e){if(!(e instanceof this))throw Error(r(279));e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function Ht(e){e.eventPool=[],e.getPooled=Wt,e.release=Vt}i(Qt.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Ft)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Ft)},persist:function(){this.isPersistent=Ft},isPersistent:Yt,destructor:function(){var e,n=this.constructor.Interface;for(e in n)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=Yt,this._dispatchInstances=this._dispatchListeners=null}}),Qt.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},Qt.extend=function(e){function n(){}function t(){return a.apply(this,arguments)}var a=this;n.prototype=a.prototype;var s=new n;return i(s,t.prototype),t.prototype=s,t.prototype.constructor=t,t.Interface=i({},a.Interface,e),t.extend=a.extend,Ht(t),t},Ht(Qt);var $t=Qt.extend({data:null}),Xt=Qt.extend({data:null}),Kt=[9,13,27,32],Zt=B&&"CompositionEvent"in window,Gt=null;B&&"documentMode"in document&&(Gt=document.documentMode);var Jt=B&&"TextEvent"in window&&!Gt,ea=B&&(!Zt||Gt&&8<Gt&&11>=Gt),na=String.fromCharCode(32),ta={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},aa=!1;function ia(e,n){switch(e){case"keyup":return-1!==Kt.indexOf(n.keyCode);case"keydown":return 229!==n.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function sa(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var ra=!1;var oa={eventTypes:ta,extractEvents:function(e,n,t,a){var i;if(Zt)e:{switch(e){case"compositionstart":var s=ta.compositionStart;break e;case"compositionend":s=ta.compositionEnd;break e;case"compositionupdate":s=ta.compositionUpdate;break e}s=void 0}else ra?ia(e,t)&&(s=ta.compositionEnd):"keydown"===e&&229===t.keyCode&&(s=ta.compositionStart);return s?(ea&&"ko"!==t.locale&&(ra||s!==ta.compositionStart?s===ta.compositionEnd&&ra&&(i=Rt()):(jt="value"in(Ut=a)?Ut.value:Ut.textContent,ra=!0)),s=$t.getPooled(s,n,t,a),i?s.data=i:null!==(i=sa(t))&&(s.data=i),Lt(s),i=s):i=null,(e=Jt?function(e,n){switch(e){case"compositionend":return sa(n);case"keypress":return 32!==n.which?null:(aa=!0,na);case"textInput":return(e=n.data)===na&&aa?null:e;default:return null}}(e,t):function(e,n){if(ra)return"compositionend"===e||!Zt&&ia(e,n)?(e=Rt(),Dt=jt=Ut=null,ra=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return ea&&"ko"!==n.locale?null:n.data;default:return null}}(e,t))?((n=Xt.getPooled(ta.beforeInput,n,t,a)).data=e,Lt(n)):n=null,null===i?n:null===n?i:[i,n]}},ca={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function la(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===n?!!ca[e.type]:"textarea"===n}var pa={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function fa(e,n,t){return(e=Qt.getPooled(pa.change,e,n,t)).type="change",M(t),Lt(e),e}var ua=null,da=null;function ga(e){cn(e)}function ma(e){if(_e(Tt(e)))return e}function ha(e,n){if("change"===e)return n}var Aa=!1;function ka(){ua&&(ua.detachEvent("onpropertychange",ya),da=ua=null)}function ya(e){if("value"===e.propertyName&&ma(da))if(e=fa(da,e,ln(e)),U)cn(e);else{U=!0;try{I(ga,e)}finally{U=!1,D()}}}function ba(e,n,t){"focus"===e?(ka(),da=t,(ua=n).attachEvent("onpropertychange",ya)):"blur"===e&&ka()}function _a(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return ma(da)}function va(e,n){if("click"===e)return ma(n)}function wa(e,n){if("input"===e||"change"===e)return ma(n)}B&&(Aa=pn("input")&&(!document.documentMode||9<document.documentMode));var Ea={eventTypes:pa,_isInputEventSupported:Aa,extractEvents:function(e,n,t,a){var i=n?Tt(n):window,s=i.nodeName&&i.nodeName.toLowerCase();if("select"===s||"input"===s&&"file"===i.type)var r=ha;else if(la(i))if(Aa)r=wa;else{r=_a;var o=ba}else(s=i.nodeName)&&"input"===s.toLowerCase()&&("checkbox"===i.type||"radio"===i.type)&&(r=va);if(r&&(r=r(e,n)))return fa(r,t,a);o&&o(e,i,n),"blur"===e&&(e=i._wrapperState)&&e.controlled&&"number"===i.type&&Be(i,"number",i.value)}},Ca=Qt.extend({view:null,detail:null}),xa={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ba(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):!!(e=xa[e])&&!!n[e]}function Sa(){return Ba}var Ta=0,Pa=0,Na=!1,Ma=!1,qa=Ca.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:Sa,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},movementX:function(e){if("movementX"in e)return e.movementX;var n=Ta;return Ta=e.screenX,Na?"mousemove"===e.type?e.screenX-n:0:(Na=!0,0)},movementY:function(e){if("movementY"in e)return e.movementY;var n=Pa;return Pa=e.screenY,Ma?"mousemove"===e.type?e.screenY-n:0:(Ma=!0,0)}}),Ia=qa.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),Oa={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",dependencies:["pointerout","pointerover"]}},za={eventTypes:Oa,extractEvents:function(e,n,t,a,i){var s="mouseover"===e||"pointerover"===e,r="mouseout"===e||"pointerout"===e;if(s&&0==(32&i)&&(t.relatedTarget||t.fromElement)||!r&&!s)return null;(s=a.window===a?a:(s=a.ownerDocument)?s.defaultView||s.parentWindow:window,r)?(r=n,null!==(n=(n=t.relatedTarget||t.toElement)?Bt(n):null)&&(n!==Je(n)||5!==n.tag&&6!==n.tag)&&(n=null)):r=null;if(r===n)return null;if("mouseout"===e||"mouseover"===e)var o=qa,c=Oa.mouseLeave,l=Oa.mouseEnter,p="mouse";else"pointerout"!==e&&"pointerover"!==e||(o=Ia,c=Oa.pointerLeave,l=Oa.pointerEnter,p="pointer");if(e=null==r?s:Tt(r),s=null==n?s:Tt(n),(c=o.getPooled(c,r,t,a)).type=p+"leave",c.target=e,c.relatedTarget=s,(t=o.getPooled(l,n,t,a)).type=p+"enter",t.target=s,t.relatedTarget=e,p=n,(a=r)&&p)e:{for(l=p,r=0,e=o=a;e;e=Nt(e))r++;for(e=0,n=l;n;n=Nt(n))e++;for(;0<r-e;)o=Nt(o),r--;for(;0<e-r;)l=Nt(l),e--;for(;r--;){if(o===l||o===l.alternate)break e;o=Nt(o),l=Nt(l)}o=null}else o=null;for(l=o,o=[];a&&a!==l&&(null===(r=a.alternate)||r!==l);)o.push(a),a=Nt(a);for(a=[];p&&p!==l&&(null===(r=p.alternate)||r!==l);)a.push(p),p=Nt(p);for(p=0;p<o.length;p++)Ot(o[p],"bubbled",c);for(p=a.length;0<p--;)Ot(a[p],"captured",t);return 0==(64&i)?[c]:[c,t]}};var La="function"==typeof Object.is?Object.is:function(e,n){return e===n&&(0!==e||1/e==1/n)||e!=e&&n!=n},Ua=Object.prototype.hasOwnProperty;function ja(e,n){if(La(e,n))return!0;if("object"!=typeof e||null===e||"object"!=typeof n||null===n)return!1;var t=Object.keys(e),a=Object.keys(n);if(t.length!==a.length)return!1;for(a=0;a<t.length;a++)if(!Ua.call(n,t[a])||!La(e[t[a]],n[t[a]]))return!1;return!0}var Da=B&&"documentMode"in document&&11>=document.documentMode,Ra={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Fa=null,Ya=null,Qa=null,Wa=!1;function Va(e,n){var t=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;return Wa||null==Fa||Fa!==pt(t)?null:("selectionStart"in(t=Fa)&>(t)?t={start:t.selectionStart,end:t.selectionEnd}:t={anchorNode:(t=(t.ownerDocument&&t.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:t.anchorOffset,focusNode:t.focusNode,focusOffset:t.focusOffset},Qa&&ja(Qa,t)?null:(Qa=t,(e=Qt.getPooled(Ra.select,Ya,e,n)).type="select",e.target=Fa,Lt(e),e))}var Ha={eventTypes:Ra,extractEvents:function(e,n,t,a,i,s){if(!(s=!(i=s||(a.window===a?a.document:9===a.nodeType?a:a.ownerDocument)))){e:{i=Ge(i),s=C.onSelect;for(var r=0;r<s.length;r++)if(!i.has(s[r])){i=!1;break e}i=!0}s=!i}if(s)return null;switch(i=n?Tt(n):window,e){case"focus":(la(i)||"true"===i.contentEditable)&&(Fa=i,Ya=n,Qa=null);break;case"blur":Qa=Ya=Fa=null;break;case"mousedown":Wa=!0;break;case"contextmenu":case"mouseup":case"dragend":return Wa=!1,Va(t,a);case"selectionchange":if(Da)break;case"keydown":case"keyup":return Va(t,a)}return null}},$a=Qt.extend({animationName:null,elapsedTime:null,pseudoElement:null}),Xa=Qt.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ka=Ca.extend({relatedTarget:null});function Za(e){var n=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===n&&(e=13):e=n,10===e&&(e=13),32<=e||13===e?e:0}var Ga={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ja={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ei=Ca.extend({key:function(e){if(e.key){var n=Ga[e.key]||e.key;if("Unidentified"!==n)return n}return"keypress"===e.type?13===(e=Za(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Ja[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:Sa,charCode:function(e){return"keypress"===e.type?Za(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Za(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),ni=qa.extend({dataTransfer:null}),ti=Ca.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:Sa}),ai=Qt.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),ii=qa.extend({deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),si={eventTypes:Un,extractEvents:function(e,n,t,a){var i=jn.get(e);if(!i)return null;switch(e){case"keypress":if(0===Za(t))return null;case"keydown":case"keyup":e=ei;break;case"blur":case"focus":e=Ka;break;case"click":if(2===t.button)return null;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":e=qa;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":e=ni;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":e=ti;break;case Ve:case He:case $e:e=$a;break;case Xe:e=ai;break;case"scroll":e=Ca;break;case"wheel":e=ii;break;case"copy":case"cut":case"paste":e=Xa;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":e=Ia;break;default:e=Qt}return Lt(n=e.getPooled(i,n,t,a)),n}};if(k)throw Error(r(101));k=Array.prototype.slice.call("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),b(),g=Pt,m=St,h=Tt,x({SimpleEventPlugin:si,EnterLeaveEventPlugin:za,ChangeEventPlugin:Ea,SelectEventPlugin:Ha,BeforeInputEventPlugin:oa});var ri=[],oi=-1;function ci(e){0>oi||(e.current=ri[oi],ri[oi]=null,oi--)}function li(e,n){oi++,ri[oi]=e.current,e.current=n}var pi={},fi={current:pi},ui={current:!1},di=pi;function gi(e,n){var t=e.type.contextTypes;if(!t)return pi;var a=e.stateNode;if(a&&a.__reactInternalMemoizedUnmaskedChildContext===n)return a.__reactInternalMemoizedMaskedChildContext;var i,s={};for(i in t)s[i]=n[i];return a&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=s),s}function mi(e){return null!=(e=e.childContextTypes)}function hi(){ci(ui),ci(fi)}function Ai(e,n,t){if(fi.current!==pi)throw Error(r(168));li(fi,n),li(ui,t)}function ki(e,n,t){var a=e.stateNode;if(e=n.childContextTypes,"function"!=typeof a.getChildContext)return t;for(var s in a=a.getChildContext())if(!(s in e))throw Error(r(108,he(n)||"Unknown",s));return i({},t,{},a)}function yi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||pi,di=fi.current,li(fi,e),li(ui,ui.current),!0}function bi(e,n,t){var a=e.stateNode;if(!a)throw Error(r(169));t?(e=ki(e,n,di),a.__reactInternalMemoizedMergedChildContext=e,ci(ui),ci(fi),li(fi,e)):ci(ui),li(ui,t)}var _i=s.unstable_runWithPriority,vi=s.unstable_scheduleCallback,wi=s.unstable_cancelCallback,Ei=s.unstable_requestPaint,Ci=s.unstable_now,xi=s.unstable_getCurrentPriorityLevel,Bi=s.unstable_ImmediatePriority,Si=s.unstable_UserBlockingPriority,Ti=s.unstable_NormalPriority,Pi=s.unstable_LowPriority,Ni=s.unstable_IdlePriority,Mi={},qi=s.unstable_shouldYield,Ii=void 0!==Ei?Ei:function(){},Oi=null,zi=null,Li=!1,Ui=Ci(),ji=1e4>Ui?Ci:function(){return Ci()-Ui};function Di(){switch(xi()){case Bi:return 99;case Si:return 98;case Ti:return 97;case Pi:return 96;case Ni:return 95;default:throw Error(r(332))}}function Ri(e){switch(e){case 99:return Bi;case 98:return Si;case 97:return Ti;case 96:return Pi;case 95:return Ni;default:throw Error(r(332))}}function Fi(e,n){return e=Ri(e),_i(e,n)}function Yi(e,n,t){return e=Ri(e),vi(e,n,t)}function Qi(e){return null===Oi?(Oi=[e],zi=vi(Bi,Vi)):Oi.push(e),Mi}function Wi(){if(null!==zi){var e=zi;zi=null,wi(e)}Vi()}function Vi(){if(!Li&&null!==Oi){Li=!0;var e=0;try{var n=Oi;Fi(99,(function(){for(;e<n.length;e++){var t=n[e];do{t=t(!0)}while(null!==t)}})),Oi=null}catch(n){throw null!==Oi&&(Oi=Oi.slice(e+1)),vi(Bi,Wi),n}finally{Li=!1}}}function Hi(e,n,t){return 1073741821-(1+((1073741821-e+n/10)/(t/=10)|0))*t}function $i(e,n){if(e&&e.defaultProps)for(var t in n=i({},n),e=e.defaultProps)void 0===n[t]&&(n[t]=e[t]);return n}var Xi={current:null},Ki=null,Zi=null,Gi=null;function Ji(){Gi=Zi=Ki=null}function es(e){var n=Xi.current;ci(Xi),e.type._context._currentValue=n}function ns(e,n){for(;null!==e;){var t=e.alternate;if(e.childExpirationTime<n)e.childExpirationTime=n,null!==t&&t.childExpirationTime<n&&(t.childExpirationTime=n);else{if(!(null!==t&&t.childExpirationTime<n))break;t.childExpirationTime=n}e=e.return}}function ts(e,n){Ki=e,Gi=Zi=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(e.expirationTime>=n&&(Tr=!0),e.firstContext=null)}function as(e,n){if(Gi!==e&&!1!==n&&0!==n)if("number"==typeof n&&1073741823!==n||(Gi=e,n=1073741823),n={context:e,observedBits:n,next:null},null===Zi){if(null===Ki)throw Error(r(308));Zi=n,Ki.dependencies={expirationTime:0,firstContext:n,responders:null}}else Zi=Zi.next=n;return e._currentValue}var is=!1;function ss(e){e.updateQueue={baseState:e.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function rs(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,baseQueue:e.baseQueue,shared:e.shared,effects:e.effects})}function os(e,n){return(e={expirationTime:e,suspenseConfig:n,tag:0,payload:null,callback:null,next:null}).next=e}function cs(e,n){if(null!==(e=e.updateQueue)){var t=(e=e.shared).pending;null===t?n.next=n:(n.next=t.next,t.next=n),e.pending=n}}function ls(e,n){var t=e.alternate;null!==t&&rs(t,e),null===(t=(e=e.updateQueue).baseQueue)?(e.baseQueue=n.next=n,n.next=n):(n.next=t.next,t.next=n)}function ps(e,n,t,a){var s=e.updateQueue;is=!1;var r=s.baseQueue,o=s.shared.pending;if(null!==o){if(null!==r){var c=r.next;r.next=o.next,o.next=c}r=o,s.shared.pending=null,null!==(c=e.alternate)&&(null!==(c=c.updateQueue)&&(c.baseQueue=o))}if(null!==r){c=r.next;var l=s.baseState,p=0,f=null,u=null,d=null;if(null!==c)for(var g=c;;){if((o=g.expirationTime)<a){var m={expirationTime:g.expirationTime,suspenseConfig:g.suspenseConfig,tag:g.tag,payload:g.payload,callback:g.callback,next:null};null===d?(u=d=m,f=l):d=d.next=m,o>p&&(p=o)}else{null!==d&&(d=d.next={expirationTime:1073741823,suspenseConfig:g.suspenseConfig,tag:g.tag,payload:g.payload,callback:g.callback,next:null}),sc(o,g.suspenseConfig);e:{var h=e,A=g;switch(o=n,m=t,A.tag){case 1:if("function"==typeof(h=A.payload)){l=h.call(m,l,o);break e}l=h;break e;case 3:h.effectTag=-4097&h.effectTag|64;case 0:if(null==(o="function"==typeof(h=A.payload)?h.call(m,l,o):h))break e;l=i({},l,o);break e;case 2:is=!0}}null!==g.callback&&(e.effectTag|=32,null===(o=s.effects)?s.effects=[g]:o.push(g))}if(null===(g=g.next)||g===c){if(null===(o=s.shared.pending))break;g=r.next=o.next,o.next=c,s.baseQueue=r=o,s.shared.pending=null}}null===d?f=l:d.next=u,s.baseState=f,s.baseQueue=d,rc(p),e.expirationTime=p,e.memoizedState=l}}function fs(e,n,t){if(e=n.effects,n.effects=null,null!==e)for(n=0;n<e.length;n++){var a=e[n],i=a.callback;if(null!==i){if(a.callback=null,a=i,i=t,"function"!=typeof a)throw Error(r(191,a));a.call(i)}}}var us=K.ReactCurrentBatchConfig,ds=(new a.Component).refs;function gs(e,n,t,a){t=null==(t=t(a,n=e.memoizedState))?n:i({},n,t),e.memoizedState=t,0===e.expirationTime&&(e.updateQueue.baseState=t)}var ms={isMounted:function(e){return!!(e=e._reactInternalFiber)&&Je(e)===e},enqueueSetState:function(e,n,t){e=e._reactInternalFiber;var a=Vo(),i=us.suspense;(i=os(a=Ho(a,e,i),i)).payload=n,null!=t&&(i.callback=t),cs(e,i),$o(e,a)},enqueueReplaceState:function(e,n,t){e=e._reactInternalFiber;var a=Vo(),i=us.suspense;(i=os(a=Ho(a,e,i),i)).tag=1,i.payload=n,null!=t&&(i.callback=t),cs(e,i),$o(e,a)},enqueueForceUpdate:function(e,n){e=e._reactInternalFiber;var t=Vo(),a=us.suspense;(a=os(t=Ho(t,e,a),a)).tag=2,null!=n&&(a.callback=n),cs(e,a),$o(e,t)}};function hs(e,n,t,a,i,s,r){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(a,s,r):!n.prototype||!n.prototype.isPureReactComponent||(!ja(t,a)||!ja(i,s))}function As(e,n,t){var a=!1,i=pi,s=n.contextType;return"object"==typeof s&&null!==s?s=as(s):(i=mi(n)?di:fi.current,s=(a=null!=(a=n.contextTypes))?gi(e,i):pi),n=new n(t,s),e.memoizedState=null!==n.state&&void 0!==n.state?n.state:null,n.updater=ms,e.stateNode=n,n._reactInternalFiber=e,a&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),n}function ks(e,n,t,a){e=n.state,"function"==typeof n.componentWillReceiveProps&&n.componentWillReceiveProps(t,a),"function"==typeof n.UNSAFE_componentWillReceiveProps&&n.UNSAFE_componentWillReceiveProps(t,a),n.state!==e&&ms.enqueueReplaceState(n,n.state,null)}function ys(e,n,t,a){var i=e.stateNode;i.props=t,i.state=e.memoizedState,i.refs=ds,ss(e);var s=n.contextType;"object"==typeof s&&null!==s?i.context=as(s):(s=mi(n)?di:fi.current,i.context=gi(e,s)),ps(e,t,i,a),i.state=e.memoizedState,"function"==typeof(s=n.getDerivedStateFromProps)&&(gs(e,n,s,t),i.state=e.memoizedState),"function"==typeof n.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(n=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),n!==i.state&&ms.enqueueReplaceState(i,i.state,null),ps(e,t,i,a),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.effectTag|=4)}var bs=Array.isArray;function _s(e,n,t){if(null!==(e=t.ref)&&"function"!=typeof e&&"object"!=typeof e){if(t._owner){if(t=t._owner){if(1!==t.tag)throw Error(r(309));var a=t.stateNode}if(!a)throw Error(r(147,e));var i=""+e;return null!==n&&null!==n.ref&&"function"==typeof n.ref&&n.ref._stringRef===i?n.ref:((n=function(e){var n=a.refs;n===ds&&(n=a.refs={}),null===e?delete n[i]:n[i]=e})._stringRef=i,n)}if("string"!=typeof e)throw Error(r(284));if(!t._owner)throw Error(r(290,e))}return e}function vs(e,n){if("textarea"!==e.type)throw Error(r(31,"[object Object]"===Object.prototype.toString.call(n)?"object with keys {"+Object.keys(n).join(", ")+"}":n,""))}function ws(e){function n(n,t){if(e){var a=n.lastEffect;null!==a?(a.nextEffect=t,n.lastEffect=t):n.firstEffect=n.lastEffect=t,t.nextEffect=null,t.effectTag=8}}function t(t,a){if(!e)return null;for(;null!==a;)n(t,a),a=a.sibling;return null}function a(e,n){for(e=new Map;null!==n;)null!==n.key?e.set(n.key,n):e.set(n.index,n),n=n.sibling;return e}function i(e,n){return(e=xc(e,n)).index=0,e.sibling=null,e}function s(n,t,a){return n.index=a,e?null!==(a=n.alternate)?(a=a.index)<t?(n.effectTag=2,t):a:(n.effectTag=2,t):t}function o(n){return e&&null===n.alternate&&(n.effectTag=2),n}function c(e,n,t,a){return null===n||6!==n.tag?((n=Tc(t,e.mode,a)).return=e,n):((n=i(n,t)).return=e,n)}function l(e,n,t,a){return null!==n&&n.elementType===t.type?((a=i(n,t.props)).ref=_s(e,n,t),a.return=e,a):((a=Bc(t.type,t.key,t.props,null,e.mode,a)).ref=_s(e,n,t),a.return=e,a)}function p(e,n,t,a){return null===n||4!==n.tag||n.stateNode.containerInfo!==t.containerInfo||n.stateNode.implementation!==t.implementation?((n=Pc(t,e.mode,a)).return=e,n):((n=i(n,t.children||[])).return=e,n)}function f(e,n,t,a,s){return null===n||7!==n.tag?((n=Sc(t,e.mode,a,s)).return=e,n):((n=i(n,t)).return=e,n)}function u(e,n,t){if("string"==typeof n||"number"==typeof n)return(n=Tc(""+n,e.mode,t)).return=e,n;if("object"==typeof n&&null!==n){switch(n.$$typeof){case ee:return(t=Bc(n.type,n.key,n.props,null,e.mode,t)).ref=_s(e,null,n),t.return=e,t;case ne:return(n=Pc(n,e.mode,t)).return=e,n}if(bs(n)||me(n))return(n=Sc(n,e.mode,t,null)).return=e,n;vs(e,n)}return null}function d(e,n,t,a){var i=null!==n?n.key:null;if("string"==typeof t||"number"==typeof t)return null!==i?null:c(e,n,""+t,a);if("object"==typeof t&&null!==t){switch(t.$$typeof){case ee:return t.key===i?t.type===te?f(e,n,t.props.children,a,i):l(e,n,t,a):null;case ne:return t.key===i?p(e,n,t,a):null}if(bs(t)||me(t))return null!==i?null:f(e,n,t,a,null);vs(e,t)}return null}function g(e,n,t,a,i){if("string"==typeof a||"number"==typeof a)return c(n,e=e.get(t)||null,""+a,i);if("object"==typeof a&&null!==a){switch(a.$$typeof){case ee:return e=e.get(null===a.key?t:a.key)||null,a.type===te?f(n,e,a.props.children,i,a.key):l(n,e,a,i);case ne:return p(n,e=e.get(null===a.key?t:a.key)||null,a,i)}if(bs(a)||me(a))return f(n,e=e.get(t)||null,a,i,null);vs(n,a)}return null}function m(i,r,o,c){for(var l=null,p=null,f=r,m=r=0,h=null;null!==f&&m<o.length;m++){f.index>m?(h=f,f=null):h=f.sibling;var A=d(i,f,o[m],c);if(null===A){null===f&&(f=h);break}e&&f&&null===A.alternate&&n(i,f),r=s(A,r,m),null===p?l=A:p.sibling=A,p=A,f=h}if(m===o.length)return t(i,f),l;if(null===f){for(;m<o.length;m++)null!==(f=u(i,o[m],c))&&(r=s(f,r,m),null===p?l=f:p.sibling=f,p=f);return l}for(f=a(i,f);m<o.length;m++)null!==(h=g(f,i,m,o[m],c))&&(e&&null!==h.alternate&&f.delete(null===h.key?m:h.key),r=s(h,r,m),null===p?l=h:p.sibling=h,p=h);return e&&f.forEach((function(e){return n(i,e)})),l}function h(i,o,c,l){var p=me(c);if("function"!=typeof p)throw Error(r(150));if(null==(c=p.call(c)))throw Error(r(151));for(var f=p=null,m=o,h=o=0,A=null,k=c.next();null!==m&&!k.done;h++,k=c.next()){m.index>h?(A=m,m=null):A=m.sibling;var y=d(i,m,k.value,l);if(null===y){null===m&&(m=A);break}e&&m&&null===y.alternate&&n(i,m),o=s(y,o,h),null===f?p=y:f.sibling=y,f=y,m=A}if(k.done)return t(i,m),p;if(null===m){for(;!k.done;h++,k=c.next())null!==(k=u(i,k.value,l))&&(o=s(k,o,h),null===f?p=k:f.sibling=k,f=k);return p}for(m=a(i,m);!k.done;h++,k=c.next())null!==(k=g(m,i,h,k.value,l))&&(e&&null!==k.alternate&&m.delete(null===k.key?h:k.key),o=s(k,o,h),null===f?p=k:f.sibling=k,f=k);return e&&m.forEach((function(e){return n(i,e)})),p}return function(e,a,s,c){var l="object"==typeof s&&null!==s&&s.type===te&&null===s.key;l&&(s=s.props.children);var p="object"==typeof s&&null!==s;if(p)switch(s.$$typeof){case ee:e:{for(p=s.key,l=a;null!==l;){if(l.key===p){switch(l.tag){case 7:if(s.type===te){t(e,l.sibling),(a=i(l,s.props.children)).return=e,e=a;break e}break;default:if(l.elementType===s.type){t(e,l.sibling),(a=i(l,s.props)).ref=_s(e,l,s),a.return=e,e=a;break e}}t(e,l);break}n(e,l),l=l.sibling}s.type===te?((a=Sc(s.props.children,e.mode,c,s.key)).return=e,e=a):((c=Bc(s.type,s.key,s.props,null,e.mode,c)).ref=_s(e,a,s),c.return=e,e=c)}return o(e);case ne:e:{for(l=s.key;null!==a;){if(a.key===l){if(4===a.tag&&a.stateNode.containerInfo===s.containerInfo&&a.stateNode.implementation===s.implementation){t(e,a.sibling),(a=i(a,s.children||[])).return=e,e=a;break e}t(e,a);break}n(e,a),a=a.sibling}(a=Pc(s,e.mode,c)).return=e,e=a}return o(e)}if("string"==typeof s||"number"==typeof s)return s=""+s,null!==a&&6===a.tag?(t(e,a.sibling),(a=i(a,s)).return=e,e=a):(t(e,a),(a=Tc(s,e.mode,c)).return=e,e=a),o(e);if(bs(s))return m(e,a,s,c);if(me(s))return h(e,a,s,c);if(p&&vs(e,s),void 0===s&&!l)switch(e.tag){case 1:case 0:throw e=e.type,Error(r(152,e.displayName||e.name||"Component"))}return t(e,a)}}var Es=ws(!0),Cs=ws(!1),xs={},Bs={current:xs},Ss={current:xs},Ts={current:xs};function Ps(e){if(e===xs)throw Error(r(174));return e}function Ns(e,n){switch(li(Ts,n),li(Ss,e),li(Bs,xs),e=n.nodeType){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:Le(null,"");break;default:n=Le(n=(e=8===e?n.parentNode:n).namespaceURI||null,e=e.tagName)}ci(Bs),li(Bs,n)}function Ms(){ci(Bs),ci(Ss),ci(Ts)}function qs(e){Ps(Ts.current);var n=Ps(Bs.current),t=Le(n,e.type);n!==t&&(li(Ss,e),li(Bs,t))}function Is(e){Ss.current===e&&(ci(Bs),ci(Ss))}var Os={current:0};function zs(e){for(var n=e;null!==n;){if(13===n.tag){var t=n.memoizedState;if(null!==t&&(null===(t=t.dehydrated)||"$?"===t.data||"$!"===t.data))return n}else if(19===n.tag&&void 0!==n.memoizedProps.revealOrder){if(0!=(64&n.effectTag))return n}else if(null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}function Ls(e,n){return{responder:e,props:n}}var Us=K.ReactCurrentDispatcher,js=K.ReactCurrentBatchConfig,Ds=0,Rs=null,Fs=null,Ys=null,Qs=!1;function Ws(){throw Error(r(321))}function Vs(e,n){if(null===n)return!1;for(var t=0;t<n.length&&t<e.length;t++)if(!La(e[t],n[t]))return!1;return!0}function Hs(e,n,t,a,i,s){if(Ds=s,Rs=n,n.memoizedState=null,n.updateQueue=null,n.expirationTime=0,Us.current=null===e||null===e.memoizedState?hr:Ar,e=t(a,i),n.expirationTime===Ds){s=0;do{if(n.expirationTime=0,!(25>s))throw Error(r(301));s+=1,Ys=Fs=null,n.updateQueue=null,Us.current=kr,e=t(a,i)}while(n.expirationTime===Ds)}if(Us.current=mr,n=null!==Fs&&null!==Fs.next,Ds=0,Ys=Fs=Rs=null,Qs=!1,n)throw Error(r(300));return e}function $s(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Ys?Rs.memoizedState=Ys=e:Ys=Ys.next=e,Ys}function Xs(){if(null===Fs){var e=Rs.alternate;e=null!==e?e.memoizedState:null}else e=Fs.next;var n=null===Ys?Rs.memoizedState:Ys.next;if(null!==n)Ys=n,Fs=e;else{if(null===e)throw Error(r(310));e={memoizedState:(Fs=e).memoizedState,baseState:Fs.baseState,baseQueue:Fs.baseQueue,queue:Fs.queue,next:null},null===Ys?Rs.memoizedState=Ys=e:Ys=Ys.next=e}return Ys}function Ks(e,n){return"function"==typeof n?n(e):n}function Zs(e){var n=Xs(),t=n.queue;if(null===t)throw Error(r(311));t.lastRenderedReducer=e;var a=Fs,i=a.baseQueue,s=t.pending;if(null!==s){if(null!==i){var o=i.next;i.next=s.next,s.next=o}a.baseQueue=i=s,t.pending=null}if(null!==i){i=i.next,a=a.baseState;var c=o=s=null,l=i;do{var p=l.expirationTime;if(p<Ds){var f={expirationTime:l.expirationTime,suspenseConfig:l.suspenseConfig,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null};null===c?(o=c=f,s=a):c=c.next=f,p>Rs.expirationTime&&(Rs.expirationTime=p,rc(p))}else null!==c&&(c=c.next={expirationTime:1073741823,suspenseConfig:l.suspenseConfig,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null}),sc(p,l.suspenseConfig),a=l.eagerReducer===e?l.eagerState:e(a,l.action);l=l.next}while(null!==l&&l!==i);null===c?s=a:c.next=o,La(a,n.memoizedState)||(Tr=!0),n.memoizedState=a,n.baseState=s,n.baseQueue=c,t.lastRenderedState=a}return[n.memoizedState,t.dispatch]}function Gs(e){var n=Xs(),t=n.queue;if(null===t)throw Error(r(311));t.lastRenderedReducer=e;var a=t.dispatch,i=t.pending,s=n.memoizedState;if(null!==i){t.pending=null;var o=i=i.next;do{s=e(s,o.action),o=o.next}while(o!==i);La(s,n.memoizedState)||(Tr=!0),n.memoizedState=s,null===n.baseQueue&&(n.baseState=s),t.lastRenderedState=s}return[s,a]}function Js(e){var n=$s();return"function"==typeof e&&(e=e()),n.memoizedState=n.baseState=e,e=(e=n.queue={pending:null,dispatch:null,lastRenderedReducer:Ks,lastRenderedState:e}).dispatch=gr.bind(null,Rs,e),[n.memoizedState,e]}function er(e,n,t,a){return e={tag:e,create:n,destroy:t,deps:a,next:null},null===(n=Rs.updateQueue)?(n={lastEffect:null},Rs.updateQueue=n,n.lastEffect=e.next=e):null===(t=n.lastEffect)?n.lastEffect=e.next=e:(a=t.next,t.next=e,e.next=a,n.lastEffect=e),e}function nr(){return Xs().memoizedState}function tr(e,n,t,a){var i=$s();Rs.effectTag|=e,i.memoizedState=er(1|n,t,void 0,void 0===a?null:a)}function ar(e,n,t,a){var i=Xs();a=void 0===a?null:a;var s=void 0;if(null!==Fs){var r=Fs.memoizedState;if(s=r.destroy,null!==a&&Vs(a,r.deps))return void er(n,t,s,a)}Rs.effectTag|=e,i.memoizedState=er(1|n,t,s,a)}function ir(e,n){return tr(516,4,e,n)}function sr(e,n){return ar(516,4,e,n)}function rr(e,n){return ar(4,2,e,n)}function or(e,n){return"function"==typeof n?(e=e(),n(e),function(){n(null)}):null!=n?(e=e(),n.current=e,function(){n.current=null}):void 0}function cr(e,n,t){return t=null!=t?t.concat([e]):null,ar(4,2,or.bind(null,n,e),t)}function lr(){}function pr(e,n){return $s().memoizedState=[e,void 0===n?null:n],e}function fr(e,n){var t=Xs();n=void 0===n?null:n;var a=t.memoizedState;return null!==a&&null!==n&&Vs(n,a[1])?a[0]:(t.memoizedState=[e,n],e)}function ur(e,n){var t=Xs();n=void 0===n?null:n;var a=t.memoizedState;return null!==a&&null!==n&&Vs(n,a[1])?a[0]:(e=e(),t.memoizedState=[e,n],e)}function dr(e,n,t){var a=Di();Fi(98>a?98:a,(function(){e(!0)})),Fi(97<a?97:a,(function(){var a=js.suspense;js.suspense=void 0===n?null:n;try{e(!1),t()}finally{js.suspense=a}}))}function gr(e,n,t){var a=Vo(),i=us.suspense;i={expirationTime:a=Ho(a,e,i),suspenseConfig:i,action:t,eagerReducer:null,eagerState:null,next:null};var s=n.pending;if(null===s?i.next=i:(i.next=s.next,s.next=i),n.pending=i,s=e.alternate,e===Rs||null!==s&&s===Rs)Qs=!0,i.expirationTime=Ds,Rs.expirationTime=Ds;else{if(0===e.expirationTime&&(null===s||0===s.expirationTime)&&null!==(s=n.lastRenderedReducer))try{var r=n.lastRenderedState,o=s(r,t);if(i.eagerReducer=s,i.eagerState=o,La(o,r))return}catch(e){}$o(e,a)}}var mr={readContext:as,useCallback:Ws,useContext:Ws,useEffect:Ws,useImperativeHandle:Ws,useLayoutEffect:Ws,useMemo:Ws,useReducer:Ws,useRef:Ws,useState:Ws,useDebugValue:Ws,useResponder:Ws,useDeferredValue:Ws,useTransition:Ws},hr={readContext:as,useCallback:pr,useContext:as,useEffect:ir,useImperativeHandle:function(e,n,t){return t=null!=t?t.concat([e]):null,tr(4,2,or.bind(null,n,e),t)},useLayoutEffect:function(e,n){return tr(4,2,e,n)},useMemo:function(e,n){var t=$s();return n=void 0===n?null:n,e=e(),t.memoizedState=[e,n],e},useReducer:function(e,n,t){var a=$s();return n=void 0!==t?t(n):n,a.memoizedState=a.baseState=n,e=(e=a.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:n}).dispatch=gr.bind(null,Rs,e),[a.memoizedState,e]},useRef:function(e){return e={current:e},$s().memoizedState=e},useState:Js,useDebugValue:lr,useResponder:Ls,useDeferredValue:function(e,n){var t=Js(e),a=t[0],i=t[1];return ir((function(){var t=js.suspense;js.suspense=void 0===n?null:n;try{i(e)}finally{js.suspense=t}}),[e,n]),a},useTransition:function(e){var n=Js(!1),t=n[0];return n=n[1],[pr(dr.bind(null,n,e),[n,e]),t]}},Ar={readContext:as,useCallback:fr,useContext:as,useEffect:sr,useImperativeHandle:cr,useLayoutEffect:rr,useMemo:ur,useReducer:Zs,useRef:nr,useState:function(){return Zs(Ks)},useDebugValue:lr,useResponder:Ls,useDeferredValue:function(e,n){var t=Zs(Ks),a=t[0],i=t[1];return sr((function(){var t=js.suspense;js.suspense=void 0===n?null:n;try{i(e)}finally{js.suspense=t}}),[e,n]),a},useTransition:function(e){var n=Zs(Ks),t=n[0];return n=n[1],[fr(dr.bind(null,n,e),[n,e]),t]}},kr={readContext:as,useCallback:fr,useContext:as,useEffect:sr,useImperativeHandle:cr,useLayoutEffect:rr,useMemo:ur,useReducer:Gs,useRef:nr,useState:function(){return Gs(Ks)},useDebugValue:lr,useResponder:Ls,useDeferredValue:function(e,n){var t=Gs(Ks),a=t[0],i=t[1];return sr((function(){var t=js.suspense;js.suspense=void 0===n?null:n;try{i(e)}finally{js.suspense=t}}),[e,n]),a},useTransition:function(e){var n=Gs(Ks),t=n[0];return n=n[1],[fr(dr.bind(null,n,e),[n,e]),t]}},yr=null,br=null,_r=!1;function vr(e,n){var t=Ec(5,null,null,0);t.elementType="DELETED",t.type="DELETED",t.stateNode=n,t.return=e,t.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=t,e.lastEffect=t):e.firstEffect=e.lastEffect=t}function wr(e,n){switch(e.tag){case 5:var t=e.type;return null!==(n=1!==n.nodeType||t.toLowerCase()!==n.nodeName.toLowerCase()?null:n)&&(e.stateNode=n,!0);case 6:return null!==(n=""===e.pendingProps||3!==n.nodeType?null:n)&&(e.stateNode=n,!0);case 13:default:return!1}}function Er(e){if(_r){var n=br;if(n){var t=n;if(!wr(e,n)){if(!(n=_t(t.nextSibling))||!wr(e,n))return e.effectTag=-1025&e.effectTag|2,_r=!1,void(yr=e);vr(yr,t)}yr=e,br=_t(n.firstChild)}else e.effectTag=-1025&e.effectTag|2,_r=!1,yr=e}}function Cr(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;yr=e}function xr(e){if(e!==yr)return!1;if(!_r)return Cr(e),_r=!0,!1;var n=e.type;if(5!==e.tag||"head"!==n&&"body"!==n&&!kt(n,e.memoizedProps))for(n=br;n;)vr(e,n),n=_t(n.nextSibling);if(Cr(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(r(317));e:{for(e=e.nextSibling,n=0;e;){if(8===e.nodeType){var t=e.data;if("/$"===t){if(0===n){br=_t(e.nextSibling);break e}n--}else"$"!==t&&"$!"!==t&&"$?"!==t||n++}e=e.nextSibling}br=null}}else br=yr?_t(e.stateNode.nextSibling):null;return!0}function Br(){br=yr=null,_r=!1}var Sr=K.ReactCurrentOwner,Tr=!1;function Pr(e,n,t,a){n.child=null===e?Cs(n,null,t,a):Es(n,e.child,t,a)}function Nr(e,n,t,a,i){t=t.render;var s=n.ref;return ts(n,i),a=Hs(e,n,t,a,s,i),null===e||Tr?(n.effectTag|=1,Pr(e,n,a,i),n.child):(n.updateQueue=e.updateQueue,n.effectTag&=-517,e.expirationTime<=i&&(e.expirationTime=0),Hr(e,n,i))}function Mr(e,n,t,a,i,s){if(null===e){var r=t.type;return"function"!=typeof r||Cc(r)||void 0!==r.defaultProps||null!==t.compare||void 0!==t.defaultProps?((e=Bc(t.type,null,a,null,n.mode,s)).ref=n.ref,e.return=n,n.child=e):(n.tag=15,n.type=r,qr(e,n,r,a,i,s))}return r=e.child,i<s&&(i=r.memoizedProps,(t=null!==(t=t.compare)?t:ja)(i,a)&&e.ref===n.ref)?Hr(e,n,s):(n.effectTag|=1,(e=xc(r,a)).ref=n.ref,e.return=n,n.child=e)}function qr(e,n,t,a,i,s){return null!==e&&ja(e.memoizedProps,a)&&e.ref===n.ref&&(Tr=!1,i<s)?(n.expirationTime=e.expirationTime,Hr(e,n,s)):Or(e,n,t,a,s)}function Ir(e,n){var t=n.ref;(null===e&&null!==t||null!==e&&e.ref!==t)&&(n.effectTag|=128)}function Or(e,n,t,a,i){var s=mi(t)?di:fi.current;return s=gi(n,s),ts(n,i),t=Hs(e,n,t,a,s,i),null===e||Tr?(n.effectTag|=1,Pr(e,n,t,i),n.child):(n.updateQueue=e.updateQueue,n.effectTag&=-517,e.expirationTime<=i&&(e.expirationTime=0),Hr(e,n,i))}function zr(e,n,t,a,i){if(mi(t)){var s=!0;yi(n)}else s=!1;if(ts(n,i),null===n.stateNode)null!==e&&(e.alternate=null,n.alternate=null,n.effectTag|=2),As(n,t,a),ys(n,t,a,i),a=!0;else if(null===e){var r=n.stateNode,o=n.memoizedProps;r.props=o;var c=r.context,l=t.contextType;"object"==typeof l&&null!==l?l=as(l):l=gi(n,l=mi(t)?di:fi.current);var p=t.getDerivedStateFromProps,f="function"==typeof p||"function"==typeof r.getSnapshotBeforeUpdate;f||"function"!=typeof r.UNSAFE_componentWillReceiveProps&&"function"!=typeof r.componentWillReceiveProps||(o!==a||c!==l)&&ks(n,r,a,l),is=!1;var u=n.memoizedState;r.state=u,ps(n,a,r,i),c=n.memoizedState,o!==a||u!==c||ui.current||is?("function"==typeof p&&(gs(n,t,p,a),c=n.memoizedState),(o=is||hs(n,t,o,a,u,c,l))?(f||"function"!=typeof r.UNSAFE_componentWillMount&&"function"!=typeof r.componentWillMount||("function"==typeof r.componentWillMount&&r.componentWillMount(),"function"==typeof r.UNSAFE_componentWillMount&&r.UNSAFE_componentWillMount()),"function"==typeof r.componentDidMount&&(n.effectTag|=4)):("function"==typeof r.componentDidMount&&(n.effectTag|=4),n.memoizedProps=a,n.memoizedState=c),r.props=a,r.state=c,r.context=l,a=o):("function"==typeof r.componentDidMount&&(n.effectTag|=4),a=!1)}else r=n.stateNode,rs(e,n),o=n.memoizedProps,r.props=n.type===n.elementType?o:$i(n.type,o),c=r.context,"object"==typeof(l=t.contextType)&&null!==l?l=as(l):l=gi(n,l=mi(t)?di:fi.current),(f="function"==typeof(p=t.getDerivedStateFromProps)||"function"==typeof r.getSnapshotBeforeUpdate)||"function"!=typeof r.UNSAFE_componentWillReceiveProps&&"function"!=typeof r.componentWillReceiveProps||(o!==a||c!==l)&&ks(n,r,a,l),is=!1,c=n.memoizedState,r.state=c,ps(n,a,r,i),u=n.memoizedState,o!==a||c!==u||ui.current||is?("function"==typeof p&&(gs(n,t,p,a),u=n.memoizedState),(p=is||hs(n,t,o,a,c,u,l))?(f||"function"!=typeof r.UNSAFE_componentWillUpdate&&"function"!=typeof r.componentWillUpdate||("function"==typeof r.componentWillUpdate&&r.componentWillUpdate(a,u,l),"function"==typeof r.UNSAFE_componentWillUpdate&&r.UNSAFE_componentWillUpdate(a,u,l)),"function"==typeof r.componentDidUpdate&&(n.effectTag|=4),"function"==typeof r.getSnapshotBeforeUpdate&&(n.effectTag|=256)):("function"!=typeof r.componentDidUpdate||o===e.memoizedProps&&c===e.memoizedState||(n.effectTag|=4),"function"!=typeof r.getSnapshotBeforeUpdate||o===e.memoizedProps&&c===e.memoizedState||(n.effectTag|=256),n.memoizedProps=a,n.memoizedState=u),r.props=a,r.state=u,r.context=l,a=p):("function"!=typeof r.componentDidUpdate||o===e.memoizedProps&&c===e.memoizedState||(n.effectTag|=4),"function"!=typeof r.getSnapshotBeforeUpdate||o===e.memoizedProps&&c===e.memoizedState||(n.effectTag|=256),a=!1);return Lr(e,n,t,a,s,i)}function Lr(e,n,t,a,i,s){Ir(e,n);var r=0!=(64&n.effectTag);if(!a&&!r)return i&&bi(n,t,!1),Hr(e,n,s);a=n.stateNode,Sr.current=n;var o=r&&"function"!=typeof t.getDerivedStateFromError?null:a.render();return n.effectTag|=1,null!==e&&r?(n.child=Es(n,e.child,null,s),n.child=Es(n,null,o,s)):Pr(e,n,o,s),n.memoizedState=a.state,i&&bi(n,t,!0),n.child}function Ur(e){var n=e.stateNode;n.pendingContext?Ai(0,n.pendingContext,n.pendingContext!==n.context):n.context&&Ai(0,n.context,!1),Ns(e,n.containerInfo)}var jr,Dr,Rr,Fr={dehydrated:null,retryTime:0};function Yr(e,n,t){var a,i=n.mode,s=n.pendingProps,r=Os.current,o=!1;if((a=0!=(64&n.effectTag))||(a=0!=(2&r)&&(null===e||null!==e.memoizedState)),a?(o=!0,n.effectTag&=-65):null!==e&&null===e.memoizedState||void 0===s.fallback||!0===s.unstable_avoidThisFallback||(r|=1),li(Os,1&r),null===e){if(void 0!==s.fallback&&Er(n),o){if(o=s.fallback,(s=Sc(null,i,0,null)).return=n,0==(2&n.mode))for(e=null!==n.memoizedState?n.child.child:n.child,s.child=e;null!==e;)e.return=s,e=e.sibling;return(t=Sc(o,i,t,null)).return=n,s.sibling=t,n.memoizedState=Fr,n.child=s,t}return i=s.children,n.memoizedState=null,n.child=Cs(n,null,i,t)}if(null!==e.memoizedState){if(i=(e=e.child).sibling,o){if(s=s.fallback,(t=xc(e,e.pendingProps)).return=n,0==(2&n.mode)&&(o=null!==n.memoizedState?n.child.child:n.child)!==e.child)for(t.child=o;null!==o;)o.return=t,o=o.sibling;return(i=xc(i,s)).return=n,t.sibling=i,t.childExpirationTime=0,n.memoizedState=Fr,n.child=t,i}return t=Es(n,e.child,s.children,t),n.memoizedState=null,n.child=t}if(e=e.child,o){if(o=s.fallback,(s=Sc(null,i,0,null)).return=n,s.child=e,null!==e&&(e.return=s),0==(2&n.mode))for(e=null!==n.memoizedState?n.child.child:n.child,s.child=e;null!==e;)e.return=s,e=e.sibling;return(t=Sc(o,i,t,null)).return=n,s.sibling=t,t.effectTag|=2,s.childExpirationTime=0,n.memoizedState=Fr,n.child=s,t}return n.memoizedState=null,n.child=Es(n,e,s.children,t)}function Qr(e,n){e.expirationTime<n&&(e.expirationTime=n);var t=e.alternate;null!==t&&t.expirationTime<n&&(t.expirationTime=n),ns(e.return,n)}function Wr(e,n,t,a,i,s){var r=e.memoizedState;null===r?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:a,tail:t,tailExpiration:0,tailMode:i,lastEffect:s}:(r.isBackwards=n,r.rendering=null,r.renderingStartTime=0,r.last=a,r.tail=t,r.tailExpiration=0,r.tailMode=i,r.lastEffect=s)}function Vr(e,n,t){var a=n.pendingProps,i=a.revealOrder,s=a.tail;if(Pr(e,n,a.children,t),0!=(2&(a=Os.current)))a=1&a|2,n.effectTag|=64;else{if(null!==e&&0!=(64&e.effectTag))e:for(e=n.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Qr(e,t);else if(19===e.tag)Qr(e,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;null===e.sibling;){if(null===e.return||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}a&=1}if(li(Os,a),0==(2&n.mode))n.memoizedState=null;else switch(i){case"forwards":for(t=n.child,i=null;null!==t;)null!==(e=t.alternate)&&null===zs(e)&&(i=t),t=t.sibling;null===(t=i)?(i=n.child,n.child=null):(i=t.sibling,t.sibling=null),Wr(n,!1,i,t,s,n.lastEffect);break;case"backwards":for(t=null,i=n.child,n.child=null;null!==i;){if(null!==(e=i.alternate)&&null===zs(e)){n.child=i;break}e=i.sibling,i.sibling=t,t=i,i=e}Wr(n,!0,t,null,s,n.lastEffect);break;case"together":Wr(n,!1,null,null,void 0,n.lastEffect);break;default:n.memoizedState=null}return n.child}function Hr(e,n,t){null!==e&&(n.dependencies=e.dependencies);var a=n.expirationTime;if(0!==a&&rc(a),n.childExpirationTime<t)return null;if(null!==e&&n.child!==e.child)throw Error(r(153));if(null!==n.child){for(t=xc(e=n.child,e.pendingProps),n.child=t,t.return=n;null!==e.sibling;)e=e.sibling,(t=t.sibling=xc(e,e.pendingProps)).return=n;t.sibling=null}return n.child}function $r(e,n){switch(e.tailMode){case"hidden":n=e.tail;for(var t=null;null!==n;)null!==n.alternate&&(t=n),n=n.sibling;null===t?e.tail=null:t.sibling=null;break;case"collapsed":t=e.tail;for(var a=null;null!==t;)null!==t.alternate&&(a=t),t=t.sibling;null===a?n||null===e.tail?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Xr(e,n,t){var a=n.pendingProps;switch(n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return mi(n.type)&&hi(),null;case 3:return Ms(),ci(ui),ci(fi),(t=n.stateNode).pendingContext&&(t.context=t.pendingContext,t.pendingContext=null),null!==e&&null!==e.child||!xr(n)||(n.effectTag|=4),null;case 5:Is(n),t=Ps(Ts.current);var s=n.type;if(null!==e&&null!=n.stateNode)Dr(e,n,s,a,t),e.ref!==n.ref&&(n.effectTag|=128);else{if(!a){if(null===n.stateNode)throw Error(r(166));return null}if(e=Ps(Bs.current),xr(n)){a=n.stateNode,s=n.type;var o=n.memoizedProps;switch(a[Et]=n,a[Ct]=o,s){case"iframe":case"object":case"embed":$n("load",a);break;case"video":case"audio":for(e=0;e<Ke.length;e++)$n(Ke[e],a);break;case"source":$n("error",a);break;case"img":case"image":case"link":$n("error",a),$n("load",a);break;case"form":$n("reset",a),$n("submit",a);break;case"details":$n("toggle",a);break;case"input":we(a,o),$n("invalid",a),ct(t,"onChange");break;case"select":a._wrapperState={wasMultiple:!!o.multiple},$n("invalid",a),ct(t,"onChange");break;case"textarea":Ne(a,o),$n("invalid",a),ct(t,"onChange")}for(var c in st(s,o),e=null,o)if(o.hasOwnProperty(c)){var l=o[c];"children"===c?"string"==typeof l?a.textContent!==l&&(e=["children",l]):"number"==typeof l&&a.textContent!==""+l&&(e=["children",""+l]):E.hasOwnProperty(c)&&null!=l&&ct(t,c)}switch(s){case"input":be(a),xe(a,o,!0);break;case"textarea":be(a),qe(a);break;case"select":case"option":break;default:"function"==typeof o.onClick&&(a.onclick=lt)}t=e,n.updateQueue=t,null!==t&&(n.effectTag|=4)}else{switch(c=9===t.nodeType?t:t.ownerDocument,e===ot&&(e=ze(s)),e===ot?"script"===s?((e=c.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof a.is?e=c.createElement(s,{is:a.is}):(e=c.createElement(s),"select"===s&&(c=e,a.multiple?c.multiple=!0:a.size&&(c.size=a.size))):e=c.createElementNS(e,s),e[Et]=n,e[Ct]=a,jr(e,n),n.stateNode=e,c=rt(s,a),s){case"iframe":case"object":case"embed":$n("load",e),l=a;break;case"video":case"audio":for(l=0;l<Ke.length;l++)$n(Ke[l],e);l=a;break;case"source":$n("error",e),l=a;break;case"img":case"image":case"link":$n("error",e),$n("load",e),l=a;break;case"form":$n("reset",e),$n("submit",e),l=a;break;case"details":$n("toggle",e),l=a;break;case"input":we(e,a),l=ve(e,a),$n("invalid",e),ct(t,"onChange");break;case"option":l=Se(e,a);break;case"select":e._wrapperState={wasMultiple:!!a.multiple},l=i({},a,{value:void 0}),$n("invalid",e),ct(t,"onChange");break;case"textarea":Ne(e,a),l=Pe(e,a),$n("invalid",e),ct(t,"onChange");break;default:l=a}st(s,l);var p=l;for(o in p)if(p.hasOwnProperty(o)){var f=p[o];"style"===o?at(e,f):"dangerouslySetInnerHTML"===o?null!=(f=f?f.__html:void 0)&&je(e,f):"children"===o?"string"==typeof f?("textarea"!==s||""!==f)&&De(e,f):"number"==typeof f&&De(e,""+f):"suppressContentEditableWarning"!==o&&"suppressHydrationWarning"!==o&&"autoFocus"!==o&&(E.hasOwnProperty(o)?null!=f&&ct(t,o):null!=f&&Z(e,o,f,c))}switch(s){case"input":be(e),xe(e,a,!1);break;case"textarea":be(e),qe(e);break;case"option":null!=a.value&&e.setAttribute("value",""+ke(a.value));break;case"select":e.multiple=!!a.multiple,null!=(t=a.value)?Te(e,!!a.multiple,t,!1):null!=a.defaultValue&&Te(e,!!a.multiple,a.defaultValue,!0);break;default:"function"==typeof l.onClick&&(e.onclick=lt)}At(s,a)&&(n.effectTag|=4)}null!==n.ref&&(n.effectTag|=128)}return null;case 6:if(e&&null!=n.stateNode)Rr(0,n,e.memoizedProps,a);else{if("string"!=typeof a&&null===n.stateNode)throw Error(r(166));t=Ps(Ts.current),Ps(Bs.current),xr(n)?(t=n.stateNode,a=n.memoizedProps,t[Et]=n,t.nodeValue!==a&&(n.effectTag|=4)):((t=(9===t.nodeType?t:t.ownerDocument).createTextNode(a))[Et]=n,n.stateNode=t)}return null;case 13:return ci(Os),a=n.memoizedState,0!=(64&n.effectTag)?(n.expirationTime=t,n):(t=null!==a,a=!1,null===e?void 0!==n.memoizedProps.fallback&&xr(n):(a=null!==(s=e.memoizedState),t||null===s||null!==(s=e.child.sibling)&&(null!==(o=n.firstEffect)?(n.firstEffect=s,s.nextEffect=o):(n.firstEffect=n.lastEffect=s,s.nextEffect=null),s.effectTag=8)),t&&!a&&0!=(2&n.mode)&&(null===e&&!0!==n.memoizedProps.unstable_avoidThisFallback||0!=(1&Os.current)?Bo===bo&&(Bo=_o):(Bo!==bo&&Bo!==_o||(Bo=vo),0!==Mo&&null!==Eo&&(qc(Eo,xo),Ic(Eo,Mo)))),(t||a)&&(n.effectTag|=4),null);case 4:return Ms(),null;case 10:return es(n),null;case 17:return mi(n.type)&&hi(),null;case 19:if(ci(Os),null===(a=n.memoizedState))return null;if(s=0!=(64&n.effectTag),null===(o=a.rendering)){if(s)$r(a,!1);else if(Bo!==bo||null!==e&&0!=(64&e.effectTag))for(o=n.child;null!==o;){if(null!==(e=zs(o))){for(n.effectTag|=64,$r(a,!1),null!==(s=e.updateQueue)&&(n.updateQueue=s,n.effectTag|=4),null===a.lastEffect&&(n.firstEffect=null),n.lastEffect=a.lastEffect,a=n.child;null!==a;)o=t,(s=a).effectTag&=2,s.nextEffect=null,s.firstEffect=null,s.lastEffect=null,null===(e=s.alternate)?(s.childExpirationTime=0,s.expirationTime=o,s.child=null,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null):(s.childExpirationTime=e.childExpirationTime,s.expirationTime=e.expirationTime,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,o=e.dependencies,s.dependencies=null===o?null:{expirationTime:o.expirationTime,firstContext:o.firstContext,responders:o.responders}),a=a.sibling;return li(Os,1&Os.current|2),n.child}o=o.sibling}}else{if(!s)if(null!==(e=zs(o))){if(n.effectTag|=64,s=!0,null!==(t=e.updateQueue)&&(n.updateQueue=t,n.effectTag|=4),$r(a,!0),null===a.tail&&"hidden"===a.tailMode&&!o.alternate)return null!==(n=n.lastEffect=a.lastEffect)&&(n.nextEffect=null),null}else 2*ji()-a.renderingStartTime>a.tailExpiration&&1<t&&(n.effectTag|=64,s=!0,$r(a,!1),n.expirationTime=n.childExpirationTime=t-1);a.isBackwards?(o.sibling=n.child,n.child=o):(null!==(t=a.last)?t.sibling=o:n.child=o,a.last=o)}return null!==a.tail?(0===a.tailExpiration&&(a.tailExpiration=ji()+500),t=a.tail,a.rendering=t,a.tail=t.sibling,a.lastEffect=n.lastEffect,a.renderingStartTime=ji(),t.sibling=null,n=Os.current,li(Os,s?1&n|2:1&n),t):null}throw Error(r(156,n.tag))}function Kr(e){switch(e.tag){case 1:mi(e.type)&&hi();var n=e.effectTag;return 4096&n?(e.effectTag=-4097&n|64,e):null;case 3:if(Ms(),ci(ui),ci(fi),0!=(64&(n=e.effectTag)))throw Error(r(285));return e.effectTag=-4097&n|64,e;case 5:return Is(e),null;case 13:return ci(Os),4096&(n=e.effectTag)?(e.effectTag=-4097&n|64,e):null;case 19:return ci(Os),null;case 4:return Ms(),null;case 10:return es(e),null;default:return null}}function Zr(e,n){return{value:e,source:n,stack:Ae(n)}}jr=function(e,n){for(var t=n.child;null!==t;){if(5===t.tag||6===t.tag)e.appendChild(t.stateNode);else if(4!==t.tag&&null!==t.child){t.child.return=t,t=t.child;continue}if(t===n)break;for(;null===t.sibling;){if(null===t.return||t.return===n)return;t=t.return}t.sibling.return=t.return,t=t.sibling}},Dr=function(e,n,t,a,s){var r=e.memoizedProps;if(r!==a){var o,c,l=n.stateNode;switch(Ps(Bs.current),e=null,t){case"input":r=ve(l,r),a=ve(l,a),e=[];break;case"option":r=Se(l,r),a=Se(l,a),e=[];break;case"select":r=i({},r,{value:void 0}),a=i({},a,{value:void 0}),e=[];break;case"textarea":r=Pe(l,r),a=Pe(l,a),e=[];break;default:"function"!=typeof r.onClick&&"function"==typeof a.onClick&&(l.onclick=lt)}for(o in st(t,a),t=null,r)if(!a.hasOwnProperty(o)&&r.hasOwnProperty(o)&&null!=r[o])if("style"===o)for(c in l=r[o])l.hasOwnProperty(c)&&(t||(t={}),t[c]="");else"dangerouslySetInnerHTML"!==o&&"children"!==o&&"suppressContentEditableWarning"!==o&&"suppressHydrationWarning"!==o&&"autoFocus"!==o&&(E.hasOwnProperty(o)?e||(e=[]):(e=e||[]).push(o,null));for(o in a){var p=a[o];if(l=null!=r?r[o]:void 0,a.hasOwnProperty(o)&&p!==l&&(null!=p||null!=l))if("style"===o)if(l){for(c in l)!l.hasOwnProperty(c)||p&&p.hasOwnProperty(c)||(t||(t={}),t[c]="");for(c in p)p.hasOwnProperty(c)&&l[c]!==p[c]&&(t||(t={}),t[c]=p[c])}else t||(e||(e=[]),e.push(o,t)),t=p;else"dangerouslySetInnerHTML"===o?(p=p?p.__html:void 0,l=l?l.__html:void 0,null!=p&&l!==p&&(e=e||[]).push(o,p)):"children"===o?l===p||"string"!=typeof p&&"number"!=typeof p||(e=e||[]).push(o,""+p):"suppressContentEditableWarning"!==o&&"suppressHydrationWarning"!==o&&(E.hasOwnProperty(o)?(null!=p&&ct(s,o),e||l===p||(e=[])):(e=e||[]).push(o,p))}t&&(e=e||[]).push("style",t),s=e,(n.updateQueue=s)&&(n.effectTag|=4)}},Rr=function(e,n,t,a){t!==a&&(n.effectTag|=4)};var Gr="function"==typeof WeakSet?WeakSet:Set;function Jr(e,n){var t=n.source,a=n.stack;null===a&&null!==t&&(a=Ae(t)),null!==t&&he(t.type),n=n.value,null!==e&&1===e.tag&&he(e.type);try{console.error(n)}catch(e){setTimeout((function(){throw e}))}}function eo(e){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){kc(e,n)}else n.current=null}function no(e,n){switch(n.tag){case 0:case 11:case 15:case 22:return;case 1:if(256&n.effectTag&&null!==e){var t=e.memoizedProps,a=e.memoizedState;n=(e=n.stateNode).getSnapshotBeforeUpdate(n.elementType===n.type?t:$i(n.type,t),a),e.__reactInternalSnapshotBeforeUpdate=n}return;case 3:case 5:case 6:case 4:case 17:return}throw Error(r(163))}function to(e,n){if(null!==(n=null!==(n=n.updateQueue)?n.lastEffect:null)){var t=n=n.next;do{if((t.tag&e)===e){var a=t.destroy;t.destroy=void 0,void 0!==a&&a()}t=t.next}while(t!==n)}}function ao(e,n){if(null!==(n=null!==(n=n.updateQueue)?n.lastEffect:null)){var t=n=n.next;do{if((t.tag&e)===e){var a=t.create;t.destroy=a()}t=t.next}while(t!==n)}}function io(e,n,t){switch(t.tag){case 0:case 11:case 15:case 22:return void ao(3,t);case 1:if(e=t.stateNode,4&t.effectTag)if(null===n)e.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:$i(t.type,n.memoizedProps);e.componentDidUpdate(a,n.memoizedState,e.__reactInternalSnapshotBeforeUpdate)}return void(null!==(n=t.updateQueue)&&fs(t,n,e));case 3:if(null!==(n=t.updateQueue)){if(e=null,null!==t.child)switch(t.child.tag){case 5:e=t.child.stateNode;break;case 1:e=t.child.stateNode}fs(t,n,e)}return;case 5:return e=t.stateNode,void(null===n&&4&t.effectTag&&At(t.type,t.memoizedProps)&&e.focus());case 6:case 4:case 12:return;case 13:return void(null===t.memoizedState&&(t=t.alternate,null!==t&&(t=t.memoizedState,null!==t&&(t=t.dehydrated,null!==t&&Ln(t)))));case 19:case 17:case 20:case 21:return}throw Error(r(163))}function so(e,n,t){switch("function"==typeof vc&&vc(n),n.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=n.updateQueue)&&null!==(e=e.lastEffect)){var a=e.next;Fi(97<t?97:t,(function(){var e=a;do{var t=e.destroy;if(void 0!==t){var i=n;try{t()}catch(e){kc(i,e)}}e=e.next}while(e!==a)}))}break;case 1:eo(n),"function"==typeof(t=n.stateNode).componentWillUnmount&&function(e,n){try{n.props=e.memoizedProps,n.state=e.memoizedState,n.componentWillUnmount()}catch(n){kc(e,n)}}(n,t);break;case 5:eo(n);break;case 4:lo(e,n,t)}}function ro(e){var n=e.alternate;e.return=null,e.child=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.alternate=null,e.firstEffect=null,e.lastEffect=null,e.pendingProps=null,e.memoizedProps=null,e.stateNode=null,null!==n&&ro(n)}function oo(e){return 5===e.tag||3===e.tag||4===e.tag}function co(e){e:{for(var n=e.return;null!==n;){if(oo(n)){var t=n;break e}n=n.return}throw Error(r(160))}switch(n=t.stateNode,t.tag){case 5:var a=!1;break;case 3:case 4:n=n.containerInfo,a=!0;break;default:throw Error(r(161))}16&t.effectTag&&(De(n,""),t.effectTag&=-17);e:n:for(t=e;;){for(;null===t.sibling;){if(null===t.return||oo(t.return)){t=null;break e}t=t.return}for(t.sibling.return=t.return,t=t.sibling;5!==t.tag&&6!==t.tag&&18!==t.tag;){if(2&t.effectTag)continue n;if(null===t.child||4===t.tag)continue n;t.child.return=t,t=t.child}if(!(2&t.effectTag)){t=t.stateNode;break e}}a?function e(n,t,a){var i=n.tag,s=5===i||6===i;if(s)n=s?n.stateNode:n.stateNode.instance,t?8===a.nodeType?a.parentNode.insertBefore(n,t):a.insertBefore(n,t):(8===a.nodeType?(t=a.parentNode).insertBefore(n,a):(t=a).appendChild(n),null!==(a=a._reactRootContainer)&&void 0!==a||null!==t.onclick||(t.onclick=lt));else if(4!==i&&null!==(n=n.child))for(e(n,t,a),n=n.sibling;null!==n;)e(n,t,a),n=n.sibling}(e,t,n):function e(n,t,a){var i=n.tag,s=5===i||6===i;if(s)n=s?n.stateNode:n.stateNode.instance,t?a.insertBefore(n,t):a.appendChild(n);else if(4!==i&&null!==(n=n.child))for(e(n,t,a),n=n.sibling;null!==n;)e(n,t,a),n=n.sibling}(e,t,n)}function lo(e,n,t){for(var a,i,s=n,o=!1;;){if(!o){o=s.return;e:for(;;){if(null===o)throw Error(r(160));switch(a=o.stateNode,o.tag){case 5:i=!1;break e;case 3:case 4:a=a.containerInfo,i=!0;break e}o=o.return}o=!0}if(5===s.tag||6===s.tag){e:for(var c=e,l=s,p=t,f=l;;)if(so(c,f,p),null!==f.child&&4!==f.tag)f.child.return=f,f=f.child;else{if(f===l)break e;for(;null===f.sibling;){if(null===f.return||f.return===l)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}i?(c=a,l=s.stateNode,8===c.nodeType?c.parentNode.removeChild(l):c.removeChild(l)):a.removeChild(s.stateNode)}else if(4===s.tag){if(null!==s.child){a=s.stateNode.containerInfo,i=!0,s.child.return=s,s=s.child;continue}}else if(so(e,s,t),null!==s.child){s.child.return=s,s=s.child;continue}if(s===n)break;for(;null===s.sibling;){if(null===s.return||s.return===n)return;4===(s=s.return).tag&&(o=!1)}s.sibling.return=s.return,s=s.sibling}}function po(e,n){switch(n.tag){case 0:case 11:case 14:case 15:case 22:return void to(3,n);case 1:return;case 5:var t=n.stateNode;if(null!=t){var a=n.memoizedProps,i=null!==e?e.memoizedProps:a;e=n.type;var s=n.updateQueue;if(n.updateQueue=null,null!==s){for(t[Ct]=a,"input"===e&&"radio"===a.type&&null!=a.name&&Ee(t,a),rt(e,i),n=rt(e,a),i=0;i<s.length;i+=2){var o=s[i],c=s[i+1];"style"===o?at(t,c):"dangerouslySetInnerHTML"===o?je(t,c):"children"===o?De(t,c):Z(t,o,c,n)}switch(e){case"input":Ce(t,a);break;case"textarea":Me(t,a);break;case"select":n=t._wrapperState.wasMultiple,t._wrapperState.wasMultiple=!!a.multiple,null!=(e=a.value)?Te(t,!!a.multiple,e,!1):n!==!!a.multiple&&(null!=a.defaultValue?Te(t,!!a.multiple,a.defaultValue,!0):Te(t,!!a.multiple,a.multiple?[]:"",!1))}}}return;case 6:if(null===n.stateNode)throw Error(r(162));return void(n.stateNode.nodeValue=n.memoizedProps);case 3:return void((n=n.stateNode).hydrate&&(n.hydrate=!1,Ln(n.containerInfo)));case 12:return;case 13:if(t=n,null===n.memoizedState?a=!1:(a=!0,t=n.child,Io=ji()),null!==t)e:for(e=t;;){if(5===e.tag)s=e.stateNode,a?"function"==typeof(s=s.style).setProperty?s.setProperty("display","none","important"):s.display="none":(s=e.stateNode,i=null!=(i=e.memoizedProps.style)&&i.hasOwnProperty("display")?i.display:null,s.style.display=tt("display",i));else if(6===e.tag)e.stateNode.nodeValue=a?"":e.memoizedProps;else{if(13===e.tag&&null!==e.memoizedState&&null===e.memoizedState.dehydrated){(s=e.child.sibling).return=e,e=s;continue}if(null!==e.child){e.child.return=e,e=e.child;continue}}if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}return void fo(n);case 19:return void fo(n);case 17:return}throw Error(r(163))}function fo(e){var n=e.updateQueue;if(null!==n){e.updateQueue=null;var t=e.stateNode;null===t&&(t=e.stateNode=new Gr),n.forEach((function(n){var a=bc.bind(null,e,n);t.has(n)||(t.add(n),n.then(a,a))}))}}var uo="function"==typeof WeakMap?WeakMap:Map;function go(e,n,t){(t=os(t,null)).tag=3,t.payload={element:null};var a=n.value;return t.callback=function(){zo||(zo=!0,Lo=a),Jr(e,n)},t}function mo(e,n,t){(t=os(t,null)).tag=3;var a=e.type.getDerivedStateFromError;if("function"==typeof a){var i=n.value;t.payload=function(){return Jr(e,n),a(i)}}var s=e.stateNode;return null!==s&&"function"==typeof s.componentDidCatch&&(t.callback=function(){"function"!=typeof a&&(null===Uo?Uo=new Set([this]):Uo.add(this),Jr(e,n));var t=n.stack;this.componentDidCatch(n.value,{componentStack:null!==t?t:""})}),t}var ho,Ao=Math.ceil,ko=K.ReactCurrentDispatcher,yo=K.ReactCurrentOwner,bo=0,_o=3,vo=4,wo=0,Eo=null,Co=null,xo=0,Bo=bo,So=null,To=1073741823,Po=1073741823,No=null,Mo=0,qo=!1,Io=0,Oo=null,zo=!1,Lo=null,Uo=null,jo=!1,Do=null,Ro=90,Fo=null,Yo=0,Qo=null,Wo=0;function Vo(){return 0!=(48&wo)?1073741821-(ji()/10|0):0!==Wo?Wo:Wo=1073741821-(ji()/10|0)}function Ho(e,n,t){if(0==(2&(n=n.mode)))return 1073741823;var a=Di();if(0==(4&n))return 99===a?1073741823:1073741822;if(0!=(16&wo))return xo;if(null!==t)e=Hi(e,0|t.timeoutMs||5e3,250);else switch(a){case 99:e=1073741823;break;case 98:e=Hi(e,150,100);break;case 97:case 96:e=Hi(e,5e3,250);break;case 95:e=2;break;default:throw Error(r(326))}return null!==Eo&&e===xo&&--e,e}function $o(e,n){if(50<Yo)throw Yo=0,Qo=null,Error(r(185));if(null!==(e=Xo(e,n))){var t=Di();1073741823===n?0!=(8&wo)&&0==(48&wo)?Jo(e):(Zo(e),0===wo&&Wi()):Zo(e),0==(4&wo)||98!==t&&99!==t||(null===Fo?Fo=new Map([[e,n]]):(void 0===(t=Fo.get(e))||t>n)&&Fo.set(e,n))}}function Xo(e,n){e.expirationTime<n&&(e.expirationTime=n);var t=e.alternate;null!==t&&t.expirationTime<n&&(t.expirationTime=n);var a=e.return,i=null;if(null===a&&3===e.tag)i=e.stateNode;else for(;null!==a;){if(t=a.alternate,a.childExpirationTime<n&&(a.childExpirationTime=n),null!==t&&t.childExpirationTime<n&&(t.childExpirationTime=n),null===a.return&&3===a.tag){i=a.stateNode;break}a=a.return}return null!==i&&(Eo===i&&(rc(n),Bo===vo&&qc(i,xo)),Ic(i,n)),i}function Ko(e){var n=e.lastExpiredTime;if(0!==n)return n;if(!Mc(e,n=e.firstPendingTime))return n;var t=e.lastPingedTime;return 2>=(e=t>(e=e.nextKnownPendingLevel)?t:e)&&n!==e?0:e}function Zo(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=Qi(Jo.bind(null,e));else{var n=Ko(e),t=e.callbackNode;if(0===n)null!==t&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var a=Vo();if(1073741823===n?a=99:1===n||2===n?a=95:a=0>=(a=10*(1073741821-n)-10*(1073741821-a))?99:250>=a?98:5250>=a?97:95,null!==t){var i=e.callbackPriority;if(e.callbackExpirationTime===n&&i>=a)return;t!==Mi&&wi(t)}e.callbackExpirationTime=n,e.callbackPriority=a,n=1073741823===n?Qi(Jo.bind(null,e)):Yi(a,Go.bind(null,e),{timeout:10*(1073741821-n)-ji()}),e.callbackNode=n}}}function Go(e,n){if(Wo=0,n)return Oc(e,n=Vo()),Zo(e),null;var t=Ko(e);if(0!==t){if(n=e.callbackNode,0!=(48&wo))throw Error(r(327));if(mc(),e===Eo&&t===xo||tc(e,t),null!==Co){var a=wo;wo|=16;for(var i=ic();;)try{cc();break}catch(n){ac(e,n)}if(Ji(),wo=a,ko.current=i,1===Bo)throw n=So,tc(e,t),qc(e,t),Zo(e),n;if(null===Co)switch(i=e.finishedWork=e.current.alternate,e.finishedExpirationTime=t,a=Bo,Eo=null,a){case bo:case 1:throw Error(r(345));case 2:Oc(e,2<t?2:t);break;case _o:if(qc(e,t),t===(a=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=fc(i)),1073741823===To&&10<(i=Io+500-ji())){if(qo){var s=e.lastPingedTime;if(0===s||s>=t){e.lastPingedTime=t,tc(e,t);break}}if(0!==(s=Ko(e))&&s!==t)break;if(0!==a&&a!==t){e.lastPingedTime=a;break}e.timeoutHandle=yt(uc.bind(null,e),i);break}uc(e);break;case vo:if(qc(e,t),t===(a=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=fc(i)),qo&&(0===(i=e.lastPingedTime)||i>=t)){e.lastPingedTime=t,tc(e,t);break}if(0!==(i=Ko(e))&&i!==t)break;if(0!==a&&a!==t){e.lastPingedTime=a;break}if(1073741823!==Po?a=10*(1073741821-Po)-ji():1073741823===To?a=0:(a=10*(1073741821-To)-5e3,0>(a=(i=ji())-a)&&(a=0),(t=10*(1073741821-t)-i)<(a=(120>a?120:480>a?480:1080>a?1080:1920>a?1920:3e3>a?3e3:4320>a?4320:1960*Ao(a/1960))-a)&&(a=t)),10<a){e.timeoutHandle=yt(uc.bind(null,e),a);break}uc(e);break;case 5:if(1073741823!==To&&null!==No){s=To;var o=No;if(0>=(a=0|o.busyMinDurationMs)?a=0:(i=0|o.busyDelayMs,a=(s=ji()-(10*(1073741821-s)-(0|o.timeoutMs||5e3)))<=i?0:i+a-s),10<a){qc(e,t),e.timeoutHandle=yt(uc.bind(null,e),a);break}}uc(e);break;default:throw Error(r(329))}if(Zo(e),e.callbackNode===n)return Go.bind(null,e)}}return null}function Jo(e){var n=e.lastExpiredTime;if(n=0!==n?n:1073741823,0!=(48&wo))throw Error(r(327));if(mc(),e===Eo&&n===xo||tc(e,n),null!==Co){var t=wo;wo|=16;for(var a=ic();;)try{oc();break}catch(n){ac(e,n)}if(Ji(),wo=t,ko.current=a,1===Bo)throw t=So,tc(e,n),qc(e,n),Zo(e),t;if(null!==Co)throw Error(r(261));e.finishedWork=e.current.alternate,e.finishedExpirationTime=n,Eo=null,uc(e),Zo(e)}return null}function ec(e,n){var t=wo;wo|=1;try{return e(n)}finally{0===(wo=t)&&Wi()}}function nc(e,n){var t=wo;wo&=-2,wo|=8;try{return e(n)}finally{0===(wo=t)&&Wi()}}function tc(e,n){e.finishedWork=null,e.finishedExpirationTime=0;var t=e.timeoutHandle;if(-1!==t&&(e.timeoutHandle=-1,bt(t)),null!==Co)for(t=Co.return;null!==t;){var a=t;switch(a.tag){case 1:null!=(a=a.type.childContextTypes)&&hi();break;case 3:Ms(),ci(ui),ci(fi);break;case 5:Is(a);break;case 4:Ms();break;case 13:case 19:ci(Os);break;case 10:es(a)}t=t.return}Eo=e,Co=xc(e.current,null),xo=n,Bo=bo,So=null,Po=To=1073741823,No=null,Mo=0,qo=!1}function ac(e,n){for(;;){try{if(Ji(),Us.current=mr,Qs)for(var t=Rs.memoizedState;null!==t;){var a=t.queue;null!==a&&(a.pending=null),t=t.next}if(Ds=0,Ys=Fs=Rs=null,Qs=!1,null===Co||null===Co.return)return Bo=1,So=n,Co=null;e:{var i=e,s=Co.return,r=Co,o=n;if(n=xo,r.effectTag|=2048,r.firstEffect=r.lastEffect=null,null!==o&&"object"==typeof o&&"function"==typeof o.then){var c=o;if(0==(2&r.mode)){var l=r.alternate;l?(r.updateQueue=l.updateQueue,r.memoizedState=l.memoizedState,r.expirationTime=l.expirationTime):(r.updateQueue=null,r.memoizedState=null)}var p=0!=(1&Os.current),f=s;do{var u;if(u=13===f.tag){var d=f.memoizedState;if(null!==d)u=null!==d.dehydrated;else{var g=f.memoizedProps;u=void 0!==g.fallback&&(!0!==g.unstable_avoidThisFallback||!p)}}if(u){var m=f.updateQueue;if(null===m){var h=new Set;h.add(c),f.updateQueue=h}else m.add(c);if(0==(2&f.mode)){if(f.effectTag|=64,r.effectTag&=-2981,1===r.tag)if(null===r.alternate)r.tag=17;else{var A=os(1073741823,null);A.tag=2,cs(r,A)}r.expirationTime=1073741823;break e}o=void 0,r=n;var k=i.pingCache;if(null===k?(k=i.pingCache=new uo,o=new Set,k.set(c,o)):void 0===(o=k.get(c))&&(o=new Set,k.set(c,o)),!o.has(r)){o.add(r);var y=yc.bind(null,i,c,r);c.then(y,y)}f.effectTag|=4096,f.expirationTime=n;break e}f=f.return}while(null!==f);o=Error((he(r.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."+Ae(r))}5!==Bo&&(Bo=2),o=Zr(o,r),f=s;do{switch(f.tag){case 3:c=o,f.effectTag|=4096,f.expirationTime=n,ls(f,go(f,c,n));break e;case 1:c=o;var b=f.type,_=f.stateNode;if(0==(64&f.effectTag)&&("function"==typeof b.getDerivedStateFromError||null!==_&&"function"==typeof _.componentDidCatch&&(null===Uo||!Uo.has(_)))){f.effectTag|=4096,f.expirationTime=n,ls(f,mo(f,c,n));break e}}f=f.return}while(null!==f)}Co=pc(Co)}catch(e){n=e;continue}break}}function ic(){var e=ko.current;return ko.current=mr,null===e?mr:e}function sc(e,n){e<To&&2<e&&(To=e),null!==n&&e<Po&&2<e&&(Po=e,No=n)}function rc(e){e>Mo&&(Mo=e)}function oc(){for(;null!==Co;)Co=lc(Co)}function cc(){for(;null!==Co&&!qi();)Co=lc(Co)}function lc(e){var n=ho(e.alternate,e,xo);return e.memoizedProps=e.pendingProps,null===n&&(n=pc(e)),yo.current=null,n}function pc(e){Co=e;do{var n=Co.alternate;if(e=Co.return,0==(2048&Co.effectTag)){if(n=Xr(n,Co,xo),1===xo||1!==Co.childExpirationTime){for(var t=0,a=Co.child;null!==a;){var i=a.expirationTime,s=a.childExpirationTime;i>t&&(t=i),s>t&&(t=s),a=a.sibling}Co.childExpirationTime=t}if(null!==n)return n;null!==e&&0==(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=Co.firstEffect),null!==Co.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=Co.firstEffect),e.lastEffect=Co.lastEffect),1<Co.effectTag&&(null!==e.lastEffect?e.lastEffect.nextEffect=Co:e.firstEffect=Co,e.lastEffect=Co))}else{if(null!==(n=Kr(Co)))return n.effectTag&=2047,n;null!==e&&(e.firstEffect=e.lastEffect=null,e.effectTag|=2048)}if(null!==(n=Co.sibling))return n;Co=e}while(null!==Co);return Bo===bo&&(Bo=5),null}function fc(e){var n=e.expirationTime;return n>(e=e.childExpirationTime)?n:e}function uc(e){var n=Di();return Fi(99,dc.bind(null,e,n)),null}function dc(e,n){do{mc()}while(null!==Do);if(0!=(48&wo))throw Error(r(327));var t=e.finishedWork,a=e.finishedExpirationTime;if(null===t)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,t===e.current)throw Error(r(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var i=fc(t);if(e.firstPendingTime=i,a<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:a<=e.firstSuspendedTime&&(e.firstSuspendedTime=a-1),a<=e.lastPingedTime&&(e.lastPingedTime=0),a<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===Eo&&(Co=Eo=null,xo=0),1<t.effectTag?null!==t.lastEffect?(t.lastEffect.nextEffect=t,i=t.firstEffect):i=t:i=t.firstEffect,null!==i){var s=wo;wo|=32,yo.current=null,mt=Hn;var o=dt();if(gt(o)){if("selectionStart"in o)var c={start:o.selectionStart,end:o.selectionEnd};else e:{var l=(c=(c=o.ownerDocument)&&c.defaultView||window).getSelection&&c.getSelection();if(l&&0!==l.rangeCount){c=l.anchorNode;var p=l.anchorOffset,f=l.focusNode;l=l.focusOffset;try{c.nodeType,f.nodeType}catch(e){c=null;break e}var u=0,d=-1,g=-1,m=0,h=0,A=o,k=null;n:for(;;){for(var y;A!==c||0!==p&&3!==A.nodeType||(d=u+p),A!==f||0!==l&&3!==A.nodeType||(g=u+l),3===A.nodeType&&(u+=A.nodeValue.length),null!==(y=A.firstChild);)k=A,A=y;for(;;){if(A===o)break n;if(k===c&&++m===p&&(d=u),k===f&&++h===l&&(g=u),null!==(y=A.nextSibling))break;k=(A=k).parentNode}A=y}c=-1===d||-1===g?null:{start:d,end:g}}else c=null}c=c||{start:0,end:0}}else c=null;ht={activeElementDetached:null,focusedElem:o,selectionRange:c},Hn=!1,Oo=i;do{try{gc()}catch(e){if(null===Oo)throw Error(r(330));kc(Oo,e),Oo=Oo.nextEffect}}while(null!==Oo);Oo=i;do{try{for(o=e,c=n;null!==Oo;){var b=Oo.effectTag;if(16&b&&De(Oo.stateNode,""),128&b){var _=Oo.alternate;if(null!==_){var v=_.ref;null!==v&&("function"==typeof v?v(null):v.current=null)}}switch(1038&b){case 2:co(Oo),Oo.effectTag&=-3;break;case 6:co(Oo),Oo.effectTag&=-3,po(Oo.alternate,Oo);break;case 1024:Oo.effectTag&=-1025;break;case 1028:Oo.effectTag&=-1025,po(Oo.alternate,Oo);break;case 4:po(Oo.alternate,Oo);break;case 8:lo(o,p=Oo,c),ro(p)}Oo=Oo.nextEffect}}catch(e){if(null===Oo)throw Error(r(330));kc(Oo,e),Oo=Oo.nextEffect}}while(null!==Oo);if(v=ht,_=dt(),b=v.focusedElem,c=v.selectionRange,_!==b&&b&&b.ownerDocument&&function e(n,t){return!(!n||!t)&&(n===t||(!n||3!==n.nodeType)&&(t&&3===t.nodeType?e(n,t.parentNode):"contains"in n?n.contains(t):!!n.compareDocumentPosition&&!!(16&n.compareDocumentPosition(t))))}(b.ownerDocument.documentElement,b)){null!==c&>(b)&&(_=c.start,void 0===(v=c.end)&&(v=_),"selectionStart"in b?(b.selectionStart=_,b.selectionEnd=Math.min(v,b.value.length)):(v=(_=b.ownerDocument||document)&&_.defaultView||window).getSelection&&(v=v.getSelection(),p=b.textContent.length,o=Math.min(c.start,p),c=void 0===c.end?o:Math.min(c.end,p),!v.extend&&o>c&&(p=c,c=o,o=p),p=ut(b,o),f=ut(b,c),p&&f&&(1!==v.rangeCount||v.anchorNode!==p.node||v.anchorOffset!==p.offset||v.focusNode!==f.node||v.focusOffset!==f.offset)&&((_=_.createRange()).setStart(p.node,p.offset),v.removeAllRanges(),o>c?(v.addRange(_),v.extend(f.node,f.offset)):(_.setEnd(f.node,f.offset),v.addRange(_))))),_=[];for(v=b;v=v.parentNode;)1===v.nodeType&&_.push({element:v,left:v.scrollLeft,top:v.scrollTop});for("function"==typeof b.focus&&b.focus(),b=0;b<_.length;b++)(v=_[b]).element.scrollLeft=v.left,v.element.scrollTop=v.top}Hn=!!mt,ht=mt=null,e.current=t,Oo=i;do{try{for(b=e;null!==Oo;){var w=Oo.effectTag;if(36&w&&io(b,Oo.alternate,Oo),128&w){_=void 0;var E=Oo.ref;if(null!==E){var C=Oo.stateNode;switch(Oo.tag){case 5:_=C;break;default:_=C}"function"==typeof E?E(_):E.current=_}}Oo=Oo.nextEffect}}catch(e){if(null===Oo)throw Error(r(330));kc(Oo,e),Oo=Oo.nextEffect}}while(null!==Oo);Oo=null,Ii(),wo=s}else e.current=t;if(jo)jo=!1,Do=e,Ro=n;else for(Oo=i;null!==Oo;)n=Oo.nextEffect,Oo.nextEffect=null,Oo=n;if(0===(n=e.firstPendingTime)&&(Uo=null),1073741823===n?e===Qo?Yo++:(Yo=0,Qo=e):Yo=0,"function"==typeof _c&&_c(t.stateNode,a),Zo(e),zo)throw zo=!1,e=Lo,Lo=null,e;return 0!=(8&wo)||Wi(),null}function gc(){for(;null!==Oo;){var e=Oo.effectTag;0!=(256&e)&&no(Oo.alternate,Oo),0==(512&e)||jo||(jo=!0,Yi(97,(function(){return mc(),null}))),Oo=Oo.nextEffect}}function mc(){if(90!==Ro){var e=97<Ro?97:Ro;return Ro=90,Fi(e,hc)}}function hc(){if(null===Do)return!1;var e=Do;if(Do=null,0!=(48&wo))throw Error(r(331));var n=wo;for(wo|=32,e=e.current.firstEffect;null!==e;){try{var t=e;if(0!=(512&t.effectTag))switch(t.tag){case 0:case 11:case 15:case 22:to(5,t),ao(5,t)}}catch(n){if(null===e)throw Error(r(330));kc(e,n)}t=e.nextEffect,e.nextEffect=null,e=t}return wo=n,Wi(),!0}function Ac(e,n,t){cs(e,n=go(e,n=Zr(t,n),1073741823)),null!==(e=Xo(e,1073741823))&&Zo(e)}function kc(e,n){if(3===e.tag)Ac(e,e,n);else for(var t=e.return;null!==t;){if(3===t.tag){Ac(t,e,n);break}if(1===t.tag){var a=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof a.componentDidCatch&&(null===Uo||!Uo.has(a))){cs(t,e=mo(t,e=Zr(n,e),1073741823)),null!==(t=Xo(t,1073741823))&&Zo(t);break}}t=t.return}}function yc(e,n,t){var a=e.pingCache;null!==a&&a.delete(n),Eo===e&&xo===t?Bo===vo||Bo===_o&&1073741823===To&&ji()-Io<500?tc(e,xo):qo=!0:Mc(e,t)&&(0!==(n=e.lastPingedTime)&&n<t||(e.lastPingedTime=t,Zo(e)))}function bc(e,n){var t=e.stateNode;null!==t&&t.delete(n),0===(n=0)&&(n=Ho(n=Vo(),e,null)),null!==(e=Xo(e,n))&&Zo(e)}ho=function(e,n,t){var a=n.expirationTime;if(null!==e){var i=n.pendingProps;if(e.memoizedProps!==i||ui.current)Tr=!0;else{if(a<t){switch(Tr=!1,n.tag){case 3:Ur(n),Br();break;case 5:if(qs(n),4&n.mode&&1!==t&&i.hidden)return n.expirationTime=n.childExpirationTime=1,null;break;case 1:mi(n.type)&&yi(n);break;case 4:Ns(n,n.stateNode.containerInfo);break;case 10:a=n.memoizedProps.value,i=n.type._context,li(Xi,i._currentValue),i._currentValue=a;break;case 13:if(null!==n.memoizedState)return 0!==(a=n.child.childExpirationTime)&&a>=t?Yr(e,n,t):(li(Os,1&Os.current),null!==(n=Hr(e,n,t))?n.sibling:null);li(Os,1&Os.current);break;case 19:if(a=n.childExpirationTime>=t,0!=(64&e.effectTag)){if(a)return Vr(e,n,t);n.effectTag|=64}if(null!==(i=n.memoizedState)&&(i.rendering=null,i.tail=null),li(Os,Os.current),!a)return null}return Hr(e,n,t)}Tr=!1}}else Tr=!1;switch(n.expirationTime=0,n.tag){case 2:if(a=n.type,null!==e&&(e.alternate=null,n.alternate=null,n.effectTag|=2),e=n.pendingProps,i=gi(n,fi.current),ts(n,t),i=Hs(null,n,a,e,i,t),n.effectTag|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(n.tag=1,n.memoizedState=null,n.updateQueue=null,mi(a)){var s=!0;yi(n)}else s=!1;n.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,ss(n);var o=a.getDerivedStateFromProps;"function"==typeof o&&gs(n,a,o,e),i.updater=ms,n.stateNode=i,i._reactInternalFiber=n,ys(n,a,e,t),n=Lr(null,n,a,!0,s,t)}else n.tag=0,Pr(null,n,i,t),n=n.child;return n;case 16:e:{if(i=n.elementType,null!==e&&(e.alternate=null,n.alternate=null,n.effectTag|=2),e=n.pendingProps,function(e){if(-1===e._status){e._status=0;var n=e._ctor;n=n(),e._result=n,n.then((function(n){0===e._status&&(n=n.default,e._status=1,e._result=n)}),(function(n){0===e._status&&(e._status=2,e._result=n)}))}}(i),1!==i._status)throw i._result;switch(i=i._result,n.type=i,s=n.tag=function(e){if("function"==typeof e)return Cc(e)?1:0;if(null!=e){if((e=e.$$typeof)===ce)return 11;if(e===fe)return 14}return 2}(i),e=$i(i,e),s){case 0:n=Or(null,n,i,e,t);break e;case 1:n=zr(null,n,i,e,t);break e;case 11:n=Nr(null,n,i,e,t);break e;case 14:n=Mr(null,n,i,$i(i.type,e),a,t);break e}throw Error(r(306,i,""))}return n;case 0:return a=n.type,i=n.pendingProps,Or(e,n,a,i=n.elementType===a?i:$i(a,i),t);case 1:return a=n.type,i=n.pendingProps,zr(e,n,a,i=n.elementType===a?i:$i(a,i),t);case 3:if(Ur(n),a=n.updateQueue,null===e||null===a)throw Error(r(282));if(a=n.pendingProps,i=null!==(i=n.memoizedState)?i.element:null,rs(e,n),ps(n,a,null,t),(a=n.memoizedState.element)===i)Br(),n=Hr(e,n,t);else{if((i=n.stateNode.hydrate)&&(br=_t(n.stateNode.containerInfo.firstChild),yr=n,i=_r=!0),i)for(t=Cs(n,null,a,t),n.child=t;t;)t.effectTag=-3&t.effectTag|1024,t=t.sibling;else Pr(e,n,a,t),Br();n=n.child}return n;case 5:return qs(n),null===e&&Er(n),a=n.type,i=n.pendingProps,s=null!==e?e.memoizedProps:null,o=i.children,kt(a,i)?o=null:null!==s&&kt(a,s)&&(n.effectTag|=16),Ir(e,n),4&n.mode&&1!==t&&i.hidden?(n.expirationTime=n.childExpirationTime=1,n=null):(Pr(e,n,o,t),n=n.child),n;case 6:return null===e&&Er(n),null;case 13:return Yr(e,n,t);case 4:return Ns(n,n.stateNode.containerInfo),a=n.pendingProps,null===e?n.child=Es(n,null,a,t):Pr(e,n,a,t),n.child;case 11:return a=n.type,i=n.pendingProps,Nr(e,n,a,i=n.elementType===a?i:$i(a,i),t);case 7:return Pr(e,n,n.pendingProps,t),n.child;case 8:case 12:return Pr(e,n,n.pendingProps.children,t),n.child;case 10:e:{a=n.type._context,i=n.pendingProps,o=n.memoizedProps,s=i.value;var c=n.type._context;if(li(Xi,c._currentValue),c._currentValue=s,null!==o)if(c=o.value,0===(s=La(c,s)?0:0|("function"==typeof a._calculateChangedBits?a._calculateChangedBits(c,s):1073741823))){if(o.children===i.children&&!ui.current){n=Hr(e,n,t);break e}}else for(null!==(c=n.child)&&(c.return=n);null!==c;){var l=c.dependencies;if(null!==l){o=c.child;for(var p=l.firstContext;null!==p;){if(p.context===a&&0!=(p.observedBits&s)){1===c.tag&&((p=os(t,null)).tag=2,cs(c,p)),c.expirationTime<t&&(c.expirationTime=t),null!==(p=c.alternate)&&p.expirationTime<t&&(p.expirationTime=t),ns(c.return,t),l.expirationTime<t&&(l.expirationTime=t);break}p=p.next}}else o=10===c.tag&&c.type===n.type?null:c.child;if(null!==o)o.return=c;else for(o=c;null!==o;){if(o===n){o=null;break}if(null!==(c=o.sibling)){c.return=o.return,o=c;break}o=o.return}c=o}Pr(e,n,i.children,t),n=n.child}return n;case 9:return i=n.type,a=(s=n.pendingProps).children,ts(n,t),a=a(i=as(i,s.unstable_observedBits)),n.effectTag|=1,Pr(e,n,a,t),n.child;case 14:return s=$i(i=n.type,n.pendingProps),Mr(e,n,i,s=$i(i.type,s),a,t);case 15:return qr(e,n,n.type,n.pendingProps,a,t);case 17:return a=n.type,i=n.pendingProps,i=n.elementType===a?i:$i(a,i),null!==e&&(e.alternate=null,n.alternate=null,n.effectTag|=2),n.tag=1,mi(a)?(e=!0,yi(n)):e=!1,ts(n,t),As(n,a,i),ys(n,a,i,t),Lr(null,n,a,!0,e,t);case 19:return Vr(e,n,t)}throw Error(r(156,n.tag))};var _c=null,vc=null;function wc(e,n,t,a){this.tag=e,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}function Ec(e,n,t,a){return new wc(e,n,t,a)}function Cc(e){return!(!(e=e.prototype)||!e.isReactComponent)}function xc(e,n){var t=e.alternate;return null===t?((t=Ec(e.tag,n,e.key,e.mode)).elementType=e.elementType,t.type=e.type,t.stateNode=e.stateNode,t.alternate=e,e.alternate=t):(t.pendingProps=n,t.effectTag=0,t.nextEffect=null,t.firstEffect=null,t.lastEffect=null),t.childExpirationTime=e.childExpirationTime,t.expirationTime=e.expirationTime,t.child=e.child,t.memoizedProps=e.memoizedProps,t.memoizedState=e.memoizedState,t.updateQueue=e.updateQueue,n=e.dependencies,t.dependencies=null===n?null:{expirationTime:n.expirationTime,firstContext:n.firstContext,responders:n.responders},t.sibling=e.sibling,t.index=e.index,t.ref=e.ref,t}function Bc(e,n,t,a,i,s){var o=2;if(a=e,"function"==typeof e)Cc(e)&&(o=1);else if("string"==typeof e)o=5;else e:switch(e){case te:return Sc(t.children,i,s,n);case oe:o=8,i|=7;break;case ae:o=8,i|=1;break;case ie:return(e=Ec(12,t,n,8|i)).elementType=ie,e.type=ie,e.expirationTime=s,e;case le:return(e=Ec(13,t,n,i)).type=le,e.elementType=le,e.expirationTime=s,e;case pe:return(e=Ec(19,t,n,i)).elementType=pe,e.expirationTime=s,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case se:o=10;break e;case re:o=9;break e;case ce:o=11;break e;case fe:o=14;break e;case ue:o=16,a=null;break e;case de:o=22;break e}throw Error(r(130,null==e?e:typeof e,""))}return(n=Ec(o,t,n,i)).elementType=e,n.type=a,n.expirationTime=s,n}function Sc(e,n,t,a){return(e=Ec(7,e,a,n)).expirationTime=t,e}function Tc(e,n,t){return(e=Ec(6,e,null,n)).expirationTime=t,e}function Pc(e,n,t){return(n=Ec(4,null!==e.children?e.children:[],e.key,n)).expirationTime=t,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function Nc(e,n,t){this.tag=n,this.current=null,this.containerInfo=e,this.pingCache=this.pendingChildren=null,this.finishedExpirationTime=0,this.finishedWork=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=t,this.callbackNode=null,this.callbackPriority=90,this.lastExpiredTime=this.lastPingedTime=this.nextKnownPendingLevel=this.lastSuspendedTime=this.firstSuspendedTime=this.firstPendingTime=0}function Mc(e,n){var t=e.firstSuspendedTime;return e=e.lastSuspendedTime,0!==t&&t>=n&&e<=n}function qc(e,n){var t=e.firstSuspendedTime,a=e.lastSuspendedTime;t<n&&(e.firstSuspendedTime=n),(a>n||0===t)&&(e.lastSuspendedTime=n),n<=e.lastPingedTime&&(e.lastPingedTime=0),n<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function Ic(e,n){n>e.firstPendingTime&&(e.firstPendingTime=n);var t=e.firstSuspendedTime;0!==t&&(n>=t?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:n>=e.lastSuspendedTime&&(e.lastSuspendedTime=n+1),n>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=n))}function Oc(e,n){var t=e.lastExpiredTime;(0===t||t>n)&&(e.lastExpiredTime=n)}function zc(e,n,t,a){var i=n.current,s=Vo(),o=us.suspense;s=Ho(s,i,o);e:if(t){n:{if(Je(t=t._reactInternalFiber)!==t||1!==t.tag)throw Error(r(170));var c=t;do{switch(c.tag){case 3:c=c.stateNode.context;break n;case 1:if(mi(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break n}}c=c.return}while(null!==c);throw Error(r(171))}if(1===t.tag){var l=t.type;if(mi(l)){t=ki(t,l,c);break e}}t=c}else t=pi;return null===n.context?n.context=t:n.pendingContext=t,(n=os(s,o)).payload={element:e},null!==(a=void 0===a?null:a)&&(n.callback=a),cs(i,n),$o(i,s),s}function Lc(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function Uc(e,n){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime<n&&(e.retryTime=n)}function jc(e,n){Uc(e,n),(e=e.alternate)&&Uc(e,n)}function Dc(e,n,t){var a=new Nc(e,n,t=null!=t&&!0===t.hydrate),i=Ec(3,null,null,2===n?7:1===n?3:0);a.current=i,i.stateNode=a,ss(i),e[xt]=a.current,t&&0!==n&&function(e,n){var t=Ge(n);Bn.forEach((function(e){mn(e,n,t)})),Sn.forEach((function(e){mn(e,n,t)}))}(0,9===e.nodeType?e:e.ownerDocument),this._internalRoot=a}function Rc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Fc(e,n,t,a,i){var s=t._reactRootContainer;if(s){var r=s._internalRoot;if("function"==typeof i){var o=i;i=function(){var e=Lc(r);o.call(e)}}zc(n,r,e,i)}else{if(s=t._reactRootContainer=function(e,n){if(n||(n=!(!(n=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==n.nodeType||!n.hasAttribute("data-reactroot"))),!n)for(var t;t=e.lastChild;)e.removeChild(
|
