Version Description
Download this release
Release Info
Developer | themeisle |
Plugin | FEEDZY RSS Feeds Lite |
Version | 3.7.1 |
Comparing to | |
See all releases |
Code changes from version 3.7.0 to 3.7.1
- CHANGELOG.md +11 -0
- css/feedzy-rss-feeds.css +8 -2
- feedzy-rss-feed.php +1 -1
- includes/abstract/feedzy-rss-feeds-admin-abstract.php +13 -1
- includes/admin/feedzy-rss-feeds-admin.php +1 -1
- includes/admin/feedzy-rss-feeds-import.php +45 -6
- includes/feedzy-rss-feeds.php +1 -1
- includes/gutenberg/build/block.js +1 -1
- includes/views/css/import-metabox-edit.css +27 -27
- readme.txt +14 -0
- vendor/autoload.php +1 -1
- vendor/composer/ClassLoader.php +3 -1
- vendor/composer/InstalledVersions.php +326 -284
- vendor/composer/autoload_real.php +7 -7
- vendor/composer/autoload_static.php +2 -2
- vendor/composer/installed.php +31 -31
CHANGELOG.md
CHANGED
@@ -1,3 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
#### [Version 3.7.0](https://github.com/Codeinwp/feedzy-rss-feeds/compare/v3.6.4...v3.7.0) (2021-05-12)
|
2 |
|
3 |
### Features
|
1 |
+
##### [Version 3.7.1](https://github.com/Codeinwp/feedzy-rss-feeds/compare/v3.7.0...v3.7.1) (2021-07-07)
|
2 |
+
|
3 |
+
### Fixes
|
4 |
+
- Particular RSS XML Feed showed as invalid if you select Post author to be shown in the backend
|
5 |
+
- Add default feed values if they are empty
|
6 |
+
- Fix source name when author unavailable in Gutenberg block
|
7 |
+
- Change 2nd-time validation message when author empty
|
8 |
+
- Fix broken style issue in feedzy list page
|
9 |
+
- Fix fewer columns issue in Gutenberg block
|
10 |
+
- Fix broken dropdown style issue in admin
|
11 |
+
|
12 |
#### [Version 3.7.0](https://github.com/Codeinwp/feedzy-rss-feeds/compare/v3.6.4...v3.7.0) (2021-05-12)
|
13 |
|
14 |
### Features
|
css/feedzy-rss-feeds.css
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
* feedzy-rss-feeds.css
|
3 |
* Feedzy RSS Feed
|
4 |
* Copyright: (c) 2016 Themeisle, themeisle.com
|
5 |
-
* Version: 3.7.
|
6 |
* Plugin Name: FEEDZY RSS Feeds
|
7 |
* Plugin URI: http://themeisle.com/plugins/feedzy-rss-feeds/
|
8 |
* Author: Themeisle
|
@@ -67,7 +67,10 @@
|
|
67 |
.feedzy-rss ul {
|
68 |
margin: 0 -2%;
|
69 |
}
|
70 |
-
|
|
|
|
|
|
|
71 |
.feedzy-rss ul:before,
|
72 |
.feedzy-rss ul:after {
|
73 |
display: table;
|
@@ -446,4 +449,7 @@ input:checked + .feedzy-track:before {
|
|
446 |
|
447 |
.wp-block-feedzy-rss-feeds-feedzy-block .wp-block-embed.is-loading {
|
448 |
margin: auto !important;
|
|
|
|
|
|
|
449 |
}
|
2 |
* feedzy-rss-feeds.css
|
3 |
* Feedzy RSS Feed
|
4 |
* Copyright: (c) 2016 Themeisle, themeisle.com
|
5 |
+
* Version: 3.7.1
|
6 |
* Plugin Name: FEEDZY RSS Feeds
|
7 |
* Plugin URI: http://themeisle.com/plugins/feedzy-rss-feeds/
|
8 |
* Author: Themeisle
|
67 |
.feedzy-rss ul {
|
68 |
margin: 0 -2%;
|
69 |
}
|
70 |
+
.editor-styles-wrapper .feedzy-rss ul {
|
71 |
+
margin: 0 -2%;
|
72 |
+
box-sizing: inherit;
|
73 |
+
}
|
74 |
.feedzy-rss ul:before,
|
75 |
.feedzy-rss ul:after {
|
76 |
display: table;
|
449 |
|
450 |
.wp-block-feedzy-rss-feeds-feedzy-block .wp-block-embed.is-loading {
|
451 |
margin: auto !important;
|
452 |
+
}
|
453 |
+
.components-select-control {
|
454 |
+
height:auto;
|
455 |
}
|
feedzy-rss-feed.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* Plugin Name: Feedzy RSS Feeds Lite
|
16 |
* Plugin URI: https://themeisle.com/plugins/feedzy-rss-feeds-lite/
|
17 |
* Description: A small and lightweight RSS aggregator plugin. Fast and very easy to use, it allows you to aggregate multiple RSS feeds into your WordPress site through fully customizable shortcodes & widgets.
|
18 |
-
* Version: 3.7.
|
19 |
* Author: Themeisle
|
20 |
* Author URI: http://themeisle.com
|
21 |
* License: GPL-2.0+
|
15 |
* Plugin Name: Feedzy RSS Feeds Lite
|
16 |
* Plugin URI: https://themeisle.com/plugins/feedzy-rss-feeds-lite/
|
17 |
* Description: A small and lightweight RSS aggregator plugin. Fast and very easy to use, it allows you to aggregate multiple RSS feeds into your WordPress site through fully customizable shortcodes & widgets.
|
18 |
+
* Version: 3.7.1
|
19 |
* Author: Themeisle
|
20 |
* Author URI: http://themeisle.com
|
21 |
* License: GPL-2.0+
|
includes/abstract/feedzy-rss-feeds-admin-abstract.php
CHANGED
@@ -1270,6 +1270,9 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
|
|
1270 |
$content_title = '';
|
1271 |
}
|
1272 |
}
|
|
|
|
|
|
|
1273 |
$content_title = apply_filters( 'feedzy_title_output', $content_title, $feed_url, $item );
|
1274 |
|
1275 |
// meta=yes is for backward compatibility, otherwise its always better to provide the fields with granularity.
|
@@ -1332,6 +1335,11 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
|
|
1332 |
$author_url = apply_filters( 'feedzy_author_url', $author_url, $author_name, $feed_url, $item );
|
1333 |
$content_meta_values['author'] = apply_filters( 'feedzy_meta_author', __( 'by', 'feedzy-rss-feeds' ) . ' <a href="' . $author_url . '" target="' . $sc['target'] . '" title="' . $domain['host'] . '" >' . $author_name . '</a> ', $author_name, $author_url, $feed_source, $feed_url, $item );
|
1334 |
}
|
|
|
|
|
|
|
|
|
|
|
1335 |
}
|
1336 |
|
1337 |
// date/time.
|
@@ -1390,6 +1398,10 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
|
|
1390 |
}
|
1391 |
$content_summary = apply_filters( 'feedzy_summary_output', $content_summary, $new_link, $feed_url, $item );
|
1392 |
}
|
|
|
|
|
|
|
|
|
1393 |
$item_array = array(
|
1394 |
'item_img_class' => 'rss_image',
|
1395 |
'item_img_style' => 'width:' . $sizes['width'] . 'px; height:' . $sizes['height'] . 'px;',
|
@@ -1407,7 +1419,7 @@ abstract class Feedzy_Rss_Feeds_Admin_Abstract {
|
|
1407 |
'item_date_formatted' => $content_meta_date,
|
1408 |
'item_author' => $item->get_author(),
|
1409 |
'item_description' => $content_summary,
|
1410 |
-
'item_content' => apply_filters( 'feedzy_content', $
|
1411 |
'item_source' => $feed_source,
|
1412 |
);
|
1413 |
$item_array = apply_filters( 'feedzy_item_filter', $item_array, $item, $sc, $index, $item_index );
|
1270 |
$content_title = '';
|
1271 |
}
|
1272 |
}
|
1273 |
+
if ( empty( $content_title ) ) {
|
1274 |
+
$content_title = esc_html__( 'Post Title', 'feedzy-rss-feeds' );
|
1275 |
+
}
|
1276 |
$content_title = apply_filters( 'feedzy_title_output', $content_title, $feed_url, $item );
|
1277 |
|
1278 |
// meta=yes is for backward compatibility, otherwise its always better to provide the fields with granularity.
|
1335 |
$author_url = apply_filters( 'feedzy_author_url', $author_url, $author_name, $feed_url, $item );
|
1336 |
$content_meta_values['author'] = apply_filters( 'feedzy_meta_author', __( 'by', 'feedzy-rss-feeds' ) . ' <a href="' . $author_url . '" target="' . $sc['target'] . '" title="' . $domain['host'] . '" >' . $author_name . '</a> ', $author_name, $author_url, $feed_source, $feed_url, $item );
|
1337 |
}
|
1338 |
+
} elseif ( $is_multiple && $meta_args['source'] && ! empty( $feed_source ) ) {
|
1339 |
+
$domain = wp_parse_url( $new_link );
|
1340 |
+
$author_url = '//' . $domain['host'];
|
1341 |
+
$author_url = apply_filters( 'feedzy_author_url', $author_url, $feed_source, $feed_url, $item );
|
1342 |
+
$content_meta_values['author'] = apply_filters( 'feedzy_meta_author', __( 'by', 'feedzy-rss-feeds' ) . ' <a href="' . $author_url . '" target="' . $sc['target'] . '" title="' . $domain['host'] . '" >' . $feed_source . '</a> ', $feed_source, $author_url, $feed_source, $feed_url, $item );
|
1343 |
}
|
1344 |
|
1345 |
// date/time.
|
1398 |
}
|
1399 |
$content_summary = apply_filters( 'feedzy_summary_output', $content_summary, $new_link, $feed_url, $item );
|
1400 |
}
|
1401 |
+
$item_content = $item->get_content( false );
|
1402 |
+
if ( empty( $item_content ) ) {
|
1403 |
+
$item_content = esc_html__( 'Post Content', 'feedzy-rss-feeds' );
|
1404 |
+
}
|
1405 |
$item_array = array(
|
1406 |
'item_img_class' => 'rss_image',
|
1407 |
'item_img_style' => 'width:' . $sizes['width'] . 'px; height:' . $sizes['height'] . 'px;',
|
1419 |
'item_date_formatted' => $content_meta_date,
|
1420 |
'item_author' => $item->get_author(),
|
1421 |
'item_description' => $content_summary,
|
1422 |
+
'item_content' => apply_filters( 'feedzy_content', $item_content, $item ),
|
1423 |
'item_source' => $feed_source,
|
1424 |
);
|
1425 |
$item_array = apply_filters( 'feedzy_item_filter', $item_array, $item, $sc, $index, $item_index );
|
includes/admin/feedzy-rss-feeds-admin.php
CHANGED
@@ -758,7 +758,7 @@ class Feedzy_Rss_Feeds_Admin extends Feedzy_Rss_Feeds_Admin_Abstract {
|
|
758 |
$invalid = $invalid_source;
|
759 |
delete_post_meta( $post->ID, '__transient_feedzy_invalid_source' );
|
760 |
} elseif ( $invalid_dc_namespace ) {
|
761 |
-
$text = __( '
|
762 |
$invalid = $invalid_dc_namespace;
|
763 |
delete_post_meta( $post->ID, '__transient_feedzy_invalid_dc_namespace' );
|
764 |
}
|
758 |
$invalid = $invalid_source;
|
759 |
delete_post_meta( $post->ID, '__transient_feedzy_invalid_source' );
|
760 |
} elseif ( $invalid_dc_namespace ) {
|
761 |
+
$text = __( 'Please enter a valid feed URL to import the author', 'feedzy-rss-feeds' );
|
762 |
$invalid = $invalid_dc_namespace;
|
763 |
delete_post_meta( $post->ID, '__transient_feedzy_invalid_dc_namespace' );
|
764 |
}
|
includes/admin/feedzy-rss-feeds-import.php
CHANGED
@@ -123,14 +123,14 @@ class Feedzy_Rss_Feeds_Import {
|
|
123 |
if ( get_current_screen()->post_type === 'feedzy_imports' ) {
|
124 |
wp_enqueue_style( $this->plugin_name . '_chosen', FEEDZY_ABSURL . 'includes/views/css/chosen.css', array(), $this->version, 'all' );
|
125 |
wp_enqueue_style( $this->plugin_name . '_metabox_edit', FEEDZY_ABSURL . 'includes/views/css/import-metabox-edit.css', array( 'wp-jquery-ui-dialog' ), $this->version, 'all' );
|
126 |
-
wp_enqueue_script( $this->plugin_name . '
|
127 |
wp_enqueue_script(
|
128 |
$this->plugin_name . '_metabox_edit_script',
|
129 |
FEEDZY_ABSURL . 'includes/views/js/import-metabox-edit.js',
|
130 |
array(
|
131 |
'jquery',
|
132 |
'jquery-ui-dialog',
|
133 |
-
$this->plugin_name . '
|
134 |
),
|
135 |
$this->version,
|
136 |
true
|
@@ -1382,7 +1382,42 @@ class Feedzy_Rss_Feeds_Import {
|
|
1382 |
continue;
|
1383 |
}
|
1384 |
|
1385 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1386 |
|
1387 |
// Set post language.
|
1388 |
if ( function_exists( 'pll_set_post_language' ) && ! empty( $import_selected_language ) ) {
|
@@ -1431,7 +1466,7 @@ class Feedzy_Rss_Feeds_Import {
|
|
1431 |
|
1432 |
do_action( 'feedzy_import_extra', $job, $results, $new_post_id, $index, $item['item_index'], $import_errors, $import_info );
|
1433 |
|
1434 |
-
if ( ! empty( $import_featured_img ) ) {
|
1435 |
$image_url = '';
|
1436 |
$img_success = true;
|
1437 |
|
@@ -1567,7 +1602,7 @@ class Feedzy_Rss_Feeds_Import {
|
|
1567 |
*
|
1568 |
* @return bool
|
1569 |
*/
|
1570 |
-
private function generate_featured_image( $file, $post_id, $desc, &$import_errors, &$import_info ) {
|
1571 |
do_action( 'themeisle_log_event', FEEDZY_NAME, sprintf( 'Trying to generate featured image for %s and postID %d', $file, $post_id ), 'debug', __FILE__, __LINE__ );
|
1572 |
|
1573 |
require_once ABSPATH . 'wp-admin' . '/includes/image.php';
|
@@ -1600,13 +1635,17 @@ class Feedzy_Rss_Feeds_Import {
|
|
1600 |
$file_array['tmp_name'] = $local_file;
|
1601 |
$file_array['name'] = basename( $local_file );
|
1602 |
|
1603 |
-
$id = media_handle_sideload( $file_array, $post_id, $desc );
|
1604 |
if ( is_wp_error( $id ) ) {
|
1605 |
do_action( 'themeisle_log_event', FEEDZY_NAME, sprintf( 'Unable to attach file for postID %d = %s', $post_id, print_r( $id, true ) ), 'error', __FILE__, __LINE__ );
|
1606 |
unlink( $file_array['tmp_name'] );
|
1607 |
return false;
|
1608 |
}
|
1609 |
|
|
|
|
|
|
|
|
|
1610 |
$success = set_post_thumbnail( $post_id, $id );
|
1611 |
if ( false === $success ) {
|
1612 |
do_action( 'themeisle_log_event', FEEDZY_NAME, sprintf( 'Unable to attach file for postID %d for no apparent reason', $post_id ), 'error', __FILE__, __LINE__ );
|
123 |
if ( get_current_screen()->post_type === 'feedzy_imports' ) {
|
124 |
wp_enqueue_style( $this->plugin_name . '_chosen', FEEDZY_ABSURL . 'includes/views/css/chosen.css', array(), $this->version, 'all' );
|
125 |
wp_enqueue_style( $this->plugin_name . '_metabox_edit', FEEDZY_ABSURL . 'includes/views/css/import-metabox-edit.css', array( 'wp-jquery-ui-dialog' ), $this->version, 'all' );
|
126 |
+
wp_enqueue_script( $this->plugin_name . '_chosen_script', FEEDZY_ABSURL . 'includes/views/js/chosen.js', array( 'jquery' ), $this->version, true );
|
127 |
wp_enqueue_script(
|
128 |
$this->plugin_name . '_metabox_edit_script',
|
129 |
FEEDZY_ABSURL . 'includes/views/js/import-metabox-edit.js',
|
130 |
array(
|
131 |
'jquery',
|
132 |
'jquery-ui-dialog',
|
133 |
+
$this->plugin_name . '_chosen_script',
|
134 |
),
|
135 |
$this->version,
|
136 |
true
|
1382 |
continue;
|
1383 |
}
|
1384 |
|
1385 |
+
if ( 'attachment' === $import_post_type ) {
|
1386 |
+
$image_url = '';
|
1387 |
+
$img_success = true;
|
1388 |
+
$new_post_id = 0;
|
1389 |
+
|
1390 |
+
// image tag
|
1391 |
+
if ( strpos( $import_featured_img, '[#item_image]' ) !== false ) {
|
1392 |
+
// image exists in item
|
1393 |
+
if ( ! empty( $item['item_img_path'] ) ) {
|
1394 |
+
$image_url = str_replace( '[#item_image]', $item['item_img_path'], $import_featured_img );
|
1395 |
+
} else {
|
1396 |
+
$img_success = false;
|
1397 |
+
}
|
1398 |
+
} elseif ( strpos( $import_featured_img, '[#item_custom' ) !== false ) {
|
1399 |
+
// custom image tag
|
1400 |
+
$value = apply_filters( 'feedzy_parse_custom_tags', $import_featured_img, $results['feed'], $index );
|
1401 |
+
if ( ! empty( $value ) && strpos( $value, '[#item_custom' ) === false ) {
|
1402 |
+
$image_url = $value;
|
1403 |
+
} else {
|
1404 |
+
$img_success = false;
|
1405 |
+
}
|
1406 |
+
} else {
|
1407 |
+
$image_url = $import_featured_img;
|
1408 |
+
}
|
1409 |
+
|
1410 |
+
if ( ! empty( $image_url ) ) {
|
1411 |
+
$img_success = $this->generate_featured_image( $image_url, 0, $item['item_title'], $import_errors, $import_info, $new_post );
|
1412 |
+
$new_post_id = $img_success;
|
1413 |
+
}
|
1414 |
+
|
1415 |
+
if ( ! $img_success ) {
|
1416 |
+
$import_image_errors++;
|
1417 |
+
}
|
1418 |
+
} else {
|
1419 |
+
$new_post_id = wp_insert_post( $new_post, true );
|
1420 |
+
}
|
1421 |
|
1422 |
// Set post language.
|
1423 |
if ( function_exists( 'pll_set_post_language' ) && ! empty( $import_selected_language ) ) {
|
1466 |
|
1467 |
do_action( 'feedzy_import_extra', $job, $results, $new_post_id, $index, $item['item_index'], $import_errors, $import_info );
|
1468 |
|
1469 |
+
if ( ! empty( $import_featured_img ) && 'attachment' !== $import_post_type ) {
|
1470 |
$image_url = '';
|
1471 |
$img_success = true;
|
1472 |
|
1602 |
*
|
1603 |
* @return bool
|
1604 |
*/
|
1605 |
+
private function generate_featured_image( $file, $post_id, $desc, &$import_errors, &$import_info, $post_data = array() ) {
|
1606 |
do_action( 'themeisle_log_event', FEEDZY_NAME, sprintf( 'Trying to generate featured image for %s and postID %d', $file, $post_id ), 'debug', __FILE__, __LINE__ );
|
1607 |
|
1608 |
require_once ABSPATH . 'wp-admin' . '/includes/image.php';
|
1635 |
$file_array['tmp_name'] = $local_file;
|
1636 |
$file_array['name'] = basename( $local_file );
|
1637 |
|
1638 |
+
$id = media_handle_sideload( $file_array, $post_id, $desc, $post_data );
|
1639 |
if ( is_wp_error( $id ) ) {
|
1640 |
do_action( 'themeisle_log_event', FEEDZY_NAME, sprintf( 'Unable to attach file for postID %d = %s', $post_id, print_r( $id, true ) ), 'error', __FILE__, __LINE__ );
|
1641 |
unlink( $file_array['tmp_name'] );
|
1642 |
return false;
|
1643 |
}
|
1644 |
|
1645 |
+
if ( ! empty( $post_data ) ) {
|
1646 |
+
return $id;
|
1647 |
+
}
|
1648 |
+
|
1649 |
$success = set_post_thumbnail( $post_id, $id );
|
1650 |
if ( false === $success ) {
|
1651 |
do_action( 'themeisle_log_event', FEEDZY_NAME, sprintf( 'Unable to attach file for postID %d for no apparent reason', $post_id ), 'error', __FILE__, __LINE__ );
|
includes/feedzy-rss-feeds.php
CHANGED
@@ -104,7 +104,7 @@ class Feedzy_Rss_Feeds {
|
|
104 |
*/
|
105 |
public function init() {
|
106 |
self::$plugin_name = 'feedzy-rss-feeds';
|
107 |
-
self::$version = '3.7.
|
108 |
self::$instance->load_dependencies();
|
109 |
self::$instance->set_locale();
|
110 |
self::$instance->define_admin_hooks();
|
104 |
*/
|
105 |
public function init() {
|
106 |
self::$plugin_name = 'feedzy-rss-feeds';
|
107 |
+
self::$version = '3.7.1';
|
108 |
self::$instance->load_dependencies();
|
109 |
self::$instance->set_locale();
|
110 |
self::$instance->define_admin_hooks();
|
includes/gutenberg/build/block.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=5)}([function(e,t,r){"use strict";const n=r(1),a=r(2),o=r(3),s=r(4);function i(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function l(e,t){return t.encode?t.strict?n(e):encodeURIComponent(e):e}function p(e,t){return t.decode?a(e):e}function u(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function c(e){const t=(e=u(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function m(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function d(e,t){i((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=r):n[e]=r};case"bracket":return(e,r,n)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],r):n[e]=[r]:n[e]=r};case"comma":case"separator":return(t,r,n)=>{const a="string"==typeof r&&r.includes(e.arrayFormatSeparator),o="string"==typeof r&&!a&&p(r,e).includes(e.arrayFormatSeparator);r=o?p(r,e):r;const s=a||o?r.split(e.arrayFormatSeparator).map(t=>p(t,e)):null===r?r:p(r,e);n[t]=s};case"bracket-separator":return(t,r,n)=>{const a=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!a)return void(n[t]=r?p(r,e):r);const o=null===r?[]:r.split(e.arrayFormatSeparator).map(t=>p(t,e));void 0!==n[t]?n[t]=[].concat(n[t],o):n[t]=o};default:return(e,t,r)=>{void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t),n=Object.create(null);if("string"!=typeof e)return n;if(!(e=e.trim().replace(/^[?#&]/,"")))return n;for(const a of e.split("&")){if(""===a)continue;let[e,s]=o(t.decode?a.replace(/\+/g," "):a,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:p(s,t),r(p(e,t),s,n)}for(const e of Object.keys(n)){const r=n[e];if("object"==typeof r&&null!==r)for(const e of Object.keys(r))r[e]=m(r[e],t);else n[e]=m(r,t)}return!1===t.sort?n:(!0===t.sort?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce((e,t)=>{const r=n[t];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort((e,t)=>Number(e)-Number(t)).map(e=>t[e]):t}(r):e[t]=r,e},Object.create(null))}t.extract=c,t.parse=d,t.stringify=(e,t)=>{if(!e)return"";i((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const r=r=>t.skipNull&&null==e[r]||t.skipEmptyString&&""===e[r],n=function(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{const a=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[l(t,e),"[",a,"]"].join("")]:[...r,[l(t,e),"[",l(a,e),"]=",l(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[l(t,e),"[]"].join("")]:[...r,[l(t,e),"[]=",l(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return r=>(n,a)=>void 0===a||e.skipNull&&null===a||e.skipEmptyString&&""===a?n:(a=null===a?"":a,0===n.length?[[l(r,e),t,l(a,e)].join("")]:[[n,l(a,e)].join(e.arrayFormatSeparator)])}default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,l(t,e)]:[...r,[l(t,e),"=",l(n,e)].join("")]}}(t),a={};for(const t of Object.keys(e))r(t)||(a[t]=e[t]);const o=Object.keys(a);return!1!==t.sort&&o.sort(t.sort),o.map(r=>{const a=e[r];return void 0===a?"":null===a?l(r,t):Array.isArray(a)?0===a.length&&"bracket-separator"===t.arrayFormat?l(r,t)+"[]":a.reduce(n(r),[]).join("&"):l(r,t)+"="+l(a,t)}).filter(e=>e.length>0).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[r,n]=o(e,"#");return Object.assign({url:r.split("?")[0]||"",query:d(c(e),t)},t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:p(n,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0},r);const n=u(e.url).split("?")[0]||"",a=t.extract(e.url),o=t.parse(a,{sort:!1}),s=Object.assign(o,e.query);let i=t.stringify(s,r);i&&(i="?"+i);let p=function(e){let t="";const r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(p="#"+l(e.fragmentIdentifier,r)),`${n}${i}${p}`},t.pick=(e,r,n)=>{n=Object.assign({parseFragmentIdentifier:!0},n);const{url:a,query:o,fragmentIdentifier:i}=t.parseUrl(e,n);return t.stringifyUrl({url:a,query:s(o,r),fragmentIdentifier:i},n)},t.exclude=(e,r,n)=>{const a=Array.isArray(r)?e=>!r.includes(e):(e,t)=>!r(e,t);return t.pick(e,a,n)}},function(e,t,r){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>"%"+e.charCodeAt(0).toString(16).toUpperCase())},function(e,t,r){"use strict";var n=new RegExp("%[a-f0-9]{2}","gi"),a=new RegExp("(%[a-f0-9]{2})+","gi");function o(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],o(r),o(n))}function s(e){try{return decodeURIComponent(e)}catch(a){for(var t=e.match(n),r=1;r<t.length;r++)t=(e=o(t,r).join("")).match(n);return e}}e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=a.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch(e){var n=s(r[0]);n!==r[0]&&(t[r[0]]=n)}r=a.exec(e)}t["%C2"]="�";for(var o=Object.keys(t),i=0;i<o.length;i++){var l=o[i];e=e.replace(new RegExp(l,"g"),t[l])}return e}(e)}}},function(e,t,r){"use strict";e.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const r=e.indexOf(t);return-1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}},function(e,t,r){"use strict";e.exports=function(e,t){for(var r={},n=Object.keys(e),a=Array.isArray(t),o=0;o<n.length;o++){var s=n[o],i=e[s];(a?-1!==t.indexOf(s):t(s,i,e))&&(r[s]=i)}return r}},function(e,t,r){"use strict";r.r(t);var n={feeds:{type:"string"},max:{type:"number",default:5},offset:{type:"number",default:0},feed_title:{type:"boolean",default:!0},refresh:{type:"string",default:"12_hours"},sort:{type:"string",default:"default"},target:{type:"string",default:"_blank"},title:{type:"number"},meta:{type:"boolean",default:!0},lazy:{type:"boolean",default:!1},metafields:{type:"string",default:""},multiple_meta:{type:"string",default:""},summary:{type:"boolean",default:!0},summarylength:{type:"number"},keywords_title:{type:"string"},keywords_ban:{type:"string"},thumb:{type:"string",default:"auto"},default:{type:"object"},size:{type:"number",default:150},http:{type:"string"},referral_url:{type:"string"},columns:{type:"number",default:1},template:{type:"string",default:"default"},price:{type:"boolean",default:!0},route:{type:"string",default:"home"},feedData:{type:"object"},categories:{type:"object"}},a=r(0),o=r.n(a),s=lodash.isEmpty,i=wp.components.BaseControl;var l=(0,wp.compose.withInstanceId)((function(e){var t=e.label,r=e.selected,n=e.help,a=e.instanceId,o=e.onChange,l=e.disabled,p=e.options,u=void 0===p?[]:p,c="inspector-radio-image-control-".concat(a),m=function(e){return o(e.target.value)};return!s(u)&&wp.element.createElement(i,{label:t,id:c,help:n,className:"components-radio-image-control"},wp.element.createElement("div",{className:"components-radio-image-control__container"},u.map((function(e,t){return wp.element.createElement("div",{key:"".concat(c,"-").concat(t),className:"components-radio-image-control__option"},wp.element.createElement("input",{id:"".concat(c,"-").concat(t),className:"components-radio-image-control__input",type:"radio",name:c,value:e.value,onChange:m,checked:e.value===r,"aria-describedby":n?"".concat(c,"__help"):void 0,disabled:l}),wp.element.createElement("label",{htmlFor:"".concat(c,"-").concat(t),title:e.label},wp.element.createElement("img",{src:e.src}),wp.element.createElement("span",{class:"image-clickable"})))}))))}));function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=h(e);if(t){var a=h(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return f(this,r)}}function f(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var y=wp.i18n.__,b=wp.blockEditor||wp.editor,g=b.InspectorControls,v=b.MediaUpload,w=wp.element,E=w.Component,k=(w.Fragment,wp.components),C=k.BaseControl,T=k.ExternalLink,x=k.PanelBody,S=k.RangeControl,z=k.TextControl,O=k.Button,j=k.ToggleControl,N=k.SelectControl,F=k.ResponsiveWrapper,R=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(o,e);var t,r,n,a=d(o);function o(){return u(this,o),a.apply(this,arguments)}return t=o,(r=[{key:"render",value:function(){var e=this,t="";return"https"===this.props.attributes.http&&(t+=y("Please verify that the images exist on HTTPS.")),wp.element.createElement(g,{key:"inspector"},0!==this.props.attributes.status&&wp.element.createElement(x,null,wp.element.createElement(z,{label:y("Feed Source"),className:"feedzy-source",value:this.props.attributes.feeds,onChange:this.props.edit.onChangeFeed}),wp.element.createElement(O,{isLarge:!0,isPrimary:!0,type:"submit",onClick:this.props.edit.loadFeed,className:"loadFeed"},y("Load Feed"))),"fetched"===this.props.state.route&&[wp.element.createElement(x,{title:y("Feed Settings"),initialOpen:!0,className:"feedzy-options"},wp.element.createElement(S,{label:y("Number of Items"),value:Number(this.props.attributes.max)||5,onChange:this.props.edit.onChangeMax,min:1,max:this.props.attributes.feedData.items.length||10,beforeIcon:"sort",className:"feedzy-max"}),wp.element.createElement(S,{label:y("Ignore first N items"),value:Number(this.props.attributes.offset)||0,onChange:this.props.edit.onChangeOffset,min:0,max:this.props.attributes.feedData.items.length,beforeIcon:"sort",className:"feedzy-offset"}),null!==this.props.attributes.feedData.channel&&wp.element.createElement(j,{label:y("Display feed title?"),checked:!!this.props.attributes.feed_title,onChange:this.props.edit.onToggleFeedTitle,className:"feedzy-title"}),wp.element.createElement(j,{label:y("Lazy load feed?"),checked:!!this.props.attributes.lazy,onChange:this.props.edit.onToggleLazy,className:"feedzy-lazy",help:y("Only on the front end.")}),wp.element.createElement(N,{label:y("Feed Caching Time"),value:this.props.attributes.refresh,options:[{label:y("1 Hour"),value:"1_hours"},{label:y("2 Hours"),value:"3_hours"},{label:y("12 Hours"),value:"12_hours"},{label:y("1 Day"),value:"1_days"},{label:y("3 Days"),value:"3_days"},{label:y("15 Days"),value:"15_days"}],onChange:this.props.edit.onRefresh,className:"feedzy-refresh"}),wp.element.createElement(N,{label:y("Sorting Order"),value:this.props.attributes.sort,options:[{label:y("Default"),value:"default"},{label:y("Date Descending"),value:"date_desc"},{label:y("Date Ascending"),value:"date_asc"},{label:y("Title Descending"),value:"title_desc"},{label:y("Title Ascending"),value:"title_asc"}],onChange:this.props.edit.onSort,className:"feedzy-sort"})),wp.element.createElement(x,{title:y("Item Options"),initialOpen:!1,className:"feedzy-item-options"},wp.element.createElement(N,{label:y("Open Links In"),value:this.props.attributes.target,options:[{label:y("New Tab"),value:"_blank"},{label:y("Same Tab"),value:"_self"}],onChange:this.props.edit.onTarget}),wp.element.createElement(z,{label:y("Title Character Limit"),help:y("Leave empty to show full title."),type:"number",value:this.props.attributes.title,onChange:this.props.edit.onTitle,className:"feedzy-title-length"}),wp.element.createElement(C,null,wp.element.createElement(z,{label:feedzyjs.isPro?y("Should we display additional meta fields out of author, date, time or categories? (comma-separated list, in order of display)."):y("Should we display additional meta fields out of author, date or time? (comma-separated list, in order of display)."),help:y('Leave empty to display all and "no" to display nothing.'),placeholder:feedzyjs.isPro?y("(eg: author, date, time, tz=local, categories)"):y("(eg: author, date, time, tz=local)"),value:this.props.attributes.metafields,onChange:this.props.edit.onChangeMeta,className:"feedzy-meta"}),wp.element.createElement(z,{label:y("When using multiple sources, should we display additional meta fields? - source (comma-separated list)."),placeholder:y("(eg: source)"),value:this.props.attributes.multiple_meta,onChange:this.props.edit.onChangeMultipleMeta,className:"feedzy-multiple-meta"}),wp.element.createElement(T,{href:"https://docs.themeisle.com/article/1089-how-to-display-author-date-or-time-from-the-feed"},y("You can find more info about available meta field values here."))),wp.element.createElement(j,{label:y("Display post description?"),checked:!!this.props.attributes.summary,onChange:this.props.edit.onToggleSummary,className:"feedzy-summary"}),this.props.attributes.summary&&wp.element.createElement(z,{label:y("Description Character Limit"),help:y("Leave empty to show full description."),type:"number",value:this.props.attributes.summarylength,onChange:this.props.edit.onSummaryLength,className:"feedzy-summary-length"}),feedzyjs.isPro&&[wp.element.createElement(z,{label:y("Only display if title contains:"),help:y("Comma-separated list/case sensitive."),value:this.props.attributes.keywords_title,onChange:this.props.edit.onKeywordsTitle,className:"feedzy-include"}),wp.element.createElement(z,{label:y("Exclude if title contains:"),help:y("Comma-separated list/case sensitive."),value:this.props.attributes.keywords_ban,onChange:this.props.edit.onKeywordsBan,className:"feedzy-ban"})]),wp.element.createElement(x,{title:y("Item Image Options"),initialOpen:!1,className:"feedzy-image-options"},wp.element.createElement(N,{label:y("Display first image if available?"),value:this.props.attributes.thumb,options:[{label:y("Yes (without a fallback image)"),value:"auto"},{label:y("Yes (with a fallback image)"),value:"yes"},{label:y("No"),value:"no"}],onChange:this.props.edit.onThumb,className:"feedzy-thumb"}),"no"!==this.props.attributes.thumb&&["auto"!==this.props.attributes.thumb&&wp.element.createElement("div",{className:"feedzy-blocks-base-control"},wp.element.createElement("label",{className:"blocks-base-control__label",for:"inspector-media-upload"},y("Fallback image if no image is found.")),wp.element.createElement(v,{type:"image",id:"inspector-media-upload",value:this.props.attributes.default,onSelect:this.props.edit.onDefault,render:function(t){var r=t.open;return[void 0!==e.props.attributes.default&&[wp.element.createElement(F,{naturalWidth:e.props.attributes.default.width,naturalHeight:e.props.attributes.default.height},wp.element.createElement("img",{src:e.props.attributes.default.url,alt:y("Featured image")})),wp.element.createElement(O,{isLarge:!0,isSecondary:!0,onClick:function(){return e.props.setAttributes({default:void 0})},style:{marginTop:"10px"}},y("Remove Image"))],wp.element.createElement(O,{isLarge:!0,isPrimary:!0,onClick:r,style:{marginTop:"10px"},className:void 0===e.props.attributes.default&&"feedzy_image_upload"},y("Upload Image"))]}})),wp.element.createElement(z,{label:y("Thumbnails dimension."),type:"number",value:this.props.attributes.size,onChange:this.props.edit.onSize}),wp.element.createElement(N,{label:y("How should we treat HTTP images?"),value:this.props.attributes.http,options:[{label:y("Show with HTTP link"),value:"auto"},{label:y("Force HTTPS"),value:"https"},{label:y("Ignore and show the default image instead"),value:"default"}],onChange:this.props.edit.onHTTP,className:"feedzy-http",help:t})]),feedzyjs.isPro&&wp.element.createElement(x,{title:y("Pro Features"),initialOpen:!1,className:"feedzy-pro-options"},wp.element.createElement(j,{label:y("Display price if available?"),help:this.props.attributes.price&&"default"===this.props.attributes.template?y("Choose a different template for this to work."):null,checked:!!this.props.attributes.price,onChange:this.props.edit.onTogglePrice,className:"feedzy-pro-price"}),wp.element.createElement(z,{label:y("Referral URL parameters."),help:y('Without ("?")'),placeholder:_("(eg. promo_code=feedzy_is_awesome)"),value:this.props.attributes.referral_url,onChange:this.props.edit.onReferralURL}),wp.element.createElement(S,{label:y("Columns"),help:y("How many columns we should use to display the feed items?"),value:this.props.attributes.columns||1,onChange:this.props.edit.onColumns,min:1,max:6,beforeIcon:"sort",allowReset:!0}),wp.element.createElement(l,{label:y("Feed Template"),selected:this.props.attributes.template,options:[{label:y("Default"),src:feedzyjs.imagepath+"feedzy-default-template.jpg",value:"default"},{label:y("Style 1"),src:feedzyjs.imagepath+"feedzy-style1-template.jpg",value:"style1"},{label:y("Style 2"),src:feedzyjs.imagepath+"feedzy-style2-template.jpg",value:"style2"}],onChange:this.props.edit.onTemplate,className:"feedzy-pro-template"}))])}}])&&c(t.prototype,r),n&&c(t,n),o}(E),P=function(e){var t=document.createElement("div");return t.innerHTML=e,void 0!==t.innerText?t.innerText:t.textContent};function A(e){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function L(){return(L=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function I(e,t,r,n,a,o,s){try{var i=e[o](s),l=i.value}catch(e){return void r(e)}i.done?t(l):Promise.resolve(l).then(n,a)}function U(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function s(e){I(o,n,a,s,i,"next",e)}function i(e){I(o,n,a,s,i,"throw",e)}s(void 0)}))}}function D(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function M(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function B(e,t){return(B=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function H(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=V(e);if(t){var a=V(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return $(this,r)}}function $(e,t){return!t||"object"!==A(t)&&"function"!=typeof t?K(e):t}function K(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V(e){return(V=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var q=wp.i18n.__,W=wp,Y=(W.apiFetch,W.apiRequest),Q=wp.element,G=Q.Component,J=(Q.Fragment,wp.components),X=J.ExternalLink,Z=J.Placeholder,ee=J.TextControl,te=J.Button,re=J.Spinner,ne=wp.date.date,ae=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&B(e,t)}(l,e);var t,r,n,a,s,i=H(l);function l(){var e;return D(this,l),(e=i.apply(this,arguments)).loadFeed=e.loadFeed.bind(K(e)),e.loadCategories=e.loadCategories.bind(K(e)),e.metaExists=e.metaExists.bind(K(e)),e.multipleMetaExists=e.multipleMetaExists.bind(K(e)),e.getImageURL=e.getImageURL.bind(K(e)),e.getValidateURL=e.getValidateURL.bind(K(e)),e.onChangeFeed=e.onChangeFeed.bind(K(e)),e.onChangeMax=e.onChangeMax.bind(K(e)),e.onChangeOffset=e.onChangeOffset.bind(K(e)),e.onToggleFeedTitle=e.onToggleFeedTitle.bind(K(e)),e.onRefresh=e.onRefresh.bind(K(e)),e.onSort=e.onSort.bind(K(e)),e.onTarget=e.onTarget.bind(K(e)),e.onTitle=e.onTitle.bind(K(e)),e.onChangeMeta=e.onChangeMeta.bind(K(e)),e.onChangeMultipleMeta=e.onChangeMultipleMeta.bind(K(e)),e.onToggleSummary=e.onToggleSummary.bind(K(e)),e.onToggleLazy=e.onToggleLazy.bind(K(e)),e.onSummaryLength=e.onSummaryLength.bind(K(e)),e.onKeywordsTitle=e.onKeywordsTitle.bind(K(e)),e.onKeywordsBan=e.onKeywordsBan.bind(K(e)),e.onThumb=e.onThumb.bind(K(e)),e.onDefault=e.onDefault.bind(K(e)),e.onSize=e.onSize.bind(K(e)),e.onHTTP=e.onHTTP.bind(K(e)),e.onReferralURL=e.onReferralURL.bind(K(e)),e.onColumns=e.onColumns.bind(K(e)),e.onTemplate=e.onTemplate.bind(K(e)),e.onTogglePrice=e.onTogglePrice.bind(K(e)),e.state={route:e.props.attributes.route,loading:!1,error:!1},e}return t=l,(r=[{key:"componentDidMount",value:(s=U(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.loadFeed(),void 0===this.props.attributes.categories&&(this.props.attributes.meta||this.props.setAttributes({meta:!0,metafields:"no"}),this.loadCategories());case 2:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"componentDidUpdate",value:(a=U(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"reload"===this.state.route&&this.loadFeed();case 1:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"loadFeed",value:function(){var e=this,t=this.props.attributes.feeds;if(void 0!==t){if(function(e,t){if(void 0===t)return!1;for(var r=!1,n=0;n<t.length;n++)if(t[n]===e){r=!0;break}return r}(t,this.props.attributes.categories)){var r=t;t=o.a.stringify({category:r},{arrayFormat:"bracket"})}else t=t.replace(/\s/g,"").split(",").filter((function(e){return""!==e})),t=o.a.stringify({url:t},{arrayFormat:"bracket"});this.setState({route:"home",loading:!0}),Y({path:"/feedzy/v1/feed?".concat(t),method:"POST",data:this.props.attributes}).then((function(t){return e.unmounting?t:t.error?(e.setState({route:"home",loading:!1,error:!0}),t):(e.props.setAttributes({feedData:t}),e.setState({route:"fetched",loading:!1}),t)})).fail((function(t){return e.setState({route:"home",loading:!1,error:!0}),t}))}}},{key:"loadCategories",value:function(){var e=this;Y({path:"/wp/v2/feedzy_categories"}).then((function(t){if(e.unmounting)return t;var r=0,n=[];t.forEach((function(e){n[r]=e.slug,r+=1})),e.props.setAttributes({categories:n}),jQuery(".feedzy-source input").autocomplete({source:n,select:function(e,t){this.props.setAttributes({feeds:t.item.label})}})})).fail((function(e){return e}))}},{key:"metaExists",value:function(e){return 0<=this.props.attributes.metafields.replace(/\s/g,"").split(",").indexOf(e)||""===this.props.attributes.metafields}},{key:"multipleMetaExists",value:function(e){return 0<=this.props.attributes.multiple_meta.replace(/\s/g,"").split(",").indexOf(e)||""===this.props.attributes.multiple_meta}},{key:"getImageURL",value:function(e,t){var r=e.thumbnail?e.thumbnail:this.props.attributes.default?this.props.attributes.default.url:feedzyjs.imagepath+"feedzy.svg";switch(this.props.attributes.http){case"default":-1===r.indexOf("https")&&0===r.indexOf("http")&&(r=this.props.attributes.default?this.props.attributes.default.url:feedzyjs.imagepath+"feedzy.svg");break;case"https":r=r.replace(/http:/g,"https:")}return t&&(r="url("+r+")"),r}},{key:"onChangeFeed",value:function(e){this.props.setAttributes({feeds:e})}},{key:"onChangeMax",value:function(e){this.props.setAttributes({max:e?Number(e):5})}},{key:"onChangeOffset",value:function(e){this.props.setAttributes({offset:Number(e)})}},{key:"onToggleFeedTitle",value:function(e){this.props.setAttributes({feed_title:!this.props.attributes.feed_title})}},{key:"onRefresh",value:function(e){this.props.setAttributes({refresh:e})}},{key:"onSort",value:function(e){this.props.setAttributes({sort:e})}},{key:"onTarget",value:function(e){this.props.setAttributes({target:e})}},{key:"onTitle",value:function(e){this.props.setAttributes({title:Number(e)})}},{key:"onChangeMeta",value:function(e){this.props.setAttributes({metafields:e})}},{key:"onChangeMultipleMeta",value:function(e){this.props.setAttributes({multiple_meta:e})}},{key:"onToggleSummary",value:function(e){this.props.setAttributes({summary:!this.props.attributes.summary})}},{key:"onToggleLazy",value:function(e){this.props.setAttributes({lazy:!this.props.attributes.lazy})}},{key:"onSummaryLength",value:function(e){this.props.setAttributes({summarylength:Number(e)})}},{key:"onKeywordsTitle",value:function(e){this.props.setAttributes({keywords_title:e})}},{key:"onKeywordsBan",value:function(e){this.props.setAttributes({keywords_ban:e})}},{key:"onThumb",value:function(e){this.props.setAttributes({thumb:e})}},{key:"onDefault",value:function(e){this.props.setAttributes({default:e}),this.setState({route:"reload"})}},{key:"onSize",value:function(e){this.props.setAttributes({size:e?Number(e):150})}},{key:"onHTTP",value:function(e){this.props.setAttributes({http:e}),this.setState({route:"reload"})}},{key:"onReferralURL",value:function(e){this.props.setAttributes({referral_url:e})}},{key:"onColumns",value:function(e){this.props.setAttributes({columns:e})}},{key:"onTemplate",value:function(e){this.props.setAttributes({template:e})}},{key:"onTogglePrice",value:function(e){this.props.setAttributes({price:!this.props.attributes.price})}},{key:"getValidateURL",value:function(){var e="https://validator.w3.org/feed/";return this.props.attributes.feeds&&(e+="check.cgi?url="+this.props.attributes.feeds),e}},{key:"render",value:function(){var e,t,r,n,a,o,s=this;return["fetched"===this.state.route&&wp.element.createElement(R,L({edit:this,state:this.state},this.props)),"home"===this.state.route&&wp.element.createElement("div",{className:this.props.className},wp.element.createElement(Z,{key:"placeholder",icon:"rss",label:q("Feedzy RSS Feeds")},this.state.loading?wp.element.createElement("div",{key:"loading",className:"wp-block-embed is-loading"},wp.element.createElement(re,null),wp.element.createElement("p",null,q("Fetching..."))):[wp.element.createElement(ee,{type:"url",className:"feedzy-source",placeholder:q("Enter URL or category of your feed here..."),onChange:this.onChangeFeed,value:this.props.attributes.feeds}),wp.element.createElement(te,{isLarge:!0,isPrimary:!0,type:"submit",onClick:this.loadFeed},q("Load Feed")),wp.element.createElement(X,{href:this.getValidateURL(),title:q("Validate Feed ")},q("Validate ")),this.state.error&&wp.element.createElement("div",null,q("Feed URL is invalid. Invalid feeds will NOT display items."))])),!("fetched"!==this.state.route||void 0===this.props.attributes.feedData)&&wp.element.createElement("div",{className:"feedzy-rss"},this.props.attributes.feed_title&&null!==this.props.attributes.feedData.channel&&wp.element.createElement("div",{className:"rss_header"},wp.element.createElement("h2",null,wp.element.createElement("a",{className:"rss_title"},P(this.props.attributes.feedData.channel.title)),wp.element.createElement("span",{className:"rss_description"}," "+P(this.props.attributes.feedData.channel.description)))),wp.element.createElement("ul",{className:"feedzy-".concat(this.props.attributes.template)},(e=this.props.attributes.feedData.items,t=this.props.attributes.sort,r=this.props.attributes.keywords_title,n=this.props.attributes.keywords_ban,a=this.props.attributes.max,o=this.props.attributes.offset,e=Array.from(e).sort((function(e,r){var n,a;return"date_desc"===t||"date_asc"===t?(n=e.pubDate,a=r.pubDate):"title_desc"!==t&&"title_asc"!==t||(n=e.title.toUpperCase(),a=r.title.toUpperCase()),n<a?"date_desc"===t||"title_desc"===t?1:-1:n>a?"date_desc"===t||"title_desc"===t?-1:1:0})).filter((function(e){return!r||r.split(",").filter((function(e){return""!==e.replace(/\s/g,"")})).some((function(t){return e.title.includes(t.trim())}))})).filter((function(e){return!n||n.split(",").filter((function(e){return""!==e.replace(/\s/g,"")})).every((function(t){return!1===e.title.includes(t.trim())}))})).slice(o,a+o)).map((function(e,t){var r=(e.date||"")+" "+(e.time||"")+" UTC +0000",n=P(e.date)||"",a=P(e.time)||"",o=P(e.categories)||"";s.metaExists("tz=local")&&(n=ne("F jS, o",r),a=ne("h:i A",r));var i=e.creator&&s.metaExists("author")?e.creator:"";""!==s.props.attributes.multiple_meta&&"no"!==s.props.attributes.multiple_meta&&(s.multipleMetaExists("source")||s.multipleMetaExists("yes"))&&""!==i&&""!==e.source&&(i=i+" ("+e.source+")");var l=new Object;return l.author=q("by")+" "+i,l.date=q("on")+" "+P(n),l.time=q("at")+" "+P(a),l.categories=q("in")+" "+P(o),wp.element.createElement("li",{key:t,style:{padding:"15px 0 25px"},className:"rss_item feedzy-rss-col-".concat(s.props.attributes.columns)},(e.thumbnail&&"auto"===s.props.attributes.thumb||"yes"===s.props.attributes.thumb)&&wp.element.createElement("div",{className:"rss_image",style:{width:s.props.attributes.size+"px",height:s.props.attributes.size+"px"}},wp.element.createElement("a",{title:P(e.title),style:{width:s.props.attributes.size+"px",height:s.props.attributes.size+"px"}},wp.element.createElement("span",{className:"fetched",style:{width:s.props.attributes.size+"px",height:s.props.attributes.size+"px",backgroundImage:s.getImageURL(e,!0)},title:P(e.title)}))),wp.element.createElement("div",{className:"rss_content_wrap"},wp.element.createElement("span",{className:"title"},wp.element.createElement("a",null,s.props.attributes.title&&P(e.title).length>s.props.attributes.title?P(e.title).substring(0,s.props.attributes.title)+"...":P(e.title))),wp.element.createElement("div",{className:"rss_content"},"no"!==s.props.attributes.metafields&&wp.element.createElement("small",{className:"meta"},function(e,t){var r="";""===t&&(t="author, date, time");for(var n=t.replace(/\s/g,"").split(","),a=0;a<n.length;a++)void 0!==e[n[a]]&&(r=r+" "+e[n[a]]);return r}(l,s.props.attributes.metafields)),s.props.attributes.summary&&wp.element.createElement("p",{className:"description"},s.props.attributes.summarylength&&P(e.description).length>s.props.attributes.summarylength?P(e.description).substring(0,s.props.attributes.summarylength)+" [...]":P(e.description)),feedzyjs.isPro&&e.media&&e.media.src&&wp.element.createElement("audio",{controls:!0,controlsList:"nodownload"},wp.element.createElement("source",{src:e.media.src,type:e.media.type}),q("Your browser does not support the audio element. But you can check this for the original link: "),wp.element.createElement("a",{href:e.media.src},e.media.src)),feedzyjs.isPro&&s.props.attributes.price&&e.price&&"default"!==s.props.attributes.template&&wp.element.createElement("div",{className:"price-wrap"},wp.element.createElement("a",null,wp.element.createElement("button",{className:"price"},e.price))))))}))))]}}])&&M(t.prototype,r),n&&M(t,n),l}(G),oe=wp.i18n.__,se=wp.blocks.registerBlockType;t.default=se("feedzy-rss-feeds/feedzy-block",{title:oe("Feedzy RSS Feeds"),category:"common",icon:"rss",keywords:[oe("Feedzy RSS Feeds"),oe("RSS"),oe("Feeds")],supports:{html:!1},attributes:n,edit:ae,save:function(){return null}})}]);
|
1 |
+
(()=>{"use strict";var e={20:e=>{var t="%[a-f0-9]{2}",r=new RegExp(t,"gi"),a=new RegExp("("+t+")+","gi");function n(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),a=e.slice(t);return Array.prototype.concat.call([],n(r),n(a))}function s(e){try{return decodeURIComponent(e)}catch(s){for(var t=e.match(r),a=1;a<t.length;a++)t=(e=n(t,a).join("")).match(r);return e}}e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=a.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch(e){var n=s(r[0]);n!==r[0]&&(t[r[0]]=n)}r=a.exec(e)}t["%C2"]="�";for(var o=Object.keys(t),i=0;i<o.length;i++){var l=o[i];e=e.replace(new RegExp(l,"g"),t[l])}return e}(e)}}},806:e=>{e.exports=function(e,t){for(var r={},a=Object.keys(e),n=Array.isArray(t),s=0;s<a.length;s++){var o=a[s],i=e[o];(n?-1!==t.indexOf(o):t(o,i,e))&&(r[o]=i)}return r}},563:(e,t,r)=>{const a=r(610),n=r(20),s=r(500),o=r(806);function i(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function l(e,t){return t.encode?t.strict?a(e):encodeURIComponent(e):e}function p(e,t){return t.decode?n(e):e}function u(e){return Array.isArray(e)?e.sort():"object"==typeof e?u(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function c(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function m(e){const t=(e=c(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function d(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function f(e,t){i((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,a)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===a[e]&&(a[e]={}),a[e][t[1]]=r):a[e]=r};case"bracket":return(e,r,a)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==a[e]?a[e]=[].concat(a[e],r):a[e]=[r]:a[e]=r};case"comma":case"separator":return(t,r,a)=>{const n="string"==typeof r&&r.includes(e.arrayFormatSeparator),s="string"==typeof r&&!n&&p(r,e).includes(e.arrayFormatSeparator);r=s?p(r,e):r;const o=n||s?r.split(e.arrayFormatSeparator).map((t=>p(t,e))):null===r?r:p(r,e);a[t]=o};case"bracket-separator":return(t,r,a)=>{const n=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!n)return void(a[t]=r?p(r,e):r);const s=null===r?[]:r.split(e.arrayFormatSeparator).map((t=>p(t,e)));void 0!==a[t]?a[t]=[].concat(a[t],s):a[t]=s};default:return(e,t,r)=>{void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t),a=Object.create(null);if("string"!=typeof e)return a;if(!(e=e.trim().replace(/^[?#&]/,"")))return a;for(const n of e.split("&")){if(""===n)continue;let[e,o]=s(t.decode?n.replace(/\+/g," "):n,"=");o=void 0===o?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?o:p(o,t),r(p(e,t),o,a)}for(const e of Object.keys(a)){const r=a[e];if("object"==typeof r&&null!==r)for(const e of Object.keys(r))r[e]=d(r[e],t);else a[e]=d(r,t)}return!1===t.sort?a:(!0===t.sort?Object.keys(a).sort():Object.keys(a).sort(t.sort)).reduce(((e,t)=>{const r=a[t];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?e[t]=u(r):e[t]=r,e}),Object.create(null))}t.extract=m,t.parse=f,t.stringify=(e,t)=>{if(!e)return"";i((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const r=r=>t.skipNull&&null==e[r]||t.skipEmptyString&&""===e[r],a=function(e){switch(e.arrayFormat){case"index":return t=>(r,a)=>{const n=r.length;return void 0===a||e.skipNull&&null===a||e.skipEmptyString&&""===a?r:null===a?[...r,[l(t,e),"[",n,"]"].join("")]:[...r,[l(t,e),"[",l(n,e),"]=",l(a,e)].join("")]};case"bracket":return t=>(r,a)=>void 0===a||e.skipNull&&null===a||e.skipEmptyString&&""===a?r:null===a?[...r,[l(t,e),"[]"].join("")]:[...r,[l(t,e),"[]=",l(a,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return r=>(a,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?a:(n=null===n?"":n,0===a.length?[[l(r,e),t,l(n,e)].join("")]:[[a,l(n,e)].join(e.arrayFormatSeparator)])}default:return t=>(r,a)=>void 0===a||e.skipNull&&null===a||e.skipEmptyString&&""===a?r:null===a?[...r,l(t,e)]:[...r,[l(t,e),"=",l(a,e)].join("")]}}(t),n={};for(const t of Object.keys(e))r(t)||(n[t]=e[t]);const s=Object.keys(n);return!1!==t.sort&&s.sort(t.sort),s.map((r=>{const n=e[r];return void 0===n?"":null===n?l(r,t):Array.isArray(n)?0===n.length&&"bracket-separator"===t.arrayFormat?l(r,t)+"[]":n.reduce(a(r),[]).join("&"):l(r,t)+"="+l(n,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[r,a]=s(e,"#");return Object.assign({url:r.split("?")[0]||"",query:f(m(e),t)},t&&t.parseFragmentIdentifier&&a?{fragmentIdentifier:p(a,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0},r);const a=c(e.url).split("?")[0]||"",n=t.extract(e.url),s=t.parse(n,{sort:!1}),o=Object.assign(s,e.query);let i=t.stringify(o,r);i&&(i=`?${i}`);let p=function(e){let t="";const r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(p=`#${l(e.fragmentIdentifier,r)}`),`${a}${i}${p}`},t.pick=(e,r,a)=>{a=Object.assign({parseFragmentIdentifier:!0},a);const{url:n,query:s,fragmentIdentifier:i}=t.parseUrl(e,a);return t.stringifyUrl({url:n,query:o(s,r),fragmentIdentifier:i},a)},t.exclude=(e,r,a)=>{const n=Array.isArray(r)?e=>!r.includes(e):(e,t)=>!r(e,t);return t.pick(e,n,a)}},500:e=>{e.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const r=e.indexOf(t);return-1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}},610:e=>{e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))}},t={};function r(a){var n=t[a];if(void 0!==n)return n.exports;var s=t[a]={exports:{}};return e[a](s,s.exports,r),s.exports}(()=>{var e=r(563),t=lodash.isEmpty,a=wp.components.BaseControl;const n=(0,wp.compose.withInstanceId)((function(e){var r=e.label,n=e.selected,s=e.help,o=e.instanceId,i=e.onChange,l=e.disabled,p=e.options,u=void 0===p?[]:p,c="inspector-radio-image-control-".concat(o),m=function(e){return i(e.target.value)};return!t(u)&&wp.element.createElement(a,{label:r,id:c,help:s,className:"components-radio-image-control"},wp.element.createElement("div",{className:"components-radio-image-control__container"},u.map((function(e,t){return wp.element.createElement("div",{key:"".concat(c,"-").concat(t),className:"components-radio-image-control__option"},wp.element.createElement("input",{id:"".concat(c,"-").concat(t),className:"components-radio-image-control__input",type:"radio",name:c,value:e.value,onChange:m,checked:e.value===n,"aria-describedby":s?"".concat(c,"__help"):void 0,disabled:l}),wp.element.createElement("label",{htmlFor:"".concat(c,"-").concat(t),title:e.label},wp.element.createElement("img",{src:e.src}),wp.element.createElement("span",{class:"image-clickable"})))}))))}));function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var c=wp.i18n.__,m=wp.blockEditor||wp.editor,d=m.InspectorControls,f=m.MediaUpload,h=wp.element,y=h.Component,b=(h.Fragment,wp.components),g=b.BaseControl,v=b.ExternalLink,w=b.PanelBody,E=b.RangeControl,k=b.TextControl,C=b.Button,T=b.ToggleControl,x=b.SelectControl,z=b.ResponsiveWrapper;const N=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(h,e);var t,r,a,s,m=(a=h,s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=u(a);if(s){var r=u(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return p(this,e)});function h(){return o(this,h),m.apply(this,arguments)}return t=h,(r=[{key:"render",value:function(){var e=this,t="";return"https"===this.props.attributes.http&&(t+=c("Please verify that the images exist on HTTPS.")),wp.element.createElement(d,{key:"inspector"},0!==this.props.attributes.status&&wp.element.createElement(w,null,wp.element.createElement(k,{label:c("Feed Source"),className:"feedzy-source",value:this.props.attributes.feeds,onChange:this.props.edit.onChangeFeed}),wp.element.createElement(C,{isLarge:!0,isPrimary:!0,type:"submit",onClick:this.props.edit.loadFeed,className:"loadFeed"},c("Load Feed"))),"fetched"===this.props.state.route&&[wp.element.createElement(w,{title:c("Feed Settings"),initialOpen:!0,className:"feedzy-options"},wp.element.createElement(E,{label:c("Number of Items"),value:Number(this.props.attributes.max)||5,onChange:this.props.edit.onChangeMax,min:1,max:this.props.attributes.feedData.items.length||10,beforeIcon:"sort",className:"feedzy-max"}),wp.element.createElement(E,{label:c("Ignore first N items"),value:Number(this.props.attributes.offset)||0,onChange:this.props.edit.onChangeOffset,min:0,max:this.props.attributes.feedData.items.length,beforeIcon:"sort",className:"feedzy-offset"}),null!==this.props.attributes.feedData.channel&&wp.element.createElement(T,{label:c("Display feed title?"),checked:!!this.props.attributes.feed_title,onChange:this.props.edit.onToggleFeedTitle,className:"feedzy-title"}),wp.element.createElement(T,{label:c("Lazy load feed?"),checked:!!this.props.attributes.lazy,onChange:this.props.edit.onToggleLazy,className:"feedzy-lazy",help:c("Only on the front end.")}),wp.element.createElement(x,{label:c("Feed Caching Time"),value:this.props.attributes.refresh,options:[{label:c("1 Hour"),value:"1_hours"},{label:c("2 Hours"),value:"3_hours"},{label:c("12 Hours"),value:"12_hours"},{label:c("1 Day"),value:"1_days"},{label:c("3 Days"),value:"3_days"},{label:c("15 Days"),value:"15_days"}],onChange:this.props.edit.onRefresh,className:"feedzy-refresh"}),wp.element.createElement(x,{label:c("Sorting Order"),value:this.props.attributes.sort,options:[{label:c("Default"),value:"default"},{label:c("Date Descending"),value:"date_desc"},{label:c("Date Ascending"),value:"date_asc"},{label:c("Title Descending"),value:"title_desc"},{label:c("Title Ascending"),value:"title_asc"}],onChange:this.props.edit.onSort,className:"feedzy-sort"})),wp.element.createElement(w,{title:c("Item Options"),initialOpen:!1,className:"feedzy-item-options"},wp.element.createElement(x,{label:c("Open Links In"),value:this.props.attributes.target,options:[{label:c("New Tab"),value:"_blank"},{label:c("Same Tab"),value:"_self"}],onChange:this.props.edit.onTarget}),wp.element.createElement(k,{label:c("Title Character Limit"),help:c("Leave empty to show full title."),type:"number",value:this.props.attributes.title,onChange:this.props.edit.onTitle,className:"feedzy-title-length"}),wp.element.createElement(g,null,wp.element.createElement(k,{label:feedzyjs.isPro?c("Should we display additional meta fields out of author, date, time or categories? (comma-separated list, in order of display)."):c("Should we display additional meta fields out of author, date or time? (comma-separated list, in order of display)."),help:c('Leave empty to display all and "no" to display nothing.'),placeholder:feedzyjs.isPro?c("(eg: author, date, time, tz=local, categories)"):c("(eg: author, date, time, tz=local)"),value:this.props.attributes.metafields,onChange:this.props.edit.onChangeMeta,className:"feedzy-meta"}),wp.element.createElement(k,{label:c("When using multiple sources, should we display additional meta fields? - source (comma-separated list)."),placeholder:c("(eg: source)"),value:this.props.attributes.multiple_meta,onChange:this.props.edit.onChangeMultipleMeta,className:"feedzy-multiple-meta"}),wp.element.createElement(v,{href:"https://docs.themeisle.com/article/1089-how-to-display-author-date-or-time-from-the-feed"},c("You can find more info about available meta field values here."))),wp.element.createElement(T,{label:c("Display post description?"),checked:!!this.props.attributes.summary,onChange:this.props.edit.onToggleSummary,className:"feedzy-summary"}),this.props.attributes.summary&&wp.element.createElement(k,{label:c("Description Character Limit"),help:c("Leave empty to show full description."),type:"number",value:this.props.attributes.summarylength,onChange:this.props.edit.onSummaryLength,className:"feedzy-summary-length"}),feedzyjs.isPro&&[wp.element.createElement(k,{label:c("Only display if title contains:"),help:c("Comma-separated list/case sensitive."),value:this.props.attributes.keywords_title,onChange:this.props.edit.onKeywordsTitle,className:"feedzy-include"}),wp.element.createElement(k,{label:c("Exclude if title contains:"),help:c("Comma-separated list/case sensitive."),value:this.props.attributes.keywords_ban,onChange:this.props.edit.onKeywordsBan,className:"feedzy-ban"})]),wp.element.createElement(w,{title:c("Item Image Options"),initialOpen:!1,className:"feedzy-image-options"},wp.element.createElement(x,{label:c("Display first image if available?"),value:this.props.attributes.thumb,options:[{label:c("Yes (without a fallback image)"),value:"auto"},{label:c("Yes (with a fallback image)"),value:"yes"},{label:c("No"),value:"no"}],onChange:this.props.edit.onThumb,className:"feedzy-thumb"}),"no"!==this.props.attributes.thumb&&["auto"!==this.props.attributes.thumb&&wp.element.createElement("div",{className:"feedzy-blocks-base-control"},wp.element.createElement("label",{className:"blocks-base-control__label",for:"inspector-media-upload"},c("Fallback image if no image is found.")),wp.element.createElement(f,{type:"image",id:"inspector-media-upload",value:this.props.attributes.default,onSelect:this.props.edit.onDefault,render:function(t){var r=t.open;return[void 0!==e.props.attributes.default&&[wp.element.createElement(z,{naturalWidth:e.props.attributes.default.width,naturalHeight:e.props.attributes.default.height},wp.element.createElement("img",{src:e.props.attributes.default.url,alt:c("Featured image")})),wp.element.createElement(C,{isLarge:!0,isSecondary:!0,onClick:function(){return e.props.setAttributes({default:void 0})},style:{marginTop:"10px"}},c("Remove Image"))],wp.element.createElement(C,{isLarge:!0,isPrimary:!0,onClick:r,style:{marginTop:"10px"},className:void 0===e.props.attributes.default&&"feedzy_image_upload"},c("Upload Image"))]}})),wp.element.createElement(k,{label:c("Thumbnails dimension."),type:"number",value:this.props.attributes.size,onChange:this.props.edit.onSize}),wp.element.createElement(x,{label:c("How should we treat HTTP images?"),value:this.props.attributes.http,options:[{label:c("Show with HTTP link"),value:"auto"},{label:c("Force HTTPS"),value:"https"},{label:c("Ignore and show the default image instead"),value:"default"}],onChange:this.props.edit.onHTTP,className:"feedzy-http",help:t})]),feedzyjs.isPro&&wp.element.createElement(w,{title:c("Pro Features"),initialOpen:!1,className:"feedzy-pro-options"},wp.element.createElement(T,{label:c("Display price if available?"),help:this.props.attributes.price&&"default"===this.props.attributes.template?c("Choose a different template for this to work."):null,checked:!!this.props.attributes.price,onChange:this.props.edit.onTogglePrice,className:"feedzy-pro-price"}),wp.element.createElement(k,{label:c("Referral URL parameters."),help:c('Without ("?")'),placeholder:_("(eg. promo_code=feedzy_is_awesome)"),value:this.props.attributes.referral_url,onChange:this.props.edit.onReferralURL}),wp.element.createElement(E,{label:c("Columns"),help:c("How many columns we should use to display the feed items?"),value:this.props.attributes.columns||1,onChange:this.props.edit.onColumns,min:1,max:6,beforeIcon:"sort",allowReset:!0}),wp.element.createElement(n,{label:c("Feed Template"),selected:this.props.attributes.template,options:[{label:c("Default"),src:feedzyjs.imagepath+"feedzy-default-template.jpg",value:"default"},{label:c("Style 1"),src:feedzyjs.imagepath+"feedzy-style1-template.jpg",value:"style1"},{label:c("Style 2"),src:feedzyjs.imagepath+"feedzy-style2-template.jpg",value:"style2"}],onChange:this.props.edit.onTemplate,className:"feedzy-pro-template"}))])}}])&&i(t.prototype,r),h}(y);var S=function(e){var t=document.createElement("div");return t.innerHTML=e,void 0!==t.innerText?t.innerText:t.textContent};function F(e){return(F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function O(){return(O=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}function j(e,t,r,a,n,s,o){try{var i=e[s](o),l=i.value}catch(e){return void r(e)}i.done?t(l):Promise.resolve(l).then(a,n)}function R(e){return function(){var t=this,r=arguments;return new Promise((function(a,n){var s=e.apply(t,r);function o(e){j(s,a,n,o,i,"next",e)}function i(e){j(s,a,n,o,i,"throw",e)}o(void 0)}))}}function A(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function L(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function P(e,t){return(P=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e,t){return!t||"object"!==F(t)&&"function"!=typeof t?U(e):t}function U(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function D(e){return(D=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var M=wp.i18n.__,B=wp,H=(B.apiFetch,B.apiRequest),$=wp.element,K=$.Component,V=($.Fragment,wp.components),q=V.ExternalLink,W=V.Placeholder,Y=V.TextControl,Q=V.Button,G=V.Spinner,J=wp.date.date;const X=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&P(e,t)}(p,t);var r,a,n,s,o,i,l=(o=p,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=D(o);if(i){var r=D(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return I(this,e)});function p(){var e;return A(this,p),(e=l.apply(this,arguments)).loadFeed=e.loadFeed.bind(U(e)),e.loadCategories=e.loadCategories.bind(U(e)),e.metaExists=e.metaExists.bind(U(e)),e.multipleMetaExists=e.multipleMetaExists.bind(U(e)),e.getImageURL=e.getImageURL.bind(U(e)),e.getValidateURL=e.getValidateURL.bind(U(e)),e.onChangeFeed=e.onChangeFeed.bind(U(e)),e.onChangeMax=e.onChangeMax.bind(U(e)),e.onChangeOffset=e.onChangeOffset.bind(U(e)),e.onToggleFeedTitle=e.onToggleFeedTitle.bind(U(e)),e.onRefresh=e.onRefresh.bind(U(e)),e.onSort=e.onSort.bind(U(e)),e.onTarget=e.onTarget.bind(U(e)),e.onTitle=e.onTitle.bind(U(e)),e.onChangeMeta=e.onChangeMeta.bind(U(e)),e.onChangeMultipleMeta=e.onChangeMultipleMeta.bind(U(e)),e.onToggleSummary=e.onToggleSummary.bind(U(e)),e.onToggleLazy=e.onToggleLazy.bind(U(e)),e.onSummaryLength=e.onSummaryLength.bind(U(e)),e.onKeywordsTitle=e.onKeywordsTitle.bind(U(e)),e.onKeywordsBan=e.onKeywordsBan.bind(U(e)),e.onThumb=e.onThumb.bind(U(e)),e.onDefault=e.onDefault.bind(U(e)),e.onSize=e.onSize.bind(U(e)),e.onHTTP=e.onHTTP.bind(U(e)),e.onReferralURL=e.onReferralURL.bind(U(e)),e.onColumns=e.onColumns.bind(U(e)),e.onTemplate=e.onTemplate.bind(U(e)),e.onTogglePrice=e.onTogglePrice.bind(U(e)),e.state={route:e.props.attributes.route,loading:!1,error:!1},e}return r=p,(a=[{key:"componentDidMount",value:(s=R(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.loadFeed(),void 0===this.props.attributes.categories&&(this.props.attributes.meta||this.props.setAttributes({meta:!0,metafields:"no"}),this.loadCategories());case 2:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"componentDidUpdate",value:(n=R(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"reload"===this.state.route&&this.loadFeed();case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"loadFeed",value:function(){var t=this,r=this.props.attributes.feeds;if(void 0!==r){if(function(e,t){if(void 0===t)return!1;for(var r=!1,a=0;a<t.length;a++)if(t[a]===e){r=!0;break}return r}(r,this.props.attributes.categories)){var a=r;r=e.stringify({category:a},{arrayFormat:"bracket"})}else r=r.replace(/\s/g,"").split(",").filter((function(e){return""!==e})),r=e.stringify({url:r},{arrayFormat:"bracket"});this.setState({route:"home",loading:!0}),H({path:"/feedzy/v1/feed?".concat(r),method:"POST",data:this.props.attributes}).then((function(e){return t.unmounting?e:e.error?(t.setState({route:"home",loading:!1,error:!0}),e):(t.props.setAttributes({feedData:e}),t.setState({route:"fetched",loading:!1}),e)})).fail((function(e){return t.setState({route:"home",loading:!1,error:!0}),e}))}}},{key:"loadCategories",value:function(){var e=this;H({path:"/wp/v2/feedzy_categories"}).then((function(t){if(e.unmounting)return t;var r=0,a=[];t.forEach((function(e){a[r]=e.slug,r+=1})),e.props.setAttributes({categories:a}),jQuery(".feedzy-source input").autocomplete({source:a,select:function(e,t){this.props.setAttributes({feeds:t.item.label})}})})).fail((function(e){return e}))}},{key:"metaExists",value:function(e){return 0<=this.props.attributes.metafields.replace(/\s/g,"").split(",").indexOf(e)||""===this.props.attributes.metafields}},{key:"multipleMetaExists",value:function(e){return 0<=this.props.attributes.multiple_meta.replace(/\s/g,"").split(",").indexOf(e)||""===this.props.attributes.multiple_meta}},{key:"getImageURL",value:function(e,t){var r=e.thumbnail?e.thumbnail:this.props.attributes.default?this.props.attributes.default.url:feedzyjs.imagepath+"feedzy.svg";switch(this.props.attributes.http){case"default":-1===r.indexOf("https")&&0===r.indexOf("http")&&(r=this.props.attributes.default?this.props.attributes.default.url:feedzyjs.imagepath+"feedzy.svg");break;case"https":r=r.replace(/http:/g,"https:")}return t&&(r="url("+r+")"),r}},{key:"onChangeFeed",value:function(e){this.props.setAttributes({feeds:e})}},{key:"onChangeMax",value:function(e){this.props.setAttributes({max:e?Number(e):5})}},{key:"onChangeOffset",value:function(e){this.props.setAttributes({offset:Number(e)})}},{key:"onToggleFeedTitle",value:function(e){this.props.setAttributes({feed_title:!this.props.attributes.feed_title})}},{key:"onRefresh",value:function(e){this.props.setAttributes({refresh:e})}},{key:"onSort",value:function(e){this.props.setAttributes({sort:e})}},{key:"onTarget",value:function(e){this.props.setAttributes({target:e})}},{key:"onTitle",value:function(e){this.props.setAttributes({title:Number(e)})}},{key:"onChangeMeta",value:function(e){this.props.setAttributes({metafields:e})}},{key:"onChangeMultipleMeta",value:function(e){this.props.setAttributes({multiple_meta:e})}},{key:"onToggleSummary",value:function(e){this.props.setAttributes({summary:!this.props.attributes.summary})}},{key:"onToggleLazy",value:function(e){this.props.setAttributes({lazy:!this.props.attributes.lazy})}},{key:"onSummaryLength",value:function(e){this.props.setAttributes({summarylength:Number(e)})}},{key:"onKeywordsTitle",value:function(e){this.props.setAttributes({keywords_title:e})}},{key:"onKeywordsBan",value:function(e){this.props.setAttributes({keywords_ban:e})}},{key:"onThumb",value:function(e){this.props.setAttributes({thumb:e})}},{key:"onDefault",value:function(e){this.props.setAttributes({default:e}),this.setState({route:"reload"})}},{key:"onSize",value:function(e){this.props.setAttributes({size:e?Number(e):150})}},{key:"onHTTP",value:function(e){this.props.setAttributes({http:e}),this.setState({route:"reload"})}},{key:"onReferralURL",value:function(e){this.props.setAttributes({referral_url:e})}},{key:"onColumns",value:function(e){this.props.setAttributes({columns:e})}},{key:"onTemplate",value:function(e){this.props.setAttributes({template:e})}},{key:"onTogglePrice",value:function(e){this.props.setAttributes({price:!this.props.attributes.price})}},{key:"getValidateURL",value:function(){var e="https://validator.w3.org/feed/";return this.props.attributes.feeds&&(e+="check.cgi?url="+this.props.attributes.feeds),e}},{key:"render",value:function(){var e,t,r,a,n,s,o=this;return["fetched"===this.state.route&&wp.element.createElement(N,O({edit:this,state:this.state},this.props)),"home"===this.state.route&&wp.element.createElement("div",{className:this.props.className},wp.element.createElement(W,{key:"placeholder",icon:"rss",label:M("Feedzy RSS Feeds")},this.state.loading?wp.element.createElement("div",{key:"loading",className:"wp-block-embed is-loading"},wp.element.createElement(G,null),wp.element.createElement("p",null,M("Fetching..."))):[wp.element.createElement(Y,{type:"url",className:"feedzy-source",placeholder:M("Enter URL or category of your feed here..."),onChange:this.onChangeFeed,value:this.props.attributes.feeds}),wp.element.createElement(Q,{isLarge:!0,isPrimary:!0,type:"submit",onClick:this.loadFeed},M("Load Feed")),wp.element.createElement(q,{href:this.getValidateURL(),title:M("Validate Feed ")},M("Validate ")),this.state.error&&wp.element.createElement("div",null,M("Feed URL is invalid. Invalid feeds will NOT display items."))])),!("fetched"!==this.state.route||void 0===this.props.attributes.feedData)&&wp.element.createElement("div",{className:"feedzy-rss"},this.props.attributes.feed_title&&null!==this.props.attributes.feedData.channel&&wp.element.createElement("div",{className:"rss_header"},wp.element.createElement("h2",null,wp.element.createElement("a",{className:"rss_title"},S(this.props.attributes.feedData.channel.title)),wp.element.createElement("span",{className:"rss_description"}," "+S(this.props.attributes.feedData.channel.description)))),wp.element.createElement("ul",{className:"feedzy-".concat(this.props.attributes.template)},(e=this.props.attributes.feedData.items,t=this.props.attributes.sort,r=this.props.attributes.keywords_title,a=this.props.attributes.keywords_ban,n=this.props.attributes.max,s=this.props.attributes.offset,e=Array.from(e).sort((function(e,r){var a,n;return"date_desc"===t||"date_asc"===t?(a=e.pubDate,n=r.pubDate):"title_desc"!==t&&"title_asc"!==t||(a=e.title.toUpperCase(),n=r.title.toUpperCase()),a<n?"date_desc"===t||"title_desc"===t?1:-1:a>n?"date_desc"===t||"title_desc"===t?-1:1:0})).filter((function(e){return!r||r.split(",").filter((function(e){return""!==e.replace(/\s/g,"")})).some((function(t){return e.title.includes(t.trim())}))})).filter((function(e){return!a||a.split(",").filter((function(e){return""!==e.replace(/\s/g,"")})).every((function(t){return!1===e.title.includes(t.trim())}))})).slice(s,n+s)).map((function(e,t){var r=(e.date||"")+" "+(e.time||"")+" UTC +0000",a=S(e.date)||"",n=S(e.time)||"",s=S(e.categories)||"";o.metaExists("tz=local")&&(a=J("F jS, o",r),n=J("h:i A",r));var i=e.creator&&o.metaExists("author")?e.creator:"";""!==o.props.attributes.multiple_meta&&"no"!==o.props.attributes.multiple_meta&&((o.multipleMetaExists("source")||o.multipleMetaExists("yes"))&&""!==i&&""!==e.source?i=i+" ("+e.source+")":(o.multipleMetaExists("source")||o.multipleMetaExists("yes"))&&""!==e.source&&(i=e.source));var l=new Object;return l.author=M("by")+" "+i,l.date=M("on")+" "+S(a),l.time=M("at")+" "+S(n),l.categories=M("in")+" "+S(s),wp.element.createElement("li",{key:t,style:{padding:"15px 0 25px"},className:"rss_item feedzy-rss-col-".concat(o.props.attributes.columns)},(e.thumbnail&&"auto"===o.props.attributes.thumb||"yes"===o.props.attributes.thumb)&&wp.element.createElement("div",{className:"rss_image",style:{width:o.props.attributes.size+"px",height:o.props.attributes.size+"px"}},wp.element.createElement("a",{title:S(e.title),style:{width:o.props.attributes.size+"px",height:o.props.attributes.size+"px"}},wp.element.createElement("span",{className:"fetched",style:{width:o.props.attributes.size+"px",height:o.props.attributes.size+"px",backgroundImage:o.getImageURL(e,!0)},title:S(e.title)}))),wp.element.createElement("div",{className:"rss_content_wrap"},wp.element.createElement("span",{className:"title"},wp.element.createElement("a",null,o.props.attributes.title&&S(e.title).length>o.props.attributes.title?S(e.title).substring(0,o.props.attributes.title)+"...":S(e.title))),wp.element.createElement("div",{className:"rss_content"},"no"!==o.props.attributes.metafields&&wp.element.createElement("small",{className:"meta"},function(e,t){var r="";""===t&&(t="author, date, time");for(var a=t.replace(/\s/g,"").split(","),n=0;n<a.length;n++)void 0!==e[a[n]]&&(r=r+" "+e[a[n]]);return r}(l,o.props.attributes.metafields)),o.props.attributes.summary&&wp.element.createElement("p",{className:"description"},o.props.attributes.summarylength&&S(e.description).length>o.props.attributes.summarylength?S(e.description).substring(0,o.props.attributes.summarylength)+" [...]":S(e.description)),feedzyjs.isPro&&e.media&&e.media.src&&wp.element.createElement("audio",{controls:!0,controlsList:"nodownload"},wp.element.createElement("source",{src:e.media.src,type:e.media.type}),M("Your browser does not support the audio element. But you can check this for the original link: "),wp.element.createElement("a",{href:e.media.src},e.media.src)),feedzyjs.isPro&&o.props.attributes.price&&e.price&&"default"!==o.props.attributes.template&&wp.element.createElement("div",{className:"price-wrap"},wp.element.createElement("a",null,wp.element.createElement("button",{className:"price"},e.price))))))}))))]}}])&&L(r.prototype,a),p}(K);var Z=wp.i18n.__;(0,wp.blocks.registerBlockType)("feedzy-rss-feeds/feedzy-block",{title:Z("Feedzy RSS Feeds"),category:"common",icon:"rss",keywords:[Z("Feedzy RSS Feeds"),Z("RSS"),Z("Feeds")],supports:{html:!1},attributes:{feeds:{type:"string"},max:{type:"number",default:5},offset:{type:"number",default:0},feed_title:{type:"boolean",default:!0},refresh:{type:"string",default:"12_hours"},sort:{type:"string",default:"default"},target:{type:"string",default:"_blank"},title:{type:"number"},meta:{type:"boolean",default:!0},lazy:{type:"boolean",default:!1},metafields:{type:"string",default:""},multiple_meta:{type:"string",default:""},summary:{type:"boolean",default:!0},summarylength:{type:"number"},keywords_title:{type:"string"},keywords_ban:{type:"string"},thumb:{type:"string",default:"auto"},default:{type:"object"},size:{type:"number",default:150},http:{type:"string"},referral_url:{type:"string"},columns:{type:"number",default:1},template:{type:"string",default:"default"},price:{type:"boolean",default:!0},route:{type:"string",default:"home"},feedData:{type:"object"},categories:{type:"object"}},edit:X,save:function(){return null}})})()})();
|
includes/views/css/import-metabox-edit.css
CHANGED
@@ -1795,11 +1795,11 @@ a:focus.dropdown-item {
|
|
1795 |
border-color: #f35b3f;
|
1796 |
}
|
1797 |
|
1798 |
-
input[type="text"],
|
1799 |
-
input[type="password"],
|
1800 |
-
input[type="number"],
|
1801 |
-
textarea,
|
1802 |
-
textarea.form-control {
|
1803 |
width: 100%;
|
1804 |
height: 44px;
|
1805 |
margin: 0;
|
@@ -1818,43 +1818,43 @@ textarea.form-control {
|
|
1818 |
transition: all 0.3s;
|
1819 |
}
|
1820 |
|
1821 |
-
textarea,
|
1822 |
-
textarea.form-control {
|
1823 |
height: 90px;
|
1824 |
}
|
1825 |
|
1826 |
-
input[type="text"]:focus,
|
1827 |
-
input[type="password"]:focus,
|
1828 |
-
input[type="number"]:focus,
|
1829 |
-
textarea:focus,
|
1830 |
-
textarea.form-control:focus {
|
1831 |
border: 1px solid #ccc;
|
1832 |
outline: 0;
|
1833 |
background: #fff;
|
1834 |
box-shadow: none;
|
1835 |
}
|
1836 |
|
1837 |
-
input[type="text"]:-moz-placeholder,
|
1838 |
-
input[type="password"]:-moz-placeholder,
|
1839 |
-
input[type="number"]:-moz-placeholder,
|
1840 |
-
textarea:-moz-placeholder,
|
1841 |
-
textarea.form-control:-moz-placeholder {
|
1842 |
color: #888;
|
1843 |
}
|
1844 |
|
1845 |
-
input[type="text"]:-ms-input-placeholder,
|
1846 |
-
input[type="password"]:-ms-input-placeholder,
|
1847 |
-
input[type="number"]:-ms-input-placeholder,
|
1848 |
-
textarea:-ms-input-placeholder,
|
1849 |
-
textarea.form-control:-ms-input-placeholder {
|
1850 |
color: #888;
|
1851 |
}
|
1852 |
|
1853 |
-
input[type="text"]::-webkit-input-placeholder,
|
1854 |
-
input[type="password"]::-webkit-input-placeholder,
|
1855 |
-
input[type="number"]::-webkit-input-placeholder,
|
1856 |
-
textarea::-webkit-input-placeholder,
|
1857 |
-
textarea.form-control::-webkit-input-placeholder {
|
1858 |
color: #888;
|
1859 |
}
|
1860 |
|
1795 |
border-color: #f35b3f;
|
1796 |
}
|
1797 |
|
1798 |
+
#poststuff input[type="text"],
|
1799 |
+
#poststuff input[type="password"],
|
1800 |
+
#poststuff input[type="number"],
|
1801 |
+
#poststuff textarea,
|
1802 |
+
#poststuff textarea.form-control {
|
1803 |
width: 100%;
|
1804 |
height: 44px;
|
1805 |
margin: 0;
|
1818 |
transition: all 0.3s;
|
1819 |
}
|
1820 |
|
1821 |
+
#poststuff textarea,
|
1822 |
+
#poststuff textarea.form-control {
|
1823 |
height: 90px;
|
1824 |
}
|
1825 |
|
1826 |
+
#poststuff input[type="text"]:focus,
|
1827 |
+
#poststuff input[type="password"]:focus,
|
1828 |
+
#poststuff input[type="number"]:focus,
|
1829 |
+
#poststuff textarea:focus,
|
1830 |
+
#poststuff textarea.form-control:focus {
|
1831 |
border: 1px solid #ccc;
|
1832 |
outline: 0;
|
1833 |
background: #fff;
|
1834 |
box-shadow: none;
|
1835 |
}
|
1836 |
|
1837 |
+
#poststuff input[type="text"]:-moz-placeholder,
|
1838 |
+
#poststuff input[type="password"]:-moz-placeholder,
|
1839 |
+
#poststuff input[type="number"]:-moz-placeholder,
|
1840 |
+
#poststuff textarea:-moz-placeholder,
|
1841 |
+
#poststuff textarea.form-control:-moz-placeholder {
|
1842 |
color: #888;
|
1843 |
}
|
1844 |
|
1845 |
+
#poststuff input[type="text"]:-ms-input-placeholder,
|
1846 |
+
#poststuff input[type="password"]:-ms-input-placeholder,
|
1847 |
+
#poststuff input[type="number"]:-ms-input-placeholder,
|
1848 |
+
#poststuff textarea:-ms-input-placeholder,
|
1849 |
+
#poststuff textarea.form-control:-ms-input-placeholder {
|
1850 |
color: #888;
|
1851 |
}
|
1852 |
|
1853 |
+
#poststuff input[type="text"]::-webkit-input-placeholder,
|
1854 |
+
#poststuff input[type="password"]::-webkit-input-placeholder,
|
1855 |
+
#poststuff input[type="number"]::-webkit-input-placeholder,
|
1856 |
+
#poststuff textarea::-webkit-input-placeholder,
|
1857 |
+
#poststuff textarea.form-control::-webkit-input-placeholder {
|
1858 |
color: #888;
|
1859 |
}
|
1860 |
|
readme.txt
CHANGED
@@ -462,6 +462,20 @@ You have to check first if your feed is valid. Please test it here: https://vali
|
|
462 |
|
463 |
== Changelog ==
|
464 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
465 |
#### [Version 3.7.0](https://github.com/Codeinwp/feedzy-rss-feeds/compare/v3.6.4...v3.7.0) (2021-05-12)
|
466 |
|
467 |
### Features
|
462 |
|
463 |
== Changelog ==
|
464 |
|
465 |
+
##### [Version 3.7.1](https://github.com/Codeinwp/feedzy-rss-feeds/compare/v3.7.0...v3.7.1) (2021-07-07)
|
466 |
+
|
467 |
+
### Fixes
|
468 |
+
- Particular RSS XML Feed showed as invalid if you select Post author to be shown in the backend
|
469 |
+
- Add default feed values if they are empty
|
470 |
+
- Fix source name when author unavailable in Gutenberg block
|
471 |
+
- Change 2nd-time validation message when author empty
|
472 |
+
- Fix broken style issue in feedzy list page
|
473 |
+
- Fix fewer columns issue in Gutenberg block
|
474 |
+
- Fix broken dropdown style issue in admin
|
475 |
+
|
476 |
+
|
477 |
+
|
478 |
+
|
479 |
#### [Version 3.7.0](https://github.com/Codeinwp/feedzy-rss-feeds/compare/v3.6.4...v3.7.0) (2021-05-12)
|
480 |
|
481 |
### Features
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit199b618daa374bf13d1ae645672cdf7c::getLoader();
|
vendor/composer/ClassLoader.php
CHANGED
@@ -338,7 +338,7 @@ class ClassLoader
|
|
338 |
* Loads the given class or interface.
|
339 |
*
|
340 |
* @param string $class The name of the class
|
341 |
-
* @return
|
342 |
*/
|
343 |
public function loadClass($class)
|
344 |
{
|
@@ -347,6 +347,8 @@ class ClassLoader
|
|
347 |
|
348 |
return true;
|
349 |
}
|
|
|
|
|
350 |
}
|
351 |
|
352 |
/**
|
338 |
* Loads the given class or interface.
|
339 |
*
|
340 |
* @param string $class The name of the class
|
341 |
+
* @return true|null True if loaded, null otherwise
|
342 |
*/
|
343 |
public function loadClass($class)
|
344 |
{
|
347 |
|
348 |
return true;
|
349 |
}
|
350 |
+
|
351 |
+
return null;
|
352 |
}
|
353 |
|
354 |
/**
|
vendor/composer/InstalledVersions.php
CHANGED
@@ -1,295 +1,337 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
|
13 |
namespace Composer;
|
14 |
|
15 |
use Composer\Autoload\ClassLoader;
|
16 |
use Composer\Semver\VersionParser;
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
class InstalledVersions
|
26 |
{
|
27 |
-
private static $installed
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
)
|
59 |
-
|
60 |
-
);
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
if (
|
137 |
-
|
138 |
-
}
|
139 |
-
|
140 |
-
$ranges =
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
}
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
return null
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
}
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
return null
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
}
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
return null
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
}
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
return
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
$installed
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
295 |
}
|
1 |
<?php
|
2 |
|
3 |
+
/*
|
4 |
+
* This file is part of Composer.
|
5 |
+
*
|
6 |
+
* (c) Nils Adermann <naderman@naderman.de>
|
7 |
+
* Jordi Boggiano <j.boggiano@seld.be>
|
8 |
+
*
|
9 |
+
* For the full copyright and license information, please view the LICENSE
|
10 |
+
* file that was distributed with this source code.
|
11 |
+
*/
|
12 |
|
13 |
namespace Composer;
|
14 |
|
15 |
use Composer\Autoload\ClassLoader;
|
16 |
use Composer\Semver\VersionParser;
|
17 |
|
18 |
+
/**
|
19 |
+
* This class is copied in every Composer installed project and available to all
|
20 |
+
*
|
21 |
+
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
22 |
+
*
|
23 |
+
* To require it's presence, you can require `composer-runtime-api ^2.0`
|
24 |
+
*/
|
25 |
class InstalledVersions
|
26 |
{
|
27 |
+
private static $installed;
|
28 |
+
private static $canGetVendors;
|
29 |
+
private static $installedByVendor = array();
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Returns a list of all package names which are present, either by being installed, replaced or provided
|
33 |
+
*
|
34 |
+
* @return string[]
|
35 |
+
* @psalm-return list<string>
|
36 |
+
*/
|
37 |
+
public static function getInstalledPackages()
|
38 |
+
{
|
39 |
+
$packages = array();
|
40 |
+
foreach (self::getInstalled() as $installed) {
|
41 |
+
$packages[] = array_keys($installed['versions']);
|
42 |
+
}
|
43 |
+
|
44 |
+
if (1 === \count($packages)) {
|
45 |
+
return $packages[0];
|
46 |
+
}
|
47 |
+
|
48 |
+
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Returns a list of all package names with a specific type e.g. 'library'
|
53 |
+
*
|
54 |
+
* @param string $type
|
55 |
+
* @return string[]
|
56 |
+
* @psalm-return list<string>
|
57 |
+
*/
|
58 |
+
public static function getInstalledPackagesByType($type)
|
59 |
+
{
|
60 |
+
$packagesByType = array();
|
61 |
+
|
62 |
+
foreach (self::getInstalled() as $installed) {
|
63 |
+
foreach ($installed['versions'] as $name => $package) {
|
64 |
+
if (isset($package['type']) && $package['type'] === $type) {
|
65 |
+
$packagesByType[] = $name;
|
66 |
+
}
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
return $packagesByType;
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Checks whether the given package is installed
|
75 |
+
*
|
76 |
+
* This also returns true if the package name is provided or replaced by another package
|
77 |
+
*
|
78 |
+
* @param string $packageName
|
79 |
+
* @param bool $includeDevRequirements
|
80 |
+
* @return bool
|
81 |
+
*/
|
82 |
+
public static function isInstalled($packageName, $includeDevRequirements = true)
|
83 |
+
{
|
84 |
+
foreach (self::getInstalled() as $installed) {
|
85 |
+
if (isset($installed['versions'][$packageName])) {
|
86 |
+
return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
|
87 |
+
}
|
88 |
+
}
|
89 |
+
|
90 |
+
return false;
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Checks whether the given package satisfies a version constraint
|
95 |
+
*
|
96 |
+
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
|
97 |
+
*
|
98 |
+
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
|
99 |
+
*
|
100 |
+
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
|
101 |
+
* @param string $packageName
|
102 |
+
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
|
103 |
+
* @return bool
|
104 |
+
*/
|
105 |
+
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
106 |
+
{
|
107 |
+
$constraint = $parser->parseConstraints($constraint);
|
108 |
+
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
109 |
+
|
110 |
+
return $provided->matches($constraint);
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Returns a version constraint representing all the range(s) which are installed for a given package
|
115 |
+
*
|
116 |
+
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
|
117 |
+
* whether a given version of a package is installed, and not just whether it exists
|
118 |
+
*
|
119 |
+
* @param string $packageName
|
120 |
+
* @return string Version constraint usable with composer/semver
|
121 |
+
*/
|
122 |
+
public static function getVersionRanges($packageName)
|
123 |
+
{
|
124 |
+
foreach (self::getInstalled() as $installed) {
|
125 |
+
if (!isset($installed['versions'][$packageName])) {
|
126 |
+
continue;
|
127 |
+
}
|
128 |
+
|
129 |
+
$ranges = array();
|
130 |
+
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
131 |
+
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
132 |
+
}
|
133 |
+
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
134 |
+
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
135 |
+
}
|
136 |
+
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
137 |
+
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
138 |
+
}
|
139 |
+
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
140 |
+
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
141 |
+
}
|
142 |
+
|
143 |
+
return implode(' || ', $ranges);
|
144 |
+
}
|
145 |
+
|
146 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
147 |
+
}
|
148 |
+
|
149 |
+
/**
|
150 |
+
* @param string $packageName
|
151 |
+
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
152 |
+
*/
|
153 |
+
public static function getVersion($packageName)
|
154 |
+
{
|
155 |
+
foreach (self::getInstalled() as $installed) {
|
156 |
+
if (!isset($installed['versions'][$packageName])) {
|
157 |
+
continue;
|
158 |
+
}
|
159 |
+
|
160 |
+
if (!isset($installed['versions'][$packageName]['version'])) {
|
161 |
+
return null;
|
162 |
+
}
|
163 |
+
|
164 |
+
return $installed['versions'][$packageName]['version'];
|
165 |
+
}
|
166 |
+
|
167 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
168 |
+
}
|
169 |
+
|
170 |
+
/**
|
171 |
+
* @param string $packageName
|
172 |
+
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
173 |
+
*/
|
174 |
+
public static function getPrettyVersion($packageName)
|
175 |
+
{
|
176 |
+
foreach (self::getInstalled() as $installed) {
|
177 |
+
if (!isset($installed['versions'][$packageName])) {
|
178 |
+
continue;
|
179 |
+
}
|
180 |
+
|
181 |
+
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
182 |
+
return null;
|
183 |
+
}
|
184 |
+
|
185 |
+
return $installed['versions'][$packageName]['pretty_version'];
|
186 |
+
}
|
187 |
+
|
188 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
189 |
+
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* @param string $packageName
|
193 |
+
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
|
194 |
+
*/
|
195 |
+
public static function getReference($packageName)
|
196 |
+
{
|
197 |
+
foreach (self::getInstalled() as $installed) {
|
198 |
+
if (!isset($installed['versions'][$packageName])) {
|
199 |
+
continue;
|
200 |
+
}
|
201 |
+
|
202 |
+
if (!isset($installed['versions'][$packageName]['reference'])) {
|
203 |
+
return null;
|
204 |
+
}
|
205 |
+
|
206 |
+
return $installed['versions'][$packageName]['reference'];
|
207 |
+
}
|
208 |
+
|
209 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
210 |
+
}
|
211 |
+
|
212 |
+
/**
|
213 |
+
* @param string $packageName
|
214 |
+
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
|
215 |
+
*/
|
216 |
+
public static function getInstallPath($packageName)
|
217 |
+
{
|
218 |
+
foreach (self::getInstalled() as $installed) {
|
219 |
+
if (!isset($installed['versions'][$packageName])) {
|
220 |
+
continue;
|
221 |
+
}
|
222 |
+
|
223 |
+
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
|
224 |
+
}
|
225 |
+
|
226 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
227 |
+
}
|
228 |
+
|
229 |
+
/**
|
230 |
+
* @return array
|
231 |
+
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}
|
232 |
+
*/
|
233 |
+
public static function getRootPackage()
|
234 |
+
{
|
235 |
+
$installed = self::getInstalled();
|
236 |
+
|
237 |
+
return $installed[0]['root'];
|
238 |
+
}
|
239 |
+
|
240 |
+
/**
|
241 |
+
* Returns the raw installed.php data for custom implementations
|
242 |
+
*
|
243 |
+
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
244 |
+
* @return array[]
|
245 |
+
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}
|
246 |
+
*/
|
247 |
+
public static function getRawData()
|
248 |
+
{
|
249 |
+
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
|
250 |
+
|
251 |
+
if (null === self::$installed) {
|
252 |
+
// only require the installed.php file if this file is loaded from its dumped location,
|
253 |
+
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
254 |
+
if (substr(__DIR__, -8, 1) !== 'C') {
|
255 |
+
self::$installed = include __DIR__ . '/installed.php';
|
256 |
+
} else {
|
257 |
+
self::$installed = array();
|
258 |
+
}
|
259 |
+
}
|
260 |
+
|
261 |
+
return self::$installed;
|
262 |
+
}
|
263 |
+
|
264 |
+
/**
|
265 |
+
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
266 |
+
*
|
267 |
+
* @return array[]
|
268 |
+
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
|
269 |
+
*/
|
270 |
+
public static function getAllRawData()
|
271 |
+
{
|
272 |
+
return self::getInstalled();
|
273 |
+
}
|
274 |
+
|
275 |
+
/**
|
276 |
+
* Lets you reload the static array from another file
|
277 |
+
*
|
278 |
+
* This is only useful for complex integrations in which a project needs to use
|
279 |
+
* this class but then also needs to execute another project's autoloader in process,
|
280 |
+
* and wants to ensure both projects have access to their version of installed.php.
|
281 |
+
*
|
282 |
+
* A typical case would be PHPUnit, where it would need to make sure it reads all
|
283 |
+
* the data it needs from this class, then call reload() with
|
284 |
+
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
|
285 |
+
* the project in which it runs can then also use this class safely, without
|
286 |
+
* interference between PHPUnit's dependencies and the project's dependencies.
|
287 |
+
*
|
288 |
+
* @param array[] $data A vendor/composer/installed.php data set
|
289 |
+
* @return void
|
290 |
+
*
|
291 |
+
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} $data
|
292 |
+
*/
|
293 |
+
public static function reload($data)
|
294 |
+
{
|
295 |
+
self::$installed = $data;
|
296 |
+
self::$installedByVendor = array();
|
297 |
+
}
|
298 |
+
|
299 |
+
/**
|
300 |
+
* @return array[]
|
301 |
+
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
|
302 |
+
*/
|
303 |
+
private static function getInstalled()
|
304 |
+
{
|
305 |
+
if (null === self::$canGetVendors) {
|
306 |
+
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
307 |
+
}
|
308 |
+
|
309 |
+
$installed = array();
|
310 |
+
|
311 |
+
if (self::$canGetVendors) {
|
312 |
+
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
313 |
+
if (isset(self::$installedByVendor[$vendorDir])) {
|
314 |
+
$installed[] = self::$installedByVendor[$vendorDir];
|
315 |
+
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
316 |
+
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
|
317 |
+
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
318 |
+
self::$installed = $installed[count($installed) - 1];
|
319 |
+
}
|
320 |
+
}
|
321 |
+
}
|
322 |
+
}
|
323 |
+
|
324 |
+
if (null === self::$installed) {
|
325 |
+
// only require the installed.php file if this file is loaded from its dumped location,
|
326 |
+
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
327 |
+
if (substr(__DIR__, -8, 1) !== 'C') {
|
328 |
+
self::$installed = require __DIR__ . '/installed.php';
|
329 |
+
} else {
|
330 |
+
self::$installed = array();
|
331 |
+
}
|
332 |
+
}
|
333 |
+
$installed[] = self::$installed;
|
334 |
+
|
335 |
+
return $installed;
|
336 |
+
}
|
337 |
}
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -22,15 +22,15 @@ class ComposerAutoloaderInitf94beb1a47a6e1ee13e61293c8c79e82
|
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
-
spl_autoload_register(array('
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
27 |
-
spl_autoload_unregister(array('
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
-
call_user_func(\Composer\Autoload\
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
@@ -51,19 +51,19 @@ class ComposerAutoloaderInitf94beb1a47a6e1ee13e61293c8c79e82
|
|
51 |
$loader->register(true);
|
52 |
|
53 |
if ($useStaticLoader) {
|
54 |
-
$includeFiles = Composer\Autoload\
|
55 |
} else {
|
56 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
57 |
}
|
58 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
59 |
-
|
60 |
}
|
61 |
|
62 |
return $loader;
|
63 |
}
|
64 |
}
|
65 |
|
66 |
-
function
|
67 |
{
|
68 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
69 |
require $file;
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit199b618daa374bf13d1ae645672cdf7c
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
+
spl_autoload_register(array('ComposerAutoloaderInit199b618daa374bf13d1ae645672cdf7c', 'loadClassLoader'), true, true);
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
27 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit199b618daa374bf13d1ae645672cdf7c', 'loadClassLoader'));
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit199b618daa374bf13d1ae645672cdf7c::getInitializer($loader));
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
51 |
$loader->register(true);
|
52 |
|
53 |
if ($useStaticLoader) {
|
54 |
+
$includeFiles = Composer\Autoload\ComposerStaticInit199b618daa374bf13d1ae645672cdf7c::$files;
|
55 |
} else {
|
56 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
57 |
}
|
58 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
59 |
+
composerRequire199b618daa374bf13d1ae645672cdf7c($fileIdentifier, $file);
|
60 |
}
|
61 |
|
62 |
return $loader;
|
63 |
}
|
64 |
}
|
65 |
|
66 |
+
function composerRequire199b618daa374bf13d1ae645672cdf7c($fileIdentifier, $file)
|
67 |
{
|
68 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
69 |
require $file;
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'3df8ee254224091c21b9aebb792d2f8b' => __DIR__ . '/..' . '/codeinwp/themeisle-sdk/load.php',
|
@@ -17,7 +17,7 @@ class ComposerStaticInitf94beb1a47a6e1ee13e61293c8c79e82
|
|
17 |
public static function getInitializer(ClassLoader $loader)
|
18 |
{
|
19 |
return \Closure::bind(function () use ($loader) {
|
20 |
-
$loader->classMap =
|
21 |
|
22 |
}, null, ClassLoader::class);
|
23 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInit199b618daa374bf13d1ae645672cdf7c
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'3df8ee254224091c21b9aebb792d2f8b' => __DIR__ . '/..' . '/codeinwp/themeisle-sdk/load.php',
|
17 |
public static function getInitializer(ClassLoader $loader)
|
18 |
{
|
19 |
return \Closure::bind(function () use ($loader) {
|
20 |
+
$loader->classMap = ComposerStaticInit199b618daa374bf13d1ae645672cdf7c::$classMap;
|
21 |
|
22 |
}, null, ClassLoader::class);
|
23 |
}
|
vendor/composer/installed.php
CHANGED
@@ -1,34 +1,34 @@
|
|
1 |
-
<?php return array
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
8 |
),
|
9 |
-
'
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
),
|
23 |
-
'codeinwp/themeisle-sdk' =>
|
24 |
-
array (
|
25 |
-
'pretty_version' => 'dev-master',
|
26 |
-
'version' => 'dev-master',
|
27 |
-
'aliases' =>
|
28 |
-
array (
|
29 |
-
0 => '9999999-dev',
|
30 |
-
),
|
31 |
-
'reference' => 'aeef3f159c1b35451d87672b6984ccde36c0d21d',
|
32 |
-
),
|
33 |
-
),
|
34 |
);
|
1 |
+
<?php return array(
|
2 |
+
'root' => array(
|
3 |
+
'pretty_version' => 'v3.7.1',
|
4 |
+
'version' => '3.7.1.0',
|
5 |
+
'type' => 'wordpress-plugin',
|
6 |
+
'install_path' => __DIR__ . '/../../',
|
7 |
+
'aliases' => array(),
|
8 |
+
'reference' => '49c888998a13cfb627e50f5ec1e8d10715398fa8',
|
9 |
+
'name' => 'codeinwp/feedzy-rss-feeds',
|
10 |
+
'dev' => false,
|
11 |
),
|
12 |
+
'versions' => array(
|
13 |
+
'codeinwp/feedzy-rss-feeds' => array(
|
14 |
+
'pretty_version' => 'v3.7.1',
|
15 |
+
'version' => '3.7.1.0',
|
16 |
+
'type' => 'wordpress-plugin',
|
17 |
+
'install_path' => __DIR__ . '/../../',
|
18 |
+
'aliases' => array(),
|
19 |
+
'reference' => '49c888998a13cfb627e50f5ec1e8d10715398fa8',
|
20 |
+
'dev_requirement' => false,
|
21 |
+
),
|
22 |
+
'codeinwp/themeisle-sdk' => array(
|
23 |
+
'pretty_version' => 'dev-master',
|
24 |
+
'version' => 'dev-master',
|
25 |
+
'type' => 'library',
|
26 |
+
'install_path' => __DIR__ . '/../codeinwp/themeisle-sdk',
|
27 |
+
'aliases' => array(
|
28 |
+
0 => '9999999-dev',
|
29 |
+
),
|
30 |
+
'reference' => 'aeef3f159c1b35451d87672b6984ccde36c0d21d',
|
31 |
+
'dev_requirement' => false,
|
32 |
+
),
|
33 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
);
|