Blocksy Companion - Version 1.0.3

Version Description

  • Tested with WordPress 5.2
  • Checkbox for consent
  • Support Blocksy child themes variations
Download this release

Release Info

Developer creativethemeshq
Plugin Icon wp plugin Blocksy Companion
Version 1.0.3
Comparing to
See all releases

Code changes from version 1.0.1 to 1.0.3

Files changed (114) hide show
  1. blocksy-companion.php +1 -1
  2. framework/autoload.php +18 -2
  3. framework/dashboard.php +8 -2
  4. framework/extensions-manager-api.php +9 -4
  5. framework/extensions-manager.php +68 -4
  6. framework/extensions/cookies-consent/config.php +5 -0
  7. framework/extensions/cookies-consent/customizer.php +177 -0
  8. framework/extensions/cookies-consent/extension.php +94 -0
  9. framework/extensions/cookies-consent/global.php +44 -0
  10. framework/extensions/cookies-consent/helpers.php +88 -0
  11. framework/extensions/cookies-consent/readme.php +26 -0
  12. framework/extensions/cookies-consent/static/bundle/main.css +8 -0
  13. framework/extensions/cookies-consent/static/bundle/main.js +8 -0
  14. framework/extensions/cookies-consent/static/bundle/sync.js +1 -0
  15. framework/extensions/cookies-consent/static/images/type-1.svg +44 -0
  16. framework/extensions/cookies-consent/static/images/type-2.svg +46 -0
  17. framework/extensions/cookies-consent/static/js/main.js +81 -0
  18. framework/extensions/cookies-consent/static/js/sync.js +54 -0
  19. framework/extensions/cookies-consent/static/js/variables.js +33 -0
  20. framework/extensions/cookies-consent/static/sass/main.scss +170 -0
  21. framework/extensions/instagram/config.php +1 -1
  22. framework/extensions/instagram/ct-instagram/view.php +0 -6
  23. framework/extensions/instagram/ct-instagram/widget.php +1 -3
  24. framework/extensions/instagram/customizer.php +92 -0
  25. framework/extensions/instagram/extension.php +37 -4
  26. framework/extensions/instagram/helpers.php +238 -0
  27. framework/extensions/instagram/readme.php +42 -0
  28. framework/extensions/instagram/static/bundle/0.17a36d03c4d4439f3e19.js +1 -0
  29. framework/extensions/instagram/static/bundle/main.css +8 -0
  30. framework/extensions/instagram/static/bundle/main.js +1 -0
  31. framework/extensions/instagram/static/bundle/sync.js +1 -0
  32. framework/extensions/instagram/static/js/instagram-widget.js +29 -0
  33. framework/extensions/instagram/static/js/lazy-load-helpers.js +18 -0
  34. framework/extensions/instagram/static/js/main.js +17 -0
  35. framework/extensions/instagram/static/js/public-path.js +1 -0
  36. framework/extensions/instagram/static/js/sync.js +60 -0
  37. framework/extensions/instagram/static/js/sync/helpers.js +133 -0
  38. framework/extensions/instagram/static/sass/main.scss +73 -0
  39. framework/extensions/mailchimp/admin-static/bundle/1.4b8b242225582999eec3.js +20 -0
  40. framework/extensions/mailchimp/admin-static/bundle/2.8838a376a98402a4d731.js +1 -0
  41. framework/extensions/mailchimp/admin-static/bundle/main.js +1 -0
  42. framework/extensions/mailchimp/admin-static/bundle/sync.js +1 -0
  43. framework/extensions/mailchimp/admin-static/js/ListPicker.js +22 -0
  44. framework/extensions/mailchimp/admin-static/js/ListPicker/Implementation.js +122 -0
  45. framework/extensions/mailchimp/admin-static/js/main.js +9 -0
  46. framework/extensions/mailchimp/admin-static/js/public-path.js +1 -0
  47. framework/extensions/mailchimp/admin-static/js/sync.js +51 -0
  48. framework/extensions/mailchimp/admin-static/js/variables.js +39 -0
  49. framework/extensions/mailchimp/config.php +6 -0
  50. framework/extensions/mailchimp/ct-mailchimp/options.php +89 -0
  51. framework/extensions/mailchimp/ct-mailchimp/view.php +88 -0
  52. framework/extensions/mailchimp/ct-mailchimp/widget.php +22 -0
  53. framework/extensions/mailchimp/customizer.php +234 -0
  54. framework/extensions/mailchimp/dashboard-static/bundle/main.js +20 -0
  55. framework/extensions/mailchimp/dashboard-static/js/EditCredentials.js +157 -0
  56. framework/extensions/mailchimp/dashboard-static/js/ListPicker.js +150 -0
  57. framework/extensions/mailchimp/dashboard-static/js/Mailchimp.js +66 -0
  58. framework/extensions/mailchimp/dashboard-static/js/hooks/useActivationWithRequirements.js +82 -0
  59. framework/extensions/mailchimp/dashboard-static/js/main.js +14 -0
  60. framework/extensions/mailchimp/extension.php +110 -0
  61. framework/extensions/mailchimp/global.php +65 -0
  62. framework/extensions/mailchimp/helpers.php +106 -0
  63. framework/extensions/mailchimp/mailchimp-manager.php +120 -0
  64. framework/extensions/mailchimp/pre-boot.php +112 -0
  65. framework/extensions/mailchimp/readme.php +43 -0
  66. framework/extensions/mailchimp/static/bundle/main.css +8 -0
  67. framework/extensions/mailchimp/static/sass/main.scss +30 -0
  68. framework/extensions/mailchimp/static/sass/single-block.scss +54 -0
  69. framework/extensions/mailchimp/static/sass/widget.scss +40 -0
  70. framework/extensions/read-progress/config.php +8 -0
  71. framework/extensions/read-progress/extension.php +76 -0
  72. framework/extensions/read-progress/helpers.php +10 -0
  73. framework/extensions/read-progress/readme.php +22 -0
  74. framework/extensions/read-progress/static/bundle/1.4e041077b3d19928a037.js +1 -0
  75. framework/extensions/read-progress/static/bundle/main.css +8 -0
  76. framework/extensions/read-progress/static/bundle/main.js +1 -0
  77. framework/extensions/read-progress/static/js/implementation.js +28 -0
  78. framework/extensions/read-progress/static/js/main.js +9 -0
  79. framework/extensions/read-progress/static/js/public-path.js +1 -0
  80. framework/extensions/read-progress/static/sass/main.scss +29 -0
  81. framework/extensions/widgets/config.php +5 -0
  82. framework/extensions/widgets/extension.php +36 -0
  83. framework/extensions/widgets/static/bundle/main.css +8 -0
  84. framework/extensions/widgets/static/sass/contact-info.scss +45 -0
  85. framework/extensions/widgets/static/sass/main.scss +4 -0
  86. framework/extensions/widgets/static/sass/posts.scss +49 -0
  87. framework/extensions/widgets/widgets/ct-advertisement/options.php +84 -0
  88. framework/extensions/widgets/widgets/ct-advertisement/view.php +55 -0
  89. framework/extensions/widgets/widgets/ct-advertisement/widget.php +21 -0
  90. framework/extensions/widgets/widgets/ct-contact-info/options.php +278 -0
  91. framework/extensions/widgets/widgets/ct-contact-info/view.php +146 -0
  92. framework/extensions/widgets/widgets/ct-contact-info/widget.php +21 -0
  93. framework/extensions/widgets/widgets/ct-posts/options.php +101 -0
  94. framework/extensions/widgets/widgets/ct-posts/view.php +120 -0
  95. framework/extensions/widgets/widgets/ct-posts/widget.php +22 -0
  96. framework/extensions/widgets/widgets/ct-socials/options.php +156 -0
  97. framework/extensions/widgets/widgets/ct-socials/view.php +55 -0
  98. framework/extensions/widgets/widgets/ct-socials/widget.php +22 -0
  99. framework/features/google-analytics.php +84 -0
  100. framework/theme-integration.php +23 -0
  101. framework/widgets-manager.php +192 -0
  102. plugin.php +12 -2
  103. readme.txt +15 -1
  104. static/bundle/dashboard.css +2 -2
  105. static/bundle/dashboard.js +2 -2
  106. static/img/extensions.svg +30 -0
  107. static/js/helpers/useActivationAction.js +42 -0
  108. static/js/helpers/useExtensionReadme.js +53 -0
  109. static/js/screens/Extensions.js +59 -45
  110. static/sass/common-frontend.scss +2 -0
  111. static/sass/dashboard.scss +1 -1
  112. static/sass/extensions/extensions-config.scss +47 -0
  113. static/sass/extensions/extensions-readme.scss +40 -0
  114. static/sass/extensions/main.scss +93 -0
blocksy-companion.php CHANGED
@@ -3,7 +3,7 @@
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.0.1
7
  Author: CreativeThemes
8
  Author URI: https://creativethemes.com
9
  Text Domain: blc
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.0.3
7
  Author: CreativeThemes
8
  Author URI: https://creativethemes.com
9
  Text Domain: blc
framework/autoload.php CHANGED
@@ -24,7 +24,14 @@ class Autoloader {
24
  'ExtensionsManager' => 'framework/extensions-manager.php',
25
  'ExtensionsManagerApi' => 'framework/extensions-manager-api.php',
26
  'Dashboard' => 'framework/dashboard.php',
27
- 'ThemeIntegration' => 'framework/theme-integration.php'
 
 
 
 
 
 
 
28
  ];
29
 
30
  /**
@@ -77,7 +84,11 @@ class Autoloader {
77
  * @param string $class Class name.
78
  */
79
  private static function autoload( $class ) {
80
- if ( 0 !== strpos( $class, __NAMESPACE__ . '\\' ) ) {
 
 
 
 
81
  return;
82
  }
83
 
@@ -85,6 +96,11 @@ class Autoloader {
85
 
86
  $final_class_name = __NAMESPACE__ . '\\' . $relative_class_name;
87
 
 
 
 
 
 
88
  if ( ! class_exists( $final_class_name ) ) {
89
  self::load_class( $relative_class_name );
90
  }
24
  'ExtensionsManager' => 'framework/extensions-manager.php',
25
  'ExtensionsManagerApi' => 'framework/extensions-manager-api.php',
26
  'Dashboard' => 'framework/dashboard.php',
27
+ 'ThemeIntegration' => 'framework/theme-integration.php',
28
+
29
+ 'GoogleAnalytics' => 'framework/features/google-analytics.php',
30
+
31
+ /**
32
+ * No namespace
33
+ */
34
+ '_BlocksyWidgetFactory' => 'framework/widgets-manager.php'
35
  ];
36
 
37
  /**
84
  * @param string $class Class name.
85
  */
86
  private static function autoload( $class ) {
87
+ if (
88
+ 0 !== strpos( $class, __NAMESPACE__ . '\\' )
89
+ &&
90
+ ! isset( self::$classes_map[ '_' . $class ] )
91
+ ) {
92
  return;
93
  }
94
 
96
 
97
  $final_class_name = __NAMESPACE__ . '\\' . $relative_class_name;
98
 
99
+ if ( isset( self::$classes_map[ '_' . $relative_class_name ] ) ) {
100
+ $final_class_name = $relative_class_name;
101
+ $relative_class_name = '_' . $relative_class_name;
102
+ }
103
+
104
  if ( ! class_exists( $final_class_name ) ) {
105
  self::load_class( $relative_class_name );
106
  }
framework/dashboard.php CHANGED
@@ -6,7 +6,8 @@ class Dashboard {
6
  public function __construct() {
7
  add_action(
8
  'admin_enqueue_scripts',
9
- [ $this, 'enqueue_static' ]
 
10
  );
11
  }
12
 
@@ -16,10 +17,15 @@ class Dashboard {
16
 
17
  $data = get_plugin_data(BLOCKSY__FILE__);
18
 
 
 
 
 
 
19
  wp_enqueue_script(
20
  'blocksy-dashboard-scripts',
21
  BLOCKSY_URL . 'static/bundle/dashboard.js',
22
- ['wp-i18n', 'ct-dashboard-scripts'],
23
  $data['Version'],
24
  true
25
  );
6
  public function __construct() {
7
  add_action(
8
  'admin_enqueue_scripts',
9
+ [ $this, 'enqueue_static' ],
10
+ 100
11
  );
12
  }
13
 
17
 
18
  $data = get_plugin_data(BLOCKSY__FILE__);
19
 
20
+ $deps = apply_filters('blocksy-dashboard-scripts-dependencies', [
21
+ 'wp-i18n',
22
+ 'ct-options-scripts'
23
+ ]);
24
+
25
  wp_enqueue_script(
26
  'blocksy-dashboard-scripts',
27
  BLOCKSY_URL . 'static/bundle/dashboard.js',
28
+ $deps,
29
  $data['Version'],
30
  true
31
  );
framework/extensions-manager-api.php CHANGED
@@ -5,6 +5,11 @@ namespace Blocksy;
5
  class ExtensionsManagerApi {
6
  public function __construct() {
7
  $this->attach_ajax_actions();
 
 
 
 
 
8
  }
9
 
10
  protected $ajax_actions = [
@@ -16,14 +21,14 @@ class ExtensionsManagerApi {
16
 
17
  public function blocksy_extensions_status() {
18
  $this->check_capability( 'edit_plugins' );
 
19
 
20
- $manager = new ExtensionsManager();
21
  wp_send_json_success($manager->get_extensions());
22
  }
23
 
24
  public function blocksy_extension_activate() {
25
  $this->check_capability( 'edit_plugins' );
26
- $manager = new ExtensionsManager();
27
 
28
  $manager->activate_extension($this->get_extension_from_request());
29
 
@@ -32,7 +37,7 @@ class ExtensionsManagerApi {
32
 
33
  public function blocksy_extension_deactivate() {
34
  $this->check_capability( 'edit_plugins' );
35
- $manager = new ExtensionsManager();
36
 
37
  $manager->deactivate_extension($this->get_extension_from_request());
38
 
@@ -40,7 +45,7 @@ class ExtensionsManagerApi {
40
  }
41
 
42
  public function check_capability( $cap = 'install_plugins' ) {
43
- $manager = new ExtensionsManager();
44
 
45
  if ( ! $manager->can( $cap ) ) {
46
  wp_send_json_error();
5
  class ExtensionsManagerApi {
6
  public function __construct() {
7
  $this->attach_ajax_actions();
8
+
9
+ if (wp_doing_ajax()) {
10
+ $manager = Plugin::instance()->extensions;
11
+ $manager->do_extensions_preboot();
12
+ }
13
  }
14
 
15
  protected $ajax_actions = [
21
 
22
  public function blocksy_extensions_status() {
23
  $this->check_capability( 'edit_plugins' );
24
+ $manager = Plugin::instance()->extensions;
25
 
 
26
  wp_send_json_success($manager->get_extensions());
27
  }
28
 
29
  public function blocksy_extension_activate() {
30
  $this->check_capability( 'edit_plugins' );
31
+ $manager = Plugin::instance()->extensions;
32
 
33
  $manager->activate_extension($this->get_extension_from_request());
34
 
37
 
38
  public function blocksy_extension_deactivate() {
39
  $this->check_capability( 'edit_plugins' );
40
+ $manager = Plugin::instance()->extensions;
41
 
42
  $manager->deactivate_extension($this->get_extension_from_request());
43
 
45
  }
46
 
47
  public function check_capability( $cap = 'install_plugins' ) {
48
+ $manager = Plugin::instance()->extensions;
49
 
50
  if ( ! $manager->can( $cap ) ) {
51
  wp_send_json_error();
framework/extensions-manager.php CHANGED
@@ -20,14 +20,29 @@ class ExtensionsManager {
20
  public function __construct() {
21
  $this->read_installed_extensions();
22
 
 
 
 
 
23
  foreach ($this->get_activated_extensions() as $single_id) {
24
  $this->boot_activated_extension_for($single_id);
25
  }
 
 
 
 
 
 
 
26
 
27
- // print_r($this->extensions);
 
28
 
29
- // $this->activate_extension('simple');
30
- // $this->deactivate_extension('simple');
 
 
 
31
  }
32
 
33
  public function get_extensions() {
@@ -94,8 +109,39 @@ class ExtensionsManager {
94
  $this->extensions[$id] = [
95
  'path' => $path,
96
  '__object' => null,
97
- 'config' => $this->read_config_for($path)
 
 
98
  ];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  }
100
 
101
  private function boot_activated_extension_for($id) {
@@ -113,6 +159,24 @@ class ExtensionsManager {
113
  $this->extensions[$id]['__object'] = new $class_name();
114
  }
115
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  private function read_config_for( $file_path ) {
117
  $_extract_variables = [ 'config' => [] ];
118
 
20
  public function __construct() {
21
  $this->read_installed_extensions();
22
 
23
+ if ($this->is_dashboard_page()) {
24
+ $this->do_extensions_preboot();
25
+ }
26
+
27
  foreach ($this->get_activated_extensions() as $single_id) {
28
  $this->boot_activated_extension_for($single_id);
29
  }
30
+ }
31
+
32
+ public function do_extensions_preboot() {
33
+ foreach (array_keys($this->get_extensions()) as $single_id) {
34
+ $this->maybe_do_extension_preboot($single_id);
35
+ }
36
+ }
37
 
38
+ private function is_dashboard_page() {
39
+ global $pagenow;
40
 
41
+ $is_ct_settings =
42
+ // 'themes.php' === $pagenow &&
43
+ isset( $_GET['page'] ) && 'ct-dashboard' === $_GET['page'];
44
+
45
+ return $is_ct_settings;
46
  }
47
 
48
  public function get_extensions() {
109
  $this->extensions[$id] = [
110
  'path' => $path,
111
  '__object' => null,
112
+ 'config' => $this->read_config_for($path),
113
+ 'readme' => $this->read_readme_for($path),
114
+ 'data' => null
115
  ];
116
+
117
+ // if (method_exists())
118
+ }
119
+
120
+ private function maybe_do_extension_preboot($id) {
121
+ if (! isset($this->extensions[$id])) return false;
122
+ if (isset($this->extensions[$id]['__object_preboot'])) return;
123
+
124
+ $class_name = explode( '-', $id );
125
+ $class_name = array_map( 'ucfirst', $class_name );
126
+ $class_name = 'BlocksyExtension' . implode( '', $class_name ) . 'PreBoot';
127
+
128
+ $path = $this->extensions[$id]['path'];
129
+
130
+ if (!file_exists($path . '/pre-boot.php')) {
131
+ return;
132
+ }
133
+
134
+ require_once($path . '/pre-boot.php');
135
+
136
+ $this->extensions[$id]['__object_preboot'] = new $class_name();
137
+
138
+ if (method_exists(
139
+ $this->extensions[$id]['__object_preboot'], 'ext_data'
140
+ )) {
141
+ $this->extensions[$id]['data'] = $this->extensions[
142
+ $id
143
+ ]['__object_preboot']->ext_data();
144
+ }
145
  }
146
 
147
  private function boot_activated_extension_for($id) {
159
  $this->extensions[$id]['__object'] = new $class_name();
160
  }
161
 
162
+ private function read_readme_for($path) {
163
+ $readme = '';
164
+
165
+ ob_start();
166
+
167
+ if (is_readable($path . '/readme.php')) {
168
+ require $path . '/readme.php';
169
+ }
170
+
171
+ $readme = ob_get_clean();
172
+
173
+ if (empty(trim($readme))) {
174
+ return null;
175
+ }
176
+
177
+ return trim($readme);
178
+ }
179
+
180
  private function read_config_for( $file_path ) {
181
  $_extract_variables = [ 'config' => [] ];
182
 
framework/extensions/cookies-consent/config.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ $config = [
4
+ 'description' => __('Enable this extension in order to comply with the GDPR regulations.', 'blc')
5
+ ];
framework/extensions/cookies-consent/customizer.php ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $options = [
4
+ 'title' => __('Cookie Consent', 'blc'),
5
+ 'container' => [ 'priority' => 8 ],
6
+ 'options' => [
7
+
8
+ 'cookie_consent_section_options' => [
9
+ 'type' => 'ct-options',
10
+ 'setting' => [ 'transport' => 'postMessage' ],
11
+ 'inner-options' => [
12
+
13
+ blocksy_rand_md5() => [
14
+ 'title' => __( 'General', 'blocksy' ),
15
+ 'type' => 'tab',
16
+ 'options' => [
17
+
18
+ 'cookie_consent_type' => [
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', 'blocksy' ),
29
+ ],
30
+
31
+ 'type-2' => [
32
+ 'src' => BLOCKSY_URL . 'framework/extensions/cookies-consent/static/images/type-2.svg',
33
+ 'title' => __( 'Type 2', 'blocksy' ),
34
+ ],
35
+
36
+ ],
37
+ ],
38
+
39
+ 'cookie_consent_period' => [
40
+ 'label' => __('Cookie period', 'blc'),
41
+ 'type' => 'ct-select',
42
+ 'value' => 'onemonth',
43
+ 'design' => 'inline',
44
+ 'setting' => [ 'transport' => 'postMessage' ],
45
+ 'choices' => blocksy_ordered_keys(
46
+
47
+ [
48
+ 'onehour' => __( 'One hour', 'blc' ),
49
+ 'oneday' => __( 'One day', 'blc' ),
50
+ 'oneweek' => __( 'One week', 'blc' ),
51
+ 'onemonth' => __( 'One month', 'blc' ),
52
+ 'threemonths' => __( 'Three months', 'blc' ),
53
+ 'sixmonths' => __( 'Six months', 'blc' ),
54
+ 'oneyear' => __( 'One year', 'blc' ),
55
+ 'forever' => __('Forever', 'blc')
56
+ ]
57
+
58
+ ),
59
+ ],
60
+
61
+
62
+ 'cookie_consent_content' => [
63
+ 'label' => __( 'Content', 'blc' ),
64
+ 'type' => 'textarea',
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' => [
71
+ 'label' => __( 'Button text', 'blc' ),
72
+ 'type' => 'text',
73
+ 'design' => 'block',
74
+ 'value' => __('Accept', 'blc'),
75
+ 'setting' => [ 'transport' => 'postMessage' ],
76
+ ],
77
+
78
+ ],
79
+ ],
80
+
81
+ blocksy_rand_md5() => [
82
+ 'title' => __( 'Design', 'blocksy' ),
83
+ 'type' => 'tab',
84
+ 'options' => [
85
+
86
+ 'cookieContentColor' => [
87
+ 'label' => __( 'Content Color', 'blocksy' ),
88
+ 'type' => 'ct-color-picker',
89
+ 'design' => 'inline',
90
+ 'setting' => [ 'transport' => 'postMessage' ],
91
+
92
+ 'value' => [
93
+ 'default' => [
94
+ 'color' => 'var(--paletteColor3)',
95
+ ],
96
+ ],
97
+
98
+ 'pickers' => [
99
+ [
100
+ 'title' => __( 'Initial', 'blocksy' ),
101
+ 'id' => 'default',
102
+ ],
103
+ ],
104
+ ],
105
+
106
+ 'cookieButtonBackground' => [
107
+ 'label' => __( 'Button Color', 'blocksy' ),
108
+ 'type' => 'ct-color-picker',
109
+ 'design' => 'inline',
110
+ 'setting' => [ 'transport' => 'postMessage' ],
111
+ 'value' => [
112
+ 'default' => [
113
+ 'color' => 'var(--paletteColor1)',
114
+ ],
115
+
116
+ 'hover' => [
117
+ 'color' => 'var(--paletteColor2)',
118
+ ],
119
+ ],
120
+
121
+ 'pickers' => [
122
+ [
123
+ 'title' => __( 'Initial', 'blocksy' ),
124
+ 'id' => 'default',
125
+ ],
126
+
127
+ [
128
+ 'title' => __( 'Hover', 'blocksy' ),
129
+ 'id' => 'hover',
130
+ ],
131
+ ],
132
+ ],
133
+
134
+ 'cookieBackground' => [
135
+ 'label' => __( 'Background Color', 'blocksy' ),
136
+ 'type' => 'ct-color-picker',
137
+ 'design' => 'inline',
138
+ 'setting' => [ 'transport' => 'postMessage' ],
139
+
140
+ 'value' => [
141
+ 'default' => [
142
+ 'color' => '#ffffff',
143
+ ],
144
+ ],
145
+
146
+ 'pickers' => [
147
+ [
148
+ 'title' => __( 'Initial', 'blocksy' ),
149
+ 'id' => 'default',
150
+ ],
151
+ ],
152
+ ],
153
+
154
+ blocksy_rand_md5() => [
155
+ 'type' => 'ct-condition',
156
+ 'condition' => [ 'cookie_consent_type' => 'type-1' ],
157
+ 'options' => [
158
+
159
+ 'cookieMaxWidth' => [
160
+ 'label' => __( 'Maximum Width', 'blocksy' ),
161
+ 'type' => 'ct-slider',
162
+ 'value' => 400,
163
+ 'min' => 200,
164
+ 'max' => 500,
165
+ 'setting' => [ 'transport' => 'postMessage' ],
166
+ ],
167
+
168
+ ],
169
+ ],
170
+
171
+ ],
172
+ ],
173
+
174
+ ],
175
+ ],
176
+ ],
177
+ ];
framework/extensions/cookies-consent/extension.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
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']
14
+ );
15
+
16
+ add_action(
17
+ 'customize_preview_init',
18
+ function () {
19
+ if (! function_exists('get_plugin_data')){
20
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
21
+ }
22
+
23
+ $data = get_plugin_data(BLOCKSY__FILE__);
24
+
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
+ );
32
+ }
33
+ );
34
+
35
+ add_action('wp_enqueue_scripts', function () {
36
+ if (! function_exists('get_plugin_data')) {
37
+ require_once(ABSPATH . 'wp-admin/includes/plugin.php');
38
+ }
39
+
40
+ $data = get_plugin_data(BLOCKSY__FILE__);
41
+
42
+ if (is_admin()) {
43
+ return;
44
+ }
45
+
46
+ if (! BlocksyExtensionCookiesConsent::should_display_notification()) {
47
+ if (! is_customize_preview()) {
48
+ return;
49
+ }
50
+ }
51
+
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
+ $css, $tablet_css, $mobile_css
70
+ ) {
71
+
72
+ blocksy_get_variables_from_file(
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'] = blocksy_get_options(
87
+ dirname( __FILE__ ) . '/customizer.php',
88
+ [], false
89
+ );
90
+
91
+ return $options;
92
+ }
93
+ }
94
+
framework/extensions/cookies-consent/global.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // Cookie
4
+ $cookieContentColor = blocksy_get_colors( get_theme_mod(
5
+ 'cookieContentColor',
6
+ [ 'default' => [ 'color' => 'var(--paletteColor3)' ] ]
7
+ ));
8
+
9
+ $css->put(
10
+ ':root',
11
+ "--cookieContentColor: {$cookieContentColor['default']}"
12
+ );
13
+
14
+ $cookieButtonBackground = blocksy_get_colors( get_theme_mod(
15
+ 'cookieButtonBackground',
16
+ [
17
+ 'default' => [ 'color' => 'var(--paletteColor1)' ],
18
+ 'hover' => [ 'color' => 'var(--paletteColor2)' ],
19
+ ]
20
+ ));
21
+
22
+ $css->put(
23
+ '.cookie-notification',
24
+ "--buttonInitialColor: {$cookieButtonBackground['default']}"
25
+ );
26
+
27
+ $css->put(
28
+ '.cookie-notification',
29
+ "--buttonHoverColor: {$cookieButtonBackground['hover']}"
30
+ );
31
+
32
+ $cookieBackground = blocksy_get_colors( get_theme_mod(
33
+ 'cookieBackground',
34
+ [ 'default' => [ 'color' => '#ffffff' ] ]
35
+ ));
36
+
37
+ $css->put(
38
+ ':root',
39
+ "--cookieBackground: {$cookieBackground['default']}"
40
+ );
41
+
42
+ $cookieMaxWidth = get_theme_mod( 'cookieMaxWidth', 400 );
43
+ $css->put( ':root', '--cookieMaxWidth: ' . $cookieMaxWidth . 'px' );
44
+
framework/extensions/cookies-consent/helpers.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function blc_ext_cookies_consent_cache() {
4
+ if (! is_customize_preview()) return;
5
+
6
+ blocksy_add_customizer_preview_cache(
7
+ blocksy_html_tag(
8
+ 'div',
9
+ [ 'data-id' => 'blocksy-cookies-consent-section' ],
10
+ blocksy_ext_cookies_consent_output(true)
11
+ )
12
+ );
13
+ }
14
+
15
+ function blocksy_ext_cookies_consent_output($forced = false) {
16
+ if (! $forced) {
17
+ blc_ext_cookies_consent_cache();
18
+ }
19
+
20
+ if (! BlocksyExtensionCookiesConsent::should_display_notification()) {
21
+ if (! $forced) {
22
+ return;
23
+ }
24
+ }
25
+
26
+ $content = get_theme_mod(
27
+ 'cookie_consent_content',
28
+ __('We use cookies to ensure that we give you the best experience on our website.', 'blc')
29
+ );
30
+
31
+ $button_text = get_theme_mod('cookie_consent_button_text', __('Accept', 'blc'));
32
+ $period = get_theme_mod('cookie_consent_period', 'onemonth');
33
+ $type = get_theme_mod('cookie_consent_type', 'type-1');
34
+
35
+ $class = 'container';
36
+
37
+ if ( $type === 'type-2' ) {
38
+ $class = 'ct-container';
39
+ }
40
+
41
+ ob_start();
42
+
43
+ ?>
44
+
45
+
46
+ <div class="cookie-notification ct-fade-in-start" data-period="<?php esc_attr_e($period) ?>" data-type="<?php esc_attr_e($type) ?>">
47
+
48
+ <div class="<?php esc_attr_e($class) ?>">
49
+
50
+ <?php if (!empty($content)) { ?>
51
+ <p><?php echo esc_html($content) ?></p>
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>
58
+ <?php } ?>
59
+
60
+ </div>
61
+ </div>
62
+ <?php
63
+
64
+ return ob_get_clean();
65
+ }
66
+
67
+ function blocksy_ext_cookies_checkbox() {
68
+ ob_start();
69
+
70
+ $message = sprintf(
71
+ __('I accept the %s', 'blc'),
72
+ sprintf(
73
+ '<a href="' . site_url('/privacy-policy') . '">%s</a>',
74
+ __('Privacy Policy', 'blc')
75
+ )
76
+ );
77
+
78
+ ?>
79
+
80
+ <div class="gdpr-confirm-policy">
81
+ <input id="gdprconfirm" name="gdprconfirm" type="checkbox" required />
82
+ <label for="gdprconfirm"><?php echo $message ?></label>
83
+ </div>
84
+
85
+ <?php
86
+
87
+ return ob_get_clean();
88
+ }
framework/extensions/cookies-consent/readme.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h1><?php echo __('Instructions', 'blc'); ?></h1>
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
+ <b>
10
+ <?php echo __('Customizer', 'blc') ?>
11
+ </b>
12
+ <i>
13
+ <?php
14
+ echo sprintf(
15
+ __('Navigate to %s and customize the notification to meet your needs.', 'blc'),
16
+ sprintf(
17
+ '<code>%s</code>',
18
+ __('Customizer ➝ Cookie Consent', 'blc')
19
+ )
20
+ );
21
+ ?>
22
+ </i>
23
+ </li>
24
+ </ul>
25
+
26
+
framework/extensions/cookies-consent/static/bundle/main.css ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /**
2
+ * - v1.0.3
3
+ *
4
+ * Copyright (c) 2019
5
+ * Licensed GPLv2+
6
+ */
7
+
8
+ .cookie-notification{position:fixed;left:0;bottom:0;z-index:999999;color:var(--cookieContentColor)}@media (max-width: 479.98px){.cookie-notification>div{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}}@media (max-width: 689.98px){.cookie-notification{right:0}.cookie-notification>div{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-top:15px;padding-bottom:15px}}@media (max-width: 689.98px){.cookie-notification[data-type='type-1']{background:var(--cookieBackground)}}@media (min-width: 690px){.cookie-notification[data-type='type-1']{padding:0 25px 25px 25px}.cookie-notification[data-type='type-1'] p{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(--cookieBackground);-webkit-box-shadow:0px 12px 18px -6px rgba(34,56,101,0.2);box-shadow:0px 12px 18px -6px rgba(34,56,101,0.2);padding:25px 40px 25px 25px;border-radius:3px;max-width:var(--cookieMaxWidth)}}.cookie-notification[data-type='type-2']{right:0;background:var(--cookieBackground)}@media (min-width: 690px){.cookie-notification[data-type='type-2']{padding:15px 0}.cookie-notification[data-type='type-2'] .ct-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack: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 p{opacity:0.8;line-height:1.4}@media (max-width: 479.98px){.cookie-notification p{text-align:center;margin-bottom:15px}}@media (max-width: 689.98px){.cookie-notification p{font-size:13px}}@media (min-width: 690px){.cookie-notification p{font-size:14px}}.cookie-notification .ct-accept{font-size:13px;font-weight:500;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;color:#fff;height:35px;padding:0 20px;border:none;border-radius:3px;background-color:var(--buttonInitialColor);-webkit-transition:color 0.2s ease, background 0.2s ease, -webkit-transform 0.2s ease;transition:color 0.2s ease, background 0.2s ease, -webkit-transform 0.2s ease;transition:color 0.2s ease, transform 0.2s ease, background 0.2s ease;transition:color 0.2s ease, transform 0.2s ease, background 0.2s ease, -webkit-transform 0.2s ease}.cookie-notification .ct-accept:hover{background-color:var(--buttonHoverColor)}.cookie-notification .ct-accept:focus{outline: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{position:absolute;top:0;right:0;border:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:45px;height:45px;padding:0;opacity:0.5;color:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;-webkit-transition:opacity 0.2s ease;transition:opacity 0.2s ease}.cookie-notification .ct-close:focus{outline:none}.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{-webkit-transition:all 0.3s ease;transition:all 0.3s ease}.cookie-notification.ct-fade-in-start{opacity:0;-webkit-transform:translate3d(0, 15px, 0);transform:translate3d(0, 15px, 0)}.cookie-notification.ct-fade-end{opacity:0;-webkit-transform:translate3d(0, 15px, 0);transform:translate3d(0, 15px, 0)}
framework/extensions/cookies-consent/static/bundle/main.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
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,n){var o,r;
2
+ /*!
3
+ * JavaScript Cookie v2.2.0
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===(r="function"==typeof(o=i)?o.call(t,n,t,e):o)||(e.exports=r),!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 o in n)t[o]=n[o]}return t}return function t(n){function o(t,r,i){var c;if("undefined"!=typeof document){if(arguments.length>1){if("number"==typeof(i=e({path:"/"},o.defaults,i)).expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*i.expires),i.expires=a}i.expires=i.expires?i.expires.toUTCString():"";try{c=JSON.stringify(r),/^[\{\[]/.test(c)&&(r=c)}catch(e){}r=n.write?n.write(r,t):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=(t=(t=encodeURIComponent(String(t))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);var s="";for(var u in i)i[u]&&(s+="; "+u,!0!==i[u]&&(s+="="+i[u]));return document.cookie=t+"="+r+s}t||(c={});for(var f=document.cookie?document.cookie.split("; "):[],d=/(%[0-9A-Z]{2})+/g,l=0;l<f.length;l++){var p=f[l].split("="),v=p.slice(1).join("=");this.json||'"'!==v.charAt(0)||(v=v.slice(1,-1));try{var m=p[0].replace(d,decodeURIComponent);if(v=n.read?n.read(v,m):n(v,m)||v.replace(d,decodeURIComponent),this.json)try{v=JSON.parse(v)}catch(e){}if(t===m){c=v;break}t||(c[m]=v)}catch(e){}}return c}}return o.set=o,o.get=function(e){return o.call(o,e)},o.getJSON=function(){return o.apply({json:!0},[].slice.call(arguments))},o.defaults={},o.remove=function(t,n){o(t,"",e(n,{expires:-1}))},o.withConverter=t,o}(function(){})})},function(e,t,n){"use strict";n.r(t);n(2);var o=n(0),r=n.n(o);var i=function(){var e=document.querySelector(".cookie-notification");e&&(requestAnimationFrame(function(){e.classList.remove("ct-fade-in-start"),e.classList.add("ct-fade-in-end"),c(e,function(){e.classList.remove("ct-fade-in-end")})}),[].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.querySelectorAll("button"))).map(function(t){t.addEventListener("click",function(n){if(n.preventDefault(),t.classList.contains("ct-accept")){r.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"),c(e,function(){e.parentNode.removeChild(e)})})})}))};function c(e,t){setTimeout(function(){t()},300)}document.addEventListener("DOMContentLoaded",function(){i(),window.ctEvents.on("blocksy:cookies:init",function(){i()})})},function(e,t){e.exports=window.ctEvents}]);
framework/extensions/cookies-consent/static/bundle/sync.js ADDED
@@ -0,0 +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()})})}]);
framework/extensions/cookies-consent/static/images/type-1.svg ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 23.0.3, 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:#6E747A;}
9
+ .st3{fill:#565D66;}
10
+ .st4{fill:#4F5459;}
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,15h78v14H11V15z"/>
15
+ <path class="st2" 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"/>
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="st0" d="M25.5,13.4h-3c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h3c0.3,0,0.5,0.2,0.5,0.5S25.8,13.4,25.5,13.4z
19
+ M31.5,13.4h-3c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h3c0.3,0,0.5,0.2,0.5,0.5S31.8,13.4,31.5,13.4z M37.5,13.4h-3
20
+ c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h3c0.3,0,0.5,0.2,0.5,0.5S37.8,13.4,37.5,13.4z"/>
21
+ <circle class="st0" cx="77.1" cy="12.9" r="0.9"/>
22
+ <circle class="st0" cx="73.3" cy="12.9" r="0.9"/>
23
+ <circle class="st0" cx="69.5" cy="12.9" r="0.9"/>
24
+ <path class="st4" d="M77.5,22.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,22.5,77.5,22.5z
25
+ M70.5,22.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,22.5,70.5,22.5z M63.5,22.5h-4
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="st2" 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
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.1v0c0-1.1,0.9-2.1,2.1-2.1h7.3c1.1,0,2.1,0.9,2.1,2.1v0
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
42
+ C39.7,49.4,39.2,49.9,38.7,49.9z"/>
43
+ </g>
44
+ </svg>
framework/extensions/cookies-consent/static/images/type-2.svg ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 23.0.3, 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:#6E747A;}
8
+ .st2{fill:#EDEFF0;}
9
+ .st3{fill:#565D66;}
10
+ .st4{fill:#4F5459;}
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
+ <g>
15
+ <rect x="10.4" y="59.2" class="st1" width="79.1" height="13"/>
16
+ <path class="st0" d="M32.3,67.5h-17c-0.3,0-0.5-0.2-0.5-0.5c0-0.3,0.2-0.5,0.5-0.5h17c0.3,0,0.5,0.2,0.5,0.5
17
+ C32.8,67.3,32.6,67.5,32.3,67.5z"/>
18
+ <path class="st0" d="M45.5,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
19
+ C46,67.3,45.8,67.5,45.5,67.5z"/>
20
+ <path class="st0" d="M56.7,67.5h-9.2c-0.3,0-0.5-0.2-0.5-0.5c0-0.3,0.2-0.5,0.5-0.5h9.2c0.3,0,0.5,0.2,0.5,0.5
21
+ C57.2,67.3,57,67.5,56.7,67.5z"/>
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,15h78v14H11V15z"/>
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="st0" d="M25.5,13.4h-3c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h3c0.3,0,0.5,0.2,0.5,0.5S25.8,13.4,25.5,13.4z
33
+ M31.5,13.4h-3c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h3c0.3,0,0.5,0.2,0.5,0.5S31.8,13.4,31.5,13.4z M37.5,13.4h-3
34
+ c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h3c0.3,0,0.5,0.2,0.5,0.5S37.8,13.4,37.5,13.4z"/>
35
+ <circle class="st0" cx="77.1" cy="12.9" r="0.9"/>
36
+ <circle class="st0" cx="73.3" cy="12.9" r="0.9"/>
37
+ <circle class="st0" cx="69.5" cy="12.9" r="0.9"/>
38
+ <path class="st4" d="M77.5,22.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,22.5,77.5,22.5z
39
+ M70.5,22.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,22.5,70.5,22.5z M63.5,22.5h-4
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>
framework/extensions/cookies-consent/static/js/main.js ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import ctEvents from 'ct-events'
2
+ import cookie from 'js-cookie'
3
+
4
+ const initCookies = () => {
5
+ const notification = document.querySelector('.cookie-notification')
6
+
7
+ if (!notification) return
8
+
9
+ requestAnimationFrame(() => {
10
+ notification.classList.remove('ct-fade-in-start')
11
+ notification.classList.add('ct-fade-in-end')
12
+
13
+ whenTransitionEnds(notification, () => {
14
+ notification.classList.remove('ct-fade-in-end')
15
+ })
16
+ })
17
+ ;[...notification.querySelectorAll('button')].map(el => {
18
+ el.addEventListener('click', e => {
19
+ e.preventDefault()
20
+
21
+ if (el.classList.contains('ct-accept')) {
22
+ const periods = {
23
+ onehour: 36e5,
24
+ oneday: 864e5,
25
+ oneweek: 7 * 864e5,
26
+ onemonth: 31 * 864e5,
27
+ threemonths: 3 * 31 * 864e5,
28
+ sixmonths: 6 * 31 * 864e5,
29
+ oneyear: 365 * 864e5,
30
+ forever: 10000 * 864e5
31
+ }
32
+
33
+ cookie.set('blocksy_cookies_consent_accepted', 'true', {
34
+ expires: new Date(
35
+ new Date() * 1 +
36
+ periods[el.closest('[data-period]').dataset.period]
37
+ )
38
+ })
39
+ }
40
+
41
+ notification.classList.add('ct-fade-start')
42
+
43
+ requestAnimationFrame(() => {
44
+ notification.classList.remove('ct-fade-start')
45
+ notification.classList.add('ct-fade-end')
46
+
47
+ whenTransitionEnds(notification, () => {
48
+ notification.parentNode.removeChild(notification)
49
+ })
50
+ })
51
+ })
52
+ })
53
+ }
54
+
55
+ document.addEventListener('DOMContentLoaded', () => {
56
+ initCookies()
57
+
58
+ window.ctEvents.on('blocksy:cookies:init', () => {
59
+ initCookies()
60
+ })
61
+ })
62
+
63
+ function whenTransitionEnds(el, cb) {
64
+ setTimeout(() => {
65
+ cb()
66
+ }, 300)
67
+ return
68
+
69
+ const end = () => {
70
+ el.removeEventListener('transitionend', onEnd)
71
+ cb()
72
+ }
73
+
74
+ const onEnd = e => {
75
+ if (e.target === el) {
76
+ end()
77
+ }
78
+ }
79
+
80
+ el.addEventListener('transitionend', onEnd)
81
+ }
framework/extensions/cookies-consent/static/js/sync.js ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import './variables'
2
+
3
+ import { renderWithStrategy } from '../../../instagram/static/js/sync/helpers'
4
+
5
+ const maybeAnimateCookiesConsent = cb => {
6
+ if (document.querySelector('.cookie-notification')) return
7
+
8
+ renderWithStrategy({
9
+ fragment_id: 'blocksy-cookies-consent-section',
10
+ selector: '.cookie-notification',
11
+ parent_selector: '#main-container'
12
+ })
13
+
14
+ return true
15
+ }
16
+
17
+ const render = () => {
18
+ const didInsert = maybeAnimateCookiesConsent()
19
+
20
+ const notification = document.querySelector('.cookie-notification')
21
+
22
+ if (!notification) {
23
+ return
24
+ }
25
+
26
+ notification.querySelector('p').innerHTML = wp.customize(
27
+ 'cookie_consent_content'
28
+ )()
29
+
30
+ notification.querySelector('button.ct-accept').innerHTML = wp.customize(
31
+ 'cookie_consent_button_text'
32
+ )()
33
+
34
+ const type = wp.customize('cookie_consent_type')()
35
+
36
+ notification.dataset.type = type
37
+
38
+ notification.firstElementChild.classList.remove('ct-container', 'container')
39
+ notification.firstElementChild.classList.add(
40
+ type === 'type-1' ? 'container' : 'ct-container'
41
+ )
42
+
43
+ if (didInsert) {
44
+ setTimeout(() => window.ctEvents.trigger('blocksy:cookies:init'))
45
+ }
46
+ }
47
+
48
+ wp.customize('cookie_consent_content', val =>
49
+ val.bind(to => {
50
+ render()
51
+ })
52
+ )
53
+ wp.customize('cookie_consent_button_text', val => val.bind(to => render()))
54
+ wp.customize('cookie_consent_type', val => val.bind(to => render()))
framework/extensions/cookies-consent/static/js/variables.js ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { handleVariablesFor } from 'customizer-sync-helpers'
2
+
3
+ handleVariablesFor({
4
+ // Cookie
5
+ cookieContentColor: {
6
+ variable: 'cookieContentColor',
7
+ type: 'color'
8
+ },
9
+
10
+ cookieBackground: {
11
+ variable: 'cookieBackground',
12
+ type: 'color'
13
+ },
14
+
15
+ cookieButtonBackground: [
16
+ {
17
+ selector: '.cookie-notification',
18
+ variable: 'buttonInitialColor',
19
+ type: 'color:default'
20
+ },
21
+
22
+ {
23
+ selector: '.cookie-notification',
24
+ variable: 'buttonHoverColor',
25
+ type: 'color:hover'
26
+ }
27
+ ],
28
+
29
+ cookieMaxWidth: {
30
+ variable: 'cookieMaxWidth',
31
+ unit: 'px'
32
+ }
33
+ })
framework/extensions/cookies-consent/static/sass/main.scss ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../../../../../static/sass/common-frontend';
2
+
3
+ .cookie-notification {
4
+ position: fixed;
5
+ left: 0;
6
+ bottom: 0;
7
+ z-index: 999999;
8
+ color: var(--cookieContentColor);
9
+
10
+ @include media-breakpoint-down (xs) {
11
+ > div {
12
+ flex-direction: column;
13
+ }
14
+ }
15
+
16
+ @include media-breakpoint-down (sm) {
17
+ right: 0;
18
+
19
+ > div {
20
+ display: flex;
21
+ align-items: center;
22
+ padding-top: 15px;
23
+ padding-bottom: 15px;
24
+ }
25
+ }
26
+
27
+ // type 1
28
+ &[data-type='type-1'] {
29
+ @include media-breakpoint-down (sm) {
30
+ background: var(--cookieBackground);
31
+ }
32
+
33
+ @include media-breakpoint-up (md) {
34
+ padding: 0 25px 25px 25px;
35
+
36
+ p {
37
+ margin-bottom: 15px;
38
+ max-width: 90%;
39
+ }
40
+ }
41
+
42
+ .container {
43
+ position: relative;
44
+
45
+ @include media-breakpoint-down (sm) {
46
+ width: 88%;
47
+ margin: 0 auto;
48
+ }
49
+
50
+ @include media-breakpoint-up (md) {
51
+ background: var(--cookieBackground);
52
+ box-shadow: 0px 12px 18px -6px rgba(34, 56, 101, 0.2);
53
+ padding: 25px 40px 25px 25px;
54
+ border-radius: 3px;
55
+ max-width: var(--cookieMaxWidth);
56
+ }
57
+ }
58
+ }
59
+
60
+ // type 2
61
+ &[data-type='type-2'] {
62
+ right: 0;
63
+ background: var(--cookieBackground);
64
+
65
+ @include media-breakpoint-up (md) {
66
+ padding: 15px 0;
67
+
68
+ .ct-container {
69
+ display: flex;
70
+ align-items: center;
71
+ justify-content: center;
72
+ }
73
+
74
+ .ct-accept {
75
+ margin-left: 25px;
76
+ }
77
+ }
78
+
79
+ .ct-close {
80
+ display: none;
81
+ }
82
+ }
83
+
84
+ p {
85
+ opacity: 0.8;
86
+ line-height: 1.4;
87
+
88
+ @include media-breakpoint-down (xs) {
89
+ text-align: center;
90
+ margin-bottom: 15px;
91
+ }
92
+
93
+ @include media-breakpoint-down (sm) {
94
+ font-size: 13px;
95
+ }
96
+
97
+ @include media-breakpoint-up (md) {
98
+ font-size: 14px;
99
+ }
100
+ }
101
+
102
+ .ct-accept {
103
+ font-size: 13px;
104
+ font-weight: 500;
105
+
106
+ @include button((
107
+ height: 35px,
108
+ padding: 20px,
109
+ shadow: false,
110
+ translate: false
111
+ ));
112
+
113
+ @include media-breakpoint-down (xs) {
114
+ width: 100%;
115
+ }
116
+
117
+ @include media-breakpoint-only (sm) {
118
+ margin-left: 20px;
119
+ }
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
+ padding: 0;
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;
146
+ }
147
+
148
+ @include media-breakpoint-down (sm) {
149
+ display: none;
150
+ }
151
+ }
152
+
153
+ // animation
154
+ &.ct-fade-in-start,
155
+ &.ct-fade-in-end,
156
+ &.ct-fade-start,
157
+ &.ct-fade-end {
158
+ transition: all 0.3s ease;
159
+ }
160
+
161
+ &.ct-fade-in-start {
162
+ opacity: 0;
163
+ transform: translate3d(0, 15px, 0);
164
+ }
165
+
166
+ &.ct-fade-end {
167
+ opacity: 0;
168
+ transform: translate3d(0, 15px, 0);
169
+ }
170
+ }
framework/extensions/instagram/config.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  $config = [
4
- 'description' => __('Instagram Widget', 'blc')
5
  ];
6
 
7
 
1
  <?php
2
 
3
  $config = [
4
+ 'description' => __('Show your instagram feed anywhere on your site with the help of a widget or a block.', 'blc')
5
  ];
6
 
7
 
framework/extensions/instagram/ct-instagram/view.php CHANGED
@@ -16,7 +16,6 @@ if ( empty( $title ) ) {
16
 
17
  $images_per_row = blocksy_akg( 'instagram_images_per_row', $atts, '2' );
18
 
19
-
20
  echo $before_widget . $before_title . $title . $after_title;
21
 
22
  $photos_number = intval( blocksy_default_akg( 'photos_number', $atts, '6' ) );
@@ -30,11 +29,6 @@ $widget_data = json_encode(
30
 
31
  ?>
32
 
33
- <?php if ( false && ! empty( $instagram_photos ) ) { ?>
34
- <ul data-row="<?php echo $images_per_row; ?>">
35
- </ul>
36
- <?php } ?>
37
-
38
  <ul
39
  class="ct-loading"
40
  data-widget='<?php echo $widget_data; ?>'
16
 
17
  $images_per_row = blocksy_akg( 'instagram_images_per_row', $atts, '2' );
18
 
 
19
  echo $before_widget . $before_title . $title . $after_title;
20
 
21
  $photos_number = intval( blocksy_default_akg( 'photos_number', $atts, '6' ) );
29
 
30
  ?>
31
 
 
 
 
 
 
32
  <ul
33
  class="ct-loading"
34
  data-widget='<?php echo $widget_data; ?>'
framework/extensions/instagram/ct-instagram/widget.php CHANGED
@@ -1,8 +1,6 @@
1
  <?php
2
 
3
- require_once dirname( __FILE__ ) . '/helpers.php';
4
-
5
- class Blocksy_Widget_Ct_Instagram extends Blocksy_Widget_Factory {
6
  protected function get_config() {
7
  return [
8
  'name' => 'Instagram',
1
  <?php
2
 
3
+ class Blocksy_Widget_Ct_Instagram extends BlocksyWidgetFactory {
 
 
4
  protected function get_config() {
5
  return [
6
  'name' => 'Instagram',
framework/extensions/instagram/customizer.php ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $options = [
4
+ 'title' => __('Instagram Extension', 'blc'),
5
+ 'container' => [ 'priority' => 8 ],
6
+ 'options' => [
7
+
8
+ 'instagram_section_options' => [
9
+ 'type' => 'ct-options',
10
+ 'setting' => [ 'transport' => 'postMessage' ],
11
+ 'inner-options' => [
12
+ 'insta_block_enabled' => [
13
+ 'label' => __( 'Instagram section', 'blc' ),
14
+ 'type' => 'ct-switch',
15
+ 'value' => 'no',
16
+ 'setting' => [ 'transport' => 'postMessage' ],
17
+ ],
18
+
19
+ blocksy_rand_md5() => [
20
+ 'type' => 'ct-condition',
21
+ 'condition' => [ 'insta_block_enabled' => 'yes' ],
22
+ 'options' => [
23
+
24
+ 'insta_block_location' => [
25
+ 'label' => __( 'Block Location', 'blc' ),
26
+ 'type' => 'ct-radio',
27
+ 'value' => 'above',
28
+ 'view' => 'text',
29
+ 'design' => 'block',
30
+ 'setting' => [ 'transport' => 'postMessage' ],
31
+ 'choices' => [
32
+ 'above' => __( 'Above Footer', 'blc' ),
33
+ 'below' => __( 'Below Footer', 'blc' ),
34
+ ],
35
+ ],
36
+
37
+ blocksy_rand_md5() => [
38
+ 'type' => 'ct-divider',
39
+ 'attr' => [ 'data-type' => 'small' ],
40
+ ],
41
+
42
+ 'insta_block_username' => [
43
+ 'label' => __( 'Username', 'blc' ),
44
+ 'type' => 'text',
45
+ 'design' => 'inline',
46
+ 'value' => '',
47
+ 'setting' => [ 'transport' => 'postMessage' ],
48
+ ],
49
+
50
+ 'insta_block_count' => [
51
+ 'type' => 'ct-number',
52
+ 'label' => __( 'Images Count', 'blc' ),
53
+ 'min' => 1,
54
+ 'max' => 18,
55
+ 'value' => 6,
56
+ 'design' => 'inline',
57
+ 'setting' => [ 'transport' => 'postMessage' ],
58
+ ],
59
+
60
+ blocksy_rand_md5() => [
61
+ 'type' => 'ct-divider',
62
+ 'attr' => [ 'data-type' => 'small' ],
63
+ ],
64
+
65
+ 'insta_block_visibility' => [
66
+ 'label' => __( 'Visibility', 'blc' ),
67
+ 'type' => 'ct-visibility',
68
+ 'design' => 'block',
69
+ 'setting' => [ 'transport' => 'postMessage' ],
70
+ 'value' => [
71
+ 'desktop' => true,
72
+ 'tablet' => true,
73
+ 'mobile' => false,
74
+ ],
75
+
76
+ 'choices' => blocksy_ordered_keys([
77
+ 'desktop' => __( 'Desktop', 'blc' ),
78
+ 'tablet' => __( 'Tablet', 'blc' ),
79
+ 'mobile' => __( 'Mobile', 'blc' ),
80
+ ]),
81
+ ],
82
+
83
+
84
+ ],
85
+ ],
86
+
87
+
88
+ ],
89
+ ],
90
+ ],
91
+ ];
92
+
framework/extensions/instagram/extension.php CHANGED
@@ -1,7 +1,14 @@
1
  <?php
2
 
 
 
3
  class BlocksyExtensionInstagram {
4
  public function __construct() {
 
 
 
 
 
5
  add_filter('blocksy_widgets_paths', function ($all_widgets) {
6
  $all_widgets[] = dirname(__FILE__) . '/ct-instagram';
7
  return $all_widgets;
@@ -18,14 +25,14 @@ class BlocksyExtensionInstagram {
18
 
19
  wp_enqueue_style(
20
  'blocksy-ext-instagram-styles',
21
- BLOCKSY_URL . 'framework/extensions/instagram/ct-instagram/static/bundle/main.css',
22
  [],
23
  $data['Version']
24
  );
25
 
26
  wp_enqueue_script(
27
  'blocksy-ext-instagram-scripts',
28
- BLOCKSY_URL . 'framework/extensions/instagram/ct-instagram/static/bundle/main.js',
29
  [],
30
  $data['Version'],
31
  true
@@ -33,7 +40,7 @@ class BlocksyExtensionInstagram {
33
 
34
  $data = [
35
  'ajax_url' => admin_url( 'admin-ajax.php' ),
36
- 'public_url' => BLOCKSY_URL . 'framework/extensions/instagram/ct-instagram/static/bundle/',
37
  ];
38
 
39
  wp_localize_script(
@@ -42,7 +49,33 @@ class BlocksyExtensionInstagram {
42
  $data
43
  );
44
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  }
46
- }
47
 
 
 
 
 
 
48
 
 
 
 
1
  <?php
2
 
3
+ require_once dirname( __FILE__ ) . '/helpers.php';
4
+
5
  class BlocksyExtensionInstagram {
6
  public function __construct() {
7
+ add_filter(
8
+ 'blocksy_extensions_customizer_options',
9
+ [$this, 'add_options_panel']
10
+ );
11
+
12
  add_filter('blocksy_widgets_paths', function ($all_widgets) {
13
  $all_widgets[] = dirname(__FILE__) . '/ct-instagram';
14
  return $all_widgets;
25
 
26
  wp_enqueue_style(
27
  'blocksy-ext-instagram-styles',
28
+ BLOCKSY_URL . 'framework/extensions/instagram/static/bundle/main.css',
29
  [],
30
  $data['Version']
31
  );
32
 
33
  wp_enqueue_script(
34
  'blocksy-ext-instagram-scripts',
35
+ BLOCKSY_URL . 'framework/extensions/instagram/static/bundle/main.js',
36
  [],
37
  $data['Version'],
38
  true
40
 
41
  $data = [
42
  'ajax_url' => admin_url( 'admin-ajax.php' ),
43
+ 'public_url' => BLOCKSY_URL . 'framework/extensions/instagram/static/bundle/',
44
  ];
45
 
46
  wp_localize_script(
49
  $data
50
  );
51
  });
52
+
53
+ add_action(
54
+ 'customize_preview_init',
55
+ function () {
56
+ if (! function_exists('get_plugin_data')){
57
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
58
+ }
59
+
60
+ $data = get_plugin_data(BLOCKSY__FILE__);
61
+
62
+ wp_enqueue_script(
63
+ 'blocksy-instagram-customizer-sync',
64
+ BLOCKSY_URL . 'framework/extensions/instagram/static/bundle/sync.js',
65
+ [ 'customize-preview' ],
66
+ $data['Version'],
67
+ true
68
+ );
69
+ }
70
+ );
71
  }
 
72
 
73
+ public function add_options_panel($options) {
74
+ $options['instagram_ext'] = blocksy_get_options(
75
+ dirname( __FILE__ ) . '/customizer.php',
76
+ [], false
77
+ );
78
 
79
+ return $options;
80
+ }
81
+ }
framework/extensions/instagram/helpers.php ADDED
@@ -0,0 +1,238 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ add_action( 'wp_ajax_blocksy_widget_instagram', 'blocksy_widget_instagram_generate_html' );
4
+ add_action( 'wp_ajax_nopriv_blocksy_widget_instagram', 'blocksy_widget_instagram_generate_html' );
5
+
6
+ function blocksy_widget_instagram_generate_html() {
7
+ $instagram_photos = blocksy_get_instagram_photos(
8
+ sanitize_text_field( $_GET['username'] ),
9
+ intval( sanitize_text_field( $_GET['limit'] ) )
10
+ );
11
+
12
+ ?>
13
+ <?php foreach ( $instagram_photos as $photo ) { ?>
14
+ <li
15
+ <?php
16
+ if ( $photo['is_video'] ) {
17
+ echo ' class="ct-is-video"';}
18
+ ?>
19
+ >
20
+ <?php
21
+ echo blocksy_simple_image(
22
+ $photo['img'],
23
+ [
24
+ 'tag_name' => 'a',
25
+ 'html_atts' => [
26
+ 'target' => '_blank',
27
+ 'href' => 'https://instagram.com/p/' . $photo['code'],
28
+ ],
29
+ 'img_atts' => [
30
+ 'alt' => esc_attr( $photo['description'] ),
31
+ 'title' => esc_attr( $photo['description'] ),
32
+ ],
33
+ ]
34
+ )
35
+ ?>
36
+ </li>
37
+ <?php } ?>
38
+
39
+ <?php
40
+
41
+ wp_die();
42
+ }
43
+
44
+ function blocksy_get_instagram_photos( $username, $items = 10 ) {
45
+ $username = trim($username);
46
+
47
+ if (! $username) {
48
+ return [];
49
+ }
50
+
51
+ $transient_name = 'blocksy_instagram_ext_' . md5(
52
+ json_encode(
53
+ [
54
+ $username,
55
+ // $items
56
+ ]
57
+ )
58
+ );
59
+
60
+ $remote_images = [];
61
+
62
+ if ( $maybe_transient_data = get_transient( $transient_name ) ) {
63
+ $remote_images = $maybe_transient_data;
64
+ } else {
65
+ $source = wp_remote_get('http://instagram.com/' . $username);
66
+
67
+ $remote_response = true;
68
+
69
+ if ( is_wp_error( $source ) ) {
70
+ $remote_response = null;
71
+ }
72
+
73
+ if ( 200 !== wp_remote_retrieve_response_code( $source ) ) {
74
+ $remote_response = null;
75
+ }
76
+
77
+ if ( ! $remote_response ) {
78
+ return [];
79
+ }
80
+
81
+ // Get json info about the user.
82
+ preg_match( '|window._sharedData = {(.+?)};</script>|', $source['body'], $matches );
83
+
84
+ if ( ! isset( $matches[1] ) ) {
85
+ return [];
86
+ }
87
+
88
+ $json_data = "{{$matches[1]}}";
89
+ $json_data = json_decode( $json_data, true );
90
+
91
+ if ( ! $json_data ) {
92
+ return [];
93
+ }
94
+
95
+ if (isset( $json_data['entry_data']['ProfilePage'][0]['graphql']['user']['edge_owner_to_timeline_media']['edges'] )) {
96
+ $remote_images = $json_data['entry_data'][
97
+ 'ProfilePage'
98
+ ][0]['graphql']['user']['edge_owner_to_timeline_media']['edges'];
99
+ } else {
100
+ return $instagram_photos;
101
+ }
102
+ }
103
+
104
+ if (! $remote_images) {
105
+ return [];
106
+ }
107
+
108
+ $instagram_photos = [];
109
+
110
+ foreach ( $remote_images as $image ) {
111
+ if ( count( $instagram_photos ) >= $items ) {
112
+ break;
113
+ }
114
+
115
+ $image = $image['node'];
116
+
117
+ if ( ! isset( $image['edge_media_to_caption'] ) ) {
118
+ $image['edge_media_to_caption'] = [
119
+ 'edges' => [
120
+ ['node' => ['text' => '']]
121
+ ]
122
+ ];
123
+ }
124
+
125
+ if ( empty( $iamge['edge_media_to_caption']['edges'] ) ) {
126
+ $image['edge_media_to_caption'] = [
127
+ 'edges' => [
128
+ [
129
+ 'node' => ['text' => '']
130
+ ]
131
+ ]
132
+ ];
133
+ }
134
+
135
+ $instagram_photos[] = [
136
+ 'code' => $image['shortcode'],
137
+ 'img' => $image['thumbnail_src'],
138
+ 'likes' => $image['edge_liked_by']['count'],
139
+ 'description' => $image['edge_media_to_caption']['edges'][0]['node']['text'],
140
+ 'is_video' => $image['is_video'],
141
+ ];
142
+ }
143
+
144
+ set_transient( $transient_name, $remote_images, 7 * 24 * HOUR_IN_SECONDS );
145
+
146
+ return $instagram_photos;
147
+ }
148
+
149
+ function blc_output_instagram_section_cache() {
150
+ if (! is_customize_preview()) return;
151
+
152
+ blocksy_add_customizer_preview_cache(
153
+ blocksy_html_tag(
154
+ 'div',
155
+ [ 'data-id' => 'blocksy-instagram-section' ],
156
+ blc_output_instagram_section(true)
157
+ )
158
+ );
159
+ }
160
+
161
+ function blc_output_instagram_section($forced = false) {
162
+ if (! $forced) {
163
+ blc_output_instagram_section_cache();
164
+ }
165
+
166
+ if (get_theme_mod('insta_block_enabled', 'no') !== 'yes') {
167
+ if (! $forced) {
168
+ return '';
169
+ }
170
+ }
171
+
172
+ $actual_location = get_theme_mod('insta_block_location', 'above');
173
+
174
+ $username = get_theme_mod( 'insta_block_username', '');
175
+
176
+ if (empty($username)) {
177
+ return '';
178
+ }
179
+
180
+ $photos_number = intval(get_theme_mod('insta_block_count', '6'));
181
+
182
+ if ($forced) {
183
+ $photos_number = 18;
184
+ }
185
+
186
+ $widget_data = json_encode(
187
+ [
188
+ 'limit' => $photos_number,
189
+ 'username' => get_theme_mod( 'insta_block_username', ''),
190
+ ]
191
+ );
192
+
193
+ $class = 'ct-instagram-block ct-instagram-widget';
194
+
195
+ $class .= ' ' . blocksy_visibility_classes(
196
+ get_theme_mod('insta_block_visibility', [
197
+ 'desktop' => true,
198
+ 'tablet' => true,
199
+ 'mobile' => false,
200
+ ])
201
+ );
202
+
203
+ ob_start();
204
+
205
+ ?>
206
+
207
+ <div class="<?php echo esc_attr($class) ?>" data-location="<?php echo esc_attr($actual_location) ?>">
208
+ <ul
209
+ class="ct-loading"
210
+ data-widget='<?php echo $widget_data; ?>'>
211
+
212
+ <?php
213
+ echo str_repeat(
214
+ '<li>' . blocksy_simple_image(
215
+ '#',
216
+ [
217
+ 'tag' => 'a',
218
+ 'html_atts' => [
219
+ 'target' => '_blank',
220
+ 'href' => '#',
221
+ ],
222
+ ]
223
+ ) . '</li>',
224
+ $photos_number
225
+ );
226
+ ?>
227
+ </ul>
228
+ <a href="https://instagram.com/<?php echo esc_attr($username) ?>" target="_blank" class="ct-instagram-follow">
229
+ @<?php echo esc_html($username) ?>
230
+ </a>
231
+ </div>
232
+
233
+
234
+ <?php
235
+
236
+ return ob_get_clean();
237
+ }
238
+
framework/extensions/instagram/readme.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h1><?php echo __('Instructions', 'blc'); ?></h1>
2
+
3
+ <p>
4
+ <?php echo __('After installing and activating the Instagram extension you will have two possibilities to show your feed:', 'blc') ?>
5
+ </p>
6
+
7
+ <ol>
8
+ <li>
9
+ <b>
10
+ <?php echo __('Instagram Widget', 'blc') ?>
11
+ </b>
12
+ <i>
13
+ <?php
14
+ echo sprintf(
15
+ __('Navigate to %s and place the widget in any widget area you want.', 'blc'),
16
+ sprintf(
17
+ '<code>%s</code>',
18
+ __('Appearance ➝ Widgets', 'blc')
19
+ )
20
+ );
21
+ ?>
22
+ </i>
23
+ </li>
24
+
25
+ <li>
26
+ <b>
27
+ <?php echo __('Instagram Block', 'blc') ?>
28
+ </b>
29
+ <i>
30
+ <?php
31
+ echo sprintf(
32
+ __('Navigate to %s and customize the location, number of images and more.', 'blc'),
33
+ sprintf(
34
+ '<code>%s</code>',
35
+ __('Customizer ➝ Instagram Extension', 'blc')
36
+ )
37
+ );
38
+ ?>
39
+ </i>
40
+ </li>
41
+ </ol>
42
+
framework/extensions/instagram/static/bundle/0.17a36d03c4d4439f3e19.js ADDED
@@ -0,0 +1 @@
 
1
+ (window.blocksyInstagramWidgetJsonp=window.blocksyInstagramWidgetJsonp||[]).push([[0],[function(t,e,r){"use strict";r.r(e);var a=r(3),i=r.n(a);var n=function(t){return[].concat(function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}(t.querySelectorAll(".ct-image-container.ct-lazy"))).map(function(t){t.querySelector("img").setAttribute("src",t.querySelector("img").dataset.original),t.querySelector("img").dataset.originalSet&&t.querySelector("img").setAttribute("srcset",t.querySelector("img").dataset.originalSet),t.classList.remove("ct-lazy"),t.classList.add("ct-lazy-loaded")})};r.d(e,"initInstagramWidget",function(){return l});var l=function(t){if(t.querySelector("ul[data-widget]")){if(window.fetch){var e=JSON.parse(t.querySelector("ul").dataset.widget),r=e.limit,a=e.username;t.querySelector("ul").removeAttribute("data-widget"),fetch(blocksy_ext_instagram_localization.ajax_url+"?action=blocksy_widget_instagram&limit="+r+"&username="+a).then(function(t){return t.text()}).then(function(e){t.querySelector("ul").removeAttribute("class"),t.querySelector("ul").innerHTML=e,i.a.trigger("ct:images:lazyload:update")})}}else n(t.querySelector("ul"))}}]]);
framework/extensions/instagram/static/bundle/main.css ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /**
2
+ * - v1.0.3
3
+ *
4
+ * Copyright (c) 2019
5
+ * Licensed GPLv2+
6
+ */
7
+
8
+ .ct-instagram-block{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.ct-instagram-block ul{display:-webkit-box;display:-ms-flexbox;display:flex;margin:0;padding:0;width:100%;list-style:none}.ct-instagram-block ul li{-ms-flex-preferred-size:100%;flex-basis:100%;margin:0;-webkit-transition:opacity 0.2s ease;transition:opacity 0.2s ease}@media (min-width: 690px) and (max-width: 999.98px){.ct-instagram-block ul li:nth-child(n+5){display:none}}@media (max-width: 689.98px){.ct-instagram-block ul li:nth-child(n+4){display:none}}.ct-instagram-block ul li:hover{opacity:0.8}.ct-instagram-block ul.ct-loading+a{display:none}.ct-instagram-block[data-location="above"]{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.ct-instagram-block[data-location="below"]{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.ct-instagram-follow{top:calc(50% - 19px);font-family:SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace;font-size:15px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;color:#fff;height:40px;padding:0 18px;border:none;border-radius:3px;background-color:#fff;-webkit-transition:color 0.2s ease, background 0.2s ease, -webkit-transform 0.2s ease;transition:color 0.2s ease, background 0.2s ease, -webkit-transform 0.2s ease;transition:color 0.2s ease, transform 0.2s ease, background 0.2s ease;transition:color 0.2s ease, transform 0.2s ease, background 0.2s ease, -webkit-transform 0.2s ease;position:absolute;color:inherit}.ct-instagram-follow:hover{background-color:var(--buttonHoverColor);-webkit-transform:translate3d(0, -3px, 0);transform:translate3d(0, -3px, 0)}.ct-instagram-follow:focus{outline:none}.ct-instagram-follow:before{position:absolute;z-index:-1;content:'';top:0;left:0;right:0;bottom:0;display:block;border-radius:inherit;opacity:0;-webkit-box-shadow:0px 8px 30px 0px var(--buttonHoverColor);box-shadow:0px 8px 30px 0px var(--buttonHoverColor);-webkit-transition:opacity 0.2s ease;transition:opacity 0.2s ease}.ct-instagram-follow:hover:before{opacity:0.5}.ct-instagram-follow:hover{color:#fff}
framework/extensions/instagram/static/bundle/main.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(t){function n(n){for(var e,o,i=n[0],u=n[1],a=0,l=[];a<i.length;a++)o=i[a],r[o]&&l.push(r[o][0]),r[o]=0;for(e in u)Object.prototype.hasOwnProperty.call(u,e)&&(t[e]=u[e]);for(c&&c(n);l.length;)l.shift()()}var e={},r={1:0};function o(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.e=function(t){var n=[],e=r[t];if(0!==e)if(e)n.push(e[2]);else{var i=new Promise(function(n,o){e=r[t]=[n,o]});n.push(e[2]=i);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.src=function(t){return o.p+""+t+"."+{0:"17a36d03c4d4439f3e19"}[t]+".js"}(t),u=function(n){a.onerror=a.onload=null,clearTimeout(c);var e=r[t];if(0!==e){if(e){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src,u=new Error("Loading chunk "+t+" failed.\n("+o+": "+i+")");u.type=o,u.request=i,e[1](u)}r[t]=void 0}};var c=setTimeout(function(){u({type:"timeout",target:a})},12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(n)},o.m=t,o.c=e,o.d=function(t,n,e){o.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,n){if(1&n&&(t=o(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(o.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var r in t)o.d(e,r,function(n){return t[n]}.bind(null,r));return e},o.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(n,"a",n),n},o.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},o.p="",o.oe=function(t){throw console.error(t),t};var i=window.blocksyInstagramWidgetJsonp=window.blocksyInstagramWidgetJsonp||[],u=i.push.bind(i);i.push=n,i=i.slice();for(var a=0;a<i.length;a++)n(i[a]);var c=u;o(o.s=1)}([,function(t,n,e){"use strict";e.r(n);e(2);function r(t){if(Array.isArray(t)){for(var n=0,e=Array(t.length);n<t.length;n++)e[n]=t[n];return e}return Array.from(t)}document.addEventListener("DOMContentLoaded",function(){[].concat(r(document.querySelectorAll(".ct-instagram-widget"))).map(function(t){return e.e(0).then(e.bind(null,0)).then(function(n){(0,n.initInstagramWidget)(t)})}),window.ctEvents.on("blocksy:instagram:init",function(){[].concat(r(document.querySelectorAll(".ct-instagram-widget"))).map(function(t){return e.e(0).then(e.bind(null,0)).then(function(n){(0,n.initInstagramWidget)(t)})})})})},function(t,n,e){e.p=blocksy_ext_instagram_localization.public_url},function(t,n){t.exports=window.ctEvents}]);
framework/extensions/instagram/static/bundle/sync.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.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 i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));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=0)}([function(t,e,r){"use strict";r.r(e);var n=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var a,c=t[Symbol.iterator]();!(n=(a=c.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{!n&&c.return&&c.return()}finally{if(i)throw o}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t};var o=function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";r||((e=document.createElement("div")).innerHTML=document.querySelector(".ct-customizer-preview-cache-container").value,r=e);var i=r.querySelector(".ct-customizer-preview-cache [data-"+n+'="'+t+'"]').innerHTML,o=document.createElement("div");return o.innerHTML=i,o},a=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=i({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([].concat(function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}(document.querySelectorAll(t.parent_selector+" "+t.selector))).map(function(t){return t.parentNode.removeChild(t)}),t.should_insert){for(var r=o(t.fragment_id);r.firstElementChild;)if(t.beforeInsert(r.firstElementChild),"append"===t.strategy&&e.appendChild(r.firstElementChild),"firstChild"===t.strategy&&e.insertBefore(r.firstElementChild,e.firstElementChild),t.strategy.indexOf("maybeBefore")>-1){var a=t.strategy.split(":"),c=n(a,2),l=(c[0],c[1]);e.querySelector(l)?e.insertBefore(r.firstElementChild,e.querySelector(l)):e.appendChild(r.firstElementChild)}t.whenInserted()}},c=function(t,e){if(e.classList.remove("ct-hidden-sm","ct-hidden-md","ct-hidden-lg"),wp.customize(t)){var r=wp.customize(t)()||{mobile:!1,tablet:!0,desktop:!0};r.mobile||e.classList.add("ct-hidden-sm"),r.tablet||e.classList.add("ct-hidden-md"),r.desktop||e.classList.add("ct-hidden-lg")}};wp.customize("insta_block_visibility",function(t){return t.bind(function(t){var e=document.querySelector(".ct-instagram-block");c("insta_block_visibility",e)})}),wp.customize("insta_block_location",function(t){return t.bind(function(t){document.querySelector(".ct-instagram-block").dataset.location=wp.customize("insta_block_location")()})}),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=i({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)();a(i({},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:"insta_block_enabled",strategy:"append",parent_selector:".footer-inner",selector:".ct-instagram-block",fragment_id:"blocksy-instagram-section",watch:["insta_block_count","insta_block_username"],whenInserted:function(){var t=document.querySelector(".ct-instagram-block");c("insta_block_visibility",t),t.dataset.location=wp.customize("insta_block_location")();var e=JSON.parse(t.firstElementChild.dataset.widget);[].concat(function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}(Array(e.limit-parseInt(wp.customize("insta_block_count")(),10)))).map(function(){return t.firstElementChild.removeChild(t.firstElementChild.firstElementChild)});var r=wp.customize("insta_block_username")();t.firstElementChild.dataset.widget=JSON.stringify({limit:parseInt(wp.customize("insta_block_count")(),10),username:r});var n=t.querySelector(".ct-instagram-follow");n.href="https://instagram.com/"+r,n.innerHTML="@"+r,ctEvents.trigger("blocksy:instagram:init")}})}]);
framework/extensions/instagram/static/js/instagram-widget.js ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import ctEvents from 'ct-events'
2
+ import { markImagesAsLoaded } from './lazy-load-helpers'
3
+
4
+ export const initInstagramWidget = el => {
5
+ if (!el.querySelector('ul[data-widget]')) {
6
+ markImagesAsLoaded(el.querySelector('ul'))
7
+ return
8
+ }
9
+
10
+ if (!window.fetch) return
11
+
12
+ const { limit, username } = JSON.parse(
13
+ el.querySelector('ul').dataset.widget
14
+ )
15
+
16
+ el.querySelector('ul').removeAttribute('data-widget')
17
+
18
+ fetch(
19
+ `${
20
+ blocksy_ext_instagram_localization.ajax_url
21
+ }?action=blocksy_widget_instagram&limit=${limit}&username=${username}`
22
+ )
23
+ .then(r => r.text())
24
+ .then(text => {
25
+ el.querySelector('ul').removeAttribute('class')
26
+ el.querySelector('ul').innerHTML = text
27
+ ctEvents.trigger('ct:images:lazyload:update')
28
+ })
29
+ }
framework/extensions/instagram/static/js/lazy-load-helpers.js ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export const markImagesAsLoaded = el =>
2
+ [...el.querySelectorAll('.ct-image-container.ct-lazy')].map(el => {
3
+ el
4
+ .querySelector('img')
5
+ .setAttribute('src', el.querySelector('img').dataset.original)
6
+
7
+ if (el.querySelector('img').dataset.originalSet) {
8
+ el
9
+ .querySelector('img')
10
+ .setAttribute(
11
+ 'srcset',
12
+ el.querySelector('img').dataset.originalSet
13
+ )
14
+ }
15
+
16
+ el.classList.remove('ct-lazy')
17
+ el.classList.add('ct-lazy-loaded')
18
+ })
framework/extensions/instagram/static/js/main.js ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import './public-path'
2
+
3
+ document.addEventListener('DOMContentLoaded', () => {
4
+ ;[...document.querySelectorAll('.ct-instagram-widget')].map(el =>
5
+ import('./instagram-widget').then(({ initInstagramWidget }) => {
6
+ initInstagramWidget(el)
7
+ })
8
+ )
9
+
10
+ window.ctEvents.on('blocksy:instagram:init', () => {
11
+ ;[...document.querySelectorAll('.ct-instagram-widget')].map(el =>
12
+ import('./instagram-widget').then(({ initInstagramWidget }) => {
13
+ initInstagramWidget(el)
14
+ })
15
+ )
16
+ })
17
+ })
framework/extensions/instagram/static/js/public-path.js ADDED
@@ -0,0 +1 @@
 
1
+ __webpack_public_path__ = blocksy_ext_instagram_localization.public_url
framework/extensions/instagram/static/js/sync.js ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { checkAndReplace, responsiveClassesFor } from './sync/helpers'
2
+
3
+ wp.customize('insta_block_visibility', val =>
4
+ val.bind(to => {
5
+ const block = document.querySelector('.ct-instagram-block')
6
+
7
+ responsiveClassesFor('insta_block_visibility', block)
8
+ })
9
+ )
10
+
11
+ wp.customize('insta_block_location', val =>
12
+ val.bind(to => {
13
+ const block = document.querySelector('.ct-instagram-block')
14
+ block.dataset.location = wp.customize('insta_block_location')()
15
+ })
16
+ )
17
+
18
+ checkAndReplace({
19
+ id: 'insta_block_enabled',
20
+ strategy: 'append',
21
+
22
+ parent_selector: '.footer-inner',
23
+ selector: '.ct-instagram-block',
24
+ fragment_id: 'blocksy-instagram-section',
25
+
26
+ watch: ['insta_block_count', 'insta_block_username'],
27
+
28
+ whenInserted: () => {
29
+ const block = document.querySelector('.ct-instagram-block')
30
+
31
+ responsiveClassesFor('insta_block_visibility', block)
32
+
33
+ block.dataset.location = wp.customize('insta_block_location')()
34
+
35
+ const currentData = JSON.parse(block.firstElementChild.dataset.widget)
36
+ ;[
37
+ ...Array(
38
+ currentData.limit -
39
+ parseInt(wp.customize('insta_block_count')(), 10)
40
+ )
41
+ ].map(() =>
42
+ block.firstElementChild.removeChild(
43
+ block.firstElementChild.firstElementChild
44
+ )
45
+ )
46
+
47
+ const username = wp.customize('insta_block_username')()
48
+
49
+ block.firstElementChild.dataset.widget = JSON.stringify({
50
+ limit: parseInt(wp.customize('insta_block_count')(), 10),
51
+ username
52
+ })
53
+
54
+ const link = block.querySelector('.ct-instagram-follow')
55
+ link.href = `https://instagram.com/${username}`
56
+ link.innerHTML = `@${username}`
57
+
58
+ ctEvents.trigger('blocksy:instagram:init')
59
+ }
60
+ })
framework/extensions/instagram/static/js/sync/helpers.js ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ const newHtml = cache.querySelector(
17
+ `.ct-customizer-preview-cache [data-${attr}="${id}"]`
18
+ ).innerHTML
19
+
20
+ const e = document.createElement('div')
21
+ e.innerHTML = newHtml
22
+
23
+ return e
24
+ }
25
+
26
+ export const renderWithStrategy = (args = {}) => {
27
+ args = {
28
+ fragment_id: null,
29
+
30
+ selector: null,
31
+ parent_selector: null,
32
+
33
+ // append | firstChild | maybeBefore:selector
34
+ strategy: 'append',
35
+ whenInserted: () => {},
36
+ beforeInsert: el => {},
37
+
38
+ should_insert: true,
39
+
40
+ ...args
41
+ }
42
+
43
+ const parent = document.querySelector(args.parent_selector)
44
+ ;[
45
+ ...document.querySelectorAll(`${args.parent_selector} ${args.selector}`)
46
+ ].map(el => el.parentNode.removeChild(el))
47
+
48
+ if (!args.should_insert) return
49
+
50
+ const el = getFreshHtmlFor(args.fragment_id)
51
+
52
+ while (el.firstElementChild) {
53
+ args.beforeInsert(el.firstElementChild)
54
+
55
+ if (args.strategy === 'append') {
56
+ parent.appendChild(el.firstElementChild)
57
+ }
58
+
59
+ if (args.strategy === 'firstChild') {
60
+ parent.insertBefore(el.firstElementChild, parent.firstElementChild)
61
+ }
62
+
63
+ if (args.strategy.indexOf('maybeBefore') > -1) {
64
+ const [_, selector] = args.strategy.split(':')
65
+
66
+ if (parent.querySelector(selector)) {
67
+ parent.insertBefore(
68
+ el.firstElementChild,
69
+ parent.querySelector(selector)
70
+ )
71
+ } else {
72
+ parent.appendChild(el.firstElementChild)
73
+ }
74
+ }
75
+ }
76
+
77
+ args.whenInserted()
78
+ }
79
+
80
+ export const checkAndReplace = (args = {}) => {
81
+ args = {
82
+ id: null,
83
+
84
+ fragment_id: null,
85
+
86
+ selector: null,
87
+ parent_selector: null,
88
+
89
+ // append | firstChild | maybeBefore:selector
90
+ strategy: 'append',
91
+ whenInserted: () => {},
92
+ beforeInsert: el => {},
93
+ watch: [],
94
+
95
+ ...args
96
+ }
97
+
98
+ const render = () => {
99
+ const to = wp.customize(args.id)()
100
+
101
+ renderWithStrategy({
102
+ ...args,
103
+ should_insert: to === 'yes'
104
+ })
105
+ }
106
+
107
+ wp.customize(args.id, val => val.bind(to => render()))
108
+ args.watch.map(opt => wp.customize(opt, val => val.bind(() => render())))
109
+ }
110
+
111
+ export const responsiveClassesFor = (id, el) => {
112
+ el.classList.remove('ct-hidden-sm', 'ct-hidden-md', 'ct-hidden-lg')
113
+
114
+ if (!wp.customize(id)) return
115
+
116
+ const data = wp.customize(id)() || {
117
+ mobile: false,
118
+ tablet: true,
119
+ desktop: true
120
+ }
121
+
122
+ if (!data.mobile) {
123
+ el.classList.add('ct-hidden-sm')
124
+ }
125
+
126
+ if (!data.tablet) {
127
+ el.classList.add('ct-hidden-md')
128
+ }
129
+
130
+ if (!data.desktop) {
131
+ el.classList.add('ct-hidden-lg')
132
+ }
133
+ }
framework/extensions/instagram/static/sass/main.scss ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../../../../../static/sass/common-frontend';
2
+
3
+ .ct-instagram-block {
4
+ position: relative;
5
+ display: flex;
6
+ justify-content: center;
7
+
8
+ ul {
9
+ display: flex;
10
+ margin: 0;
11
+ padding: 0;
12
+ width: 100%;
13
+ list-style: none;
14
+
15
+ li {
16
+ flex-basis: 100%;
17
+
18
+ @include media-breakpoint-only (md) {
19
+ &:nth-child(n+5) {
20
+ display: none;
21
+ }
22
+ }
23
+
24
+ @include media-breakpoint-down (sm) {
25
+ &:nth-child(n+4) {
26
+ display: none;
27
+ }
28
+ }
29
+
30
+ margin: 0;
31
+ transition: opacity 0.2s ease;
32
+
33
+ &:hover {
34
+ opacity: 0.8;
35
+ }
36
+ }
37
+
38
+ &.ct-loading {
39
+ + a {
40
+ display: none;
41
+ }
42
+ }
43
+ }
44
+
45
+ // block location
46
+ &[data-location="above"] {
47
+ order: 1;
48
+ }
49
+
50
+ &[data-location="below"] {
51
+ order: 5;
52
+ }
53
+ }
54
+
55
+ .ct-instagram-follow {
56
+ top: calc(50% - 19px);
57
+ font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace;
58
+ font-size: 15px;
59
+
60
+ @include button((
61
+ display: flex,
62
+ height: 40px,
63
+ padding: 18px,
64
+ position: absolute,
65
+ bg_1: #fff,
66
+ ));
67
+
68
+ color: inherit;
69
+
70
+ &:hover {
71
+ color: #fff;
72
+ }
73
+ }
framework/extensions/mailchimp/admin-static/bundle/1.4b8b242225582999eec3.js ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (window.blocksyMailchimpExtJsonp=window.blocksyMailchimpExtJsonp||[]).push([[1],[,,,,,function(e,t,n){e.exports=n(6)()},function(e,t,n){"use strict";var o=n(7);function i(){}function r(){}r.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,r,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:r,resetWarningCache:i};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(9)},function(e,t,n){"use strict";
2
+ /** @license React v16.8.6
3
+ * react-is.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&Symbol.for,i=o?Symbol.for("react.element"):60103,r=o?Symbol.for("react.portal"):60106,s=o?Symbol.for("react.fragment"):60107,u=o?Symbol.for("react.strict_mode"):60108,l=o?Symbol.for("react.profiler"):60114,a=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.memo"):60115,m=o?Symbol.for("react.lazy"):60116;function v(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case d:case c:case s:case l:case u:case f:return e;default:switch(e=e&&e.$$typeof){case p:case h:case a:return e;default:return t}}case m:case g:case r:return t}}}function y(e){return v(e)===c}t.typeOf=v,t.AsyncMode=d,t.ConcurrentMode=c,t.ContextConsumer=p,t.ContextProvider=a,t.Element=i,t.ForwardRef=h,t.Fragment=s,t.Lazy=m,t.Memo=g,t.Portal=r,t.Profiler=l,t.StrictMode=u,t.Suspense=f,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===s||e===c||e===l||e===u||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===g||e.$$typeof===a||e.$$typeof===p||e.$$typeof===h)},t.isAsyncMode=function(e){return y(e)||v(e)===d},t.isConcurrentMode=y,t.isContextConsumer=function(e){return v(e)===p},t.isContextProvider=function(e){return v(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},t.isForwardRef=function(e){return v(e)===h},t.isFragment=function(e){return v(e)===s},t.isLazy=function(e){return v(e)===m},t.isMemo=function(e){return v(e)===g},t.isPortal=function(e){return v(e)===r},t.isProfiler=function(e){return v(e)===l},t.isStrictMode=function(e){return v(e)===u},t.isSuspense=function(e){return v(e)===f}},function(e,t,n){var o;
10
+ /*!
11
+ Copyright (c) 2017 Jed Watson.
12
+ Licensed under the MIT License (MIT), see
13
+ http://jedwatson.github.io/classnames
14
+ */
15
+ /*!
16
+ Copyright (c) 2017 Jed Watson.
17
+ Licensed under the MIT License (MIT), see
18
+ http://jedwatson.github.io/classnames
19
+ */
20
+ !function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var r=typeof o;if("string"===r||"number"===r)e.push(o);else if(Array.isArray(o)&&o.length){var s=i.apply(null,o);s&&e.push(s)}else if("object"===r)for(var u in o)n.call(o,u)&&o[u]&&e.push(u)}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(o=function(){return i}.apply(t,[]))||(e.exports=o)}()},function(e,t,n){"use strict";function o(e,t){if(null==e)return{};var n,o,i={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(i[n]=e[n]);return i}function i(){return(i=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 r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n(5);var s=n(1),u=n.n(s);n(8);function l(e){return null!=e&&"object"==typeof e&&1===e.nodeType}function a(e,t){return(!t||"hidden"!==e)&&("visible"!==e&&"clip"!==e)}function p(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var n=getComputedStyle(e,null);return a(n.overflowY,t)||a(n.overflowX,t)}return!1}function d(e,t,n,o,i,r,s,u){return r<e&&s>t||r>e&&s<t?0:r<=e&&u<=n||s>=t&&u>=n?r-e-o:s>t&&u<n||r<e&&u>n?s-t+i:0}var c=function(e,t){var n=t.scrollMode,o=t.block,i=t.inline,r=t.boundary,s=t.skipOverflowHiddenElements,u="function"==typeof r?r:function(e){return e!==r};if(!l(e))throw new TypeError("Invalid target");for(var a=document.scrollingElement||document.documentElement,c=[],h=e;l(h)&&u(h);){if((h=h.parentNode)===a){c.push(h);break}h===document.body&&p(h)&&!p(document.documentElement)||p(h,s)&&c.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"===i?C+S/2:"end"===i?w:C,E=[],P=0;P<c.length;P++){var M=c[P],D=M.getBoundingClientRect(),T=D.height,k=D.width,A=D.top,R=D.right,K=D.bottom,V=D.left;if("if-needed"===n&&b>=0&&C>=0&&x<=g&&w<=f&&b>=A&&x<=K&&C>=V&&w<=R)return E;var _=getComputedStyle(M),L=parseInt(_.borderLeftWidth,10),B=parseInt(_.borderTopWidth,10),j=parseInt(_.borderRightWidth,10),$=parseInt(_.borderBottomWidth,10),U=0,W=0,N="offsetWidth"in M?M.offsetWidth-M.clientWidth-L-j:0,F="offsetHeight"in M?M.offsetHeight-M.clientHeight-B-$:0;if(a===M)U="start"===o?H:"end"===o?H-g:"nearest"===o?d(v,v+g,g,B,$,v+H,v+H+I,I):H-g/2,W="start"===i?O:"center"===i?O-f/2:"end"===i?O-f:d(m,m+f,f,L,j,m+O,m+O+S,S),U=Math.max(0,U+v),W=Math.max(0,W+m);else{U="start"===o?H-A-B:"end"===o?H-K+$+F:"nearest"===o?d(A,K,T,B,$+F,H,H+I,I):H-(A+T/2)+F/2,W="start"===i?O-V-L:"center"===i?O-(V+k/2)+N/2:"end"===i?O-R+j+N:d(V,R,k,L,j+N,O,O+S,S);var z=M.scrollLeft,Y=M.scrollTop;H+=Y-(U=Math.max(0,Math.min(Y+U,M.scrollHeight-T+F))),O+=z-(W=Math.max(0,Math.min(z+W,M.scrollWidth-k+N)))}E.push({el:M,top:U,left:W})}return E},h="undefined"==typeof document?null:document.getElementById("a11y-status-message"),f=[];function g(e){var t=f[f.length-1]===e;f=t?[].concat(f,[e]):[e];for(var n=function(){if(h)return h;return(h=document.createElement("div")).setAttribute("id","a11y-status-message"),h.setAttribute("role","status"),h.setAttribute("aria-live","polite"),h.setAttribute("aria-relevant","additions text"),Object.assign(h.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),document.body.appendChild(h),h}();n.lastChild;)n.removeChild(n.firstChild);f.filter(Boolean).forEach(function(e,t){n.appendChild(function(e,t){var n=t===f.length-1?"block":"none",o=document.createElement("div");return o.style.display=n,o.textContent=e,o}(e,t))})}var m=0,v=2,y=3,I=4,S=5,b=6,w=7,x=8,C=9,H=10,O=11,E=12,P=13,M=14,D=Object.freeze({unknown:m,mouseUp:1,itemMouseEnter:v,keyDownArrowUp:y,keyDownArrowDown:I,keyDownEscape:S,keyDownEnter:b,keyDownHome:w,keyDownEnd:x,clickItem:C,blurInput:H,changeInput:O,keyDownSpaceButton:E,clickButton:P,blurButton:M,controlledPropUpdatedSelectedItem:15,touchEnd:16}),T=0;function k(e){return"function"==typeof e?e:A}function A(){}function R(e,t){return e===t||e.contains&&e.contains(t)}function K(){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),i=1;i<n;i++)o[i-1]=arguments[i];return t.some(function(t){return t&&t.apply(void 0,[e].concat(o)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault})}}function V(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}function _(e){return"string"==typeof e.type}function L(e){return e.props}var B=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function j(e){void 0===e&&(e={});var t={};return B.forEach(function(n){e.hasOwnProperty(n)&&(t[n]=e[n])}),t}function $(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function U(e,t,n){var o=n-1;("number"!=typeof t||t<0||t>=n)&&(t=e>0?-1:o+1);var i=t+e;return i<0?i=o:i>o&&(i=0),i}var W=function(e){var t,n;function s(t){var n=e.call(this,t)||this;n.id=n.props.id||"downshift-"+String(T++),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=j(t),n.internalSetState(i({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=j(t),n.internalSetState(i({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),o)},n.selectItemAtIndex=function(e,t,o){var i=n.items[e];null!=i&&n.selectItem(i,t,o)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var o,r,s={},u="function"==typeof e;return!u&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,i({},n.getStateAndHelpers(),e)),n.setState(function(t){t=n.getState(t);var l=u?e(t):e;l=n.props.stateReducer(t,l),o=l.hasOwnProperty("selectedItem");var a={},p={};return o&&l.selectedItem!==t.selectedItem&&(r=l.selectedItem),l.type=l.type||m,Object.keys(l).forEach(function(e){t[e]!==l[e]&&(s[e]=l[e]),"type"!==e&&(p[e]=l[e],n.isControlledProp(e)||(a[e]=l[e]))}),u&&l.hasOwnProperty("inputValue")&&n.props.onInputValueChange(l.inputValue,i({},n.getStateAndHelpers(),l)),a},function(){k(t)(),Object.keys(s).length>1&&n.props.onStateChange(s,n.getStateAndHelpers()),o&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==r&&n.props.onChange(r,n.getStateAndHelpers()),n.props.onUserAction(s,n.getStateAndHelpers())})},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var r,s=void 0===e?{}:e,u=s.refKey,l=void 0===u?"ref":u,a=o(s,["refKey"]),p=(void 0===t?{}:t).suppressRefError,d=void 0!==p&&p;n.getRootProps.called=!0,n.getRootProps.refKey=l,n.getRootProps.suppressRefError=d;var c=n.getState().isOpen;return i(((r={})[l]=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),a)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:I})}else this.internalSetState({isOpen:!0,type:I},function(){var e=t.getItemCount();e>0&&t.setHighlightedIndex(U(1,t.getState().highlightedIndex,e),{type:I})})},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:y})}else this.internalSetState({isOpen:!0,type:y},function(){var e=t.getItemCount();e>0&&t.setHighlightedIndex(U(-1,t.getState().highlightedIndex,e),{type:I})})},Enter:function(e){var t=this.getState(),n=t.isOpen,o=t.highlightedIndex;if(n&&null!=o){e.preventDefault();var i=this.items[o],r=this.getItemNodeFromIndex(o);if(null==i||r&&r.hasAttribute("disabled"))return;this.selectHighlightedItem({type:b})}},Escape:function(e){e.preventDefault(),this.reset({type:S})}},n.buttonKeyDownHandlers=i({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:E})}}),n.inputKeyDownHandlers=i({},n.keyDownHandlers,{Home:function(e){this.highlightFirstOrLastIndex(e,!0,{type:w})},End:function(e){this.highlightFirstOrLastIndex(e,!1,{type:x})}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,r=t.onClick,s=(t.onPress,t.onKeyDown),u=t.onKeyUp,l=t.onBlur,a=o(t,["onClick","onPress","onKeyDown","onKeyUp","onBlur"]),p=n.getState().isOpen,d={onClick:K(r,n.buttonHandleClick),onKeyDown:K(s,n.buttonHandleKeyDown),onKeyUp:K(u,n.buttonHandleKeyUp),onBlur:K(l,n.buttonHandleBlur)};return i({type:"button",role:"button","aria-label":p?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},a.disabled?{}:d,a)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=$(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(r(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:P})})},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:M})})},n.getLabelProps=function(e){return i({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,r=t.onKeyDown,s=t.onBlur,u=t.onChange,l=t.onInput,a=(t.onChangeText,o(t,["onKeyDown","onBlur","onChange","onInput","onChangeText"])),p={};var d,c=n.getState(),h=c.inputValue,f=c.isOpen,g=c.highlightedIndex;a.disabled||((d={}).onChange=K(u,l,n.inputHandleChange),d.onKeyDown=K(r,n.inputHandleKeyDown),d.onBlur=K(s,n.inputHandleBlur),p=d);return i({"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,a)},n.inputHandleKeyDown=function(e){var t=$(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(r(n),e)},n.inputHandleChange=function(e){n.internalSetState({type:O,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleTextChange=function(e){n.internalSetState({type:O,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:H})})},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var r,s=void 0===e?{}:e,u=s.refKey,l=void 0===u?"ref":u,a=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=l,n.getMenuProps.suppressRefError=c,i(((r={})[l]=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),o=0;o<e;o++)n[o]=arguments[o];t.forEach(function(e){e&&e.apply(void 0,n)})}}(a,n.menuRef),r.role="listbox",r["aria-labelledby"]=p&&p["aria-label"]?null:n.labelId,r.id=n.menuId,r),p)},n.getItemProps=function(e){var t,r=void 0===e?{}:e,s=r.onMouseMove,u=r.onMouseDown,l=r.onClick,a=(r.onPress,r.index),p=r.item,d=void 0===p?void 0:p,c=o(r,["onMouseMove","onMouseDown","onClick","onPress","index","item"]);void 0===a?(n.items.push(d),a=n.items.indexOf(d)):n.items[a]=d;var h=l,f=((t={onMouseMove:K(s,function(){a!==n.getState().highlightedIndex&&(n.setHighlightedIndex(a,{type:v}),n.avoidScrolling=!0,n.internalSetTimeout(function(){return n.avoidScrolling=!1},250))}),onMouseDown:K(u,function(e){e.preventDefault()})}).onClick=K(h,function(){n.selectItemAtIndex(a,{type:C})}),t),g=c.disabled?{onMouseDown:f.onMouseDown}:f;return i({id:n.getItemId(a),role:"option","aria-selected":n.getState().highlightedIndex===a},g,c)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=j(e),n.internalSetState(function(t){var o=t.selectedItem;return i({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=j(e),n.internalSetState(function(t){var o=t.isOpen;return i({isOpen:!o},o&&{highlightedIndex:n.props.defaultHighlightedIndex},e)},function(){var o=n.getState(),i=o.isOpen,r=o.highlightedIndex;i&&n.getItemCount()>0&&"number"==typeof r&&n.setHighlightedIndex(r,e),k(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 o(){n&&clearTimeout(n)}function i(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];o(),n=setTimeout(function(){n=null,e.apply(void 0,r)},t)}return i.cancel=o,i}(function(){var e=n.getState(),t=n.items[e.highlightedIndex],o=n.getItemCount(),r=n.props.getA11yStatusMessage(i({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:o,highlightedItem:t},e));n.previousResultCount=o,g(r)},200);var s=n.props,u=s.defaultHighlightedIndex,l=s.initialHighlightedIndex,a=void 0===l?u:l,p=s.defaultIsOpen,d=s.initialIsOpen,c=void 0===d?p:d,h=s.initialInputValue,f=void 0===h?"":h,D=s.initialSelectedItem,A=void 0===D?null:D,R=n.getState({highlightedIndex:a,isOpen:c,inputValue:f,selectedItem:A});return null!=R.selectedItem&&void 0===n.props.initialInputValue&&(R.inputValue=n.props.itemToString(R.selectedItem)),n.state=R,n}n=e,(t=s).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var l=s.prototype;return l.internalClearTimeouts=function(){this.timeoutIds.forEach(function(e){clearTimeout(e)}),this.timeoutIds=[]},l.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},{})},l.isControlledProp=function(e){return void 0!==this.props[e]},l.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},l.getItemNodeFromIndex=function(e){return this.props.environment.document.getElementById(this.getItemId(e))},l.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},l.moveHighlightedIndex=function(e,t){var n=this.getItemCount();if(n>0){var o=U(e,this.getState().highlightedIndex,n);this.setHighlightedIndex(o,t)}},l.highlightFirstOrLastIndex=function(e,t,n){var o=this.getItemCount()-1;o<0||!this.getState().isOpen||(e.preventDefault(),this.setHighlightedIndex(t?0:o,n))},l.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,o=e.selectedItem,i=e.isOpen,r=this.props.itemToString,s=this.id,u=this.getRootProps,l=this.getToggleButtonProps,a=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:l,getLabelProps:a,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:r,id:s,highlightedIndex:t,inputValue:n,isOpen:i,selectedItem:o}},l.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&&(R(e,t)||n&&R(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())})},i=function(){e.isTouchMove=!1},r=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())})};this.props.environment.addEventListener("mousedown",n),this.props.environment.addEventListener("mouseup",o),this.props.environment.addEventListener("touchstart",i),this.props.environment.addEventListener("touchmove",r),this.props.environment.addEventListener("touchend",s),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),e.props.environment.removeEventListener("mousedown",n),e.props.environment.removeEventListener("mouseup",o),e.props.environment.removeEventListener("touchstart",i),e.props.environment.removeEventListener("touchmove",r),e.props.environment.removeEventListener("touchend",s)}},l.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},l.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()},l.componentWillUnmount=function(){this.cleanup()},l.render=function(){var e=V(this.props.children,A);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=V(e(this.getStateAndHelpers()));return t?this.getRootProps.called||this.props.suppressRefError?t:_(t)?u.a.cloneElement(t,this.getRootProps(L(t))):void 0:null},s}(s.Component);W.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:function(e){var t=e.isOpen,n=e.selectedItem,o=e.resultCount,i=e.previousResultCount,r=e.itemToString;return t?o?o!==i?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?r(n):""},itemToString:function(e){return null==e?"":String(e)},onStateChange:A,onInputValueChange:A,onUserAction:A,onChange:A,onSelect:A,onOuterClick:A,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&&c(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})}},W.stateChangeTypes=D;t.a=W}]]);
framework/extensions/mailchimp/admin-static/bundle/2.8838a376a98402a4d731.js ADDED
@@ -0,0 +1 @@
 
1
+ (window.blocksyMailchimpExtJsonp=window.blocksyMailchimpExtJsonp||[]).push([[2],{12:function(e,t,n){"use strict";n.r(t);var r=n(0),a=n(11),c=n(2),i=n(10),o=n.n(i),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},s=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,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&&o.return&&o.return()}finally{if(a)throw c}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();var l=null;t.default=function(e){var t,n,i=e.value,d=e.onChange,p=Object(r.useState)(l||[]),f=s(p,2),m=f[0],v=f[1],b=Object(r.useState)(!l),h=s(b,2),y=h[0],O=h[1],g=(t=regeneratorRuntime.mark(function e(){var t,n,r,a=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a&&O(!0),(t=new FormData).append("action","blocksy_ext_mailchimp_get_actual_lists"),e.prev=3,e.next=6,fetch(ajaxurl,{method:"POST",body:t});case 6:if(200!==(n=e.sent).status){e.next=17;break}return e.next=10,n.json();case 10:if(!(r=e.sent).success){e.next=17;break}if("api_key_invalid"===r.data.result){e.next=17;break}return O(!1),v(r.data.result),l=r.data.result,e.abrupt("return");case 17:e.next=21;break;case 19:e.prev=19,e.t0=e.catch(3);case 21:O(!1);case 22:case"end":return e.stop()}},e,void 0,[[3,19]])}),n=function(){var e=t.apply(this,arguments);return new Promise(function(t,n){return function r(a,c){try{var i=e[a](c),o=i.value}catch(e){return void n(e)}if(!i.done)return Promise.resolve(o).then(function(e){r("next",e)},function(e){r("throw",e)});t(o)}("next")})},function(){return n.apply(this,arguments)});return Object(r.useEffect)(function(){g(!l)},[]),0===m.length?Object(r.createElement)("div",{className:"ct-select-input"},Object(r.createElement)("input",{disabled:!0,placeholder:y?Object(c.__)("Loading..."):Object(c.__)("Invalid API Key...")})):Object(r.createElement)(a.a,{selectedItem:i||m[0].id,onChange:function(e){return d(e)},itemToString:function(e){return e?(m.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,s=(e.inputValue,e.highlightedIndex),l=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..."),readOnly:!0})),i&&Object(r.createElement)("div",a({className:"ct-select-dropdown"}),m.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:s===t,selected:l===e.id})}),e.name)})))})}}}]);
framework/extensions/mailchimp/admin-static/bundle/main.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){function t(t){for(var n,o,i=t[0],c=t[1],u=0,a=[];u<i.length;u++)o=i[u],r[o]&&a.push(r[o][0]),r[o]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(t);a.length;)a.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 i=new Promise(function(t,o){n=r[e]=[t,o]});t.push(n[2]=i);var c,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:"4b8b242225582999eec3",2:"8838a376a98402a4d731"}[e]+".js"}(e),c=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),i=t&&t.target&&t.target.src,c=new Error("Loading chunk "+e+" failed.\n("+o+": "+i+")");c.type=o,c.request=i,n[1](c)}r[e]=void 0}};var l=setTimeout(function(){c({type:"timeout",target:u})},12e4);u.onerror=u.onload=c,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 i=window.blocksyMailchimpExtJsonp=window.blocksyMailchimpExtJsonp||[],c=i.push.bind(i);i.push=t,i=i.slice();for(var u=0;u<i.length;u++)t(i[u]);var l=c;o(o.s=4)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.BlocksyReact},function(e,t){e.exports=window.wp.i18n},function(e,t,n){n.p=blocksy_ext_mailchimp_localization.public_url},function(e,t,n){"use strict";n.r(t);n(3);var r=n(0),o=n(2),i=n(1),c=Object(i.lazy)(function(){return Promise.all([n.e(1),n.e(2)]).then(n.bind(null,12))}),u=function(e){return Object(r.createElement)("div",null,Object(r.createElement)(i.Suspense,{fallback:Object(r.createElement)("div",{className:"ct-select-input"},Object(r.createElement)("input",{disabled:!0,placeholder:Object(o.__)("Loading...")}))},Object(r.createElement)(c,e)))};document.addEventListener("DOMContentLoaded",function(){return ctEvents.on("blocksy:options:register",function(e){e["blocksy-mailchimp"]=u})})}]);
framework/extensions/mailchimp/admin-static/bundle/sync.js ADDED
@@ -0,0 +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")()}})}]);
framework/extensions/mailchimp/admin-static/js/ListPicker.js ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { createElement, Component } from '@wordpress/element'
2
+ import { __ } from 'ct-i18n'
3
+ import { lazy, Suspense } from 'react'
4
+
5
+ const ListPickerImplementation = lazy(() =>
6
+ import('./ListPicker/Implementation')
7
+ )
8
+
9
+ const ListPicker = props => (
10
+ <div>
11
+ <Suspense
12
+ fallback={
13
+ <div className="ct-select-input">
14
+ <input disabled placeholder={__('Loading...')} />
15
+ </div>
16
+ }>
17
+ <ListPickerImplementation {...props} />
18
+ </Suspense>
19
+ </div>
20
+ )
21
+
22
+ export default ListPicker
framework/extensions/mailchimp/admin-static/js/ListPicker/Implementation.js ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {
2
+ createElement,
3
+ Component,
4
+ useState,
5
+ useEffect,
6
+ Fragment
7
+ } from '@wordpress/element'
8
+ import Downshift from 'downshift'
9
+ import { __ } from 'ct-i18n'
10
+ import classnames from 'classnames'
11
+
12
+ let listsCache = null
13
+
14
+ const ListPickerImplementation = ({ value, onChange }) => {
15
+ const [lists, setLists] = useState(listsCache || [])
16
+ const [isLoadingLists, setListsLoading] = useState(!listsCache)
17
+
18
+ const maybeFetchLists = async (verbose = true) => {
19
+ if (verbose) {
20
+ setListsLoading(true)
21
+ }
22
+
23
+ const body = new FormData()
24
+ body.append('action', 'blocksy_ext_mailchimp_get_actual_lists')
25
+
26
+ try {
27
+ const response = await fetch(ajaxurl, {
28
+ method: 'POST',
29
+ body
30
+ })
31
+ if (response.status === 200) {
32
+ const body = await response.json()
33
+
34
+ if (body.success) {
35
+ if (body.data.result !== 'api_key_invalid') {
36
+ setListsLoading(false)
37
+ setLists(body.data.result)
38
+ listsCache = body.data.result
39
+
40
+ return
41
+ }
42
+ }
43
+ }
44
+ } catch (e) {}
45
+
46
+ setListsLoading(false)
47
+ }
48
+
49
+ useEffect(() => {
50
+ maybeFetchLists(!listsCache)
51
+ }, [])
52
+
53
+ return lists.length === 0 ? (
54
+ <div className="ct-select-input">
55
+ <input
56
+ disabled
57
+ placeholder={
58
+ isLoadingLists ? __('Loading...') : __('Invalid API Key...')
59
+ }
60
+ />
61
+ </div>
62
+ ) : (
63
+ <Downshift
64
+ selectedItem={value || lists[0].id}
65
+ onChange={selection => onChange(selection)}
66
+ itemToString={item =>
67
+ item ? (lists.find(({ id }) => id === item) || {}).name : ''
68
+ }>
69
+ {({
70
+ getInputProps,
71
+ getItemProps,
72
+ getLabelProps,
73
+ getMenuProps,
74
+ isOpen,
75
+ inputValue,
76
+ highlightedIndex,
77
+ selectedItem,
78
+ openMenu
79
+ }) => (
80
+ <div className="ct-select-input">
81
+ <input
82
+ {...getInputProps({
83
+ onFocus: () => openMenu(),
84
+ onClick: () => openMenu()
85
+ })}
86
+ placeholder={__('Select list...')}
87
+ readOnly
88
+ />
89
+
90
+ {isOpen && (
91
+ <div
92
+ {...getMenuProps({
93
+ className: 'ct-select-dropdown'
94
+ })}>
95
+ {lists.map((item, index) => (
96
+ <div
97
+ {...getItemProps({
98
+ key: item.id,
99
+ index,
100
+ item: item.id,
101
+ className: classnames(
102
+ 'ct-select-dropdown-item',
103
+ {
104
+ active:
105
+ highlightedIndex === index,
106
+ selected:
107
+ selectedItem === item.id
108
+ }
109
+ )
110
+ })}>
111
+ {item.name}
112
+ </div>
113
+ ))}
114
+ </div>
115
+ )}
116
+ </div>
117
+ )}
118
+ </Downshift>
119
+ )
120
+ }
121
+
122
+ export default ListPickerImplementation
framework/extensions/mailchimp/admin-static/js/main.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
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 => {
7
+ opts['blocksy-mailchimp'] = ListPicker
8
+ })
9
+ )
framework/extensions/mailchimp/admin-static/js/public-path.js ADDED
@@ -0,0 +1 @@
 
1
+ __webpack_public_path__ = blocksy_ext_mailchimp_localization.public_url
framework/extensions/mailchimp/admin-static/js/sync.js ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {
2
+ checkAndReplace,
3
+ responsiveClassesFor
4
+ } from '../../../instagram/static/js/sync/helpers'
5
+
6
+ import './variables'
7
+
8
+ wp.customize('mailchimp_subscribe_visibility', val =>
9
+ val.bind(to => {
10
+ const block = document.querySelector('.ct-mailchimp-block')
11
+ responsiveClassesFor('mailchimp_subscribe_visibility', block)
12
+ })
13
+ )
14
+
15
+ checkAndReplace({
16
+ id: 'mailchimp_single_post_enabled',
17
+ strategy: 'append',
18
+
19
+ parent_selector: '.content-area article',
20
+ selector: '.ct-mailchimp-block',
21
+ fragment_id: 'blocksy-mailchimp-subscribe',
22
+
23
+ watch: [
24
+ 'has_mailchimp_name',
25
+ 'mailchimp_button_text',
26
+ 'mailchimp_title',
27
+ 'mailchimp_text'
28
+ ],
29
+
30
+ whenInserted: () => {
31
+ const block = document.querySelector('.ct-mailchimp-block')
32
+
33
+ responsiveClassesFor('mailchimp_subscribe_visibility', block)
34
+
35
+ if (wp.customize('has_mailchimp_name')() !== 'yes') {
36
+ block
37
+ .querySelector('[name="FNAME"]')
38
+ .parentNode.removeChild(block.querySelector('[name="FNAME"]'))
39
+ }
40
+
41
+ block.querySelector('button').innerHTML = wp.customize(
42
+ 'mailchimp_button_text'
43
+ )()
44
+
45
+ block.querySelector('h4').innerHTML = wp.customize('mailchimp_title')()
46
+
47
+ block.querySelector(
48
+ '.ct-mailchimp-description'
49
+ ).innerHTML = wp.customize('mailchimp_text')()
50
+ }
51
+ })
framework/extensions/mailchimp/admin-static/js/variables.js ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { handleVariablesFor } from 'customizer-sync-helpers'
2
+
3
+ handleVariablesFor({
4
+ // Mailchimp
5
+ mailchimpContent: {
6
+ variable: 'mailchimpContent',
7
+ type: 'color'
8
+ },
9
+
10
+ mailchimpButton: [
11
+ {
12
+ selector: '.ct-mailchimp-block',
13
+ variable: 'buttonInitialColor',
14
+ type: 'color:default'
15
+ },
16
+
17
+ {
18
+ selector: '.ct-mailchimp-block',
19
+ variable: 'buttonHoverColor',
20
+ type: 'color:hover'
21
+ }
22
+ ],
23
+
24
+ mailchimpBackground: {
25
+ variable: 'mailchimpBackground',
26
+ type: 'color'
27
+ },
28
+
29
+ mailchimpShadow: {
30
+ variable: 'mailchimpShadow',
31
+ type: 'color'
32
+ },
33
+
34
+ mailchimpSpacing: {
35
+ variable: 'mailchimpSpacing',
36
+ responsive: true,
37
+ unit: ''
38
+ }
39
+ })
framework/extensions/mailchimp/config.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $config = [
4
+ 'description' => __('Display a Mailchimp subscribe form with the help of a widget or a block.', 'blc')
5
+ ];
6
+
framework/extensions/mailchimp/ct-mailchimp/options.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Mailchimp 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' => __( 'Newsletter', 'blc' ),
19
+ 'disableRevertButton' => true,
20
+ ],
21
+
22
+ 'mailchimp_text' => [
23
+ 'label' => __( 'Message', 'blc' ),
24
+ 'type' => 'textarea',
25
+ 'value' => __( 'Enter your email address below to subscribe to our newsletter', 'blc' ),
26
+ 'design' => 'inline',
27
+ 'disableRevertButton' => true,
28
+ ],
29
+
30
+ 'mailchimp_list_id_source' => [
31
+ 'type' => 'ct-radio',
32
+ 'label' => __( 'List Source', 'blc' ),
33
+ 'value' => 'default',
34
+ 'view' => 'radio',
35
+ 'inline' => true,
36
+ 'design' => 'inline',
37
+ 'disableRevertButton' => true,
38
+ 'choices' => [
39
+ 'default' => __('Default', 'blc'),
40
+ 'custom' => __('Custom', 'blc'),
41
+ ],
42
+ ],
43
+
44
+ blocksy_rand_md5() => [
45
+ 'type' => 'ct-condition',
46
+ 'condition' => [ 'mailchimp_list_id_source' => 'custom' ],
47
+ 'options' => [
48
+
49
+ 'mailchimp_list_id' => [
50
+ 'label' => __( 'List ID', 'blc' ),
51
+ 'type' => 'blocksy-mailchimp',
52
+ 'value' => '',
53
+ 'design' => 'inline',
54
+ 'disableRevertButton' => true,
55
+ ],
56
+
57
+ ],
58
+ ],
59
+
60
+ 'has_mailchimp_name' => [
61
+ 'type' => 'ct-switch',
62
+ 'label' => __( 'Name Field', 'blc' ),
63
+ 'value' => 'no',
64
+ 'disableRevertButton' => true,
65
+ ],
66
+
67
+ 'mailchimp_button_text' => [
68
+ 'type' => 'text',
69
+ 'label' => __( 'Button Text', 'blc' ),
70
+ 'design' => 'inline',
71
+ 'value' => __( 'Subscribe', 'blc' ),
72
+ 'disableRevertButton' => true,
73
+ ],
74
+
75
+ 'mailchimp_alignment' => [
76
+ 'type' => 'ct-radio',
77
+ 'label' => __( 'Content Alignment', 'blc' ),
78
+ 'value' => 'center',
79
+ 'view' => 'text',
80
+ 'attr' => [ 'data-type' => 'alignment' ],
81
+ 'disableRevertButton' => true,
82
+ 'choices' => [
83
+ 'left' => '',
84
+ 'center' => '',
85
+ 'right' => '',
86
+ ],
87
+ ],
88
+
89
+ ];
framework/extensions/mailchimp/ct-mailchimp/view.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Mailchimp 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, __( 'Newsletter', 'blc' ) );
13
+
14
+
15
+ // Message
16
+ $message = blocksy_default_akg( 'mailchimp_text', $atts, __( 'Enter your email address below to subscribe to our newsletter', 'blc' ) );
17
+
18
+ // Button text
19
+ $button_text = blocksy_default_akg( 'mailchimp_button_text', $atts, __( 'Subscribe', 'blc' ) );
20
+
21
+ // Form name
22
+ $has_name = blocksy_default_akg( 'has_mailchimp_name', $atts, 'no' ) === 'yes';
23
+
24
+ $list_id = null;
25
+
26
+ if (blocksy_default_akg( 'mailchimp_list_id_source', $atts, 'default' ) === 'custom') {
27
+ $list_id = blocksy_default_akg( 'mailchimp_list_id', $atts, '' );
28
+ }
29
+
30
+ $manager = new BlocksyMailchimpManager();
31
+
32
+ // Button value
33
+ $form_url = $manager->get_form_url_for($list_id);
34
+
35
+ if (! $form_url) {
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
49
+ echo $before_widget;
50
+
51
+ echo '<div class="ct-widget-inner"' . $data_alignment . '>';
52
+
53
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
54
+ echo $before_title . wp_kses_post( $title ) . $after_title;
55
+
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">
63
+ <?php echo wp_kses_post($message) ?>
64
+ </div>
65
+ <?php } ?>
66
+
67
+ <div class="ct-fields">
68
+ <?php if ( $has_name ) { ?>
69
+ <input type="text" name="FNAME" placeholder="<?php esc_attr_e('Your Name', 'blocksy'); ?>" />
70
+ <?php } ?>
71
+
72
+ <input type="email" name="EMAIL" placeholder="<?php esc_attr_e('Your Email', 'blocksy'); ?> *" required />
73
+
74
+ <button class="button">
75
+ <?php echo esc_html($button_text) ?>
76
+ </button>
77
+
78
+ <?php
79
+ if (function_exists('blocksy_ext_cookies_checkbox')) {
80
+ echo blocksy_ext_cookies_checkbox();
81
+ }
82
+ ?>
83
+ </div>
84
+ </form>
85
+
86
+ </div>
87
+
88
+ <?php echo wp_kses_post( $after_widget ); ?>
framework/extensions/mailchimp/ct-mailchimp/widget.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Mailchimp 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_Mailchimp extends BlocksyWidgetFactory {
11
+ protected function get_config() {
12
+ return [
13
+ 'name' => __('Mailchimp Subscribe', 'blc'),
14
+ 'description' => __('Mailchimp subscribe form', 'blc'),
15
+ ];
16
+ }
17
+
18
+ public function get_path() {
19
+ return dirname(__FILE__);
20
+ }
21
+ }
22
+
framework/extensions/mailchimp/customizer.php ADDED
@@ -0,0 +1,234 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $options = [
4
+ 'label' => __( 'Subscribe Form', 'blc' ),
5
+ 'type' => 'ct-panel',
6
+ 'switch' => true,
7
+ 'value' => 'yes',
8
+ 'setting' => [ 'transport' => 'postMessage' ],
9
+ 'inner-options' => [
10
+
11
+ blocksy_rand_md5() => [
12
+ 'title' => __( 'General', 'blocksy' ),
13
+ 'type' => 'tab',
14
+ 'options' => [
15
+
16
+ 'mailchimp_title' => [
17
+ 'type' => 'text',
18
+ 'label' => __( 'Title', 'blc' ),
19
+ 'field_attr' => [ 'id' => 'widget-title' ],
20
+ 'design' => 'block',
21
+ 'value' => __( 'Newsletter Updates', 'blc' ),
22
+ 'disableRevertButton' => true,
23
+ 'setting' => [ 'transport' => 'postMessage' ],
24
+ ],
25
+
26
+ 'mailchimp_text' => [
27
+ 'label' => __( 'Message', 'blc' ),
28
+ 'type' => 'textarea',
29
+ 'value' => __( 'Enter your email address below to subscribe to our newsletter', 'blc' ),
30
+ 'design' => 'block',
31
+ 'disableRevertButton' => true,
32
+ 'setting' => [ 'transport' => 'postMessage' ],
33
+ ],
34
+
35
+ blocksy_rand_md5() => [
36
+ 'type' => 'ct-divider',
37
+ 'attr' => [ 'data-type' => 'small' ],
38
+ ],
39
+
40
+ 'mailchimp_list_id_source' => [
41
+ 'type' => 'ct-radio',
42
+ 'label' => __( 'List Source', 'blc' ),
43
+ 'value' => 'default',
44
+ 'view' => 'radio',
45
+ 'inline' => true,
46
+ 'design' => 'inline',
47
+ 'disableRevertButton' => true,
48
+ 'choices' => [
49
+ 'default' => __('Default', 'blc'),
50
+ 'custom' => __('Custom', 'blc'),
51
+ ],
52
+
53
+ 'setting' => [ 'transport' => 'postMessage' ],
54
+ ],
55
+
56
+ blocksy_rand_md5() => [
57
+ 'type' => 'ct-condition',
58
+ 'condition' => [ 'mailchimp_list_id_source' => 'custom' ],
59
+ 'options' => [
60
+
61
+ 'mailchimp_list_id' => [
62
+ 'label' => __( 'List ID', 'blc' ),
63
+ 'type' => 'blocksy-mailchimp',
64
+ 'value' => '',
65
+ 'design' => 'inline',
66
+ 'disableRevertButton' => true,
67
+ 'setting' => [ 'transport' => 'postMessage' ],
68
+ ],
69
+
70
+ ],
71
+ ],
72
+
73
+ 'has_mailchimp_name' => [
74
+ 'type' => 'ct-switch',
75
+ 'label' => __( 'Name Field', 'blc' ),
76
+ 'value' => 'no',
77
+ 'disableRevertButton' => true,
78
+ 'setting' => [ 'transport' => 'postMessage' ],
79
+ ],
80
+
81
+ 'mailchimp_button_text' => [
82
+ 'type' => 'text',
83
+ 'label' => __( 'Button Text', 'blc' ),
84
+ 'design' => 'block',
85
+ 'value' => __( 'Subscribe', 'blc' ),
86
+ 'disableRevertButton' => true,
87
+ 'setting' => [ 'transport' => 'postMessage' ],
88
+ ],
89
+
90
+ blocksy_rand_md5() => [
91
+ 'type' => 'ct-divider',
92
+ 'attr' => [ 'data-type' => 'small' ],
93
+ ],
94
+
95
+ 'mailchimp_subscribe_visibility' => [
96
+ 'label' => __( 'Visibility', 'blocksy' ),
97
+ 'type' => 'ct-visibility',
98
+ 'design' => 'block',
99
+ 'setting' => [ 'transport' => 'postMessage' ],
100
+ 'value' => [
101
+ 'desktop' => true,
102
+ 'tablet' => true,
103
+ 'mobile' => false,
104
+ ],
105
+
106
+ 'choices' => blocksy_ordered_keys([
107
+ 'desktop' => __( 'Desktop', 'blocksy' ),
108
+ 'tablet' => __( 'Tablet', 'blocksy' ),
109
+ 'mobile' => __( 'Mobile', 'blocksy' ),
110
+ ]),
111
+ ],
112
+
113
+ ],
114
+ ],
115
+
116
+ blocksy_rand_md5() => [
117
+ 'title' => __( 'Design', 'blocksy' ),
118
+ 'type' => 'tab',
119
+ 'options' => [
120
+
121
+ 'mailchimpContent' => [
122
+ 'label' => __( 'Content Color', 'blocksy' ),
123
+ 'type' => 'ct-color-picker',
124
+ 'design' => 'inline',
125
+ 'setting' => [ 'transport' => 'postMessage' ],
126
+
127
+ 'value' => [
128
+ 'default' => [
129
+ 'color' => 'var(--paletteColor3)',
130
+ ],
131
+ ],
132
+
133
+ 'pickers' => [
134
+ [
135
+ 'title' => __( 'Initial', 'blocksy' ),
136
+ 'id' => 'default',
137
+ ],
138
+ ],
139
+ ],
140
+
141
+ 'mailchimpButton' => [
142
+ 'label' => __( 'Button Color', 'blocksy' ),
143
+ 'type' => 'ct-color-picker',
144
+ 'design' => 'inline',
145
+ 'setting' => [ 'transport' => 'postMessage' ],
146
+
147
+ 'value' => [
148
+ 'default' => [
149
+ 'color' => 'var(--paletteColor1)',
150
+ ],
151
+
152
+ 'hover' => [
153
+ 'color' => 'var(--paletteColor2)',
154
+ ],
155
+ ],
156
+
157
+ 'pickers' => [
158
+ [
159
+ 'title' => __( 'Initial', 'blocksy' ),
160
+ 'id' => 'default',
161
+ ],
162
+
163
+ [
164
+ 'title' => __( 'Hover', 'blocksy' ),
165
+ 'id' => 'hover',
166
+ ],
167
+ ],
168
+ ],
169
+
170
+ 'mailchimpBackground' => [
171
+ 'label' => __( 'Background Color', 'blocksy' ),
172
+ 'type' => 'ct-color-picker',
173
+ 'design' => 'inline',
174
+ 'setting' => [ 'transport' => 'postMessage' ],
175
+
176
+ 'value' => [
177
+ 'default' => [
178
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword(),
179
+ ],
180
+ ],
181
+
182
+ 'pickers' => [
183
+ [
184
+ 'title' => __( 'Initial', 'blocksy' ),
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', 'blocksy' ),
217
+ 'type' => 'ct-slider',
218
+ 'value' => '40px',
219
+ 'units' => blocksy_units_config([
220
+ [
221
+ 'unit' => 'px',
222
+ 'min' => 0,
223
+ 'max' => 300,
224
+ ],
225
+ ]),
226
+ 'responsive' => true,
227
+ 'setting' => [ 'transport' => 'postMessage' ],
228
+ ],
229
+
230
+ ],
231
+ ],
232
+
233
+ ],
234
+ ];
framework/extensions/mailchimp/dashboard-static/bundle/main.js ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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=28)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.BlocksyReact},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t){e.exports=window.wp.i18n},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=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},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
+ */
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)})}]);
framework/extensions/mailchimp/dashboard-static/js/EditCredentials.js ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {
2
+ createElement,
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)
23
+ const [isLoading, setIsLoading] = useState(false)
24
+ const [isApiKeyInvalid, makeKeyInvalid] = useState(false)
25
+
26
+ const attemptToSaveCredentials = async () => {
27
+ const body = new FormData()
28
+
29
+ body.append('api_key', apiKey)
30
+ body.append('list_id', listId)
31
+
32
+ body.append('action', 'blocksy_ext_mailchimp_maybe_save_credentials')
33
+
34
+ setIsLoading(true)
35
+
36
+ try {
37
+ const response = await fetch(ctDashboardLocalizations.ajax_url, {
38
+ method: 'POST',
39
+ body
40
+ })
41
+
42
+ if (response.status === 200) {
43
+ const body = await response.json()
44
+
45
+ if (body.success) {
46
+ if (body.data.result !== 'api_key_invalid') {
47
+ onCredentialsValidated()
48
+ makeKeyInvalid(false)
49
+ }
50
+ }
51
+ }
52
+
53
+ makeKeyInvalid(true)
54
+ } catch (e) {
55
+ makeKeyInvalid(true)
56
+ }
57
+
58
+ await new Promise(r => setTimeout(() => r(), 1000))
59
+
60
+ setIsLoading(false)
61
+ }
62
+
63
+ return (
64
+ <Transition
65
+ items={isEditingCredentials}
66
+ config={{ duration: 200 }}
67
+ from={{ opacity: 0, y: -10 }}
68
+ enter={{ opacity: 1, y: 0 }}
69
+ leave={{ opacity: 0, y: 10 }}>
70
+ {isEditingCredentials =>
71
+ isEditingCredentials &&
72
+ (props => (
73
+ <DialogOverlay
74
+ style={{ opacity: props.opacity }}
75
+ onDismiss={() => setIsEditingCredentials(false)}>
76
+ <DialogContent
77
+ style={{
78
+ transform: `translate3d(0px, ${props.y}px, 0px)`
79
+ }}>
80
+ <button
81
+ className="close-button"
82
+ onClick={() => setIsEditingCredentials(false)}>
83
+ ×
84
+ </button>
85
+
86
+ <div
87
+ className={classnames(
88
+ 'ct-mailchimp-edit-credentials ct-extension-config',
89
+ {
90
+ 'ct-key-invalid': isApiKeyInvalid
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
+ </DialogContent>
150
+ </DialogOverlay>
151
+ ))
152
+ }
153
+ </Transition>
154
+ )
155
+ }
156
+
157
+ export default EditCredentials
framework/extensions/mailchimp/dashboard-static/js/ListPicker.js ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {
2
+ createElement,
3
+ Component,
4
+ useEffect,
5
+ useState,
6
+ Fragment
7
+ } from '@wordpress/element'
8
+ import Downshift from 'downshift'
9
+ import { __ } from 'ct-i18n'
10
+ import classnames from 'classnames'
11
+
12
+ const ListPicker = ({ listId, apiKey, onChange }) => {
13
+ const [lists, setLists] = useState([])
14
+ const [isLoadingLists, setListsLoading] = useState(false)
15
+
16
+ let [{ controller }, setAbortState] = useState({
17
+ controller: null
18
+ })
19
+
20
+ const maybeFetchLists = async () => {
21
+ if (controller) {
22
+ controller.abort()
23
+ }
24
+
25
+ setListsLoading(true)
26
+
27
+ if ('AbortController' in window) {
28
+ controller = new AbortController()
29
+
30
+ setAbortState({
31
+ controller
32
+ })
33
+ }
34
+
35
+ const body = new FormData()
36
+
37
+ body.append('api_key', apiKey)
38
+ body.append('action', 'blocksy_ext_mailchimp_maybe_get_lists')
39
+
40
+ try {
41
+ const response = await fetch(ctDashboardLocalizations.ajax_url, {
42
+ method: 'POST',
43
+ signal: controller.signal,
44
+ body
45
+ })
46
+ if (response.status === 200) {
47
+ const body = await response.json()
48
+
49
+ if (body.success) {
50
+ if (body.data.result !== 'api_key_invalid') {
51
+ setListsLoading(false)
52
+ setLists(body.data.result)
53
+
54
+ return
55
+ }
56
+ }
57
+ }
58
+ } catch (e) {}
59
+
60
+ setLists([])
61
+ setListsLoading(false)
62
+ }
63
+
64
+ useEffect(
65
+ () => {
66
+ if (!apiKey) {
67
+ setLists([])
68
+ return
69
+ }
70
+
71
+ if (apiKey.indexOf('-') === -1) {
72
+ setLists([])
73
+ return
74
+ }
75
+
76
+ maybeFetchLists()
77
+ },
78
+ [apiKey]
79
+ )
80
+
81
+ return lists.length === 0 ? (
82
+ <div className="ct-select-input">
83
+ <input
84
+ disabled
85
+ placeholder={
86
+ isLoadingLists ? __('Loading') : __('Invalid API Key...')
87
+ }
88
+ />
89
+ </div>
90
+ ) : (
91
+ <Downshift
92
+ selectedItem={listId || ''}
93
+ onChange={selection => onChange(selection)}
94
+ itemToString={item =>
95
+ item ? (lists.find(({ id }) => id === item) || {}).name : ''
96
+ }>
97
+ {({
98
+ getInputProps,
99
+ getItemProps,
100
+ getLabelProps,
101
+ getMenuProps,
102
+ isOpen,
103
+ inputValue,
104
+ highlightedIndex,
105
+ selectedItem,
106
+ openMenu
107
+ }) => (
108
+ <div className="ct-select-input">
109
+ <input
110
+ {...getInputProps({
111
+ onFocus: () => openMenu(),
112
+ onClick: () => openMenu()
113
+ })}
114
+ placeholder={__('Select list...')}
115
+ readOnly
116
+ />
117
+
118
+ {isOpen && (
119
+ <div
120
+ {...getMenuProps({
121
+ className: 'ct-select-dropdown'
122
+ })}>
123
+ {lists.map((item, index) => (
124
+ <div
125
+ {...getItemProps({
126
+ key: item.id,
127
+ index,
128
+ item: item.id,
129
+ className: classnames(
130
+ 'ct-select-dropdown-item',
131
+ {
132
+ active:
133
+ highlightedIndex === index,
134
+ selected:
135
+ selectedItem === item.id
136
+ }
137
+ )
138
+ })}>
139
+ {item.name}
140
+ </div>
141
+ ))}
142
+ </div>
143
+ )}
144
+ </div>
145
+ )}
146
+ </Downshift>
147
+ )
148
+ }
149
+
150
+ export default ListPicker
framework/extensions/mailchimp/dashboard-static/js/Mailchimp.js ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {
2
+ createElement,
3
+ Component,
4
+ useEffect,
5
+ useState,
6
+ Fragment
7
+ } from '@wordpress/element'
8
+ import { __ } from 'ct-i18n'
9
+ import classnames from 'classnames'
10
+
11
+ import useExtensionReadme from '../../../../../static/js/helpers/useExtensionReadme'
12
+ // import useActivationAction from '../../../../../static/js/helpers/useActivationAction'
13
+ import useActivationWithRequirements from './hooks/useActivationWithRequirements'
14
+
15
+ const Mailchimp = ({ extension, onExtsSync }) => {
16
+ const [isLoading, activationAction, ui] = useActivationWithRequirements(
17
+ extension,
18
+ () => {
19
+ onExtsSync()
20
+ }
21
+ )
22
+
23
+ const [showReadme, readme] = useExtensionReadme(extension)
24
+
25
+ return (
26
+ <li className={classnames({ active: !!extension.__object })}>
27
+ <h4 className="ct-extension-title">{extension.config.name}</h4>
28
+
29
+ {extension.config.description && (
30
+ <div className="ct-extension-description">
31
+ {extension.config.description}
32
+ </div>
33
+ )}
34
+
35
+ <div className="ct-extension-actions">
36
+ <button
37
+ className="ct-button"
38
+ data-button="white"
39
+ disabled={isLoading}
40
+ onClick={() => activationAction()}>
41
+ {isLoading
42
+ ? __('Loading')
43
+ : extension.__object
44
+ ? __('Deactivate')
45
+ : __('Activate')}
46
+ </button>
47
+
48
+ {ui}
49
+
50
+ {extension.readme && (
51
+ <button
52
+ onClick={() => showReadme()}
53
+ data-button="white"
54
+ className="ct-minimal-button ct-instruction">
55
+ <svg width="16" height="16" viewBox="0 0 24 24">
56
+ <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" />
57
+ </svg>
58
+ </button>
59
+ )}
60
+ </div>
61
+ {readme}
62
+ </li>
63
+ )
64
+ }
65
+
66
+ export default Mailchimp
framework/extensions/mailchimp/dashboard-static/js/hooks/useActivationWithRequirements.js ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {
2
+ createElement,
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 EditCredentials from '../EditCredentials'
12
+
13
+ const useActivationWithRequirements = (extension, cb = () => {}) => {
14
+ const [isLoading, setIsLoading] = useState(false)
15
+ const [isEditingCredentials, setIsEditingCredentials] = useState(false)
16
+
17
+ const toggleActivationState = async () => {
18
+ const body = new FormData()
19
+
20
+ body.append('ext', extension.name)
21
+ body.append(
22
+ 'action',
23
+ extension.__object
24
+ ? 'blocksy_extension_deactivate'
25
+ : 'blocksy_extension_activate'
26
+ )
27
+
28
+ setIsLoading(true)
29
+
30
+ try {
31
+ await fetch(ctDashboardLocalizations.ajax_url, {
32
+ method: 'POST',
33
+ body
34
+ })
35
+
36
+ cb()
37
+ } catch (e) {}
38
+
39
+ await new Promise(r => setTimeout(() => r(), 1000))
40
+
41
+ setIsLoading(false)
42
+ }
43
+
44
+ const handleActionWithRequirements = () => {
45
+ if (extension.__object || extension.data.api_key) {
46
+ toggleActivationState()
47
+ return
48
+ }
49
+
50
+ setIsEditingCredentials(true)
51
+ }
52
+
53
+ return [
54
+ isLoading,
55
+ handleActionWithRequirements,
56
+ <Fragment>
57
+ {extension.__object &&
58
+ extension.data.api_key && (
59
+ <button
60
+ className="ct-minimal-button ct-config-btn dashicons dashicons-admin-generic"
61
+ title="Edit Credentials"
62
+ onClick={() => setIsEditingCredentials(true)}>
63
+ </button>
64
+ )}
65
+
66
+ <EditCredentials
67
+ isEditingCredentials={isEditingCredentials}
68
+ setIsEditingCredentials={setIsEditingCredentials}
69
+ extension={extension}
70
+ onCredentialsValidated={() => {
71
+ if (!extension.__object) {
72
+ toggleActivationState()
73
+ }
74
+
75
+ setIsEditingCredentials(false)
76
+ }}
77
+ />
78
+ </Fragment>
79
+ ]
80
+ }
81
+
82
+ export default useActivationWithRequirements
framework/extensions/mailchimp/dashboard-static/js/main.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {
2
+ createElement,
3
+ Component,
4
+ useEffect,
5
+ useState,
6
+ Fragment
7
+ } from '@wordpress/element'
8
+
9
+ import Mailchimp from './Mailchimp'
10
+
11
+ ctEvents.on('ct:extensions:card', ({ CustomComponent, extension }) => {
12
+ if (extension.name !== 'mailchimp') return
13
+ CustomComponent.extension = Mailchimp
14
+ })
framework/extensions/mailchimp/extension.php ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once dirname( __FILE__ ) . '/helpers.php';
4
+ 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
+ $css, $tablet_css, $mobile_css
10
+ ) {
11
+
12
+ blocksy_get_variables_from_file(
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) {
25
+ $d[] = 'blocksy-ext-mailchimp-admin-scripts';
26
+ return $d;
27
+ });
28
+
29
+ add_action('admin_enqueue_scripts', function () {
30
+ if (! function_exists('get_plugin_data')) {
31
+ require_once(ABSPATH . 'wp-admin/includes/plugin.php');
32
+ }
33
+
34
+ $data = get_plugin_data(BLOCKSY__FILE__);
35
+
36
+ wp_register_script(
37
+ 'blocksy-ext-mailchimp-admin-scripts',
38
+ BLOCKSY_URL . 'framework/extensions/mailchimp/admin-static/bundle/main.js',
39
+ [],
40
+ $data['Version'],
41
+ false
42
+ );
43
+
44
+ wp_localize_script(
45
+ 'blocksy-ext-mailchimp-admin-scripts',
46
+ 'blocksy_ext_mailchimp_localization',
47
+ [
48
+ 'public_url' => BLOCKSY_URL . 'framework/extensions/mailchimp/admin-static/bundle/',
49
+ ]
50
+ );
51
+ });
52
+
53
+ add_action('wp_enqueue_scripts', function () {
54
+ if (! function_exists('get_plugin_data')) {
55
+ require_once(ABSPATH . 'wp-admin/includes/plugin.php');
56
+ }
57
+
58
+ $data = get_plugin_data(BLOCKSY__FILE__);
59
+
60
+ if (is_admin()) {
61
+ return;
62
+ }
63
+
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) {
73
+ $all_widgets[] = dirname(__FILE__) . '/ct-mailchimp';
74
+ return $all_widgets;
75
+ });
76
+
77
+ add_filter(
78
+ 'blocksy_single_posts_end_customizer_options',
79
+ function ($opts) {
80
+ $opts['mailchimp_single_post_enabled'] = blocksy_get_options(
81
+ dirname( __FILE__ ) . '/customizer.php',
82
+ [], false
83
+ );
84
+
85
+ return $opts;
86
+ }
87
+ );
88
+
89
+ add_action(
90
+ 'customize_preview_init',
91
+ function () {
92
+ if (! function_exists('get_plugin_data')){
93
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
94
+ }
95
+
96
+ $data = get_plugin_data(BLOCKSY__FILE__);
97
+
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
+ );
105
+ }
106
+ );
107
+
108
+ }
109
+ }
110
+
framework/extensions/mailchimp/global.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // Mailchimp
4
+ $mailchimpContent = blocksy_get_colors( get_theme_mod(
5
+ 'mailchimpContent',
6
+ [ 'default' => [ 'color' => 'var(--paletteColor3)' ] ]
7
+ ));
8
+
9
+ $css->put(
10
+ ':root',
11
+ "--mailchimpContent: {$mailchimpContent['default']}"
12
+ );
13
+
14
+ $mailchimpButton = blocksy_get_colors( get_theme_mod(
15
+ 'mailchimpButton',
16
+ [
17
+ 'default' => [ 'color' => 'var(--paletteColor1)' ],
18
+ 'hover' => [ 'color' => 'var(--paletteColor2)' ],
19
+ ]
20
+ ));
21
+
22
+ $css->put(
23
+ '.ct-mailchimp-block',
24
+ "--buttonInitialColor: {$mailchimpButton['default']}"
25
+ );
26
+
27
+ $css->put(
28
+ '.ct-mailchimp-block',
29
+ "--buttonHoverColor: {$mailchimpButton['hover']}"
30
+ );
31
+
32
+ $mailchimpBackground = blocksy_get_colors( get_theme_mod(
33
+ 'mailchimpBackground',
34
+ [ 'default' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword() ] ]
35
+ ));
36
+
37
+ $css->put(
38
+ ':root',
39
+ "--mailchimpBackground: {$mailchimpBackground['default']}"
40
+ );
41
+
42
+ $mailchimpShadow = blocksy_get_colors( get_theme_mod(
43
+ 'mailchimpShadow',
44
+ [ 'default' => [ 'color' => 'rgba(210, 213, 218, 0.4)' ] ]
45
+ ));
46
+
47
+ $css->put(
48
+ ':root',
49
+ "--mailchimpShadow: {$mailchimpShadow['default']}"
50
+ );
51
+
52
+ blocksy_output_responsive([
53
+ 'css' => $css,
54
+ 'tablet_css' => $tablet_css,
55
+ 'mobile_css' => $mobile_css,
56
+ 'selector' => ':root',
57
+ 'variableName' => 'mailchimpSpacing',
58
+ 'value' => get_theme_mod('mailchimpSpacing', [
59
+ 'mobile' => '40px',
60
+ 'tablet' => '40px',
61
+ 'desktop' => '40px',
62
+ ]),
63
+ 'unit' => ''
64
+ ]);
65
+
framework/extensions/mailchimp/helpers.php ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function blc_output_mailchimp_subscribe_form_cache() {
4
+ if (! is_customize_preview()) return;
5
+
6
+ blocksy_add_customizer_preview_cache(
7
+ blocksy_html_tag(
8
+ 'div',
9
+ [ 'data-id' => 'blocksy-mailchimp-subscribe' ],
10
+ blc_ext_mailchimp_subscribe_form(true)
11
+ )
12
+ );
13
+ }
14
+
15
+ function blc_ext_mailchimp_subscribe_form($forced = false) {
16
+ if (! $forced) {
17
+ blc_output_mailchimp_subscribe_form_cache();
18
+ }
19
+
20
+ if (get_theme_mod('mailchimp_single_post_enabled', 'yes') !== 'yes') {
21
+ if (! $forced) {
22
+ return '';
23
+ }
24
+ }
25
+
26
+ $title = get_theme_mod('mailchimp_title', __(
27
+ 'Newsletter Updates', 'blc'
28
+ ));
29
+
30
+ $description = get_theme_mod('mailchimp_text', __(
31
+ 'Enter your email address below to subscribe to our newsletter',
32
+ 'blc'
33
+ ));
34
+
35
+ $button_text = get_theme_mod('mailchimp_button_text', __(
36
+ 'Subscribe', 'blc'
37
+ ));
38
+
39
+ $has_name = get_theme_mod( 'has_mailchimp_name', 'no' ) === 'yes';
40
+
41
+ if ($forced) {
42
+ $has_name = true;
43
+ }
44
+
45
+ $list_id = null;
46
+
47
+ if (get_theme_mod( 'mailchimp_list_id_source', 'default' ) === 'custom') {
48
+ $list_id = get_theme_mod( 'mailchimp_list_id', '' );
49
+ }
50
+
51
+ $manager = new BlocksyMailchimpManager();
52
+
53
+ $form_url = $manager->get_form_url_for($list_id);
54
+
55
+ if (! $form_url) {
56
+ return '';
57
+ }
58
+
59
+ $class = 'ct-mailchimp-block';
60
+
61
+ $class .= ' ' . blocksy_visibility_classes(
62
+ get_theme_mod('mailchimp_subscribe_visibility', [
63
+ 'desktop' => true,
64
+ 'tablet' => true,
65
+ 'mobile' => false,
66
+ ])
67
+ );
68
+
69
+ ob_start();
70
+
71
+ ?>
72
+
73
+ <div class="<?php esc_attr_e($class) ?>">
74
+ <h4>
75
+ <?php echo esc_html($title) ?>
76
+ </h4>
77
+
78
+ <p class="ct-mailchimp-description">
79
+ <?php echo esc_html($description) ?>
80
+ </p>
81
+
82
+ <form action="<?php echo esc_attr($form_url) ?>" method="post" class="ct-mailchimp-form">
83
+ <?php if ( $has_name ) { ?>
84
+ <input type="text" name="FNAME" placeholder="<?php esc_attr_e('Your Name', 'blocksy'); ?>" />
85
+ <?php } ?>
86
+
87
+ <input type="email" name="EMAIL" placeholder="<?php esc_attr_e('Your Email', 'blocksy'); ?> *" required />
88
+
89
+ <button class="button">
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
+
99
+ </form>
100
+
101
+ </div>
102
+
103
+ <?php
104
+
105
+ return ob_get_clean();
106
+ }
framework/extensions/mailchimp/mailchimp-manager.php ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class BlocksyMailchimpManager {
4
+ public function __construct() {
5
+ }
6
+
7
+ public function get_settings() {
8
+ return array_merge([
9
+ 'api_key' => null,
10
+ 'list_id' => null
11
+ ], get_option('blocksy_ext_mailchimp_credentials', []));
12
+ }
13
+
14
+ public function set_settings($vals) {
15
+ update_option('blocksy_ext_mailchimp_credentials', array_merge([
16
+ 'api_key' => null,
17
+ 'list_id' => null
18
+ ], $vals));
19
+ }
20
+
21
+ public function can( $capability = 'manage_options' ) {
22
+ if ( is_multisite() ) {
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 ( $can ) {
30
+ // Also you can use this method to get the capability.
31
+ $can = $capability;
32
+ }
33
+
34
+ return $can;
35
+ }
36
+
37
+ public function fetch_lists($api_key) {
38
+ if (! $api_key) {
39
+ return 'api_key_invalid';
40
+ }
41
+
42
+ if (strpos($api_key, '-') === false) {
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', [
50
+ 'headers' => [
51
+ 'Authorization' => 'Basic ' . base64_encode('asd:' . $api_key)
52
+ ]
53
+ ]);
54
+
55
+ if ( ! is_wp_error( $response ) ) {
56
+ if ( 200 !== wp_remote_retrieve_response_code( $response ) ) {
57
+ return 'api_key_invalid';
58
+ }
59
+
60
+ $body = json_decode(wp_remote_retrieve_body( $response ), true);
61
+
62
+ if (! $body) {
63
+ return 'api_key_invalid';
64
+ }
65
+
66
+ if (! isset($body['lists'])) {
67
+ return 'api_key_invalid';
68
+ }
69
+
70
+ return array_map(function($list) {
71
+ return [
72
+ 'name' => $list['name'],
73
+ 'id' => $list['id'],
74
+ 'subscribe_url_long' => $list['subscribe_url_long']
75
+ ];
76
+ }, $body['lists']);
77
+ } else {
78
+ return 'api_key_invalid';
79
+ }
80
+ }
81
+
82
+ public function get_form_url_for($maybe_custom_list = null) {
83
+ $settings = $this->get_settings();
84
+
85
+ if (! isset($settings['api_key'])) {
86
+ return false;
87
+ }
88
+
89
+ if (! $settings['api_key']) {
90
+ return false;
91
+ }
92
+
93
+ $lists = $this->fetch_lists($settings['api_key']);
94
+
95
+ if (! is_array($lists)) {
96
+ return false;
97
+ }
98
+
99
+ if (empty($lists)) {
100
+ return false;
101
+ }
102
+
103
+ if ($maybe_custom_list) {
104
+ $settings['list_id'] = $maybe_custom_list;
105
+ }
106
+
107
+ if (! $settings['list_id']) {
108
+ return $lists[0]['subscribe_url_long'];
109
+ }
110
+
111
+ foreach ($lists as $single_list) {
112
+ if ($single_list['id'] === $settings['list_id']) {
113
+ return $single_list['subscribe_url_long'];
114
+ }
115
+ }
116
+
117
+ return $lists[0]['subscribe_url_long'];
118
+ }
119
+ }
120
+
framework/extensions/mailchimp/pre-boot.php ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
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',
10
+ [$this, 'get_lists']
11
+ );
12
+
13
+ add_action(
14
+ 'wp_ajax_blocksy_ext_mailchimp_get_actual_lists',
15
+ [$this, 'get_actual_lists']
16
+ );
17
+
18
+ add_action(
19
+ 'wp_ajax_blocksy_ext_mailchimp_maybe_save_credentials',
20
+ [$this, 'save_credentials']
21
+ );
22
+
23
+ add_filter('blocksy-dashboard-scripts-dependencies', function ($s) {
24
+ $s[] = 'blocksy-ext-mailchimp-dashboard-scripts';
25
+ return $s;
26
+ });
27
+
28
+ add_action('admin_enqueue_scripts', function () {
29
+ if (! function_exists('get_plugin_data')) {
30
+ require_once(ABSPATH . 'wp-admin/includes/plugin.php');
31
+ }
32
+
33
+ $data = get_plugin_data(BLOCKSY__FILE__);
34
+
35
+ wp_register_script(
36
+ 'blocksy-ext-mailchimp-dashboard-scripts',
37
+ BLOCKSY_URL . 'framework/extensions/mailchimp/dashboard-static/bundle/main.js',
38
+ [],
39
+ $data['Version'],
40
+ true
41
+ );
42
+ });
43
+ }
44
+
45
+ public function ext_data() {
46
+ $m = new BlocksyMailchimpManager();
47
+ return $m->get_settings();
48
+ }
49
+
50
+ public function save_credentials() {
51
+ $this->maybe_save_credentials();
52
+ }
53
+
54
+ public function get_actual_lists() {
55
+ $m = new BlocksyMailchimpManager();
56
+
57
+ if ( ! $m->can() ) {
58
+ wp_send_json_error();
59
+ }
60
+
61
+ $settings = $m->get_settings();
62
+
63
+ $lists = $m->fetch_lists($settings['api_key']);
64
+
65
+ wp_send_json_success([
66
+ 'result' => $lists
67
+ ]);
68
+ }
69
+
70
+ public function get_lists() {
71
+ $this->maybe_save_credentials(false);
72
+ }
73
+
74
+ public function maybe_save_credentials($save = true) {
75
+ $m = new BlocksyMailchimpManager();
76
+
77
+ if ( ! $m->can() ) {
78
+ wp_send_json_error();
79
+ }
80
+
81
+ $lists = $m->fetch_lists($this->get_api_key_from_request());
82
+
83
+ if ($save) {
84
+ if (is_array($lists)) {
85
+ $m->set_settings([
86
+ 'api_key' => $this->get_api_key_from_request(),
87
+ 'list_id' => $this->get_list_id_from_request(),
88
+ ]);
89
+ }
90
+ }
91
+
92
+ wp_send_json_success([
93
+ 'result' => $lists
94
+ ]);
95
+ }
96
+
97
+ public function get_api_key_from_request() {
98
+ if ( ! isset( $_POST['api_key'] ) ) {
99
+ wp_send_json_error();
100
+ }
101
+
102
+ return addslashes( $_POST['api_key'] );
103
+ }
104
+
105
+ public function get_list_id_from_request() {
106
+ if ( ! isset( $_POST['list_id'] ) ) {
107
+ wp_send_json_error();
108
+ }
109
+
110
+ return addslashes( $_POST['list_id'] );
111
+ }
112
+ }
framework/extensions/mailchimp/readme.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h1><?php echo __('Instructions', 'blc'); ?></h1>
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
+ <b>
10
+ <?php echo __('Mailchimp Widget', 'blc') ?>
11
+ </b>
12
+ <i>
13
+ <?php
14
+ echo sprintf(
15
+ __('Navigate to %s and place the widget in any widget area you want.', 'blc'),
16
+ sprintf(
17
+ '<code>%s</code>',
18
+ __('Appearance ➝ Widgets', 'blc')
19
+ )
20
+ );
21
+ ?>
22
+ </i>
23
+ </li>
24
+
25
+ <li>
26
+ <b>
27
+ <?php echo __('Mailchimp Block', 'blc') ?>
28
+ </b>
29
+ <i>
30
+ <?php
31
+ echo sprintf(
32
+ __('Navigate to %s and customize the form and more.', 'blc'),
33
+ sprintf(
34
+ '<code>%s</code>',
35
+ __('Customizer ➝ Single Posts', 'blc')
36
+ )
37
+ );
38
+ ?>
39
+ </i>
40
+ </li>
41
+ </ol>
42
+
43
+
framework/extensions/mailchimp/static/bundle/main.css ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /**
2
+ * - v1.0.3
3
+ *
4
+ * Copyright (c) 2019
5
+ * Licensed GPLv2+
6
+ */
7
+
8
+ .ct-mailchimp-widget .ct-mailchimp-description:not(:empty){margin-bottom:20px}.ct-mailchimp-widget input{text-align:center}aside[data-type="type-1"] .ct-mailchimp-widget{padding:30px;background:#fff;border-radius:3px;-webkit-box-shadow:0px 12px 18px -6px rgba(34,56,101,0.04);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="center"] .gdpr-confirm-policy{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.ct-widget-inner[data-alignment="right"]{text-align:right}.ct-widget-inner[data-alignment="right"] .gdpr-confirm-policy{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.ct-mailchimp-block{margin-top:60px;color:var(--mailchimpContent);padding:var(--mailchimpSpacing);background:var(--mailchimpBackground);-webkit-box-shadow:0px 60px 90px 0px var(--mailchimpShadow);box-shadow:0px 60px 90px 0px var(--mailchimpShadow)}.ct-mailchimp-block>*:first-child{margin-top:20px}.ct-mailchimp-block>*:last-child{margin-bottom:20px}.ct-mailchimp-block h4{text-align:center}.ct-mailchimp-block .ct-mailchimp-description{text-align:center}.ct-mailchimp-block .ct-mailchimp-description:not(:empty){margin-top:10px;margin-bottom:40px}.ct-mailchimp-block form{display:grid;grid-column-gap:15px;grid-row-gap:15px;margin-left:auto;margin-right:auto}@media (max-width: 689.98px){.ct-mailchimp-block form input{text-align:center}}@media (min-width: 690px){.ct-mailchimp-block form{grid-template-columns:repeat(3, 1fr)}}@media (min-width: 1000px){.ct-mailchimp-block form{width:85%;max-width:550px}}.ct-mailchimp-form .ct-fields>*:not(:last-child){margin-bottom:10px}.ct-mailchimp-form .button{width:100%;font-size:15px;font-weight:600;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;color:#fff;height:45px;padding:0 25px;border:none;border-radius:3px;background-color:var(--buttonInitialColor);-webkit-transition:color 0.2s ease, background 0.2s ease, -webkit-transform 0.2s ease;transition:color 0.2s ease, background 0.2s ease, -webkit-transform 0.2s ease;transition:color 0.2s ease, transform 0.2s ease, background 0.2s ease;transition:color 0.2s ease, transform 0.2s ease, background 0.2s ease, -webkit-transform 0.2s ease;position:relative}.ct-mailchimp-form .button:hover{background-color:var(--buttonHoverColor);-webkit-transform:translate3d(0, -3px, 0);transform:translate3d(0, -3px, 0)}.ct-mailchimp-form .button:focus{outline:none}.ct-mailchimp-form .button:before{position:absolute;z-index:-1;content:'';top:0;left:0;right:0;bottom:0;display:block;border-radius:inherit;opacity:0;-webkit-box-shadow:0px 8px 30px 0px var(--buttonHoverColor);box-shadow:0px 8px 30px 0px var(--buttonHoverColor);-webkit-transition:opacity 0.2s ease;transition:opacity 0.2s ease}.ct-mailchimp-form .button:hover:before{opacity:0.5}
framework/extensions/mailchimp/static/sass/main.scss ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../../../../../static/sass/common-frontend';
2
+ @import 'widget';
3
+ @import 'single-block';
4
+
5
+ .ct-mailchimp-form {
6
+
7
+ .ct-fields {
8
+ > * {
9
+ &:not(:last-child) {
10
+ margin-bottom: 10px;
11
+ }
12
+ }
13
+ }
14
+
15
+ .button {
16
+ width: 100%;
17
+ font-size: 15px;
18
+ font-weight: 600;
19
+
20
+ @include button((
21
+ // padding: 18px,
22
+ ));
23
+ }
24
+
25
+ &:invalid {
26
+ .button {
27
+ // pointer-events: none;
28
+ }
29
+ }
30
+ }
framework/extensions/mailchimp/static/sass/single-block.scss ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ct-mailchimp-block {
2
+ margin-top: 60px;
3
+ color: var(--mailchimpContent);
4
+ padding: var(--mailchimpSpacing);
5
+ background: var(--mailchimpBackground);
6
+ box-shadow: 0px 60px 90px 0px var(--mailchimpShadow);
7
+
8
+ > * {
9
+ &:first-child {
10
+ margin-top: 20px;
11
+ }
12
+
13
+ &:last-child {
14
+ margin-bottom: 20px;
15
+ }
16
+ }
17
+
18
+ h4 {
19
+ text-align: center;
20
+ }
21
+
22
+ .ct-mailchimp-description {
23
+ text-align: center;
24
+
25
+ &:not(:empty) {
26
+ margin-top: 10px;
27
+ margin-bottom: 40px;
28
+ }
29
+ }
30
+
31
+
32
+ form {
33
+ display: grid;
34
+ grid-column-gap: 15px;
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
+ grid-template-columns: repeat(3, 1fr);
47
+ }
48
+
49
+ @include media-breakpoint-up (lg) {
50
+ width: 85%;
51
+ max-width: 550px
52
+ }
53
+ }
54
+ }
framework/extensions/mailchimp/static/sass/widget.scss ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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;
16
+ background: #fff;
17
+ border-radius: 3px;
18
+ box-shadow: 0px 12px 18px -6px rgba(34, 56, 101, 0.04);
19
+ }
20
+ }
21
+
22
+ // alignment
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
+ .gdpr-confirm-policy {
36
+ justify-content: flex-end;
37
+ }
38
+ }
39
+ }
40
+
framework/extensions/read-progress/config.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $config = [
4
+ 'description' => __('Display a neat reading progress bar at the top single posts and pages.', 'blc')
5
+ ];
6
+
7
+
8
+
framework/extensions/read-progress/extension.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once dirname( __FILE__ ) . '/helpers.php';
4
+
5
+ class BlocksyExtensionReadProgress {
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()) return;
15
+
16
+ if (! BlocksyExtensionReadProgress::should_enable_progress_bar()) {
17
+ return;
18
+ }
19
+
20
+ wp_enqueue_style(
21
+ 'blocksy-ext-read-progress-bar-styles',
22
+ BLOCKSY_URL . 'framework/extensions/read-progress/static/bundle/main.css',
23
+ [],
24
+ $data['Version']
25
+ );
26
+
27
+ wp_enqueue_script(
28
+ 'blocksy-ext-read-progress-bar-scripts',
29
+ BLOCKSY_URL . 'framework/extensions/read-progress/static/bundle/main.js',
30
+ [],
31
+ $data['Version'],
32
+ true
33
+ );
34
+
35
+ $data = [
36
+ 'public_url' => BLOCKSY_URL . 'framework/extensions/read-progress/static/bundle/',
37
+ ];
38
+
39
+ wp_localize_script(
40
+ 'blocksy-ext-read-progress-bar-scripts',
41
+ 'blocksy_ext_read_progress_localization',
42
+ $data
43
+ );
44
+ });
45
+
46
+ add_filter('blocksy_extensions_metabox_page_bottom', function ($opts) {
47
+ $opts['read_progress_bar'] = [
48
+ 'label' => __( 'Read progress bar', 'blocksy' ),
49
+ 'type' => 'ct-switch',
50
+ 'value' => 'yes',
51
+ ];
52
+
53
+ return $opts;
54
+ });
55
+ }
56
+
57
+ public static function should_enable_progress_bar() {
58
+ if (! function_exists('blocksy_is_page')) {
59
+ return false;
60
+ }
61
+
62
+ if (! blocksy_is_page() && !is_single()) {
63
+ return false;
64
+ }
65
+
66
+ if (is_single() && get_post_type() !== 'post') {
67
+ return false;
68
+ }
69
+
70
+ return blocksy_default_akg(
71
+ 'read_progress_bar',
72
+ blocksy_get_post_options(),
73
+ 'yes'
74
+ ) === 'yes';
75
+ }
76
+ }
framework/extensions/read-progress/helpers.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function blc_output_read_progress_bar() {
4
+ if (! BlocksyExtensionReadProgress::should_enable_progress_bar()) {
5
+ return '';
6
+ }
7
+
8
+ return '<div class="ct-read-progress-bar"></div>';
9
+ }
10
+
framework/extensions/read-progress/readme.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h1><?php echo __('Instructions', 'blc'); ?></h1>
2
+
3
+ <p>
4
+ <?php echo __('After installing and activating the Read Progress extension you will be able to configure it from this location:', 'blc') ?>
5
+ </p>
6
+
7
+ <ul>
8
+
9
+ <li>
10
+ <b>
11
+ <?php echo __('Metabox', 'blc') ?>
12
+ </b>
13
+ <i>
14
+ <?php
15
+ echo __(
16
+ 'From the posts or pages metabox you will have the possibility to deactivate or activate the progress bar.', 'blc'
17
+ );
18
+ ?>
19
+ </i>
20
+ </li>
21
+ </ul>
22
+
framework/extensions/read-progress/static/bundle/1.4e041077b3d19928a037.js ADDED
@@ -0,0 +1 @@
 
1
+ (window.blocksyReadProgressWidgetJsonp=window.blocksyReadProgressWidgetJsonp||[]).push([[1],{2:function(e,t,n){"use strict";n.r(t),n.d(t,"mount",function(){return o});var r=function(){var e=document.querySelector(".entry-content").getBoundingClientRect();document.querySelector(".ct-read-progress-bar").style.setProperty("--scroll",Math.max(0,Math.min(100,100*pageYOffset/(e.top+e.height+pageYOffset-innerHeight)))+"%")},o=function(){r(),document.addEventListener("scroll",function(){return r()})}}}]);
framework/extensions/read-progress/static/bundle/main.css ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /**
2
+ * - v1.0.3
3
+ *
4
+ * Copyright (c) 2019
5
+ * Licensed GPLv2+
6
+ */
7
+
8
+ .ct-read-progress-bar{background:-webkit-gradient(linear, left top, right top, from(var(--paletteColor1)), color-stop(0, transparent));background:linear-gradient(to right, var(--paletteColor1) var(--scroll, 0%), transparent 0);background-repeat:no-repeat;position:fixed;top:0;width:100%;height:3px;z-index:10;opacity:1;-webkit-transition:opacity 0.1s ease;transition:opacity 0.1s ease}.ct-read-progress-bar[style*='100']{opacity:0}@media screen and (min-width: 783px){.admin-bar .ct-read-progress-bar{top:32px}}@media screen and (max-width: 782px){.admin-bar .ct-read-progress-bar{top:46px}}@media screen and (max-width: 600px){.admin-bar .ct-read-progress-bar{top:0}}
framework/extensions/read-progress/static/bundle/main.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){function t(t){for(var r,o,u=t[0],i=t[1],c=0,l=[];c<u.length;c++)o=u[c],n[o]&&l.push(n[o][0]),n[o]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);for(a&&a(t);l.length;)l.shift()()}var r={},n={0:0};function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.e=function(e){var t=[],r=n[e];if(0!==r)if(r)t.push(r[2]);else{var u=new Promise(function(t,o){r=n[e]=[t,o]});t.push(r[2]=u);var i,c=document.createElement("script");c.charset="utf-8",c.timeout=120,o.nc&&c.setAttribute("nonce",o.nc),c.src=function(e){return o.p+""+e+"."+{1:"4e041077b3d19928a037"}[e]+".js"}(e),i=function(t){c.onerror=c.onload=null,clearTimeout(a);var r=n[e];if(0!==r){if(r){var o=t&&("load"===t.type?"missing":t.type),u=t&&t.target&&t.target.src,i=new Error("Loading chunk "+e+" failed.\n("+o+": "+u+")");i.type=o,i.request=u,r[1](i)}n[e]=void 0}};var a=setTimeout(function(){i({type:"timeout",target:c})},12e4);c.onerror=c.onload=i,document.head.appendChild(c)}return Promise.all(t)},o.m=e,o.c=r,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},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 u=window.blocksyReadProgressWidgetJsonp=window.blocksyReadProgressWidgetJsonp||[],i=u.push.bind(u);u.push=t,u=u.slice();for(var c=0;c<u.length;c++)t(u[c]);var a=i;o(o.s=0)}([function(e,t,r){"use strict";r.r(t);r(1);document.addEventListener("DOMContentLoaded",function(){document.querySelector(".ct-read-progress-bar")&&r.e(1).then(r.bind(null,2)).then(function(e){return(0,e.mount)()})})},function(e,t,r){r.p=blocksy_ext_read_progress_localization.public_url}]);
framework/extensions/read-progress/static/js/implementation.js ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const render = () => {
2
+ const entryContent = document
3
+ .querySelector('.entry-content')
4
+ .getBoundingClientRect()
5
+
6
+ document
7
+ .querySelector('.ct-read-progress-bar')
8
+ .style.setProperty(
9
+ '--scroll',
10
+ `${Math.max(
11
+ 0,
12
+ Math.min(
13
+ 100,
14
+ 100 *
15
+ pageYOffset /
16
+ (entryContent.top +
17
+ entryContent.height +
18
+ pageYOffset -
19
+ innerHeight)
20
+ )
21
+ )}%`
22
+ )
23
+ }
24
+
25
+ export const mount = () => {
26
+ render()
27
+ document.addEventListener('scroll', () => render())
28
+ }
framework/extensions/read-progress/static/js/main.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ import './public-path'
2
+
3
+ document.addEventListener('DOMContentLoaded', () => {
4
+ if (!document.querySelector('.ct-read-progress-bar')) {
5
+ return
6
+ }
7
+
8
+ import('./implementation').then(({ mount }) => mount())
9
+ })
framework/extensions/read-progress/static/js/public-path.js ADDED
@@ -0,0 +1 @@
 
1
+ __webpack_public_path__ = blocksy_ext_read_progress_localization.public_url
framework/extensions/read-progress/static/sass/main.scss ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ct-read-progress-bar {
2
+ background: linear-gradient(to right, var(--paletteColor1) var(--scroll, 0%), transparent 0);
3
+ background-repeat: no-repeat;
4
+ position: fixed;
5
+ top: 0;
6
+ width: 100%;
7
+ height: 3px;
8
+ z-index: 10;
9
+ opacity: 1;
10
+ transition: opacity 0.1s ease;
11
+
12
+ &[style*='100'] {
13
+ opacity: 0;
14
+ }
15
+ }
16
+
17
+ .admin-bar .ct-read-progress-bar {
18
+ @media screen and (min-width: 783px) {
19
+ top: 32px;
20
+ }
21
+
22
+ @media screen and (max-width: 782px) {
23
+ top: 46px;
24
+ }
25
+
26
+ @media screen and (max-width: 600px) {
27
+ top: 0;
28
+ }
29
+ }
framework/extensions/widgets/config.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ $config = [
4
+ 'description' => __('Popular/Recent Posts, Advertisement, Contact Info, Mailchimp Subscribe, Social Icons and more.', 'blc')
5
+ ];
framework/extensions/widgets/extension.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class BlocksyExtensionWidgets {
4
+ public function __construct() {
5
+ add_filter('blocksy_widgets_paths', function ($all_widgets) {
6
+ $all_widgets = array_merge(
7
+ $all_widgets,
8
+ glob(
9
+ dirname(__FILE__) . '/widgets/*',
10
+ GLOB_ONLYDIR
11
+ )
12
+ );
13
+
14
+ return $all_widgets;
15
+ });
16
+
17
+ add_action('wp_enqueue_scripts', function () {
18
+ if (! function_exists('get_plugin_data')){
19
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
20
+ }
21
+
22
+ $data = get_plugin_data(BLOCKSY__FILE__);
23
+
24
+ if (is_admin()) return;
25
+
26
+ wp_enqueue_style(
27
+ 'blocksy-ext-widgets-styles',
28
+ BLOCKSY_URL . 'framework/extensions/widgets/static/bundle/main.css',
29
+ [
30
+ 'ct-main-styles'
31
+ ],
32
+ $data['Version']
33
+ );
34
+ });
35
+ }
36
+ }
framework/extensions/widgets/static/bundle/main.css ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /**
2
+ * - v1.0.3
3
+ *
4
+ * Copyright (c) 2019
5
+ * Licensed GPLv2+
6
+ */
7
+
8
+ .ct-posts-widget ul li{display:-webkit-box;display:-ms-flexbox;display:flex;margin-bottom:20px}.ct-posts-widget ul li .ct-image-container{-ms-flex-item-align:start;align-self:flex-start}@media (max-width: 999.98px){.ct-posts-widget ul li .ct-image-container{-webkit-box-flex:0;-ms-flex:0 0 15%;flex:0 0 15%;margin-right:3%}}@media (min-width: 1000px){.ct-posts-widget ul li .ct-image-container{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;margin-right:20px}}.ct-posts-widget ul li .ct-entry-content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;min-width:0}.ct-posts-widget ul li .ct-entry-content a{font-size:15px;font-weight:500;word-wrap:break-word;word-break:break-word}.ct-posts-widget ul li .ct-entry-content a::before{content:'';display:block;height:0;width:0;margin-top:calc((1 - 1.65) * 0.5em)}.ct-posts-widget ul li .ct-entry-meta span:not(:last-child):after{content:'/';margin:0 3px}.ct-contact-info-widget ul{font-size:15px;margin-top:30px}.ct-contact-info-widget ul li{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-bottom:20px}.ct-contact-info-widget i{margin-right:18px}.ct-contact-info-widget i svg{opacity:0.9}.ct-contact-info-widget .contact-info{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.ct-contact-info-widget .contact-title{font-weight:600}.ct-contact-info-widget [data-icons*="solid"] i{background:rgba(218,222,228,0.3);-webkit-transition:color 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);transition:color 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-contact-info-widget [data-icons*="solid"] li:hover i{color:#fff;background:var(--paletteColor1)}
framework/extensions/widgets/static/sass/contact-info.scss ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ct-contact-info-widget {
2
+
3
+ ul {
4
+ font-size: 15px;
5
+ margin-top: 30px;
6
+
7
+ li {
8
+ display: flex;
9
+ align-items: center;
10
+ margin-bottom: 20px;
11
+ }
12
+ }
13
+
14
+ i {
15
+ margin-right: 18px;
16
+
17
+ svg {
18
+ opacity: 0.9;
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
+ // fill type
32
+ [data-icons*="solid"] {
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
+ li:hover i {
41
+ color: #fff;
42
+ background: var(--paletteColor1);
43
+ }
44
+ }
45
+ }
framework/extensions/widgets/static/sass/main.scss ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ @import '../../../../../static/sass/common-frontend';
2
+
3
+ @import 'posts';
4
+ @import 'contact-info';
framework/extensions/widgets/static/sass/posts.scss ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ct-posts-widget {
2
+ ul {
3
+ li {
4
+ display: flex;
5
+ margin-bottom: 20px;
6
+
7
+ .ct-image-container {
8
+ align-self: flex-start;
9
+
10
+ @include media-breakpoint-down (md) {
11
+ flex: 0 0 15%;
12
+ margin-right: 3%;
13
+ }
14
+
15
+ @include media-breakpoint-up (lg) {
16
+ flex: 0 0 25%;
17
+ margin-right: 20px;
18
+ }
19
+ }
20
+
21
+ .ct-entry-content {
22
+ display: flex;
23
+ flex-direction: column;
24
+ justify-content: center;
25
+ min-width: 0;
26
+
27
+ a {
28
+ font-size: 15px;
29
+ font-weight: 500;
30
+ // line-height: 1.4;
31
+ word-wrap: break-word;
32
+ word-break: break-word;
33
+ @include lhCrop(1.65);
34
+ }
35
+ }
36
+
37
+ .ct-entry-meta {
38
+ span {
39
+ &:not(:last-child) {
40
+ &:after {
41
+ content: '/';
42
+ margin: 0 3px;
43
+ }
44
+ }
45
+ }
46
+ }
47
+ }
48
+ }
49
+ }
framework/extensions/widgets/widgets/ct-advertisement/options.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Advertisement 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' => __( 'Advertisement', 'blc' ),
19
+ 'disableRevertButton' => true,
20
+ ],
21
+
22
+ 'ad_source' => [
23
+ 'label' => __( 'Source', 'blc' ),
24
+ 'type' => 'ct-radio',
25
+ 'value' => 'code',
26
+ 'view' => 'radio',
27
+ 'design' => 'inline',
28
+ 'inline' => true,
29
+ 'disableRevertButton' => true,
30
+ 'choices' => [
31
+ 'code' => __( 'Code', 'blc' ),
32
+ 'upload' => __( 'Image', 'blc' ),
33
+ ],
34
+ ],
35
+
36
+ blocksy_rand_md5() => [
37
+ 'type' => 'ct-condition',
38
+ 'condition' => [ 'ad_source' => 'code' ],
39
+ 'options' => [
40
+
41
+ 'ad_code' => [
42
+ 'label' => __( 'Ad Code', 'blc' ),
43
+ 'type' => 'textarea',
44
+ 'value' => '',
45
+ 'design' => 'inline',
46
+ 'disableRevertButton' => true,
47
+ ],
48
+
49
+ ],
50
+ ],
51
+
52
+ blocksy_rand_md5() => [
53
+ 'type' => 'ct-condition',
54
+ 'condition' => [ 'ad_source' => 'upload' ],
55
+ 'options' => [
56
+
57
+ 'ad_image' => [
58
+ 'label' => __('Upload Image', 'blc'),
59
+ 'type' => 'ct-image-uploader',
60
+ 'design' => 'inline',
61
+ 'value' => [ 'attachment_id' => null ],
62
+ 'emptyLabel' => __('Select Image', 'blc'),
63
+ 'filledLabel' => __('Change Image', 'blc'),
64
+ ],
65
+
66
+ 'ad_link' => [
67
+ 'type' => 'text',
68
+ 'label' => __( 'Ad URL', 'blc' ),
69
+ 'design' => 'inline',
70
+ 'value' => 'https://creativethemes.com',
71
+ 'disableRevertButton' => true,
72
+ ],
73
+
74
+ 'ad_link_target' => [
75
+ 'type' => 'ct-switch',
76
+ 'label' => __( 'Open link in new tab', 'blc' ),
77
+ 'value' => 'yes',
78
+ 'disableRevertButton' => true,
79
+ ],
80
+
81
+ ],
82
+ ],
83
+
84
+ ];
framework/extensions/widgets/widgets/ct-advertisement/view.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Advertisement 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, __( 'Advertisement', 'blc' ) );
13
+
14
+ // Ad source
15
+ $source = blocksy_default_akg( 'ad_source', $atts, 'code' );
16
+
17
+ // Button text
18
+ $ad_code = blocksy_default_akg( 'ad_code', $atts, '' );
19
+
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 = blocksy_image([
27
+ 'attachment_id' => blocksy_default_akg( 'ad_image/attachment_id', $atts, null ),
28
+ 'ratio' => 'original',
29
+ 'tag_name' => 'a',
30
+ 'size' => 'large',
31
+ 'html_atts' => array_merge([
32
+ 'href' => esc_url( $ad_link ),
33
+ ], $ad_link_target !== 'yes' ? [] : [
34
+ 'target' => '_blank'
35
+ ]),
36
+ ]);
37
+
38
+
39
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
40
+ echo $before_widget;
41
+
42
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
43
+ echo $before_title . wp_kses_post( $title ) . $after_title;
44
+
45
+ ?>
46
+
47
+ <div class="ct-advertisement">
48
+ <?php if ( $source === 'code' ) {
49
+ echo $ad_code;
50
+ } else {
51
+ echo $image_output;
52
+ } ?>
53
+ </div>
54
+
55
+ <?php echo wp_kses_post( $after_widget ); ?>
framework/extensions/widgets/widgets/ct-advertisement/widget.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Advertisement 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_Advertisement extends BlocksyWidgetFactory {
11
+ protected function get_config() {
12
+ return [
13
+ 'name' => __('Advertisement', 'blc'),
14
+ 'description' => __('Advertisement', 'blc'),
15
+ ];
16
+ }
17
+
18
+ public function get_path() {
19
+ return dirname(__FILE__);
20
+ }
21
+ }
framework/extensions/widgets/widgets/ct-contact-info/options.php ADDED
@@ -0,0 +1,278 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contact Info 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' => __( 'Contact Info', 'blc' ),
19
+ 'disableRevertButton' => true,
20
+ ],
21
+
22
+ 'contact_text' => [
23
+ 'label' => __( 'Text', 'blc' ),
24
+ 'type' => 'textarea',
25
+ 'design' => 'inline',
26
+ 'disableRevertButton' => true,
27
+ ],
28
+
29
+ 'contact_information' => [
30
+ 'label' => false,
31
+ 'type' => 'ct-layers',
32
+ 'manageable' => true,
33
+ 'value' => [
34
+ [
35
+ 'id' => 'address',
36
+ 'enabled' => true,
37
+ 'title' => __('Address:', 'blc'),
38
+ 'content' => 'Street Name, NY 38954',
39
+ ],
40
+
41
+ [
42
+ 'id' => 'phone',
43
+ 'enabled' => true,
44
+ 'title' => __('Phone:', 'blc'),
45
+ 'content' => '578-393-4937',
46
+ 'link' => 'tel:578-393-4937',
47
+ ],
48
+
49
+ [
50
+ 'id' => 'mobile',
51
+ 'enabled' => true,
52
+ 'title' => __('Mobile:', 'blc'),
53
+ 'content' => '578-393-4937',
54
+ 'link' => 'tel:578-393-4937',
55
+ ],
56
+
57
+ ],
58
+
59
+ 'settings' => [
60
+ 'address' => [
61
+ 'label' => __( 'Address', 'blc' ),
62
+ 'options' => [
63
+ 'title' => [
64
+ 'type' => 'text',
65
+ 'label' => __('Title', 'blc'),
66
+ 'value' => __('Address:', 'blc'),
67
+ 'design' => 'inline',
68
+ ],
69
+
70
+ 'content' => [
71
+ 'type' => 'text',
72
+ 'label' => __('Content', 'blc'),
73
+ 'value' => 'Street Name, NY 38954',
74
+ 'design' => 'inline',
75
+ ],
76
+
77
+ 'link' => [
78
+ 'type' => 'text',
79
+ 'label' => __('Link (optional)', 'blc'),
80
+ 'design' => 'inline',
81
+ ]
82
+ ]
83
+ ],
84
+
85
+ 'phone' => [
86
+ 'label' => __( 'Phone', 'blc' ),
87
+ 'options' => [
88
+
89
+ 'title' => [
90
+ 'type' => 'text',
91
+ 'label' => __('Title', 'blc'),
92
+ 'value' => __('Phone:', 'blc'),
93
+ 'design' => 'inline',
94
+ ],
95
+
96
+ 'content' => [
97
+ 'type' => 'text',
98
+ 'label' => __('Content', 'blc'),
99
+ 'value' => '578-393-4937',
100
+ 'design' => 'inline',
101
+ ],
102
+
103
+ 'link' => [
104
+ 'type' => 'text',
105
+ 'label' => __('Link (optional)', 'blc'),
106
+ 'value' => 'tel:578-393-4937',
107
+ 'design' => 'inline',
108
+ ]
109
+
110
+ ]
111
+ ],
112
+
113
+ 'mobile' => [
114
+ 'label' => __( 'Mobile', 'blc' ),
115
+ 'options' => [
116
+ 'title' => [
117
+ 'type' => 'text',
118
+ 'label' => __('Title', 'blc'),
119
+ 'value' => __('Mobile:', 'blc'),
120
+ 'design' => 'inline',
121
+ ],
122
+
123
+ 'content' => [
124
+ 'type' => 'text',
125
+ 'label' => __('Content', 'blc'),
126
+ 'value' => '578-393-4937',
127
+ 'design' => 'inline',
128
+ ],
129
+
130
+ 'link' => [
131
+ 'type' => 'text',
132
+ 'label' => __('Link (optional)', 'blc'),
133
+ 'value' => 'tel:578-393-4937',
134
+ 'design' => 'inline',
135
+ ],
136
+
137
+ ]
138
+ ],
139
+
140
+ 'fax' => [
141
+ 'label' => __( 'Fax', 'blc' ),
142
+ 'options' => [
143
+ 'title' => [
144
+ 'type' => 'text',
145
+ 'label' => __('Title', 'blc'),
146
+ 'value' => __('Fax:', 'blc'),
147
+ 'design' => 'inline',
148
+ ],
149
+
150
+ 'content' => [
151
+ 'type' => 'text',
152
+ 'label' => __('Content', 'blc'),
153
+ 'value' => '578-393-4937',
154
+ 'design' => 'inline',
155
+ ],
156
+
157
+ 'link' => [
158
+ 'type' => 'text',
159
+ 'label' => __('Link (optional)', 'blc'),
160
+ 'value' => 'tel:578-393-4937',
161
+ 'design' => 'inline',
162
+ ],
163
+
164
+ ]
165
+ ],
166
+
167
+ 'email' => [
168
+ 'label' => __( 'Email', 'blc' ),
169
+ 'options' => [
170
+ 'title' => [
171
+ 'type' => 'text',
172
+ 'label' => __('Title', 'blc'),
173
+ 'value' => __('Email:', 'blc'),
174
+ 'design' => 'inline',
175
+ ],
176
+
177
+ 'content' => [
178
+ 'type' => 'text',
179
+ 'label' => __('Content', 'blc'),
180
+ 'value' => 'contact@yourwebsite.com',
181
+ 'design' => 'inline',
182
+ ],
183
+
184
+ 'link' => [
185
+ 'type' => 'text',
186
+ 'label' => __('Link (optional)', 'blc'),
187
+ 'value' => 'mailto:contact@yourwebsite.com',
188
+ 'design' => 'inline',
189
+ ],
190
+
191
+ ]
192
+ ],
193
+
194
+ 'website' => [
195
+ 'label' => __( 'Website', 'blc' ),
196
+ 'options' => [
197
+ 'title' => [
198
+ 'type' => 'text',
199
+ 'label' => __('Title', 'blc'),
200
+ 'value' => __('Website:', 'blc'),
201
+ 'design' => 'inline',
202
+ ],
203
+
204
+ 'content' => [
205
+ 'type' => 'text',
206
+ 'label' => __('Content', 'blc'),
207
+ 'value' => 'creativethemes.com',
208
+ 'design' => 'inline',
209
+ ],
210
+
211
+ 'link' => [
212
+ 'type' => 'text',
213
+ 'label' => __('Link (optional)', 'blc'),
214
+ 'value' => 'https://creativethemes.com',
215
+ 'design' => 'inline',
216
+ ],
217
+
218
+ ]
219
+ ],
220
+ ],
221
+ ],
222
+
223
+ 'contact_link_target' => [
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',
234
+ 'view' => 'text',
235
+ 'design' => 'block',
236
+ 'setting' => [ 'transport' => 'postMessage' ],
237
+ 'choices' => [
238
+ 'small' => __( 'Small', 'blc' ),
239
+ 'medium' => __( 'Medium', 'blc' ),
240
+ 'large' => __( 'Large', 'blc' ),
241
+ ],
242
+ ],
243
+
244
+ 'contact_icons_type' => [
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' => __( 'Simple', 'blc' ),
253
+ 'rounded' => __( 'Rounded', 'blc' ),
254
+ 'square' => __( 'Square', 'blc' ),
255
+ ],
256
+ ],
257
+
258
+ blocksy_rand_md5() => [
259
+ 'type' => 'ct-condition',
260
+ 'condition' => [ 'contact_icons_type' => '!simple' ],
261
+ 'options' => [
262
+
263
+ 'contact_icons_fill' => [
264
+ 'label' => __( 'Icons Fill Type', 'blc' ),
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
+ ];
framework/extensions/widgets/widgets/ct-contact-info/view.php ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Mailchimp 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, __( 'Contact Info', 'blc' ) );
13
+
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,
35
+ [
36
+ [
37
+ 'id' => 'address',
38
+ 'enabled' => true,
39
+ 'title' => __('Address:', 'blc'),
40
+ 'content' => 'Street Name, NY 38954',
41
+ ],
42
+
43
+ [
44
+ 'id' => 'phone',
45
+ 'enabled' => true,
46
+ 'title' => __('Phone:', 'blc'),
47
+ 'content' => '578-393-4937',
48
+ 'link' => 'tel:578-393-4937',
49
+ ],
50
+
51
+ [
52
+ 'id' => 'mobile',
53
+ 'enabled' => true,
54
+ 'title' => __('Mobile:', 'blc'),
55
+ 'content' => '578-393-4937',
56
+ 'link' => 'tel:578-393-4937',
57
+ ],
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
+
98
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
99
+ echo $before_title . wp_kses_post( $title ) . $after_title;
100
+
101
+ ?>
102
+
103
+ <?php if( !empty( $text ) ) { ?>
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
+ <?php } ?>
145
+
146
+ <?php echo wp_kses_post( $after_widget ); ?>
framework/extensions/widgets/widgets/ct-contact-info/widget.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contact Info 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_Contact_Info extends BlocksyWidgetFactory {
11
+ protected function get_config() {
12
+ return [
13
+ 'name' => __('Contact Info', 'blc'),
14
+ 'description' => __('Contact info', 'blc'),
15
+ ];
16
+ }
17
+
18
+ public function get_path() {
19
+ return dirname(__FILE__);
20
+ }
21
+ }
framework/extensions/widgets/widgets/ct-posts/options.php ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Posts 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
+ $categories = get_categories(
11
+ [
12
+ 'type' => 'post',
13
+ 'orderby' => 'name',
14
+ 'order' => 'ASC',
15
+ ]
16
+ );
17
+
18
+ $category_choices = [
19
+ 'all_categories' => __( 'All categories', 'blc' ),
20
+ ];
21
+
22
+ foreach ( $categories as $category ) {
23
+ $category_choices[ $category->term_id ] = $category->name;
24
+ }
25
+
26
+ $options = [
27
+ 'title' => [
28
+ 'type' => 'text',
29
+ 'label' => __( 'Title', 'blc' ),
30
+ 'field_attr' => [ 'id' => 'widget-title' ],
31
+ 'design' => 'inline',
32
+ 'value' => __( 'Posts', 'blc' ),
33
+ ],
34
+
35
+ 'type' => [
36
+ 'type' => 'ct-select',
37
+ 'label' => __( 'Select Type', 'blc' ),
38
+ 'value' => 'recent',
39
+ 'design' => 'inline',
40
+ 'choices' => blocksy_ordered_keys(
41
+ [
42
+ 'recent' => __( 'Recent Posts', 'blc' ),
43
+ 'popular' => __( 'Popular Posts', 'blc' ),
44
+ 'commented' => __( 'Most Commented Posts', 'blc' ),
45
+ ]
46
+ ),
47
+ ],
48
+
49
+ 'days' => [
50
+ 'type' => 'ct-select',
51
+ 'label' => __( 'Days', 'blc' ),
52
+ 'value' => 'all_time',
53
+ 'design' => 'inline',
54
+ 'choices' => blocksy_ordered_keys(
55
+ [
56
+ 'all_time' => __( 'All Time', 'blc' ),
57
+ '7' => __( '1 Week', 'blc' ),
58
+ '30' => __( '1 Month', 'blc' ),
59
+ '90' => __( '3 Months', 'blc' ),
60
+ '180' => __( '6 Months', 'blc' ),
61
+ '360' => __( '1 Year', 'blc' ),
62
+ ]
63
+ ),
64
+ ],
65
+
66
+ 'category' => [
67
+ 'type' => 'ct-select',
68
+ 'label' => __( 'Category', 'blc' ),
69
+ 'value' => 'all_categories',
70
+ 'choices' => blocksy_ordered_keys( $category_choices ),
71
+ 'design' => 'inline',
72
+ ],
73
+
74
+ 'posts_number' => [
75
+ 'type' => 'ct-number',
76
+ 'label' => __( 'Number of Posts', 'blc' ),
77
+ 'min' => 1,
78
+ 'max' => 30,
79
+ 'value' => 5,
80
+ 'design' => 'inline',
81
+ ],
82
+
83
+ 'display_date' => [
84
+ 'type' => 'ct-switch',
85
+ 'label' => __( 'Show Date', 'blc' ),
86
+ 'value' => 'no',
87
+ ],
88
+
89
+ 'display_photo' => [
90
+ 'type' => 'ct-switch',
91
+ 'label' => __( 'Show Thumbnail', 'blc' ),
92
+ 'value' => 'no',
93
+ ],
94
+
95
+ 'display_comments' => [
96
+ 'type' => 'ct-switch',
97
+ 'label' => __( 'Show Comments', 'blc' ),
98
+ 'value' => 'no',
99
+ ],
100
+ ];
101
+
framework/extensions/widgets/widgets/ct-posts/view.php ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Posts 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
+ $items = intval( blocksy_default_akg( 'posts_number', $atts, 5 ) );
11
+
12
+ $date_query = [];
13
+
14
+ $days = blocksy_default_akg( 'days', $atts, 'all_time' );
15
+
16
+ if ( $days && 'all_time' !== $days ) {
17
+ $time = time() - ( intval( $days ) * 24 * 60 * 60 );
18
+
19
+ $date_query = array(
20
+ 'after' => date( 'F jS, Y', $time ),
21
+ 'before' => date( 'F jS, Y' ),
22
+ 'inclusive' => true,
23
+ );
24
+ }
25
+
26
+ $fw_cat_id = blocksy_default_akg( 'category', $atts, 'all_categories' );
27
+ $fw_cat_id = ( empty( $category ) || 'all_categories' === $category ) ? '' : $category;
28
+
29
+ $type = blocksy_default_akg( 'type', $atts, 'recent' );
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 = blocksy_default_akg( 'display_photo', $atts, 'no' ) === 'yes';
44
+ $data_thumbnail = '';
45
+
46
+ if ( $has_thumbnail ) {
47
+ $data_thumbnail = ' data-thumbnail="true"';
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
+
56
+ // Widget title
57
+ $title = blocksy_default_akg( 'title', $atts, __( 'Posts', 'blc' ) );
58
+
59
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
60
+ echo $before_widget;
61
+
62
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
63
+ echo $before_title . wp_kses_post( $title ) . $after_title;
64
+
65
+ ?>
66
+
67
+ <?php if ( $query->have_posts() ) { ?>
68
+ <ul <?php echo wp_kses( $data_thumbnail, [] ); ?>>
69
+ <?php while ( $query->have_posts() ) { ?>
70
+ <?php $query->the_post(); ?>
71
+
72
+ <li>
73
+ <?php
74
+ if ( $has_thumbnail ) {
75
+ echo wp_kses_post(
76
+ blocksy_image(
77
+ [
78
+ 'attachment_id' => get_post_thumbnail_id(),
79
+ 'ratio' => '1/1',
80
+ 'tag_name' => 'a',
81
+ 'html_atts' => [
82
+ 'href' => get_permalink(),
83
+ ],
84
+ ]
85
+ )
86
+ );
87
+ }
88
+ ?>
89
+
90
+ <div class="ct-entry-content">
91
+ <a href="<?php echo esc_url( get_permalink() ); ?>" class="ct-post-title">
92
+ <?php echo wp_kses_post(get_the_title()); ?>
93
+ </a>
94
+
95
+ <?php if ( $has_meta || $has_comments ) { ?>
96
+ <div class="ct-entry-meta">
97
+ <?php if ( $has_meta ) { ?>
98
+ <span>
99
+ <?php echo esc_attr( get_the_time( 'M j, Y' ) ); ?>
100
+ </span>
101
+ <?php } ?>
102
+
103
+ <?php if ( $has_comments && get_comments_number() > 0 ) { ?>
104
+ <span>
105
+ <?php echo wp_kses_post( get_comments_number_text( '', '1 Comment', '% Comments' ) ); ?>
106
+ </span>
107
+ <?php } ?>
108
+ </div>
109
+ <?php } ?>
110
+ </div>
111
+ </li>
112
+ <?php } ?>
113
+ </ul>
114
+ <?php } ?>
115
+
116
+ <?php wp_reset_postdata(); ?>
117
+
118
+ <?php
119
+ echo wp_kses_post( $after_widget );
120
+ ?>
framework/extensions/widgets/widgets/ct-posts/widget.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Posts list 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_Posts extends BlocksyWidgetFactory {
11
+ protected function get_config() {
12
+ return [
13
+ 'name' => __('Posts', 'blc'),
14
+ 'description' => __('Description', 'blc'),
15
+ ];
16
+ }
17
+
18
+ public function get_path() {
19
+ return dirname(__FILE__);
20
+ }
21
+ }
22
+
framework/extensions/widgets/widgets/ct-socials/options.php ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Options for socials 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
+ // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
11
+ $options = [
12
+
13
+ 'title' => [
14
+ 'type' => 'text',
15
+ 'label' => __( 'Title', 'blc' ),
16
+ 'field_attr' => [ 'id' => 'widget-title' ],
17
+ 'design' => 'inline',
18
+ 'value' => __( 'Social Icons', 'blc' ),
19
+ 'disableRevertButton' => true,
20
+ ],
21
+
22
+ 'socials' => [
23
+ 'type' => 'ct-layers',
24
+ 'label' => false,
25
+ 'manageable' => true,
26
+ 'desc' => sprintf(
27
+ __( 'You can configure social URLs in %s.', 'blc' ),
28
+ sprintf(
29
+ '<a href="%s" target="_blank">%s</a>',
30
+ admin_url('/customize.php?autofocus[section]=social_accounts'),
31
+ __('Customizer', 'blc')
32
+ )
33
+ ),
34
+ 'value' => [
35
+ [
36
+ 'id' => 'facebook',
37
+ 'enabled' => true,
38
+ ],
39
+
40
+ [
41
+ 'id' => 'twitter',
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
+ 'facebook' => [
58
+ 'label' => __( 'Facebook', 'blc' ),
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' => [
108
+ 'label' => __( 'Icons Size', 'blc' ),
109
+ 'type' => 'ct-radio',
110
+ 'value' => 'medium',
111
+ 'view' => 'text',
112
+ 'design' => 'block',
113
+ 'setting' => [ 'transport' => 'postMessage' ],
114
+ 'choices' => [
115
+ 'small' => __( 'Small', 'blc' ),
116
+ 'medium' => __( 'Medium', 'blc' ),
117
+ 'large' => __( 'Large', 'blc' ),
118
+ ],
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' => __( 'Simple', 'blc' ),
130
+ 'rounded' => __( 'Rounded', 'blc' ),
131
+ 'square' => __( 'Square', 'blc' ),
132
+ ],
133
+ ],
134
+
135
+ blocksy_rand_md5() => [
136
+ 'type' => 'ct-condition',
137
+ 'condition' => [ 'social_type' => '!simple' ],
138
+ 'options' => [
139
+
140
+ 'social_icons_fill' => [
141
+ 'label' => __( 'Icons Fill Type', 'blc' ),
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
+
153
+ ],
154
+ ],
155
+
156
+ ];
framework/extensions/widgets/widgets/ct-socials/view.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Socials 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
+ // Widget title.
11
+ $title = blocksy_default_akg( 'title', $atts, __('Social Icons', 'blc') );
12
+
13
+ echo wp_kses_post($before_widget . $before_title . $title . $after_title);
14
+
15
+ $size = blocksy_default_akg('social_icons_size', $atts, 'medium');
16
+ $type = blocksy_default_akg('social_type', $atts, 'simple');
17
+ $fill = blocksy_default_akg('social_icons_fill', $atts, 'outline');
18
+
19
+ /**
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 blocksy_social_icons(
24
+ blocksy_default_akg(
25
+ 'socials',
26
+ $atts,
27
+ [
28
+ [
29
+ 'id' => 'facebook',
30
+ 'enabled' => true,
31
+ ],
32
+
33
+ [
34
+ 'id' => 'twitter',
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
+ $size . '-' . $type . (
50
+ $type === 'simple' ? '' : '-' . $fill
51
+ )
52
+ );
53
+
54
+ echo wp_kses_post($after_widget);
55
+
framework/extensions/widgets/widgets/ct-socials/widget.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Socials Widget
5
+ *
6
+ * @copyright 2019-present Creative Themes
7
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
8
+ * @package Blocksy
9
+ */
10
+
11
+ class Blocksy_Widget_Ct_Socials extends BlocksyWidgetFactory {
12
+ protected function get_config() {
13
+ return [
14
+ 'name' => __('Social Icons', 'blc'),
15
+ 'description' => __('Social channels icons', 'blc'),
16
+ ];
17
+ }
18
+
19
+ public function get_path() {
20
+ return dirname(__FILE__);
21
+ }
22
+ }
framework/features/google-analytics.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class GoogleAnalytics {
6
+ public function __construct() {
7
+
8
+ add_filter(
9
+ 'blocksy_misc_end_section_customizer_options',
10
+ [$this, 'generate_google_analytics_opts']
11
+ );
12
+
13
+ add_action('print_footer_scripts', function () {
14
+ if (is_admin()) return;
15
+
16
+ if (class_exists('BlocksyExtensionCookiesConsent')) {
17
+ if (\BlocksyExtensionCookiesConsent::should_display_notification()) {
18
+ return;
19
+ }
20
+ }
21
+
22
+ $analytics_id = get_theme_mod('analytics_id', '');
23
+
24
+ if (empty($analytics_id)) return;
25
+
26
+ ?>
27
+
28
+ <!-- Google Analytics -->
29
+ <script>
30
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
31
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
32
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
33
+ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
34
+ ga('create', '<?php echo $analytics_id ?>', 'auto');
35
+ ga('send', 'pageview');
36
+ <?php if (get_theme_mod('ip_anonymization', 'no') === 'yes') { ?>
37
+ ga('set', 'anonymizeIp', true);
38
+ <?php } ?>
39
+ </script>
40
+ <!-- End Google Analytics -->
41
+
42
+ <?php
43
+ });
44
+ }
45
+
46
+ public function generate_google_analytics_opts($options) {
47
+ $options['google_analytics'] = [
48
+ 'title' => __('Google Analytics', 'blocksy'),
49
+ 'container' => [ 'priority' => 7 ],
50
+ 'options' => [
51
+
52
+ 'integrations_section_options' => [
53
+ 'type' => 'ct-options',
54
+ 'setting' => [ 'transport' => 'postMessage' ],
55
+ 'inner-options' => [
56
+ blocksy_rand_md5() => [
57
+ 'label' => __( 'Google Analytics', 'blc' ),
58
+ 'type' => 'ct-title',
59
+ ],
60
+
61
+ 'analytics_id' => [
62
+ 'label' => __( 'Tracking ID', 'blc' ),
63
+ 'type' => 'text',
64
+ 'design' => 'inline',
65
+ 'value' => '',
66
+ 'setting' => [ 'transport' => 'postMessage' ],
67
+ ],
68
+
69
+ 'ip_anonymization' => [
70
+ 'label' => __( 'IP Anonymization', 'blc' ),
71
+ 'type' => 'ct-switch',
72
+ 'value' => 'no',
73
+ 'desc' => __( 'Enable Google Analytics IP anonymization feature <a href="https://developers.google.com/analytics/devguides/collection/gtagjs/ip-anonymization">(more info)</a>.', 'blc' ),
74
+ 'setting' => [ 'transport' => 'postMessage' ],
75
+ ],
76
+ ],
77
+ ],
78
+
79
+ ]
80
+ ];
81
+
82
+ return $options;
83
+ }
84
+ }
framework/theme-integration.php CHANGED
@@ -21,5 +21,28 @@ class ThemeIntegration {
21
  },
22
  10, 2
23
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  }
25
  }
21
  },
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
+ 'elementor/element/section/section_layout/before_section_end',
32
+ function ($element, $args) {
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
+ 10, 2
46
+ );
47
  }
48
  }
framework/widgets-manager.php ADDED
@@ -0,0 +1,192 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class BlocksyWidgetFactory extends WP_Widget {
4
+ /**
5
+ * Options for the widget.
6
+ *
7
+ * @var array $options options.
8
+ */
9
+ public $options;
10
+
11
+ /**
12
+ * Widget prefix for the path.
13
+ *
14
+ * @var string $prefix
15
+ */
16
+ public $prefix = 'ct_default_widget';
17
+
18
+ public function get_path() {
19
+ throw new Error('Implement get_path()');
20
+ }
21
+
22
+ /**
23
+ * Loop through all the folders and treat each folder as a separated widget.
24
+ * Based on the folder name, instantiate a specific class, treat this
25
+ * as convention over configuration.
26
+ */
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
+ register_widget( 'Blocksy_Widget_' . blocksy_dirname_to_classname( $prefix ) );
35
+ }
36
+ }
37
+
38
+ /**
39
+ * Extract widget path based on the class name.
40
+ */
41
+ /*
42
+ public function get_path() {
43
+ $widget_path = strtolower( get_class( $this ) );
44
+ $widget_path = str_replace( '_', '-', str_replace( 'blocksy_widget_', '', $widget_path ) );
45
+
46
+ return get_template_directory() . '/inc/widgets-manager/widgets/' . $widget_path;
47
+ }
48
+ */
49
+
50
+ /**
51
+ * Construct the widget
52
+ */
53
+ public function __construct() {
54
+ $prefix = basename( $this->get_path() );
55
+
56
+ $config = [
57
+ 'name' => $this->blocksy_id_to_title( $prefix ),
58
+ 'description' => __( 'Default widget description', 'blocksy' ),
59
+ ];
60
+
61
+ $options = null;
62
+
63
+ if ($this->get_config()) {
64
+ $config = array_merge( $config, $this->get_config() );
65
+ }
66
+
67
+ $this->prefix = $prefix;
68
+
69
+ parent::__construct(
70
+ false,
71
+ blocksy_akg(
72
+ 'name',
73
+ $config,
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
+
93
+ public function widget( $args, $instance ) {
94
+ $file_path = $this->get_path() . '/view.php';
95
+
96
+ if ( ! file_exists( $file_path ) ) {
97
+ echo '<p>Default widget view. Please create a <i>view.php</i> file.</p>';
98
+ return;
99
+ }
100
+
101
+ $instance = blocksy_akg( blocksy_post_name(), $instance, [] );
102
+
103
+ if ( ! $instance ) {
104
+ $instance = [];
105
+ }
106
+
107
+ // @codingStandardsIgnoreLine
108
+ echo blocksy_render_view(
109
+ $file_path,
110
+ array_merge(
111
+ [ 'atts' => $instance ],
112
+ $args
113
+ )
114
+ );
115
+ }
116
+
117
+ public function read_options() {
118
+ $options = null;
119
+
120
+ if ( file_exists( $this->get_path() . '/options.php' ) ) {
121
+ $options = blocksy_akg(
122
+ 'options',
123
+ blocksy_get_variables_from_file(
124
+ $this->get_path() . '/options.php',
125
+ [ 'options' => [] ]
126
+ )
127
+ );
128
+ }
129
+
130
+ if ( $options ) {
131
+ $this->options = $options;
132
+ } else {
133
+ $this->options = [
134
+ 'title' => [
135
+ 'type' => 'text',
136
+ 'label' => __( 'Widget Title', 'blocksy' ),
137
+ 'field_attr' => [ 'id' => 'widget-title' ],
138
+ ],
139
+ ];
140
+ }
141
+ }
142
+
143
+ /**
144
+ * Save widget values, if available.
145
+ *
146
+ * @param array $new_instance new widget values.
147
+ * @param array $old_instance old widget values.
148
+ */
149
+ public function update( $new_instance, $old_instance ) {
150
+ $new_instance[ $this->prefix ][ blocksy_post_name() ] = json_decode(
151
+ $new_instance[ $this->prefix ][ blocksy_post_name() ],
152
+ true
153
+ );
154
+
155
+ return $new_instance[ $this->prefix ];
156
+ }
157
+
158
+ public function form( $values ) {
159
+ $this->read_options();
160
+
161
+ echo blocksy_output_options_panel(
162
+ [
163
+ 'options' => $this->options,
164
+ 'values' => blocksy_akg( blocksy_post_name(), $values ),
165
+ 'id_prefix' => 'ct-widget-options-' . $this->get_field_id(
166
+ $this->prefix
167
+ ),
168
+ 'name_prefix' => $this->get_field_name( $this->prefix ),
169
+ 'attr' => [
170
+ 'data-disable-reverse-button' => ''
171
+ ]
172
+ ]
173
+ );
174
+
175
+ return $values;
176
+ }
177
+
178
+ private function blocksy_id_to_title( $id ) {
179
+ if ( function_exists( 'mb_strtoupper' ) && function_exists( 'mb_substr' ) && function_exists( 'mb_strlen' ) ) {
180
+ $id = mb_strtoupper( mb_substr( $id, 0, 1, 'UTF-8' ), 'UTF-8' ) . mb_substr(
181
+ $id,
182
+ 1,
183
+ mb_strlen( $id, 'UTF-8' ),
184
+ 'UTF-8'
185
+ );
186
+ } else {
187
+ $id = strtoupper( substr( $id, 0, 1 ) ) . substr( $id, 1, strlen( $id ) );
188
+ }
189
+
190
+ return str_replace( array( '_', '-' ), ' ', $id );
191
+ }
192
+ }
plugin.php CHANGED
@@ -21,9 +21,11 @@ class Plugin {
21
  public $extensions_api = null;
22
 
23
  public $dashboard = null;
24
-
25
  public $theme_integration = null;
26
 
 
 
 
27
  /**
28
  * Instance.
29
  *
@@ -46,6 +48,11 @@ class Plugin {
46
  return;
47
  }
48
 
 
 
 
 
 
49
  $this->extensions_api = new ExtensionsManagerApi();
50
  $this->theme_integration = new ThemeIntegration();
51
  }
@@ -61,7 +68,10 @@ class Plugin {
61
  }
62
 
63
  $this->extensions = new ExtensionsManager();
 
64
  $this->dashboard = new Dashboard();
 
 
65
  }
66
 
67
  /**
@@ -92,7 +102,7 @@ class Plugin {
92
  }
93
 
94
  private function check_if_blocksy_is_activated() {
95
- return wp_get_theme()->get('Name') === 'Blocksy';
96
  }
97
  }
98
 
21
  public $extensions_api = null;
22
 
23
  public $dashboard = null;
 
24
  public $theme_integration = null;
25
 
26
+ // Features
27
+ public $feat_google_analytics = null;
28
+
29
  /**
30
  * Instance.
31
  *
48
  return;
49
  }
50
 
51
+ add_action('widgets_init', [
52
+ 'BlocksyWidgetFactory',
53
+ 'register_all_widgets',
54
+ ]);
55
+
56
  $this->extensions_api = new ExtensionsManagerApi();
57
  $this->theme_integration = new ThemeIntegration();
58
  }
68
  }
69
 
70
  $this->extensions = new ExtensionsManager();
71
+
72
  $this->dashboard = new Dashboard();
73
+
74
+ $this->feat_google_analytics = new GoogleAnalytics();
75
  }
76
 
77
  /**
102
  }
103
 
104
  private function check_if_blocksy_is_activated() {
105
+ return strpos(wp_get_theme()->get('Name'), 'Blocksy') !== false;
106
  }
107
  }
108
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: creativethemeshq
3
  Tags: widget, widgets
4
  Requires at least: 5.0
5
  Requires PHP: 7.0
6
- Tested up to: 5.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -29,3 +29,17 @@ This plugin runs and adds its enhacements only if the Blocksy theme is installed
29
  = 1.0.1 =
30
  * Remove `gz` files from build
31
  * Instagram widget text & defaults changes
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  Tags: widget, widgets
4
  Requires at least: 5.0
5
  Requires PHP: 7.0
6
+ Tested up to: 5.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
29
  = 1.0.1 =
30
  * Remove `gz` files from build
31
  * Instagram widget text & defaults changes
32
+
33
+ = 1.0.2 =
34
+ * Google Analytics script
35
+ * Instagram extension with block and widget
36
+ * Allow SVG uploads
37
+ * Read Progress extension
38
+ * Mailchimp subscribe extension
39
+ * Cookies consent extension
40
+ * Elementor Columns Fix switch
41
+
42
+ = 1.0.3 =
43
+ * Tested with WordPress 5.2
44
+ * Checkbox for consent
45
+ * Support Blocksy child themes variations
static/bundle/dashboard.css CHANGED
@@ -1,8 +1,8 @@
1
  /**
2
- * - v1.0.1
3
  *
4
  * Copyright (c) 2019
5
  * Licensed GPLv2+
6
  */
7
 
8
- .ct-extensions-list ul{display:grid;grid-template-columns:repeat(2, 1fr);grid-column-gap:35px;grid-row-gap:35px;margin:0}.ct-extensions-list ul li{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;margin:0;border-radius:3px;border:1px solid rgba(226,230,235,0.7);-webkit-box-shadow:0 2px 5px rgba(143,163,184,0.12);box-shadow:0 2px 5px rgba(143,163,184,0.12)}.ct-extension-title{margin:35px 0 15px 0;padding:0 25px}.ct-extension-description{margin-bottom:35px;padding:0 25px}.ct-extension-actions{margin-top:auto;padding:20px 25px;border-top:1px solid rgba(226,230,235,0.7)}
1
  /**
2
+ * - v1.0.3
3
  *
4
  * Copyright (c) 2019
5
  * Licensed GPLv2+
6
  */
7
 
8
+ .ct-extension-readme{text-align:left;padding:30px}.ct-extension-readme ul,.ct-extension-readme ol{margin:0;padding-left:20px}.ct-extension-readme ul li,.ct-extension-readme ol li{margin-bottom:20px}.ct-extension-readme ul li:last-child,.ct-extension-readme ol li:last-child{margin-bottom:0}.ct-extension-readme ul li b,.ct-extension-readme ol li b{display:inline-block;margin-bottom:10px}.ct-extension-readme ul li i,.ct-extension-readme ol li i{display:block;color:#717a84}.ct-extension-readme ul{list-style:initial}.ct-extension-readme code{font-size:12px;font-style:normal;padding:3px 7px;border-radius:2px;background:#f1f3f5}.ct-extension-config{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding:30px}.ct-config-btn{font-size:16px;margin-left:auto}.mailchimp-credentials{display:-webkit-box;display:-ms-flexbox;display:flex;margin:10px 0 0 0}.mailchimp-credentials li{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;margin-bottom:0}.mailchimp-credentials li:not(:first-child){margin-left:10px}.mailchimp-credentials label{display:block;font-size:12px;margin-bottom:3px;opacity:0.7}.mailchimp-credentials input{height:35px;border-radius:2px;margin:0;padding:3px 5px 3px 10px}.mailchimp-credentials .ct-select-input:after{top:16px}.ct-extensions-list .ct-info{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.ct-extensions-list .ct-info i{-webkit-box-flex:0;-ms-flex:0 0 90px;flex:0 0 90px;width:90px;height:90px;margin-right:20px;background-image:url(../img/extensions.svg);background-repeat:no-repeat}.ct-extensions-list .ct-info p{max-width:600px}.ct-extensions-list ul{display:grid;grid-template-columns:repeat(3, 1fr);grid-column-gap:30px;grid-row-gap:30px;margin:50px 0 0 0}.ct-extensions-list ul li{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;margin:0;border-radius:3px;border:1px solid rgba(226,230,235,0.7);-webkit-box-shadow:0 2px 5px rgba(143,163,184,0.12);box-shadow:0 2px 5px rgba(143,163,184,0.12)}.ct-extension-title{margin:30px 0 15px 0;padding:0 25px}.ct-extension-description{font-size:14px;line-height:1.7;margin-bottom:30px;padding:0 25px}.ct-extension-actions{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin-top:auto;padding:20px 13px 20px 25px;border-top:1px solid rgba(226,230,235,0.7)}.ct-minimal-button{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:35px;height:35px;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;padding:0;color:inherit;cursor:pointer}.ct-minimal-button:hover{color:#0085ba}.ct-minimal-button:focus{outline:none}.ct-minimal-button svg{fill:currentColor}
static/bundle/dashboard.js CHANGED
@@ -1,4 +1,4 @@
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=3)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t,n){var r;
2
  /*!
3
  Copyright (c) 2017 Jed Watson.
4
  Licensed under the MIT License (MIT), see
@@ -9,4 +9,4 @@
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 a=typeof r;if("string"===a||"number"===a)e.push(r);else if(Array.isArray(r)&&r.length){var c=o.apply(null,r);c&&e.push(c)}else if("object"===a)for(var i in r)n.call(r,i)&&r[i]&&e.push(i)}}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";n.r(t);var r=n(0),o=n(1),a=(n(2),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,a=void 0;try{for(var c,i=e[Symbol.iterator]();!(r=(c=i.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&i.return&&i.return()}finally{if(o)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}());function c(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){return function r(o,a){try{var c=t[o](a),i=c.value}catch(e){return void n(e)}if(!c.done)return Promise.resolve(i).then(function(e){r("next",e)},function(e){r("throw",e)});e(i)}("next")})}}var i=null,u=function(e){var t,n=e.extension,i=e.onExtsSync,u=Object(r.useState)(!1),s=a(u,2),l=s[0],f=s[1],p=(t=c(regeneratorRuntime.mark(function e(t,n){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return(r=new FormData).append("ext",t),r.append("action",n),f(!0),e.prev=4,e.next=7,fetch(ctDashboardLocalizations.ajax_url,{method:"POST",body:r});case 7:i(),e.next=12;break;case 10:e.prev=10,e.t0=e.catch(4);case 12:return e.next=14,new Promise(function(e){return setTimeout(function(){return e()},1e3)});case 14:f(!1);case 15:case"end":return e.stop()}},e,void 0,[[4,10]])})),function(e,n){return t.apply(this,arguments)});return Object(r.createElement)("li",null,Object(r.createElement)("h4",{className:"ct-extension-title"},n.config.name),n.config.description&&Object(r.createElement)("div",{className:"ct-extension-description"},n.config.description),Object(r.createElement)("div",{className:"ct-extension-actions"},Object(r.createElement)("button",{className:"ct-button","data-button":"white",disabled:l,onClick:function(){return p(n.name,n.__object?"blocksy_extension_deactivate":"blocksy_extension_activate")}},l?Object(o.__)("Loading"):n.__object?Object(o.__)("Deactivate"):Object(o.__)("Activate"))))},s=function(){var e,t=Object(r.useState)(!i),n=a(t,2),s=n[0],l=n[1],f=Object(r.useState)(i||[]),p=a(f,2),b=p[0],d=p[1],v=(e=c(regeneratorRuntime.mark(function e(){var t,n,r,o,a,c=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return c&&l(!0),(t=new FormData).append("action","blocksy_extensions_status"),e.prev=3,e.next=6,fetch(ctDashboardLocalizations.ajax_url,{method:"POST",body:t});case 6:if(200!==(n=e.sent).status){e.next=14;break}return e.next=10,n.json();case 10:r=e.sent,o=r.success,a=r.data,o&&(d(a),i=a);case 14:e.next=18;break;case 16:e.prev=16,e.t0=e.catch(3);case 18:l(!1);case 19:case"end":return e.stop()}},e,void 0,[[3,16]])})),function(){return e.apply(this,arguments)});Object(r.useEffect)(function(){v(!i)},[]);var m=Object.values(b).map(function(e,t){return e.name=Object.keys(b)[t],e});return Object(r.createElement)("div",{className:"ct-extensions-list"},s&&Object(r.createElement)("p",{className:"ct-loading-text"},Object(o.__)("Loading Extensions Status...")),!s&&m.length>0&&Object(r.createElement)("ul",null,m.map(function(e){return Object(r.createElement)(u,{key:e.name,extension:e,onExtsSync:function(){return v()}})})))};ctEvents.on("ct:dashboard:routes",function(e){return e.push({Component:function(){return Object(r.createElement)(s,null)},path:"/extensions"})}),ctEvents.on("ct:dashboard:navigation-links",function(e){return e.push({text:Object(o.__)("Extensions"),path:"/extensions"})})}]);
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=26)}([function(t,e){t.exports=window.BlocksyReact},function(t,e){t.exports=window.wp.element},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e){t.exports=window.wp.i18n},function(t,e){t.exports=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}},function(t,e,n){t.exports=n(18)()},function(t,e){t.exports=window.BlocksyReactDOM},function(t,e){function n(){return t.exports=n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},n.apply(this,arguments)}t.exports=n},function(t,e,n){t.exports=n(16)()},function(t,e,n){var r;
2
  /*!
3
  Copyright (c) 2017 Jed Watson.
4
  Licensed under the MIT License (MIT), see
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 t=[],e=0;e<arguments.length;e++){var r=arguments[e];if(r){var i=typeof r;if("string"===i||"number"===i)t.push(r);else if(Array.isArray(r)&&r.length){var a=o.apply(null,r);a&&t.push(a)}else if("object"===i)for(var s in r)n.call(r,s)&&r[s]&&t.push(s)}}return t.join(" ")}t.exports?(o.default=o,t.exports=o):void 0===(r=function(){return o}.apply(e,[]))||(t.exports=r)}()},function(t,e){t.exports=function(t,e,n,r){var o=n?n.call(r,t,e):void 0;if(void 0!==o)return!!o;if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof e||!e)return!1;var i=Object.keys(t),a=Object.keys(e);if(i.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(e),c=0;c<i.length;c++){var u=i[c];if(!s(u))return!1;var l=t[u],d=e[u];if(!1===(o=n?n.call(r,l,d,u):void 0)||void 0===o&&l!==d)return!1}return!0}},function(t,e,n){"use strict";function r(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(e,"__esModule",{value:!0});var o=r(n(24)),i=r(n(25)),a=r(n(0)),s=r(n(7));let c=void 0,u=void 0,l=[],d=t=>"undefined"!=typeof window&&window.requestAnimationFrame(t),p=t=>"undefined"!=typeof window&&window.cancelAnimationFrame(t),f=void 0,h=()=>Date.now(),m=void 0,v=void 0;const y=(t,e)=>u={fn:t,transform:e},g=t=>l=t,b=t=>c=t,w=t=>f=t,x=t=>m=t,E=t=>v=t;var A=Object.freeze({get bugfixes(){return c},get applyAnimatedValues(){return u},get colorNames(){return l},get requestFrame(){return d},get cancelFrame(){return p},get interpolation(){return f},get now(){return h},get defaultElement(){return m},get createAnimatedStyle(){return v},injectApplyAnimatedValues:y,injectColorNames:g,injectBugfixes:b,injectInterpolation:w,injectFrame:(t,e)=>{var n=[t,e];return d=n[0],p=n[1],n},injectNow:t=>h=t,injectDefaultElement:x,injectCreateAnimatedStyle:E});class O{attach(){}detach(){}getValue(){}getAnimatedValue(){return this.getValue()}addChild(t){}removeChild(t){}getChildren(){return[]}}const S=t=>Object.keys(t).map(e=>t[e]);class j extends O{constructor(){var t;super(...arguments),t=this,this.children=[],this.getChildren=(()=>this.children),this.getPayload=function(e){return void 0===e&&(e=void 0),void 0!==e&&t.payload?t.payload[e]:t.payload||t}}addChild(t){0===this.children.length&&this.attach(),this.children.push(t)}removeChild(t){const e=this.children.indexOf(t);this.children.splice(e,1),0===this.children.length&&this.detach()}}class k extends j{constructor(){super(...arguments),this.payload=[],this.getAnimatedValue=(()=>this.getValue()),this.attach=(()=>this.payload.forEach(t=>t instanceof O&&t.addChild(this))),this.detach=(()=>this.payload.forEach(t=>t instanceof O&&t.removeChild(this)))}}class C extends j{constructor(){super(...arguments),this.payload={},this.getAnimatedValue=(()=>this.getValue(!0)),this.attach=(()=>S(this.payload).forEach(t=>t instanceof O&&t.addChild(this))),this.detach=(()=>S(this.payload).forEach(t=>t instanceof O&&t.removeChild(this)))}getValue(t){void 0===t&&(t=!1);const e={};for(const n in this.payload){const r=this.payload[n];(!t||r instanceof O)&&(e[n]=r instanceof O?r[t?"getAnimatedValue":"getValue"]():r)}return e}}class P extends C{constructor(t){super(),!(t=t||{}).transform||t.transform instanceof O||(t=u.transform(t)),this.payload=t}}const T={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 U{static create(t,e,n){if("function"==typeof t)return t;if(f&&t.output&&"string"==typeof t.output[0])return f(t);if(Array.isArray(t))return U.create({range:t,output:e,extrapolate:n||"extend"});let r=t.output,o=t.range||[0,1],i=t.easing||(t=>t),a="extend",s=t.map;void 0!==t.extrapolateLeft?a=t.extrapolateLeft:void 0!==t.extrapolate&&(a=t.extrapolate);let c="extend";return void 0!==t.extrapolateRight?c=t.extrapolateRight:void 0!==t.extrapolate&&(c=t.extrapolate),t=>{let e=function(t,e){for(var n=1;n<e.length-1&&!(e[n]>=t);++n);return n-1}(t,o);return function(t,e,n,r,o,i,a,s,c){let u=c?c(t):t;if(u<e){if("identity"===a)return u;"clamp"===a&&(u=e)}if(u>n){if("identity"===s)return u;"clamp"===s&&(u=n)}if(r===o)return r;if(e===n)return t<=e?r:o;e===-1/0?u=-u:n===1/0?u-=e:u=(u-e)/(n-e);u=i(u),r===-1/0?u=-u:o===1/0?u+=r:u=u*(o-r)+r;return u}(t,o[e],o[e+1],r[e],r[e+1],i,a,c,s)}}}const R="[-+]?\\d*\\.?\\d+",_=R+"%";function F(){return"\\(\\s*("+Array.prototype.slice.call(arguments).join(")\\s*,\\s*(")+")\\s*\\)"}const I=new RegExp("rgb"+F(R,R,R)),D=new RegExp("rgba"+F(R,R,R,R)),M=new RegExp("hsl"+F(R,_,_)),V=new RegExp("hsla"+F(R,_,_,R)),L=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,N=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,B=/^#([0-9a-fA-F]{6})$/,W=/^#([0-9a-fA-F]{8})$/;function q(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function z(t,e,n){const r=n<.5?n*(1+e):n+e-n*e,o=2*n-r,i=q(o,r,t+1/3),a=q(o,r,t),s=q(o,r,t-1/3);return Math.round(255*i)<<24|Math.round(255*a)<<16|Math.round(255*s)<<8}function G(t){const e=parseInt(t,10);return e<0?0:e>255?255:e}function K(t){return(parseFloat(t)%360+360)%360/360}function $(t){const e=parseFloat(t);return e<0?0:e>1?255:Math.round(255*e)}function H(t){const e=parseFloat(t);return e<0?0:e>100?1:e/100}function Y(t){let e=function(t){let e;return"number"==typeof t?t>>>0===t&&t>=0&&t<=4294967295?t:null:(e=B.exec(t))?parseInt(e[1]+"ff",16)>>>0:T.hasOwnProperty(t)?T[t]:(e=I.exec(t))?(G(e[1])<<24|G(e[2])<<16|G(e[3])<<8|255)>>>0:(e=D.exec(t))?(G(e[1])<<24|G(e[2])<<16|G(e[3])<<8|$(e[4]))>>>0:(e=L.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=W.exec(t))?parseInt(e[1],16)>>>0:(e=N.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=M.exec(t))?(255|z(K(e[1]),H(e[2]),H(e[3])))>>>0:(e=V.exec(t))?(z(K(e[1]),H(e[2]),H(e[3]))|$(e[4]))>>>0:null}(t);return null===e?t:`rgba(${(4278190080&(e=e||0))>>>24}, ${(16711680&e)>>>16}, ${(65280&e)>>>8}, ${(255&e)/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,Z=new RegExp(`(${Object.keys(T).join("|")})`,"g");class X extends k{constructor(t,e,n){super(),this.getValue=(()=>this.calc(...this.payload.map(t=>t.getValue()))),this.updateConfig=((t,e)=>this.calc=U.create(t,e)),this.interpolate=((t,e)=>new X(this,t,e)),this.payload=t instanceof k&&!t.updateConfig?t.payload:Array.isArray(t)?t:[t],this.calc=U.create(e,n)}}class tt extends j{constructor(t){var e;super(),e=this,this.setValue=function(t,n){void 0===n&&(n=!0),e.value=t,n&&e.flush()},this.getValue=(()=>this.value),this.updateStyles=(()=>(function t(e,n){"function"==typeof e.update?n.add(e):e.getChildren().forEach(e=>t(e,n))})(this,this.animatedStyles)),this.updateValue=(t=>this.flush(this.value=t)),this.interpolate=((t,e)=>new X(this,t,e)),this.value=t,this.animatedStyles=new Set,this.done=!1,this.startPosition=t,this.lastPosition=t,this.lastVelocity=void 0,this.lastTime=void 0,this.controller=void 0}flush(){0===this.animatedStyles.size&&this.updateStyles(),this.animatedStyles.forEach(t=>t.update())}prepare(t){void 0===this.controller&&(this.controller=t),this.controller===t&&(this.startPosition=this.value,this.lastPosition=this.value,this.lastVelocity=t.isActive?this.lastVelocity:void 0,this.lastTime=t.isActive?this.lastTime:void 0,this.done=!1,this.animatedStyles.clear())}}class et extends k{constructor(t){var e;super(),e=this,this.setValue=function(t,n){void 0===n&&(n=!0),Array.isArray(t)?t.length===e.payload.length&&t.forEach((t,r)=>e.payload[r].setValue(t,n)):e.payload.forEach((r,o)=>e.payload[o].setValue(t,n))},this.getValue=(()=>this.payload.map(t=>t.getValue())),this.interpolate=((t,e)=>new X(this,t,e)),this.payload=t.map(t=>new tt(t))}}function nt(t,e){return null==t?e:t}function rt(t){return void 0!==t?Array.isArray(t)?t:[t]:[]}function ot(t,e){if(typeof t!=typeof e)return!1;if("string"==typeof t||"number"==typeof t)return t===e;let n;for(n in t)if(!(n in e))return!1;for(n in e)if(t[n]!==e[n])return!1;return void 0!==n||t===e}function it(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return"function"==typeof t?t(...n):t}function at(t){return Object.keys(t).map(e=>t[e])}function st(t){const e=function(t){return t.to,t.from,t.config,t.native,t.onStart,t.onRest,t.onFrame,t.children,t.reset,t.reverse,t.force,t.immediate,t.impl,t.inject,t.delay,t.attach,t.destroyed,t.interpolateTo,t.autoStart,t.ref,o(t,["to","from","config","native","onStart","onRest","onFrame","children","reset","reverse","force","immediate","impl","inject","delay","attach","destroyed","interpolateTo","autoStart","ref"])}(t),n=Object.keys(t).reduce((n,r)=>void 0!==e[r]?n:i({},n,{[r]:t[r]}),{});return i({to:e},n)}function ct(t,e){let n=e[0],r=e[1];return i({},t,{[n]:new(Array.isArray(r)?et:tt)(r)})}function ut(t){const e=t.from,n=t.to,r=t.native,o=Object.entries(i({},e,n));return r?o.reduce(ct,{}):i({},e,n)}function lt(t,e){return e&&("function"==typeof e?e(t):"object"==typeof e&&(e.current=t)),t}const dt=t=>"auto"===t,pt=(t,e)=>(n,r)=>{let o=r[0],a=r[1];return i({},n,{[o]:"auto"===a?~o.indexOf("height")?e:t:a})};let ft={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 ht=["Webkit","Ms","Moz","O"];function mt(t,e,n){return null==e||"boolean"==typeof e||""===e?"":n||"number"!=typeof e||0===e||ft.hasOwnProperty(t)&&ft[t]?(""+e).trim():e+"px"}ft=Object.keys(ft).reduce((t,e)=>(ht.forEach(n=>t[((t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1))(n,e)]=t[e]),t),ft);const vt={};E(t=>new P(t)),x("div"),w(function(t){const e=t.output.map(t=>t.replace(J,Y)).map(t=>t.replace(Z,Y)),n=e[0].match(Q).map(()=>[]);e.forEach(t=>{t.match(Q).forEach((t,e)=>n[e].push(+t))});const r=e[0].match(Q).map((e,r)=>U.create(i({},t,{output:n[r]})));return t=>{let n=0;return e[0].replace(Q,()=>r[n++](t)).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,(t,e,n,r,o)=>`rgba(${Math.round(e)}, ${Math.round(n)}, ${Math.round(r)}, ${o})`)}}),g(T),b(function(t,e){const n=t.from,r=t.to,o=t.children;if(!at(r).some(dt)&&!at(n).some(dt))return;let c=o(ut(t));if(!c)return;Array.isArray(c)&&(c={type:"div",props:{children:c}});const u=c.props.style;return a.createElement(c.type,i({key:c.key?c.key:void 0},c.props,{style:i({},u,{position:"absolute",visibility:"hidden"}),ref:o=>{if(o){let a,c,u=s.findDOMNode(o),l=getComputedStyle(u);if("border-box"===l.boxSizing)a=u.offsetWidth,c=u.offsetHeight;else{const t=parseFloat(l.paddingLeft||0)+parseFloat(l.paddingRight||0),e=parseFloat(l.paddingTop||0)+parseFloat(l.paddingBottom||0),n=parseFloat(l.borderLeftWidth||0)+parseFloat(l.borderRightWidth||0),r=parseFloat(l.borderTopWidth||0)+parseFloat(l.borderBottomWidth||0);a=u.offsetWidth-t-n,c=u.offsetHeight-e-r}const d=pt(a,c);e(i({},t,{from:Object.entries(n).reduce(d,n),to:Object.entries(r).reduce(d,r)}))}}}))}),y((t,e)=>{if(!t.nodeType||void 0===t.setAttribute)return!1;{const i=e.style,a=e.children,s=e.scrollTop,c=e.scrollLeft,u=o(e,["style","children","scrollTop","scrollLeft"]);void 0!==s&&(t.scrollTop=s),void 0!==c&&(t.scrollLeft=c),void 0!==a&&(t.textContent=a);for(let e in i)if(i.hasOwnProperty(e)){var n=0===e.indexOf("--"),r=mt(e,i[e],n);"float"===e&&(e="cssFloat"),n?t.style.setProperty(e,r):t.style[e]=r}for(let e in u){const n=vt[e]||(vt[e]=e.replace(/([A-Z])/g,t=>"-"+t.toLowerCase()));void 0!==t.getAttribute(n)&&t.setAttribute(n,u[e])}}},t=>t);let yt=!1;const gt=new Set,bt=()=>{let t=h();for(let e of gt){let n=!0,r=!0;for(let o=0;o<e.configs.length;o++){let i,a,s=e.configs[o];for(let o=0;o<s.animatedValues.length;o++){let c=s.animatedValues[o];if(c.done)continue;let u=s.fromValues[o],l=s.toValues[o],d=c.lastPosition,p=l instanceof O,f=Array.isArray(s.initialVelocity)?s.initialVelocity[o]:s.initialVelocity;if(p&&(l=l.getValue()),s.immediate||!p&&!s.decay&&u===l)c.updateValue(l),c.done=!0;else if(s.delay&&t-e.startTime<s.delay)n=!1;else if(r=!1,"string"!=typeof u&&"string"!=typeof l){if(void 0!==s.duration)d=u+s.easing((t-e.startTime-s.delay)/s.duration)*(l-u),i=t>=e.startTime+s.delay+s.duration;else if(s.decay)d=u+f/(1-.998)*(1-Math.exp(-(1-.998)*(t-e.startTime))),(i=Math.abs(c.lastPosition-d)<.1)&&(l=d);else{a=void 0!==c.lastTime?c.lastTime:t,f=void 0!==c.lastVelocity?c.lastVelocity:s.initialVelocity,t>a+64&&(a=t);let e=Math.floor(t-a);for(let t=0;t<e;++t){d+=1*(f+=1*((-s.tension*(d-l)+-s.friction*f)/s.mass)/1e3)/1e3}let n=!(!s.clamp||0===s.tension)&&(u<l?d>l:d<l),r=Math.abs(f)<=s.precision,o=0===s.tension||Math.abs(l-d)<=s.precision;i=n||r&&o,c.lastVelocity=f,c.lastTime=t}p&&!s.toValues[o].done&&(i=!1),i?(c.value!==l&&(d=l),c.done=!0):n=!1,c.updateValue(d),c.lastPosition=d}else c.updateValue(l),c.done=!0}!e.props.onFrame&&e.props.native||(e.animatedProps[s.name]=s.interpolation.getValue())}!e.props.onFrame&&e.props.native||(!e.props.native&&e.onUpdate&&e.onUpdate(),e.props.onFrame&&e.props.onFrame(e.animatedProps)),n&&(gt.delete(e),e.debouncedOnEnd({finished:!0,noChange:r}))}gt.size?d(bt):yt=!1},wt=t=>{gt.has(t)||(gt.add(t),yt||d(bt),yt=!0)},xt=t=>{gt.has(t)&&gt.delete(t)};class Et{constructor(t,e){void 0===e&&(e={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({},t,e))}update(t){this.props=i({},this.props,t);let e=this.props.interpolateTo?st(this.props):this.props,n=e.from,r=void 0===n?{}:n,o=e.to,a=void 0===o?{}:o,s=e.config,c=void 0===s?{}:s,u=e.delay,d=void 0===u?0:u,p=e.reverse,f=e.attach,h=e.reset,m=e.immediate,v=e.autoStart,y=e.ref;if(p){var g=[a,r];r=g[0],a=g[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((t,e,n)=>{let o=e[0],a=e[1],s=!h&&t[o]||{};const u="number"==typeof a,p="string"==typeof a&&!a.startsWith("#")&&!/\d/.test(a)&&!l[a],f=!u&&!p&&Array.isArray(a);let v=void 0!==r[o]?r[o]:a,y=u||f?a:p?a:1,g=it(c,o);if(b&&(y=b.animations[o].parent),void 0===g.decay&&ot(s.changes,a))return t;{let e,n;if(this.hasChanged=!0,u||p)e=n=s.parent||new tt(v);else if(f)e=n=s.parent||new et(v);else{const t=s.interpolation&&s.interpolation.calc(s.parent.value);s.parent?(e=s.parent).setValue(0,!1):e=new tt(0);const r={output:[void 0!==t?t:v,a]};s.interpolation?(n=s.interpolation,s.interpolation.updateConfig(r)):n=e.interpolate(r)}it(m,o)&&e.setValue(a,!1);const r=rt(e.getPayload());return r.forEach(t=>t.prepare(this)),i({},t,{[o]:i({},s,{name:o,parent:e,interpolation:n,animatedValues:r,changes:a,fromValues:rt(e.getValue()),toValues:rt(b?y.getPayload():y),immediate:it(m,o),delay:nt(g.delay,d||0),initialVelocity:nt(g.velocity,0),clamp:nt(g.clamp,!1),precision:nt(g.precision,.01),tension:nt(g.tension,170),friction:nt(g.friction,26),mass:nt(g.mass,1),duration:g.duration,easing:nt(g.easing,t=>t),decay:g.decay})})}},this.animations),this.hasChanged){this.configs=at(this.animations),this.animatedProps={},this.interpolations={};for(let t in this.animations)this.interpolations[t]=this.animations[t].interpolation,this.animatedProps[t]=this.animations[t].interpolation.getValue()}for(var x=arguments.length,E=new Array(x>1?x-1:0),A=1;A<x;A++)E[A-1]=arguments[A];y||!v&&!E.length||this.start(...E);const O=E[0],S=E[1];return this.onEnd="function"==typeof O&&O,this.onUpdate=S,this.getValues()}start(t,e){return this.startTime=h(),this.isActive&&this.stop(),this.isActive=!0,this.onEnd="function"==typeof t&&t,this.onUpdate=e,this.props.onStart&&this.props.onStart(),wt(this),new Promise(t=>this.resolve=t)}stop(t){void 0===t&&(t=!1),t&&at(this.animations).forEach(t=>t.changes=void 0),this.debouncedOnEnd({finished:t})}destroy(){xt(this),this.props={},this.merged={},this.animations={},this.interpolations={},this.animatedProps={},this.configs=[]}debouncedOnEnd(t){xt(this),this.isActive=!1;const e=this.onEnd;this.onEnd=null,e&&e(t),this.resolve&&this.resolve(),this.resolve=null}}class At extends C{constructor(t,e){super(),t.style&&(t=i({},t,{style:v(t.style)})),this.payload=t,this.update=e,this.attach()}}function Ot(t){class e extends a.Component{constructor(t){super(),this.callback=(()=>{if(this.node){!1===u.fn(this.node,this.propsAnimated.getAnimatedValue(),this)&&this.forceUpdate()}}),this.attachProps(t)}componentWillUnmount(){this.propsAnimated&&this.propsAnimated.detach()}setNativeProps(t){!1===u.fn(this.node,t,this)&&this.forceUpdate()}attachProps(t){t.forwardRef;let e=o(t,["forwardRef"]);const n=this.propsAnimated;this.propsAnimated=new At(e,this.callback),n&&n.detach()}shouldComponentUpdate(t){const e=t.style,n=o(t,["style"]),r=this.props,i=r.style;return(!ot(o(r,["style"]),n)||!ot(i,e))&&(this.attachProps(t),!0)}render(){const e=this.propsAnimated.getValue(),n=(e.scrollTop,e.scrollLeft,o(e,["scrollTop","scrollLeft"]));return a.createElement(t,i({},n,{ref:t=>this.node=lt(t,this.props.forwardRef)}))}}return a.forwardRef((t,n)=>a.createElement(e,i({},t,{forwardRef:n})))}const St={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 jt extends a.Component{constructor(){super(...arguments),this.state={lastProps:{from:{},to:{}},propsChanged:!1,internal:!1},this.controller=new Et(null,null),this.didUpdate=!1,this.didInject=!1,this.finished=!0,this.start=(()=>{this.finished=!1;let t=this.mounted;this.controller.start(e=>this.finish(i({},e,{wasMounted:t})),this.update)}),this.stop=(()=>this.controller.stop(!0)),this.update=(()=>this.mounted&&this.setState({internal:!0})),this.finish=(t=>{let e=t.finished,n=t.noChange,r=t.wasMounted;this.finished=!0,this.mounted&&e&&(!this.props.onRest||!r&&n||this.props.onRest(this.controller.merged),this.mounted&&this.didInject&&(this.afterInject=ut(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(t,e){let n=e.internal,r=e.lastProps;const o=t.from,i=t.to,a=t.reset,s=t.force;return{propsChanged:!ot(i,r.to)||!ot(o,r.from)||a&&!n||s&&!n,lastProps:t,internal:!1}}render(){const t=this.props.children,e=this.state.propsChanged;if(this.props.inject&&e&&!this.injectProps){const t=this.props.inject(this.props,t=>{this.injectProps=t,this.setState({internal:!0})});if(t)return t}(this.injectProps||e)&&(this.didInject=!1,this.injectProps?(this.controller.update(this.injectProps),this.didInject=!0):e&&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?t(n):null}componentDidUpdate(){this.didUpdate&&this.start(),this.didUpdate=!1}}jt.defaultProps={from:{},to:{},config:St.default,native:!1,immediate:!1,reset:!1,force:!1,inject:c};class kt extends a.PureComponent{constructor(){super(...arguments),this.first=!0,this.instances=new Set,this.hook=((t,e,n,r)=>(this.instances.add(t),(r?e===n-1:0===e)?void 0:Array.from(this.instances)[r?e+1:e-1]))}render(){const t=this.props,e=t.items,n=t.children,r=t.from,s=void 0===r?{}:r,c=t.initial,u=t.reverse,l=t.keys,d=t.delay,p=t.onRest,f=o(t,["items","children","from","initial","reverse","keys","delay","onRest"]),h=rt(e);return rt(h).map((t,e)=>a.createElement(jt,i({onRest:0===e?p:null,key:"function"==typeof l?l(t):rt(l)[e],from:this.first&&void 0!==c?c||{}:s},f,{delay:0===e&&d||void 0,attach:t=>this.hook(t,e,h.length,u),children:r=>{const o=n(t,e);return o?o(r):null}})))}componentDidUpdate(t){this.first=!1,t.items!==this.props.items&&this.instances.clear()}}kt.defaultProps={keys:t=>t};class Ct extends a.PureComponent{constructor(){var t;super(...arguments),t=this,this.guid=0,this.state={props:{},resolve:()=>null,last:!0,index:0},this.next=function(e,n,r){return void 0===n&&(n=!0),void 0===r&&(r=0),t.running=!0,new Promise(o=>{t.mounted&&t.setState(t=>({props:e,resolve:o,last:n,index:r}),()=>t.running=!1)})}}componentDidMount(){this.mounted=!0,this.componentDidUpdate({})}componentWillUnmount(){this.mounted=!1}componentDidUpdate(t){var e=this;const n=this.props,r=n.states,o=n.filter,i=n.state;if((t.state!==this.props.state||this.props.reset&&!this.running||!ot(r[i],t.states[t.state]))&&r&&i&&r[i]){const t=++this.guid,n=r[i];if(n)if(Array.isArray(n)){let e=Promise.resolve();for(let r=0;r<n.length;r++){let i=r,a=n[i],s=i===n.length-1;e=e.then(()=>t===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),t===e.guid&&e.next(o(n),i,r++)},()=>d(()=>this.instance&&this.instance.stop()),this.props)}else this.next(o(r[i]))}}render(){const t=this.state,e=t.props,n=t.resolve,r=t.last,s=t.index;if(!e||0===Object.keys(e).length)return null;let c=this.props,u=(c.state,c.filter,c.states,c.config),l=c.primitive,d=c.onRest,p=c.forwardRef,f=o(c,["state","filter","states","config","primitive","onRest","forwardRef"]);return Array.isArray(u)&&(u=u[s]),a.createElement(l,i({ref:t=>this.instance=lt(t,p),config:u},f,e,{onRest:t=>{n(t),d&&r&&d(t)}}))}}Ct.defaultProps={state:"__default"};const Pt=a.forwardRef((t,e)=>a.createElement(Ct,i({},t,{forwardRef:e})));Pt.create=(t=>(function(e,n){return void 0===n&&(n=(t=>t)),("function"==typeof e||Array.isArray(e))&&(e={__default:e}),r=>a.createElement(Ct,i({primitive:t,states:e,filter:n},r))})),Pt.Spring=(t=>Pt.create(jt)(t,st)),Pt.Trail=(t=>Pt.create(kt)(t,st));let Tt=0,Ut=t=>{let e=t.items,n=t.keys,r=o(t,["items","keys"]);return e=rt(void 0!==e?e:null),n="function"==typeof n?e.map(n):rt(n),i({items:e,keys:n.map(t=>String(t))},r)};class Rt extends a.PureComponent{componentDidMount(){this.mounted=!0}componentWillUnmount(){this.mounted=!1}constructor(t){super(t),this.destroyItem=((t,e,n)=>r=>{const o=this.props,i=o.onRest,a=o.onDestroyed;this.mounted&&(a&&a(t),this.setState(t=>{return{deleted:t.deleted.filter(t=>t.key!==e)}}),i&&i(t,n,r))}),this.state={first:!0,transitions:[],current:{},deleted:[],prevProps:t}}static getDerivedStateFromProps(t,e){let n=e.first,r=e.prevProps,a=o(e,["first","prevProps"]),s=Ut(t),c=s.items,u=s.keys,l=s.initial,d=s.from,p=s.enter,f=s.leave,h=s.update,m=s.trail,v=void 0===m?0:m,y=s.unique,g=s.config,b=Ut(r),w=b.keys,x=b.items,E=i({},a.current),A=[...a.deleted],O=Object.keys(E),S=new Set(O),j=new Set(u),k=u.filter(t=>!S.has(t)),C=a.transitions.filter(t=>!t.destroyed&&!j.has(t.originalKey)).map(t=>t.originalKey),P=u.filter(t=>S.has(t)),T=0;k.forEach(t=>{y&&A.find(e=>e.originalKey===t)&&(A=A.filter(e=>e.originalKey!==t));const e=u.indexOf(t),r=c[e];E[t]={state:"enter",originalKey:t,key:y?String(t):Tt++,item:r,trail:T+=v,config:it(g,r,"enter"),from:it(n&&void 0!==l?l||{}:d,r),to:it(p,r)}}),C.forEach(t=>{const e=w.indexOf(t),n=x[e];A.push(i({},E[t],{state:"leave",destroyed:!0,left:w[Math.max(0,e-1)],right:w[Math.min(w.length,e+1)],trail:T+=v,config:it(g,n,"leave"),to:it(f,n)})),delete E[t]}),P.forEach(t=>{const e=u.indexOf(t),n=c[e];E[t]=i({},E[t],{item:n,state:"update",trail:T+=v,config:it(g,n,"update"),to:it(h,n)})});let U=u.map(t=>E[t]);return A.forEach(t=>{let e,n=t.left,r=t.right,i=o(t,["left","right"]);-1!==(e=U.findIndex(t=>t.originalKey===n))&&(e+=1),-1===e&&(e=U.findIndex(t=>t.originalKey===r)),-1===e&&(e=A.findIndex(t=>t.originalKey===n)),-1===e&&(e=A.findIndex(t=>t.originalKey===r)),e=Math.max(0,e),U=[...U.slice(0,e),i,...U.slice(e)]}),{first:n&&0===k.length,transitions:U,current:E,deleted:A,prevProps:t}}render(){const t=this.props,e=(t.initial,t.from,t.enter,t.leave,t.update,t.onDestroyed,t.keys,t.items,t.onFrame),n=t.onRest,r=t.onStart,s=(t.trail,t.config,t.children),c=(t.unique,t.reset),u=o(t,["initial","from","enter","leave","update","onDestroyed","keys","items","onFrame","onRest","onStart","trail","config","children","unique","reset"]);return this.state.transitions.map((t,o)=>{let l=t.state,d=t.key,p=t.item,f=t.from,h=t.to,m=t.trail,v=t.config,y=t.destroyed;return a.createElement(Pt,i({reset:c&&"enter"===l,primitive:jt,state:l,filter:st,states:{[l]:h},key:d,onRest:y?this.destroyItem(p,d,l):n&&(t=>n(p,l,t)),onStart:r&&(()=>r(p,l)),onFrame:e&&(t=>e(p,l,t)),delay:m,config:v},u,{from:f,children:t=>{const e=s(p,l,o);return e?e(t):null}}))})}}Rt.defaultProps={keys:t=>t,unique:!1,reset:!1};const _t=["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((t,e)=>(t[e]=Ot(e),t),Ot);e.Spring=jt,e.Keyframes=Pt,e.Transition=Rt,e.Trail=kt,e.Controller=Et,e.config=St,e.animated=_t,e.interpolate=((t,e,n)=>t&&new X(t,e,n)),e.Globals=A},,,,function(t,e,n){"use strict";var r=n(17);function o(){}function i(){}i.resetWarningCache=o,t.exports=function(){function t(t,e,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 e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){"use strict";var r=n(19);function o(){}t.exports=function(){function t(t,e,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 e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return n.checkPropTypes=o,n.PropTypes=n,n}},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){var r=n(21);"string"==typeof r&&(r=[[t.i,r,""]]);n(23)(r,{});r.locals&&(t.exports=r.locals)},function(t,e,n){(t.exports=n(22)()).push([t.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(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e<this.length;e++){var n=this[e];n[2]?t.push("@media "+n[2]+"{"+n[1]+"}"):t.push(n[1])}return t.join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];"number"==typeof i&&(r[i]=!0)}for(o=0;o<e.length;o++){var a=e[o];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(t,e){var n={},r=function(t){var e;return function(){return void 0===e&&(e=t.apply(this,arguments)),e}},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,c=[];function u(t,e){for(var r=0;r<t.length;r++){var o=t[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],e))}else{var s=[];for(a=0;a<o.parts.length;a++)s.push(h(o.parts[a],e));n[o.id]={id:o.id,refs:1,parts:s}}}}function l(t){for(var e=[],n={},r=0;r<t.length;r++){var o=t[r],i=o[0],a={css:o[1],media:o[2],sourceMap:o[3]};n[i]?n[i].parts.push(a):e.push(n[i]={id:i,parts:[a]})}return e}function d(t,e){var n=i(),r=c[c.length-1];if("top"===t.insertAt)r?r.nextSibling?n.insertBefore(e,r.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),c.push(e);else{if("bottom"!==t.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");n.appendChild(e)}}function p(t){t.parentNode.removeChild(t);var e=c.indexOf(t);e>=0&&c.splice(e,1)}function f(t){var e=document.createElement("style");return e.type="text/css",d(t,e),e}function h(t,e){var n,r,o;if(e.singleton){var i=s++;n=a||(a=f(e)),r=y.bind(null,n,i,!1),o=y.bind(null,n,i,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return e.rel="stylesheet",d(t,e),e}(e),r=function(t,e){var n=e.css,r=e.sourceMap;r&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var o=new Blob([n],{type:"text/css"}),i=t.href;t.href=URL.createObjectURL(o),i&&URL.revokeObjectURL(i)}.bind(null,n),o=function(){p(n),n.href&&URL.revokeObjectURL(n.href)}):(n=f(e),r=function(t,e){var n=e.css,r=e.media;r&&t.setAttribute("media",r);if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),o=function(){p(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else o()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");void 0===(e=e||{}).singleton&&(e.singleton=o()),void 0===e.insertAt&&(e.insertAt="bottom");var r=l(t);return u(r,e),function(t){for(var o=[],i=0;i<r.length;i++){var a=r[i];(s=n[a.id]).refs--,o.push(s)}t&&u(l(t),e);for(i=0;i<o.length;i++){var s;if(0===(s=o[i]).refs){for(var c=0;c<s.parts.length;c++)s.parts[c]();delete n[s.id]}}}};var m,v=(m=[],function(t,e){return m[t]=e,m.filter(Boolean).join("\n")});function y(t,e,n,r){var o=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=v(e,o);else{var i=document.createTextNode(o),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(i,a[e]):t.appendChild(i)}}},function(t,e,n){"use strict";function r(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}n.r(e),n.d(e,"default",function(){return r})},function(t,e,n){"use strict";function r(){return(r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}n.r(e),n.d(e,"default",function(){return r})},function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"FOCUS_GROUP",function(){return R}),n.d(r,"FOCUS_DISABLED",function(){return _}),n.d(r,"FOCUS_ALLOW",function(){return F}),n.d(r,"FOCUS_AUTO",function(){return I});var o=n(1),i=n(4),a=n(10),s=n.n(a),c=n(12),u=n(0),l=n.n(u);n(9);function d(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var p=function(t){t.initialState,t.getInitialState,t.refs,t.getRefs,t.didMount,t.didUpdate,t.willUnmount,t.getSnapshotBeforeUpdate,t.shouldUpdate,t.render;return function(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}(t,["initialState","getInitialState","refs","getRefs","didMount","didUpdate","willUnmount","getSnapshotBeforeUpdate","shouldUpdate","render"])},f=function(t){function e(){var n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=d(this,t.call.apply(t,[this].concat(i))),h.call(r),d(r,n)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.getArgs=function(){var t=this.state,e=this.props,n=this._setState,r=this._forceUpdate,o=this._refs;return{state:t,props:p(e),refs:o,setState:n,forceUpdate:r}},e.prototype.componentDidMount=function(){this.props.didMount&&this.props.didMount(this.getArgs())},e.prototype.shouldComponentUpdate=function(t,e){return!this.props.shouldUpdate||this.props.shouldUpdate({props:this.props,state:this.state,nextProps:p(t),nextState:e})},e.prototype.componentWillUnmount=function(){this.props.willUnmount&&this.props.willUnmount({state:this.state,props:p(this.props),refs:this._refs})},e.prototype.componentDidUpdate=function(t,e,n){this.props.didUpdate&&this.props.didUpdate(Object.assign(this.getArgs(),{prevProps:p(t),prevState:e}),n)},e.prototype.getSnapshotBeforeUpdate=function(t,e){return this.props.getSnapshotBeforeUpdate?this.props.getSnapshotBeforeUpdate(Object.assign(this.getArgs(),{prevProps:p(t),prevState:e})):null},e.prototype.render=function(){var t=this.props,e=t.children,n=t.render;return n?n(this.getArgs()):"function"==typeof e?e(this.getArgs()):e||null},e}(l.a.Component);f.defaultProps={getInitialState:function(){},getRefs:function(){return{}}};var h=function(){var t=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 t.setState.apply(t,arguments)},this._forceUpdate=function(){return t.forceUpdate.apply(t,arguments)}},m=f,v=n(7),y=function(t){var e=t.children,n=t.type,r=void 0===n?"reach-portal":n;return l.a.createElement(m,{getRefs:function(){return{node:null}},didMount:function(t){var e=t.refs,n=t.forceUpdate;e.node=document.createElement(r),document.body.appendChild(e.node),n()},willUnmount:function(t){var e=t.refs.node;document.body.removeChild(e)},render:function(t){var n=t.refs.node;return n?Object(v.createPortal)(e,n):null}})};var g=function(t,e){return function(n){if(t&&t(n),!n.defaultPrevented)return e(n)}},b=n(8),w=n.n(b),x=n(5),E=n.n(x),A=n(2),O=n.n(A),S=n(3),j=n.n(S),k=(n(6),function(t){for(var e=Array(t.length),n=0;n<t.length;++n)e[n]=t[n];return e}),C=function(t){return Array.isArray(t)?t:[t]},P=function(t,e){var n=t.tabIndex-e.tabIndex,r=t.index-e.index;if(n){if(!t.tabIndex)return 1;if(!e.tabIndex)return-1}return n||r},T=function(t,e,n){return k(t).map(function(t,e){return{node:t,index:e,tabIndex:n&&-1===t.tabIndex?(t.dataset||{}).focusGuard?0:-1:t.tabIndex}}).filter(function(t){return!e||t.tabIndex>=0}).sort(P)},U=["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]"],R="data-focus-lock",_="data-focus-lock-disabled",F="data-no-focus-lock",I="data-autofocus-inside",D=U.join(","),M=D+", [data-focus-guard]",V=function(t,e){return t.reduce(function(t,n){return t.concat(k(n.querySelectorAll(e?M:D)),n.parentNode?k(n.parentNode.querySelectorAll(U.join(","))).filter(function(t){return t===n}):[])},[])},L=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n.push(e),e.parentNode&&t(e.parentNode,n),n},N=function(t,e){for(var n=L(t),r=L(e),o=0;o<n.length;o+=1){var i=n[o];if(r.indexOf(i)>=0)return i}return!1},B=function(t){return k(t).filter(function(t){return function t(e){return!e||e===document||!((n=window.getComputedStyle(e,null))&&n.getPropertyValue&&("none"===n.getPropertyValue("display")||"hidden"===n.getPropertyValue("visibility")))&&t(e.parentNode);var n}(t)}).filter(function(t){return function(t){return!(("INPUT"===t.tagName||"BUTTON"===t.tagName)&&("hidden"===t.type||t.disabled))}(t)})},W=function(t,e){return T(B(V(t,e)),!0,e)},q=function(t){return B((e=t.querySelectorAll("["+I+"]"),k(e).map(function(t){return V([t])}).reduce(function(t,e){return t.concat(e)},[])));var e},z=function(t){return"INPUT"===t.tagName&&"radio"===t.type},G=function(t){return t[0]&&t.length>1&&z(t[0])&&t[0].name?function(t,e){return e.filter(z).filter(function(e){return e.name===t.name}).filter(function(t){return t.checked})[0]||t}(t[0],t):t[0]},K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$=function(t){return C(t).filter(Boolean).reduce(function(t,e){var n=e.getAttribute(R);return t.push.apply(t,n?function t(e){for(var n=e.length,r=0;r<n;r+=1)for(var o=function(n){if(r!==n&&e[r].contains(e[n]))return{v:t(e.filter(function(t){return t!==e[n]}))}},i=0;i<n;i+=1){var a=o(i);if("object"===(void 0===a?"undefined":K(a)))return a.v}return e}(k(function t(e){return e.parentNode?t(e.parentNode):e}(e).querySelectorAll("["+R+'="'+n+'"]:not(['+_+'="disabled"])'))):[e]),t},[])},H=function(t,e,n){var r=C(t),o=C(e),i=r[0],a=null;return o.filter(Boolean).forEach(function(t){a=N(a||t,t)||a,n.filter(Boolean).forEach(function(t){var e=N(i,t);e&&(a=!a||e.contains(a)?e:N(e,a))})}),a},Y=function(t){return!(t.dataset&&t.dataset.focusGuard)},Q=function(t,e){var n=document&&document.activeElement,r=$(t).filter(Y),o=H(n||t,t,r),i=W(r).filter(function(t){var e=t.node;return Y(e)});if(i[0]||(i=(a=r,T(B(V(a)),!1)).filter(function(t){var e=t.node;return Y(e)}))[0]){var a,s,c,u=W([o]).map(function(t){return t.node}),l=(s=i,u.map(function(t){return s.find(function(e){var n=e.node;return t===n})}).filter(Boolean)),d=l.map(function(t){return t.node}),p=function(t,e,n,r,o){var i=t.length,a=t[0],s=t[i-1];if(!(t.indexOf(n)>=0)){var c=e.indexOf(n),u=e.indexOf(r||c),l=t.indexOf(r),d=c-u,p=e.indexOf(a),f=e.indexOf(s);return-1===c||-1===l?t.indexOf(o.length?G(o):G(t)):!d&&l>=0?l:d&&Math.abs(d)>1?l:c<=p?i-1:c>f?0:d?Math.abs(d)>1?l:(i+l+d)%i:void 0}}(d,u,n,e,d.filter((c=function(t){return t.reduce(function(t,e){return t.concat(q(e))},[])}(r),function(t){return!!t.autofocus||t.dataset&&!!t.dataset.autofocus||c.indexOf(t)>=0})));return void 0===p?p:l[p]}},J=function(t){return t===document.activeElement},Z=function(t){var e=document&&document.activeElement;return!(!e||e.dataset&&e.dataset.focusGuard)&&$(t).reduce(function(t,n){return t||n.contains(e)||(r=k(n.querySelectorAll("iframe")),o=J,!!r.filter(function(t){return t===o})[0]);var r,o},!1)},X=function(){return document&&k(document.querySelectorAll("["+F+"]")).some(function(t){return t.contains(document.activeElement)})},tt=0,et=!1,nt=function(t,e){var n,r=Q(t,e);if(!et&&r){if(tt>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"),et=!0,void setTimeout(function(){et=!1},1);tt++,(n=r.node).focus(),n.contentWindow&&n.contentWindow.focus(),tt--}},rt=n(11),ot=n.n(rt);function it(t){var e=window.setImmediate;void 0!==e?e(t):setTimeout(t,1)}var at=function(){return document&&document.activeElement===document.body||X()},st=null,ct=null,ut=null;function lt(t,e,n,r){var o=null,i=t;do{var a=r[i];if(a.guard)a.node.dataset.focusAutoGuard&&(o=a);else{if(!a.lockItem)break;if(i!==t)return;o=null}}while((i+=n)!==e);o&&(o.node.tabIndex=0)}var dt=function(t){return t&&"current"in t?t.current:t},pt=function(){var t,e,n,r,o,i,a=!1;if(st){var s=st,c=s.observed,u=s.persistentFocus,l=s.autoFocus,d=s.shards,p=c||ut&&ut.portaledElement,f=document&&document.activeElement;if(p){var h=[p].concat(d.map(dt).filter(Boolean));if(f&&!function(t){return(st.whiteList||function(){return!0})(t)}(f)||(u||!at()||!ct&&l)&&(!p||Z(h)||(i=f,ut&&ut.portaledElement===i)||(document&&!ct&&f&&!l?(f.blur(),document.body.focus()):(a=nt(h,ct),ut={})),ct=document&&document.activeElement),document){var m=document&&document.activeElement,v=(e=$(t=h).filter(Y),n=H(t,t,e),r=W([n],!0),o=W(e).filter(function(t){var e=t.node;return Y(e)}).map(function(t){return t.node}),r.map(function(t){var e=t.node;return{node:e,index:t.index,lockItem:o.indexOf(e)>=0,guard:!Y(e)}})),y=v.find(function(t){return t.node===m});if(y){v.filter(function(t){var e=t.guard,n=t.node;return e&&n.dataset.focusAutoGuard}).forEach(function(t){return t.node.removeAttribute("tabIndex")});var g=v.indexOf(y);lt(g,v.length,1,v),lt(g,-1,-1,v)}}}}return a},ft=function(t){pt()&&t&&(t.stopPropagation(),t.preventDefault())},ht=function(){return it(pt)},mt=function(t){var e=t.target,n=t.currentTarget;n.contains(e)||(ut={observerNode:n,portaledElement:e})},vt=function(){document.addEventListener("focusin",ft,!0),document.addEventListener("focusout",ht)},yt=function(){document.removeEventListener("focusin",ft,!0),document.removeEventListener("focusout",ht)};var gt=function(t,e){return function(n){var r,o=[];function i(){r=t(o.map(function(t){return t.props})),e(r)}var a=function(t){function e(){return t.apply(this,arguments)||this}E()(e,t),e.peek=function(){return r};var a=e.prototype;return a.shouldComponentUpdate=function(t){return!ot()(t,this.props)},a.componentDidMount=function(){o.push(this),i()},a.componentDidUpdate=function(){i()},a.componentWillUnmount=function(){var t=o.indexOf(this);o.splice(t,1),i()},a.render=function(){return l.a.createElement(n,this.props)},e}(u.Component);return j()(a,"displayName","SideEffect("+function(t){return t.displayName||t.name||"Component"}(n)+")"),a}}(function(t){return t.filter(function(t){return!t.disabled}).slice(-1)[0]},function(t){t&&!st&&vt();var e=st,n=e&&t&&t.onActivation===e.onActivation;st=t,e&&!n&&e.onDeactivation(),t?(ct=null,n&&e.observed===t.observed||t.onActivation(),pt(!0),it(pt)):(yt(),ct=null)})(function(){return null}),bt={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},wt=function(t){var e=t.children;return l.a.createElement(l.a.Fragment,null,l.a.createElement("div",{key:"guard-first","data-focus-guard":!0,"data-focus-auto-guard":!0,style:bt}),e,e&&l.a.createElement("div",{key:"guard-last","data-focus-guard":!0,"data-focus-auto-guard":!0,style:bt}))};wt.propTypes={},wt.defaultProps={children:null};var xt=function(t){var e=t.children;return l.a.createElement("div",null,e)};xt.propTypes={};var Et=l.a.Fragment?l.a.Fragment:xt,At=[],Ot=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e=t.call.apply(t,[this].concat(r))||this,j()(O()(O()(e)),"state",{observed:void 0}),j()(O()(O()(e)),"onActivation",function(){e.originalFocusedElement=e.originalFocusedElement||document&&document.activeElement,e.state.observed&&e.props.onActivation&&e.props.onActivation(e.state.observed),e.isActive=!0}),j()(O()(O()(e)),"onDeactivation",function(){e.isActive=!1,e.props.returnFocus&&e.originalFocusedElement&&e.originalFocusedElement.focus&&(e.originalFocusedElement.focus(),e.originalFocusedElement=null),e.props.onDeactivation&&e.props.onDeactivation(e.state.observed)}),j()(O()(O()(e)),"onFocus",function(t){e.isActive&&mt(t)}),j()(O()(O()(e)),"onBlur",ht),j()(O()(O()(e)),"setObserveNode",function(t){return e.setState({observed:t})}),j()(O()(O()(e)),"isActive",!1),j()(O()(O()(e)),"update",function(){return e.setState(function(t){return{escapeAttempts:t.escapeAttempts+1}})}),j()(O()(O()(e)),"originalFocusedElement",null),e}return E()(e,t),e.prototype.render=function(){var t,e=this.props,n=e.children,o=e.disabled,i=e.noFocusGuards,a=e.persistentFocus,s=e.autoFocus,c=(e.allowTextSelection,e.group),u=e.className,d=e.whiteList,p=e.shards,f=void 0===p?At:p,h=e.as,m=void 0===h?"div":h,v=e.lockProps,y=void 0===v?{}:v,g=this.state.observed;var b=w()(((t={})[r.FOCUS_DISABLED]=o&&"disabled",t[r.FOCUS_GROUP]=c,t),y);return l.a.createElement(Et,null,!i&&[l.a.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:o?-1:0,style:bt}),l.a.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:o?-1:1,style:bt})],l.a.createElement(m,w()({ref:this.setObserveNode},b,{className:u,onBlur:this.onBlur,onFocus:this.onFocus}),l.a.createElement(gt,{observed:g,disabled:o,persistentFocus:a,autoFocus:s,whiteList:d,shards:f,onActivation:this.onActivation,onDeactivation:this.onDeactivation}),n),!i&&l.a.createElement("div",{"data-focus-guard":!0,tabIndex:o?-1:0,style:bt}))},e}(u.Component);Ot.propTypes={},Ot.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 St=Ot,jt=function(t,e){return(jt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function kt(t,e){function n(){this.constructor=t}jt(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var Ct=function(){return(Ct=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};var Pt,Tt={left:0,top:0,right:0,gap:0},Ut=function(t){if(void 0===t&&(t="margin"),"undefined"==typeof window)return Tt;var e=function(t){var e=window.getComputedStyle(document.body),n=e["padding"===t?"paddingLeft":"marginLeft"],r=e["padding"===t?"paddingTop":"marginTop"],o=e["padding"===t?"paddingRight":"marginRight"];return[parseInt(n||"",10)||0,parseInt(r||"",10)||0,parseInt(o||"",10)||0]}(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},Rt=(Pt=function(){var t=0,e=null;return{add:function(n){var r,o;0==t&&(e=function(){if(!document)return null;var t=document.createElement("style");return t.type="text/css",t}())&&(o=n,(r=e).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(t){(document.head||document.getElementsByTagName("head")[0]).appendChild(t)}(e)),t++},remove:function(){!--t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}}(),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return kt(e,t),e.prototype.componentDidMount=function(){Pt.add(this.props.styles)},e.prototype.componentWillUnmount=function(){Pt.remove()},e.prototype.render=function(){return null},e}(u.PureComponent)),_t=function(t,e,n,r){var o=t.left,i=t.top,a=t.right,s=t.gap;return void 0===n&&(n="margin"),"\n body {\n overflow: hidden "+r+";\n "+[e&&"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"},Ft=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state={gap:Ut(e.props.gapMode)},e.onResize=function(){e.forceUpdate(),e.state.gap&&e.props.dynamic&&window.innerHeight>document.body.offsetHeight&&e.setState({gap:Tt})},e}return kt(e,t),e.prototype.componentDidMount=function(){var t=Ut(this.props.gapMode);t!==this.state.gap&&this.setState({gap:t}),"undefined"!=typeof window&&window.addEventListener("resize",this.onResize)},e.prototype.componentWillUnmount=function(){"undefined"!=typeof window&&window.removeEventListener("resize",this.onResize)},e.prototype.componentDidUpdate=function(){if(!this.state.gap){var t=Ut(this.props.gapMode);t!==this.state.gap&&this.setState({gap:t})}},e.prototype.render=function(){var t=this.props,e=t.noRelative,n=t.noImportant,r=t.gapMode,o=void 0===r?"margin":r,i=this.state.gap;return i.gap?u.createElement(Rt,{styles:_t(i,!e,o,n?"":"!important")}):null},e}(u.Component),It=function(t,e,n){var r,o=n,i=e.target,a=t.contains(i),s=!1,c=o>0,u=0,l=0;do{var d=i.scrollTop,p=i.scrollHeight-i.clientHeight-d;(d||p)&&(r=i,"hidden"!==window.getComputedStyle(r).overflowY&&(u+=p,l+=d)),i=i.parentNode}while(!a&&i!==document.body||a&&(t.contains(i)||t===i));return c&&o>u?s=!0:!c&&-o>l&&(s=!0),s},Dt=!1;if("undefined"!=typeof window)try{var Mt=Object.defineProperty({},"passive",{get:function(){return Dt=!0,!0}});window.addEventListener("test",Mt,Mt),window.removeEventListener("test",Mt,Mt)}catch(t){Dt=!1}var Vt=!!Dt&&{passive:!1},Lt=function(t){return t.changedTouches?t.changedTouches[0].clientY:0},Nt={fullWidth:"width-before-scroll-bar",zeroRight:"right-scroll-bar-position"},Bt=function(t){return t&&"current"in t?t.current:t},Wt=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.shouldPreventQueue=[],n.touchStart=0,n.ref=u.createRef(),n.shouldPrevent=function(t){var r=e.stack.filter(function(t){return t.props.enabled});if(r.length&&r[r.length-1]===n){var o=t.deltaY||Lt(t),i=n.shouldPreventQueue.filter(function(e){return e.name===t.type&&e.delta===o&&e.target===t.target})[0];if(i&&i.should)t.preventDefault();else if(!i){var a=(n.props.shards||[]).map(Bt).filter(Boolean).filter(function(e){return e.contains(t.target)});(a.length>0?n.shouldCancelEvent(t,a[0]):!n.props.noIsolation)&&t.preventDefault()}}},n.shouldCancel=function(t,e,r,o){var i={name:t,delta:e,target:r,should:o};n.shouldPreventQueue.push(i),setTimeout(function(){n.shouldPreventQueue=n.shouldPreventQueue.filter(function(t){return t!==i})},1)},n.scrollTouchStart=function(t){n.touchStart=Lt(t)},n.scrollWheel=function(t){n.shouldCancel(t.type,t.deltaY,t.target,n.shouldCancelEvent(t,n.ref.current))},n.scrollTouchMove=function(t){n.shouldCancel(t.type,Lt(t),t.target,n.shouldCancelEvent(t,n.ref.current))},n}return kt(e,t),e.prototype.componentDidMount=function(){e.stack.push(this),this.componentDidUpdate({enabled:!1})},e.prototype.componentWillUnmount=function(){var t=this;e.stack=e.stack.filter(function(e){return e!==t}),this.disable()},e.prototype.componentDidUpdate=function(t){t.enabled!==this.props.enabled&&(this.props.enabled?this.enable():this.disable())},e.prototype.enable=function(){"undefined"!=typeof document&&(document.addEventListener("wheel",this.shouldPrevent,Vt),document.addEventListener("touchmove",this.shouldPrevent,Vt),document.addEventListener("touchstart",this.scrollTouchStart,Vt))},e.prototype.disable=function(){"undefined"!=typeof window&&(document.removeEventListener("wheel",this.shouldPrevent,Vt),document.removeEventListener("touchmove",this.shouldPrevent,Vt),document.removeEventListener("touchstart",this.scrollTouchStart,Vt))},e.prototype.shouldCancelEvent=function(t,e){switch(t.type){case"wheel":case"scroll":return It(e,t,t.deltaY);case"touchmove":return It(e,t,this.touchStart-Lt(t))}return!1},e.prototype.render=function(){var t=this.props,e=t.forwardProps,n=t.children,r=t.className,o=t.removeScrollBar,i=t.enabled,a={ref:this.ref,onScrollCapture:this.scrollWheel,onWheelCapture:this.scrollWheel,onTouchMoveCapture:this.scrollTouchMove};return u.createElement(u.Fragment,null,o&&i&&u.createElement(Ft,{gapMode:"margin"}),e?u.cloneElement(u.Children.only(n),a):u.createElement("div",Ct({},a,{className:r}),n))},e.classNames=Nt,e.defaultProps={enabled:!0,removeScrollBar:!0},e.stack=[],e}(u.Component),qt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};function zt(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}var Gt=function(){},Kt=function(){},$t=function(t){var e,n,r;t.disposeAriaHider=(e=t.overlayNode,n=[],r=[],Array.prototype.forEach.call(document.querySelectorAll("body > *"),function(t){if(t!==e.parentNode){var o=t.getAttribute("aria-hidden");null!==o&&"false"!==o||(n.push(o),r.push(t),t.setAttribute("aria-hidden","true"))}}),function(){r.forEach(function(t,e){var r=n[e];null===r?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden",r)})})},Ht=function(t){t.refs.disposeAriaHider()},Yt=(l.a.createContext(),l.a.forwardRef(function(t,e){var n=t.isOpen,r=void 0===n||n,o=t.onDismiss,i=void 0===o?Gt:o,a=t.initialFocusRef,s=t.onClick,c=t.onKeyDown,u=zt(t,["isOpen","onDismiss","initialFocusRef","onClick","onKeyDown"]);return l.a.createElement(m,{didMount:Kt},r?l.a.createElement(y,{"data-reach-dialog-wrapper":!0},l.a.createElement(m,{refs:{overlayNode:null},didMount:function(t){var e=t.refs;$t(e)},willUnmount:Ht},function(t){var n=t.refs;return l.a.createElement(St,{returnFocus:!0,onActivation:function(){a&&a.current.focus()}},l.a.createElement(Wt,null,l.a.createElement("div",qt({"data-reach-dialog-overlay":!0,onClick:g(s,function(t){t.stopPropagation(),i()}),onKeyDown:g(c,function(t){"Escape"===t.key&&(t.stopPropagation(),i())}),ref:function(t){n.overlayNode=t,e&&e(t)}},u))))})):null)}));Yt.propTypes={initialFocusRef:function(){}};var Qt=function(t){return t.stopPropagation()},Jt=l.a.forwardRef(function(t,e){var n=t.onClick,r=(t.onKeyDown,zt(t,["onClick","onKeyDown"]));return l.a.createElement("div",qt({"aria-modal":"true","data-reach-dialog-content":!0,tabIndex:"-1",onClick:g(n,Qt),ref:function(t){e&&e(t)}},r))}),Zt=(n(20),function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()),Xt=function(t){var e=Object(o.useState)(!1),n=Zt(e,2),r=n[0],i=n[1];return[function(){return i(!0)},Object(o.createElement)(c.Transition,{items:r,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)(Yt,{style:{opacity:e.opacity},onDismiss:function(){return i(!1)}},Object(o.createElement)(Jt,{style:{transform:"translate3d(0px, "+e.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:t.readme}})))}})]},te=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();var ee=function(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},i=Object(o.useState)(!1),a=te(i,2),s=a[0],c=a[1];return[s,(e=regeneratorRuntime.mark(function e(){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return(n=new FormData).append("ext",t.name),n.append("action",t.__object?"blocksy_extension_deactivate":"blocksy_extension_activate"),c(!0),e.prev=4,e.next=7,fetch(ctDashboardLocalizations.ajax_url,{method:"POST",body:n});case 7:r(),e.next=12;break;case 10:e.prev=10,e.t0=e.catch(4);case 12:return e.next=14,new Promise(function(t){return setTimeout(function(){return t()},1e3)});case 14:c(!1);case 15:case"end":return e.stop()}},e,void 0,[[4,10]])}),n=function(){var t=e.apply(this,arguments);return new Promise(function(e,n){return function r(o,i){try{var a=t[o](i),s=a.value}catch(t){return void n(t)}if(!a.done)return Promise.resolve(s).then(function(t){r("next",t)},function(t){r("throw",t)});e(s)}("next")})},function(){return n.apply(this,arguments)})]},ne=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();var re=null,oe=function(t){var e=t.extension,n=t.onExtsSync,r=Xt(e),a=ne(r,2),c=a[0],u=a[1],l=ee(e,function(){n()}),d=ne(l,2),p=d[0],f=d[1];return Object(o.createElement)("li",{className:s()({active:!!e.__object})},Object(o.createElement)("h4",{className:"ct-extension-title"},e.config.name),e.config.description&&Object(o.createElement)("div",{className:"ct-extension-description"},e.config.description),Object(o.createElement)("div",{className:"ct-extension-actions"},Object(o.createElement)("button",{className:"ct-button","data-button":"white",disabled:p,onClick:function(){return f()}},p?Object(i.__)("Loading"):e.__object?Object(i.__)("Deactivate"):Object(i.__)("Activate")),e.readme&&Object(o.createElement)("button",{onClick:function(){return c()},"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"})))),u)},ie=function(){var t,e,n=Object(o.useState)(!re),r=ne(n,2),a=r[0],s=r[1],c=Object(o.useState)(re||[]),u=ne(c,2),l=u[0],d=u[1],p=(t=regeneratorRuntime.mark(function t(){var e,n,r,o,i,a=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return a&&s(!0),(e=new FormData).append("action","blocksy_extensions_status"),t.prev=3,t.next=6,fetch(ctDashboardLocalizations.ajax_url,{method:"POST",body:e});case 6:if(200!==(n=t.sent).status){t.next=14;break}return t.next=10,n.json();case 10:r=t.sent,o=r.success,i=r.data,o&&(d(i),re=i);case 14:t.next=18;break;case 16:t.prev=16,t.t0=t.catch(3);case 18:s(!1);case 19:case"end":return t.stop()}},t,void 0,[[3,16]])}),e=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(t){return void n(t)}if(!a.done)return Promise.resolve(s).then(function(t){r("next",t)},function(t){r("throw",t)});t(s)}("next")})},function(){return e.apply(this,arguments)});Object(o.useEffect)(function(){p(!re)},[]);var f=Object.values(l).map(function(t,e){return t.name=Object.keys(l)[e],t});return Object(o.createElement)("div",{className:"ct-extensions-list"},a&&Object(o.createElement)("p",{className:"ct-loading-text"},Object(i.__)("Loading Extensions Status...")),!a&&f.length>0&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)("div",{className:"ct-info"},Object(o.createElement)("i",null),Object(o.createElement)("p",null,Object(i.__)("Supercharge your website with the help of this extensions. Display your Instagram feed, add a Trending Posts widget, collect subscribers and more..."))),Object(o.createElement)("ul",null,f.map(function(t){var e={extension:oe};return ctEvents.trigger("ct:extensions:card",{CustomComponent:e,extension:t}),Object(o.createElement)(e.extension,{key:t.name,extension:t,onExtsSync:function(){return p()}})}))))};ctEvents.on("ct:dashboard:routes",function(t){return t.push({Component:function(){return Object(o.createElement)(ie,null)},path:"/extensions"})}),ctEvents.on("ct:dashboard:navigation-links",function(t){return t.push({text:Object(i.__)("Extensions"),path:"/extensions"})})}]);
static/img/extensions.svg ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 23.0.3, 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 90 90" style="enable-background:new 0 0 90 90;" xml:space="preserve">
5
+ <style type="text/css">
6
+ .st0{clip-path:url(#SVGID_2_);fill:#F3F6F8;}
7
+ .st1{fill:#0C7AB3;}
8
+ .st2{fill:#3497D3;}
9
+ .st3{fill:#DBE7EE;}
10
+ .st4{fill:#BDC8D7;}
11
+ .st5{fill:#44ACDF;}
12
+ </style>
13
+ <g>
14
+ <g>
15
+ <defs>
16
+ <rect id="SVGID_1_" width="90" height="90"/>
17
+ </defs>
18
+ <clipPath id="SVGID_2_">
19
+ <use xlink:href="#SVGID_1_" style="overflow:visible;"/>
20
+ </clipPath>
21
+ <circle class="st0" cx="45" cy="45" r="45"/>
22
+ </g>
23
+ </g>
24
+ <ellipse class="st1" cx="45" cy="28.3" rx="5" ry="3.3"/>
25
+ <ellipse class="st2" cx="56.7" cy="33.3" rx="5" ry="3.3"/>
26
+ <ellipse class="st2" cx="33.3" cy="33.3" rx="5" ry="3.3"/>
27
+ <path class="st3" d="M25,56c0,1.4,0.9,2.7,2.2,3.1L43.3,65V45L25,38.3V56z"/>
28
+ <path class="st4" d="M46.7,45v20l16.1-5.9c1.3-0.5,2.2-1.7,2.2-3.1V38.3L46.7,45z"/>
29
+ <ellipse class="st5" cx="45" cy="38.3" rx="5" ry="3.3"/>
30
+ </svg>
static/js/helpers/useActivationAction.js ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {
2
+ createElement,
3
+ Component,
4
+ useEffect,
5
+ useState,
6
+ Fragment
7
+ } from '@wordpress/element'
8
+
9
+ const useActivationAction = (extension, cb = () => {}) => {
10
+ const [isLoading, setIsLoading] = useState(false)
11
+
12
+ const makeAction = async () => {
13
+ const body = new FormData()
14
+
15
+ body.append('ext', extension.name)
16
+ body.append(
17
+ 'action',
18
+ extension.__object
19
+ ? 'blocksy_extension_deactivate'
20
+ : 'blocksy_extension_activate'
21
+ )
22
+
23
+ setIsLoading(true)
24
+
25
+ try {
26
+ await fetch(ctDashboardLocalizations.ajax_url, {
27
+ method: 'POST',
28
+ body
29
+ })
30
+
31
+ cb()
32
+ } catch (e) {}
33
+
34
+ await new Promise(r => setTimeout(() => r(), 1000))
35
+
36
+ setIsLoading(false)
37
+ }
38
+
39
+ return [isLoading, makeAction]
40
+ }
41
+
42
+ export default useActivationAction
static/js/helpers/useExtensionReadme.js ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {
2
+ createElement,
3
+ Component,
4
+ useEffect,
5
+ useState,
6
+ Fragment
7
+ } from '@wordpress/element'
8
+ import { Transition } from 'react-spring/renderprops'
9
+ import { Dialog, DialogOverlay, DialogContent } from '@reach/dialog'
10
+ import '@reach/dialog/styles.css'
11
+
12
+ const useExtensionReadme = extension => {
13
+ const [showReadme, setIsShowingReadme] = useState(false)
14
+
15
+ return [
16
+ () => setIsShowingReadme(true),
17
+
18
+ <Transition
19
+ items={showReadme}
20
+ config={{ duration: 200 }}
21
+ from={{ opacity: 0, y: -10 }}
22
+ enter={{ opacity: 1, y: 0 }}
23
+ leave={{ opacity: 0, y: 10 }}>
24
+ {showReadme =>
25
+ showReadme &&
26
+ (props => (
27
+ <DialogOverlay
28
+ style={{ opacity: props.opacity }}
29
+ onDismiss={() => setIsShowingReadme(false)}>
30
+ <DialogContent
31
+ style={{
32
+ transform: `translate3d(0px, ${props.y}px, 0px)`
33
+ }}>
34
+ <button
35
+ className="close-button"
36
+ onClick={() => setIsShowingReadme(false)}>
37
+ ×
38
+ </button>
39
+ <div
40
+ className="ct-extension-readme"
41
+ dangerouslySetInnerHTML={{
42
+ __html: extension.readme
43
+ }}
44
+ />
45
+ </DialogContent>
46
+ </DialogOverlay>
47
+ ))
48
+ }
49
+ </Transition>
50
+ ]
51
+ }
52
+
53
+ export default useExtensionReadme
static/js/screens/Extensions.js CHANGED
@@ -2,42 +2,25 @@ import {
2
  createElement,
3
  Component,
4
  useEffect,
5
- useState
 
6
  } from '@wordpress/element'
7
  import { __ } from 'ct-i18n'
8
  import classnames from 'classnames'
 
 
9
 
10
  let exts_status_cache = null
11
 
12
  const Extension = ({ extension, onExtsSync }) => {
13
- const [isLoading, setIsLoading] = useState(false)
14
-
15
- const makeAction = async (ext, actionName) => {
16
- const body = new FormData()
17
- body.append('ext', ext)
18
- body.append('action', actionName)
19
-
20
- setIsLoading(true)
21
-
22
- try {
23
- await fetch(ctDashboardLocalizations.ajax_url, {
24
- method: 'POST',
25
- body
26
- })
27
-
28
- onExtsSync()
29
- } catch (e) {}
30
-
31
- await new Promise(r => setTimeout(() => r(), 1000))
32
-
33
- setIsLoading(false)
34
- }
35
 
36
  return (
37
- <li>
38
- <h4 className="ct-extension-title">
39
- {extension.config.name}
40
- </h4>
41
 
42
  {extension.config.description && (
43
  <div className="ct-extension-description">
@@ -50,19 +33,27 @@ const Extension = ({ extension, onExtsSync }) => {
50
  className="ct-button"
51
  data-button="white"
52
  disabled={isLoading}
53
- onClick={() =>
54
- makeAction(
55
- extension.name,
56
- extension.__object
57
- ? 'blocksy_extension_deactivate'
58
- : 'blocksy_extension_activate'
59
- )
60
- }>
61
  {isLoading
62
  ? __('Loading')
63
- : extension.__object ? __('Deactivate') : __('Activate')}
 
 
64
  </button>
 
 
 
 
 
 
 
 
 
 
 
65
  </div>
 
 
66
  </li>
67
  )
68
  }
@@ -117,15 +108,38 @@ const Extensions = () => {
117
 
118
  {!isLoading &&
119
  exts.length > 0 && (
120
- <ul>
121
- {exts.map(ext => (
122
- <Extension
123
- key={ext.name}
124
- extension={ext}
125
- onExtsSync={() => syncExts()}
126
- />
127
- ))}
128
- </ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  )}
130
  </div>
131
  )
2
  createElement,
3
  Component,
4
  useEffect,
5
+ useState,
6
+ Fragment
7
  } from '@wordpress/element'
8
  import { __ } from 'ct-i18n'
9
  import classnames from 'classnames'
10
+ import useExtensionReadme from '../helpers/useExtensionReadme'
11
+ import useActivationAction from '../helpers/useActivationAction'
12
 
13
  let exts_status_cache = null
14
 
15
  const Extension = ({ extension, onExtsSync }) => {
16
+ const [showReadme, readme] = useExtensionReadme(extension)
17
+ const [isLoading, activationAction] = useActivationAction(extension, () => {
18
+ onExtsSync()
19
+ })
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  return (
22
+ <li className={classnames({ active: !!extension.__object })}>
23
+ <h4 className="ct-extension-title">{extension.config.name}</h4>
 
 
24
 
25
  {extension.config.description && (
26
  <div className="ct-extension-description">
33
  className="ct-button"
34
  data-button="white"
35
  disabled={isLoading}
36
+ onClick={() => activationAction()}>
 
 
 
 
 
 
 
37
  {isLoading
38
  ? __('Loading')
39
+ : extension.__object
40
+ ? __('Deactivate')
41
+ : __('Activate')}
42
  </button>
43
+
44
+ {extension.readme && (
45
+ <button
46
+ onClick={() => showReadme()}
47
+ data-button="white"
48
+ className="ct-minimal-button ct-instruction">
49
+ <svg width="16" height="16" viewBox="0 0 24 24">
50
+ <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" />
51
+ </svg>
52
+ </button>
53
+ )}
54
  </div>
55
+
56
+ {readme}
57
  </li>
58
  )
59
  }
108
 
109
  {!isLoading &&
110
  exts.length > 0 && (
111
+ <Fragment>
112
+ <div className="ct-info">
113
+ <i />
114
+
115
+ <p>
116
+ {__(
117
+ 'Supercharge your website with the help of this extensions. Display your Instagram feed, add a Trending Posts widget, collect subscribers and more...'
118
+ )}
119
+ </p>
120
+ </div>
121
+
122
+ <ul>
123
+ {exts.map(ext => {
124
+ let CustomComponent = {
125
+ extension: Extension
126
+ }
127
+
128
+ ctEvents.trigger('ct:extensions:card', {
129
+ CustomComponent,
130
+ extension: ext
131
+ })
132
+
133
+ return (
134
+ <CustomComponent.extension
135
+ key={ext.name}
136
+ extension={ext}
137
+ onExtsSync={() => syncExts()}
138
+ />
139
+ )
140
+ })}
141
+ </ul>
142
+ </Fragment>
143
  )}
144
  </div>
145
  )
static/sass/common-frontend.scss ADDED
@@ -0,0 +1,2 @@
 
 
1
+ @import '../../themes/blocksy/static/sass/frontend/utilities/mixins';
2
+ @import '../../themes/blocksy/static/sass/frontend/utilities/responsive-breakpoints';
static/sass/dashboard.scss CHANGED
@@ -1 +1 @@
1
- @import 'extensions';
1
+ @import 'extensions/main';
static/sass/extensions/extensions-config.scss ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ct-extension-config {
2
+ display: flex;
3
+ flex-direction: column;
4
+ justify-content: center;
5
+ padding: 30px;
6
+ }
7
+
8
+ .ct-config-btn {
9
+ font-size: 16px;
10
+ margin-left: auto;
11
+ }
12
+
13
+
14
+ .mailchimp-credentials {
15
+ display: flex;
16
+ margin: 10px 0 0 0;
17
+
18
+ li {
19
+ display: flex;
20
+ flex-direction: column;
21
+ justify-content: flex-end;
22
+ margin-bottom: 0;
23
+ // flex: 1;
24
+
25
+ &:not(:first-child) {
26
+ margin-left: 10px;
27
+ }
28
+ }
29
+
30
+ label {
31
+ display: block;
32
+ font-size: 12px;
33
+ margin-bottom: 3px;
34
+ opacity: 0.7;
35
+ }
36
+
37
+ input {
38
+ height: 35px;
39
+ border-radius: 2px;
40
+ margin: 0;
41
+ padding: 3px 5px 3px 10px;
42
+ }
43
+
44
+ .ct-select-input:after {
45
+ top: 16px;
46
+ }
47
+ }
static/sass/extensions/extensions-readme.scss ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ct-extension-readme {
2
+ text-align: left;
3
+ padding: 30px;
4
+
5
+ ul,
6
+ ol {
7
+ margin: 0;
8
+ padding-left: 20px;
9
+
10
+ li {
11
+ margin-bottom: 20px;
12
+
13
+ &:last-child {
14
+ margin-bottom: 0;
15
+ }
16
+
17
+ b {
18
+ display: inline-block;
19
+ margin-bottom: 10px;
20
+ }
21
+
22
+ i {
23
+ display: block;
24
+ color: #717a84;
25
+ }
26
+ }
27
+ }
28
+
29
+ ul {
30
+ list-style: initial;
31
+ }
32
+
33
+ code {
34
+ font-size: 12px;
35
+ font-style: normal;
36
+ padding: 3px 7px;
37
+ border-radius: 2px;
38
+ background: #f1f3f5;
39
+ }
40
+ }
static/sass/extensions/main.scss ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import 'extensions-readme';
2
+ @import 'extensions-config';
3
+
4
+ $extension-spacing: 25px;
5
+
6
+ .ct-extensions-list {
7
+ .ct-info {
8
+ display: flex;
9
+ align-items: center;
10
+
11
+ i {
12
+ flex: 0 0 90px;
13
+ width: 90px;
14
+ height: 90px;
15
+ margin-right: 20px;
16
+ background-image: url(../img/extensions.svg);
17
+ background-repeat: no-repeat;
18
+ }
19
+
20
+ p {
21
+ max-width: 600px;
22
+ }
23
+ }
24
+
25
+
26
+ ul {
27
+ display: grid;
28
+ grid-template-columns: repeat(3, 1fr);
29
+ grid-column-gap: 30px;
30
+ grid-row-gap: 30px;
31
+ margin: 50px 0 0 0;
32
+
33
+ li {
34
+ display: flex;
35
+ flex-direction: column;
36
+ margin: 0;
37
+ // padding: $extension-spacing 0;
38
+ border-radius: 3px;
39
+ border: 1px solid rgba(226, 230, 235, 0.7);
40
+ box-shadow: 0 2px 5px rgba(143, 163, 184, 0.12);
41
+ }
42
+ }
43
+
44
+ // active extensions
45
+ li.active {
46
+
47
+ }
48
+ }
49
+
50
+ .ct-extension-title {
51
+ margin: 30px 0 15px 0;
52
+ padding: 0 $extension-spacing;
53
+ }
54
+
55
+ .ct-extension-description {
56
+ font-size: 14px;
57
+ line-height: 1.7;
58
+ margin-bottom: 30px;
59
+ padding: 0 $extension-spacing;
60
+ }
61
+
62
+ .ct-extension-actions {
63
+ display: flex;
64
+ justify-content: space-between;
65
+ margin-top: auto;
66
+ padding: 20px #{$extension-spacing - 12px} 20px $extension-spacing;
67
+ border-top: 1px solid rgba(226, 230, 235, 0.7);
68
+ }
69
+
70
+ .ct-minimal-button {
71
+ display: flex;
72
+ align-items: center;
73
+ justify-content: center;
74
+ width: 35px;
75
+ height: 35px;
76
+ appearance: none;
77
+ border: none;
78
+ padding: 0;
79
+ color: inherit;
80
+ cursor: pointer;
81
+
82
+ &:hover {
83
+ color: #0085ba;
84
+ }
85
+
86
+ &:focus {
87
+ outline: none;
88
+ }
89
+
90
+ svg {
91
+ fill: currentColor;
92
+ }
93
+ }