EmbedPress – Embed Google Docs, YouTube, Maps, Vimeo, Wistia Videos & Upload PDF, PPT in Gutenberg & Elementor - Version 2.6.2

Version Description

Download this release

Release Info

Developer Asif2BD
Plugin Icon wp plugin EmbedPress – Embed Google Docs, YouTube, Maps, Vimeo, Wistia Videos & Upload PDF, PPT in Gutenberg & Elementor
Version 2.6.2
Comparing to
See all releases

Code changes from version 2.6.1 to 2.6.2

EmbedPress/Core.php CHANGED
@@ -359,6 +359,7 @@ class Core {
359
  [
360
  'methods' => \WP_REST_Server::READABLE,
361
  'callback' => ['\\EmbedPress\\RestAPI', 'oembed'],
 
362
  ]
363
  );
364
  }
359
  [
360
  'methods' => \WP_REST_Server::READABLE,
361
  'callback' => ['\\EmbedPress\\RestAPI', 'oembed'],
362
+ 'permission_callback' => '__return_true',
363
  ]
364
  );
365
  }
EmbedPress/Ends/Back/Handler.php CHANGED
@@ -36,7 +36,7 @@ class Handler extends EndHandlerAbstract {
36
  wp_enqueue_script( 'embedpress-pdfobject', EMBEDPRESS_URL_ASSETS . 'js/pdfobject.min.js', [],
37
  $this->pluginVersion, false );
38
  wp_enqueue_script( "bootbox-bootstrap", EMBEDPRESS_URL_ASSETS . 'js/vendor/bootstrap/bootstrap.min.js',
39
- [ 'jquery' ], $this->pluginVersion, true );
40
  wp_enqueue_script( "bootbox", EMBEDPRESS_URL_ASSETS . 'js/vendor/bootbox.min.js',
41
  [ 'jquery', 'bootbox-bootstrap' ], $this->pluginVersion, true );
42
  wp_enqueue_script( $this->pluginName, EMBEDPRESS_URL_ASSETS . 'js/preview.js', [ 'jquery', 'bootbox' ],
@@ -430,6 +430,6 @@ class Handler extends EndHandlerAbstract {
430
  */
431
  public static function embedpress_notice_dismiss() {
432
  check_ajax_referer( 'embedpress', 'security' );
433
- update_option( 'embedpress_dismiss_notice', true );
434
  }
435
  }
36
  wp_enqueue_script( 'embedpress-pdfobject', EMBEDPRESS_URL_ASSETS . 'js/pdfobject.min.js', [],
37
  $this->pluginVersion, false );
38
  wp_enqueue_script( "bootbox-bootstrap", EMBEDPRESS_URL_ASSETS . 'js/vendor/bootstrap/bootstrap.min.js',
39
+ [ 'jquery' ], $this->pluginVersion, false );
40
  wp_enqueue_script( "bootbox", EMBEDPRESS_URL_ASSETS . 'js/vendor/bootbox.min.js',
41
  [ 'jquery', 'bootbox-bootstrap' ], $this->pluginVersion, true );
42
  wp_enqueue_script( $this->pluginName, EMBEDPRESS_URL_ASSETS . 'js/preview.js', [ 'jquery', 'bootbox' ],
430
  */
431
  public static function embedpress_notice_dismiss() {
432
  check_ajax_referer( 'embedpress', 'security' );
433
+ update_option( 'embedpress_social_dismiss_notice', true );
434
  }
435
  }
EmbedPress/Ends/Back/Settings.php CHANGED
@@ -139,6 +139,21 @@ class Settings {
139
  ];
140
  }
141
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  $fieldMap['forceFacebookLanguage'] = [
143
  'label' => "Facebook embed language",
144
  'section' => "admin",
@@ -200,8 +215,8 @@ class Settings {
200
  </h1>
201
  <div class="embedpress-version-name">
202
  <span class="free">Core Version: <?php echo EMBEDPRESS_VERSION; ?></span>
203
-
204
- <?php if ( defined('EMBEDPRESS_PRO_PLUGIN_VERSION')) { ?>
205
  <span class="pro"> Pro Version: <?php echo EMBEDPRESS_PRO_PLUGIN_VERSION; ?></span>
206
  <?php } ?>
207
  </div>
@@ -214,11 +229,11 @@ class Settings {
214
  class="nav-tab<?php echo $activeTab === 'embedpress' || empty( $activeTab ) ? ' nav-tab-active' : ''; ?> ">
215
  General settings
216
  </a>
217
- <?php if(!defined('EMBEDPRESS_PRO_PLUGIN_VERSION')): ?>
218
- <a href="?page=embedpress&tab=embedpress_get_pro"
219
- class="nav-tab<?php echo $activeTab === 'embedpress_get_pro' ? ' nav-tab-active' : ''; ?> ">
220
- Go Premium
221
- </a>
222
  <?php endif; ?>
223
  <?php do_action( 'embedpress:settings:render:tab', $activeTab ); ?>
224
  <?php do_action( 'embedpress_license_tab', $activeTab ); ?>
@@ -237,21 +252,24 @@ class Settings {
237
  <?php if ( $activeTab == 'embedpress_license' ) : ?>
238
  <?php echo do_action( 'embedpress_license' ); ?>
239
  <?php endif; ?>
240
- <?php if ( $activeTab == 'embedpress_get_pro' && !defined('EMBEDPRESS_PRO_PLUGIN_VERSION') ) : ?>
241
  <div class=" embedpress-go-premium">
242
  <div class="embedpress-col-half">
243
  <div class="embedpress-admin-block-wrapper">
244
  <div class="embedpress-admin-block embedpress-admin-block-docs">
245
  <header class="embedpress-admin-block-header">
246
  <div class="embedpress-admin-block-header-icon">
247
- <img src="<?php echo plugins_url( 'assets/images/icon-why-premium.svg', EMBEDPRESS_PLUGIN_BASENAME ); ?>" alt="embedpress-go-pro">
 
248
  </div>
249
  <h4 class="embedpress-admin-title">Why upgrade to Premium Version?</h4>
250
  </header>
251
  <div class="embedpress-admin-block-content">
252
- <p>The premium version helps us to continue development of the product incorporating even more features and enhancements.</p>
 
253
  <p>You will also get world class support from our dedicated team, 24/7.</p>
254
- <a href="https://wpdeveloper.net/plugins/embedpress#pricing" target="_blank" class="button embedpress-btn">Get Pro Version</a>
 
255
  </div>
256
  </div>
257
  </div><!--admin block-wrapper end-->
@@ -307,7 +325,8 @@ class Settings {
307
  </nav>
308
  <p>
309
  <a href="//embedpress.com" target="_blank" rel="noopener noreferrer">
310
- <img width="100" src="<?php echo plugins_url( 'assets/images/embedpress.png', EMBEDPRESS_PLUGIN_BASENAME ); ?>">
 
311
  </a>
312
  </p>
313
  </footer>
@@ -332,6 +351,8 @@ class Settings {
332
  'enableGlobalEmbedResize' => isset( $freshData['enableGlobalEmbedResize'] ) ? (bool)$freshData['enableGlobalEmbedResize'] : false,
333
  'enableEmbedResizeHeight' => isset( $freshData['enableEmbedResizeHeight'] ) ? $freshData['enableEmbedResizeHeight'] : 552,
334
  'enableEmbedResizeWidth' => isset( $freshData['enableEmbedResizeWidth'] ) ? $freshData['enableEmbedResizeWidth'] : 652,
 
 
335
  'fbLanguage' => $freshData['fbLanguage'],
336
  ];
337
 
@@ -428,6 +449,53 @@ class Settings {
428
  echo '<p class="description">Global Embed Iframe Width </p></span>';
429
  }
430
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
431
  /**
432
  * Method that renders the forceFacebookLanguage input.
433
  *
139
  ];
140
  }
141
 
142
+ $fieldMap['heading_settings'] = [
143
+ 'label' => " ",
144
+ 'section' => "admin",
145
+ ];
146
+
147
+ $fieldMap['facebook_app_code'] = [
148
+ 'label' => "App Code",
149
+ 'section' => "admin",
150
+ ];
151
+
152
+ $fieldMap['facebook_app_secret'] = [
153
+ 'label' => "App Secret",
154
+ 'section' => "admin",
155
+ ];
156
+
157
  $fieldMap['forceFacebookLanguage'] = [
158
  'label' => "Facebook embed language",
159
  'section' => "admin",
215
  </h1>
216
  <div class="embedpress-version-name">
217
  <span class="free">Core Version: <?php echo EMBEDPRESS_VERSION; ?></span>
218
+
219
+ <?php if ( defined( 'EMBEDPRESS_PRO_PLUGIN_VERSION' ) ) { ?>
220
  <span class="pro"> Pro Version: <?php echo EMBEDPRESS_PRO_PLUGIN_VERSION; ?></span>
221
  <?php } ?>
222
  </div>
229
  class="nav-tab<?php echo $activeTab === 'embedpress' || empty( $activeTab ) ? ' nav-tab-active' : ''; ?> ">
230
  General settings
231
  </a>
232
+ <?php if ( !defined( 'EMBEDPRESS_PRO_PLUGIN_VERSION' ) ): ?>
233
+ <a href="?page=embedpress&tab=embedpress_get_pro"
234
+ class="nav-tab<?php echo $activeTab === 'embedpress_get_pro' ? ' nav-tab-active' : ''; ?> ">
235
+ Go Premium
236
+ </a>
237
  <?php endif; ?>
238
  <?php do_action( 'embedpress:settings:render:tab', $activeTab ); ?>
239
  <?php do_action( 'embedpress_license_tab', $activeTab ); ?>
252
  <?php if ( $activeTab == 'embedpress_license' ) : ?>
253
  <?php echo do_action( 'embedpress_license' ); ?>
254
  <?php endif; ?>
255
+ <?php if ( $activeTab == 'embedpress_get_pro' && !defined( 'EMBEDPRESS_PRO_PLUGIN_VERSION' ) ) : ?>
256
  <div class=" embedpress-go-premium">
257
  <div class="embedpress-col-half">
258
  <div class="embedpress-admin-block-wrapper">
259
  <div class="embedpress-admin-block embedpress-admin-block-docs">
260
  <header class="embedpress-admin-block-header">
261
  <div class="embedpress-admin-block-header-icon">
262
+ <img src="<?php echo plugins_url( 'assets/images/icon-why-premium.svg',
263
+ EMBEDPRESS_PLUGIN_BASENAME ); ?>" alt="embedpress-go-pro">
264
  </div>
265
  <h4 class="embedpress-admin-title">Why upgrade to Premium Version?</h4>
266
  </header>
267
  <div class="embedpress-admin-block-content">
268
+ <p>The premium version helps us to continue development of the product
269
+ incorporating even more features and enhancements.</p>
270
  <p>You will also get world class support from our dedicated team, 24/7.</p>
271
+ <a href="https://wpdeveloper.net/plugins/embedpress#pricing" target="_blank"
272
+ class="button embedpress-btn">Get Pro Version</a>
273
  </div>
274
  </div>
275
  </div><!--admin block-wrapper end-->
325
  </nav>
326
  <p>
327
  <a href="//embedpress.com" target="_blank" rel="noopener noreferrer">
328
+ <img width="100" src="<?php echo plugins_url( 'assets/images/embedpress.png',
329
+ EMBEDPRESS_PLUGIN_BASENAME ); ?>">
330
  </a>
331
  </p>
332
  </footer>
351
  'enableGlobalEmbedResize' => isset( $freshData['enableGlobalEmbedResize'] ) ? (bool)$freshData['enableGlobalEmbedResize'] : false,
352
  'enableEmbedResizeHeight' => isset( $freshData['enableEmbedResizeHeight'] ) ? $freshData['enableEmbedResizeHeight'] : 552,
353
  'enableEmbedResizeWidth' => isset( $freshData['enableEmbedResizeWidth'] ) ? $freshData['enableEmbedResizeWidth'] : 652,
354
+ 'facebook_app_code' => isset( $freshData['facebook_app_code'] ) ? $freshData['facebook_app_code'] : 652,
355
+ 'facebook_app_secret' => isset( $freshData['facebook_app_secret'] ) ? $freshData['facebook_app_secret'] : 652,
356
  'fbLanguage' => $freshData['fbLanguage'],
357
  ];
358
 
449
  echo '<p class="description">Global Embed Iframe Width </p></span>';
450
  }
451
 
452
+ /**
453
+ * Method that renders the forceFacebookLanguage input.
454
+ *
455
+ * @since 1.3.0
456
+ * @static
457
+ */
458
+ public static function renderField_facebook_app_code() {
459
+ $fieldName = "facebook_app_code";
460
+
461
+ $options = get_option( self::$sectionGroupIdentifier );
462
+
463
+ $options[$fieldName] = !isset( $options[$fieldName] ) ? "" : $options[$fieldName];
464
+
465
+ $facebookLocales = self::getFacebookAvailableLocales();
466
+
467
+ echo '<span><input type="text" value="' . $options[$fieldName] . '" class="regular-text" name="' . self::$sectionGroupIdentifier . '[' . $fieldName . ']">';
468
+ }
469
+
470
+ /**
471
+ * Method that renders the forceFacebookLanguage input.
472
+ *
473
+ * @since 1.3.0
474
+ * @static
475
+ */
476
+ public static function renderField_heading_settings() {
477
+ printf( "<h2>%s</h2>", esc_html__( 'Facebook and Instagram Embed Settings', 'embedpress' ) );
478
+ printf( __( '<p>Starting October 24th, due to changes in Facebook API, you will need Facebook Developer app credentials to embed Facebook & Instagram content on your WordPress website. You need to <a class="embedpress-settings-link" href="%s" target="_blank" rel="noopener noreferrer">register a Facebook app</a>, enable <a class="embedpress-settings-link" href="%s">oEmbed</a>, and add its `App ID` & `App secret` in the fields below.</p>', "embedpress" ), esc_url( 'https://developers.facebook.com/apps/' ), esc_url( 'https://developers.facebook.com/docs/plugins/oembed' ) );
479
+ printf( __( '<p>For more details, check out this documentation <a class="embedpress-settings-link" href="%s">Here</a></p>', 'embedpress' ), esc_url( 'https://embedpress.com/docs/how-to-connect-facebook-instagram-embedpress/' ) );
480
+ }
481
+
482
+ /**
483
+ * Method that renders the forceFacebookLanguage input.
484
+ *
485
+ * @since 1.3.0
486
+ * @static
487
+ */
488
+ public static function renderField_facebook_app_secret() {
489
+ $fieldName = "facebook_app_secret";
490
+
491
+ $options = get_option( self::$sectionGroupIdentifier );
492
+
493
+ $options[$fieldName] = !isset( $options[$fieldName] ) ? "" : $options[$fieldName];
494
+
495
+
496
+ echo '<span><input type="text" value="' . $options[$fieldName] . '" class="regular-text" name="' . self::$sectionGroupIdentifier . '[' . $fieldName . ']">';
497
+ }
498
+
499
  /**
500
  * Method that renders the forceFacebookLanguage input.
501
  *
EmbedPress/Includes/Traits/Shared.php CHANGED
@@ -1,7 +1,8 @@
1
  <?php
 
2
  namespace EmbedPress\Includes\Traits;
3
 
4
- if (!defined('ABSPATH')) {
5
  exit;
6
  } // Exit if accessed directly
7
  use \EmbedPress\Includes\Classes\EmbedPress_Plugin_Usage_Tracker;
@@ -27,7 +28,7 @@ trait Shared {
27
  }
28
 
29
  public function admin_notice() {
30
- $notice = new EmbedPress_Notice(EMBEDPRESS_PLUGIN_BASENAME, EMBEDPRESS_VERSION);
31
 
32
  /**
33
  * Current Notice End Time.
@@ -43,42 +44,42 @@ trait Shared {
43
 
44
  $notice->text_domain = 'embedpress';
45
 
46
- $scheme = (parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY)) ? '&' : '?';
47
- $url = $_SERVER['REQUEST_URI'] . $scheme;
48
  $notice->links = [
49
  'review' => array(
50
- 'later' => array(
51
- 'link' => 'https://wordpress.org/support/plugin/embedpress/reviews/',
52
- 'target' => '_blank',
53
- 'label' => __('Ok, you deserve it!', 'embedpress'),
54
  'icon_class' => 'dashicons dashicons-external',
55
  ),
56
- 'allready' => array(
57
- 'link' => $url,
58
- 'label' => __('I already did', 'embedpress'),
59
  'icon_class' => 'dashicons dashicons-smiley',
60
- 'data_args' => [
61
  'dismiss' => true,
62
  ],
63
  ),
64
- 'maybe_later' => array(
65
- 'link' => $url,
66
- 'label' => __('Maybe Later', 'embedpress'),
67
  'icon_class' => 'dashicons dashicons-calendar-alt',
68
- 'data_args' => [
69
  'later' => true,
70
  ],
71
  ),
72
- 'support' => array(
73
- 'link' => 'https://wordpress.org/support/plugin/embedpress/',
74
- 'label' => __('I need help', 'embedpress'),
75
  'icon_class' => 'dashicons dashicons-sos',
76
  ),
77
  'never_show_again' => array(
78
- 'link' => $url,
79
- 'label' => __('Never show again', 'embedpress'),
80
  'icon_class' => 'dashicons dashicons-dismiss',
81
- 'data_args' => [
82
  'dismiss' => true,
83
  ],
84
  ),
@@ -88,21 +89,21 @@ trait Shared {
88
  /**
89
  * This is review message and thumbnail.
90
  */
91
- $notice->message('review', '<p>' . __('We hope you\'re enjoying EmbedPress! Could you please do us a BIG favor and give it a 5-star rating on WordPress to help us spread the word and boost our motivation?', 'embedpress') . '</p>');
92
- $notice->thumbnail('review', plugins_url('assets/images/icon-128x128.png', EMBEDPRESS_PLUGIN_BASENAME));
93
  /**
94
  * This is upsale notice settings
95
  * classes for wrapper,
96
  * Message message for showing.
97
  */
98
  $notice->classes( 'upsale', 'notice is-dismissible ' );
99
- $notice->message( 'upsale', '<p>'. __( 'If you are using Gutenberg, you must install <a href="https://essential-blocks.com/" target="_blank">Essential Blocks</a>, it extends your capacity, with 22 Free Blocks!', $notice->text_domain ) .'</p>' );
100
  $notice->thumbnail( 'upsale', plugins_url( 'assets/images/essential-blocks.png', EMBEDPRESS_PLUGIN_BASENAME ) );
101
 
102
  // Update Notice For PRO Version
103
- if( $this->is_pro_active() && \version_compare( EMBEDPRESS_PRO_VERSION, '2.0.0', '<' ) ) {
104
  $notice->classes( 'update', 'notice is-dismissible ' );
105
- $notice->message( 'update', '<p>'. __( 'You are using an incompatible version of EmbedPress PRO. Please update to v3.4.0+. <a href="https://essential-addons.com/elementor/docs/manually-update-essential-addons-pro/" target="_blank">Follow manual update guide.</a>', $notice->text_domain ) .'</p>' );
106
  $notice->thumbnail( 'update', plugins_url( 'assets/images/icon-128x128.png', EMBEDPRESS_PLUGIN_BASENAME ) );
107
  }
108
 
@@ -110,9 +111,9 @@ trait Shared {
110
  'slug' => 'essential-blocks',
111
  'page_slug' => 'essential-blocks',
112
  'file' => 'essential-blocks.php',
113
- 'btn_text' => __( 'Install Free', 'embedpress'),
114
  'condition' => [
115
- 'by' => 'class',
116
  'class' => 'EssentialAdmin'
117
  ],
118
  );
@@ -120,19 +121,19 @@ trait Shared {
120
  $notice->options_args = array(
121
  'notice_will_show' => [
122
  'opt_in' => $notice->timestamp,
123
- 'upsale' => $notice->makeTime($notice->timestamp, '14 Day'),
124
- 'review' => $notice->makeTime($notice->timestamp, '7 Day'), // after 3 days
125
  ],
126
  );
127
- if( $this->is_pro_active() && \version_compare( EMBEDPRESS_PRO_VERSION, '2.0.0', '<' ) ) {
128
  $notice->options_args['notice_will_show']['update'] = $notice->timestamp;
129
  }
130
 
131
  $notice->init();
132
  }
133
 
134
- public function is_pro_active(){
135
- return is_plugin_active('embedpress-pro/embedpress-pro.php');
136
  }
137
 
138
  /**
@@ -140,27 +141,16 @@ trait Shared {
140
  *
141
  * @since 2.4.0
142
  */
143
- public function embedpress_admin_notice(){
144
 
145
- if (get_option( 'embedpress_dismiss_notice' ) == true || $this->is_pro_active() ) {
146
  return;
147
  }
148
 
149
- $plugin_list = [
150
- 'embedpress-vimeo/embedpress-vimeo.php',
151
- 'embedpress-wistia/embedpress-wistia.php',
152
- 'embedpress-youtube/embedpress-youtube.php',
153
- ];
154
- $active_plugins = get_option('active_plugins');
155
- foreach($active_plugins as $plugin){
156
- if(in_array($plugin,$plugin_list)){
157
- $msg = '<strong>[Good News]</strong> Introducing <strong>EmbedPress Pro</strong>! And as existing Loyal User you get Unlimited Sites access to EmbedPress Pro for free. Please update and claim your free license to continue. <br/><strong>[<a href="https://embedpress.com/ep-loyal-users" target="_blank" rel="noopener">Details</a>] - [<a href="https://embedpress.com/new-pro-2020-free" target="_blank" rel="noopener">Get EmbedPress Pro for Free</a>]</strong>';
158
- echo '<div class="notice notice-info embedpress-plugin-notice-dismissible is-dismissible">
159
- <p>'.$msg.'</p>
160
- </div>';
161
- break;
162
- }
163
- }
164
  }
165
 
166
  }
1
  <?php
2
+
3
  namespace EmbedPress\Includes\Traits;
4
 
5
+ if ( !defined( 'ABSPATH' ) ) {
6
  exit;
7
  } // Exit if accessed directly
8
  use \EmbedPress\Includes\Classes\EmbedPress_Plugin_Usage_Tracker;
28
  }
29
 
30
  public function admin_notice() {
31
+ $notice = new EmbedPress_Notice( EMBEDPRESS_PLUGIN_BASENAME, EMBEDPRESS_VERSION );
32
 
33
  /**
34
  * Current Notice End Time.
44
 
45
  $notice->text_domain = 'embedpress';
46
 
47
+ $scheme = (parse_url( $_SERVER['REQUEST_URI'], PHP_URL_QUERY )) ? '&' : '?';
48
+ $url = $_SERVER['REQUEST_URI'] . $scheme;
49
  $notice->links = [
50
  'review' => array(
51
+ 'later' => array(
52
+ 'link' => 'https://wordpress.org/support/plugin/embedpress/reviews/',
53
+ 'target' => '_blank',
54
+ 'label' => __( 'Ok, you deserve it!', 'embedpress' ),
55
  'icon_class' => 'dashicons dashicons-external',
56
  ),
57
+ 'allready' => array(
58
+ 'link' => $url,
59
+ 'label' => __( 'I already did', 'embedpress' ),
60
  'icon_class' => 'dashicons dashicons-smiley',
61
+ 'data_args' => [
62
  'dismiss' => true,
63
  ],
64
  ),
65
+ 'maybe_later' => array(
66
+ 'link' => $url,
67
+ 'label' => __( 'Maybe Later', 'embedpress' ),
68
  'icon_class' => 'dashicons dashicons-calendar-alt',
69
+ 'data_args' => [
70
  'later' => true,
71
  ],
72
  ),
73
+ 'support' => array(
74
+ 'link' => 'https://wordpress.org/support/plugin/embedpress/',
75
+ 'label' => __( 'I need help', 'embedpress' ),
76
  'icon_class' => 'dashicons dashicons-sos',
77
  ),
78
  'never_show_again' => array(
79
+ 'link' => $url,
80
+ 'label' => __( 'Never show again', 'embedpress' ),
81
  'icon_class' => 'dashicons dashicons-dismiss',
82
+ 'data_args' => [
83
  'dismiss' => true,
84
  ],
85
  ),
89
  /**
90
  * This is review message and thumbnail.
91
  */
92
+ $notice->message( 'review', '<p>' . __( 'We hope you\'re enjoying EmbedPress! Could you please do us a BIG favor and give it a 5-star rating on WordPress to help us spread the word and boost our motivation?', 'embedpress' ) . '</p>' );
93
+ $notice->thumbnail( 'review', plugins_url( 'assets/images/icon-128x128.png', EMBEDPRESS_PLUGIN_BASENAME ) );
94
  /**
95
  * This is upsale notice settings
96
  * classes for wrapper,
97
  * Message message for showing.
98
  */
99
  $notice->classes( 'upsale', 'notice is-dismissible ' );
100
+ $notice->message( 'upsale', '<p>' . __( 'If you are using Gutenberg, you must install <a href="https://essential-blocks.com/" target="_blank">Essential Blocks</a>, it extends your capacity, with 22 Free Blocks!', $notice->text_domain ) . '</p>' );
101
  $notice->thumbnail( 'upsale', plugins_url( 'assets/images/essential-blocks.png', EMBEDPRESS_PLUGIN_BASENAME ) );
102
 
103
  // Update Notice For PRO Version
104
+ if ( $this->is_pro_active() && \version_compare( EMBEDPRESS_PRO_VERSION, '2.0.0', '<' ) ) {
105
  $notice->classes( 'update', 'notice is-dismissible ' );
106
+ $notice->message( 'update', '<p>' . __( 'You are using an incompatible version of EmbedPress PRO. Please update to v3.4.0+. <a href="https://essential-addons.com/elementor/docs/manually-update-essential-addons-pro/" target="_blank">Follow manual update guide.</a>', $notice->text_domain ) . '</p>' );
107
  $notice->thumbnail( 'update', plugins_url( 'assets/images/icon-128x128.png', EMBEDPRESS_PLUGIN_BASENAME ) );
108
  }
109
 
111
  'slug' => 'essential-blocks',
112
  'page_slug' => 'essential-blocks',
113
  'file' => 'essential-blocks.php',
114
+ 'btn_text' => __( 'Install Free', 'embedpress' ),
115
  'condition' => [
116
+ 'by' => 'class',
117
  'class' => 'EssentialAdmin'
118
  ],
119
  );
121
  $notice->options_args = array(
122
  'notice_will_show' => [
123
  'opt_in' => $notice->timestamp,
124
+ 'upsale' => $notice->makeTime( $notice->timestamp, '14 Day' ),
125
+ 'review' => $notice->makeTime( $notice->timestamp, '7 Day' ), // after 3 days
126
  ],
127
  );
128
+ if ( $this->is_pro_active() && \version_compare( EMBEDPRESS_PRO_VERSION, '2.0.0', '<' ) ) {
129
  $notice->options_args['notice_will_show']['update'] = $notice->timestamp;
130
  }
131
 
132
  $notice->init();
133
  }
134
 
135
+ public function is_pro_active() {
136
+ return is_plugin_active( 'embedpress-pro/embedpress-pro.php' );
137
  }
138
 
139
  /**
141
  *
142
  * @since 2.4.0
143
  */
144
+ public function embedpress_admin_notice() {
145
 
146
+ if ( get_option( 'embedpress_social_dismiss_notice' ) == true ) {
147
  return;
148
  }
149
 
150
+ $msg = '<strong>Due to recent Facebook API changes, if you have embeded Facebook or Instagram link before, that won’t work. EmbedPress could help, configure <a href="'.admin_url( 'admin.php?page=embedpress' ).'">here</a>. [<a href="'.esc_url('https://embedpress.com/docs/how-to-connect-facebook-instagram-embedpress/').'">Read Details</a>] </strong>';
151
+ echo '<div class="notice notice-info embedpress-plugin-notice-dismissible is-dismissible">
152
+ <p>' . $msg . '</p>
153
+ </div>';
 
 
 
 
 
 
 
 
 
 
 
154
  }
155
 
156
  }
EmbedPress/Shortcode.php CHANGED
@@ -5,7 +5,7 @@ namespace EmbedPress;
5
  use Embera\Embera;
6
  use Embera\Formatter;
7
 
8
- (defined( 'ABSPATH' ) && defined( 'EMBEDPRESS_IS_LOADED' )) or die( "No direct script access allowed." );
9
 
10
  /**
11
  * Entity responsible to handle the plugin's shortcode events and behaviors.
@@ -27,7 +27,7 @@ class Shortcode {
27
  * @var string $oEmbedInstance
28
  */
29
  private static $oEmbedInstance = null;
30
-
31
  /**
32
  * Register the plugin's shortcode into WordPress.
33
  *
@@ -38,10 +38,10 @@ class Shortcode {
38
  */
39
  public static function register() {
40
  // Register the new shortcode for embeds.
41
- add_shortcode( EMBEDPRESS_SHORTCODE, [ '\\EmbedPress\\Shortcode', 'do_shortcode' ] );
42
- add_shortcode( 'embed_oembed_html', [ '\\EmbedPress\\Shortcode', 'do_shortcode' ] );
43
  }
44
-
45
  /**
46
  * Method that converts the plugin shortcoded-string into its complex content.
47
  *
@@ -53,10 +53,10 @@ class Shortcode {
53
  * @static
54
  *
55
  */
56
-
57
  public static function do_shortcode( $attributes = [], $subject = null ) {
58
  $plgSettings = Core::getSettings();
59
- $default = [];
60
  if ( $plgSettings->enableGlobalEmbedResize ) {
61
  $default = [
62
  'width' => $plgSettings->enableEmbedResizeWidth,
@@ -64,11 +64,11 @@ class Shortcode {
64
  ];
65
  }
66
  $attributes = wp_parse_args( $attributes, $default );
67
- $embed = self::parseContent( $subject, true, $attributes );
68
-
69
  return is_object( $embed ) ? $embed->embed : $embed;
70
  }
71
-
72
  /**
73
  * Replace a given content with its embeded HTML code.
74
  *
@@ -85,43 +85,50 @@ class Shortcode {
85
  if ( empty( $customAttributes ) ) {
86
  $customAttributes = self::parseContentAttributesFromString( $subject );
87
  }
88
-
89
  $content = preg_replace( '/(\[' . EMBEDPRESS_SHORTCODE . '(?:\]|.+?\])|\[\/' . EMBEDPRESS_SHORTCODE . '\])/i',
90
  "", $subject );
91
-
92
  // Converts any special HTML entities back to characters.
93
  $content = htmlspecialchars_decode( $content );
94
-
95
  // Check if the WP_oEmbed class is loaded
96
  if ( !self::$oEmbedInstance ) {
97
- require_once ABSPATH . 'wp-includes/class-wp-oembed.php';
98
-
 
 
 
 
99
  self::$oEmbedInstance = _wp_oembed_get_object();
 
 
 
 
100
  }
101
-
102
  $emberaInstanceSettings = [
103
  'params' => [],
104
  ];
105
-
106
  $content_uid = md5( $content );
107
-
108
  $attributes = self::parseContentAttributes( $customAttributes, $content_uid );
109
- if ( isset( $attributes['width'] ) || isset( $attributes['height'] ) ) {
110
- if ( isset( $attributes['width'] ) ) {
111
- $emberaInstanceSettings['params']['width'] = $attributes['width'];
112
- unset( $attributes['width'] );
113
  }
114
-
115
- if ( isset( $attributes['height'] ) ) {
116
- $emberaInstanceSettings['params']['height'] = $attributes['height'];
117
- unset( $attributes['height'] );
118
  }
119
  }
120
-
121
  // Identify what service provider the shortcode's link belongs to
122
  $serviceProvider = self::$oEmbedInstance->get_provider( $content );
123
-
124
-
125
  // Check if OEmbed was unable to detect the url service provider.
126
  if ( empty( $serviceProvider ) ) {
127
  // Attempt to do the same using Embera.
@@ -132,67 +139,66 @@ class Shortcode {
132
  foreach ( $additionalServiceProviders as $serviceProviderClassName => $serviceProviderUrls ) {
133
  self::addServiceProvider( $serviceProviderClassName, $serviceProviderUrls, $emberaInstance );
134
  }
135
-
136
  unset( $serviceProviderUrls, $serviceProviderClassName );
137
  }
138
-
139
  // Attempt to fetch more info about the url-embed.
140
  $urlData = $emberaInstance->getUrlInfo( $content );
141
  } else {
142
  // Attempt to fetch more info about the url-embed.
143
  $urlData = self::$oEmbedInstance->fetch( $serviceProvider, $content, $attributes );
144
  }
145
-
146
  // Sanitize the data
147
  $urlData = self::sanitizeUrlData( $urlData );
148
-
149
  // Stores the original content
150
  if ( is_object( $urlData ) ) {
151
  $urlData->originalContent = $content;
152
  }
153
-
154
  $eventResults = apply_filters( 'embedpress:onBeforeEmbed', $urlData );
155
  if ( empty( $eventResults ) ) {
156
  // EmbedPress seems unable to embed the url.
157
  return $subject;
158
  }
159
-
160
  // Transform all shortcode attributes into html form. I.e.: {foo: "joe"} -> foo="joe"
161
  $attributesHtml = [];
162
  foreach ( $attributes as $attrName => $attrValue ) {
163
  $attributesHtml[] = $attrName . '="' . $attrValue . '"';
164
  }
165
-
166
  // Define the EmbedPress html template where the generated embed will be injected in
167
  $embedTemplate = '<div ' . implode( ' ', $attributesHtml ) . '>{html}</div>';
168
-
169
  // Check if $content is a google shortened url and tries to extract from it which Google service it refers to.
170
  if ( preg_match( '/http[s]?:\/\/goo\.gl\/(?:([a-z]+)\/)?[a-z0-9]+\/?$/i', $content, $matches ) ) {
171
  // Fetch all headers from the short-url so we can know how to handle its original content depending on the service.
172
  $headers = get_headers( $content );
173
-
174
  $supportedServicesHeadersPatterns = [
175
  'maps' => '/^Location:\s+(http[s]?:\/\/.+)$/i',
176
  ];
177
-
178
- $service = isset( $matches[1] ) ? strtolower( $matches[1] ) : null;
179
  // No specific service was found in the url.
180
  if ( empty( $service ) ) {
181
  // Let's try to guess which service the original url belongs to.
182
  foreach ( $headers as $header ) {
183
  // Check if the short-url reffers to a Google Maps url.
184
- if ( preg_match( $supportedServicesHeadersPatterns['maps'], $header, $matches ) ) {
185
  // Replace the shortened url with its original url.
186
- $content = $matches[1];
187
  break;
188
  }
189
  }
190
  unset( $header );
191
  } else {
192
  // Check if the Google service is supported atm.
193
- if ( isset( $supportedServicesHeadersPatterns[$service] ) ) {
194
  // Tries to extract the url based on its headers.
195
- $originalUrl = self::extractContentFromHeaderAsArray( $supportedServicesHeadersPatterns[$service],
196
  $headers );
197
  // Replace the shortened url with its original url if the specific header was found.
198
  if ( !empty( $originalUrl ) ) {
@@ -202,66 +208,72 @@ class Shortcode {
202
  }
203
  }
204
  unset( $service, $supportedServicesHeadersPatterns, $headers, $matches );
 
205
  }
206
-
207
  // Facebook is a special case. WordPress will try to embed them using OEmbed, but they always end up embedding the profile page, regardless
208
  // if the url was pointing to a photo, a post, etc. So, since Embera can embed only facebook-media/posts, we'll use it only for that.
209
- if ( isset( $urlData->provider_name ) && in_array( $urlData->provider_name, [ 'Facebook' ] ) ) {
210
- // Check if this is a Facebook profile url.
211
- if ( preg_match( '/facebook\.com\/(?:[^\/]+?)\/?$/', $content, $match ) ) {
212
- // Try to embed the url using WP's OSEmbed.
213
- $parsedContent = self::$oEmbedInstance->get_html( $content, $attributes );
214
- } else {
215
- // Try to embed the url using EmbedPress' Embera.
216
- $parsedContent = false;
217
- }
218
- } else {
219
- // Try to embed the url using WP's OSEmbed.
220
- $parsedContent = self::$oEmbedInstance->get_html( $content, $attributes );
221
- }
222
-
 
 
 
 
223
  if ( !$parsedContent ) {
224
  if ( !isset( $emberaInstance ) ) {
 
225
  // If the embed couldn't be generated, we'll try to use Embera's API
226
  $emberaInstance = new Embera( $emberaInstanceSettings );
227
  // Add support to the user's custom service providers
228
  $additionalServiceProviders = Core::getAdditionalServiceProviders();
229
  if ( !empty( $additionalServiceProviders ) ) {
230
  foreach ( $additionalServiceProviders as $serviceProviderClassName => $serviceProviderUrls ) {
231
- self::addServiceProvider( $serviceProviderClassName, $serviceProviderUrls, $emberaInstance );
 
232
  }
233
-
234
  unset( $serviceProviderUrls, $serviceProviderClassName );
235
  }
236
  }
237
-
238
  // Register the html template
239
  $emberaFormaterInstance = new Formatter( $emberaInstance, true );
240
  $emberaFormaterInstance->setTemplate( $embedTemplate );
241
-
242
  // Try to generate the embed using Embera API
243
  $parsedContent = $emberaFormaterInstance->transform( $content );
244
-
245
  unset( $emberaFormaterInstance, $additionalServiceProviders, $emberaInstance );
246
  } else {
247
  // Inject the generated code inside the html template
248
  $parsedContent = str_replace( '{html}', $parsedContent, $embedTemplate );
249
-
250
  // Replace all single quotes to double quotes. I.e: foo='joe' -> foo="joe"
251
  $parsedContent = str_replace( "'", '"', $parsedContent );
252
-
253
  // Replace the flag `{provider_alias}` which is used by Embera with the "ose-<serviceProviderAlias>". I.e: YouTube -> "ose-youtube"
254
  $parsedContent = preg_replace( '/((?:ose-)?\{provider_alias\})/i',
255
  "ose-" . strtolower( $urlData->provider_name ), $parsedContent );
256
  }
257
-
258
- if ( isset( $urlData->provider_name ) || (is_array( $urlData ) && isset( $urlData[$content]['provider_name'] )) ) {
259
  // NFB seems to always return their embed code with all HTML entities into their applicable characters string.
260
- if ( (isset( $urlData->provider_name ) && strtoupper( $urlData->provider_name ) === "NATIONAL FILM BOARD OF CANADA") || (is_array( $urlData ) && isset( $urlData[$content]['provider_name'] ) && strtoupper( $urlData[$content]['provider_name'] ) === "NATIONAL FILM BOARD OF CANADA") ) {
261
  $parsedContent = html_entity_decode( $parsedContent );
262
- } elseif ( (isset( $urlData->provider_name ) && strtoupper( $urlData->provider_name ) === "FACEBOOK") || (is_array( $urlData ) && isset( $urlData[$content]['provider_name'] ) && strtoupper( $urlData[$content]['provider_name'] ) === "FACEBOOK") ) {
263
  $plgSettings = Core::getSettings();
264
-
265
  // Check if the user wants to force a certain language into Facebook embeds.
266
  $locale = isset( $plgSettings->fbLanguage ) && !empty( $plgSettings->fbLanguage ) ? $plgSettings->fbLanguage : false;
267
  if ( !!$locale ) {
@@ -269,74 +281,75 @@ class Shortcode {
269
  $parsedContent = preg_replace( '/\/[a-z]{2}\_[a-z]{2}\/sdk\.js/i', "/{$locale}/sdk.js",
270
  $parsedContent );
271
  }
272
-
273
  // Make sure `adapt_container_width` parameter is set to false. Setting to true, as it is by default, might cause Facebook to render embeds inside editors (in admin) with only 180px wide.
274
  if ( is_admin() ) {
275
  $parsedContent = preg_replace( '~data\-adapt\-container\-width=\"(?:true|1)\"~i',
276
  'data-adapt-container-width="0"', $parsedContent );
277
  }
278
-
279
  unset( $locale, $plgSettings );
280
  }
281
  }
282
-
283
  unset( $embedTemplate, $serviceProvider );
284
-
285
  // This assure that the iframe has the same dimensions the user wants to
286
- if ( isset( $emberaInstanceSettings['params']['width'] ) || isset( $emberaInstanceSettings['params']['height'] ) ) {
287
- if ( isset( $emberaInstanceSettings['params']['width'] ) && isset( $emberaInstanceSettings['params']['height'] ) ) {
288
- $customWidth = (int)$emberaInstanceSettings['params']['width'];
289
- $customHeight = (int)$emberaInstanceSettings['params']['height'];
290
  } else {
291
  if ( preg_match( '~width="(\d+)"|width\s+:\s+(\d+)~i', $parsedContent, $matches ) ) {
292
- $iframeWidth = (int)$matches[1];
293
  }
294
-
295
  if ( preg_match( '~height="(\d+)"|height\s+:\s+(\d+)~i', $parsedContent, $matches ) ) {
296
- $iframeHeight = (int)$matches[1];
297
  }
298
-
299
  if ( isset( $iframeWidth ) && isset( $iframeHeight ) && $iframeWidth > 0 && $iframeHeight > 0 ) {
300
  $iframeRatio = ceil( $iframeWidth / $iframeHeight );
301
-
302
- if ( isset( $emberaInstanceSettings['params']['width'] ) ) {
303
- $customWidth = (int)$emberaInstanceSettings['params']['width'];
304
  $customHeight = ceil( $customWidth / $iframeRatio );
305
  } else {
306
- $customHeight = (int)$emberaInstanceSettings['params']['height'];
307
- $customWidth = $iframeRatio * $customHeight;
308
  }
309
  }
310
  }
311
-
312
  if ( isset( $customWidth ) && isset( $customHeight ) ) {
313
  if ( preg_match( '~width="(\d+)"~i', $parsedContent ) ) {
314
  $parsedContent = preg_replace( '~width="(\d+)"~i', 'width="' . $customWidth . '"',
315
  $parsedContent );
316
  }
317
-
318
  if ( preg_match( '~height="(\d+)"~i', $parsedContent ) ) {
319
  $parsedContent = preg_replace( '~height="(\d+)"~i', 'height="' . $customHeight . '"',
320
  $parsedContent );
321
  }
322
-
323
  if ( preg_match( '~width\s+:\s+(\d+)~i', $parsedContent ) ) {
324
- $parsedContent = preg_replace( '~width\s+:\s+(\d+)~i', 'width: ' . $customWidth, $parsedContent );
 
325
  }
326
-
327
  if ( preg_match( '~height\s+:\s+(\d+)~i', $parsedContent ) ) {
328
  $parsedContent = preg_replace( '~height\s+:\s+(\d+)~i', 'height: ' . $customHeight,
329
  $parsedContent );
330
  }
331
  }
332
  }
333
-
334
  if ( $stripNewLine ) {
335
  $parsedContent = preg_replace( '/\n/', '', $parsedContent );
336
  }
337
-
338
  $parsedContent = apply_filters( 'pp_embed_parsed_content', $parsedContent, $urlData, $attributes );
339
-
340
  if ( !empty( $parsedContent ) ) {
341
  $embed = (object)array_merge( (array)$urlData, [
342
  'attributes' => (object)$attributes,
@@ -347,10 +360,10 @@ class Shortcode {
347
  return $embed;
348
  }
349
  }
350
-
351
  return $subject;
352
  }
353
-
354
  /**
355
  * Method that adds support to a given new service provider (SP).
356
  *
@@ -367,7 +380,7 @@ class Shortcode {
367
  if ( empty( $className ) || empty( $reference ) ) {
368
  return false;
369
  }
370
-
371
  if ( is_string( $reference ) ) {
372
  $emberaInstance->addProvider( $reference, EMBEDPRESS_NAMESPACE . "\\Providers\\{$className}" );
373
  } elseif ( is_array( $reference ) ) {
@@ -378,7 +391,7 @@ class Shortcode {
378
  return false;
379
  }
380
  }
381
-
382
  /**
383
  * Method that retrieves all custom parameters from a shortcoded string.
384
  *
@@ -392,19 +405,19 @@ class Shortcode {
392
  public static function parseContentAttributesFromString( $subject ) {
393
  $customAttributes = [];
394
  if ( preg_match( '/\[embed\s*(.*?)\]/i', stripslashes( $subject ), $m ) ) {
395
- if ( preg_match_all( '/(\!?\w+-?\w*)(?:="(.+?)")?/i', stripslashes( $m[1] ), $matches ) ) {
396
- $attributes = $matches[1];
397
- $attrValues = $matches[2];
398
-
399
  foreach ( $attributes as $attrIndex => $attrName ) {
400
- $customAttributes[$attrName] = $attrValues[$attrIndex];
401
  }
402
  }
403
  }
404
-
405
  return $customAttributes;
406
  }
407
-
408
  /**
409
  * Method that parses and adds the "data-" prefix to the given custom shortcode attributes.
410
  *
@@ -419,95 +432,95 @@ class Shortcode {
419
  */
420
  private static function parseContentAttributes( array $customAttributes, $content_uid = null ) {
421
  $attributes = [
422
- 'class' => [ "embedpress-wrapper" ],
423
  ];
424
-
425
- $embedShouldBeResponsive = true;
426
  $embedShouldHaveCustomDimensions = false;
427
  if ( !empty( $customAttributes ) ) {
428
- if ( isset( $customAttributes['class'] ) ) {
429
- if ( !empty( $customAttributes['class'] ) ) {
430
- $customAttributes['class'] = explode( ' ', $customAttributes['class'] );
431
-
432
- $attributes['class'] = array_merge( $attributes['class'], $customAttributes['class'] );
433
  }
434
-
435
- unset( $customAttributes['class'] );
436
  }
437
-
438
- if ( isset( $customAttributes['width'] ) ) {
439
- if ( !empty( $customAttributes['width'] ) ) {
440
- $attributes['width'] = (int)$customAttributes['width'];
441
  $embedShouldHaveCustomDimensions = true;
442
  }
443
  }
444
-
445
- if ( isset( $customAttributes['height'] ) ) {
446
- if ( !empty( $customAttributes['height'] ) ) {
447
- $attributes['height'] = (int)$customAttributes['height'];
448
  $embedShouldHaveCustomDimensions = true;
449
  }
450
  }
451
-
452
  if ( !empty( $customAttributes ) ) {
453
  $attrNameDefaultPrefix = "data-";
454
  foreach ( $customAttributes as $attrName => $attrValue ) {
455
  if ( is_numeric( $attrName ) ) {
456
- $attrName = $attrValue;
457
  $attrValue = "";
458
  }
459
-
460
  $attrName = str_replace( $attrNameDefaultPrefix, "", $attrName );
461
-
462
  if ( !strlen( $attrValue ) ) {
463
- if ( $attrName[0] === "!" ) {
464
  $attrValue = "false";
465
- $attrName = substr( $attrName, 1 );
466
  } else {
467
  $attrValue = "true";
468
  }
469
  }
470
-
471
- $attributes[$attrNameDefaultPrefix . $attrName] = $attrValue;
472
  }
473
  }
474
-
475
  // Check if there's any "responsive" parameter
476
- $responsiveAttributes = [ "responsive", "data-responsive" ];
477
  foreach ( $responsiveAttributes as $responsiveAttr ) {
478
- if ( isset( $attributes[$responsiveAttr] ) ) {
479
- if ( !strlen( $attributes[$responsiveAttr] ) ) { // If the parameter is passed but have no value, it will be true by default
480
  $embedShouldBeResponsive = true;
481
  } else {
482
- $embedShouldBeResponsive = !self::valueIsFalse( $attributes[$responsiveAttr] );
483
  }
484
-
485
  break;
486
  }
487
  }
488
  unset( $responsiveAttr, $responsiveAttributes );
489
  }
490
-
491
- $attributes['class'][] = 'ose-{provider_alias}';
492
-
493
  if ( !empty( $content_uid ) ) {
494
- $attributes['class'][] = 'ose-uid-' . $content_uid;
495
  }
496
-
497
  if ( $embedShouldBeResponsive && !$embedShouldHaveCustomDimensions ) {
498
- $attributes['class'][] = 'responsive';
499
  } else {
500
- $attributes['data-responsive'] = "false";
501
  }
502
-
503
- $attributes['class'] = implode( ' ', array_unique( array_filter( $attributes['class'] ) ) );
504
- if ( isset( $attributes['width'] ) ) {
505
- $attributes['style'] = "width:{$attributes['width'] }px;height:{$attributes['height'] }px;";
506
  }
507
-
508
  return $attributes;
509
  }
510
-
511
  /**
512
  * Method that checks if a given value is/can be identified as (bool)false.
513
  *
@@ -533,7 +546,7 @@ class Shortcode {
533
  return false;
534
  }
535
  }
536
-
537
  /**
538
  * Return the value from a header which is in an array resulted from a get_headers() call.
539
  * If the header cannot be found, this method will return null instead.
@@ -549,17 +562,17 @@ class Shortcode {
549
  */
550
  private static function extractContentFromHeaderAsArray( $headerPattern, $headersList ) {
551
  $headerValue = null;
552
-
553
  foreach ( $headersList as $header ) {
554
  if ( preg_match( $headerPattern, $header, $matches ) ) {
555
- $headerValue = $matches[1];
556
  break;
557
  }
558
  }
559
-
560
  return $headerValue;
561
  }
562
-
563
  /**
564
  * Sanitize the object returned by the embed source. Sometimes we need to convert
565
  * attributes from "dash" separated to "underline" separated to be able to access
@@ -576,26 +589,92 @@ class Shortcode {
576
  private static function sanitizeUrlData( $data ) {
577
  if ( is_object( $data ) ) {
578
  $attributes = get_object_vars( $data );
579
-
580
  foreach ( $attributes as $key => $value ) {
581
  if ( substr_count( $key, '-' ) ) {
582
  unset( $data->$key );
583
-
584
- $key = str_replace( '-', '_', $key );
585
  $data->$key = $value;
586
  }
587
  }
588
  } elseif ( is_array( $data ) ) {
589
  foreach ( $data as $key => $value ) {
590
  if ( substr_count( $key, '-' ) ) {
591
- unset( $data[$key] );
592
-
593
- $key = str_replace( '-', '_', $key );
594
- $data[$key] = $value;
595
  }
596
  }
597
  }
598
-
599
  return $data;
600
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
601
  }
5
  use Embera\Embera;
6
  use Embera\Formatter;
7
 
8
+ ( defined( 'ABSPATH' ) && defined( 'EMBEDPRESS_IS_LOADED' ) ) or die( "No direct script access allowed." );
9
 
10
  /**
11
  * Entity responsible to handle the plugin's shortcode events and behaviors.
27
  * @var string $oEmbedInstance
28
  */
29
  private static $oEmbedInstance = null;
30
+
31
  /**
32
  * Register the plugin's shortcode into WordPress.
33
  *
38
  */
39
  public static function register() {
40
  // Register the new shortcode for embeds.
41
+ add_shortcode( EMBEDPRESS_SHORTCODE, ['\\EmbedPress\\Shortcode', 'do_shortcode'] );
42
+ add_shortcode( 'embed_oembed_html', ['\\EmbedPress\\Shortcode', 'do_shortcode'] );
43
  }
44
+
45
  /**
46
  * Method that converts the plugin shortcoded-string into its complex content.
47
  *
53
  * @static
54
  *
55
  */
56
+
57
  public static function do_shortcode( $attributes = [], $subject = null ) {
58
  $plgSettings = Core::getSettings();
59
+ $default = [];
60
  if ( $plgSettings->enableGlobalEmbedResize ) {
61
  $default = [
62
  'width' => $plgSettings->enableEmbedResizeWidth,
64
  ];
65
  }
66
  $attributes = wp_parse_args( $attributes, $default );
67
+ $embed = self::parseContent( $subject, true, $attributes );
68
+
69
  return is_object( $embed ) ? $embed->embed : $embed;
70
  }
71
+
72
  /**
73
  * Replace a given content with its embeded HTML code.
74
  *
85
  if ( empty( $customAttributes ) ) {
86
  $customAttributes = self::parseContentAttributesFromString( $subject );
87
  }
88
+
89
  $content = preg_replace( '/(\[' . EMBEDPRESS_SHORTCODE . '(?:\]|.+?\])|\[\/' . EMBEDPRESS_SHORTCODE . '\])/i',
90
  "", $subject );
91
+
92
  // Converts any special HTML entities back to characters.
93
  $content = htmlspecialchars_decode( $content );
94
+
95
  // Check if the WP_oEmbed class is loaded
96
  if ( !self::$oEmbedInstance ) {
97
+ global $wp_version;
98
+ if ( version_compare( $wp_version, '5.3.0', '>=' ) ) {
99
+ require_once ABSPATH . 'wp-includes/class-wp-oembed.php';
100
+ } else {
101
+ require_once ABSPATH . 'wp-includes/class-oembed.php';
102
+ }
103
  self::$oEmbedInstance = _wp_oembed_get_object();
104
+ };
105
+ if ( !empty( self::get_access_token() ) ) {
106
+ self::$oEmbedInstance->providers = array_merge( self::$oEmbedInstance->providers,
107
+ self::get_modified_provider( self::get_access_token() ) );
108
  }
 
109
  $emberaInstanceSettings = [
110
  'params' => [],
111
  ];
112
+
113
  $content_uid = md5( $content );
114
+
115
  $attributes = self::parseContentAttributes( $customAttributes, $content_uid );
116
+ if ( isset( $attributes[ 'width' ] ) || isset( $attributes[ 'height' ] ) ) {
117
+ if ( isset( $attributes[ 'width' ] ) ) {
118
+ $emberaInstanceSettings[ 'params' ][ 'width' ] = $attributes[ 'width' ];
119
+ unset( $attributes[ 'width' ] );
120
  }
121
+
122
+ if ( isset( $attributes[ 'height' ] ) ) {
123
+ $emberaInstanceSettings[ 'params' ][ 'height' ] = $attributes[ 'height' ];
124
+ unset( $attributes[ 'height' ] );
125
  }
126
  }
127
+
128
  // Identify what service provider the shortcode's link belongs to
129
  $serviceProvider = self::$oEmbedInstance->get_provider( $content );
130
+
131
+
132
  // Check if OEmbed was unable to detect the url service provider.
133
  if ( empty( $serviceProvider ) ) {
134
  // Attempt to do the same using Embera.
139
  foreach ( $additionalServiceProviders as $serviceProviderClassName => $serviceProviderUrls ) {
140
  self::addServiceProvider( $serviceProviderClassName, $serviceProviderUrls, $emberaInstance );
141
  }
142
+
143
  unset( $serviceProviderUrls, $serviceProviderClassName );
144
  }
145
+
146
  // Attempt to fetch more info about the url-embed.
147
  $urlData = $emberaInstance->getUrlInfo( $content );
148
  } else {
149
  // Attempt to fetch more info about the url-embed.
150
  $urlData = self::$oEmbedInstance->fetch( $serviceProvider, $content, $attributes );
151
  }
152
+
153
  // Sanitize the data
154
  $urlData = self::sanitizeUrlData( $urlData );
 
155
  // Stores the original content
156
  if ( is_object( $urlData ) ) {
157
  $urlData->originalContent = $content;
158
  }
159
+
160
  $eventResults = apply_filters( 'embedpress:onBeforeEmbed', $urlData );
161
  if ( empty( $eventResults ) ) {
162
  // EmbedPress seems unable to embed the url.
163
  return $subject;
164
  }
165
+
166
  // Transform all shortcode attributes into html form. I.e.: {foo: "joe"} -> foo="joe"
167
  $attributesHtml = [];
168
  foreach ( $attributes as $attrName => $attrValue ) {
169
  $attributesHtml[] = $attrName . '="' . $attrValue . '"';
170
  }
171
+
172
  // Define the EmbedPress html template where the generated embed will be injected in
173
  $embedTemplate = '<div ' . implode( ' ', $attributesHtml ) . '>{html}</div>';
174
+
175
  // Check if $content is a google shortened url and tries to extract from it which Google service it refers to.
176
  if ( preg_match( '/http[s]?:\/\/goo\.gl\/(?:([a-z]+)\/)?[a-z0-9]+\/?$/i', $content, $matches ) ) {
177
  // Fetch all headers from the short-url so we can know how to handle its original content depending on the service.
178
  $headers = get_headers( $content );
179
+
180
  $supportedServicesHeadersPatterns = [
181
  'maps' => '/^Location:\s+(http[s]?:\/\/.+)$/i',
182
  ];
183
+
184
+ $service = isset( $matches[ 1 ] ) ? strtolower( $matches[ 1 ] ) : null;
185
  // No specific service was found in the url.
186
  if ( empty( $service ) ) {
187
  // Let's try to guess which service the original url belongs to.
188
  foreach ( $headers as $header ) {
189
  // Check if the short-url reffers to a Google Maps url.
190
+ if ( preg_match( $supportedServicesHeadersPatterns[ 'maps' ], $header, $matches ) ) {
191
  // Replace the shortened url with its original url.
192
+ $content = $matches[ 1 ];
193
  break;
194
  }
195
  }
196
  unset( $header );
197
  } else {
198
  // Check if the Google service is supported atm.
199
+ if ( isset( $supportedServicesHeadersPatterns[ $service ] ) ) {
200
  // Tries to extract the url based on its headers.
201
+ $originalUrl = self::extractContentFromHeaderAsArray( $supportedServicesHeadersPatterns[ $service ],
202
  $headers );
203
  // Replace the shortened url with its original url if the specific header was found.
204
  if ( !empty( $originalUrl ) ) {
208
  }
209
  }
210
  unset( $service, $supportedServicesHeadersPatterns, $headers, $matches );
211
+
212
  }
 
213
  // Facebook is a special case. WordPress will try to embed them using OEmbed, but they always end up embedding the profile page, regardless
214
  // if the url was pointing to a photo, a post, etc. So, since Embera can embed only facebook-media/posts, we'll use it only for that.
215
+ // if ( isset( $urlData->provider_name ) && in_array( $urlData->provider_name, ['Facebook'] ) ) {
216
+ // // Check if this is a Facebook profile url.
217
+ // if ( preg_match( '/facebook\.com\/(?:[^\/]+?)\/?$/', $content, $match ) ) {
218
+ // // Try to embed the url using WP's OSEmbed.
219
+ // $parsedContent = self::$oEmbedInstance->get_html( $content, $attributes );
220
+ // } else {
221
+ // // Try to embed the url using EmbedPress' Embera.
222
+ // $parsedContent = false;
223
+ // }
224
+ // } else {
225
+ // // Try to embed the url using WP's OSEmbed.
226
+ //
227
+ // }
228
+
229
+ $parsedContent = self::$oEmbedInstance->get_html( $content, $attributes );
230
+
231
+
232
+
233
  if ( !$parsedContent ) {
234
  if ( !isset( $emberaInstance ) ) {
235
+
236
  // If the embed couldn't be generated, we'll try to use Embera's API
237
  $emberaInstance = new Embera( $emberaInstanceSettings );
238
  // Add support to the user's custom service providers
239
  $additionalServiceProviders = Core::getAdditionalServiceProviders();
240
  if ( !empty( $additionalServiceProviders ) ) {
241
  foreach ( $additionalServiceProviders as $serviceProviderClassName => $serviceProviderUrls ) {
242
+ self::addServiceProvider( $serviceProviderClassName, $serviceProviderUrls,
243
+ $emberaInstance );
244
  }
245
+
246
  unset( $serviceProviderUrls, $serviceProviderClassName );
247
  }
248
  }
249
+
250
  // Register the html template
251
  $emberaFormaterInstance = new Formatter( $emberaInstance, true );
252
  $emberaFormaterInstance->setTemplate( $embedTemplate );
253
+
254
  // Try to generate the embed using Embera API
255
  $parsedContent = $emberaFormaterInstance->transform( $content );
256
+
257
  unset( $emberaFormaterInstance, $additionalServiceProviders, $emberaInstance );
258
  } else {
259
  // Inject the generated code inside the html template
260
  $parsedContent = str_replace( '{html}', $parsedContent, $embedTemplate );
261
+
262
  // Replace all single quotes to double quotes. I.e: foo='joe' -> foo="joe"
263
  $parsedContent = str_replace( "'", '"', $parsedContent );
264
+
265
  // Replace the flag `{provider_alias}` which is used by Embera with the "ose-<serviceProviderAlias>". I.e: YouTube -> "ose-youtube"
266
  $parsedContent = preg_replace( '/((?:ose-)?\{provider_alias\})/i',
267
  "ose-" . strtolower( $urlData->provider_name ), $parsedContent );
268
  }
269
+
270
+ if ( isset( $urlData->provider_name ) || ( is_array( $urlData ) && isset( $urlData[ $content ][ 'provider_name' ] ) ) ) {
271
  // NFB seems to always return their embed code with all HTML entities into their applicable characters string.
272
+ if ( ( isset( $urlData->provider_name ) && strtoupper( $urlData->provider_name ) === "NATIONAL FILM BOARD OF CANADA" ) || ( is_array( $urlData ) && isset( $urlData[ $content ][ 'provider_name' ] ) && strtoupper( $urlData[ $content ][ 'provider_name' ] ) === "NATIONAL FILM BOARD OF CANADA" ) ) {
273
  $parsedContent = html_entity_decode( $parsedContent );
274
+ } elseif ( ( isset( $urlData->provider_name ) && strtoupper( $urlData->provider_name ) === "FACEBOOK" ) || ( is_array( $urlData ) && isset( $urlData[ $content ][ 'provider_name' ] ) && strtoupper( $urlData[ $content ][ 'provider_name' ] ) === "FACEBOOK" ) ) {
275
  $plgSettings = Core::getSettings();
276
+
277
  // Check if the user wants to force a certain language into Facebook embeds.
278
  $locale = isset( $plgSettings->fbLanguage ) && !empty( $plgSettings->fbLanguage ) ? $plgSettings->fbLanguage : false;
279
  if ( !!$locale ) {
281
  $parsedContent = preg_replace( '/\/[a-z]{2}\_[a-z]{2}\/sdk\.js/i', "/{$locale}/sdk.js",
282
  $parsedContent );
283
  }
284
+
285
  // Make sure `adapt_container_width` parameter is set to false. Setting to true, as it is by default, might cause Facebook to render embeds inside editors (in admin) with only 180px wide.
286
  if ( is_admin() ) {
287
  $parsedContent = preg_replace( '~data\-adapt\-container\-width=\"(?:true|1)\"~i',
288
  'data-adapt-container-width="0"', $parsedContent );
289
  }
290
+
291
  unset( $locale, $plgSettings );
292
  }
293
  }
294
+
295
  unset( $embedTemplate, $serviceProvider );
296
+
297
  // This assure that the iframe has the same dimensions the user wants to
298
+ if ( isset( $emberaInstanceSettings[ 'params' ][ 'width' ] ) || isset( $emberaInstanceSettings[ 'params' ][ 'height' ] ) ) {
299
+ if ( isset( $emberaInstanceSettings[ 'params' ][ 'width' ] ) && isset( $emberaInstanceSettings[ 'params' ][ 'height' ] ) ) {
300
+ $customWidth = (int)$emberaInstanceSettings[ 'params' ][ 'width' ];
301
+ $customHeight = (int)$emberaInstanceSettings[ 'params' ][ 'height' ];
302
  } else {
303
  if ( preg_match( '~width="(\d+)"|width\s+:\s+(\d+)~i', $parsedContent, $matches ) ) {
304
+ $iframeWidth = (int)$matches[ 1 ];
305
  }
306
+
307
  if ( preg_match( '~height="(\d+)"|height\s+:\s+(\d+)~i', $parsedContent, $matches ) ) {
308
+ $iframeHeight = (int)$matches[ 1 ];
309
  }
310
+
311
  if ( isset( $iframeWidth ) && isset( $iframeHeight ) && $iframeWidth > 0 && $iframeHeight > 0 ) {
312
  $iframeRatio = ceil( $iframeWidth / $iframeHeight );
313
+
314
+ if ( isset( $emberaInstanceSettings[ 'params' ][ 'width' ] ) ) {
315
+ $customWidth = (int)$emberaInstanceSettings[ 'params' ][ 'width' ];
316
  $customHeight = ceil( $customWidth / $iframeRatio );
317
  } else {
318
+ $customHeight = (int)$emberaInstanceSettings[ 'params' ][ 'height' ];
319
+ $customWidth = $iframeRatio * $customHeight;
320
  }
321
  }
322
  }
323
+
324
  if ( isset( $customWidth ) && isset( $customHeight ) ) {
325
  if ( preg_match( '~width="(\d+)"~i', $parsedContent ) ) {
326
  $parsedContent = preg_replace( '~width="(\d+)"~i', 'width="' . $customWidth . '"',
327
  $parsedContent );
328
  }
329
+
330
  if ( preg_match( '~height="(\d+)"~i', $parsedContent ) ) {
331
  $parsedContent = preg_replace( '~height="(\d+)"~i', 'height="' . $customHeight . '"',
332
  $parsedContent );
333
  }
334
+
335
  if ( preg_match( '~width\s+:\s+(\d+)~i', $parsedContent ) ) {
336
+ $parsedContent = preg_replace( '~width\s+:\s+(\d+)~i', 'width: ' . $customWidth,
337
+ $parsedContent );
338
  }
339
+
340
  if ( preg_match( '~height\s+:\s+(\d+)~i', $parsedContent ) ) {
341
  $parsedContent = preg_replace( '~height\s+:\s+(\d+)~i', 'height: ' . $customHeight,
342
  $parsedContent );
343
  }
344
  }
345
  }
346
+
347
  if ( $stripNewLine ) {
348
  $parsedContent = preg_replace( '/\n/', '', $parsedContent );
349
  }
350
+
351
  $parsedContent = apply_filters( 'pp_embed_parsed_content', $parsedContent, $urlData, $attributes );
352
+
353
  if ( !empty( $parsedContent ) ) {
354
  $embed = (object)array_merge( (array)$urlData, [
355
  'attributes' => (object)$attributes,
360
  return $embed;
361
  }
362
  }
363
+
364
  return $subject;
365
  }
366
+
367
  /**
368
  * Method that adds support to a given new service provider (SP).
369
  *
380
  if ( empty( $className ) || empty( $reference ) ) {
381
  return false;
382
  }
383
+
384
  if ( is_string( $reference ) ) {
385
  $emberaInstance->addProvider( $reference, EMBEDPRESS_NAMESPACE . "\\Providers\\{$className}" );
386
  } elseif ( is_array( $reference ) ) {
391
  return false;
392
  }
393
  }
394
+
395
  /**
396
  * Method that retrieves all custom parameters from a shortcoded string.
397
  *
405
  public static function parseContentAttributesFromString( $subject ) {
406
  $customAttributes = [];
407
  if ( preg_match( '/\[embed\s*(.*?)\]/i', stripslashes( $subject ), $m ) ) {
408
+ if ( preg_match_all( '/(\!?\w+-?\w*)(?:="(.+?)")?/i', stripslashes( $m[ 1 ] ), $matches ) ) {
409
+ $attributes = $matches[ 1 ];
410
+ $attrValues = $matches[ 2 ];
411
+
412
  foreach ( $attributes as $attrIndex => $attrName ) {
413
+ $customAttributes[ $attrName ] = $attrValues[ $attrIndex ];
414
  }
415
  }
416
  }
417
+
418
  return $customAttributes;
419
  }
420
+
421
  /**
422
  * Method that parses and adds the "data-" prefix to the given custom shortcode attributes.
423
  *
432
  */
433
  private static function parseContentAttributes( array $customAttributes, $content_uid = null ) {
434
  $attributes = [
435
+ 'class' => ["embedpress-wrapper"],
436
  ];
437
+
438
+ $embedShouldBeResponsive = true;
439
  $embedShouldHaveCustomDimensions = false;
440
  if ( !empty( $customAttributes ) ) {
441
+ if ( isset( $customAttributes[ 'class' ] ) ) {
442
+ if ( !empty( $customAttributes[ 'class' ] ) ) {
443
+ $customAttributes[ 'class' ] = explode( ' ', $customAttributes[ 'class' ] );
444
+
445
+ $attributes[ 'class' ] = array_merge( $attributes[ 'class' ], $customAttributes[ 'class' ] );
446
  }
447
+
448
+ unset( $customAttributes[ 'class' ] );
449
  }
450
+
451
+ if ( isset( $customAttributes[ 'width' ] ) ) {
452
+ if ( !empty( $customAttributes[ 'width' ] ) ) {
453
+ $attributes[ 'width' ] = (int)$customAttributes[ 'width' ];
454
  $embedShouldHaveCustomDimensions = true;
455
  }
456
  }
457
+
458
+ if ( isset( $customAttributes[ 'height' ] ) ) {
459
+ if ( !empty( $customAttributes[ 'height' ] ) ) {
460
+ $attributes[ 'height' ] = (int)$customAttributes[ 'height' ];
461
  $embedShouldHaveCustomDimensions = true;
462
  }
463
  }
464
+
465
  if ( !empty( $customAttributes ) ) {
466
  $attrNameDefaultPrefix = "data-";
467
  foreach ( $customAttributes as $attrName => $attrValue ) {
468
  if ( is_numeric( $attrName ) ) {
469
+ $attrName = $attrValue;
470
  $attrValue = "";
471
  }
472
+
473
  $attrName = str_replace( $attrNameDefaultPrefix, "", $attrName );
474
+
475
  if ( !strlen( $attrValue ) ) {
476
+ if ( $attrName[ 0 ] === "!" ) {
477
  $attrValue = "false";
478
+ $attrName = substr( $attrName, 1 );
479
  } else {
480
  $attrValue = "true";
481
  }
482
  }
483
+
484
+ $attributes[ $attrNameDefaultPrefix . $attrName ] = $attrValue;
485
  }
486
  }
487
+
488
  // Check if there's any "responsive" parameter
489
+ $responsiveAttributes = ["responsive", "data-responsive"];
490
  foreach ( $responsiveAttributes as $responsiveAttr ) {
491
+ if ( isset( $attributes[ $responsiveAttr ] ) ) {
492
+ if ( !strlen( $attributes[ $responsiveAttr ] ) ) { // If the parameter is passed but have no value, it will be true by default
493
  $embedShouldBeResponsive = true;
494
  } else {
495
+ $embedShouldBeResponsive = !self::valueIsFalse( $attributes[ $responsiveAttr ] );
496
  }
497
+
498
  break;
499
  }
500
  }
501
  unset( $responsiveAttr, $responsiveAttributes );
502
  }
503
+
504
+ $attributes[ 'class' ][] = 'ose-{provider_alias}';
505
+
506
  if ( !empty( $content_uid ) ) {
507
+ $attributes[ 'class' ][] = 'ose-uid-' . $content_uid;
508
  }
509
+
510
  if ( $embedShouldBeResponsive && !$embedShouldHaveCustomDimensions ) {
511
+ $attributes[ 'class' ][] = 'responsive';
512
  } else {
513
+ $attributes[ 'data-responsive' ] = "false";
514
  }
515
+
516
+ $attributes[ 'class' ] = implode( ' ', array_unique( array_filter( $attributes[ 'class' ] ) ) );
517
+ if ( isset( $attributes[ 'width' ] ) ) {
518
+ $attributes[ 'style' ] = "width:{$attributes['width'] }px;height:{$attributes['height'] }px;";
519
  }
520
+
521
  return $attributes;
522
  }
523
+
524
  /**
525
  * Method that checks if a given value is/can be identified as (bool)false.
526
  *
546
  return false;
547
  }
548
  }
549
+
550
  /**
551
  * Return the value from a header which is in an array resulted from a get_headers() call.
552
  * If the header cannot be found, this method will return null instead.
562
  */
563
  private static function extractContentFromHeaderAsArray( $headerPattern, $headersList ) {
564
  $headerValue = null;
565
+
566
  foreach ( $headersList as $header ) {
567
  if ( preg_match( $headerPattern, $header, $matches ) ) {
568
+ $headerValue = $matches[ 1 ];
569
  break;
570
  }
571
  }
572
+
573
  return $headerValue;
574
  }
575
+
576
  /**
577
  * Sanitize the object returned by the embed source. Sometimes we need to convert
578
  * attributes from "dash" separated to "underline" separated to be able to access
589
  private static function sanitizeUrlData( $data ) {
590
  if ( is_object( $data ) ) {
591
  $attributes = get_object_vars( $data );
592
+
593
  foreach ( $attributes as $key => $value ) {
594
  if ( substr_count( $key, '-' ) ) {
595
  unset( $data->$key );
596
+
597
+ $key = str_replace( '-', '_', $key );
598
  $data->$key = $value;
599
  }
600
  }
601
  } elseif ( is_array( $data ) ) {
602
  foreach ( $data as $key => $value ) {
603
  if ( substr_count( $key, '-' ) ) {
604
+ unset( $data[ $key ] );
605
+
606
+ $key = str_replace( '-', '_', $key );
607
+ $data[ $key ] = $value;
608
  }
609
  }
610
  }
611
+
612
  return $data;
613
  }
614
+
615
+ public static function get_modified_provider( $access_token = null ) {
616
+ if ( empty( $access_token ) ) {
617
+ return [];
618
+ }
619
+ return [
620
+ '#https?://www\.facebook\.com/.*/posts/.*#i' => [
621
+ 'https://graph.facebook.com/v8.0/oembed_post?access_token=' . $access_token,
622
+ true
623
+ ],
624
+ '#https?://www\.facebook\.com/.*/activity/.*#i' => [
625
+ 'https://graph.facebook.com/v8.0/oembed_post?access_token=' . $access_token,
626
+ true
627
+ ],
628
+ '#https?://www\.facebook\.com/.*/photos/.*#i' => [
629
+ 'https://graph.facebook.com/v8.0/oembed_post?access_token=' . $access_token,
630
+ true
631
+ ],
632
+ '#https?://www\.facebook\.com/photo(s/|\.php).*#i' => [
633
+ 'https://graph.facebook.com/v8.0/oembed_post?access_token=' . $access_token,
634
+ true
635
+ ],
636
+ '#https?://www\.facebook\.com/permalink\.php.*#i' => [
637
+ 'https://graph.facebook.com/v8.0/oembed_post?access_token=' . $access_token,
638
+ true
639
+ ],
640
+ '#https?://www\.facebook\.com/media/.*#i' => [
641
+ 'https://graph.facebook.com/v8.0/oembed_post?access_token=' . $access_token,
642
+ true
643
+ ],
644
+ '#https?://www\.facebook\.com/questions/.*#i' => [
645
+ 'https://graph.facebook.com/v8.0/oembed_post?access_token=' . $access_token,
646
+ true
647
+ ],
648
+ '#https?://www\.facebook\.com/notes/.*#i' => [
649
+ 'https://graph.facebook.com/v8.0/oembed_post?access_token=' . $access_token,
650
+ true
651
+ ],
652
+ '#https?://www\.facebook\.com/.*/videos/.*#i' => [
653
+ 'https://graph.facebook.com/v8.0/oembed_video?access_token=' . $access_token,
654
+ true
655
+ ],
656
+ '#https?://www\.facebook\.com/video\.php.*#i' => [
657
+ 'https://graph.facebook.com/v8.0/oembed_video?access_token=' . $access_token,
658
+ true
659
+ ],
660
+ '#https?://www\.facebook\.com/watch/?\?v=\d+#i' => [
661
+ 'https://graph.facebook.com/v8.0/oembed_video?access_token=' . $access_token,
662
+ true
663
+ ],
664
+
665
+ '#https?://(www\.)?instagr(\.am|am\.com)/(p|tv)/.*#i' => [
666
+ 'https://graph.facebook.com/v8.0/instagram_oembed?access_token=' . $access_token,
667
+ true
668
+ ]
669
+ ];
670
+ }
671
+
672
+ public static function get_access_token() {
673
+ $plgSettings = Core::getSettings();
674
+ if ( !empty( $plgSettings->facebook_app_code ) && !empty( $plgSettings->facebook_app_secret ) ) {
675
+ return urlencode( $plgSettings->facebook_app_code . '|' . $plgSettings->facebook_app_secret );
676
+ } else {
677
+ return null;
678
+ }
679
+ }
680
  }
Gutenberg/dist/blocks.build.js CHANGED
@@ -1 +1 @@
1
- !function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=5)}([function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"g",function(){return c}),n.d(t,"f",function(){return s}),n.d(t,"d",function(){return u}),n.d(t,"c",function(){return p}),n.d(t,"e",function(){return m}),n.d(t,"h",function(){return d}),n.d(t,"i",function(){return f}),n.d(t,"j",function(){return h}),n.d(t,"a",function(){return w});var r=wp.components,i=r.G,l=r.Path,o=(r.Polygon,r.SVG),a=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#2196F3"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(l,{style:{fill:"#BBDEFB"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(l,{style:{fill:"#1565C0"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 23 L 33 23 L 33 25 L 15 25 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 27 L 33 27 L 33 29 L 15 29 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 31 L 33 31 L 33 33 L 15 33 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 35 L 25 35 L 25 37 L 15 37 Z "}))),c=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink","enable-background":"new 0 0 24 24",id:"Layer_2",version:"1.1",viewBox:"0 0 24 24"},wp.element.createElement(i,null,wp.element.createElement(l,{d:"M21,6l-6-6H5C3.8954306,0,3,0.8954305,3,2v20c0,1.1045704,0.8954306,2,2,2h14c1.1045704,0,2-0.8954296,2-2 V6z",style:{fill:"#FFC720"}}),wp.element.createElement(l,{d:"M17,6c-0.5444336,0-1.0367432-0.2190552-1.3973999-0.5719604L21,10.8254395V6H17z",style:{fill:"url(#SVGID_1_)"}}),wp.element.createElement(l,{d:"M19,23.75H5c-1.1045532,0-2-0.8954468-2-2V22c0,1.1045532,0.8954468,2,2,2h14c1.1045532,0,2-0.8954468,2-2 v-0.25C21,22.8545532,20.1045532,23.75,19,23.75z",style:{opacity:"0.1"}}),wp.element.createElement(l,{d:"M15,0v4c0,1.1045694,0.8954306,2,2,2h4L15,0z",style:{fill:"#FFE083"}}),wp.element.createElement(l,{d:"M17,5.75c-1.1045532,0-2-0.8954468-2-2V4c0,1.1045532,0.8954468,2,2,2h4l-0.25-0.25H17z",style:{opacity:"0.1"}}),wp.element.createElement(l,{d:"M15,0H5C3.8954468,0,3,0.8953857,3,2v0.25c0-1.1046143,0.8954468-2,2-2h10",style:{fill:"#FFFFFF",opacity:"0.2"}}),wp.element.createElement(l,{d:"M15.5,9h-7C7.6728516,9,7,9.6728516,7,10.5v6C7,17.3271484,7.6728516,18,8.5,18h7 c0.8271484,0,1.5-0.6728516,1.5-1.5v-6C17,9.6728516,16.3271484,9,15.5,9z M8,15.5V11h8v4.5H8z",style:{fill:"#FFFFFF"}}),wp.element.createElement(l,{d:"M21,6l-6-6H5C3.8954306,0,3,0.8954305,3,2v20c0,1.1045704,0.8954306,2,2,2h14 c1.1045704,0,2-0.8954296,2-2V6z",style:{fill:"url(#SVGID_2_)"}})),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null)),s=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#43A047"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(l,{style:{fill:"#C8E6C9"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(l,{style:{fill:"#2E7D32"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 31 23 L 15 23 L 15 37 L 33 37 L 33 23 Z M 17 25 L 21 25 L 21 27 L 17 27 Z M 17 29 L 21 29 L 21 31 L 17 31 Z M 17 33 L 21 33 L 21 35 L 17 35 Z M 31 35 L 23 35 L 23 33 L 31 33 Z M 31 31 L 23 31 L 23 29 L 31 29 Z M 31 27 L 23 27 L 23 25 L 31 25 Z "}))),u=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#7850C1"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(l,{style:{fill:"#C2ABE1"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(l,{style:{fill:"#2E7D32"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 19 23 L 33 23 L 33 25 L 19 25 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 19 28 L 33 28 L 33 30 L 19 30 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 19 33 L 33 33 L 33 35 L 19 35 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 15 23 L 17 23 L 17 25 L 15 25 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 15 28 L 17 28 L 17 30 L 15 30 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 15 33 L 17 33 L 17 35 L 15 35 Z "}))),p=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#DE5245"},d:"M37,45H11c-1.7,0-3-1.3-3-3V6c0-1.7,1.3-3,3-3h19l10,10v29C40,43.7,38.7,45,37,45z"}),wp.element.createElement(l,{style:{fill:"#EEA6A0"},d:"M40,13H30V3L40,13z"}),wp.element.createElement(l,{style:{fill:"#B3433A"},d:"M30,13l10,10V13H30z"}),wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M20.5,32c-3,0-5.5-2.5-5.5-5.5c0-3,2.5-5.5,5.5-5.5s5.5,2.5,5.5,5.5C26,29.5,23.5,32,20.5,32z M20.5,23c-1.9,0-3.5,1.6-3.5,3.5s1.6,3.5,3.5,3.5s3.5-1.6,3.5-3.5S22.4,23,20.5,23z"}),wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M27.6,29c-0.6,1.8-1.9,3.3-3.6,4.1V38h9v-9H27.6z"}))),m=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#1C9957"},d:"M 42 39 L 42 9 C 42 7.34375 40.65625 6 39 6 L 9 6 C 7.34375 6 6 7.34375 6 9 L 6 39 C 6 40.65625 7.34375 42 9 42 L 39 42 C 40.65625 42 42 40.65625 42 39 Z "}),wp.element.createElement(l,{style:{fill:"#3E7BF1"},d:"M 9 42 L 39 42 C 40.65625 42 24 26 24 26 C 24 26 7.34375 42 9 42 Z "}),wp.element.createElement(l,{style:{fill:"#CBCCC9"},d:"M 42 39 L 42 9 C 42 7.34375 26 24 26 24 C 26 24 42 40.65625 42 39 Z "}),wp.element.createElement(l,{style:{fill:"#EFEFEF"},d:"M 39 42 C 40.65625 42 42 40.65625 42 39 L 42 38.753906 L 26.246094 23 L 23 26.246094 L 38.753906 42 Z "}),wp.element.createElement(l,{style:{fill:"#FFD73D"},d:"M 42 9 C 42 7.34375 40.65625 6 39 6 L 38.753906 6 L 6 38.753906 L 6 39 C 6 40.65625 7.34375 42 9 42 L 9.246094 42 L 42 9.246094 Z "}),wp.element.createElement(l,{style:{fill:"#D73F35"},d:"M 36 2 C 30.476563 2 26 6.476563 26 12 C 26 18.8125 33.664063 21.296875 35.332031 31.851563 C 35.441406 32.53125 35.449219 33 36 33 C 36.550781 33 36.558594 32.53125 36.667969 31.851563 C 38.335938 21.296875 46 18.8125 46 12 C 46 6.476563 41.523438 2 36 2 Z "}),wp.element.createElement(l,{style:{fill:"#752622"},d:"M 39.5 12 C 39.5 13.933594 37.933594 15.5 36 15.5 C 34.066406 15.5 32.5 13.933594 32.5 12 C 32.5 10.066406 34.066406 8.5 36 8.5 C 37.933594 8.5 39.5 10.066406 39.5 12 Z "}),wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M 14.492188 12.53125 L 14.492188 14.632813 L 17.488281 14.632813 C 17.09375 15.90625 16.03125 16.816406 14.492188 16.816406 C 12.660156 16.816406 11.175781 15.332031 11.175781 13.5 C 11.175781 11.664063 12.660156 10.179688 14.492188 10.179688 C 15.316406 10.179688 16.070313 10.484375 16.648438 10.980469 L 18.195313 9.433594 C 17.21875 8.542969 15.921875 8 14.492188 8 C 11.453125 8 8.992188 10.464844 8.992188 13.5 C 8.992188 16.535156 11.453125 19 14.492188 19 C 19.304688 19 20.128906 14.683594 19.675781 12.539063 Z "}))),d=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M 12 32 L 12 8 L 39 8 L 39 26 L 33 32 L 24 32 L 18 38 L 18 32 Z "}),wp.element.createElement(l,{style:{fill:"#8E24AA"},d:"M 9 5 L 6 12.121094 L 6 38 L 15 38 L 15 43 L 20 43 L 25 38 L 32 38 L 42 28 L 42 5 Z M 38 26 L 33 31 L 24 31 L 19 36 L 19 31 L 13 31 L 13 9 L 38 9 Z "}),wp.element.createElement(l,{style:{fill:"#8E24AA"},d:"M 32 25 L 27 25 L 27 15 L 32 15 Z "}),wp.element.createElement(l,{style:{fill:"#8E24AA"},d:"M 24 25 L 19 25 L 19 15 L 24 15 Z "}))),f=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 769 598",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#148ee0"},d:"M766.89,229.17c0,0 -17.78,35.38 -106.5,91.3c-37.82,23.79 -116.36,49.1 -217.33,58.86c-54.52,5.29 -154.9,0.99 -197.96,0.99c-43.29,0 -63.13,9.12 -101.95,52.84c-143.15,161.36 -143.15,161.36 -143.15,161.36c0,0 49.57,0.24 87.01,0.24c37.43,0 271.55,13.59 375.43,-14.98c337.36,-92.72 304.46,-350.62 304.46,-350.62z"}),wp.element.createElement(l,{style:{fill:"#54bbff"},d:"M757.84,126.66c16.23,-98.97 -39.68,-126.16 -39.68,-126.16c0,0 2.36,80.57 -145.7,97.65c-131.42,15.16 -572.46,3.74 -572.46,3.74c0,0 0,0 141.74,162.54c38.39,44.06 58.76,49.17 101.92,52.22c43.16,2.89 138.42,1.86 202.99,-3.05c70.58,-5.41 171.17,-28.43 239.19,-81.11c34.88,-26.98 65.21,-64.48 72,-105.83z"}))),h=wp.element.createElement(o,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},wp.element.createElement(l,{d:"M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z"})),w=(wp.element.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 56 23"},wp.element.createElement("g",null,wp.element.createElement("g",null,wp.element.createElement("path",{style:{fill:"#DA2B28"},className:"st0",d:"M55.4,3.7c-0.2-0.9-0.6-1.6-1.3-2.2c-0.7-0.6-1.4-0.9-2.3-1c-2.7-0.3-6.8-0.4-12.3-0.4\r c-5.5,0-9.6,0.1-12.3,0.4c-0.9,0.1-1.6,0.5-2.3,1c-0.7,0.6-1.1,1.3-1.3,2.2c-0.4,1.7-0.6,4.3-0.6,7.8c0,3.5,0.2,6.1,0.6,7.8\r c0.2,0.9,0.6,1.6,1.3,2.2c0.7,0.6,1.4,0.9,2.3,1c2.7,0.3,6.8,0.5,12.3,0.5c5.5,0,9.6-0.2,12.3-0.5c0.9-0.1,1.6-0.4,2.3-1\r c0.7-0.6,1.1-1.3,1.3-2.2c0.4-1.7,0.6-4.3,0.6-7.8C56,8,55.8,5.4,55.4,3.7L55.4,3.7z M32.5,6h-2.4v12.6h-2.2V6h-2.3V3.9h6.9V6z\r M38.5,18.6h-2v-1.2c-0.8,0.9-1.6,1.4-2.3,1.4c-0.7,0-1.1-0.3-1.3-0.8c-0.1-0.4-0.2-0.9-0.2-1.6V7.6h2v8.1c0,0.5,0,0.7,0,0.8\r c0,0.3,0.2,0.5,0.5,0.5c0.4,0,0.8-0.3,1.3-0.9V7.6h2V18.6z M46.1,15.3c0,1.1-0.1,1.8-0.2,2.2c-0.3,0.8-0.8,1.2-1.6,1.2\r c-0.7,0-1.4-0.4-2.1-1.2v1.1h-2V3.9h2v4.8c0.6-0.8,1.3-1.2,2.1-1.2c0.8,0,1.3,0.4,1.6,1.2c0.1,0.4,0.2,1.1,0.2,2.2V15.3z\r M53.5,13.5h-4v1.9c0,1,0.3,1.5,1,1.5c0.5,0,0.8-0.3,0.9-0.8c0-0.1,0-0.6,0-1.4h2v0.3c0,0.7,0,1.2,0,1.3c0,0.4-0.2,0.8-0.5,1.2\r c-0.5,0.8-1.3,1.2-2.4,1.2c-1,0-1.8-0.4-2.4-1.1c-0.4-0.5-0.6-1.4-0.6-2.6v-3.8c0-1.2,0.2-2,0.6-2.6c0.6-0.8,1.4-1.1,2.4-1.1\r c1,0,1.8,0.4,2.3,1.1c0.4,0.5,0.6,1.4,0.6,2.6V13.5z M53.5,13.5"}),wp.element.createElement("path",{className:"st0",d:"M43.2,9.3c-0.3,0-0.7,0.2-1,0.5v6.7c0.3,0.3,0.7,0.5,1,0.5c0.6,0,0.9-0.5,0.9-1.5v-4.7\r C44.1,9.8,43.8,9.3,43.2,9.3L43.2,9.3z M43.2,9.3"}),wp.element.createElement("path",{className:"st0",d:"M50.6,9.3c-0.7,0-1,0.5-1,1.5v1h2v-1C51.6,9.8,51.2,9.3,50.6,9.3L50.6,9.3z M50.6,9.3"})),wp.element.createElement("g",null,wp.element.createElement("path",{d:"M2.8,12.8v6h2.2v-6L7.7,4H5.5L4,9.8L2.4,4H0.1c0.4,1.2,0.9,2.6,1.4,4.1C2.2,10.2,2.6,11.7,2.8,12.8L2.8,12.8z M2.8,12.8"}),wp.element.createElement("path",{d:"M10.7,19c1,0,1.8-0.4,2.3-1.1c0.4-0.5,0.6-1.4,0.6-2.6v-3.9c0-1.2-0.2-2-0.6-2.6c-0.5-0.8-1.3-1.1-2.3-1.1\r c-1,0-1.8,0.4-2.3,1.1C8,9.3,7.8,10.2,7.8,11.4v3.9c0,1.2,0.2,2.1,0.6,2.6C8.9,18.6,9.7,19,10.7,19L10.7,19z M9.8,11\r c0-1,0.3-1.5,1-1.5c0.6,0,1,0.5,1,1.5v4.7c0,1-0.3,1.6-1,1.6c-0.6,0-1-0.5-1-1.6V11z M9.8,11"}),wp.element.createElement("path",{d:"M16.8,19c0.7,0,1.5-0.5,2.3-1.4v1.2h2V7.8h-2v8.4c-0.4,0.6-0.9,1-1.3,1c-0.3,0-0.4-0.2-0.5-0.5c0,0,0-0.3,0-0.8V7.8h-2\r v8.7c0,0.8,0.1,1.3,0.2,1.7C15.7,18.7,16.1,19,16.8,19L16.8,19z M16.8,19"})))),wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 276 340"},wp.element.createElement("path",{d:"M196.7.6H24.3C11.1.6.4 11.3.4 24.6v292.9c0 12.3 10 22.2 22.2 22.2H252c13.3 0 23.9-10.7 23.9-23.9V80.9L196.7.6z",fill:"#e94848"}),wp.element.createElement("path",{d:"M196.7 57c0 13.3 10.7 23.9 23.9 23.9H276L196.7.6V57z",fill:"#f19191"}),wp.element.createElement("linearGradient",{id:"A",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"77.111",x2:"116.568",y2:"77.111"},wp.element.createElement("stop",{offset:"0","stop-color":"#fff"}),wp.element.createElement("stop",{offset:"1","stop-color":"#fff0f0"})),wp.element.createElement("path",{d:"M113 84.5H48.3c-1.9 0-3.5-1.6-3.5-3.5v-7.7c0-1.9 1.6-3.5 3.5-3.5H113c1.9 0 3.5 1.6 3.5 3.5V81c.1 1.9-1.5 3.5-3.5 3.5z",fill:"url(#A)"}),wp.element.createElement("linearGradient",{id:"B",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"136.016",x2:"233.927",y2:"136.016"},wp.element.createElement("stop",{offset:"0","stop-color":"#fff"}),wp.element.createElement("stop",{offset:"1","stop-color":"#fff0f0"})),wp.element.createElement("use",{href:"#H",opacity:".8",fill:"url(#B)"}),wp.element.createElement("linearGradient",{id:"C",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"135.993",x2:"233.927",y2:"135.993"},wp.element.createElement("stop",{offset:"0","stop-color":"#fff"}),wp.element.createElement("stop",{offset:"1","stop-color":"#fff0f0"})),wp.element.createElement("use",{href:"#H",y:"33.6",opacity:".7",fill:"url(#C)"}),wp.element.createElement("linearGradient",{id:"D",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"135.969",x2:"233.927",y2:"135.969"},wp.element.createElement("stop",{offset:"0","stop-color":"#fff"}),wp.element.createElement("stop",{offset:"1","stop-color":"#fff0f0"})),wp.element.createElement("use",{href:"#H",y:"67.2",opacity:".6",fill:"url(#D)"}),wp.element.createElement("linearGradient",{id:"E",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"136.045",x2:"233.927",y2:"136.045"},wp.element.createElement("stop",{offset:"0","stop-color":"#fff"}),wp.element.createElement("stop",{offset:"1","stop-color":"#fff0f0"})),wp.element.createElement("use",{href:"#H",y:"100.7",opacity:".4",fill:"url(#E)"}),wp.element.createElement("linearGradient",{id:"F",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"270.322",x2:"174.778",y2:"270.322"},wp.element.createElement("stop",{offset:"0","stop-color":"#fff"}),wp.element.createElement("stop",{offset:"1","stop-color":"#fff0f0"})),wp.element.createElement("path",{d:"M171.9 277.7H47.6c-1.6 0-2.9-1.3-2.9-2.9v-9c0-1.6 1.3-2.9 2.9-2.9h124.3c1.6 0 2.9 1.3 2.9 2.9v9c0 1.6-1.3 2.9-2.9 2.9z",opacity:".3",fill:"url(#F)"}),wp.element.createElement("defs",null,wp.element.createElement("path",{id:"H",d:"M231 143.4H47.6c-1.6 0-2.9-1.3-2.9-2.9v-9c0-1.6 1.3-2.9 2.9-2.9H231c1.6 0 2.9 1.3 2.9 2.9v9c0 1.6-1.3 2.9-2.9 2.9z"}))))},function(e,t,n){"use strict";var r=wp.i18n.__,i=wp.components.Spinner,l=function(){return wp.element.createElement("div",{className:"wp-block-embed is-loading"},wp.element.createElement(i,null),wp.element.createElement("p",null,r("Embedding\u2026")))};t.a=l},function(e,t,n){"use strict";var r=wp.i18n.__,i=wp.element.Fragment,l=wp.components,o=l.IconButton,a=l.Toolbar,c=wp.editor.BlockControls,s=function(e){var t=e.showEditButton,n=e.switchBackToURLInput;return wp.element.createElement(i,null,wp.element.createElement(c,null,wp.element.createElement(a,null,t&&wp.element.createElement(o,{className:"components-toolbar__control",label:r("Edit URL"),icon:"edit",onClick:n}))))};t.a=s},function(e,t,n){"use strict";var r=n(10),i=n.n(r),l=wp.i18n,o=l.__,a=l._x,c=wp.components,s=c.Button,u=c.Placeholder,p=c.ExternalLink,m=wp.blockEditor.BlockIcon,d=function(e){var t=e.icon,n=e.label,r=e.value,l=e.onSubmit,c=e.onChange,d=e.cannotEmbed,f=e.docLink,h=e.DocTitle,w=i()("wp-block-embed",{});return wp.element.createElement("div",null,wp.element.createElement(u,{icon:wp.element.createElement(m,{icon:t,showColors:!0}),label:n,className:w},wp.element.createElement("form",{onSubmit:l},wp.element.createElement("input",{type:"url",value:r||"",className:"components-placeholder__input","aria-label":n,placeholder:o("Enter URL to embed here\u2026"),onChange:c}),wp.element.createElement(s,{isLarge:!0,type:"submit"},a("Embed","button label")),d&&wp.element.createElement("p",{className:"components-placeholder__error"},o("Sorry, we could not embed that content."),wp.element.createElement("br",null))),f&&wp.element.createElement("div",{className:"components-placeholder__learn-more"},wp.element.createElement(p,{href:f},h))))};t.a=d},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function l(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)}var o=n(11),a=n.n(o),c=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(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=wp.element.Component,p=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return l(t,e),s(t,[{key:"componentDidMount",value:function(){a.a.findDOMNode(this.refs.iframe).addEventListener("load",this.props.onLoad)}},{key:"render",value:function(){return wp.element.createElement("iframe",c({ref:"iframe"},this.props))}}]),t}(u);t.a=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(6),n(12),n(16),n(20),n(24),n(28),n(32),n(36),n(40),n(44);!function(){var e=wp.element.createElement("svg",{width:"33",height:"20",version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 270 270"},wp.element.createElement("g",null,wp.element.createElement("polygon",{className:"st0",fill:"#9595C1",points:"0,0 0,52 15,52 15,15 52,15 52,0 \t"}),wp.element.createElement("polygon",{className:"st0",fill:"#9595C1",points:"255,218 255,255 218,255 218,270 270,270 270,218 \t"}),wp.element.createElement("path",{fill:"#5B4E96",d:"M260.7,68.1c-10.4-18.6-29.3-31.2-50.6-33.6c-12.4-1.4-25,0.6-36.3,6c-1.3,0.6-2.6,1.3-3.9,2\r C154.5,51,143,65.3,138.3,81.7l0,0.1l-36.4,103.8c-3.1,9.4-9.1,17-17.1,21.4c-0.7,0.4-1.4,0.7-2.1,1.1c-6.1,2.9-12.8,4-19.5,3.2\r c-11.5-1.3-21.6-8.1-27.2-18.1c-4.6-8.3-5.7-18-3.1-27.2c2.6-9.2,8.7-16.9,17.1-21.5c0.7-0.4,1.4-0.8,2.1-1.1\r c6.1-2.9,12.7-4,19.6-3.2c0.3,0,0.5,0.1,0.8,0.1L64.9,162c-0.5,1.5,0.3,3.1,1.8,3.6l19.4,6.3c1.5,0.5,3-0.3,3.5-1.7l16.7-47.4\r c0.4-1.2,0.3-2.5-0.3-3.6c-0.6-1.1-1.6-2-2.8-2.4l-17.6-5.1c-0.4-0.1-0.8-0.2-1.2-0.3l-1.6-0.5l0,0.1c-2.5-0.6-5-1.1-7.5-1.3\r c-12.5-1.4-25.1,0.6-36.4,6c-1.3,0.6-2.6,1.3-3.9,2c-15.6,8.7-27,22.9-31.9,40.1c-4.9,17.1-2.8,35.1,5.8,50.5\r c10.4,18.6,29.3,31.2,50.6,33.6c12.4,1.4,25-0.6,36.3-6c1.3-0.6,2.6-1.3,3.9-2c15.3-8.5,26.8-22.8,31.6-39.2l0-0.1L167.8,91\r l0.1-0.2l0-0.1c4.1-10.5,9.3-17,17-21.3c0.7-0.4,1.4-0.7,2.1-1.1c6.1-2.9,12.8-4,19.5-3.2c11.5,1.3,21.6,8.1,27.2,18.1\r c9.6,17.2,3.3,39.1-14,48.7c-0.7,0.4-1.4,0.7-2.1,1.1c-6.1,2.9-12.8,4-19.7,3.2c-2-0.2-4.1-0.6-6.1-1.2l-0.2-0.1l-11.3-3.4\r c-1.2-0.4-2.5,0.3-2.9,1.5l-8.8,24.8c-0.5,1.3,0.3,2.7,1.6,3.1l13.9,4c3.4,0.9,6.8,1.6,10.3,2c12.4,1.4,25-0.6,36.3-6l0.1,0\r c1.3-0.6,2.6-1.3,3.9-2C266.8,140.8,278.5,100.1,260.7,68.1z"})));wp.blocks.updateCategory("embedpress",{icon:e})}()},function(e,t,n){"use strict";var r=n(7),i=(n.n(r),n(8)),l=(n.n(i),n(9)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-docs-block",{title:a("Google Docs"),icon:o.b,category:"embedpress",keywords:[a("embedpress"),a("google"),a("docs")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("figure",{className:"ose-google-docs-document"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))},deprecated:[{attributes:{align:{type:"string",enum:["left","center","right","wide","full"]}},save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("div",{className:"ose-google-docs-document"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function l(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)}var o=n(2),a=n(1),c=n(3),s=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element.Component,f=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.updateAlignment=e.updateAlignment.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"updateAlignment",value:function(e){var t=this.props.setAttributes,n=-1!==["wide","full"].indexOf(e)?{width:void 0,height:void 0}:{};t(Object.assign({},n,{align:e}))}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=i.exec(r),o=l[1];o&&"document"==o?(r.match(/([?&])embedded=true/i)||(r.indexOf("?")>-1?r+="&embedded=true":r+="?embedded=true"),this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Google Docs URL");return!d||r?wp.element.createElement("div",null,wp.element.createElement(c.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.b,DocTitle:m("Learn more about Google doc embed"),docLink:"https://embedpress.com/docs/embed-google-docs-wordpress/"})):wp.element.createElement("div",null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(s.a,{src:d,onMouseUp:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(d);t.a=f},function(e,t,n){var r,i;!function(){"use strict";function n(){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 o=n.apply(null,r);o&&e.push(o)}else if("object"===i)for(var a in r)l.call(r,a)&&r[a]&&e.push(a)}}return e.join(" ")}var l={}.hasOwnProperty;"undefined"!==typeof e&&e.exports?(n.default=n,e.exports=n):(r=[],void 0!==(i=function(){return n}.apply(t,r))&&(e.exports=i))}()},function(e,t){e.exports=ReactDOM},function(e,t,n){"use strict";var r=n(13),i=(n.n(r),n(14)),l=(n.n(i),n(15)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-slides-block",{title:a("Google Slides"),icon:o.g,category:"embedpress",keywords:[a("embedpress"),a("google"),a("slides")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-presentation"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function l(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)}var o=n(2),a=n(1),c=n(3),s=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,w=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=i.exec(r),o=l[1];o&&"presentation"==o?(r.match(/pub\?/i)&&(r=r.replace("/pub?","/embed?")),this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Google Slides URL");return!d||r?wp.element.createElement(c.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.g,DocTitle:m("Learn more about Google slides embed"),docLink:"https://embedpress.com/docs/embed-google-slides-wordpress/"}):wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(s.a,{src:d,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f);t.a=w},function(e,t,n){"use strict";var r=n(17),i=(n.n(r),n(18)),l=(n.n(i),n(19)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-sheets-block",{title:a("Google Sheets"),icon:o.f,category:"embedpress",keywords:[a("embedpress"),a("google"),a("sheets")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-spreadsheets"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))},deprecated:[{attributes:{align:{type:"string",enum:["left","center","right","wide","full"]}},save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("div",{className:"ose-google-docs-spreadsheets"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function l(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)}var o=n(2),a=n(1),c=n(3),s=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,w=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=i.exec(r),o=l[1];if(o&&"spreadsheets"==o){if(r.indexOf("?")>-1){var a=r.split("?");if(a=a[1],a=a.split("&"),console.log(a),a.length>0){var c=!1,s=!1;a.map(function(e){e.indexOf("widget=")?s=!0:e.indexOf("headers=")&&(c=!0)}),s||(r+="&widget=true"),c||(r+="&headers=false")}}else r+="?widget=true&headers=false";this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})}else this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Google Sheets URL");return!d||r?wp.element.createElement(c.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.f,DocTitle:m("Learn more about Google sheet embed"),docLink:"https://embedpress.com/docs/embed-google-sheets-wordpress/"}):wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(s.a,{src:d,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f);t.a=w},function(e,t,n){"use strict";var r=n(21),i=(n.n(r),n(22)),l=(n.n(i),n(23)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-forms-block",{title:a("Google Forms"),icon:o.d,category:"embedpress",keywords:[a("embedpress"),a("google"),a("forms")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-forms"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function l(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)}var o=n(2),a=n(1),c=n(3),s=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,w=(wp.components.Disabled,function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=i.exec(r),o=l[1];o&&"forms"==o?(this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Google Forms URL");return!d||r?wp.element.createElement(c.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.d,DocTitle:m("Learn more about Google forms embed"),docLink:"https://embedpress.com/docs/embed-google-forms-wordpress/"}):wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(s.a,{src:d,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f));t.a=w},function(e,t,n){"use strict";var r=n(25),i=(n.n(r),n(26)),l=(n.n(i),n(27)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-drawings-block",{title:a("Google Drawings"),icon:o.c,category:"embedpress",keywords:[a("embedpress"),a("google"),a("drawings")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-drawings"},wp.element.createElement("img",{src:t,width:"960",height:"720"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function l(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)}var o=n(2),a=n(1),c=n(3),s=n(0),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=wp.i18n.__,m=wp.element,d=m.Component,f=m.Fragment,h=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return l(t,e),u(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=i.exec(r),o=l[1];o&&"drawings"==o?(this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,u=this.props.attributes.iframeSrc,m=p("Google Drawings URL (Get your link from File -> Publish to the web -> Link)");return!u||r?wp.element.createElement(c.a,{label:m,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:s.c,DocTitle:p("Learn more about Google drawing embed"),docLink:"https://embedpress.com/docs/embed-google-drawings-wordpress/"}):wp.element.createElement(f,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement("img",{src:u,onLoad:this.onLoad,style:{display:i?"none":""},width:"960",height:"720"}),wp.element.createElement(o.a,{showEditButton:u&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(d);t.a=h},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(29),l=(n.n(i),n(30)),o=(n.n(l),n(31)),a=n(0),c=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-maps-block",{title:c("Google Maps"),icon:a.e,category:"embedpress",keywords:[c("embedpress"),c("google"),c("maps")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:o.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-maps"},wp.element.createElement("iframe",r({src:t,frameborder:"0",width:"600",height:"450"},"frameborder","0")))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function l(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)}var o=n(2),a=n(1),c=n(3),s=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,w=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/(?:(?:(?:www\.|maps\.)?(?:google\.com?))|(?:goo\.gl))(?:\.[a-z]{2})?\/(?:maps\/)?(?:place\/)?(?:[a-z0-9\/%+\-_]*)?([a-z0-9\/%,+\-_=!:@\.&*\$#?\']*)/i)){var r=this.decodeHTMLEntities(t);if(t.match("~(maps/embed|output=embed)~i"));else{var i=/@(-?[0-9\.]+,-?[0-9\.]+).+,([0-9\.]+[a-z])/i,l=i.exec(r);l&&l.length>1&&l[1]&&l[2]?r="https://maps.google.com/maps?hl=en&ie=UTF8&ll="+l[1]+"&spn="+l[1]+"&t=m&z="+Math.round(parseInt(l[2]))+"&output=embed":this.setState({cannotEmbed:!0,editingURL:!0})}this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Google Maps URL");return!d||r?wp.element.createElement(c.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.e,DocTitle:m("Learn more about Google map embed"),docLink:"https://embedpress.com/docs/embed-google-maps-wordpress/"}):wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(Disabled,null,wp.element.createElement(s.a,{src:d,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"})),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f);t.a=w},function(e,t,n){"use strict";var r=n(33),i=(n.n(r),n(34)),l=(n.n(i),n(35)),o=n(0),a=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},c=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/twitch-block",{title:c("Twitch"),icon:o.h,category:"embedpress",keywords:[c("embedpress"),c("twitch")],supports:{align:!0,lightBlockWrapper:!0},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""},attrs:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes,n=t.iframeSrc,r=t.attrs,i=n+"&parent="+embedpressObj.twitch_host;return wp.element.createElement("figure",{className:"ose-twitch-presentation"},wp.element.createElement("iframe",a({src:i},r,{frameborder:"0",width:"600",height:"450"})))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function l(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)}var o=n(2),a=n(1),c=n(3),s=n(4),u=n(0),p=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},m=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),d=wp.i18n.__,f=wp.element,h=f.Component,w=f.Fragment,b=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),m(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;n({url:t});var r=/http[s]?:\/\/(?:www\.|clips\.)twitch\.tv\/([0-9a-zA-Z\-\_]+)\/?(chat\/?$|[0-9a-z\-\_]*)?/;if(t&&t.match(r)){var i=this.decodeHTMLEntities(t),l=r.exec(i),o=l[1];console.log(o);var a,c="channel";switch(t.indexOf("clips.twitch.tv")>-1?c="clip":t.indexOf("/videos/")>-1?c="video":t.indexOf("#/chat$#")>-1&&(c="chat"),console.log(c),c){case"channel":i="https://player.twitch.tv/?channel="+o,a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"clip":i="https://clips.twitch.tv/embed?clip="+o+"&autoplay=false",a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"video":o=l[2],i="https://player.twitch.tv/?video="+o,a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"chat":i="http://www.twitch.tv/embed/"+o+"/chat",a={scrolling:"yes",frameborder:"0",allowfullscreen:"true",id:"'"+o+"'"}}this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:i,attrs:a})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,m=t.interactive,f=this.props.attributes,h=f.iframeSrc,b=f.attrs,y=d("Twitch URL");if(!h||r)return wp.element.createElement(c.a,{label:y,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.h,DocTitle:d("Learn more about twitch embed"),docLink:"https://embedpress.com/docs/embed-twitch-streams-chat/"});var v=h+"&parent="+embedpressObj.twitch_host;return wp.element.createElement(w,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(s.a,p({src:v},b,{onLoad:this.onLoad,style:{display:i?"none":""},onFocus:this.hideOverlay,width:"600",height:"450"})),!m&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:h&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(h);t.a=b},function(e,t,n){"use strict";var r=n(37),i=(n.n(r),n(38)),l=(n.n(i),n(39)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/wistia-block",{title:a("Wistia"),icon:o.i,category:"embedpress",keywords:[a("embedpress"),a("wistia")],supports:{align:!0,lightBlockWrapper:!0},edit:l.a,save:function(e){return null},deprecated:[{attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("div",{class:"ose-wistia"},wp.element.createElement("iframe",{src:t,allowtransparency:"true",frameborder:"0",class:"wistia_embed",name:"wistia_embed",width:"600",height:"330"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function l(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)}var o=n(2),a=n(1),c=n(3),s=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,w=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1,mediaId:null},e.setUrl(),e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"componentDidMount",value:function(){if(this.props.attributes.url){var e=this.props.attributes.url.match(/medias\/(.*)/),t=e[1];this.setState(Object.assign({},this.state,{mediaId:t}))}}},{key:"onLoad",value:function(){if(this.setState({fetching:!1}),embedpressObj.wisita_options){var e=Object.assign({},this.state);setTimeout(function(){var e=document.createElement("script");e.src="https://fast.wistia.com/assets/external/E-v1.js",e.charset="ISO-8859-1",document.body.appendChild(e)},100),setTimeout(function(){var t=document.createElement("script");t.type="text/javascript",t.innerHTML="window.pp_embed_wistia_labels = "+embedpressObj.wistia_labels,document.body.appendChild(t),t=document.createElement("script"),t.type="text/javascript",t.innerHTML='wistiaEmbed = Wistia.embed( "'+e.mediaId+'", '+embedpressObj.wisita_options+" );",document.body.appendChild(t)},400)}}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&(t.match(/^http[s]?:\/\/(?:www\.)?wistia\.com\/medias/i)||t.match(/^http[s]?:\/\/(?:www\.)?fast\/.wistia\.com\/embed\/medias/i.jsonp))){var r=t.match(/medias\/(.*)/),i=r[1],l="//fast.wistia.net/embed/iframe/"+i;this.setState({editingURL:!1,cannotEmbed:!1,mediaId:i}),n({iframeSrc:l})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Wistia URL");return!d||r?wp.element.createElement(c.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.i,DocTitle:m("Learn more about Wistia embed"),docLink:"https://embedpress.com/docs/embed-wistia-videos-wordpress/"}):wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement("div",{className:"ose-wistia",id:"wistia_"+this.state.mediaId},wp.element.createElement(s.a,{src:d,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"330",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"})),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f);t.a=w},function(e,t,n){"use strict";var r=n(41),i=(n.n(r),n(42)),l=(n.n(i),n(43)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/youtube-block",{title:a("Youtube"),icon:o.j,category:"embedpress",keywords:[a("embedpress"),a("youtube")],supports:{align:!0,lightBlockWrapper:!0},edit:l.a,save:function(){return null}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function l(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)}var o=n(2),a=n(1),c=n(3),s=n(4),u=n(0),p=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},m=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),d=wp.i18n.__,f=wp.element,h=f.Component,w=f.Fragment,b=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),m(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"componentWillMount",value:function(){this.state.url&&this.setUrl()}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;n({url:t});var r=t.match(/^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/);if(t&&r){var i=r[1],l="https://www.youtube.com/embed/"+i,o=new URL(l);if("undefined"!==typeof embedpressProObj)for(var a in embedpressProObj.youtubeParams)o.searchParams.set(a,embedpressProObj.youtubeParams[a]);this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:o.href,mediaId:i})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,m=t.interactive,f=this.props.attributes,h=f.iframeSrc,b=f.attrs,y=d("Youtube URL");return!h||r?wp.element.createElement(c.a,{label:y,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.j,DocTitle:d("Learn More About Youtube Embed"),docLink:"https://embedpress.com/docs/embed-youtube-wordpress/"}):wp.element.createElement(w,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(s.a,p({src:h},b,{onLoad:this.onLoad,style:{display:i?"none":""},width:"640",onFocus:this.hideOverlay,height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"})),!m&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:h&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(h);t.a=b},function(e,t,n){"use strict";var r=n(45),i=(n.n(r),n(46)),l=(n.n(i),n(47)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/document",{title:a("Document"),icon:o.a,category:"embedpress",keywords:[a("embedpress"),a("pdf"),a("doc"),a("ppt")],supports:{align:!0,lightBlockWrapper:!0},attributes:{id:{type:"string"},href:{type:"string"},powered_by:{type:"boolean",default:!0},width:{type:"number",default:600},height:{type:"number",default:600},fileName:{type:"string"},mime:{type:"string"}},edit:l.a,save:function(e){var t=e.attributes,n=t.href,r=t.mime,i=t.id,l=t.width,o=t.height,a=t.powered_by,c="//view.officeapps.live.com/op/embed.aspx?src="+n;return wp.element.createElement("figure",{className:"embedpress-embed-document"},"application/pdf"===r&&wp.element.createElement("div",{style:{height:o,width:l},className:"embedpress-embed-document-pdf "+i,"data-emid":i,"data-emsrc":n}),"application/pdf"!==r&&wp.element.createElement("iframe",{style:{height:o,width:l},src:c,mozallowfullscreen:"true",webkitallowfullscreen:"true"}),a&&wp.element.createElement("p",{className:"embedpress-el-powered"},"Powered By EmbedPress"))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function l(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)}var o=n(4),a=n(1),c=n(0),s=function(){function e(e,t){var n=[],r=!0,i=!1,l=void 0;try{for(var o,a=e[Symbol.iterator]();!(r=(o=a.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,l=e}finally{try{!r&&a.return&&a.return()}finally{if(i)throw l}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=wp.i18n.__,m=wp.blob,d=m.getBlobByURL,f=m.isBlobURL,h=m.revokeBlobURL,w=wp.editor,b=w.BlockIcon,y=w.MediaPlaceholder,v=w.InspectorControls,g=wp.element,E=g.Component,L=g.Fragment,k=wp.components,_=k.RangeControl,S=k.PanelBody,U=k.ExternalLink,O=k.ToggleControl,R=["application/pdf","application/msword","application/vnd.ms-powerpoint","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation"],M=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.onSelectFile=e.onSelectFile.bind(e),e.onUploadError=e.onUploadError.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={hasError:!1,fetching:!1,interactive:!1,loadPdf:!0},e}return l(t,e),u(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.attributes,r=t.mediaUpload,i=t.noticeOperations,l=n.href;if(f(l)){r({filesList:[d(l)],onFileChange:function(t){var n=s(t,1),r=n[0];return e.onSelectFile(r)},onError:function(t){e.setState({hasError:!0}),i.createErrorNotice(t)}}),h(l)}this.props.attributes.href&&"application/pdf"===this.props.attributes.mime&&this.state.loadPdf&&(this.setState({loadPdf:!1}),PDFObject.embed(this.props.attributes.href,"."+this.props.attributes.id))}},{key:"componentDidUpdate",value:function(e){e.isSelected&&!this.props.isSelected&&this.setState({showCopyConfirmation:!1})}},{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"onSelectFile",value:function(e){e&&e.url&&(this.setState({hasError:!1}),this.props.setAttributes({href:e.url,fileName:e.title,id:"embedpress-pdf-"+Date.now(),mime:e.mime}),embedpressObj.embedpress_pro&&this.props.setAttributes({powered_by:!1}),"application/pdf"===e.mime&&(this.setState({loadPdf:!1}),PDFObject.embed(e.url,"."+this.props.attributes.id)))}},{key:"onUploadError",value:function(e){var t=this.props.noticeOperations;t.removeAllNotices(),t.createErrorNotice(e)}},{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.noticeUI,r=e.setAttributes,i=t.href,l=t.mime,s=t.id,u=t.width,m=t.height,d=t.powered_by,f=this.state,h=f.hasError,w=f.interactive,g=f.fetching,E=f.loadPdf;if(!i||h)return wp.element.createElement("div",{className:"embedpress-document-editmode"},wp.element.createElement(y,{icon:wp.element.createElement(b,{icon:c.a}),labels:{title:p("Document"),instructions:p("Upload a file or pick one from your media library for embed.")},onSelect:this.onSelectFile,notices:n,allowedTypes:R,onError:this.onUploadError},wp.element.createElement("div",{style:{width:"100%"},className:"components-placeholder__learn-more embedpress-doc-link"},wp.element.createElement(U,{href:"https://embedpress.com/docs/embed-docuemnt/"},"Learn more about Embedded document "))));var k="//view.officeapps.live.com/op/embed.aspx?src="+i;return wp.element.createElement(L,null,g&&"application/pdf"!==l?wp.element.createElement(a.a,null):null,"application/pdf"===l&&wp.element.createElement("div",{style:{height:m,width:u},className:"embedpress-embed-document-pdf "+s,"data-emid":s,"data-emsrc":i}),"application/pdf"!==l&&wp.element.createElement(o.a,{onMouseUponMouseUp:this.hideOverlay,style:{height:m,width:u,display:g||!E?"none":""},onLoad:this.onLoad,src:k,mozallowfullscreen:"true",webkitallowfullscreen:"true"}),!w&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),d&&wp.element.createElement("p",{className:"embedpress-el-powered"},"Powered By EmbedPress"),wp.element.createElement(v,{key:"inspector"},wp.element.createElement(S,{title:p("Embed Size","embedpress")},wp.element.createElement(_,{label:p("Width","embedpress"),value:u,onChange:function(e){return r({width:e})},max:1e3,min:1}),wp.element.createElement(_,{label:p("Height","embedpress"),value:m,onChange:function(e){return r({height:e})},max:1e3,min:1}),wp.element.createElement(O,{label:p("Powered By"),onChange:function(e){return r({powered_by:e})},checked:d}))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(E);t.a=M}]);
1
+ !function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=5)}([function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"g",function(){return s}),n.d(t,"f",function(){return c}),n.d(t,"d",function(){return u}),n.d(t,"c",function(){return p}),n.d(t,"e",function(){return m}),n.d(t,"h",function(){return d}),n.d(t,"i",function(){return f}),n.d(t,"j",function(){return h}),n.d(t,"a",function(){return w});var r=wp.components,i=r.G,l=r.Path,o=(r.Polygon,r.SVG),a=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#2196F3"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(l,{style:{fill:"#BBDEFB"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(l,{style:{fill:"#1565C0"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 23 L 33 23 L 33 25 L 15 25 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 27 L 33 27 L 33 29 L 15 29 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 31 L 33 31 L 33 33 L 15 33 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 35 L 25 35 L 25 37 L 15 37 Z "}))),s=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink","enable-background":"new 0 0 24 24",id:"Layer_2",version:"1.1",viewBox:"0 0 24 24"},wp.element.createElement(i,null,wp.element.createElement(l,{d:"M21,6l-6-6H5C3.8954306,0,3,0.8954305,3,2v20c0,1.1045704,0.8954306,2,2,2h14c1.1045704,0,2-0.8954296,2-2 V6z",style:{fill:"#FFC720"}}),wp.element.createElement(l,{d:"M17,6c-0.5444336,0-1.0367432-0.2190552-1.3973999-0.5719604L21,10.8254395V6H17z",style:{fill:"url(#SVGID_1_)"}}),wp.element.createElement(l,{d:"M19,23.75H5c-1.1045532,0-2-0.8954468-2-2V22c0,1.1045532,0.8954468,2,2,2h14c1.1045532,0,2-0.8954468,2-2 v-0.25C21,22.8545532,20.1045532,23.75,19,23.75z",style:{opacity:"0.1"}}),wp.element.createElement(l,{d:"M15,0v4c0,1.1045694,0.8954306,2,2,2h4L15,0z",style:{fill:"#FFE083"}}),wp.element.createElement(l,{d:"M17,5.75c-1.1045532,0-2-0.8954468-2-2V4c0,1.1045532,0.8954468,2,2,2h4l-0.25-0.25H17z",style:{opacity:"0.1"}}),wp.element.createElement(l,{d:"M15,0H5C3.8954468,0,3,0.8953857,3,2v0.25c0-1.1046143,0.8954468-2,2-2h10",style:{fill:"#FFFFFF",opacity:"0.2"}}),wp.element.createElement(l,{d:"M15.5,9h-7C7.6728516,9,7,9.6728516,7,10.5v6C7,17.3271484,7.6728516,18,8.5,18h7 c0.8271484,0,1.5-0.6728516,1.5-1.5v-6C17,9.6728516,16.3271484,9,15.5,9z M8,15.5V11h8v4.5H8z",style:{fill:"#FFFFFF"}}),wp.element.createElement(l,{d:"M21,6l-6-6H5C3.8954306,0,3,0.8954305,3,2v20c0,1.1045704,0.8954306,2,2,2h14 c1.1045704,0,2-0.8954296,2-2V6z",style:{fill:"url(#SVGID_2_)"}})),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null)),c=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#43A047"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(l,{style:{fill:"#C8E6C9"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(l,{style:{fill:"#2E7D32"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 31 23 L 15 23 L 15 37 L 33 37 L 33 23 Z M 17 25 L 21 25 L 21 27 L 17 27 Z M 17 29 L 21 29 L 21 31 L 17 31 Z M 17 33 L 21 33 L 21 35 L 17 35 Z M 31 35 L 23 35 L 23 33 L 31 33 Z M 31 31 L 23 31 L 23 29 L 31 29 Z M 31 27 L 23 27 L 23 25 L 31 25 Z "}))),u=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#7850C1"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(l,{style:{fill:"#C2ABE1"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(l,{style:{fill:"#2E7D32"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 19 23 L 33 23 L 33 25 L 19 25 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 19 28 L 33 28 L 33 30 L 19 30 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 19 33 L 33 33 L 33 35 L 19 35 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 15 23 L 17 23 L 17 25 L 15 25 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 15 28 L 17 28 L 17 30 L 15 30 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 15 33 L 17 33 L 17 35 L 15 35 Z "}))),p=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#DE5245"},d:"M37,45H11c-1.7,0-3-1.3-3-3V6c0-1.7,1.3-3,3-3h19l10,10v29C40,43.7,38.7,45,37,45z"}),wp.element.createElement(l,{style:{fill:"#EEA6A0"},d:"M40,13H30V3L40,13z"}),wp.element.createElement(l,{style:{fill:"#B3433A"},d:"M30,13l10,10V13H30z"}),wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M20.5,32c-3,0-5.5-2.5-5.5-5.5c0-3,2.5-5.5,5.5-5.5s5.5,2.5,5.5,5.5C26,29.5,23.5,32,20.5,32z M20.5,23c-1.9,0-3.5,1.6-3.5,3.5s1.6,3.5,3.5,3.5s3.5-1.6,3.5-3.5S22.4,23,20.5,23z"}),wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M27.6,29c-0.6,1.8-1.9,3.3-3.6,4.1V38h9v-9H27.6z"}))),m=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#1C9957"},d:"M 42 39 L 42 9 C 42 7.34375 40.65625 6 39 6 L 9 6 C 7.34375 6 6 7.34375 6 9 L 6 39 C 6 40.65625 7.34375 42 9 42 L 39 42 C 40.65625 42 42 40.65625 42 39 Z "}),wp.element.createElement(l,{style:{fill:"#3E7BF1"},d:"M 9 42 L 39 42 C 40.65625 42 24 26 24 26 C 24 26 7.34375 42 9 42 Z "}),wp.element.createElement(l,{style:{fill:"#CBCCC9"},d:"M 42 39 L 42 9 C 42 7.34375 26 24 26 24 C 26 24 42 40.65625 42 39 Z "}),wp.element.createElement(l,{style:{fill:"#EFEFEF"},d:"M 39 42 C 40.65625 42 42 40.65625 42 39 L 42 38.753906 L 26.246094 23 L 23 26.246094 L 38.753906 42 Z "}),wp.element.createElement(l,{style:{fill:"#FFD73D"},d:"M 42 9 C 42 7.34375 40.65625 6 39 6 L 38.753906 6 L 6 38.753906 L 6 39 C 6 40.65625 7.34375 42 9 42 L 9.246094 42 L 42 9.246094 Z "}),wp.element.createElement(l,{style:{fill:"#D73F35"},d:"M 36 2 C 30.476563 2 26 6.476563 26 12 C 26 18.8125 33.664063 21.296875 35.332031 31.851563 C 35.441406 32.53125 35.449219 33 36 33 C 36.550781 33 36.558594 32.53125 36.667969 31.851563 C 38.335938 21.296875 46 18.8125 46 12 C 46 6.476563 41.523438 2 36 2 Z "}),wp.element.createElement(l,{style:{fill:"#752622"},d:"M 39.5 12 C 39.5 13.933594 37.933594 15.5 36 15.5 C 34.066406 15.5 32.5 13.933594 32.5 12 C 32.5 10.066406 34.066406 8.5 36 8.5 C 37.933594 8.5 39.5 10.066406 39.5 12 Z "}),wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M 14.492188 12.53125 L 14.492188 14.632813 L 17.488281 14.632813 C 17.09375 15.90625 16.03125 16.816406 14.492188 16.816406 C 12.660156 16.816406 11.175781 15.332031 11.175781 13.5 C 11.175781 11.664063 12.660156 10.179688 14.492188 10.179688 C 15.316406 10.179688 16.070313 10.484375 16.648438 10.980469 L 18.195313 9.433594 C 17.21875 8.542969 15.921875 8 14.492188 8 C 11.453125 8 8.992188 10.464844 8.992188 13.5 C 8.992188 16.535156 11.453125 19 14.492188 19 C 19.304688 19 20.128906 14.683594 19.675781 12.539063 Z "}))),d=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M 12 32 L 12 8 L 39 8 L 39 26 L 33 32 L 24 32 L 18 38 L 18 32 Z "}),wp.element.createElement(l,{style:{fill:"#8E24AA"},d:"M 9 5 L 6 12.121094 L 6 38 L 15 38 L 15 43 L 20 43 L 25 38 L 32 38 L 42 28 L 42 5 Z M 38 26 L 33 31 L 24 31 L 19 36 L 19 31 L 13 31 L 13 9 L 38 9 Z "}),wp.element.createElement(l,{style:{fill:"#8E24AA"},d:"M 32 25 L 27 25 L 27 15 L 32 15 Z "}),wp.element.createElement(l,{style:{fill:"#8E24AA"},d:"M 24 25 L 19 25 L 19 15 L 24 15 Z "}))),f=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 769 598",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#148ee0"},d:"M766.89,229.17c0,0 -17.78,35.38 -106.5,91.3c-37.82,23.79 -116.36,49.1 -217.33,58.86c-54.52,5.29 -154.9,0.99 -197.96,0.99c-43.29,0 -63.13,9.12 -101.95,52.84c-143.15,161.36 -143.15,161.36 -143.15,161.36c0,0 49.57,0.24 87.01,0.24c37.43,0 271.55,13.59 375.43,-14.98c337.36,-92.72 304.46,-350.62 304.46,-350.62z"}),wp.element.createElement(l,{style:{fill:"#54bbff"},d:"M757.84,126.66c16.23,-98.97 -39.68,-126.16 -39.68,-126.16c0,0 2.36,80.57 -145.7,97.65c-131.42,15.16 -572.46,3.74 -572.46,3.74c0,0 0,0 141.74,162.54c38.39,44.06 58.76,49.17 101.92,52.22c43.16,2.89 138.42,1.86 202.99,-3.05c70.58,-5.41 171.17,-28.43 239.19,-81.11c34.88,-26.98 65.21,-64.48 72,-105.83z"}))),h=wp.element.createElement(o,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},wp.element.createElement(l,{d:"M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z"})),w=(wp.element.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 56 23"},wp.element.createElement("g",null,wp.element.createElement("g",null,wp.element.createElement("path",{style:{fill:"#DA2B28"},className:"st0",d:"M55.4,3.7c-0.2-0.9-0.6-1.6-1.3-2.2c-0.7-0.6-1.4-0.9-2.3-1c-2.7-0.3-6.8-0.4-12.3-0.4 c-5.5,0-9.6,0.1-12.3,0.4c-0.9,0.1-1.6,0.5-2.3,1c-0.7,0.6-1.1,1.3-1.3,2.2c-0.4,1.7-0.6,4.3-0.6,7.8c0,3.5,0.2,6.1,0.6,7.8 c0.2,0.9,0.6,1.6,1.3,2.2c0.7,0.6,1.4,0.9,2.3,1c2.7,0.3,6.8,0.5,12.3,0.5c5.5,0,9.6-0.2,12.3-0.5c0.9-0.1,1.6-0.4,2.3-1 c0.7-0.6,1.1-1.3,1.3-2.2c0.4-1.7,0.6-4.3,0.6-7.8C56,8,55.8,5.4,55.4,3.7L55.4,3.7z M32.5,6h-2.4v12.6h-2.2V6h-2.3V3.9h6.9V6z M38.5,18.6h-2v-1.2c-0.8,0.9-1.6,1.4-2.3,1.4c-0.7,0-1.1-0.3-1.3-0.8c-0.1-0.4-0.2-0.9-0.2-1.6V7.6h2v8.1c0,0.5,0,0.7,0,0.8 c0,0.3,0.2,0.5,0.5,0.5c0.4,0,0.8-0.3,1.3-0.9V7.6h2V18.6z M46.1,15.3c0,1.1-0.1,1.8-0.2,2.2c-0.3,0.8-0.8,1.2-1.6,1.2 c-0.7,0-1.4-0.4-2.1-1.2v1.1h-2V3.9h2v4.8c0.6-0.8,1.3-1.2,2.1-1.2c0.8,0,1.3,0.4,1.6,1.2c0.1,0.4,0.2,1.1,0.2,2.2V15.3z M53.5,13.5h-4v1.9c0,1,0.3,1.5,1,1.5c0.5,0,0.8-0.3,0.9-0.8c0-0.1,0-0.6,0-1.4h2v0.3c0,0.7,0,1.2,0,1.3c0,0.4-0.2,0.8-0.5,1.2 c-0.5,0.8-1.3,1.2-2.4,1.2c-1,0-1.8-0.4-2.4-1.1c-0.4-0.5-0.6-1.4-0.6-2.6v-3.8c0-1.2,0.2-2,0.6-2.6c0.6-0.8,1.4-1.1,2.4-1.1 c1,0,1.8,0.4,2.3,1.1c0.4,0.5,0.6,1.4,0.6,2.6V13.5z M53.5,13.5"}),wp.element.createElement("path",{className:"st0",d:"M43.2,9.3c-0.3,0-0.7,0.2-1,0.5v6.7c0.3,0.3,0.7,0.5,1,0.5c0.6,0,0.9-0.5,0.9-1.5v-4.7 C44.1,9.8,43.8,9.3,43.2,9.3L43.2,9.3z M43.2,9.3"}),wp.element.createElement("path",{className:"st0",d:"M50.6,9.3c-0.7,0-1,0.5-1,1.5v1h2v-1C51.6,9.8,51.2,9.3,50.6,9.3L50.6,9.3z M50.6,9.3"})),wp.element.createElement("g",null,wp.element.createElement("path",{d:"M2.8,12.8v6h2.2v-6L7.7,4H5.5L4,9.8L2.4,4H0.1c0.4,1.2,0.9,2.6,1.4,4.1C2.2,10.2,2.6,11.7,2.8,12.8L2.8,12.8z M2.8,12.8"}),wp.element.createElement("path",{d:"M10.7,19c1,0,1.8-0.4,2.3-1.1c0.4-0.5,0.6-1.4,0.6-2.6v-3.9c0-1.2-0.2-2-0.6-2.6c-0.5-0.8-1.3-1.1-2.3-1.1 c-1,0-1.8,0.4-2.3,1.1C8,9.3,7.8,10.2,7.8,11.4v3.9c0,1.2,0.2,2.1,0.6,2.6C8.9,18.6,9.7,19,10.7,19L10.7,19z M9.8,11 c0-1,0.3-1.5,1-1.5c0.6,0,1,0.5,1,1.5v4.7c0,1-0.3,1.6-1,1.6c-0.6,0-1-0.5-1-1.6V11z M9.8,11"}),wp.element.createElement("path",{d:"M16.8,19c0.7,0,1.5-0.5,2.3-1.4v1.2h2V7.8h-2v8.4c-0.4,0.6-0.9,1-1.3,1c-0.3,0-0.4-0.2-0.5-0.5c0,0,0-0.3,0-0.8V7.8h-2 v8.7c0,0.8,0.1,1.3,0.2,1.7C15.7,18.7,16.1,19,16.8,19L16.8,19z M16.8,19"})))),wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 276 340"},wp.element.createElement("path",{d:"M196.7.6H24.3C11.1.6.4 11.3.4 24.6v292.9c0 12.3 10 22.2 22.2 22.2H252c13.3 0 23.9-10.7 23.9-23.9V80.9L196.7.6z",fill:"#e94848"}),wp.element.createElement("path",{d:"M196.7 57c0 13.3 10.7 23.9 23.9 23.9H276L196.7.6V57z",fill:"#f19191"}),wp.element.createElement("linearGradient",{id:"A",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"77.111",x2:"116.568",y2:"77.111"},wp.element.createElement("stop",{offset:"0","stop-color":"#fff"}),wp.element.createElement("stop",{offset:"1","stop-color":"#fff0f0"})),wp.element.createElement("path",{d:"M113 84.5H48.3c-1.9 0-3.5-1.6-3.5-3.5v-7.7c0-1.9 1.6-3.5 3.5-3.5H113c1.9 0 3.5 1.6 3.5 3.5V81c.1 1.9-1.5 3.5-3.5 3.5z",fill:"url(#A)"}),wp.element.createElement("linearGradient",{id:"B",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"136.016",x2:"233.927",y2:"136.016"},wp.element.createElement("stop",{offset:"0","stop-color":"#fff"}),wp.element.createElement("stop",{offset:"1","stop-color":"#fff0f0"})),wp.element.createElement("use",{href:"#H",opacity:".8",fill:"url(#B)"}),wp.element.createElement("linearGradient",{id:"C",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"135.993",x2:"233.927",y2:"135.993"},wp.element.createElement("stop",{offset:"0","stop-color":"#fff"}),wp.element.createElement("stop",{offset:"1","stop-color":"#fff0f0"})),wp.element.createElement("use",{href:"#H",y:"33.6",opacity:".7",fill:"url(#C)"}),wp.element.createElement("linearGradient",{id:"D",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"135.969",x2:"233.927",y2:"135.969"},wp.element.createElement("stop",{offset:"0","stop-color":"#fff"}),wp.element.createElement("stop",{offset:"1","stop-color":"#fff0f0"})),wp.element.createElement("use",{href:"#H",y:"67.2",opacity:".6",fill:"url(#D)"}),wp.element.createElement("linearGradient",{id:"E",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"136.045",x2:"233.927",y2:"136.045"},wp.element.createElement("stop",{offset:"0","stop-color":"#fff"}),wp.element.createElement("stop",{offset:"1","stop-color":"#fff0f0"})),wp.element.createElement("use",{href:"#H",y:"100.7",opacity:".4",fill:"url(#E)"}),wp.element.createElement("linearGradient",{id:"F",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"270.322",x2:"174.778",y2:"270.322"},wp.element.createElement("stop",{offset:"0","stop-color":"#fff"}),wp.element.createElement("stop",{offset:"1","stop-color":"#fff0f0"})),wp.element.createElement("path",{d:"M171.9 277.7H47.6c-1.6 0-2.9-1.3-2.9-2.9v-9c0-1.6 1.3-2.9 2.9-2.9h124.3c1.6 0 2.9 1.3 2.9 2.9v9c0 1.6-1.3 2.9-2.9 2.9z",opacity:".3",fill:"url(#F)"}),wp.element.createElement("defs",null,wp.element.createElement("path",{id:"H",d:"M231 143.4H47.6c-1.6 0-2.9-1.3-2.9-2.9v-9c0-1.6 1.3-2.9 2.9-2.9H231c1.6 0 2.9 1.3 2.9 2.9v9c0 1.6-1.3 2.9-2.9 2.9z"}))))},function(e,t,n){"use strict";var r=wp.i18n.__,i=wp.components.Spinner,l=function(){return wp.element.createElement("div",{className:"wp-block-embed is-loading"},wp.element.createElement(i,null),wp.element.createElement("p",null,r("Embedding\u2026")))};t.a=l},function(e,t,n){"use strict";var r=wp.i18n.__,i=wp.element.Fragment,l=wp.components,o=l.IconButton,a=l.Toolbar,s=wp.editor.BlockControls,c=function(e){var t=e.showEditButton,n=e.switchBackToURLInput;return wp.element.createElement(i,null,wp.element.createElement(s,null,wp.element.createElement(a,null,t&&wp.element.createElement(o,{className:"components-toolbar__control",label:r("Edit URL"),icon:"edit",onClick:n}))))};t.a=c},function(e,t,n){"use strict";var r=n(10),i=n.n(r),l=wp.i18n,o=l.__,a=l._x,s=wp.components,c=s.Button,u=s.Placeholder,p=s.ExternalLink,m=wp.blockEditor.BlockIcon,d=function(e){var t=e.icon,n=e.label,r=e.value,l=e.onSubmit,s=e.onChange,d=e.cannotEmbed,f=e.docLink,h=e.DocTitle,w=i()("wp-block-embed",{});return wp.element.createElement("div",null,wp.element.createElement(u,{icon:wp.element.createElement(m,{icon:t,showColors:!0}),label:n,className:w},wp.element.createElement("form",{onSubmit:l},wp.element.createElement("input",{type:"url",value:r||"",className:"components-placeholder__input","aria-label":n,placeholder:o("Enter URL to embed here\u2026"),onChange:s}),wp.element.createElement(c,{isLarge:!0,type:"submit"},a("Embed","button label")),d&&wp.element.createElement("p",{className:"components-placeholder__error"},o("Sorry, we could not embed that content."),wp.element.createElement("br",null))),f&&wp.element.createElement("div",{className:"components-placeholder__learn-more"},wp.element.createElement(p,{href:f},h))))};t.a=d},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function l(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)}var o=n(11),a=n.n(o),s=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},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=wp.element.Component,p=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return l(t,e),c(t,[{key:"componentDidMount",value:function(){a.a.findDOMNode(this.refs.iframe).addEventListener("load",this.props.onLoad)}},{key:"render",value:function(){return wp.element.createElement("iframe",s({ref:"iframe"},this.props))}}]),t}(u);t.a=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(6),n(12),n(16),n(20),n(24),n(28),n(32),n(36),n(40),n(44);!function(){var e=wp.element.createElement("svg",{width:"33",height:"20",version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 270 270"},wp.element.createElement("g",null,wp.element.createElement("polygon",{className:"st0",fill:"#9595C1",points:"0,0 0,52 15,52 15,15 52,15 52,0 \t"}),wp.element.createElement("polygon",{className:"st0",fill:"#9595C1",points:"255,218 255,255 218,255 218,270 270,270 270,218 \t"}),wp.element.createElement("path",{fill:"#5B4E96",d:"M260.7,68.1c-10.4-18.6-29.3-31.2-50.6-33.6c-12.4-1.4-25,0.6-36.3,6c-1.3,0.6-2.6,1.3-3.9,2 C154.5,51,143,65.3,138.3,81.7l0,0.1l-36.4,103.8c-3.1,9.4-9.1,17-17.1,21.4c-0.7,0.4-1.4,0.7-2.1,1.1c-6.1,2.9-12.8,4-19.5,3.2 c-11.5-1.3-21.6-8.1-27.2-18.1c-4.6-8.3-5.7-18-3.1-27.2c2.6-9.2,8.7-16.9,17.1-21.5c0.7-0.4,1.4-0.8,2.1-1.1 c6.1-2.9,12.7-4,19.6-3.2c0.3,0,0.5,0.1,0.8,0.1L64.9,162c-0.5,1.5,0.3,3.1,1.8,3.6l19.4,6.3c1.5,0.5,3-0.3,3.5-1.7l16.7-47.4 c0.4-1.2,0.3-2.5-0.3-3.6c-0.6-1.1-1.6-2-2.8-2.4l-17.6-5.1c-0.4-0.1-0.8-0.2-1.2-0.3l-1.6-0.5l0,0.1c-2.5-0.6-5-1.1-7.5-1.3 c-12.5-1.4-25.1,0.6-36.4,6c-1.3,0.6-2.6,1.3-3.9,2c-15.6,8.7-27,22.9-31.9,40.1c-4.9,17.1-2.8,35.1,5.8,50.5 c10.4,18.6,29.3,31.2,50.6,33.6c12.4,1.4,25-0.6,36.3-6c1.3-0.6,2.6-1.3,3.9-2c15.3-8.5,26.8-22.8,31.6-39.2l0-0.1L167.8,91 l0.1-0.2l0-0.1c4.1-10.5,9.3-17,17-21.3c0.7-0.4,1.4-0.7,2.1-1.1c6.1-2.9,12.8-4,19.5-3.2c11.5,1.3,21.6,8.1,27.2,18.1 c9.6,17.2,3.3,39.1-14,48.7c-0.7,0.4-1.4,0.7-2.1,1.1c-6.1,2.9-12.8,4-19.7,3.2c-2-0.2-4.1-0.6-6.1-1.2l-0.2-0.1l-11.3-3.4 c-1.2-0.4-2.5,0.3-2.9,1.5l-8.8,24.8c-0.5,1.3,0.3,2.7,1.6,3.1l13.9,4c3.4,0.9,6.8,1.6,10.3,2c12.4,1.4,25-0.6,36.3-6l0.1,0 c1.3-0.6,2.6-1.3,3.9-2C266.8,140.8,278.5,100.1,260.7,68.1z"})));wp.blocks.updateCategory("embedpress",{icon:e})}()},function(e,t,n){"use strict";var r=n(7),i=(n.n(r),n(8)),l=(n.n(i),n(9)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-docs-block",{title:a("Google Docs"),icon:o.b,category:"embedpress",keywords:[a("embedpress"),a("google"),a("docs")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("figure",{className:"ose-google-docs-document"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))},deprecated:[{attributes:{align:{type:"string",enum:["left","center","right","wide","full"]}},save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("div",{className:"ose-google-docs-document"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function l(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)}var o=n(2),a=n(1),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element.Component,f=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.updateAlignment=e.updateAlignment.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"updateAlignment",value:function(e){var t=this.props.setAttributes,n=-1!==["wide","full"].indexOf(e)?{width:void 0,height:void 0}:{};t(Object.assign({},n,{align:e}))}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=i.exec(r),o=l[1];o&&"document"==o?(r.match(/([?&])embedded=true/i)||(r.indexOf("?")>-1?r+="&embedded=true":r+="?embedded=true"),this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Google Docs URL");return!d||r?wp.element.createElement("div",null,wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.b,DocTitle:m("Learn more about Google doc embed"),docLink:"https://embedpress.com/docs/embed-google-docs-wordpress/"})):wp.element.createElement("div",null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(c.a,{src:d,onMouseUp:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(d);t.a=f},function(e,t,n){var r,i;!function(){"use strict";function n(){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 o=n.apply(null,r);o&&e.push(o)}else if("object"===i)for(var a in r)l.call(r,a)&&r[a]&&e.push(a)}}return e.join(" ")}var l={}.hasOwnProperty;"undefined"!==typeof e&&e.exports?(n.default=n,e.exports=n):(r=[],void 0!==(i=function(){return n}.apply(t,r))&&(e.exports=i))}()},function(e,t){e.exports=ReactDOM},function(e,t,n){"use strict";var r=n(13),i=(n.n(r),n(14)),l=(n.n(i),n(15)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-slides-block",{title:a("Google Slides"),icon:o.g,category:"embedpress",keywords:[a("embedpress"),a("google"),a("slides")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-presentation"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function l(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)}var o=n(2),a=n(1),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,w=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=i.exec(r),o=l[1];o&&"presentation"==o?(r.match(/pub\?/i)&&(r=r.replace("/pub?","/embed?")),this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Google Slides URL");return!d||r?wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.g,DocTitle:m("Learn more about Google slides embed"),docLink:"https://embedpress.com/docs/embed-google-slides-wordpress/"}):wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(c.a,{src:d,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f);t.a=w},function(e,t,n){"use strict";var r=n(17),i=(n.n(r),n(18)),l=(n.n(i),n(19)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-sheets-block",{title:a("Google Sheets"),icon:o.f,category:"embedpress",keywords:[a("embedpress"),a("google"),a("sheets")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-spreadsheets"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))},deprecated:[{attributes:{align:{type:"string",enum:["left","center","right","wide","full"]}},save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("div",{className:"ose-google-docs-spreadsheets"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function l(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)}var o=n(2),a=n(1),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,w=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=i.exec(r),o=l[1];if(o&&"spreadsheets"==o){if(r.indexOf("?")>-1){var a=r.split("?");if(a=a[1],a=a.split("&"),console.log(a),a.length>0){var s=!1,c=!1;a.map(function(e){e.indexOf("widget=")?c=!0:e.indexOf("headers=")&&(s=!0)}),c||(r+="&widget=true"),s||(r+="&headers=false")}}else r+="?widget=true&headers=false";this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})}else this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Google Sheets URL");return!d||r?wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.f,DocTitle:m("Learn more about Google sheet embed"),docLink:"https://embedpress.com/docs/embed-google-sheets-wordpress/"}):wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(c.a,{src:d,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f);t.a=w},function(e,t,n){"use strict";var r=n(21),i=(n.n(r),n(22)),l=(n.n(i),n(23)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-forms-block",{title:a("Google Forms"),icon:o.d,category:"embedpress",keywords:[a("embedpress"),a("google"),a("forms")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-forms"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function l(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)}var o=n(2),a=n(1),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,w=(wp.components.Disabled,function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=i.exec(r),o=l[1];o&&"forms"==o?(this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Google Forms URL");return!d||r?wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.d,DocTitle:m("Learn more about Google forms embed"),docLink:"https://embedpress.com/docs/embed-google-forms-wordpress/"}):wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(c.a,{src:d,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f));t.a=w},function(e,t,n){"use strict";var r=n(25),i=(n.n(r),n(26)),l=(n.n(i),n(27)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-drawings-block",{title:a("Google Drawings"),icon:o.c,category:"embedpress",keywords:[a("embedpress"),a("google"),a("drawings")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-drawings"},wp.element.createElement("img",{src:t,width:"960",height:"720"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function l(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)}var o=n(2),a=n(1),s=n(3),c=n(0),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=wp.i18n.__,m=wp.element,d=m.Component,f=m.Fragment,h=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return l(t,e),u(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=i.exec(r),o=l[1];o&&"drawings"==o?(this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,u=this.props.attributes.iframeSrc,m=p("Google Drawings URL (Get your link from File -> Publish to the web -> Link)");return!u||r?wp.element.createElement(s.a,{label:m,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:c.c,DocTitle:p("Learn more about Google drawing embed"),docLink:"https://embedpress.com/docs/embed-google-drawings-wordpress/"}):wp.element.createElement(f,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement("img",{src:u,onLoad:this.onLoad,style:{display:i?"none":""},width:"960",height:"720"}),wp.element.createElement(o.a,{showEditButton:u&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(d);t.a=h},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(29),l=(n.n(i),n(30)),o=(n.n(l),n(31)),a=n(0),s=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-maps-block",{title:s("Google Maps"),icon:a.e,category:"embedpress",keywords:[s("embedpress"),s("google"),s("maps")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:o.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-maps"},wp.element.createElement("iframe",r({src:t,frameborder:"0",width:"600",height:"450"},"frameborder","0")))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function l(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)}var o=n(2),a=n(1),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,w=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/(?:(?:(?:www\.|maps\.)?(?:google\.com?))|(?:goo\.gl))(?:\.[a-z]{2})?\/(?:maps\/)?(?:place\/)?(?:[a-z0-9\/%+\-_]*)?([a-z0-9\/%,+\-_=!:@\.&*\$#?\']*)/i)){var r=this.decodeHTMLEntities(t);if(t.match("~(maps/embed|output=embed)~i"));else{var i=/@(-?[0-9\.]+,-?[0-9\.]+).+,([0-9\.]+[a-z])/i,l=i.exec(r);l&&l.length>1&&l[1]&&l[2]?r="https://maps.google.com/maps?hl=en&ie=UTF8&ll="+l[1]+"&spn="+l[1]+"&t=m&z="+Math.round(parseInt(l[2]))+"&output=embed":this.setState({cannotEmbed:!0,editingURL:!0})}this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Google Maps URL");return!d||r?wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.e,DocTitle:m("Learn more about Google map embed"),docLink:"https://embedpress.com/docs/embed-google-maps-wordpress/"}):wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(Disabled,null,wp.element.createElement(c.a,{src:d,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"})),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f);t.a=w},function(e,t,n){"use strict";var r=n(33),i=(n.n(r),n(34)),l=(n.n(i),n(35)),o=n(0),a=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=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/twitch-block",{title:s("Twitch"),icon:o.h,category:"embedpress",keywords:[s("embedpress"),s("twitch")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""},attrs:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes,n=t.iframeSrc,r=t.attrs,i=n+"&parent="+embedpressObj.twitch_host;return wp.element.createElement("figure",{className:"ose-twitch-presentation"},wp.element.createElement("iframe",a({src:i},r,{frameborder:"0",width:"600",height:"450"})))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function l(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)}var o=n(2),a=n(1),s=n(3),c=n(4),u=n(0),p=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},m=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),d=wp.i18n.__,f=wp.element,h=f.Component,w=f.Fragment,b=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),m(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;n({url:t});var r=/http[s]?:\/\/(?:www\.|clips\.)twitch\.tv\/([0-9a-zA-Z\-\_]+)\/?(chat\/?$|[0-9a-z\-\_]*)?/;if(t&&t.match(r)){var i=this.decodeHTMLEntities(t),l=r.exec(i),o=l[1];console.log(o);var a,s="channel";switch(t.indexOf("clips.twitch.tv")>-1?s="clip":t.indexOf("/videos/")>-1?s="video":t.indexOf("#/chat$#")>-1&&(s="chat"),console.log(s),s){case"channel":i="https://player.twitch.tv/?channel="+o,a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"clip":i="https://clips.twitch.tv/embed?clip="+o+"&autoplay=false",a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"video":o=l[2],i="https://player.twitch.tv/?video="+o,a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"chat":i="http://www.twitch.tv/embed/"+o+"/chat",a={scrolling:"yes",frameborder:"0",allowfullscreen:"true",id:"'"+o+"'"}}this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:i,attrs:a})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,m=t.interactive,f=this.props.attributes,h=f.iframeSrc,b=f.attrs,y=d("Twitch URL");if(!h||r)return wp.element.createElement(s.a,{label:y,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.h,DocTitle:d("Learn more about twitch embed"),docLink:"https://embedpress.com/docs/embed-twitch-streams-chat/"});var v=h+"&parent="+embedpressObj.twitch_host;return wp.element.createElement(w,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(c.a,p({src:v},b,{onLoad:this.onLoad,style:{display:i?"none":""},onFocus:this.hideOverlay,width:"600",height:"450"})),!m&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:h&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(h);t.a=b},function(e,t,n){"use strict";var r=n(37),i=(n.n(r),n(38)),l=(n.n(i),n(39)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/wistia-block",{title:a("Wistia"),icon:o.i,category:"embedpress",keywords:[a("embedpress"),a("wistia")],supports:{align:["wide","full","right","left"],default:""},edit:l.a,save:function(e){return null},deprecated:[{attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("div",{class:"ose-wistia"},wp.element.createElement("iframe",{src:t,allowtransparency:"true",frameborder:"0",class:"wistia_embed",name:"wistia_embed",width:"600",height:"330"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function l(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)}var o=n(2),a=n(1),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,w=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1,mediaId:null},e.setUrl(),e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"componentDidMount",value:function(){if(this.props.attributes.url){var e=this.props.attributes.url.match(/medias\/(.*)/),t=e[1];this.setState(Object.assign({},this.state,{mediaId:t}))}}},{key:"onLoad",value:function(){if(this.setState({fetching:!1}),embedpressObj.wisita_options){var e=Object.assign({},this.state);setTimeout(function(){var e=document.createElement("script");e.src="https://fast.wistia.com/assets/external/E-v1.js",e.charset="ISO-8859-1",document.body.appendChild(e)},100),setTimeout(function(){var t=document.createElement("script");t.type="text/javascript",t.innerHTML="window.pp_embed_wistia_labels = "+embedpressObj.wistia_labels,document.body.appendChild(t),t=document.createElement("script"),t.type="text/javascript",t.innerHTML='wistiaEmbed = Wistia.embed( "'+e.mediaId+'", '+embedpressObj.wisita_options+" );",document.body.appendChild(t)},400)}}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&(t.match(/^http[s]?:\/\/(?:www\.)?wistia\.com\/medias/i)||t.match(/^http[s]?:\/\/(?:www\.)?fast\/.wistia\.com\/embed\/medias/i.jsonp))){var r=t.match(/medias\/(.*)/),i=r[1],l="//fast.wistia.net/embed/iframe/"+i;this.setState({editingURL:!1,cannotEmbed:!1,mediaId:i}),n({iframeSrc:l})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Wistia URL");return!d||r?wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.i,DocTitle:m("Learn more about Wistia embed"),docLink:"https://embedpress.com/docs/embed-wistia-videos-wordpress/"}):wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement("div",{className:"ose-wistia",id:"wistia_"+this.state.mediaId},wp.element.createElement(c.a,{src:d,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"330",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"})),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f);t.a=w},function(e,t,n){"use strict";var r=n(41),i=(n.n(r),n(42)),l=(n.n(i),n(43)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/youtube-block",{title:a("Youtube"),icon:o.j,category:"embedpress",keywords:[a("embedpress"),a("youtube")],supports:{align:["wide","full","right","left"],default:""},edit:l.a,save:function(){return null}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function l(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)}var o=n(2),a=n(1),s=n(3),c=n(4),u=n(0),p=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},m=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),d=wp.i18n.__,f=wp.element,h=f.Component,w=f.Fragment,b=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),m(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"componentWillMount",value:function(){this.state.url&&this.setUrl()}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;n({url:t});var r=t.match(/^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/);if(t&&r){var i=r[1],l="https://www.youtube.com/embed/"+i,o=new URL(l);if("undefined"!==typeof embedpressProObj)for(var a in embedpressProObj.youtubeParams)o.searchParams.set(a,embedpressProObj.youtubeParams[a]);this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:o.href,mediaId:i})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,m=t.interactive,f=this.props.attributes,h=f.iframeSrc,b=f.attrs,y=d("Youtube URL");return!h||r?wp.element.createElement(s.a,{label:y,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.j,DocTitle:d("Learn More About Youtube Embed"),docLink:"https://embedpress.com/docs/embed-youtube-wordpress/"}):wp.element.createElement(w,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(c.a,p({src:h},b,{onLoad:this.onLoad,style:{display:i?"none":""},width:"640",onFocus:this.hideOverlay,height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"})),!m&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:h&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(h);t.a=b},function(e,t,n){"use strict";var r=n(45),i=(n.n(r),n(46)),l=(n.n(i),n(47)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/document",{title:a("Document"),icon:o.a,category:"embedpress",keywords:[a("embedpress"),a("pdf"),a("doc"),a("ppt")],supports:{align:["wide","full","right","left"],default:""},attributes:{id:{type:"string"},href:{type:"string"},powered_by:{type:"boolean",default:!0},width:{type:"number",default:600},height:{type:"number",default:600},fileName:{type:"string"},mime:{type:"string"}},edit:l.a,save:function(e){var t=e.attributes,n=t.href,r=t.mime,i=t.id,l=t.width,o=t.height,a=t.powered_by,s="//view.officeapps.live.com/op/embed.aspx?src="+n;return wp.element.createElement("figure",{className:"embedpress-embed-document"},"application/pdf"===r&&wp.element.createElement("div",{style:{height:o,width:l},className:"embedpress-embed-document-pdf "+i,"data-emid":i,"data-emsrc":n}),"application/pdf"!==r&&wp.element.createElement("iframe",{style:{height:o,width:l},src:s,mozallowfullscreen:"true",webkitallowfullscreen:"true"}),a&&wp.element.createElement("p",{className:"embedpress-el-powered"},"Powered By EmbedPress"))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function l(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)}var o=n(4),a=n(1),s=n(0),c=function(){function e(e,t){var n=[],r=!0,i=!1,l=void 0;try{for(var o,a=e[Symbol.iterator]();!(r=(o=a.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,l=e}finally{try{!r&&a.return&&a.return()}finally{if(i)throw l}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=wp.i18n.__,m=wp.blob,d=m.getBlobByURL,f=m.isBlobURL,h=m.revokeBlobURL,w=wp.editor,b=w.BlockIcon,y=w.MediaPlaceholder,v=w.InspectorControls,g=wp.element,E=g.Component,L=g.Fragment,k=wp.components,_=k.RangeControl,S=k.PanelBody,U=k.ExternalLink,O=k.ToggleControl,R=["application/pdf","application/msword","application/vnd.ms-powerpoint","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation"],M=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.onSelectFile=e.onSelectFile.bind(e),e.onUploadError=e.onUploadError.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={hasError:!1,fetching:!1,interactive:!1,loadPdf:!0},e}return l(t,e),u(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.attributes,r=t.mediaUpload,i=t.noticeOperations,l=n.href;if(f(l)){r({filesList:[d(l)],onFileChange:function(t){var n=c(t,1),r=n[0];return e.onSelectFile(r)},onError:function(t){e.setState({hasError:!0}),i.createErrorNotice(t)}}),h(l)}this.props.attributes.href&&"application/pdf"===this.props.attributes.mime&&this.state.loadPdf&&(this.setState({loadPdf:!1}),PDFObject.embed(this.props.attributes.href,"."+this.props.attributes.id))}},{key:"componentDidUpdate",value:function(e){e.isSelected&&!this.props.isSelected&&this.setState({showCopyConfirmation:!1})}},{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"onSelectFile",value:function(e){e&&e.url&&(this.setState({hasError:!1}),this.props.setAttributes({href:e.url,fileName:e.title,id:"embedpress-pdf-"+Date.now(),mime:e.mime}),embedpressObj.embedpress_pro&&this.props.setAttributes({powered_by:!1}),"application/pdf"===e.mime&&(this.setState({loadPdf:!1}),PDFObject.embed(e.url,"."+this.props.attributes.id)))}},{key:"onUploadError",value:function(e){var t=this.props.noticeOperations;t.removeAllNotices(),t.createErrorNotice(e)}},{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.noticeUI,r=e.setAttributes,i=t.href,l=t.mime,c=t.id,u=t.width,m=t.height,d=t.powered_by,f=this.state,h=f.hasError,w=f.interactive,g=f.fetching,E=f.loadPdf;if(!i||h)return wp.element.createElement("div",{className:"embedpress-document-editmode"},wp.element.createElement(y,{icon:wp.element.createElement(b,{icon:s.a}),labels:{title:p("Document"),instructions:p("Upload a file or pick one from your media library for embed.")},onSelect:this.onSelectFile,notices:n,allowedTypes:R,onError:this.onUploadError},wp.element.createElement("div",{style:{width:"100%"},className:"components-placeholder__learn-more embedpress-doc-link"},wp.element.createElement(U,{href:"https://embedpress.com/docs/embed-docuemnt/"},"Learn more about Embedded document "))));var k="//view.officeapps.live.com/op/embed.aspx?src="+i;return wp.element.createElement(L,null,g&&"application/pdf"!==l?wp.element.createElement(a.a,null):null,"application/pdf"===l&&wp.element.createElement("div",{style:{height:m,width:u},className:"embedpress-embed-document-pdf "+c,"data-emid":c,"data-emsrc":i}),"application/pdf"!==l&&wp.element.createElement(o.a,{onMouseUponMouseUp:this.hideOverlay,style:{height:m,width:u,display:g||!E?"none":""},onLoad:this.onLoad,src:k,mozallowfullscreen:"true",webkitallowfullscreen:"true"}),!w&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),d&&wp.element.createElement("p",{className:"embedpress-el-powered"},"Powered By EmbedPress"),wp.element.createElement(v,{key:"inspector"},wp.element.createElement(S,{title:p("Embed Size","embedpress")},wp.element.createElement(_,{label:p("Width","embedpress"),value:u,onChange:function(e){return r({width:e})},max:1e3,min:1}),wp.element.createElement(_,{label:p("Height","embedpress"),value:m,onChange:function(e){return r({height:e})},max:1e3,min:1}),wp.element.createElement(O,{label:p("Powered By"),onChange:function(e){return r({powered_by:e})},checked:d}))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(E);t.a=M}]);
Gutenberg/src/document/index.js CHANGED
@@ -39,10 +39,7 @@ registerBlockType('embedpress/document', {
39
  __('doc'),
40
  __('ppt'),
41
  ],
42
- supports: {
43
- align: true,
44
- lightBlockWrapper: true,
45
- },
46
  attributes: {
47
  id: {
48
  type: "string"
39
  __('doc'),
40
  __('ppt'),
41
  ],
42
+ supports: {align: ["wide", "full","right","left"], default: ''},
 
 
 
43
  attributes: {
44
  id: {
45
  type: "string"
Gutenberg/src/google-docs/index.js CHANGED
@@ -37,10 +37,7 @@ registerBlockType('embedpress/google-docs-block', {
37
  __('google'),
38
  __('docs'),
39
  ],
40
- supports: {
41
- align: true,
42
- lightBlockWrapper: true,
43
- },
44
  attributes: {
45
  url: {
46
  type: 'string',
37
  __('google'),
38
  __('docs'),
39
  ],
40
+ supports: {align: ["wide", "full","right","left"], default: ''},
 
 
 
41
  attributes: {
42
  url: {
43
  type: 'string',
Gutenberg/src/google-drawings/index.js CHANGED
@@ -37,10 +37,7 @@ registerBlockType('embedpress/google-drawings-block', {
37
  __('google'),
38
  __('drawings'),
39
  ],
40
- supports: {
41
- align: true,
42
- lightBlockWrapper: true,
43
- },
44
  attributes: {
45
  url: {
46
  type: 'string',
37
  __('google'),
38
  __('drawings'),
39
  ],
40
+ supports: {align: ["wide", "full","right","left"], default: ''},
 
 
 
41
  attributes: {
42
  url: {
43
  type: 'string',
Gutenberg/src/google-forms/index.js CHANGED
@@ -37,10 +37,7 @@ registerBlockType('embedpress/google-forms-block', {
37
  __('google'),
38
  __('forms'),
39
  ],
40
- supports: {
41
- align: true,
42
- lightBlockWrapper: true,
43
- },
44
  attributes: {
45
  url: {
46
  type: 'string',
37
  __('google'),
38
  __('forms'),
39
  ],
40
+ supports: {align: ["wide", "full","right","left"], default: ''},
 
 
 
41
  attributes: {
42
  url: {
43
  type: 'string',
Gutenberg/src/google-maps/index.js CHANGED
@@ -37,10 +37,7 @@ registerBlockType('embedpress/google-maps-block', {
37
  __('google'),
38
  __('maps'),
39
  ],
40
- supports: {
41
- align: true,
42
- lightBlockWrapper: true,
43
- },
44
  attributes: {
45
  url: {
46
  type: 'string',
37
  __('google'),
38
  __('maps'),
39
  ],
40
+ supports: {align: ["wide", "full","right","left"], default: ''},
 
 
 
41
  attributes: {
42
  url: {
43
  type: 'string',
Gutenberg/src/google-sheets/index.js CHANGED
@@ -36,10 +36,7 @@ registerBlockType( 'embedpress/google-sheets-block', {
36
  __( 'google' ),
37
  __( 'sheets' ),
38
  ],
39
- supports: {
40
- align: true,
41
- lightBlockWrapper: true,
42
- },
43
  attributes: {
44
  url: {
45
  type: 'string',
36
  __( 'google' ),
37
  __( 'sheets' ),
38
  ],
39
+ supports: {align: ["wide", "full","right","left"], default: ''},
 
 
 
40
  attributes: {
41
  url: {
42
  type: 'string',
Gutenberg/src/google-slides/index.js CHANGED
@@ -36,10 +36,7 @@ registerBlockType( 'embedpress/google-slides-block', {
36
  __( 'google' ),
37
  __( 'slides' ),
38
  ],
39
- supports: {
40
- align: true,
41
- lightBlockWrapper: true,
42
- },
43
  attributes: {
44
  url: {
45
  type: 'string',
36
  __( 'google' ),
37
  __( 'slides' ),
38
  ],
39
+ supports: {align: ["wide", "full","right","left"], default: ''},
 
 
 
40
  attributes: {
41
  url: {
42
  type: 'string',
Gutenberg/src/init.php CHANGED
@@ -24,7 +24,7 @@ function embedpress_blocks_cgb_block_assets() { // phpcs:ignore
24
  wp_enqueue_style(
25
  'embedpress_blocks-cgb-style-css', // Handle.
26
  plugins_url( 'dist/blocks.style.build.css', dirname( __FILE__ ) ), // Block style CSS.
27
- array( 'wp-editor' ) // Dependency to include the CSS after it.
28
  // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build.css' ) // Version: File modification time.
29
  );
30
  }
24
  wp_enqueue_style(
25
  'embedpress_blocks-cgb-style-css', // Handle.
26
  plugins_url( 'dist/blocks.style.build.css', dirname( __FILE__ ) ), // Block style CSS.
27
+ is_admin() ? array( 'wp-editor' ) : null // Dependency to include the CSS after it.
28
  // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.style.build.css' ) // Version: File modification time.
29
  );
30
  }
Gutenberg/src/twitch/index.js CHANGED
@@ -36,10 +36,7 @@ registerBlockType('embedpress/twitch-block', {
36
  __('embedpress'),
37
  __('twitch'),
38
  ],
39
- supports: {
40
- align: true,
41
- lightBlockWrapper: true,
42
- },
43
  attributes: {
44
  url: {
45
  type: 'string',
36
  __('embedpress'),
37
  __('twitch'),
38
  ],
39
+ supports: {align: ["wide", "full","right","left"], default: ''},
 
 
 
40
  attributes: {
41
  url: {
42
  type: 'string',
Gutenberg/src/wistia/index.js CHANGED
@@ -35,10 +35,7 @@ registerBlockType('embedpress/wistia-block', {
35
  __('embedpress'),
36
  __('wistia'),
37
  ],
38
- supports: {
39
- align: true,
40
- lightBlockWrapper: true,
41
- },
42
  edit,
43
  save: function(props) {
44
  return null;
35
  __('embedpress'),
36
  __('wistia'),
37
  ],
38
+ supports: {align: ["wide", "full","right","left"], default: ''},
 
 
 
39
  edit,
40
  save: function(props) {
41
  return null;
Gutenberg/src/youtube/index.js CHANGED
@@ -35,10 +35,7 @@ registerBlockType( 'embedpress/youtube-block', {
35
  __( 'embedpress' ),
36
  __( 'youtube' ),
37
  ],
38
- supports: {
39
- align: true,
40
- lightBlockWrapper: true,
41
- },
42
  /**
43
  * The edit function describes the structure of your block in the context of the editor.
44
  * This represents what the editor will render when the block is used.
35
  __( 'embedpress' ),
36
  __( 'youtube' ),
37
  ],
38
+ supports: {align: ["wide", "full","right","left"], default: ''},
 
 
 
39
  /**
40
  * The edit function describes the structure of your block in the context of the editor.
41
  * This represents what the editor will render when the block is used.
assets/css/admin.css CHANGED
@@ -486,3 +486,7 @@
486
  .wpdeveloper-upsale-notice .wpdeveloper-notice-message .button {
487
  margin-left: 15px;
488
  }
 
 
 
 
486
  .wpdeveloper-upsale-notice .wpdeveloper-notice-message .button {
487
  margin-left: 15px;
488
  }
489
+
490
+ #embedpress-settings-wrapper a.embedpress-settings-link {
491
+ color: #0073aa;
492
+ }
embedpress.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: EmbedPress lets you embed videos, images, posts, audio, maps and uplaoad PDF, DOC, PPT & all other types of content into your WordPress site with one-click and showcase it beautifully for the visitors. 75+ sources supported.
6
  * Author: WPDeveloper
7
  * Author URI: https://wpdeveloper.net
8
- * Version: 2.6.1
9
  * Text Domain: embedpress
10
  * Domain Path: /languages
11
  *
5
  * Description: EmbedPress lets you embed videos, images, posts, audio, maps and uplaoad PDF, DOC, PPT & all other types of content into your WordPress site with one-click and showcase it beautifully for the visitors. 75+ sources supported.
6
  * Author: WPDeveloper
7
  * Author URI: https://wpdeveloper.net
8
+ * Version: 2.6.2
9
  * Text Domain: embedpress
10
  * Domain Path: /languages
11
  *
includes.php CHANGED
@@ -22,7 +22,7 @@ if ( ! defined('EMBEDPRESS_PLG_NAME')) {
22
  }
23
 
24
  if ( ! defined('EMBEDPRESS_VERSION')) {
25
- define('EMBEDPRESS_VERSION', "2.6.1");
26
  /**
27
  * @deprecated 2.2.0
28
  */
22
  }
23
 
24
  if ( ! defined('EMBEDPRESS_VERSION')) {
25
+ define('EMBEDPRESS_VERSION', "2.6.2");
26
  /**
27
  * @deprecated 2.2.0
28
  */
readme.txt CHANGED
@@ -4,9 +4,9 @@ Author: WPDeveloper
4
  Author URI: https://wpdeveloper.net
5
  Tags: embed, embed youtube, gutenberg embed, pdf, doc, docs, ppt, elementor embed, video embed, Google Doc, map embed, youTube Embed, content embed, iframes, vimeo embed, wistia, google sheet, youtube player, block editor, embed wordpress
6
  Requires at least: 4.6
7
- Tested up to: 5.5
8
  Requires PHP: 5.6
9
- Stable tag: 2.6.1
10
  License: GPLv3 or later
11
  License URI: https://opensource.org/licenses/GPL-3.0
12
 
@@ -14,7 +14,6 @@ EmbedPress lets you embed videos, images, posts, audio, maps and upload PDF, DOC
14
 
15
  == Description ==
16
 
17
-
18
  [EmbedPress](https://embedpress.com/) lets you embed videos, images, posts, audio, maps and upload PDF, DOC, PPT & all other types of content into your WordPress site with one-click and showcase it beautifully for the visitors. Classic Editor, Gutenberg & Elementor all supported.
19
 
20
  https://www.youtube.com/watch?v=fvYKLkEnJbI
@@ -249,7 +248,7 @@ If you like EmbedPress, then consider checking out our other WordPress Plugins:
249
 
250
  ⏰[WP Scheduled Posts](https://wordpress.org/plugins/wp-scheduled-posts/) – Complete solution for WordPress Post Scheduling to manage schedules through an editorial calendar & Social Share.
251
 
252
- 🗒️ [BetterDocs](https://betterdocs.co/) – Best Documentation & Knowledge Base Plugin for WordPress, whcih also reduce your manual support request.
253
 
254
 
255
  Visit [WPDeveloper](https://wpdeveloper.net/) to learn more about how to do better in WordPress with [Help Tutorial, Tips & Tricks](https://wpdeveloper.net/blog).
@@ -295,6 +294,13 @@ Not at all. You can set up everything your team needs without any coding knowled
295
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
296
  and this project adheres to [Semantic Versioning](http://semver.org/).
297
 
 
 
 
 
 
 
 
298
  = [2.6.1] - 2020-09-14 =
299
  * Twitch Issue Fixed
300
  * Fixed some minor issues
4
  Author URI: https://wpdeveloper.net
5
  Tags: embed, embed youtube, gutenberg embed, pdf, doc, docs, ppt, elementor embed, video embed, Google Doc, map embed, youTube Embed, content embed, iframes, vimeo embed, wistia, google sheet, youtube player, block editor, embed wordpress
6
  Requires at least: 4.6
7
+ Tested up to: 5.6
8
  Requires PHP: 5.6
9
+ Stable tag: 2.6.2
10
  License: GPLv3 or later
11
  License URI: https://opensource.org/licenses/GPL-3.0
12
 
14
 
15
  == Description ==
16
 
 
17
  [EmbedPress](https://embedpress.com/) lets you embed videos, images, posts, audio, maps and upload PDF, DOC, PPT & all other types of content into your WordPress site with one-click and showcase it beautifully for the visitors. Classic Editor, Gutenberg & Elementor all supported.
18
 
19
  https://www.youtube.com/watch?v=fvYKLkEnJbI
248
 
249
  ⏰[WP Scheduled Posts](https://wordpress.org/plugins/wp-scheduled-posts/) – Complete solution for WordPress Post Scheduling to manage schedules through an editorial calendar & Social Share.
250
 
251
+ 🗒️[BetterDocs](https://betterdocs.co/) – Best Documentation & Knowledge Base Plugin for WordPress, whcih also reduce your manual support request.
252
 
253
 
254
  Visit [WPDeveloper](https://wpdeveloper.net/) to learn more about how to do better in WordPress with [Help Tutorial, Tips & Tricks](https://wpdeveloper.net/blog).
294
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
295
  and this project adheres to [Semantic Versioning](http://semver.org/).
296
 
297
+ = [2.6.2] - 2020-10-28 =
298
+ * Fixed: Facebook & Instagram Embedding issue
299
+ * Fixed: PHP error on WordPress 4.9.8
300
+ * Fixed: Additional stylesheets loaded in frontend
301
+ * Fixed: Conflict with WordPress 5.5.1
302
+ * Few minor bug fix & improvements
303
+
304
  = [2.6.1] - 2020-09-14 =
305
  * Twitch Issue Fixed
306
  * Fixed some minor issues